aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch')
-rw-r--r--common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch33
1 files changed, 33 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch b/common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch
new file mode 100644
index 00000000..8ae339c6
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0356-drm-amdgpu-fix-signed-overrun-in-amdgpu_ctx_get_fenc.patch
@@ -0,0 +1,33 @@
+From cf6f1d39496e9b5dd62953f8dca9f995d80ab4ff Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Christian=20K=C3=B6nig?= <christian.koenig@amd.com>
+Date: Sat, 18 Jul 2015 19:20:05 +0200
+Subject: [PATCH 0356/1050] drm/amdgpu: fix signed overrun in
+ amdgpu_ctx_get_fence
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+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>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ctx.c
+index 859a484..144edc9 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;
+ }
+--
+1.9.1
+