From patchwork Fri May 4 23:40:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyun Kwon X-Patchwork-Id: 10381785 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 5104F6037D for ; Fri, 4 May 2018 23:42:39 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 413322956B for ; Fri, 4 May 2018 23:42:39 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 35E7D29576; Fri, 4 May 2018 23:42:39 +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=-5.1 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, DKIM_SIGNED, MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED, 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 936C72956B for ; Fri, 4 May 2018 23:42:38 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0E3FB6E0C8; Fri, 4 May 2018 23:42:34 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM02-SN1-obe.outbound.protection.outlook.com (mail-sn1nam02on0069.outbound.protection.outlook.com [104.47.36.69]) by gabe.freedesktop.org (Postfix) with ESMTPS id EFD9F6E0C8 for ; Fri, 4 May 2018 23:42:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=xilinx.onmicrosoft.com; s=selector1-xilinx-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HS3n6gwCf9Ap/E8S1yuayfj7KiGlYgJUaJg0lsw3Rsc=; b=k3dweQmKGxzjkvr+d0m3oNhTLaAP30SK1IvotpE3RU1Lv+0URU39bXlsvqDFO1klLV7VB2pCmJBd7yjPwGrxv512//c4VGYmf5Fd4qsTwSn9JdEtIrcQ+kUcuP4KLdezrdu7fwPkMPRj4BPcW7WimC704Nq9uNTTVpWkBbUsmx8= Received: from CY4PR02CA0029.namprd02.prod.outlook.com (2603:10b6:903:117::15) by SN1PR02MB2045.namprd02.prod.outlook.com (2a01:111:e400:7be7::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P256) id 15.20.715.24; Fri, 4 May 2018 23:42:31 +0000 Received: from BL2NAM02FT054.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e46::200) by CY4PR02CA0029.outlook.office365.com (2603:10b6:903:117::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.735.16 via Frontend Transport; Fri, 4 May 2018 23:42:30 +0000 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.freedesktop.org; dkim=none (message not signed) header.d=none; lists.freedesktop.org; dmarc=bestguesspass action=none header.from=xilinx.com; Received-SPF: Pass (protection.outlook.com: domain of xilinx.com designates 149.199.60.100 as permitted sender) receiver=protection.outlook.com; client-ip=149.199.60.100; helo=xsj-pvapsmtpgw02; Received: from xsj-pvapsmtpgw02 (149.199.60.100) by BL2NAM02FT054.mail.protection.outlook.com (10.152.77.107) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.735.16 via Frontend Transport; Fri, 4 May 2018 23:42:29 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:59096 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fEkLM-0007LQ-Rl for dri-devel@lists.freedesktop.org; Fri, 04 May 2018 16:42:28 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp2.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fEkLH-0006XN-LC; Fri, 04 May 2018 16:42:23 -0700 Received: from xsj-pvapsmtp01 (xsj-pvapsmtp01.xilinx.com [149.199.38.66]) by xsj-smtp-dlp2.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w44NgLa2020401; Fri, 4 May 2018 16:42:21 -0700 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fEkLF-0006Ws-Ha; Fri, 04 May 2018 16:42:21 -0700 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 7D0C32C7455; Fri, 4 May 2018 16:42:20 -0700 (PDT) From: Hyun Kwon To: Subject: [PATCH LIBDRM 2/3] modetest: Add support for YUV422 and YUV444 Date: Fri, 4 May 2018 16:40:53 -0700 Message-ID: <1525477254-3338-3-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1525477254-3338-1-git-send-email-hyun.kwon@xilinx.com> References: <1525477254-3338-1-git-send-email-hyun.kwon@xilinx.com> X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.2.0.1013-23620.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:149.199.60.100; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(39830400003)(376002)(39380400002)(396003)(2980300002)(438002)(189003)(199004)(50226002)(4326008)(486006)(8936002)(5660300001)(6916009)(103686004)(478600001)(2351001)(305945005)(6666003)(47776003)(2906002)(63266004)(52956003)(336012)(356003)(90966002)(36756003)(8676002)(16586007)(11346002)(186003)(42186006)(106002)(2616005)(26005)(476003)(126002)(48376002)(107886003)(106466001)(44832011)(81156014)(76176011)(51416003)(81166006)(50466002)(6266002)(446003)(316002)(426003)(107986001)(5001870100001)(217873001); DIR:OUT; SFP:1101; SCL:1; SRVR:SN1PR02MB2045; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; BL2NAM02FT054; 1:JaXsbLiuK5geazyM0qg4cbcdnzHrzaAXeWc5/gDROicrsZyJiAM9CxN9SaCANIBK1jVmyNkCZFWFF1MdRnc1ewiYEgtKHUj8fZBN5+Vt6mmcO6nBa2fBDEQBnSsS2QlX MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652020)(5600026)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(2017052603328)(7153060); SRVR:SN1PR02MB2045; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2045; 3:aYUsm7DIjZzYkYceRDE2j5O4swFmXg76+c24V+LjCGtBLirL5dKB2EWEfzcfDs+Kyrhw3NuQahZr9zFSxB3LT8hEGJefLwpcxDhKD7O2jIXQsudjRzqjn5wSVxa84Y4Z45rVN+yZgYh8mgwBmMhx1Rj7fomOawLCED3HPSBY6tiXXdM+SJLEhLN62A/St9pip5yDygdWnV/GVR+F4X/Z/6CBFX4/Dce25aRUKprIWcV4OQoyEdaINQTzqSULTCc70f8NNjntQSTeF2yXULUilMVFWGXfI57U2xo0C8IlhEOgRJDaVQ9cKMS+mDW3TbuZoNe8oEl9o9cN1Kz/c6uHz0CtHf/zeWMIVOyT67hDf6E=; 25:ylXsR3JznxdgMkwbUyRQB+icifZyPYzE9bapMiFwBe6kgCEo/dquj+pNOJJEx45LpTCthWtMaflE2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spVr2XrqMGTIiMfmVyk89tFDpsLOrJ X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(5005006)(8121501046)(3002001)(3231254)(944501410)(52105095)(10201501046)(93006095)(93004095)(6055026)(6041310)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123564045)(6072148)(201708071742011); SRVR:SN1PR02MB2045; BCL:0; PCL:0; RULEID:; SRVR:SN1PR02MB2045; X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2045; 4:4LuxcLULeR54aii2ZZyaeNxaVUXO835zbeU1bOeUIX1X/y67gpMKxUbwgPTdHYjDGuEJQLaGG5h6Ci9dDKlI48ZC9qMyVV6iboyUKOCPfEn3yZB42jh4Ms12J1fByWYVyCY7rJGMlzfz1TDWPymzT8+TzUH54ZJjgLBLa9heCIk5Wc4Edy32OtSN+GoPR9m6C5VZOCJ4S7QLRNEgTyd6idB29PDDxnuJ/h/Ps0ScfBgSmLC9OxKlzGH4utKYearuOAaGBci+ePrLO1I0eIyMNpGoFyMjlEFmB6fYxQLz1JPZRje7pUldgt7zt3cL8eaQ X-Forefront-PRVS: 06628F7CA4 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; SN1PR02MB2045; 23:j50liA68ZQ4uRoxA8vXRU/yB+suv9MO0CyfgWokso?= =?us-ascii?Q?heZiQHGYC/F1XrRHuN8qm6bKZPTIjzsl4+99V1OCrln/fz3pHcuGVmysfdia?= =?us-ascii?Q?nvujNAFSkvFE7Y/itR3B5R+W56BdPljByRCaTFB+xXfzZBUhTt+PThLfYRCK?= =?us-ascii?Q?dY6XobB4sWVyfmLr4KRTGsa5OuvEL1gSX1j4WlBdAlR0GjeO9K0i/pEu5n1h?= =?us-ascii?Q?9Os4Ucv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ZspNNphOBuWv1rxXAwNmDsH6bZGxLLp4hXuP/4XXgCQJoEVvwQaNuzRIPMywY2JAI+vgTbX1g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; SN1PR02MB2045; 7:Keof8QjiKVumRLFEWBsnmKkmbIMO0aPM6Y/UdIo8MTNQT3hhLA380A4yCnYoAn8f5r8nxQ1qW0FdEKzvMNkFf1ni4KOEPqiRWkxc0RUEBsMtj8yNooQU5df2zUnACzq0kbCXFaXGK0ObLi23nv9SMUdU9DXHYux+46J13V5DZbiSkw49M2YqPgzed1KUxFa+sX4eSgP5PFPyvCz1mYR/hB7MqVKGBPcyZ1lhmtUtoyjZT7o2rNtcsm4BQoktU2pe X-MS-Office365-Filtering-Correlation-Id: 413b5aaa-5401-4a01-4621-08d5b218b36e X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 May 2018 23:42:29.7100 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 413b5aaa-5401-4a01-4621-08d5b218b36e X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c; Ip=[149.199.60.100]; Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN1PR02MB2045 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Hyun Kwon Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP This allows dumb buffer allocation for YUV422 and YUV444 with correct subsampling values. Signed-off-by: Hyun Kwon --- tests/modetest/buffers.c | 29 ++++++++++++++++++++++++++--- 1 file changed, 26 insertions(+), 3 deletions(-) diff --git a/tests/modetest/buffers.c b/tests/modetest/buffers.c index 9b635c0..769399e 100644 --- a/tests/modetest/buffers.c +++ b/tests/modetest/buffers.c @@ -127,7 +127,7 @@ bo_create(int fd, unsigned int format, unsigned int handles[4], unsigned int pitches[4], unsigned int offsets[4], enum util_fill_pattern pattern) { - unsigned int virtual_height; + unsigned int virtual_height, hsub, vsub; struct bo *bo; unsigned int bpp; void *planes[3] = { 0, }; @@ -141,6 +141,10 @@ bo_create(int fd, unsigned int format, case DRM_FORMAT_NV61: case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: bpp = 8; break; @@ -204,15 +208,30 @@ bo_create(int fd, unsigned int format, case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: virtual_height = height * 3 / 2; + hsub = 2; + vsub = 2; break; case DRM_FORMAT_NV16: case DRM_FORMAT_NV61: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: virtual_height = height * 2; + hsub = 2; + vsub = 1; + break; + + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: + virtual_height = height * 3; + hsub = 1; + vsub = 1; break; default: virtual_height = height; + hsub = 1; + vsub = 1; break; } @@ -260,14 +279,18 @@ bo_create(int fd, unsigned int format, case DRM_FORMAT_YUV420: case DRM_FORMAT_YVU420: + case DRM_FORMAT_YUV422: + case DRM_FORMAT_YVU422: + case DRM_FORMAT_YUV444: + case DRM_FORMAT_YVU444: offsets[0] = 0; handles[0] = bo->handle; pitches[0] = bo->pitch; - pitches[1] = pitches[0] / 2; + pitches[1] = pitches[0] / hsub; offsets[1] = pitches[0] * height; handles[1] = bo->handle; pitches[2] = pitches[1]; - offsets[2] = offsets[1] + pitches[1] * height / 2; + offsets[2] = offsets[1] + pitches[1] * height / vsub; handles[2] = bo->handle; planes[0] = virtual;