drm/radeon/kms: add info query for max pipes
authorTom Stellard <tstellar@gmail.com>
Tue, 20 Mar 2012 21:17:55 +0000 (17:17 -0400)
committerDave Airlie <airlied@redhat.com>
Wed, 21 Mar 2012 06:55:49 +0000 (06:55 +0000)
The maximum number of pipes is needed by the user space compute
driver to calculate the number of wavefronts per thread group.

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/radeon/radeon_drv.c
drivers/gpu/drm/radeon/radeon_kms.c
include/drm/radeon_drm.h

index 498d21d50ba3222b65c38e5315881541ed146282..ef7bb3f6ecae9e0c5e7c647947122b9364c93f78 100644 (file)
  *   2.12.0 - RADEON_CS_KEEP_TILING_FLAGS
  *   2.13.0 - virtual memory support, streamout
  *   2.14.0 - add evergreen tiling informations
+ *   2.15.0 - add max_pipes query
  */
 #define KMS_DRIVER_MAJOR       2
-#define KMS_DRIVER_MINOR       14
+#define KMS_DRIVER_MINOR       15
 #define KMS_DRIVER_PATCHLEVEL  0
 int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags);
 int radeon_driver_unload_kms(struct drm_device *dev);
index 1986ebae1ef2f55b65f85b5685229ce3cb020666..72d70eb04a174668a19e248ea6b85f0bccd373b2 100644 (file)
@@ -264,6 +264,19 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        return -EINVAL;
                value = RADEON_IB_VM_MAX_SIZE;
                break;
+       case RADEON_INFO_MAX_PIPES:
+               if (rdev->family >= CHIP_CAYMAN)
+                       value = rdev->config.cayman.max_pipes_per_simd;
+               else if (rdev->family >= CHIP_CEDAR)
+                       value = rdev->config.evergreen.max_pipes;
+               else if (rdev->family >= CHIP_RV770)
+                       value = rdev->config.rv770.max_pipes;
+               else if (rdev->family >= CHIP_R600)
+                       value = rdev->config.r600.max_pipes;
+               else {
+                       return -EINVAL;
+               }
+               break;
        default:
                DRM_DEBUG_KMS("Invalid request %d\n", info->request);
                return -EINVAL;
index cb2f0c362a13dd8f5a7998316268b9af75bfa267..6cde931d8e68809e445dff972fda04cd756994eb 100644 (file)
@@ -962,6 +962,8 @@ struct drm_radeon_cs {
 #define RADEON_INFO_VA_START           0x0e
 /* maximum size of ib using the virtual memory cs */
 #define RADEON_INFO_IB_VM_MAX_SIZE     0x0f
+/* max pipes - needed for compute shaders */
+#define RADEON_INFO_MAX_PIPES          0x10
 
 struct drm_radeon_info {
        uint32_t                request;
This page took 0.060545 seconds and 5 git commands to generate.