diff options
author | Tom Stellard <tstellar@gmail.com> | 2012-03-20 17:17:55 -0400 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2012-03-21 02:55:49 -0400 |
commit | 609c1e15a44c25f722fb93e18668da30179a172f (patch) | |
tree | 4fb8f7faf5d5bb5e7df05b4fd04d4028ba702152 | |
parent | da0df92b57311aa1b26a2a90599ed16e1e968b90 (diff) |
drm/radeon/kms: add info query for max pipes
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>
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_drv.c | 3 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/radeon_kms.c | 13 | ||||
-rw-r--r-- | include/drm/radeon_drm.h | 2 |
3 files changed, 17 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/radeon_drv.c b/drivers/gpu/drm/radeon/radeon_drv.c index 498d21d50ba3..ef7bb3f6ecae 100644 --- a/drivers/gpu/drm/radeon/radeon_drv.c +++ b/drivers/gpu/drm/radeon/radeon_drv.c | |||
@@ -56,9 +56,10 @@ | |||
56 | * 2.12.0 - RADEON_CS_KEEP_TILING_FLAGS | 56 | * 2.12.0 - RADEON_CS_KEEP_TILING_FLAGS |
57 | * 2.13.0 - virtual memory support, streamout | 57 | * 2.13.0 - virtual memory support, streamout |
58 | * 2.14.0 - add evergreen tiling informations | 58 | * 2.14.0 - add evergreen tiling informations |
59 | * 2.15.0 - add max_pipes query | ||
59 | */ | 60 | */ |
60 | #define KMS_DRIVER_MAJOR 2 | 61 | #define KMS_DRIVER_MAJOR 2 |
61 | #define KMS_DRIVER_MINOR 14 | 62 | #define KMS_DRIVER_MINOR 15 |
62 | #define KMS_DRIVER_PATCHLEVEL 0 | 63 | #define KMS_DRIVER_PATCHLEVEL 0 |
63 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); | 64 | int radeon_driver_load_kms(struct drm_device *dev, unsigned long flags); |
64 | int radeon_driver_unload_kms(struct drm_device *dev); | 65 | int radeon_driver_unload_kms(struct drm_device *dev); |
diff --git a/drivers/gpu/drm/radeon/radeon_kms.c b/drivers/gpu/drm/radeon/radeon_kms.c index 1986ebae1ef2..72d70eb04a17 100644 --- a/drivers/gpu/drm/radeon/radeon_kms.c +++ b/drivers/gpu/drm/radeon/radeon_kms.c | |||
@@ -264,6 +264,19 @@ int radeon_info_ioctl(struct drm_device *dev, void *data, struct drm_file *filp) | |||
264 | return -EINVAL; | 264 | return -EINVAL; |
265 | value = RADEON_IB_VM_MAX_SIZE; | 265 | value = RADEON_IB_VM_MAX_SIZE; |
266 | break; | 266 | break; |
267 | case RADEON_INFO_MAX_PIPES: | ||
268 | if (rdev->family >= CHIP_CAYMAN) | ||
269 | value = rdev->config.cayman.max_pipes_per_simd; | ||
270 | else if (rdev->family >= CHIP_CEDAR) | ||
271 | value = rdev->config.evergreen.max_pipes; | ||
272 | else if (rdev->family >= CHIP_RV770) | ||
273 | value = rdev->config.rv770.max_pipes; | ||
274 | else if (rdev->family >= CHIP_R600) | ||
275 | value = rdev->config.r600.max_pipes; | ||
276 | else { | ||
277 | return -EINVAL; | ||
278 | } | ||
279 | break; | ||
267 | default: | 280 | default: |
268 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); | 281 | DRM_DEBUG_KMS("Invalid request %d\n", info->request); |
269 | return -EINVAL; | 282 | return -EINVAL; |
diff --git a/include/drm/radeon_drm.h b/include/drm/radeon_drm.h index cb2f0c362a13..6cde931d8e68 100644 --- a/include/drm/radeon_drm.h +++ b/include/drm/radeon_drm.h | |||
@@ -962,6 +962,8 @@ struct drm_radeon_cs { | |||
962 | #define RADEON_INFO_VA_START 0x0e | 962 | #define RADEON_INFO_VA_START 0x0e |
963 | /* maximum size of ib using the virtual memory cs */ | 963 | /* maximum size of ib using the virtual memory cs */ |
964 | #define RADEON_INFO_IB_VM_MAX_SIZE 0x0f | 964 | #define RADEON_INFO_IB_VM_MAX_SIZE 0x0f |
965 | /* max pipes - needed for compute shaders */ | ||
966 | #define RADEON_INFO_MAX_PIPES 0x10 | ||
965 | 967 | ||
966 | struct drm_radeon_info { | 968 | struct drm_radeon_info { |
967 | uint32_t request; | 969 | uint32_t request; |