projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
36f523a
)
drm/amdgpu: add amdgpu_get_sdma_instance helper function
author
Jammy Zhou
<
[email protected]
>
Tue, 1 Sep 2015 04:56:17 +0000
(12:56 +0800)
committer
Alex Deucher
<
[email protected]
>
Wed, 2 Sep 2015 16:23:58 +0000
(12:23 -0400)
This function is added to map the ring to sdma instance
Signed-off-by: Jammy Zhou <
[email protected]
>
Reviewed-by: Alex Deucher <
[email protected]
>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
patch
|
blob
|
history
diff --git
a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 0be51f998ff99689f451e2757613af234b316471..057e7ef5c0d0e083fab92a862f37c1750db18bcc 100644
(file)
--- 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.
*/