winsys/amdgpu: add vcn jpeg cs support
authorBoyuan Zhang <boyuan.zhang@amd.com>
Wed, 17 Oct 2018 19:03:29 +0000 (15:03 -0400)
committerLeo Liu <leo.liu@amd.com>
Tue, 23 Oct 2018 12:50:02 +0000 (08:50 -0400)
Add vcn jpeg cs support, align cs by no-op.

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
src/gallium/winsys/amdgpu/drm/amdgpu_cs.c

index c0f8b442b1d23068f0552d548c912ba3da5a70eb..5986810d4e9997ca7b1098250ff6da88fb245f40 100644 (file)
@@ -845,6 +845,10 @@ static bool amdgpu_init_cs_context(struct amdgpu_winsys *ws,
       cs->ib[IB_MAIN].ip_type = AMDGPU_HW_IP_VCN_ENC;
       break;
 
+   case RING_VCN_JPEG:
+      cs->ib[IB_MAIN].ip_type = AMDGPU_HW_IP_VCN_JPEG;
+      break;
+
    case RING_COMPUTE:
    case RING_GFX:
       cs->ib[IB_MAIN].ip_type = ring_type == RING_GFX ? AMDGPU_HW_IP_GFX :
@@ -1589,6 +1593,14 @@ static int amdgpu_cs_flush(struct radeon_cmdbuf *rcs,
       while (rcs->current.cdw & 15)
          radeon_emit(rcs, 0x80000000); /* type2 nop packet */
       break;
+   case RING_VCN_JPEG:
+      if (rcs->current.cdw % 2)
+         assert(0);
+      while (rcs->current.cdw & 15) {
+         radeon_emit(rcs, 0x60000000); /* nop packet */
+         radeon_emit(rcs, 0x00000000);
+      }
+      break;
    case RING_VCN_DEC:
       while (rcs->current.cdw & 15)
          radeon_emit(rcs, 0x81ff); /* nop packet */