From patchwork Fri Oct 5 09:26:51 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: 10627697 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 653DD1515 for ; Fri, 5 Oct 2018 09:26:57 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 5B6A129236 for ; Fri, 5 Oct 2018 09:26:57 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4F5792923D; Fri, 5 Oct 2018 09:26: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=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 DC60329236 for ; Fri, 5 Oct 2018 09:26:56 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B266B6E76E; Fri, 5 Oct 2018 09:26:55 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR04-VI1-obe.outbound.protection.outlook.com (mail-eopbgr80085.outbound.protection.outlook.com [40.107.8.85]) by gabe.freedesktop.org (Postfix) with ESMTPS id DB6ED6E76E for ; Fri, 5 Oct 2018 09:26:53 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2197.eurprd08.prod.outlook.com (10.172.227.19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1185.22; Fri, 5 Oct 2018 09:26:51 +0000 Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::647d:f29a:a6d3:c8f2]) by DB6PR0802MB2551.eurprd08.prod.outlook.com ([fe80::647d:f29a:a6d3:c8f2%12]) with mapi id 15.20.1207.022; Fri, 5 Oct 2018 09:26:51 +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" , "gustavo@padovan.org" , "maarten.lankhorst@linux.intel.com" , Ayan Halder , "daniel.vetter@ffwll.ch" , Raymond Smith , David Garbett , Lisa Wu , Matt Szczesiak , Charles Xu , "james qian wang (Arm Technology China)" Subject: [PATCH v3 2/6] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Topic: [PATCH v3 2/6] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Index: AQHUXI2M85ExCa6TDk67lC3GVCn78g== Date: Fri, 5 Oct 2018 09:26:51 +0000 Message-ID: <20181005092606.21100-3-alexandru-cosmin.gheorghe@arm.com> References: <20181005092606.21100-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181005092606.21100-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: VI1P195CA0039.EURP195.PROD.OUTLOOK.COM (2603:10a6:802:5a::28) 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; DB6PR0802MB2197; 6:Hp2elS1qhoGvxMSFTA79dsZq7h7XeNH2rugP9WqVXmo6+FvzAaNPwhEFsp/xewhrp8PFQIzPB674I9Ey5LYV4KrL/z7rCVWwFiq62jxW99Bd7TTg5esNOqXbz2IE3wVSLbPPHfCxjCn492E3qE2025k8T+MzIur/YtfkKnBfMU/wFqTto4EE9MQgJvCq9eLlE5ZyYZwZbaq8kYZ7yHRneTmfHiANmVeoT6PymFEPzbZ6iDoGvMy3eUGaFHFPaC4eHnHeDVVEMTCKQ/VXloXnlsQfRz4WAJlJM3usOCtSIHt4elK3uIvpYjEr57+G2DKGtqVxxSvKkNMquo8GouC5DYFkcoBxPEmZaLinSOde3ylJr5jH6iW1zHTVy5jCTrJbuyeSET8rZBMeYG9scSoPf5ppE8Aw7JQDI8VrR8PxoIBpQOteO9bfCRKMF68AFFLrCL1pCgikAJca6co7NH5WdQ==; 5:DOlWlAKJtmG4+x4DB8X+cx1q3dHD3aQH1yEdoQHWsY/60e63UtKs8FAKHRFRk5yJfMePgOM94jM1lev26INTABFO3FeHmZ1zeRRL9prrwXBzLK+zwNcAS01aie/tPodCj7ziXlnttKHTFUwstblfRCEPRQ0N1Jyu4C6PPuIAeZc=; 7:cBf/r3z32TkiI8EnqQXYLqEyhFwIG/lDoYjxtM/tfg7UK1UfBCS/u3nstyT2MmfnEgKsdE9NrttRnpaNLEJKyMqRlWnHwfShUvx7lYLGWCfaJqWzohduBCyI954AMn4M4QNpTiwNH1yG1hPD75RSFnktaThnZt9HV3HxEW2eX/5q2ZrMNeW/IIYsEJ8q/f7CMslTSqWrPFjgQIBSHZA/kdplovsSCKgtIc4dEWowGw/blzNkRDVpWvVHtxG8I2yx x-ms-office365-filtering-correlation-id: 103688d7-1938-48c4-d1a8-08d62aa4aea8 x-ms-office365-filtering-ht: Tenant x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:DB6PR0802MB2197; x-ms-traffictypediagnostic: DB6PR0802MB2197: 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)(5005006)(8121501046)(3231355)(944501410)(52105095)(3002001)(10201501046)(93006095)(93001095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(201708071742011)(7699051); SRVR:DB6PR0802MB2197; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2197; x-forefront-prvs: 0816F1D86E x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(136003)(366004)(346002)(396003)(39860400002)(376002)(189003)(199004)(72206003)(68736007)(8676002)(26005)(36756003)(14454004)(256004)(186003)(11346002)(71190400001)(486006)(71200400001)(5660300001)(2616005)(6636002)(2900100001)(105586002)(106356001)(446003)(66066001)(305945005)(6506007)(7736002)(102836004)(8936002)(52116002)(76176011)(81166006)(476003)(99286004)(386003)(110136005)(316002)(54906003)(2201001)(4326008)(5250100002)(6436002)(81156014)(6486002)(2906002)(575784001)(25786009)(86362001)(1076002)(53936002)(2501003)(6116002)(3846002)(97736004)(478600001)(6512007)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2197; 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: ykwLUYZqTS5v9Z9b/mWR9YK1pgcc9a4wHAkPvoM0eFVJOQq14PTKFtkQKugi0dkWNfWXNyxzyAd6BGRUuiJC8LxODNZncTFX6qzPJRqAm4YZi+TvWppECm6G0Kd/8lj4JMH4ODZ9pSNguGJDsHpydOEfa39NHRLNWBfYY33S4konT29/Nh6zVeAlD8GKnrGZwY6QYZSWksUFWRrUxZokEbeZ/dY8X3gOpy5TkZJTJZqe6k/oy3ozJZ2MxlST5XBfYPjunJjRmL5MhouOIJlqFOLw3TDuQcnL9bWeR5pyMW+R16WhNKU8p2XmNUKRl7lm5P70a5zKFukDYx+7dQFqgB02H/y/Wjyfahvw5kQJOOE= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 103688d7-1938-48c4-d1a8-08d62aa4aea8 X-MS-Exchange-CrossTenant-originalarrivaltime: 05 Oct 2018 09:26:51.6269 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2197 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. Signed-off-by: Alexandru Gheorghe Reviewed-by: Liviu Dudau --- 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 0c9725ffd5e9..13b2163e5d0b 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -228,6 +228,18 @@ const struct drm_format_info *__drm_format_info(u32 format) { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_P012, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, { .format = DRM_FORMAT_P016, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .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 600106adf91f..4de86dbf40ca 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