diff options
| author | Dave Airlie <airlied@redhat.com> | 2022-04-22 06:43:52 +1000 | 
|---|---|---|
| committer | Dave Airlie <airlied@redhat.com> | 2022-04-22 11:15:30 +1000 | 
| commit | 19df0cfa258cd42f7f106f6085f1e625f26283db (patch) | |
| tree | be212959c494f95279fd160ba04e9b498d60be8d /drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | |
| parent | c54b39a565227538c52ead2349eb17d54aadd6f7 (diff) | |
| parent | 40d8d4bd06720aed6c1125bab7296c57de4f1157 (diff) | |
Merge tag 'drm-misc-next-2022-04-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-next
drm-misc-next for 5.19-rc1
UAPI Changes:
Cross-subsystem Changes:
  - of: Create a platform_device for offb
Core Changes:
  - edid: block read refactoring
  - ttm: Add common debugfs code for resource managers
Driver Changes:
  - bridges:
    - adv7611: Enable DRM_BRIDGE_OP_HPD if there's an interrupt
    - anx7625: Fill ELD if no monitor is connected
    - dw_hdmi: Add General Parallel Audio support
    - icn6211: Add data-lanes DT property
    - new driver: Lontium LT9211
  - nouveau: make some structures static
  - tidss: Reset DISPC on startup
  - solomon: SPI Support and DT bindings improvements
Signed-off-by: Dave Airlie <airlied@redhat.com>
From: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/20220421065948.2pyp3j7acxtl6pz5@houat
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 55 | 
1 files changed, 7 insertions, 48 deletions
| diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index e85e347eb670..8de283997769 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -55,8 +55,8 @@ static int amdgpu_cs_user_fence_chunk(struct amdgpu_cs_parser *p,  	bo = amdgpu_bo_ref(gem_to_amdgpu_bo(gobj));  	p->uf_entry.priority = 0;  	p->uf_entry.tv.bo = &bo->tbo; -	/* One for TTM and one for the CS job */ -	p->uf_entry.tv.num_shared = 2; +	/* One for TTM and two for the CS job */ +	p->uf_entry.tv.num_shared = 3;  	drm_gem_object_put(gobj); @@ -574,14 +574,6 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,  		struct amdgpu_bo *bo = ttm_to_amdgpu_bo(e->tv.bo);  		e->bo_va = amdgpu_vm_bo_find(vm, bo); - -		if (bo->tbo.base.dma_buf && !amdgpu_bo_explicit_sync(bo)) { -			e->chain = dma_fence_chain_alloc(); -			if (!e->chain) { -				r = -ENOMEM; -				goto error_validate; -			} -		}  	}  	/* Move fence waiting after getting reservation lock of @@ -642,13 +634,8 @@ static int amdgpu_cs_parser_bos(struct amdgpu_cs_parser *p,  	}  error_validate: -	if (r) { -		amdgpu_bo_list_for_each_entry(e, p->bo_list) { -			dma_fence_chain_free(e->chain); -			e->chain = NULL; -		} +	if (r)  		ttm_eu_backoff_reservation(&p->ticket, &p->validated); -	}  out:  	return r;  } @@ -688,17 +675,9 @@ static void amdgpu_cs_parser_fini(struct amdgpu_cs_parser *parser, int error,  {  	unsigned i; -	if (error && backoff) { -		struct amdgpu_bo_list_entry *e; - -		amdgpu_bo_list_for_each_entry(e, parser->bo_list) { -			dma_fence_chain_free(e->chain); -			e->chain = NULL; -		} - +	if (error && backoff)  		ttm_eu_backoff_reservation(&parser->ticket,  					   &parser->validated); -	}  	for (i = 0; i < parser->num_post_deps; i++) {  		drm_syncobj_put(parser->post_deps[i].syncobj); @@ -1272,29 +1251,9 @@ static int amdgpu_cs_submit(struct amdgpu_cs_parser *p,  	amdgpu_vm_move_to_lru_tail(p->adev, &fpriv->vm); -	amdgpu_bo_list_for_each_entry(e, p->bo_list) { -		struct dma_resv *resv = e->tv.bo->base.resv; -		struct dma_fence_chain *chain = e->chain; -		struct dma_resv_iter cursor; -		struct dma_fence *fence; - -		if (!chain) -			continue; - -		/* -		 * Temporary workaround dma_resv shortcommings by wrapping up -		 * the submission in a dma_fence_chain and add it as exclusive -		 * fence. -		 * -		 * TODO: Remove together with dma_resv rework. -		 */ -		dma_resv_for_each_fence(&cursor, resv, false, fence) { -			break; -		} -		dma_fence_chain_init(chain, fence, dma_fence_get(p->fence), 1); -		rcu_assign_pointer(resv->fence_excl, &chain->base); -		e->chain = NULL; -	} +	/* Make sure all BOs are remembered as writers */ +	amdgpu_bo_list_for_each_entry(e, p->bo_list) +		e->tv.num_shared = 0;  	ttm_eu_fence_buffer_objects(&p->ticket, &p->validated, p->fence);  	mutex_unlock(&p->adev->notifier_lock); | 
