aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch')
-rw-r--r--common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch59
1 files changed, 59 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch b/common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch
new file mode 100644
index 00000000..0875998b
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0197-drm-amdgpu-add-CE-preamble-flag-v3.patch
@@ -0,0 +1,59 @@
+From aa2bdb2476206c7de4473850039daa705230c27b Mon Sep 17 00:00:00 2001
+From: Jammy Zhou <Jammy.Zhou@amd.com>
+Date: Mon, 11 May 2015 23:49:34 +0800
+Subject: [PATCH 0197/1050] drm/amdgpu: add CE preamble flag v3
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+The CE preamble IB can be dropped for the same context
+
+v2: use the flags directly
+v3: remove 'CE' for potential preamble usage by other rings
+
+Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c | 7 +++++++
+ drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 7 +++++++
+ 2 files changed, 14 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+index 7428c43..cec46eb 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c
+@@ -2518,6 +2518,13 @@ static void gfx_v7_0_ring_emit_ib(struct amdgpu_ring *ring,
+ {
+ u32 header, control = 0;
+ u32 next_rptr = ring->wptr + 5;
++
++ /* drop the CE preamble IB for the same context */
++ if ((ring->type == AMDGPU_RING_TYPE_GFX) &&
++ (ib->flags & AMDGPU_IB_FLAG_PREAMBLE) &&
++ !ring->need_ctx_switch)
++ return;
++
+ if (ring->type == AMDGPU_RING_TYPE_COMPUTE)
+ control |= INDIRECT_BUFFER_VALID;
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+index 48de920..fc8c462 100644
+--- a/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
++++ b/drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c
+@@ -3647,6 +3647,13 @@ static void gfx_v8_0_ring_emit_ib(struct amdgpu_ring *ring,
+ {
+ u32 header, control = 0;
+ u32 next_rptr = ring->wptr + 5;
++
++ /* drop the CE preamble IB for the same context */
++ if ((ring->type == AMDGPU_RING_TYPE_GFX) &&
++ (ib->flags & AMDGPU_IB_FLAG_PREAMBLE) &&
++ !ring->need_ctx_switch)
++ return;
++
+ if (ring->type == AMDGPU_RING_TYPE_COMPUTE)
+ control |= INDIRECT_BUFFER_VALID;
+
+--
+1.9.1
+