All of lore.kernel.org
 help / color / mirror / Atom feed
From: Huang Rui <ray.huang@amd.com>
To: amd-gfx@lists.freedesktop.org
Cc: "Pierre-Eric Pelloux-Prayer" <pierre-eric.pelloux-prayer@amd.com>,
	"Marek Olšák" <marek.olsak@amd.com>,
	"Huang Rui" <ray.huang@amd.com>, "Aaron Liu" <aaron.liu@amd.com>,
	"Luben Tuikov" <luben.tuikov@amd.com>,
	"Alex Deucher" <alexander.deucher@amd.com>,
	"Christian König" <christian.koenig@amd.com>
Subject: [PATCH libdrm 2/4] amdgpu: use amdgpu_cs_submit_raw2 in amdgpu_cs_submit
Date: Tue, 11 Feb 2020 19:23:01 +0800	[thread overview]
Message-ID: <1581420183-14223-3-git-send-email-ray.huang@amd.com> (raw)
In-Reply-To: <1581420183-14223-1-git-send-email-ray.huang@amd.com>

So far, amdgpu_cs_submit_raw2 is mainly used for upper layer (Mesa), however,
amdgpu_cs_submit is used for current all unit tests. Our intention is that the
unit tests can actually verify the API which is really used.

Signed-off-by: Huang Rui <ray.huang@amd.com>
---
 amdgpu/amdgpu_cs.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/amdgpu/amdgpu_cs.c b/amdgpu/amdgpu_cs.c
index aaa1f7b..864a76a 100644
--- a/amdgpu/amdgpu_cs.c
+++ b/amdgpu/amdgpu_cs.c
@@ -226,9 +226,11 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
 	struct drm_amdgpu_cs_chunk_data *chunk_data;
 	struct drm_amdgpu_cs_chunk_dep *dependencies = NULL;
 	struct drm_amdgpu_cs_chunk_dep *sem_dependencies = NULL;
+	amdgpu_device_handle dev = context->dev;
 	struct list_head *sem_list;
 	amdgpu_semaphore_handle sem, tmp;
 	uint32_t i, size, sem_count = 0;
+	uint64_t seq_no;
 	bool user_fence;
 	int r = 0;
 
@@ -354,12 +356,12 @@ static int amdgpu_cs_submit_one(amdgpu_context_handle context,
 		chunks[i].chunk_data = (uint64_t)(uintptr_t)sem_dependencies;
 	}
 
-	r = drmCommandWriteRead(context->dev->fd, DRM_AMDGPU_CS,
-				&cs, sizeof(cs));
+	r = amdgpu_cs_submit_raw2(dev, context, cs.in.bo_list_handle, cs.in.num_chunks,
+				  chunks, &seq_no);
 	if (r)
 		goto error_unlock;
 
-	ibs_request->seq_no = cs.out.handle;
+	ibs_request->seq_no = seq_no;
 	context->last_seq[ibs_request->ip_type][ibs_request->ip_instance][ibs_request->ring] = ibs_request->seq_no;
 error_unlock:
 	pthread_mutex_unlock(&context->sequence_mutex);
-- 
2.7.4

_______________________________________________
amd-gfx mailing list
amd-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/amd-gfx

  parent reply	other threads:[~2020-02-11 11:23 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-11 11:22 [PATCH libdrm 0/4] amdgpu: use amdgpu_cs_submit_raw2 for amdgpu tests Huang Rui
2020-02-11 11:23 ` [PATCH libdrm 1/4] amdgpu: use alloca for dependencies and sem_dependencies Huang Rui
2020-02-11 11:23 ` Huang Rui [this message]
2020-02-11 11:23 ` [PATCH libdrm 3/4] amdgpu: remove the un-used chunk_array Huang Rui
2020-02-11 11:23 ` [PATCH libdrm 4/4] amdgpu: clean up the cs structure variable Huang Rui
2020-02-11 11:39 ` [PATCH libdrm 0/4] amdgpu: use amdgpu_cs_submit_raw2 for amdgpu tests Christian König
2020-02-11 14:29   ` Deucher, Alexander
2020-02-11 14:35     ` Huang, Ray
2020-02-11 14:57       ` Deucher, Alexander
2020-02-11 23:28         ` Luben Tuikov

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=1581420183-14223-3-git-send-email-ray.huang@amd.com \
    --to=ray.huang@amd.com \
    --cc=aaron.liu@amd.com \
    --cc=alexander.deucher@amd.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=christian.koenig@amd.com \
    --cc=luben.tuikov@amd.com \
    --cc=marek.olsak@amd.com \
    --cc=pierre-eric.pelloux-prayer@amd.com \
    /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.