From patchwork Thu Nov 1 15:11:30 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: 10664087 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 ADFEE15E9 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9E2952C001 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9C8E22BFCC; Thu, 1 Nov 2018 15:11:41 +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=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 1F3CE2C014 for ; Thu, 1 Nov 2018 15:11:41 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 0D89B6E3AD; Thu, 1 Nov 2018 15:11:35 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR03-AM5-obe.outbound.protection.outlook.com (mail-eopbgr30080.outbound.protection.outlook.com [40.107.3.80]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8203E6E392 for ; Thu, 1 Nov 2018 15:11:33 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2246.eurprd08.prod.outlook.com (10.172.227.143) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.25; Thu, 1 Nov 2018 15:11:30 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::19ca:93bb:bc0:985a%7]) with mapi id 15.20.1273.027; Thu, 1 Nov 2018 15:11:30 +0000 From: Alexandru-Cosmin Gheorghe To: "seanpaul@chromium.org" , "airlied@linux.ie" , "dri-devel@lists.freedesktop.org" , Liviu Dudau , Brian Starkey , "malidp@foss.arm.com" , "maxime.ripard@bootlin.com" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , "james qian wang (Arm Technology China)" Subject: [RESEND v7 2/7] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Topic: [RESEND v7 2/7] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Index: AQHUcfUrDXU7EaVFVEyngRjZtPu6yA== Date: Thu, 1 Nov 2018 15:11:30 +0000 Message-ID: <20181101151051.1509-3-alexandru-cosmin.gheorghe@arm.com> References: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181101151051.1509-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0001.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:62::13) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.51] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2246; 6:vi2nVbOFIvxusex/J/t0BUbBP/1hByytdKkIiDZOI3N8CCZ0oMAKGg8eBRb5DM3Cs6BgjYIV54Q6eccEcAfm2u0V8VVxLIt1yHe7rKnn6wIq6QGuEyG/qp+l6xqiH9NDj+PzwfF1hT0Vauog/hE2yFIZReY0EuCESWGGWXJ2zBQXSCjSh+Wwod4QTT3xgY4+qko53aRZ5e7RTsCeKV8U3Xp8P71mIOvEEsFcgSEh/sejaj2e0EszjQ1lNEML/6VesFaMFCeqFi7j2eWNPxntiHB3Pt8BkvRq9/9im9Bxt6UVtNfN6thPN27NF5rSDUoGIfBToMIVNcT1+NEGo7Npe+1T+jPlTr72Tl5Wj7vFBcbqf7CijK1yqdd+wDv69ufnhyBWwXCquV8lvC1E8zmgvCBcE9vlNbQQkfOS4Q3rxc6UE9Q+BX9QUgSY04l4aee9bzWe85L9y3Bhvt8wmK5XUQ==; 5:4F4IrJM92h4Ry+WfMiAV0I9YIqNEFr+YtSe06zs22dRhd3U8IBa6PSxLgq95qlwGRp+FbflKQG2d0l6b83DeXp6y8nD+KB5VlKriWORRSRRDESruNQQMZp6ViG8P/yffgCSv0cd9P5Bl1TY5MqwpkGunQk7CMllVTxvDoaketh8=; 7:O9lLXvK63nu9XF+RF6p4LZb4F535Uuzv2AMBolhzHfJsLqmvWiVqFjf5VjTkbLhqsf3pwGNgg6DSfBWTDjWaNmVfWxQ5ZgX1ayga3fJZW4icnCFMsnHvnRzRrJgaiiYR2koXjBvaGEQiSClsvSFsOA== x-ms-office365-filtering-correlation-id: 1ee3f186-b613-492e-5d9c-08d6400c4d5c x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(5600074)(711020)(4618075)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2246; x-ms-traffictypediagnostic: DB6PR0802MB2246: nodisclaimer: True 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)(10201501046)(3002001)(93006095)(93001095)(3231382)(944501410)(52105095)(6055026)(148016)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123558120)(20161123564045)(20161123560045)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2246; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2246; x-forefront-prvs: 0843C17679 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(366004)(376002)(346002)(396003)(136003)(39860400002)(189003)(199004)(66066001)(68736007)(486006)(106356001)(6486002)(53936002)(105586002)(97736004)(6436002)(5250100002)(25786009)(8936002)(6512007)(36756003)(4326008)(2501003)(81156014)(478600001)(6116002)(316002)(6506007)(386003)(76176011)(3846002)(6636002)(1076002)(110136005)(102836004)(86362001)(71190400001)(2201001)(575784001)(71200400001)(72206003)(5660300001)(8676002)(81166006)(14454004)(186003)(11346002)(256004)(2616005)(2900100001)(476003)(446003)(52116002)(54906003)(2906002)(99286004)(305945005)(26005)(7736002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2246; H:DB6PR0802MB2551.eurprd08.prod.outlook.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-antispam-message-info: Osu47D3GEj/HVEnxhtYsbVJV0CxVJZszrTL1UJLXYViYgE2I8mUMPcIyng97OlN3on91VW6w8XQTrLDneZCgIKNzHsY7Xn809xByxI7lS9IMTDXbdJunu8Lg84oNc1Ntpnghr2JLGRY4QJgBhDCh06lzYK4pTUndATh3xNLxP7mlY7rauAPVQ5kFVJfMta21w3nCUSvxnZkrc+3/pzy5byvd3zN314iiMGNSvbYckO/viNhpusc+YynyAZYLp0pntuLaztxk79bmIhPxJB7g+NKCw9EimTZamuUAM95/xdCyeNS7lGbrGqpHSmJc+1fEiR3ye+wnp2xUNPFRHn3xNSqtHaJEZqc2kjZweTqYPt0= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 1ee3f186-b613-492e-5d9c-08d6400c4d5c X-MS-Exchange-CrossTenant-originalarrivaltime: 01 Nov 2018 15:11:30.4470 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2246 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 , Alexandru-Cosmin Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Mali-DP implements a number of tiled yuv formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout by using the newly added char_per_block, block_w, block_h. Reviewed-by: Brian Starkey Reviewed-by: Daniel Vetter Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 12 ++++++++++++ include/uapi/drm/drm_fourcc.h | 14 ++++++++++++++ 2 files changed, 26 insertions(+) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 00c96dbdcad5..aaae6152ee5e 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -225,6 +225,18 @@ 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_Y0L0, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, + .char_per_block = { 8, 0, 0 }, .block_w = { 2, 0, 0 }, .block_h = { 2, 0, 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 0cd40ebfa1b1..e7e48f1f4a74 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -152,6 +152,20 @@ extern "C" { #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 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 * index 0 = RGB plane, same format as the corresponding non _A8 format has