]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/radeon: enable the async DMA rings in the CS ioctl
authorAlex Deucher <alexander.deucher@amd.com>
Thu, 13 Dec 2012 17:27:28 +0000 (12:27 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 14 Dec 2012 15:45:26 +0000 (10:45 -0500)
This enables the functionality added in the previous
patches.  Userspace acceleration drivers can use the
CS ioctl to submit command buffers to the async DMA
rings.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/radeon_cs.c
include/uapi/drm/radeon_drm.h

index 1b32a5ab972d75e03617d767ed68a18de52686b7..396baba0141a9c2abefbd5e8782a83e5634c4c96 100644 (file)
@@ -112,6 +112,18 @@ static int radeon_cs_get_ring(struct radeon_cs_parser *p, u32 ring, s32 priority
                } else
                        p->ring = RADEON_RING_TYPE_GFX_INDEX;
                break;
+       case RADEON_CS_RING_DMA:
+               if (p->rdev->family >= CHIP_CAYMAN) {
+                       if (p->priority > 0)
+                               p->ring = R600_RING_TYPE_DMA_INDEX;
+                       else
+                               p->ring = CAYMAN_RING_TYPE_DMA1_INDEX;
+               } else if (p->rdev->family >= CHIP_R600) {
+                       p->ring = R600_RING_TYPE_DMA_INDEX;
+               } else {
+                       return -EINVAL;
+               }
+               break;
        }
        return 0;
 }
index 5645a878faec7c8df393276d237b7420b126eb79..eeda91774c8ac24f9dd95b0d2a45e61ab0da622a 100644 (file)
@@ -917,6 +917,7 @@ struct drm_radeon_gem_va {
 /* The second dword of RADEON_CHUNK_ID_FLAGS is a uint32 that sets the ring type */
 #define RADEON_CS_RING_GFX          0
 #define RADEON_CS_RING_COMPUTE      1
+#define RADEON_CS_RING_DMA          2
 /* The third dword of RADEON_CHUNK_ID_FLAGS is a sint32 that sets the priority */
 /* 0 = normal, + = higher priority, - = lower priority */