All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Subject: [PATCH 10/31] drm/amdgpu: prepare job before push to sw queue for pte ring
Date: Fri, 31 Jul 2015 18:22:26 -0400	[thread overview]
Message-ID: <1438381367-24980-11-git-send-email-alexander.deucher@amd.com> (raw)
In-Reply-To: <1438381367-24980-1-git-send-email-alexander.deucher@amd.com>

From: Chunming Zhou <david1.zhou@amd.com>

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    | 1 +
 drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c | 2 +-
 drivers/gpu/drm/amd/amdgpu/cik_sdma.c  | 1 +
 drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c | 1 +
 drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c | 1 +
 5 files changed, 5 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
index 754519e..d85df45 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h
@@ -901,6 +901,7 @@ struct amdgpu_ring {
 	struct amdgpu_ctx	*current_ctx;
 	enum amdgpu_ring_type	type;
 	char			name[16];
+	bool                    is_pte_ring;
 };
 
 /*
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
index 5f24038..9ff4d27 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_cs.c
@@ -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;
diff --git a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
index ab83cc1..6bb9d2f 100644
--- a/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
+++ b/drivers/gpu/drm/amd/amdgpu/cik_sdma.c
@@ -1403,5 +1403,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;
 	}
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
index d789588..78d4bbd 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v2_4.c
@@ -1413,5 +1413,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;
 	}
 }
diff --git a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
index 7bb37b9..763e2cc 100644
--- a/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
+++ b/drivers/gpu/drm/amd/amdgpu/sdma_v3_0.c
@@ -1507,5 +1507,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;
 	}
 }
-- 
1.8.3.1

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2015-07-31 22:23 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-07-31 22:22 [PATCH 00/31] Add GPU scheduler to amdgpu Alex Deucher
2015-07-31 22:22 ` [PATCH 01/31] drm/amd: add basic scheduling framework Alex Deucher
2015-07-31 22:22 ` [PATCH 02/31] drm/amdgpu: add scheduler initialization Alex Deucher
2015-07-31 22:22 ` [PATCH 03/31] drm/amdgpu: add context entity init Alex Deucher
2015-07-31 22:22 ` [PATCH 04/31] drm/amdgpu: disable hw semaphore with scheduler Alex Deucher
2015-07-31 22:22 ` [PATCH 05/31] drm/amdgpu: add backend implementation of gpu scheduler (v2) Alex Deucher
2015-07-31 22:22 ` [PATCH 06/31] drm/amdgpu: add bo list copy Alex Deucher
2015-07-31 22:22 ` [PATCH 07/31] drm/amdgpu: dispatch jobs in cs Alex Deucher
2015-07-31 22:22 ` [PATCH 08/31] drm/amdgpu: use scheduler user seq instead of previous user seq Alex Deucher
2015-07-31 22:22 ` [PATCH 09/31] drm/amdgpu: make sure the fence is emitted before ring to get it Alex Deucher
2015-07-31 22:22 ` Alex Deucher [this message]
2015-07-31 22:22 ` [PATCH 11/31] drm/amdgpu: add kernel ctx support (v2) Alex Deucher
2015-07-31 22:22 ` [PATCH 12/31] drm/amdgpu: dispatch job for vm Alex Deucher
2015-07-31 22:22 ` [PATCH 13/31] drm/amdgpu: add sched isr to fence process Alex Deucher
2015-07-31 22:22 ` [PATCH 14/31] drm/amdgpu: protect fence_process from multiple context Alex Deucher
2015-07-31 22:22 ` [PATCH 15/31] drm/amdgpu: add enable_scheduler module option Alex Deucher
2015-07-31 22:22 ` [PATCH 16/31] drm/amdgpu: add check for callback Alex Deucher
2015-07-31 22:22 ` [PATCH 17/31] drm/amdgpu: fix syncing to VM updates Alex Deucher
2015-07-31 22:22 ` [PATCH 18/31] drm/amdgpu: silent the message for GPU scheduler creation Alex Deucher
2015-07-31 22:22 ` [PATCH 19/31] drm/amdgpu: add amdgpu.sched_jobs option Alex Deucher
2015-07-31 22:22 ` [PATCH 20/31] drm/amdgpu: add amdgpu.sched_hw_submission option Alex Deucher
2015-07-31 22:22 ` [PATCH 21/31] drm/amdgpu: wait forever for wait emit Alex Deucher
2015-07-31 22:22 ` [PATCH 22/31] drm/amdgpu: fix seq in ctx_add_fence Alex Deucher
2015-07-31 22:22 ` [PATCH 23/31] drm/amdgpu: add helper function for kernel submission Alex Deucher
2015-07-31 22:22 ` [PATCH 24/31] drm/amdgpu: Use gpu scheduler for gfx ring ib test Alex Deucher
2015-07-31 22:22 ` [PATCH 25/31] drm/amdgpu: use gpu scheduler for sdma " Alex Deucher
2015-07-31 22:22 ` [PATCH 26/31] drm/amdgpu: use scheduler for UVD " Alex Deucher
2015-07-31 22:22 ` [PATCH 27/31] drm/amdgpu: use scheduler for VCE " Alex Deucher
2015-07-31 22:22 ` [PATCH 28/31] drm/amdgpu: use kernel fence interface when possible Alex Deucher
2015-07-31 22:22 ` [PATCH 29/31] drm/amdgpu: new implement for fence_wait_any (v2) Alex Deucher
2015-07-31 22:22 ` [PATCH 30/31] drm/amdgpu: re-implement fence_default_wait Alex Deucher
2015-07-31 22:22 ` [PATCH 31/31] drm/amdgpu: move wait_queue_head from adev to ring (v2) Alex Deucher

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1438381367-24980-11-git-send-email-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=dri-devel@lists.freedesktop.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.