drm/amdgpu:enable mcbp for gfx9(v2)
authorMonk Liu <Monk.Liu@amd.com>
Tue, 21 Mar 2017 03:50:43 +0000 (11:50 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Mar 2017 03:55:35 +0000 (23:55 -0400)
set bit 21 of IB.control filed to actually enable
MCBP for SRIOV
v2:
add flag for preemption enable bit for soc15 and use
this flag instead of hardcode.

Signed-off-by: Monk Liu <Monk.Liu@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c
drivers/gpu/drm/amd/amdgpu/soc15d.h

index 69fa156788175927c0de138150261baea2bee743..f124f6d3b86916ac77c46bc7a842c19069f7891d 100644 (file)
@@ -3073,6 +3073,9 @@ static void gfx_v9_0_ring_emit_ib_gfx(struct amdgpu_ring *ring,
 
         control |= ib->length_dw | (vm_id << 24);
 
+               if (amdgpu_sriov_vf(ring->adev) && (ib->flags & AMDGPU_IB_FLAG_PREEMPT))
+                       control |= INDIRECT_BUFFER_PRE_ENB(1);
+
         amdgpu_ring_write(ring, header);
        BUG_ON(ib->gpu_addr & 0x3); /* Dword align */
         amdgpu_ring_write(ring,
index 7d29329bd642a3ba589d24dd1a52169efa1c83d4..75403c7c8c9e43e287b4d62dba100050b6a994c8 100644 (file)
                 * 1 - Stream
                 * 2 - Bypass
                 */
+#define     INDIRECT_BUFFER_PRE_ENB(x)          ((x) << 21)
 #define        PACKET3_COPY_DATA                               0x40
 #define        PACKET3_PFP_SYNC_ME                             0x42
 #define        PACKET3_COND_WRITE                              0x45