dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Alex Deucher <alexdeucher@gmail.com>
To: dri-devel@lists.freedesktop.org
Cc: Alex Deucher <alexander.deucher@amd.com>
Subject: [PATCH 1/7] tests/amdgpu: make amdgpu_sdma_test_exec_cs() generic (v2)
Date: Thu,  4 Feb 2016 12:24:48 -0500	[thread overview]
Message-ID: <1454606688-30252-1-git-send-email-alexander.deucher@amd.com> (raw)

Share with upcoming CP tests.

v2: drop unnecessary forward declaration

Reviewed-by: Ken Wang <Qingqing.Wang@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
---
 tests/amdgpu/basic_tests.c | 51 +++++++++++++++++++++++++---------------------
 1 file changed, 28 insertions(+), 23 deletions(-)

diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c
index fa0ed12..df5f5bc 100644
--- a/tests/amdgpu/basic_tests.c
+++ b/tests/amdgpu/basic_tests.c
@@ -542,11 +542,12 @@ static void amdgpu_command_submission_compute(void)
  * pm4_src, resources, ib_info, and ibs_request
  * submit command stream described in ibs_request and wait for this IB accomplished
  */
-static void amdgpu_sdma_test_exec_cs(amdgpu_context_handle context_handle,
-				 int instance, int pm4_dw, uint32_t *pm4_src,
-				 int res_cnt, amdgpu_bo_handle *resources,
-				 struct amdgpu_cs_ib_info *ib_info,
-				 struct amdgpu_cs_request *ibs_request)
+static void amdgpu_test_exec_cs_helper(amdgpu_context_handle context_handle,
+				       unsigned ip_type,
+				       int instance, int pm4_dw, uint32_t *pm4_src,
+				       int res_cnt, amdgpu_bo_handle *resources,
+				       struct amdgpu_cs_ib_info *ib_info,
+				       struct amdgpu_cs_request *ibs_request)
 {
 	int r;
 	uint32_t expired;
@@ -579,7 +580,7 @@ static void amdgpu_sdma_test_exec_cs(amdgpu_context_handle context_handle,
 	ib_info->ib_mc_address = ib_result_mc_address;
 	ib_info->size = pm4_dw;
 
-	ibs_request->ip_type = AMDGPU_HW_IP_DMA;
+	ibs_request->ip_type = ip_type;
 	ibs_request->ring = instance;
 	ibs_request->number_of_ibs = 1;
 	ibs_request->ibs = ib_info;
@@ -601,7 +602,7 @@ static void amdgpu_sdma_test_exec_cs(amdgpu_context_handle context_handle,
 	r = amdgpu_bo_list_destroy(ibs_request->resources);
 	CU_ASSERT_EQUAL(r, 0);
 
-	fence_status.ip_type = AMDGPU_HW_IP_DMA;
+	fence_status.ip_type = ip_type;
 	fence_status.ring = ibs_request->ring;
 	fence_status.context = context_handle;
 	fence_status.fence = ibs_request->seq_no;
@@ -676,10 +677,11 @@ static void amdgpu_command_submission_sdma_write_linear(void)
 		while(j++ < sdma_write_length)
 			pm4[i++] = 0xdeadbeaf;
 
-		amdgpu_sdma_test_exec_cs(context_handle, 0,
-					i, pm4,
-					1, resources,
-					ib_info, ibs_request);
+		amdgpu_test_exec_cs_helper(context_handle,
+					   AMDGPU_HW_IP_DMA, 0,
+					   i, pm4,
+					   1, resources,
+					   ib_info, ibs_request);
 
 		/* verify if SDMA test result meets with expected */
 		i = 0;
@@ -759,10 +761,11 @@ static void amdgpu_command_submission_sdma_const_fill(void)
 		pm4[i++] = 0xdeadbeaf;
 		pm4[i++] = sdma_write_length;
 
-		amdgpu_sdma_test_exec_cs(context_handle, 0,
-					i, pm4,
-					1, resources,
-					ib_info, ibs_request);
+		amdgpu_test_exec_cs_helper(context_handle,
+					   AMDGPU_HW_IP_DMA, 0,
+					   i, pm4,
+					   1, resources,
+					   ib_info, ibs_request);
 
 		/* verify if SDMA test result meets with expected */
 		i = 0;
@@ -860,10 +863,11 @@ static void amdgpu_command_submission_sdma_copy_linear(void)
 			pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32;
 
 
-			amdgpu_sdma_test_exec_cs(context_handle, 0,
-						i, pm4,
-						2, resources,
-						ib_info, ibs_request);
+			amdgpu_test_exec_cs_helper(context_handle,
+						   AMDGPU_HW_IP_DMA, 0,
+						   i, pm4,
+						   2, resources,
+						   ib_info, ibs_request);
 
 			/* verify if SDMA test result meets with expected */
 			i = 0;
@@ -954,10 +958,11 @@ static void amdgpu_userptr_test(void)
 	while (j++ < sdma_write_length)
 		pm4[i++] = 0xdeadbeaf;
 
-	amdgpu_sdma_test_exec_cs(context_handle, 0,
-				 i, pm4,
-				 1, &handle,
-				 ib_info, ibs_request);
+	amdgpu_test_exec_cs_helper(context_handle,
+				   AMDGPU_HW_IP_DMA, 0,
+				   i, pm4,
+				   1, &handle,
+				   ib_info, ibs_request);
 	i = 0;
 	while (i < sdma_write_length) {
 		CU_ASSERT_EQUAL(((int*)ptr)[i++], 0xdeadbeaf);
-- 
2.5.0

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

                 reply	other threads:[~2016-02-04 17:24 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=1454606688-30252-1-git-send-email-alexander.deucher@amd.com \
    --to=alexdeucher@gmail.com \
    --cc=alexander.deucher@amd.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).