drm/amdgpu: prepare job before push to sw queue for pte ring
authorChunming Zhou <david1.zhou@amd.com>
Tue, 21 Jul 2015 08:04:39 +0000 (16:04 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Mon, 17 Aug 2015 20:50:36 +0000 (16:50 -0400)
user mode will still use pte ring as a normal ring.
if the prepare job generates another command(update pte) on its ring in scheduler,
then will kill scheduler which is going to waiting later job but pending running job.

Signed-off-by: Chunming Zhou <david1.zhou@amd.com>
Acked-by: Christian K?nig <christian.koenig@amd.com>
Reviewed-by: Jammy Zhou <Jammy.Zhou@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu.h
drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
drivers/gpu/drm/amd/amdgpu/cik_sdma.c
drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c

index 127867c2fc372cca34375d549d241df96aa7e889..79e81f397e60884c7637542d9567cf1acc0f543a 100644 (file)
@@ -902,6 +902,7 @@ struct amdgpu_ring {
        struct amdgpu_ctx       *current_ctx;
        enum amdgpu_ring_type   type;
        char                    name[16];
+       bool                    is_pte_ring;
 };
 
 /*
index 5f2403898b06c945cd8b4ddd71e898df56c05cb1..9ff4d2756a6f967d8f13ff8764c174d7655618ab 100644 (file)
@@ -909,7 +909,7 @@ int amdgpu_cs_ioctl(struct drm_device *dev, void *data, struct drm_file *filp)
                        amdgpu_cs_parser_get_ring(adev, parser);
                parser->uf.sequence = atomic64_inc_return(
                        &parser->ctx->rings[ring->idx].c_entity.last_queued_v_seq);
-               if ((parser->bo_list && parser->bo_list->has_userptr)) {
+               if (ring->is_pte_ring || (parser->bo_list && parser->bo_list->has_userptr)) {
                        r = amdgpu_cs_parser_prepare_job(parser);
                        if (r)
                                goto out;
index 15df46c93f0a3d9e0810b9018ba761bfaa2cc418..dd3da7bb11c184ac01b6c9c142ad101bdd7a8099 100644 (file)
@@ -1404,5 +1404,6 @@ static void cik_sdma_set_vm_pte_funcs(struct amdgpu_device *adev)
        if (adev->vm_manager.vm_pte_funcs == NULL) {
                adev->vm_manager.vm_pte_funcs = &cik_sdma_vm_pte_funcs;
                adev->vm_manager.vm_pte_funcs_ring = &adev->sdma[0].ring;
+               adev->vm_manager.vm_pte_funcs_ring->is_pte_ring = true;
        }
 }
index a988dfb1d3942e9246361bfd7b97bdabc5e5286c..8b7e2438b6d26ea82a970cc20f52561247759c61 100644 (file)
@@ -1415,5 +1415,6 @@ static void sdma_v2_4_set_vm_pte_funcs(struct amdgpu_device *adev)
        if (adev->vm_manager.vm_pte_funcs == NULL) {
                adev->vm_manager.vm_pte_funcs = &sdma_v2_4_vm_pte_funcs;
                adev->vm_manager.vm_pte_funcs_ring = &adev->sdma[0].ring;
+               adev->vm_manager.vm_pte_funcs_ring->is_pte_ring = true;
        }
 }
index 8f4aac23b3174f4e87a47c57e16b63dc1eb04a4f..4b5d769bdb4f54fe44132edbd2169579d5587759 100644 (file)
@@ -1540,5 +1540,6 @@ static void sdma_v3_0_set_vm_pte_funcs(struct amdgpu_device *adev)
        if (adev->vm_manager.vm_pte_funcs == NULL) {
                adev->vm_manager.vm_pte_funcs = &sdma_v3_0_vm_pte_funcs;
                adev->vm_manager.vm_pte_funcs_ring = &adev->sdma[0].ring;
+               adev->vm_manager.vm_pte_funcs_ring->is_pte_ring = true;
        }
 }