From patchwork Tue Aug 21 18:30:00 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: 10572287 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 BD74F13B6 for ; Tue, 21 Aug 2018 18:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB3A72AB8A for ; Tue, 21 Aug 2018 18:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A91862AC28; Tue, 21 Aug 2018 18:30:48 +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 A377E2AD3C for ; Tue, 21 Aug 2018 18:30:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CBFA6E1C4; Tue, 21 Aug 2018 18:30:46 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-HE1-obe.outbound.protection.outlook.com (mail-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 163E46E1C4 for ; Tue, 21 Aug 2018 18:30:45 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:30:38 +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, daniel.vetter@ffwll.ch Subject: [PATCH v2 1/5] drm/fourcc: Add new fourcc for malidp uncompressed formats Date: Tue, 21 Aug 2018 19:30:00 +0100 Message-Id: <20180821183004.6775-2-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29023f6a-6d63-45b0-ac09-08d6079433d6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:cQRR63czMlz2LnMZlLM1lh9K/fhRChb/j7bA6tLfWlehmqhYZfCFqoV1zD6xaAlis2NQzMZuuB1HwEu8NNonXReVovlNnFGxdLwsvbvDR8LgcP/JJuJpJf2UaYajgCSJzZmn/uRp1dVs7OwBPauMmTz/9giwqqcYUTj3WpnGYx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wIb33GYg/xbgwG/QkBLExyHdQ==; 4:zFXT9vDh6vSDLujHJmQh/2k4SviLDAAUB2IBOjevZ47Mu0hX2LnkgQ86Hl97xpIOjasM528r7ZllVB5RLhReaNQkcMQaWv4tTPDrWCU7TAid1Jf2kJjv7OWCfjHQyzrPXJrR6m1m532QFKFK6EXEb++wSotAN6kwwBEr+T/q5ifHuD4yYSr/vOAjlgi7XfSaUMJQHFTrt0Kbqwb1KnuqxTQb0Je9RVcglBqcJ7DSR9cGpXxH7VmLyZgNlZ8mBrb74DFFprmuS8OIG2ILP86GaNIo3BFmpaGCjf2lW/9V1bIYM0mzh005LD3ii+0NW9Yw 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(6666003)(105586002)(47776003)(16586007)(316002)(6116002)(575784001)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(14444005)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:u3hLQp3sMoCJmWFsDE6wPFAsS9q+80G/dQSZNvN?= vf28afuOixDD9HOPxd3+aWD1ICfR/RBFEny7g6cXmKOL4/IHJ3GZ81/hcmTmbzW5KoIo5unEwd2U1x7IQ06peZ8tK2wM1ZAHZ/nw4YB0hB8sN+JkvauJzqILtKTTjYyquglwIuP6CgWAqFB9NxRv7Yg9zg5aPBxn4QJwNsQeEpqi0MnNhFsg6l20FLtk8cPk6u8oI8BjCopQqzFO5NyHp1x5m1U1mycRd3EIUoBIk+uIYy42RRn+3C5cm0lLM7cz2Qbi5IzrM0g4ZtMtDF5tmsxlRezcyEKHxxGRTd4gCvKq81opwtnvpPh8Zx0MW9X44/8SeNU8gK5r1IRpCPHl92ARuPKfVh43lHzLMlm1Gk/h4vu4+IL8DDgYpBZk71iHkeX+h7NEfpCbmo5rseFXnzskdtrLmHJ8CQKWsL4ty2kzpyIETfCEMxV982RRnvPsWj4eM27OZ42BMFWGsNao4uPgp9lZ2fYe/iiGfxQryc8ZEFTz1jFSBx2JF0CfEchoQOJ14NxaJK1G/gqlponPx1npOiwV5B9NthcOPtEYQDg2Fi/ZfXMw4AfhWkE67G81Lq67hCAPp9CnEDSGKhC9DHlFdvTQNSJYpkHXLQrkd5v5W4CJrs9366KIt23evgWY/GvPrSY/55fK2qGD+Vpnv4nDvjugGk7lVMUj02Iot7eONongu0EUhJYpojUxbK/fVCHsgbPOkjMgU1ISmqLXiO+RRqN324tpTvf8i1k4auZpP5xK+YC1GW+VAILugby53EA5LShBvHVfonTRjih8eN5eY5IIJQxfmhsCmPaOytkgqpX6/CyQ2owJFiS+uX0O5B7Xo2N2l4cskO2xcxfJa7Np+M36IMRf4dyb1HYATl21UcXZsYOwkhE9Wc/7wX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LjQ9QPE+gWev2rMJ+L8Paf/gOAQGPuHxMIr24cdEvF91D4i1pVS6/vxJiG8rB9VaUAZxvfgpPAF40EOxSyWiaKPKro9bQNHjkNqH6gRIWZLCMgJUA0ZqZUq4vw4mV7RreaG02k1o2K7jw==; 5:wsfxWyVYvZWPL79UiuyZax60mE9fVoMCxxy4UaRBIncnkAx6Fn7gLzfC1itz6zU7I3Fm5usrJ2Cgv3i34aPKzYPZkJdiqfMqOYOVtmUUQQyJZpgIIL7Grljf4pZ06KzKF5oceyIGcB/dUMFS+QIa2baA7AQG/f9YvsGPizlH8cg=; 7:T/QWy0BTQch3s2bty9C2g30OQkVCAPR05B17vqm/E3DqazYOiJUEf+QUptt2B/71lQJS/rTW/xYf+bND1Il12EJ8T8GsUskFFkf6NvQ8KOdwp536NqJ/XeTLjhtwNTxbcZS+Xp3OXfDEztVK5V1EcKr/URqJfw4fckRpL2xVa7lKbWtEBu60tM2PeEBiaSoKkPveWj4TsfMDi3m5B/KKWgtuRBKitHyUMUptBvE+TC1TiIs5L0fAEnp/8ZXjDaH9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:30:38.4039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29023f6a-6d63-45b0-ac09-08d6079433d6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 21c50b39596f..5e01fbcd7a30 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -141,13 +141,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('X', 'V', '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 @@ -177,6 +195,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