From: Michel Dänzer Date: Mon, 7 Aug 2006 10:33:57 +0000 (+1000) Subject: drm: radeon: implement RADEON_PARAM_SCRATCH_OFFSET getparam X-Git-Tag: v2.6.19-rc1~641^2~30 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=8624ecbf68e90e5a8124514a0b7f92767fb80a62;p=linux-2.6-omap-h63xx.git 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 --- diff --git a/drivers/char/drm/radeon_state.c b/drivers/char/drm/radeon_state.c index 99589fe0032..0433ff80cb7 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;