summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/radeon/r300.c
diff options
context:
space:
mode:
authorMarek Olšák <maraeo@gmail.com>2011-01-05 05:46:48 +0100
committerDave Airlie <airlied@redhat.com>2011-01-06 04:00:45 +0100
commit9eba4a93ce520a627e876b0d1851d4f78a701c2b (patch)
treea0dbb86c2105b4ff89af724b835d0c40fbf59368 /drivers/gpu/drm/radeon/r300.c
parentdrm/radeon/kms: adjust quirk for acer laptop (diff)
downloadlinux-9eba4a93ce520a627e876b0d1851d4f78a701c2b.tar.xz
linux-9eba4a93ce520a627e876b0d1851d4f78a701c2b.zip
drm/radeon/kms: manage r300 CMASK RAM access and allow CMASK clear
The CMASK RAM is for colorbuffer compression (used in conjunction with MSAA). Only one user (filp) can access it. The CMASK RAM access is managed in the same way as Hyper-Z, but there is a separate ioctl, because an app that uses MSAA does not necessarily have to use zbuffering. Signed-off-by: Marek Olšák <maraeo@gmail.com> Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon/r300.c')
-rw-r--r--drivers/gpu/drm/radeon/r300.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c
index 36b4f7b48d6a..23fee54c3b75 100644
--- a/drivers/gpu/drm/radeon/r300.c
+++ b/drivers/gpu/drm/radeon/r300.c
@@ -745,6 +745,11 @@ static int r300_packet0_check(struct radeon_cs_parser *p,
break;
case 0x4E00:
/* RB3D_CCTL */
+ if ((idx_value & (1 << 10)) && /* CMASK_ENABLE */
+ p->rdev->cmask_filp != p->filp) {
+ DRM_ERROR("Invalid RB3D_CCTL: Cannot enable CMASK.\n");
+ return -EINVAL;
+ }
track->num_cb = ((idx_value >> 5) & 0x3) + 1;
break;
case 0x4E38:
@@ -1206,6 +1211,10 @@ static int r300_packet3_check(struct radeon_cs_parser *p,
if (p->rdev->hyperz_filp != p->filp)
return -EINVAL;
break;
+ case PACKET3_3D_CLEAR_CMASK:
+ if (p->rdev->cmask_filp != p->filp)
+ return -EINVAL;
+ break;
case PACKET3_NOP:
break;
default: