mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-08 06:58:05 +02:00
winsys/amdgpu: revert invalid changes from CS functions
It may have been accidentally left in the code. If there is any doubt about this, then the reason is the same as accepting screen=NULL in context_create or any other function.
This commit is contained in:
parent
109af1b077
commit
1ccb3c79a8
2 changed files with 6 additions and 13 deletions
|
|
@ -254,8 +254,9 @@ amdgpu_cs_get_next_fence(struct radeon_cmdbuf *rcs)
|
|||
{
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
struct pipe_fence_handle *fence = NULL;
|
||||
assert(acs);
|
||||
|
||||
if (!acs || acs->noop)
|
||||
if (acs->noop)
|
||||
return NULL;
|
||||
|
||||
if (acs->next_fence) {
|
||||
|
|
@ -665,8 +666,6 @@ static unsigned amdgpu_cs_add_buffer(struct radeon_cmdbuf *rcs,
|
|||
*/
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
assert(acs);
|
||||
if (!acs)
|
||||
return 0;
|
||||
|
||||
struct amdgpu_cs_context *csc = amdgpu_csc_get_current(acs);
|
||||
struct amdgpu_winsys_bo *bo = (struct amdgpu_winsys_bo*)buf;
|
||||
|
|
@ -815,7 +814,7 @@ static void amdgpu_set_ib_size(struct radeon_cmdbuf *rcs, struct amdgpu_ib *ib)
|
|||
*ib->ptr_ib_size = rcs->current.cdw | S_3F3_CHAIN(1) | S_3F3_VALID(1);
|
||||
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
if (acs && !rcs->gang && acs->preamble_ib_bo)
|
||||
if (!rcs->gang && acs->preamble_ib_bo)
|
||||
*ib->ptr_ib_size |= S_3F3_PRE_ENA(1);
|
||||
} else {
|
||||
*ib->ptr_ib_size = rcs->current.cdw;
|
||||
|
|
@ -902,7 +901,7 @@ static enum amd_ip_type amdgpu_cs_get_ip_type(struct radeon_cmdbuf *rcs)
|
|||
{
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
assert(acs);
|
||||
return (rcs->gang || !acs) ? AMD_IP_COMPUTE : acs->ip_type;
|
||||
return rcs->gang ? AMD_IP_COMPUTE : acs->ip_type;
|
||||
}
|
||||
|
||||
static bool ip_uses_alt_fence(enum amd_ip_type ip_type)
|
||||
|
|
@ -1035,8 +1034,6 @@ amdgpu_cs_setup_preemption(struct radeon_cmdbuf *rcs, const uint32_t *preamble_i
|
|||
uint32_t *map;
|
||||
|
||||
assert(acs);
|
||||
if (!acs)
|
||||
return false;
|
||||
aws = acs->aws;
|
||||
size = align(preamble_num_dw * 4, aws->info.ip[AMD_IP_GFX].ib_alignment);
|
||||
|
||||
|
|
@ -2420,8 +2417,7 @@ static bool amdgpu_cs_create_compute_gang(struct radeon_cmdbuf *rcs)
|
|||
{
|
||||
struct amdgpu_cs *acs = amdgpu_cs(rcs);
|
||||
struct radeon_cmdbuf *gang;
|
||||
if (!acs)
|
||||
return false;
|
||||
assert(acs);
|
||||
|
||||
gang = CALLOC_STRUCT(radeon_cmdbuf);
|
||||
if (!gang)
|
||||
|
|
|
|||
|
|
@ -249,7 +249,6 @@ amdgpu_lookup_buffer_any_type(struct amdgpu_cs_context *csc, struct amdgpu_winsy
|
|||
static inline struct amdgpu_cs *
|
||||
amdgpu_cs(struct radeon_cmdbuf *rcs)
|
||||
{
|
||||
/* acs can be NULL if rcs wasn't initialized. */
|
||||
struct amdgpu_cs *acs = (struct amdgpu_cs*)rcs->priv;
|
||||
return acs;
|
||||
}
|
||||
|
|
@ -277,9 +276,7 @@ amdgpu_bo_is_referenced_by_cs_with_usage(struct amdgpu_cs *acs,
|
|||
unsigned usage)
|
||||
{
|
||||
struct amdgpu_cs_buffer *buffer;
|
||||
|
||||
if (!acs)
|
||||
return false;
|
||||
assert(acs);
|
||||
|
||||
buffer = amdgpu_lookup_buffer_any_type(amdgpu_csc_get_current(acs), bo);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue