aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch')
-rw-r--r--common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch68
1 files changed, 68 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch b/common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch
new file mode 100644
index 00000000..07341080
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0443-drm-amdgpu-support-cond-exec.patch
@@ -0,0 +1,68 @@
+From f616a670bf0b24301261c88f8480f62be6a6c523 Mon Sep 17 00:00:00 2001
+From: Monk Liu <monk.liu@amd.com>
+Date: Thu, 14 Jan 2016 18:08:16 +0800
+Subject: [PATCH 0443/1110] drm/amdgpu: support cond exec
+MIME-Version: 1.0
+Content-Type: text/plain; charset=UTF-8
+Content-Transfer-Encoding: 8bit
+
+Signed-off-by: Monk Liu <monk.liu@amd.com>
+Reviewed-by: Christian König <christian.koenig@amd.com>
+Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 3 +++
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c | 3 +++
+ drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c | 9 +++++++++
+ 3 files changed, 15 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index ce1638c..c0b7731 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -787,6 +787,9 @@ struct amdgpu_ring {
+ struct amdgpu_ctx *current_ctx;
+ enum amdgpu_ring_type type;
+ char name[16];
++ unsigned cond_exe_offs;
++ u64 cond_exe_gpu_addr;
++ volatile u32 *cond_exe_cpu_addr;
+ };
+
+ /*
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+index 58b051c..52b63e3 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ib.c
+@@ -159,6 +159,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
+ amdgpu_ring_emit_hdp_flush(ring);
+ }
+
++ /* always set cond_exec_polling to CONTINUE */
++ *ring->cond_exe_cpu_addr = 1;
++
+ old_ctx = ring->current_ctx;
+ for (i = 0; i < num_ibs; ++i) {
+ ib = &ibs[i];
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+index 972eed2..dd79243 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ring.c
+@@ -267,6 +267,15 @@ int amdgpu_ring_init(struct amdgpu_device *adev, struct amdgpu_ring *ring,
+ }
+ ring->next_rptr_gpu_addr = adev->wb.gpu_addr + (ring->next_rptr_offs * 4);
+ ring->next_rptr_cpu_addr = &adev->wb.wb[ring->next_rptr_offs];
++
++ r = amdgpu_wb_get(adev, &ring->cond_exe_offs);
++ if (r) {
++ dev_err(adev->dev, "(%d) ring cond_exec_polling wb alloc failed\n", r);
++ return r;
++ }
++ ring->cond_exe_gpu_addr = adev->wb.gpu_addr + (ring->cond_exe_offs * 4);
++ ring->cond_exe_cpu_addr = &adev->wb.wb[ring->cond_exe_offs];
++
+ spin_lock_init(&ring->fence_lock);
+ r = amdgpu_fence_driver_start_ring(ring, irq_src, irq_type);
+ if (r) {
+--
+2.7.4
+