Skip to contentSkip to conversation

drm/r600: parse the set predication command.

PATCH In review Dave Airlie 2 participants 2 messages Feb 28, 2011

Subsystems (2)
lore
Share & tools
lore

Dave Airlie

author maintainer
#0 lore raw

PATCH 1/1 drm/r600: parse the set predication command.

From: Dave Airlie <[email protected]>

This is required for NV_conditional_render and EXT_transform_feedback.

---
 drivers/gpu/drm/radeon/r600_cs.c |   32 ++++++++++++++++++++++++++++++++
 1 files changed, 32 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +32 -0
index 00f153d..0a0848f 100644
@@ -1421,6 +1421,38 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
 	idx_value = radeon_get_ib_value(p, idx);
 
 	switch (pkt->opcode) {
+	case PACKET3_SET_PREDICATION:
+	{
+		int pred_op;
+		int tmp;
+		if (pkt->count != 1) {
+			DRM_ERROR("bad SET PREDICATION\n");
+			return -EINVAL;
+		}
+
+		tmp = radeon_get_ib_value(p, idx + 1);
+		pred_op = (tmp >> 16) & 0x7;
+
+		/* for the clear predicate operation */
+		if (pred_op == 0)
+			return 0;
+
+		if (pred_op > 2) {
+			DRM_ERROR("bad SET PREDICATION operation %d\n", pred_op);
+			return -EINVAL;
+		}
+
+		r = r600_cs_packet_next_reloc(p, &reloc);
+		if (r) {
+			DRM_ERROR("bad SET PREDICATION\n");
+			return -EINVAL;
+		}
+
+		ib[idx + 0] = idx_value + (u32)(reloc->lobj.gpu_offset & 0xffffffff);
+		ib[idx + 1] = tmp + (upper_32_bits(reloc->lobj.gpu_offset) & 0xff);
+	}
+	break;
+
 	case PACKET3_START_3D_CMDBUF:
 		if (p->family >= CHIP_RV770 || pkt->count) {
 			DRM_ERROR("bad START_3D\n");
Signature · 1 line
1.7.3.2
#1 lore raw
Quoted 3 lines · Dave Airlie

From: Dave Airlie <[email protected]>

This is required for NV_conditional_render and EXT_transform_feedback.

Need to add this packet to evergreen_cs.c as well. Otherwise, looks good.

Alex

Quoted 57 lines

---
 drivers/gpu/drm/radeon/r600_cs.c |   32 ++++++++++++++++++++++++++++++++

 1 files changed, 32 insertions(+), 0 deletions(-)
drivers/gpu/drm/radeon/r600_cs.c +32 -0
index 00f153d..0a0848f 100644
@@ -1421,6 +1421,38 @@ static int r600_packet3_check(struct radeon_cs_parser *p,
        idx_value = radeon_get_ib_value(p, idx);
 
        switch (pkt->opcode) {
+       case PACKET3_SET_PREDICATION:
+       {
+               int pred_op;
+               int tmp;
+               if (pkt->count != 1) {
+                       DRM_ERROR("bad SET PREDICATION\n");
+                       return -EINVAL;
+               }
+
+               tmp = radeon_get_ib_value(p, idx + 1);
+               pred_op = (tmp >> 16) & 0x7;
+
+               /* for the clear predicate operation */
+               if (pred_op == 0)
+                       return 0;
+
+               if (pred_op > 2) {
+                       DRM_ERROR("bad SET PREDICATION operation %d\n", pred_op);
+                       return -EINVAL;
+               }
+
+               r = r600_cs_packet_next_reloc(p, &reloc);
+               if (r) {
+                       DRM_ERROR("bad SET PREDICATION\n");
+                       return -EINVAL;
+               }
+
+               ib[idx + 0] = idx_value + (u32)(reloc->lobj.gpu_offset & 0xffffffff);
+               ib[idx + 1] = tmp + (upper_32_bits(reloc->lobj.gpu_offset) & 0xff);
+       }
+       break;
+

       case PACKET3_START_3D_CMDBUF:
               if (p->family >= CHIP_RV770 || pkt->count) { DRM_ERROR("bad START_3D\n"); --
1.7.3.2

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel