From patchwork Thu Feb 4 14:59:43 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 8223841 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0A2E1BEEE5 for ; Thu, 4 Feb 2016 15:00:12 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 63C2C203A1 for ; Thu, 4 Feb 2016 15:00:10 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 85AC320390 for ; Thu, 4 Feb 2016 15:00:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id DCF9E6E07D; Thu, 4 Feb 2016 07:00:00 -0800 (PST) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from mail-qg0-f46.google.com (mail-qg0-f46.google.com [209.85.192.46]) by gabe.freedesktop.org (Postfix) with ESMTPS id 04D946E07D for ; Thu, 4 Feb 2016 06:59:59 -0800 (PST) Received: by mail-qg0-f46.google.com with SMTP id y9so38600923qgd.3 for ; Thu, 04 Feb 2016 06:59:58 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=XxbSqcPPhfYwXuV5cjVoCNHpw1E8l4feHVMygbrUwm0=; b=m5YzGaEQJb/Mwm8675rtJ722P9+ccx33ZjmkzaMJ3FU0UgRh236rwsBIDa+N3BeqNX O9Odf5Gom8X1k46E5u3WMdbVVx5pYbpDZa5v9HqFOzkJykZVvI3x1FsoyNG+Gtv0leTS /oaCUuyu3bkKLMmOJ3OD6Xl9bUK+c4atLSO2z4kC2ru3uo8hnzNOOsHmGRHfXOdrGIqg 0QEgTvJD8/NneSlXTOYRfRvZ5nuq6FS5mnIbgQFsIvWS5raDBwNTCn/YiLMvtjt0i3OF mYD1Ij765H3IT4GHGKDkZnpx7Rl9ux0GHFdGhOCDZQjE9kBXOwS2y1KlB7BNFa1Qd9Au 05yA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=XxbSqcPPhfYwXuV5cjVoCNHpw1E8l4feHVMygbrUwm0=; b=Ja+5R7BrPdz0xa0NNFzehXf9QlssfbvBZgZMUeH1h1Tvc47AaTYHOLQ2WpVbI32yy7 rfNnELu+IueWnbTlCgjDGafAiSo8/cFAXgw/ISryZh8qHHdfv2IPJvrWnUEbeOWvhYv4 1QScoXECKPu0dzXD1gIB3hThgKJX9GsVl+XiHU2gEn8K69FjeJbsJlkAo5Fu0urXhENJ dr56bG+IEDndYM/pRzARuJOUjAmXQhG4XPNSKBgQmfECxi5jgze+uByqoqJYzhVwibGy 68D8K0RaGNb0xOGXlv/q4e3s9i59VLjncwLETYIJ/L2xhYx1c9rRzAixr8ySFGG4ViAn aglA== X-Gm-Message-State: AG10YOTG971nSCqJDdSJQtASQ3rWAwtF+OVo5hKziZrVsejgzJyHPZZB/nSkMh1vKZ7eAA== X-Received: by 10.140.239.65 with SMTP id k62mr10170378qhc.11.1454597997919; Thu, 04 Feb 2016 06:59:57 -0800 (PST) Received: from cm.localdomain (static-74-96-105-49.washdc.fios.verizon.net. [74.96.105.49]) by smtp.gmail.com with ESMTPSA id t18sm5308140qkl.11.2016.02.04.06.59.57 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 06:59:57 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 1/7] tests/amdgpu: make amdgpu_sdma_test_exec_cs() generic Date: Thu, 4 Feb 2016 09:59:43 -0500 Message-Id: <1454597989-3030-1-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.0 Cc: Alex Deucher X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.18 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Spam-Status: No, score=-4.5 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_MED, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Share with upcoming CP tests. Reviewed-by: Ken Wang Signed-off-by: Alex Deucher --- tests/amdgpu/basic_tests.c | 58 ++++++++++++++++++++++++++++------------------ 1 file changed, 35 insertions(+), 23 deletions(-) diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index fa0ed12..1bcc835 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -49,6 +49,13 @@ static void amdgpu_command_submission_sdma(void); static void amdgpu_userptr_test(void); static void amdgpu_semaphore_test(void); +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); + CU_TestInfo basic_tests[] = { { "Query Info Test", amdgpu_query_info_test }, { "Memory alloc Test", amdgpu_memory_alloc }, @@ -542,11 +549,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 +587,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 +609,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 +684,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 +768,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 +870,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 +965,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);