From patchwork Thu Oct 5 15:24:50 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zhu X-Patchwork-Id: 9987475 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 836AD60291 for ; Thu, 5 Oct 2017 15:40:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 76B4028B61 for ; Thu, 5 Oct 2017 15:40:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6B7C228C6F; Thu, 5 Oct 2017 15:40:41 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.6 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, RCVD_IN_DNSWL_MED, RCVD_IN_SORBS_WEB, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 48CAA28B61 for ; Thu, 5 Oct 2017 15:40:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 8C9386E131; Thu, 5 Oct 2017 15:40:38 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0050.outbound.protection.outlook.com [104.47.37.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id 94AA06E131 for ; Thu, 5 Oct 2017 15:40:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amd-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=PQAtpi8s8rsafNjzJ1p4kMnCmeA4ioJffGXA4UdCark=; b=A2oSO9B4Nx5mHKw878IhHtBrrBv3fmBapK/ZDRlKOPPfHHKdmtEH/DxHbNsymSgdDdYS63tXOg5YRd2W0thFw4shEna7g3RsCbaDyJHwVKNE2JSSb0f2ZoMFrmha5IiXqap9Bz+5vPvRVXIzECplrXMsrdkggbQeVoRUwPRnlfc= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=James.Zhu@amd.com; Received: from JamesZhu.amd.com (165.204.55.251) by BN6PR12MB1410.namprd12.prod.outlook.com (10.168.228.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.77.7; Thu, 5 Oct 2017 15:25:34 +0000 From: James Zhu To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH libdrm v2 2/2] tests/amdgpu: fix uvd enc data corruption issue Date: Thu, 5 Oct 2017 11:24:50 -0400 Message-Id: <1507217090-10669-2-git-send-email-James.Zhu@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507217090-10669-1-git-send-email-James.Zhu@amd.com> References: <1507217090-10669-1-git-send-email-James.Zhu@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: BN6PR02CA0048.namprd02.prod.outlook.com (10.173.146.162) To BN6PR12MB1410.namprd12.prod.outlook.com (10.168.228.144) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c6102fff-0eca-4cdf-dc25-08d50c0552c7 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:BN6PR12MB1410; X-Micros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/1KBCjpb4OddpV4ucpMFsZ7ISPfGQpzx0OlMiz1zmlAJt/8XgzxbLUcltarAFDtlGjl1cVH8xLyp4f1wQXjcK35yRfV/Og4++toW3VM0G3KNIU0RVKeTDXqMSYexrn4sJvD3PdVcBRMwkWBZomIb1BDIw2GJNIOxiVoJp93vnY3c9ll6rd8UfxCYnhvGqy2yEzMvOuBg3oO0ICKp1LcLqujMLDjdP5w8wfAd7w/eREeSJetan0rkkj3LrjPX4+nEz1JfiYmMegBSLHaAIA0yif+awWvW/nbTGGEcK5WxDLGVRU3PcDzxQXNM6pzHHKi3YzBux3/2ZtU2GaqI8yC5Sx9M8iWBxVK25N+czzs7xqGslSvMCs02yWWcPNuNWY3xnr; 4:zdDCn8I6xFrvoIQlkCFK0RTo7MUfEP9e2Tcj5Mp6ymPHdbz0UM1CM8ey3OaLghamr5k24egMr6UeCLRuZPAjlf3dMXLEy98kwlbEcE7xxuabFO5/Pynf7mnDmlLec6GRZvJeQ+EoiQhZTVGrY0805p3pE+2Wwp9sYdI97vMaoyaa9C+LinbPfujNDPe+1P+nYh05WJrFM/KRm6TXL/CoyduR6FscKhyIP4InKKcj4NHOkSL7SRpFEMGFGmsdOk4hwn1njj2R5Pqwcm2KuJOm+BDnMPMw+/4pdlfpcUXvtps= X-Exchange-Antispam-Report-Test: UriScan:(767451399110); X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(100000700101)(100105000095)(100000701101)(100105300095)(100000702101)(100105100095)(6040450)(2401047)(8121501046)(5005006)(3002001)(93006095)(93001095)(10201501046)(100000703101)(100105400095)(6055026)(6041248)(20161123560025)(20161123558100)(20161123555025)(20161123562025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123564025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:BN6PR12MB1410; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:BN6PR12MB1410; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(346002)(376002)(199003)(189002)(72206003)(2950100002)(53936002)(86362001)(6666003)(305945005)(81166006)(8676002)(50466002)(8936002)(16526018)(16586007)(450100002)(7736002)(316002)(48376002)(50226002)(478600001)(53416004)(106356001)(105586002)(2906002)(189998001)(50986999)(81156014)(47776003)(6486002)(101416001)(5003940100001)(6116002)(5660300001)(36756003)(25786009)(3846002)(97736004)(68736007)(76176999)(66066001); DIR:OUT; SFP:1101; SCL:1; SRVR:BN6PR12MB1410; H:JamesZhu.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; A:1; MX:1; LANG:en; Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR12MB1410; 23:i92S9fMgFfuISe3ppeGhkYr/yfb1xOMEusrtCmJRL?= =?us-ascii?Q?5i56FAqCRSN3As9fgoZqKU8dGl55TXD9XqaTYc6oswC+Klji5V5I66w4Cwuc?= =?us-ascii?Q?jINrkIFTvRpubzMPZw7rWlPwN238re+rghoXhAimr27R79KAtcKkaTcMFjhC?= =?us-ascii?Q?dLBlgIbatYL+F8URkc6Zh2liGtdZdmiUF0TSglmJKpFoNIBJbKCbOoOnLPdi?= =?us-ascii?Q?0QUa+RIcZDldGv9snIv9cS0EQFqepD9CrCXgUJgV0ZwpTHhRa8CYigBnwa8F?= =?us-ascii?Q?nE28BTLClYp3VYChvlQ8j++td0Af5qGalErfM1CxI9DnMsSWkcKRdzvyNBbR?= =?us-ascii?Q?ULO1IDy6BraJzryAOJakwWDj9Q5bfX/vb+aJTiI5UQyl9lVi3IiI/UTMl9AS?= =?us-ascii?Q?Z7yle81JFpUKGsRAr2POsot562uDJeYdnXe78c0HqUxEhXPIAwXhBOz9w08j?= =?us-ascii?Q?tpjBn2dzc7fy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PcUVjYz8Zw8RDwFY5w/ARNFZ3acRvuGwGhfplNOh+sa24K5Pxg==; 5:F85O0AFdL8tpRsmZmz5hnc3StMiu9hruiW8QBVIH7SUPz+Qy2GtqqWDonQk9bRCOSMNZYhPL4PcOMy39h42mHj5HzyciMUT24sdmncTIHcOVHnHC7JBRnqL4umNUSLOSdA/srLkNnDgDQ92I0g3P1Q==; 24:L2wNRuwSOCpXIEAx/bwBsIU0/sHXxpybQekBoxJ8BpIhRBLvisoOIjs5O3q5jeXrsSgsp9Y017Is+3fgYhzvyhltKkMDA2BiJVIfR7kux0Q=; 7:HHhcWgjEfji/Pac1LeIAlkjAJBWNzGmUMOyR3utj5088+B8gp8XkhiVCeLL8Y+yaOck9/sSglIO6L/ffY+ds1vLs5JArN6Moj+Yy6KEhaEEnb+md4p21IIvrXq713/K+c1z0hG+5mqWxaSymojLB7QZHImv0UMZv6/j12QOKKrJHj3IofeAYEgNj53C18E7n7EXEExonBskKO96jZmJLwvnp5DZvbvI1bn9g4B1CumU= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR12MB1410; 20:5Spryqi2Knre2Hj9QToowN/difMObUoLkKN7G7adKvw72HXAgbShfWs7V4ICoTryRCgP6DNRz8YTo0vYRaVQphOB2nxZeksQ5b0c0L+BtCOkUOCm+wEV3tUc6mBmquED4dZhuJjFCdFMCdKWNCa5clnUczI/kC0X0C3gCAAGdsvdbRI5osMF+9Q5C2/wERkwRtWu58dmgk8kwpq0Jk0xATH/NI4Ne89P+1l/s797Jvu9ZulAaWi710MsUfag+gTn X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 15:25:34.4430 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR12MB1410 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: , Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP In uvd encode parameter package, parameters input_pic_luma_pitch and input_pic_chroma_pitch should be picture width align with hardware alignment. The hardware alignment is 16 for amdgpu family earlier than AMDGPU_FAMILY_AI, and 256 for later than and including AMDGPU_FAMILY_AI. Signed-off-by: James Zhu Reviewed-by: Leo Liu --- tests/amdgpu/uvd_enc_tests.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/tests/amdgpu/uvd_enc_tests.c b/tests/amdgpu/uvd_enc_tests.c index 7518103..bbda131 100644 --- a/tests/amdgpu/uvd_enc_tests.c +++ b/tests/amdgpu/uvd_enc_tests.c @@ -272,7 +272,7 @@ static void amdgpu_cs_uvd_enc_create(void) static void check_result(struct amdgpu_uvd_enc *enc) { uint64_t sum; - uint32_t s = 26382; + uint32_t s = 175602; uint32_t *ptr, size; int i, j, r; @@ -463,6 +463,8 @@ static void amdgpu_cs_uvd_enc_encode(void) ib_cpu[len++] = chroma_offset >> 32; ib_cpu[len++] = chroma_offset; memcpy((ib_cpu + len), uve_encode_param, sizeof(uve_encode_param)); + ib_cpu[len] = ALIGN(enc.width, align); + ib_cpu[len + 1] = ALIGN(enc.width, align); len += sizeof(uve_encode_param) / 4; memcpy((ib_cpu + len), uve_op_speed_enc_mode, sizeof(uve_op_speed_enc_mode));