winsys/amdgpu: pad compute IBs
authorMarek Olšák <marek.olsak@amd.com>
Tue, 6 Mar 2018 20:03:09 +0000 (15:03 -0500)
committerMarek Olšák <marek.olsak@amd.com>
Thu, 8 Mar 2018 19:58:16 +0000 (14:58 -0500)
v2: pad with PKT2 NOPs on SI

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c

index d9a95c05093a65ffc9e3aa898ae4763e016d1500..a3feeb93026c816c8e3ccc3cb11c697c0e0bff3d 100644 (file)
@@ -1528,6 +1528,7 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
       }
       break;
    case RING_GFX:
+   case RING_COMPUTE:
       /* pad GFX ring to 8 DWs to meet CP fetch alignment requirements */
       if (ws->info.gfx_ib_pad_with_type2) {
          while (rcs->current.cdw & 7)
@@ -1536,7 +1537,8 @@ static int amdgpu_cs_flush(struct radeon_winsys_cs *rcs,
          while (rcs->current.cdw & 7)
             radeon_emit(rcs, 0xffff1000); /* type3 nop packet */
       }
-      ws->gfx_ib_size_counter += (rcs->prev_dw + rcs->current.cdw) * 4;
+      if (cs->ring_type == RING_GFX)
+         ws->gfx_ib_size_counter += (rcs->prev_dw + rcs->current.cdw) * 4;
       break;
    case RING_UVD:
    case RING_UVD_ENC: