summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--shared-core/r300_cmdbuf.c33
-rw-r--r--shared-core/radeon_drm.h12
2 files changed, 36 insertions, 9 deletions
diff --git a/shared-core/r300_cmdbuf.c b/shared-core/r300_cmdbuf.c
index db5186c8..0a789014 100644
--- a/shared-core/r300_cmdbuf.c
+++ b/shared-core/r300_cmdbuf.c
@@ -739,22 +739,37 @@ static void r300_discard_buffer(struct drm_device * dev, struct drm_buf * buf)
static void r300_cmd_wait(drm_radeon_private_t * dev_priv,
drm_r300_cmd_header_t header)
{
- RING_LOCALS;
u32 wait_until;
+ RING_LOCALS;
if (!header.wait.flags)
return;
wait_until = 0;
- if (header.wait.flags & R300_WAIT_2D)
- wait_until |= RADEON_WAIT_2D_IDLE;
- if (header.wait.flags & R300_WAIT_3D)
- wait_until |= RADEON_WAIT_3D_IDLE;
- if (header.wait.flags & R300_WAIT_2D_CLEAN)
- wait_until |= RADEON_WAIT_2D_IDLECLEAN;
- if (header.wait.flags & R300_WAIT_3D_CLEAN)
- wait_until |= RADEON_WAIT_3D_IDLECLEAN;
+ switch(header.wait.flags) {
+ case R300_WAIT_2D:
+ wait_until = RADEON_WAIT_2D_IDLE;
+ break;
+ case R300_WAIT_3D:
+ wait_until = RADEON_WAIT_3D_IDLE;
+ break;
+ case R300_NEW_WAIT_2D_3D:
+ wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_3D_IDLE;
+ break;
+ case R300_NEW_WAIT_2D_2D_CLEAN:
+ wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_2D_IDLECLEAN;
+ break;
+ case R300_NEW_WAIT_3D_3D_CLEAN:
+ wait_until = RADEON_WAIT_3D_IDLE|RADEON_WAIT_3D_IDLECLEAN;
+ break;
+ case R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN:
+ wait_until = RADEON_WAIT_2D_IDLE|RADEON_WAIT_2D_IDLECLEAN;
+ wait_until |= RADEON_WAIT_3D_IDLE|RADEON_WAIT_3D_IDLECLEAN;
+ break;
+ default:
+ return;
+ }
BEGIN_RING(2);
OUT_RING(CP_PACKET0(RADEON_WAIT_UNTIL, 0));
diff --git a/shared-core/radeon_drm.h b/shared-core/radeon_drm.h
index c4d9cc6b..67c35585 100644
--- a/shared-core/radeon_drm.h
+++ b/shared-core/radeon_drm.h
@@ -225,8 +225,20 @@ typedef union {
#define R300_CMD_WAIT 7
# define R300_WAIT_2D 0x1
# define R300_WAIT_3D 0x2
+/* these two defines are DOING IT WRONG - however
+ * we have userspace which relies on using these.
+ * The wait interface is backwards compat new
+ * code should use the NEW_WAIT defines below
+ * THESE ARE NOT BIT FIELDS
+ */
# define R300_WAIT_2D_CLEAN 0x3
# define R300_WAIT_3D_CLEAN 0x4
+
+# define R300_NEW_WAIT_2D_3D 0x3
+# define R300_NEW_WAIT_2D_2D_CLEAN 0x4
+# define R300_NEW_WAIT_3D_3D_CLEAN 0x6
+# define R300_NEW_WAIT_2D_2D_CLEAN_3D_3D_CLEAN 0x8
+
#define R300_CMD_SCRATCH 8
#define R300_CMD_R500FP 9