From patchwork Thu Oct 5 15:21:19 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: James Zhu X-Patchwork-Id: 9987469 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 E898560291 for ; Thu, 5 Oct 2017 15:36:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D878628A66 for ; Thu, 5 Oct 2017 15:36:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CD65A28D1B; Thu, 5 Oct 2017 15:36:29 +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 B44FC28D28 for ; Thu, 5 Oct 2017 15:36:28 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 546136E816; Thu, 5 Oct 2017 15:36:27 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org X-Greylist: delayed 649 seconds by postgrey-1.35 at gabe; Thu, 05 Oct 2017 15:36:25 UTC Received: from NAM02-CY1-obe.outbound.protection.outlook.com (mail-cys01nam02on0088.outbound.protection.outlook.com [104.47.37.88]) by gabe.freedesktop.org (Postfix) with ESMTPS id 9C1996E131; Thu, 5 Oct 2017 15:36:25 +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=VlVFKfLPFapwZrTn/ea0MYovFcWL/iKnf6N0AB1rt6pNLROngMilBOLVYig1QXZcxVFBpQkKg0J2nTqY7Xcwb09dJQ+czWDAqkvvmak28N7cxtXvKF9PQboG5mzQSfcVhGlpBFNmqjDZxUydutWKQGxMcXv6Rs/cJ06XSpCVLVM= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=James.Zhu@amd.com; Received: from JamesZhu.amd.com (165.204.55.251) by CY4PR12MB1415.namprd12.prod.outlook.com (10.168.170.22) 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:21:31 +0000 From: James Zhu To: amd-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org Subject: [PATCH libdrm 2/2] fix uvd enc data corruption issue Date: Thu, 5 Oct 2017 11:21:19 -0400 Message-Id: <1507216879-9815-2-git-send-email-James.Zhu@amd.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1507216879-9815-1-git-send-email-James.Zhu@amd.com> References: <1507216879-9815-1-git-send-email-James.Zhu@amd.com> MIME-Version: 1.0 X-Originating-IP: [165.204.55.251] X-ClientProxiedBy: CY4PR01CA0016.prod.exchangelabs.com (10.169.249.26) To CY4PR12MB1415.namprd12.prod.outlook.com (10.168.170.22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7527a5e6-f994-4895-5ccb-08d50c04c1c6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001)(2017030254152)(48565401081)(2017052603199)(201703131423075)(201703031133081)(201702281549075); SRVR:CY4PR12MB1415; X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1415; 3:5B8t6EDNXYw+Jhyw9NKQoM37z+qkolqK0wXbXm2dPfle0vH54OVst7VcbuLGnP8XC2mTfFrBsR/xiCckIHu2yVVmoW0eSzKDaIx8s+I6+sGKStyzpRim2Ysp+oX9fup1pRADHPSm63XR/a54UjXyc9SjqMDsOKjMV4ag9/NVpAnjuceRXEWIGgb2EtcsQW9Q+fCQQfYpi5+O+5SSJRxTB6XA8YwgpauwFMWL2uw938NiVnACBC0IKS+FvWVGvfG+; 25:gb6HJO7LwvCFlX9CNxAGfhMW1LbF9MA34BT2uK+vhSGnSGh0kf4ItuViZ8cN2QPdtv745f/IS1/vzS0Iwlo2AHWlYP4nBwpPyaSnajycm6E9Nk+JewFHN2FtkhuhBlhDFJtf68LvAWtoe48vbFXmhB2Wujii4K3LmGLpiAnx1jJx40IzSMZAq6QseLWhLB2GmgXtKsJtu9Dx/efdNeCXitpQymgsmNp5lyyOwUzqDfjpu2ZNVt7cbArVPFywXPn+iieAmal3Tdd+Iy20u1tYocRSyf2KHPvDqAUlpTg2pZh3rGstWTKnMNG7ryn/riWdM8/ZVRRDXaPjjKCWER1uKg==; 31:xodxAJQvJeUeLRqV4RxXiFfG8s66ytJakAFOGY7dYphgz8JheoQHo5lp8HcZHZ4b7EIXONfOA5aXa9Hrck6t6S8pIuJ+URx2GBSFmY1SbG025Gxv7bpAl2AURkkxUFt5kNqEo9Etr+MRwK3gsrOzhdB8/AzC4Ef5CnXQvNqyUAqWWLah3HGgyHa2PI0xl74gPJKTaMUgzu870k9urCWLMgMMmroUbfFC0XCmb175N8I= X-MS-TrafficTypeDiagnostic: CY4PR12MB1415: X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1415; 20:AS1FFU1tdtVVByjy3sFCTwLfPhtLHhlWIkLmYedbOKJCsP1T00eNr6dPN8XG3n9UrcGMg0bhXL1VzcqBce1jMQMSFLAGYwGz7HIETcwYTWbOMDkanlrzukxvFsEPpoA62j9+aHgB18Iv63gSDt+LLiUXu/pDjQPfDeQg/nZHc2m5gbbthThVEOUO0RW5Sl5Ph5X11lOAm0ee4dxJqFi+zTf0RaxgRfOIKWVIhTvyKRJycCKsAoKx7akw9jERAh7WKTIrFxSv4cBP4OY5ISB0klwZOag5Ne8Jrd0qr6hlJ7EN6WlL0uG2WHzEY7nYl/nXtdvPgOqDc3sAKYGze1cQtK7WIWGNVmnxQEFCGgzIc3VfwFICz/JpSdz/km1DPAd6fu3mljEn/l/2IHAlcbfaMzHFiLtP3/3u9N+/bTGmALxt+POybyTr3ox35u8d2cEiIyyLzItr4EZndKQyR7Zz1mEQiElRp1b6j7eMgPMFd6Ri2VpM361Pw61cSYzwQM92; 4:75uLRx1y9a+Z1SHyTZ8FPdlucFVVzj2MLmSIk2VUBheNKPZ3P3lDrn9yG/QgcKXBnC2LBzM4HjUvcWWTaskVsetaINElmdO9MBPWp9pN/24bqx0sCaWniQtk0ioc9vO9QT45QTQui2pcHMJR9sTqgF9pVyyUTqlgzLyr+lCrQCFQTXhGuCKMXCKeP9TW6loaqrtizzdX1ys8/gNSzu2VfpIwtzurpe17shdOZStszZXxlbmT3ZS3z6dZGDwBrmYrsXLxoRh3UK6SxYLV6eRQQYRV8R0rLF3jZEDCvYHJ88E= 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)(5005006)(8121501046)(93006095)(93001095)(100000703101)(100105400095)(3002001)(10201501046)(6055026)(6041248)(20161123560025)(20161123564025)(201703131423075)(201702281528075)(201703061421075)(201703061406153)(20161123562025)(20161123558100)(20161123555025)(6072148)(201708071742011)(100000704101)(100105200095)(100000705101)(100105500095); SRVR:CY4PR12MB1415; BCL:0; PCL:0; RULEID:(100000800101)(100110000095)(100000801101)(100110300095)(100000802101)(100110100095)(100000803101)(100110400095)(100000804101)(100110200095)(100000805101)(100110500095); SRVR:CY4PR12MB1415; X-Forefront-PRVS: 04519BA941 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(6009001)(39860400002)(376002)(346002)(189002)(199003)(36756003)(81166006)(47776003)(66066001)(97736004)(8676002)(189998001)(3846002)(7736002)(8936002)(81156014)(316002)(16586007)(478600001)(72206003)(16526018)(305945005)(2950100002)(68736007)(50226002)(6666003)(5660300001)(6116002)(76176999)(53936002)(50466002)(53416004)(86362001)(50986999)(5003940100001)(2906002)(101416001)(450100002)(6486002)(105586002)(106356001)(25786009)(48376002); DIR:OUT; SFP:1101; SCL:1; SRVR:CY4PR12MB1415; H:JamesZhu.amd.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A: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; CY4PR12MB1415; 23:ttSJe2HjF4QQN9JDJunBb+HZlivzUPbT9+0vjDPGn?= =?us-ascii?Q?X73pg0pi3XBKu1HwHDQwH0a3an3QW9JHlnq52kuuuJYfBy8P1MDzcz0FGW5u?= =?us-ascii?Q?VlNGERXNF6KbsCK0nu8HxPItxbJPSSYgCwkc2gSS7cCw39jz1KU6wXDuKl4Q?= =?us-ascii?Q?+VPyN3/zAQrqMxxF2cTPOQ4aAICO9quTQ46KaN89BvbLvwhGshf3zHCR6sez?= =?us-ascii?Q?ojbkGSaaDNFjuPC7kr0B+0C/j1+LeTJGPDwF0xMYqmjvsUpbWVtf8/CyE1rJ?= =?us-ascii?Q?9Pr91VRPT2vvcXPqFsaaQsPqTAAGVE4KzHGKe6mkIFN4NGBq9ciau369/+0b?= =?us-ascii?Q?W/KBtz4t4/2xhhOnXEW2ixNg1mTWimGPy6m/JJqBXSeSFxABi4LFYTT1IARM?= =?us-ascii?Q?uDWlJFYHZFKe9BVOBsEQuT+b0oULUgIsYXn4gthUlQ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JqIo5DE+aLt/6F6733ena706wwey0eum6V50H8cZtRqvEP4C9nD6giGsufzSzeWHZovZM39Q55xWvw==; 5:3JYCSSxOjIBOP61obM5jL4lJW18qKYEOR0IU1lPx8IAur5DYhcosP/9f14Qt+SzJVFQX/4DioxvGTCzEgRy4HzXYWSXTI8XKp/K5i+Dp68Lk47vMqO/9FY2seFT6+/w23sF/rWT/k0GKH7bM56Cdiw==; 24:7DiA0g3uhPYHBodvahLjCmeWtJ9V0De/sErB7Hvz19u0gNPYHoWff6qhpRoDyoytcs0295clHMAlsOHn/T8+VlInh911SDT34tehNuucMW4=; 7:CJNmhVj2fHWgQutfxVqAobC2uqnqC4mreykRwO2RPQF3Dkpgq+ZZn4JJ6WvNegC0LM7KKp5/HvWu7+BNnTU+OpTOXepsesaRKjgQ7/xTcwstYX5Q4vHckUlnFjxXrZ8O4XqLTz3XfBMwQ1YAApHbPbMFSZaKU4BvsCyCQKmZyNWbE2T1wFZZVOGMe935W3/Ky3WzRss8FR02Me+rOSrgqsjubM6mylSmRQCtimDFXhw= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; CY4PR12MB1415; 20:AJeOm2/L21/J0MUMnn+4o5URhOIWkSm7VSGl8B1tl0vJLDWT9vUYUluGJQcHi+hz9GJ4EgXru9u97AEt4fpYqfeyObOErE2i5V9dTSUaMn53UVgxdtDVxRzCtMKPvkXtTtim3DPehHjoncqFph637cPz8RIrIhj7htpam9Bpn0ib064MutnVK7UOh9cwJVcn6Uxum+OocI8z/+kPvZ7E49laBFeFoVSLgz8H7v8HQA/jP17I26DPtBD4ITj2DlKV X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Oct 2017 15:21:31.0542 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY4PR12MB1415 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 --- 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));