From patchwork Thu Jul 26 14:10:03 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru-Cosmin Gheorghe X-Patchwork-Id: 10545945 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 97B991822 for ; Thu, 26 Jul 2018 14:10:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8678C2B3B5 for ; Thu, 26 Jul 2018 14:10:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 83DDF2B407; Thu, 26 Jul 2018 14:10:57 +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 E6B092B428 for ; Thu, 26 Jul 2018 14:10:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 9DBC56E760; Thu, 26 Jul 2018 14:10:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on061b.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe02::61b]) by gabe.freedesktop.org (Postfix) with ESMTPS id 4BDAB6E760 for ; Thu, 26 Jul 2018 14:10:52 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:49 +0000 From: Alexandru Gheorghe To: seanpaul@chromium.org, airlied@linux.ie, dri-devel@lists.freedesktop.org, liviu.dudau@arm.com, brian.starkey@arm.com, malidp@foss.arm.com, gustavo@padovan.org, maarten.lankhorst@linux.intel.com, ayan.halder@arm.com Subject: [PATCH 1/3] drm/fourcc: Add malidp yuv formats Date: Thu, 26 Jul 2018 15:10:03 +0100 Message-Id: <20180726141005.8321-2-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> References: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f6782f02-a473-46a6-5030-08d5f3019757 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:rEhQKJ/OgeX850niTfb0zoVvwrpYVwgN0Mb4+thx3VUK+YHTsFEwNZ04QfVJQERI/YoD0iDVaG45BKlHdEHNeibg2gX8Lr+fUC5PODj/rqxC48YmXc4Mn2PKF1csKBmn2Xgt0V0bG6OOjmotcZCctdXfyh3lZxjEXw7aiM1gzpAr2XpDaV35BbRb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ixIIw1PEp4/9QA==; 4:ybwSrJrrZhXoCk98WVOeTLhiLU3hIRwjz8qRfpfwkOC5uJH8tPsRpmO2C6U+2XCZI4Hp14tF9rAopW3GYfQ8tMiixa21TqXlcaU0RCx4qKko0aKMVoo5/an4e5gf1YhVQXWBwn4y4tMPktZSkF4tMasgasFIYlAIZOynIH2yThU3aRnJu6C9NwrtaEeEkhr+267WAxwZdgnivbBzS6zHSHsVQqFaFenTjS6vNa3zh8HXtEaaqbqP+KAXH/tzb9YRZTpOenlhWomAK0hZ0/kXDUfclosTi7+TxGHOTbg3hFNi5M1VhVWz0wpDj6Bg7cix X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(180628864354917); X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(956004)(11346002)(476003)(446003)(386003)(486006)(2616005)(76176011)(66066001)(86362001)(575784001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2545; 23:TG/0rmpzRiVo3Dbhm+V7B7NXBIAJhNOfIKoBpK4?= PzINJx1dQQAEY7YKR/DK8PwmfXObYXFOv8CTyqMCdiEX5S6J3vsb80Y+r8t8zAjw9Y6xrWrtj1uMeopBdwVsWXmEuwrZ6Xbz8+awQgRo9TkEk805z036KiAKeZXlZqx3lrTc+hy0IhtJ7/4kikgdFhCovAiF80m+9HxGWPtq9M6f4ZOW9ugLBdFsjivc6L+JPQSB7Wr5Ic3Fpe+X+EMavMptqOv2TPbm0TkVRcEswKSV2lkOPIo33pd5o+fP9QHTdyJ+qvORs3cL0O9ykFpA8qBlRBBNVHaiKeQGHnHotYLmnroq3+FxJKHDV5z9HH0UJoIQnY3iYWv87Y8Hv7FLGZfG/YNATeE9JbM/0BSwgFEqT/kBv5jN3Fixk8gwLOYsKtxs+5JownqNrsq869A9B6FZZnL+y2kiCeBcVzq1vUvkgZm9eE7BucCpaAuQQOsrL8AyIrMRQQj1WE5nQ76eOjJ/jf3KWvqsac7nN40AXF6CuFU8cODqjfbeEzNlyEMRrr0Kq+uNwFwkaxuazf8/JJXYxQ1D4elW8j2JS5N40C98Mg29yHl6nZIi1RloPMKgCKHFE3tDDj34v7vvqRER1Y9bKst5gspM75sL256hSquavM/RrE8RbgVCntjPgSxjNo79uqp5Yx39GjXhMsZf4lidIViYpoyQTBJXWiNi9D7uBA3VUvz93ZyFvcybKn4KHzOoqoWgarC0UNpjOQY5x5BLCDUc0ZN2/NGXRMWsOWEhJUGTWytqxz0gU6IYcj3KPvHJQqUpW1hWr3kH/BiLTVCsBzl79lO2kDmbsfXV+Y/WoyoG1SVb1mhQkfwHAV5Fuet661LQFafI9dEcVAsuVi+YonbJGXtMeD0eUL3jEGfdDfr3ZB4Q0dTpFLed2LcR5dclfSsLX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uFArqVDTwcyeItmV0iRxYFmjEsUkHtaQYBhggYpUrHdTPc385l4e8oBEw7NhnRV5B5zomvDi1N3PWratgl4iDSkJo+b654wLKsod3KsrFje1H/QD8jpKjyT9MQ==; 5:x9PeAsEiW05e1G3lPqcKDbvdrqLqNHaWjQmpbmWKPpcfDhN0KLHgp9OBxhJGn6EwuF9UwSGjTimaC+jW/YOQPkdxAeNkWsPq1EGwKhOtQ4A/VR9kl9zfa3ESus+dH5vxW55HpcFSziBCYt/d5GiafaCqf4Dh+X5NAWCCLiHptjM=; 7:m8utLsltD3c/XT6kS6OggXheLYJO3DhTqMWxJ/alUULZYtxemu/2daj7W8VBoo0RfPXxBlCHUvN5VIwlk9s+OBfqw2YB5TlcdBb96pZI6RdZpt+oH791PX6Gz9kO9igNzqQg1JGx3dcZZ/r40FiM9Vf645rb1+uHi4+4OTgClmrvoFqziP3vLHwT73BUkL5Oop1d7iyEDbZCQU+Nv7ma4Roqprh5zg/TUVq8/tnowEPO3zZfTHYzcEtCsHfAu9Ws SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:49.9735 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f6782f02-a473-46a6-5030-08d5f3019757 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 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: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Malidp implements a number of yuv buffer formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 7 +++++++ include/uapi/drm/drm_fourcc.h | 27 ++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 35c1e2742c27..18bb960e9943 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -173,6 +173,13 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_UYVY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_VYUY, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, { .format = DRM_FORMAT_AYUV, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_XYUV8888, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_XVYU2101010, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, }; unsigned int i; diff --git a/include/uapi/drm/drm_fourcc.h b/include/uapi/drm/drm_fourcc.h index d43949b5bb3e..ba2fd9e9815d 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -105,13 +105,31 @@ extern "C" { #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -/* packed YCbCr */ +/* packed YCbCr422 */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ +/* packed YCbCr444 */ #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XVYU2101010 fourcc_code('V', 'U', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 little endian */ + +/* + * packed YCbCr420 2x2 tiled formats + * first 64 bits will contain Y,Cb,Cr components for a 2x2 tile + */ + +/* [63:0] A3:A2:Y3:0:Cr0:0:Y2:0:A1:A0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ +#define DRM_FORMAT_Y0L0 fourcc_code('Y', '0', 'L', '0') +/* [63:0] X3:X2:Y3:0:Cr0:0:Y2:0:X1:X0:Y1:0:Cb0:0:Y0:0 1:1:8:2:8:2:8:2:1:1:8:2:8:2:8:2 little endian */ +#define DRM_FORMAT_X0L0 fourcc_code('X', '0', 'L', '0') + +/* [63:0] A3:A2:Y3:Cr0:Y2:A1:A0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ +#define DRM_FORMAT_Y0L2 fourcc_code('Y', '0', 'L', '2') +/* [63:0] X3:X2:Y3:Cr0:Y2:X1:X0:Y1:Cb0:Y0 1:1:10:10:10:1:1:10:10:10 little endian */ +#define DRM_FORMAT_X0L2 fourcc_code('X', '0', 'L', '2') /* * 2 plane RGB + A @@ -141,6 +159,13 @@ extern "C" { #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ +/* + * Each sample packed into the top 10 bits of a 16-bit word. + * Y plane: [63:0] Y3:0:Y2:0:Y1:0:Y0:0, 10:6:10:6:10:6:10:6 + * CrCb plane: [63:0] Cr2:0:Cb2:0:Cr0:0:Cb0:0, 10:6:10:6:10:6:10:6 + */ +#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane */ + /* * 3 plane YCbCr * index 0: Y plane, [7:0] Y