diff options
Diffstat (limited to 'common/recipes-kernel/linux/linux-yocto-4.19.8/0747-drm-amdgpu-Add-helper-function-to-get-sdma-index.patch')
-rw-r--r-- | common/recipes-kernel/linux/linux-yocto-4.19.8/0747-drm-amdgpu-Add-helper-function-to-get-sdma-index.patch | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/common/recipes-kernel/linux/linux-yocto-4.19.8/0747-drm-amdgpu-Add-helper-function-to-get-sdma-index.patch b/common/recipes-kernel/linux/linux-yocto-4.19.8/0747-drm-amdgpu-Add-helper-function-to-get-sdma-index.patch new file mode 100644 index 00000000..7d9b2f95 --- /dev/null +++ b/common/recipes-kernel/linux/linux-yocto-4.19.8/0747-drm-amdgpu-Add-helper-function-to-get-sdma-index.patch @@ -0,0 +1,56 @@ +From 2191c4ea3c45993457baeff031477623ccf1f97e Mon Sep 17 00:00:00 2001 +From: Rex Zhu <Rex.Zhu@amd.com> +Date: Wed, 31 Oct 2018 19:49:27 +0800 +Subject: [PATCH 0747/2940] drm/amdgpu: Add helper function to get sdma index + +Get the sdma index from ring + +v2: refine function name + +Reviewed-by: Alex Deucher <alexander.deucher@amd.com> +Reviewed-by: Flora Cui <flora.cui@amd.com> +Signed-off-by: Rex Zhu <Rex.Zhu@amd.com> +Signed-off-by: Alex Deucher <alexander.deucher@amd.com> +--- + drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c | 16 ++++++++++++++++ + drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h | 2 +- + 2 files changed, 17 insertions(+), 1 deletion(-) + +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +index 0fb9907494bb..9464906c409a 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.c +@@ -40,3 +40,19 @@ struct amdgpu_sdma_instance * amdgpu_get_sdma_instance(struct amdgpu_ring *ring) + + return NULL; + } ++ ++int amdgpu_sdma_get_index_from_ring(struct amdgpu_ring *ring, uint32_t *index) ++{ ++ struct amdgpu_device *adev = ring->adev; ++ int i; ++ ++ for (i = 0; i < adev->sdma.num_instances; i++) { ++ if (ring == &adev->sdma.instance[i].ring || ++ ring == &adev->sdma.instance[i].page) { ++ *index = i; ++ return 0; ++ } ++ } ++ ++ return -EINVAL; ++} +diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h +index 479a2459e558..79e89e3bebc4 100644 +--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h ++++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_sdma.h +@@ -95,5 +95,5 @@ struct amdgpu_buffer_funcs { + + struct amdgpu_sdma_instance * + amdgpu_get_sdma_instance(struct amdgpu_ring *ring); +- ++int amdgpu_sdma_get_index_from_ring(struct amdgpu_ring *ring, uint32_t *index); + #endif +-- +2.17.1 + |