diff options
author | Dave Airlie <airlied@linux.ie> | 2005-12-29 00:17:51 +0000 |
---|---|---|
committer | Dave Airlie <airlied@linux.ie> | 2005-12-29 00:17:51 +0000 |
commit | 780e90e4a265532cf96c887267b80c691f016996 (patch) | |
tree | 31dfa083ab9f2fc458da749dc2dfe21e3ada35ea | |
parent | b14d15ac41c0af5093e37a47124f0995e10c3016 (diff) |
add radeon card type get param so userspace can avoid walking PCI
-rw-r--r-- | shared-core/radeon_drm.h | 6 | ||||
-rw-r--r-- | shared-core/radeon_drv.h | 5 | ||||
-rw-r--r-- | shared-core/radeon_state.c | 9 |
3 files changed, 18 insertions, 2 deletions
diff --git a/shared-core/radeon_drm.h b/shared-core/radeon_drm.h index e9a1f9b4..78492e78 100644 --- a/shared-core/radeon_drm.h +++ b/shared-core/radeon_drm.h @@ -624,6 +624,11 @@ typedef struct drm_radeon_indirect { int discard; } drm_radeon_indirect_t; +/* enum for card type parameters */ +#define RADEON_CARD_PCI 0 +#define RADEON_CARD_AGP 1 +#define RADEON_CARD_PCIE 2 + /* 1.3: An ioctl to get parameters that aren't available to the 3d * client any other way. */ @@ -640,6 +645,7 @@ typedef struct drm_radeon_indirect { #define RADEON_PARAM_SAREA_HANDLE 9 #define RADEON_PARAM_GART_TEX_HANDLE 10 #define RADEON_PARAM_SCRATCH_OFFSET 11 +#define RADEON_PARAM_CARD_TYPE 12 typedef struct drm_radeon_getparam { int param; diff --git a/shared-core/radeon_drv.h b/shared-core/radeon_drv.h index ab368262..615afc78 100644 --- a/shared-core/radeon_drv.h +++ b/shared-core/radeon_drv.h @@ -38,7 +38,7 @@ #define DRIVER_NAME "radeon" #define DRIVER_DESC "ATI Radeon" -#define DRIVER_DATE "20050911" +#define DRIVER_DATE "20051229" /* Interface history: * @@ -88,10 +88,11 @@ and R200_EMIT_ATF_TFACTOR (replaces R200_EMIT_TFACTOR_0 (8 consts instead of 6) * 1.19- Add support for gart table in FB memory and PCIE r300 * 1.20- Add support for r300 texrect + * 1.21- Add support for card type getparam */ #define DRIVER_MAJOR 1 -#define DRIVER_MINOR 20 +#define DRIVER_MINOR 21 #define DRIVER_PATCHLEVEL 0 enum radeon_family { diff --git a/shared-core/radeon_state.c b/shared-core/radeon_state.c index 670f6172..3682c68c 100644 --- a/shared-core/radeon_state.c +++ b/shared-core/radeon_state.c @@ -2952,6 +2952,15 @@ static int radeon_cp_getparam(DRM_IOCTL_ARGS) case RADEON_PARAM_GART_TEX_HANDLE: value = dev_priv->gart_textures_offset; break; + + case RADEON_PARAM_CARD_TYPE: + if (dev_priv->flags & CHIP_IS_PCIE) + value = RADEON_CARD_PCIE; + else if (dev_priv->flags & CHIP_IS_AGP) + value = RADEON_CARD_AGP; + else + value = RADEON_CARD_PCI; + break; default: return DRM_ERR(EINVAL); } |