radv/gfx9: fix set predication packet.
authorDave Airlie <airlied@redhat.com>
Tue, 15 Aug 2017 05:17:38 +0000 (15:17 +1000)
committerDave Airlie <airlied@redhat.com>
Tue, 15 Aug 2017 19:52:50 +0000 (05:52 +1000)
The predication packet changed format on GFX9, update the driver.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: "17.2" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
src/amd/vulkan/si_cmd_buffer.c

index 88616edfa27c5395ccb393658475a3ac55b3ad81..913ec0e7d2ab8974abb809812ed69ea03a8ec954 100644 (file)
@@ -1133,15 +1133,18 @@ si_emit_cache_flush(struct radv_cmd_buffer *cmd_buffer)
 void
 si_emit_set_predication_state(struct radv_cmd_buffer *cmd_buffer, uint64_t va)
 {
-       uint32_t val = 0;
-
-       if (va)
-               val = (((va >> 32) & 0xff) |
-                      PRED_OP(PREDICATION_OP_BOOL64)|
-                      PREDICATION_DRAW_VISIBLE);
-       radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 1, 0));
-       radeon_emit(cmd_buffer->cs, va);
-       radeon_emit(cmd_buffer->cs, val);
+       uint32_t op = PRED_OP(PREDICATION_OP_BOOL64) | PREDICATION_DRAW_VISIBLE;
+
+       if (cmd_buffer->device->physical_device->rad_info.chip_class >= GFX9) {
+               radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 2, 0));
+               radeon_emit(cmd_buffer->cs, op);
+               radeon_emit(cmd_buffer->cs, va);
+               radeon_emit(cmd_buffer->cs, va >> 32);
+       } else {
+               radeon_emit(cmd_buffer->cs, PKT3(PKT3_SET_PREDICATION, 1, 0));
+               radeon_emit(cmd_buffer->cs, va);
+               radeon_emit(cmd_buffer->cs, op | ((va >> 32) & 0xFF));
+       }
 }
 
 /* Set this if you want the 3D engine to wait until CP DMA is done.