aboutsummaryrefslogtreecommitdiffstats
path: root/common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch
diff options
context:
space:
mode:
Diffstat (limited to 'common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch')
-rw-r--r--common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch43
1 files changed, 43 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch b/common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch
new file mode 100644
index 00000000..c961a5ac
--- /dev/null
+++ b/common/recipes-kernel/linux/files/0521-drm-amdgpu-add-amdgpu_get_sdma_instance-helper-funct.patch
@@ -0,0 +1,43 @@
+From 4b2f7e2ca94d58ea16e411a1f717392b91f7730a Mon Sep 17 00:00:00 2001
+From: Jammy Zhou <Jammy.Zhou@amd.com>
+Date: Tue, 1 Sep 2015 12:56:17 +0800
+Subject: [PATCH 0521/1050] drm/amdgpu: add amdgpu_get_sdma_instance helper
+ function
+
+This function is added to map the ring to sdma instance
+
+Signed-off-by: Jammy Zhou <Jammy.Zhou@amd.com>
+Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
+---
+ drivers/gpu/drm/amd/amdgpu/amdgpu.h | 15 +++++++++++++++
+ 1 file changed, 15 insertions(+)
+
+diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+index 0be51f99..057e7ef 100644
+--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+@@ -2199,6 +2199,21 @@ static inline void amdgpu_ring_write(struct amdgpu_ring *ring, uint32_t v)
+ ring->ring_free_dw--;
+ }
+
++static inline struct amdgpu_sdma * amdgpu_get_sdma_instance(struct amdgpu_ring *ring)
++{
++ struct amdgpu_device *adev = ring->adev;
++ int i;
++
++ for (i = 0; i < AMDGPU_MAX_SDMA_INSTANCES; i++)
++ if (&adev->sdma[i].ring == ring)
++ break;
++
++ if (i < AMDGPU_MAX_SDMA_INSTANCES)
++ return &adev->sdma[i];
++ else
++ return NULL;
++}
++
+ /*
+ * ASICs macro.
+ */
+--
+1.9.1
+