diff options
author | Marek Olšák <maraeo@gmail.com> | 2009-12-17 00:02:28 -0500 |
---|---|---|
committer | Dave Airlie <airlied@redhat.com> | 2009-12-22 20:14:04 -0500 |
commit | 46c64d4bfa01cda7d58c514164f8b127ab6741b7 (patch) | |
tree | 92f3439c7b761d199714cb84bf09a937582b0c6e /drivers/gpu/drm/radeon | |
parent | 5ea597f3764880ab3a67fe2246218634a8c12778 (diff) |
drm/radeon/kms: allow rendering while no colorbuffer is set on r300
Because hardware cannot disable all colorbuffers directly to do depth-only
rendering, a user should:
- disable reading from a colorbuffer in blending
- disable fastfill
- set the color channel mask to 0 to prevent writing to a colorbuffer
Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/radeon')
-rw-r--r-- | drivers/gpu/drm/radeon/r100.c | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r100_track.h | 4 | ||||
-rw-r--r-- | drivers/gpu/drm/radeon/r300.c | 12 |
3 files changed, 19 insertions, 1 deletions
diff --git a/drivers/gpu/drm/radeon/r100.c b/drivers/gpu/drm/radeon/r100.c index 84e5df766d3f..71727460968f 100644 --- a/drivers/gpu/drm/radeon/r100.c +++ b/drivers/gpu/drm/radeon/r100.c | |||
@@ -2881,6 +2881,10 @@ int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track) | |||
2881 | 2881 | ||
2882 | for (i = 0; i < track->num_cb; i++) { | 2882 | for (i = 0; i < track->num_cb; i++) { |
2883 | if (track->cb[i].robj == NULL) { | 2883 | if (track->cb[i].robj == NULL) { |
2884 | if (!(track->fastfill || track->color_channel_mask || | ||
2885 | track->blend_read_enable)) { | ||
2886 | continue; | ||
2887 | } | ||
2884 | DRM_ERROR("[drm] No buffer for color buffer %d !\n", i); | 2888 | DRM_ERROR("[drm] No buffer for color buffer %d !\n", i); |
2885 | return -EINVAL; | 2889 | return -EINVAL; |
2886 | } | 2890 | } |
diff --git a/drivers/gpu/drm/radeon/r100_track.h b/drivers/gpu/drm/radeon/r100_track.h index 7188c3778ee2..b27a6999d219 100644 --- a/drivers/gpu/drm/radeon/r100_track.h +++ b/drivers/gpu/drm/radeon/r100_track.h | |||
@@ -67,13 +67,15 @@ struct r100_cs_track { | |||
67 | unsigned immd_dwords; | 67 | unsigned immd_dwords; |
68 | unsigned num_arrays; | 68 | unsigned num_arrays; |
69 | unsigned max_indx; | 69 | unsigned max_indx; |
70 | unsigned color_channel_mask; | ||
70 | struct r100_cs_track_array arrays[11]; | 71 | struct r100_cs_track_array arrays[11]; |
71 | struct r100_cs_track_cb cb[R300_MAX_CB]; | 72 | struct r100_cs_track_cb cb[R300_MAX_CB]; |
72 | struct r100_cs_track_cb zb; | 73 | struct r100_cs_track_cb zb; |
73 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; | 74 | struct r100_cs_track_texture textures[R300_TRACK_MAX_TEXTURE]; |
74 | bool z_enabled; | 75 | bool z_enabled; |
75 | bool separate_cube; | 76 | bool separate_cube; |
76 | 77 | bool fastfill; | |
78 | bool blend_read_enable; | ||
77 | }; | 79 | }; |
78 | 80 | ||
79 | int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track); | 81 | int r100_cs_track_check(struct radeon_device *rdev, struct r100_cs_track *track); |
diff --git a/drivers/gpu/drm/radeon/r300.c b/drivers/gpu/drm/radeon/r300.c index 83490c2b5061..6a5d1177afab 100644 --- a/drivers/gpu/drm/radeon/r300.c +++ b/drivers/gpu/drm/radeon/r300.c | |||
@@ -992,6 +992,18 @@ static int r300_packet0_check(struct radeon_cs_parser *p, | |||
992 | } | 992 | } |
993 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); | 993 | ib[idx] = idx_value + ((u32)reloc->lobj.gpu_offset); |
994 | break; | 994 | break; |
995 | case 0x4e0c: | ||
996 | /* RB3D_COLOR_CHANNEL_MASK */ | ||
997 | track->color_channel_mask = idx_value; | ||
998 | break; | ||
999 | case 0x4d1c: | ||
1000 | /* ZB_BW_CNTL */ | ||
1001 | track->fastfill = !!(idx_value & (1 << 2)); | ||
1002 | break; | ||
1003 | case 0x4e04: | ||
1004 | /* RB3D_BLENDCNTL */ | ||
1005 | track->blend_read_enable = !!(idx_value & (1 << 2)); | ||
1006 | break; | ||
995 | case 0x4be8: | 1007 | case 0x4be8: |
996 | /* valid register only on RV530 */ | 1008 | /* valid register only on RV530 */ |
997 | if (p->rdev->family == CHIP_RV530) | 1009 | if (p->rdev->family == CHIP_RV530) |