From patchwork Thu Feb 4 14:59:48 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alex Deucher X-Patchwork-Id: 8223801 Return-Path: X-Original-To: patchwork-dri-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 9F8C89F1C0 for ; Thu, 4 Feb 2016 15:00:07 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id A6FDC203B1 for ; Thu, 4 Feb 2016 15:00:06 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) by mail.kernel.org (Postfix) with ESMTP id 1277B203A0 for ; Thu, 4 Feb 2016 15:00:05 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6D5986E0C8; Thu, 4 Feb 2016 07:00:02 -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 2A3A96E0C8 for ; Thu, 4 Feb 2016 07:00:01 -0800 (PST) Received: by mail-qg0-f46.google.com with SMTP id o11so43128337qge.2 for ; Thu, 04 Feb 2016 07:00:01 -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:in-reply-to:references; bh=2vV1sHCWUms6N6vsBIjfCs14m3xHNtZC1n9dT/h6or4=; b=E5nYcAqBYLrZh0Bt7N9pdWPM1MXNAI5z03H4/oIK0r3m4Cld76OUkSSMLBMEwsVq3+ 9zJOYxVfXFLb6U8dxyzji8JVcBhSe/uiafNe9k7qABlemGHz87VqJCSnbRTNBYyH/mZn Fn6iVm3DU57DI9ub94HiGM481D9xPQjQ5stz8QsCFs0Iq6yg/QhppWC+hOplA3mmaRJ6 Td4UrqPIjCh0/cviZRCENvCTknHZUvGEiAlyoLlOsMO9fbKM3PWRH2AgsuxE81aq5BPE wnoykqItA1P+69ydNSN3r5OoO4xueslUFlO/2M+JxPAZ+/RbCzUhT7y1OvSYERPFPYpD Do7A== 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:in-reply-to :references; bh=2vV1sHCWUms6N6vsBIjfCs14m3xHNtZC1n9dT/h6or4=; b=nEznLcss31m+aob6jEKgFsq9u5oWTzFisOq7aS19Li1S7+5gkLeFtRyto+LqWRRPot yzolpeMBJsUubUEx3fG3pkHABpWQpSDefzjOp7k0zzFKhqLoPl2EqUlSofUKCrrGxMXs Kx/PVFPT3Mz+H5BGl+dkj8Xa0QsbyjBtfrUOl4T3vwu54rT+bWYi14M1ZfDBkZ1tHN56 ZADEPoMxMyMJyrEX5UTRVJWmD+kJXzy+xsP+ChTYceveKptMofSI2zQ0LnZMqg0nWrbB jwL8ADZlfa/IELDGUViB8dBerSMNExJ2JctX9jSk/D+CqnluaX2EEXjAaXrHO/dRwQP7 OBpw== X-Gm-Message-State: AG10YORJtV43XhRFoBGv1B+bn7z9Ix2hW9zLegql8f7TERQwraFVbgQsBibuUK8dwFDa8A== X-Received: by 10.140.169.9 with SMTP id p9mr10062145qhp.50.1454598000451; Thu, 04 Feb 2016 07:00:00 -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.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 04 Feb 2016 07:00:00 -0800 (PST) From: Alex Deucher X-Google-Original-From: Alex Deucher To: dri-devel@lists.freedesktop.org Subject: [PATCH 6/7] tests/amdgpu: make amdgpu_command_submission_sdma_copy_linear generic Date: Thu, 4 Feb 2016 09:59:48 -0500 Message-Id: <1454597989-3030-6-git-send-email-alexander.deucher@amd.com> X-Mailer: git-send-email 2.5.0 In-Reply-To: <1454597989-3030-1-git-send-email-alexander.deucher@amd.com> References: <1454597989-3030-1-git-send-email-alexander.deucher@amd.com> 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 So it can be shared for CP tests. Reviewed-by: Ken Wang Signed-off-by: Alex Deucher --- tests/amdgpu/basic_tests.c | 27 +++++++++++++++++---------- 1 file changed, 17 insertions(+), 10 deletions(-) diff --git a/tests/amdgpu/basic_tests.c b/tests/amdgpu/basic_tests.c index 7806be7..701ccf1 100644 --- a/tests/amdgpu/basic_tests.c +++ b/tests/amdgpu/basic_tests.c @@ -57,6 +57,7 @@ static void amdgpu_test_exec_cs_helper(amdgpu_context_handle context_handle, struct amdgpu_cs_request *ibs_request); static void amdgpu_command_submission_write_linear_helper(unsigned ip_type); static void amdgpu_command_submission_const_fill_helper(unsigned ip_type); +static void amdgpu_command_submission_copy_linear_helper(unsigned ip_type); CU_TestInfo basic_tests[] = { { "Query Info Test", amdgpu_query_info_test }, @@ -955,7 +956,7 @@ static void amdgpu_command_submission_sdma_const_fill(void) amdgpu_command_submission_const_fill_helper(AMDGPU_HW_IP_DMA); } -static void amdgpu_command_submission_sdma_copy_linear(void) +static void amdgpu_command_submission_copy_linear_helper(unsigned ip_type) { const int sdma_write_length = 1024; const int pm4_dw = 256; @@ -1020,17 +1021,18 @@ static void amdgpu_command_submission_sdma_copy_linear(void) /* fullfill PM4: test DMA copy linear */ i = j = 0; - pm4[i++] = SDMA_PACKET(SDMA_OPCODE_COPY, SDMA_COPY_SUB_OPCODE_LINEAR, 0); - pm4[i++] = sdma_write_length; - pm4[i++] = 0; - pm4[i++] = 0xffffffff & bo1_mc; - pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32; - pm4[i++] = 0xffffffff & bo2_mc; - pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32; - + if (ip_type == AMDGPU_HW_IP_DMA) { + pm4[i++] = SDMA_PACKET(SDMA_OPCODE_COPY, SDMA_COPY_SUB_OPCODE_LINEAR, 0); + pm4[i++] = sdma_write_length; + pm4[i++] = 0; + pm4[i++] = 0xffffffff & bo1_mc; + pm4[i++] = (0xffffffff00000000 & bo1_mc) >> 32; + pm4[i++] = 0xffffffff & bo2_mc; + pm4[i++] = (0xffffffff00000000 & bo2_mc) >> 32; + } amdgpu_test_exec_cs_helper(context_handle, - AMDGPU_HW_IP_DMA, 0, + ip_type, 0, i, pm4, 2, resources, ib_info, ibs_request); @@ -1061,6 +1063,11 @@ static void amdgpu_command_submission_sdma_copy_linear(void) CU_ASSERT_EQUAL(r, 0); } +static void amdgpu_command_submission_sdma_copy_linear(void) +{ + amdgpu_command_submission_copy_linear_helper(AMDGPU_HW_IP_DMA); +} + static void amdgpu_command_submission_sdma(void) { amdgpu_command_submission_sdma_write_linear();