From 72efa7ebdea084b96f25021d0ba9c29074c2906f Mon Sep 17 00:00:00 2001 From: Jammy Zhou Date: Fri, 8 May 2015 22:18:47 +0800 Subject: drm/amdgpu: check context id for context switching (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit check the filp is not robust, and sometimes different contexts may have same filp value. v2: check both filp and ctx_id Signed-off-by: Jammy Zhou Reviewed-by: Christian König --- drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c') diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c index 86b93245bf9d..1035e443700f 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c @@ -642,8 +642,10 @@ static int amdgpu_cs_ib_fill(struct amdgpu_device *adev, ib->is_const_ib = true; if (chunk_ib->flags & AMDGPU_IB_FLAG_GDS) ib->gds_needed = true; - if (ib->ring->current_filp != parser->filp) { + if ((ib->ring->current_filp != parser->filp) || + (ib->ring->current_ctx != parser->ctx_id)) { ib->ring->need_ctx_switch = true; + ib->ring->current_ctx = parser->ctx_id; ib->ring->current_filp = parser->filp; } -- cgit v1.2.3-70-g09d2