diff options
author | Alex Deucher <alexdeucher@gmail.com> | 2009-08-20 10:56:35 -0400 |
---|---|---|
committer | Alex Deucher <alexdeucher@gmail.com> | 2009-08-24 18:08:37 -0400 |
commit | 3023328ea721d2b87112e37e119345a9662d7e5e (patch) | |
tree | 56e50b75287e83ded5552176f5fae38646fa25ab /src/mesa/drivers/dri/radeon | |
parent | 8dd151b947c36100f38cf83eca674bd427b23e47 (diff) |
r300: add support for getting Z pipe info from drm
Needed for occulsion queries on rv530 chips
Signed-off-by: Alex Deucher <alexdeucher@gmail.com>
Diffstat (limited to 'src/mesa/drivers/dri/radeon')
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h | 8 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.c | 18 | ||||
-rw-r--r-- | src/mesa/drivers/dri/radeon/radeon_screen.h | 1 |
3 files changed, 27 insertions, 0 deletions
diff --git a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h index a42870f4a9..4520a7d7d4 100644 --- a/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h +++ b/src/mesa/drivers/dri/radeon/radeon_bocs_wrapper.h @@ -45,6 +45,10 @@ struct drm_radeon_info { #define RADEON_PARAM_DEVICE_ID 16 #endif +#ifndef RADEON_PARAM_NUM_Z_PIPES +#define RADEON_PARAM_NUM_Z_PIPES 17 +#endif + #ifndef RADEON_INFO_DEVICE_ID #define RADEON_INFO_DEVICE_ID 0 #endif @@ -52,6 +56,10 @@ struct drm_radeon_info { #define RADEON_INFO_NUM_GB_PIPES 0 #endif +#ifndef RADEON_INFO_NUM_Z_PIPES +#define RADEON_INFO_NUM_Z_PIPES 0 +#endif + #ifndef DRM_RADEON_INFO #define DRM_RADEON_INFO 0x1 #endif diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.c b/src/mesa/drivers/dri/radeon/radeon_screen.c index 10afe527d3..bdcfd10c06 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.c +++ b/src/mesa/drivers/dri/radeon/radeon_screen.c @@ -267,6 +267,9 @@ radeonGetParam(__DRIscreenPrivate *sPriv, int param, void *value) case RADEON_PARAM_NUM_GB_PIPES: info.request = RADEON_INFO_NUM_GB_PIPES; break; + case RADEON_PARAM_NUM_Z_PIPES: + info.request = RADEON_INFO_NUM_Z_PIPES; + break; default: return -EINVAL; } @@ -1171,6 +1174,15 @@ radeonCreateScreen( __DRIscreenPrivate *sPriv ) default: break; } + + if ( sPriv->drm_version.minor >= 31 ) { + ret = radeonGetParam(sPriv, RADEON_PARAM_NUM_Z_PIPES, &temp); + if (ret) + screen->num_z_pipes = 2; + else + screen->num_z_pipes = temp; + } else + screen->num_z_pipes = 2; } if ( sPriv->drm_version.minor >= 10 ) { @@ -1372,6 +1384,12 @@ radeonCreateScreen2(__DRIscreenPrivate *sPriv) break; } + ret = radeonGetParam(sPriv, RADEON_PARAM_NUM_Z_PIPES, &temp); + if (ret) + screen->num_z_pipes = 2; + else + screen->num_z_pipes = temp; + } i = 0; diff --git a/src/mesa/drivers/dri/radeon/radeon_screen.h b/src/mesa/drivers/dri/radeon/radeon_screen.h index f0dd46b0b1..15744e8828 100644 --- a/src/mesa/drivers/dri/radeon/radeon_screen.h +++ b/src/mesa/drivers/dri/radeon/radeon_screen.h @@ -108,6 +108,7 @@ typedef struct radeon_screen { const __DRIextension *extensions[16]; int num_gb_pipes; + int num_z_pipes; int kernel_mm; drm_radeon_sarea_t *sarea; /* Private SAREA data */ struct radeon_bo_manager *bom; |