summaryrefslogtreecommitdiffstats
path: root/drivers/char/drm/radeon_state.c
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2006-08-07 12:33:57 +0200
committerDave Airlie <airlied@linux.ie>2006-09-21 21:32:30 +0200
commit8624ecbf68e90e5a8124514a0b7f92767fb80a62 (patch)
treeb0de0beb4e43e567f6e09a4dae08a9fb0ad494ec /drivers/char/drm/radeon_state.c
parentdrm: radeon: add some debug output when getparam is called with unknown (diff)
downloadlinux-8624ecbf68e90e5a8124514a0b7f92767fb80a62.tar.xz
linux-8624ecbf68e90e5a8124514a0b7f92767fb80a62.zip
drm: radeon: implement RADEON_PARAM_SCRATCH_OFFSET getparam
When this succeeds, userspace can read the scratch register contents from th mapped writeback page directly. Signed-off-by: Dave Airlie <airlied@linux.ie>
Diffstat (limited to 'drivers/char/drm/radeon_state.c')
-rw-r--r--drivers/char/drm/radeon_state.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c
index 99589fe0032f..0433ff80cb70 100644
--- a/drivers/char/drm/radeon_state.c
+++ b/drivers/char/drm/radeon_state.c
@@ -2987,7 +2987,11 @@ static int radeon_cp_getparam(DRM_IOCTL_ARGS)
case RADEON_PARAM_GART_TEX_HANDLE:
value = dev_priv->gart_textures_offset;
break;
-
+ case RADEON_PARAM_SCRATCH_OFFSET:
+ if (!dev_priv->writeback_works)
+ return DRM_ERR(EINVAL);
+ value = RADEON_SCRATCH_REG_OFFSET;
+ break;
case RADEON_PARAM_CARD_TYPE:
if (dev_priv->flags & CHIP_IS_PCIE)
value = RADEON_CARD_PCIE;