summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
diff options
context:
space:
mode:
authorChristian König <christian.koenig@amd.com>2015-07-18 19:20:05 +0200
committerAlex Deucher <alexander.deucher@amd.com>2015-08-17 16:50:15 -0400
commitcf6f1d39496e9b5dd62953f8dca9f995d80ab4ff (patch)
tree2e5f5e548bac01b290c8d3bcd6c539875d401e7e /drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
parentcdecb65b4eaba1d45abbfe34b724664f65623531 (diff)
downloadtalos-op-linux-cf6f1d39496e9b5dd62953f8dca9f995d80ab4ff.tar.gz
talos-op-linux-cf6f1d39496e9b5dd62953f8dca9f995d80ab4ff.zip
drm/amdgpu: fix signed overrun in amdgpu_ctx_get_fence
Otherwise the first 16 fences of a context will always signal immediately. Signed-off-by: Christian König <christian.koenig@amd.com> Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c')
-rw-r--r--drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
index 859a4841075e..144edc97c6fe 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
@@ -226,7 +226,7 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
return ERR_PTR(-EINVAL);
}
- if (seq < cring->sequence - AMDGPU_CTX_MAX_CS_PENDING) {
+ if (seq + AMDGPU_CTX_MAX_CS_PENDING < cring->sequence) {
spin_unlock(&ctx->ring_lock);
return NULL;
}
OpenPOWER on IntegriCloud