drm/amdgpu: add a ring func for vcn start command
authorLeo Liu <leo.liu@amd.com>
Thu, 11 May 2017 20:29:08 +0000 (16:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 24 May 2017 21:41:31 +0000 (17:41 -0400)
Needed for the proper command sequence for VCN.

Signed-off-by: Leo Liu <leo.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/amdgpu_ib.c
drivers/gpu/drm/amd/amdgpu/amdgpu_ring.h

index cb9472f52e8c15051f3f6fb1d16f64d977ffd5a8..f774b3f497d28735829d9b6407cd1832e9174945 100644 (file)
@@ -169,6 +169,9 @@ int amdgpu_ib_schedule(struct amdgpu_ring *ring, unsigned num_ibs,
                dma_fence_put(tmp);
        }
 
+       if (ring->funcs->insert_start)
+               ring->funcs->insert_start(ring);
+
        if (vm) {
                r = amdgpu_vm_flush(ring, job);
                if (r) {
index 731f0941927a40a4acd6d65793cb7eb3c19bb534..9bf3100f273e44a459f85fb4b88b19a56f3d88a2 100644 (file)
@@ -132,6 +132,7 @@ struct amdgpu_ring_funcs {
        int (*test_ib)(struct amdgpu_ring *ring, long timeout);
        /* insert NOP packets */
        void (*insert_nop)(struct amdgpu_ring *ring, uint32_t count);
+       void (*insert_start)(struct amdgpu_ring *ring);
        void (*insert_end)(struct amdgpu_ring *ring);
        /* pad the indirect buffer to the necessary number of dw */
        void (*pad_ib)(struct amdgpu_ring *ring, struct amdgpu_ib *ib);