diff options
| author | Christian König <christian.koenig@amd.com> | 2019-01-10 16:48:23 +0100 | 
|---|---|---|
| committer | Alex Deucher <alexander.deucher@amd.com> | 2019-03-19 15:36:58 -0500 | 
| commit | 56753e73fb2ed232278eb69445cb72c6f54391c2 (patch) | |
| tree | 14fc98eeefe51b252a2c5171d87e2ba3ee54ae5d /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | |
| parent | 3119e7f43be172779019f282aed115b2ec0864fa (diff) | |
drm/amdgpu: wait for VM to become idle during flush
Make sure that not only the entities are flush, but that
we also wait for the HW to finish all processing.
Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Chunming Zhou <david1.zhou@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
| -rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 6 | 
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c index b7289f709644..a28a3d722ba2 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c @@ -558,13 +558,12 @@ void amdgpu_ctx_mgr_init(struct amdgpu_ctx_mgr *mgr)  	idr_init(&mgr->ctx_handles);  } -void amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr) +long amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr, long timeout)  {  	unsigned num_entities = amdgput_ctx_total_num_entities();  	struct amdgpu_ctx *ctx;  	struct idr *idp;  	uint32_t id, i; -	long max_wait = MAX_WAIT_SCHED_ENTITY_Q_EMPTY;  	idp = &mgr->ctx_handles; @@ -574,10 +573,11 @@ void amdgpu_ctx_mgr_entity_flush(struct amdgpu_ctx_mgr *mgr)  			struct drm_sched_entity *entity;  			entity = &ctx->entities[0][i].entity; -			max_wait = drm_sched_entity_flush(entity, max_wait); +			timeout = drm_sched_entity_flush(entity, timeout);  		}  	}  	mutex_unlock(&mgr->lock); +	return timeout;  }  void amdgpu_ctx_mgr_entity_fini(struct amdgpu_ctx_mgr *mgr)  | 
