From patchwork Sun Jul 8 02:35:32 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Hyun Kwon X-Patchwork-Id: 10513005 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 1F33060233 for ; Sun, 8 Jul 2018 02:37:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 01B1D28718 for ; Sun, 8 Jul 2018 02:37:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E9C4F28724; Sun, 8 Jul 2018 02:37:33 +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.2 required=2.0 tests=BAD_ENC_HEADER,BAYES_00, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED 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 8980328718 for ; Sun, 8 Jul 2018 02:37:33 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B27786E002; Sun, 8 Jul 2018 02:37:30 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM01-BY2-obe.outbound.protection.outlook.com (mail-by2nam01on0064.outbound.protection.outlook.com [104.47.34.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id 357D089D42 for ; Sun, 8 Jul 2018 02:37:29 +0000 (UTC) Received: from BYAPR02CA0046.namprd02.prod.outlook.com (2603:10b6:a03:54::23) by MWHPR0201MB3513.namprd02.prod.outlook.com (2603:10b6:301:77::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.930.21; Sun, 8 Jul 2018 02:37:27 +0000 Received: from SN1NAM02FT020.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e44::200) by BYAPR02CA0046.outlook.office365.com (2603:10b6:a03:54::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.906.24 via Frontend Transport; Sun, 8 Jul 2018 02:37:27 +0000 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 SN1NAM02FT020.mail.protection.outlook.com (10.152.72.139) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.906.15 via Frontend Transport; Sun, 8 Jul 2018 02:37:27 +0000 Received: from unknown-38-66.xilinx.com ([149.199.38.66]:51625 helo=xsj-pvapsmtp01) by xsj-pvapsmtpgw02 with esmtp (Exim 4.63) (envelope-from ) id 1fbzZm-0004mo-KB for dri-devel@lists.freedesktop.org; Sat, 07 Jul 2018 19:37:26 -0700 Received: from [127.0.0.1] (helo=xsj-smtp-dlp1.xlnx.xilinx.com) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fbzZh-00074W-Fg; Sat, 07 Jul 2018 19:37:21 -0700 Received: from xsj-pvapsmtp01 (smtp.xilinx.com [149.199.38.66]) by xsj-smtp-dlp1.xlnx.xilinx.com (8.13.8/8.13.1) with ESMTP id w682bKmw032260; Sat, 7 Jul 2018 19:37:20 -0700 Received: from [172.19.2.244] (helo=xsjhyunkubuntu) by xsj-pvapsmtp01 with esmtp (Exim 4.63) (envelope-from ) id 1fbzZg-00074L-O0; Sat, 07 Jul 2018 19:37:20 -0700 Received: by xsjhyunkubuntu (Postfix, from userid 13638) id 405362C73C6; Sat, 7 Jul 2018 19:35:37 -0700 (PDT) From: Hyun Kwon To: Subject: [PATCH libdrm 2/3] modetest: Add support for YUV422 and YUV444 Date: Sat, 7 Jul 2018 19:35:32 -0700 Message-ID: <1531017333-1483-3-git-send-email-hyun.kwon@xilinx.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1531017333-1483-1-git-send-email-hyun.kwon@xilinx.com> References: <1531017333-1483-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)(39860400002)(376002)(346002)(396003)(136003)(2980300002)(438002)(189003)(199004)(26005)(4326008)(36756003)(16586007)(107886003)(6266002)(336012)(44832011)(478600001)(186003)(2351001)(316002)(476003)(103686004)(11346002)(2616005)(50226002)(356003)(48376002)(81156014)(63266004)(486006)(126002)(6666003)(6916009)(8936002)(81166006)(50466002)(2906002)(446003)(42186006)(76176011)(106002)(426003)(305945005)(106466001)(47776003)(52956003)(8676002)(5660300001)(90966002)(51416003)(107986001)(5001870100001); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR0201MB3513; H:xsj-pvapsmtpgw02; FPR:; SPF:Pass; LANG:en; PTR:xapps1.xilinx.com,unknown-60-100.xilinx.com; MX:1; A:1; X-Microsoft-Exchange-Diagnostics: 1; SN1NAM02FT020; 1:gkpODDEis7O8O8mpWUjkWIfR0pLJySOl3Zli5E5N51YBEGXk73dltUdZCeym3JMvI1It9Fcbnn6zmTXyf7qnfjbLzCz38GTKZvAmzlzh7nAd2BaEr2yT80FAOBp8uUM/ MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 0286235e-f419-4e6b-79c7-08d5e47bbe84 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600053)(711020)(4608076)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060); SRVR:MWHPR0201MB3513; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3513; 3:Q3J0+Cx9zBnPPP292ICIY1pSfJn2lURcSLyPp7fvUZu5ZAUW5yUYaaokZZALbu4tDKYp4hqbACmyrt0Lq4mXhEB60XSrKX1w2CK0hPAbIzy/ERXge/lPtTWYCXGxX9YciPoHhv4jZSZmk9FqQEOIqB/mS3RO1YsoK6HIkQs5lEE/Siux1fuzoJD8RlirPpM+23PbtFDACFM4TSo3TWbwlnc09APcUsDkVZqEpHAaXee6Ytloz6z2mIuDtWim180rf3ihy4j0dCfVTo3GYeAqPlxythvwByJkH6TAlT/LzHv81K7BRrQjL8RZ7Si4S4j/yvB+bzDjwYekx4WINmEryXhIA6ReYjiC5K4jrD54Lyg=; 25:uUPmOPPgR8fFsvqTZbD2h3ebGfWtiH+whnpuDXZmEvIiy+3FhnLVj7TLFHS86I1Q6xav8bveQgxJbo9EILuNAQQ0mmKkNQ+eyMMtAryxuOc3dKlgMuVG+3YRIGaCfeUMxHG0qBNoj94LF4Ca6yuxZxvrd6tZN+E9WXPL9KWOq0f1+UOMhfchbCZK9o9ji0b9588NVK/71Nu6DBKBQD8zxn0BbIBZTfBoRblfnjo15YdEj0IAVommyPr1cM/LR/aXzmzObPGiN2IOC8JIx6Q3cQcsX+PXcEiiz/Ri+xjCC9ToiQfOxtOBJctrbGnyu/tQ6rlWAnTM5ZNo2JMj2SHzoA== X-MS-TrafficTypeDiagnostic: MWHPR0201MB3513: X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3513; 31:6OxTiq9fPmbwVxJfZM0BfqddNLD753KhHvBLZapBfpf4YS6np6uvzqtqusywA08AlaDTOoj+KUivz5AjJfWeszHhHFG8TsWUPyxmd1TXnu/Dp9lrXobxsTJBsuZViASy0GpAxU1w9D0pNC1L6YLM6yj5QNI8VT8iWiiw8h1LqPz38Tl0Dvlvv6vZFUdu3J/MQMLzVnR0GvoI4rfMVJ8CaQxB9XuEVsWZxo20Ml6WpG0=; 20:YH0gJ4SUyis9juEG6MWghrgeZgFfNBidBquw/Ewt0B2qxibIVR4YfonhNbTUWRuM6DHapIMIxHWeAAXmktqnutiaa4ovYQd9F7cUNL3YbtomG2N67E0qMnP8/2cbAo1a3rs74F3XXFDVI6hv67g59POvjcuiLpv8IADG+fuLQ2tq6sZWlOfBz28RrDzpT5X+tUxIwnWZKuEEi2Uan9PtEsUht7yojA7kD5hj1Jd5Ds/0jR9mxcVISkfWeI9Rfsdd7+ErDPvKCzPiNTEuqWfaHJfNTZZgczVgfoTlAuBmGS1ZXbfjn7HiVikNwg2kFossFSnE/aeUZ8uRi1ob8fuZaPXO7R+SF+anY3Pepb2MZd4ltkuStVYUwQf+7bh2E0Sc3JlDK4zQBnIXxwzmPt/SaCwhQG6mWTyI4cvNT10cBdDLo0FQ4ecVLi+MeL6m+1M4XQSAlWcNotwaIWtt7xN+sSXSrtkRjuELr8K6W/WuGH93X0frUh0iuIBj7Yf9ihsI X-Auto-Response-Suppress: DR, RN, NRN, OOF, AutoReply X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(192813158149592); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93004095)(6055026)(149027)(150027)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123558120)(20161123564045)(6072148)(201708071742011)(7699016); SRVR:MWHPR0201MB3513; BCL:0; PCL:0; RULEID:; SRVR:MWHPR0201MB3513; X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3513; 4:3PA1X+oDmcbMH6vhLHl9p3PWHpphOAuwAo9d060qc/wOGDjwbT+l2ETR53QevTO47g5BVlH1ieCcjZhiN07vZ1D40gd9VLE5V2ZR71HdPvght80Fbt7ZczOrx4DSD9F8drazJDl6mZubxUDprmVPUnUF26RaytOCxAF6KeEgSu6JEv42WVRhixP6b0+8aVYu/S1Yj8wKe79lC9V22WcZ/1i72VFrJSWk6/4f4lai/0K6CzntBC0K1w/wufb8jW1cpfBUNcXG87Znoz9XZgETsxLufKq5W4MnRAve7jyQB/DXL6WVje2XA7difz5srMgC X-Forefront-PRVS: 0727122FC6 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; MWHPR0201MB3513; 23:yBctd6ebKRCQ9mllO1S96s5ki5aKNOpmiYg4Jcb?= =?us-ascii?Q?iEutH9SGCpdmReZuK+zpA58N7Vp1/FTxDvoOC4JGp6y9NTKGu1NrSlfgU0JI?= =?us-ascii?Q?Xo48by0AMG1FGa59woHQqPSqBwS78oNgwo4svzsjdw0JFRUEhAQkf7DeVZZQ?= =?us-ascii?Q?3f1E2mXkK8o0Ldn0fa7bS8j6Al+8/K7/aso2KurrvnMpgUtiEdswjTf0+Fkp?= =?us-ascii?Q?pjpqPwV+EucxohMucGI2D6Yb2Np0R163ZQsP99KmoJgOFmdAd1VA3D7AYRpY?= =?us-ascii?Q?KrlUMa1cO0BDAsk7p1IqIYGZ/dl1qGMo5aJayKQMSST9jjn1jS0hJWP/N/u9?= =?us-ascii?Q?NiGr04O/WZ8vXRJPPv+rHrB8PMqSfL/mQBkCuB0TSY2SqlO7dfdOpYnJSgtq?= =?us-ascii?Q?2xFqLmmqW/LZlh7XH43Ab+yg6JqBGs2bRcQW+DKTp3PfKeSS3H1wNh0LB5Nb?= =?us-ascii?Q?lyj0jc1Of9aCdhf6gilAzWt4sBNGqk9evV5msDMxrlKdfRlJB2iSd/Qs4hFS?= =?us-ascii?Q?2r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ba2CS4oioLGtlBHsv+DpR43sL5dtAvrwetxJ8vMCfRCfIFSFCMbdBJxy2BSJjVQjpX6GDUYYOPL46mFkcZ79WGbRbD4xDX5AxPDbUjh/XlFNG1yK0CfqAi1CXLT8wGA6Gytn/H2Q3OU12JGPm/k= X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3513; 6:j+MqF9y73WbXC+CWh38jGn3UC592N+iPGwPaltntwvwmSC7z7IaDKrQg07WNjpoeZAcOqomJOjiuoLkml1C+CM+Z+OIEatrA+jIf8c25cAmCjcECUcmQCD5t+9xsRO+Vl0BJ7b7wSCJIUeNPAmgYmAb5vMdOhPxDziS7LBdcrLkIhs3+Ko/ZZ2MlLmnlvxR0K0mHfRPEA+5vnEJ+wN/P8s4L5IDjDNGB3LZDk6URRip6dJDHlH9rb02mmygO6oZZEyLolFmVKnmSQLsyMZvlakfa6ZDoZB5Y2jWIpc4WXKEKSPb5yBlBflhHhSqvWlYWLop2vIXDaBRyvPrcCcG0O2kgW6JiMgPzEa8goteXNJF0xW1N0lKLdXkq0ZJr8CQOBuRG2PlQIyF/B0DPXKV9wjIrKE6/aima8TWfau3Mvm5mmqYt1pVhTYfosRSOi6gXyzax3WaRTkimlqmcI7DCzQ==; 5:JV6HVXyUIzUEaEnRLMLytH9SQo/prIyaQVBrNKYdHkrdA7MkTkQT9YsbngVG05PWgDmD0Mg0mrooPjouXxEpSAvM7R0a6AJRkJooWfKSuv1z6yRwUH72KIGCTgyUow0hBd8rQLoI6aocGv5naXVMo6AbCvVZKJuzgCcLp+f8JW4=; 24:tpao/h9mranKBmQQ8dstoft+JUlOmvVzjBYkF/d7kDGZittLztjOzGq/US3yFhdsRqQ+qiaDptcvNdkmrMnXXZZJFPQeaZEaY2U3KVtBH+M= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; MWHPR0201MB3513; 7:s1N+jdpwwYhc1troc4B/FeFSz1elTtYt9aAkfK8gEmCDumYPLXTRRx8J6/0ELwq+LyDGaBk0DEyssxCd9XB3fE3rMi79wPS74rV4rONJuCjPpmg9fbLZSsGfyFJg5K57KTkWZqlZilFHIakgE+aLZBlkfYRLKTTdVon5j7ehdQDGaY086otwb06f9RMo5frvA+/t+vCbm75EP8Tb/GAsDkp16VI5xlV7V7msZNMuwopWXfWTkYxHWmuzbCEZ1HF/ X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 08 Jul 2018 02:37:27.0006 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0286235e-f419-4e6b-79c7-08d5e47bbe84 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: MWHPR0201MB3513 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;