From patchwork Mon Oct 29 17:14:37 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: 10659819 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 8C37613B5 for ; Mon, 29 Oct 2018 17:14:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 83D7929D7C for ; Mon, 29 Oct 2018 17:14:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 770D729D7E; Mon, 29 Oct 2018 17:14:49 +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 1191F29D7C for ; Mon, 29 Oct 2018 17:14:48 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D93DD6E05C; Mon, 29 Oct 2018 17:14:44 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR02-VE1-obe.outbound.protection.outlook.com (mail-eopbgr20084.outbound.protection.outlook.com [40.107.2.84]) by gabe.freedesktop.org (Postfix) with ESMTPS id 00CDD6E052 for ; Mon, 29 Oct 2018 17:14:41 +0000 (UTC) Received: from DB6PR0802MB2551.eurprd08.prod.outlook.com (10.172.251.149) by DB6PR0802MB2248.eurprd08.prod.outlook.com (10.172.227.145) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1273.19; Mon, 29 Oct 2018 17:14:38 +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; Mon, 29 Oct 2018 17:14:38 +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" , Raymond Smith , David Garbett , Lisa Wu , Matt Szczesiak , Charles Xu , "james qian wang (Arm Technology China)" Subject: [PATCH v6 2/9] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Topic: [PATCH v6 2/9] drm/fourcc: Add fourcc for Mali linear tiled formats Thread-Index: AQHUb6rftoqxO8PmvUquX95n7hr7iQ== Date: Mon, 29 Oct 2018 17:14:37 +0000 Message-ID: <20181029171419.4512-3-alexandru-cosmin.gheorghe@arm.com> References: <20181029171419.4512-1-alexandru-cosmin.gheorghe@arm.com> In-Reply-To: <20181029171419.4512-1-alexandru-cosmin.gheorghe@arm.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-clientproxiedby: LO2P265CA0032.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:61::20) To DB6PR0802MB2551.eurprd08.prod.outlook.com (2603:10a6:4:a1::21) x-ms-exchange-messagesentrepresentingtype: 1 x-originating-ip: [217.140.106.54] x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; DB6PR0802MB2248; 6:r8ordqto3yqYeL592zJlK2pq0akRKjXpX5TXUCsMwGjGIuCNlGsnC/GK4w07psFJ+xfSiy9BRyUSANdcrT7adYUFHCWYXG6PjcZPkdNI2Z653ZPw8x3GpunTMbYDtvduChd0ee7+D3vHZYaZDz3gCyg3ek9DOVItyisThF6XOnbzNiDWF38sV6q3y1fOO1j2zI27r32PvWXyCKEE32RUSnlLYVHhoV2W+gfu8zVr92giX6uHSVNvGyGN0x2e4b2wXXlS7O6noKFaUqWcn454flxOO1rOdA22/n/hjTefBJ6oqOcphe+lnWldmBs0Jmo7Wj6/2iPapvK0n9YCutw6Oqc3uVaCH1RWyOC3fJJWHWW/y+QHbjzQ5+5W0Mxn9rlcKIn6rWkUSgMvrPWGPdRMUJOMxpW9oqOZiYNrXEGjmuuh7PMK2258tDAnqbmGFwcs65BM28CDgFHnBloJtwXWZQ==; 5:DmtImhuy+w1LH1JKCj777061b5MhUt5xj7bPOziJbD+v/e/Zlk9j4LHK+f3aLexyNfWEH+BnHp66U0W+5Bd7Z+v4s0oPmSmamHxU/IDQ50hMnchaJMYBbd6VXl4/3XUn1a3tjzXDrxYBzervDXrz/YVNwpD8aROLQ1ivNLlYFgg=; 7:cq4q5xS6Fws5syXEC+WjNafe0LHNAMjgvrMJC6FaHIPDFOvBOt/oxFiNpvM8GgV4QVeXMHBUDYID06ctNV1yF/8P8szHFCOcFODb+XDnH3MUYGu6mghusO5lV0/h4GtD1sRL7FFgtXq1sGayEfVm1A== x-ms-office365-filtering-correlation-id: 745d172e-b203-45ec-da8a-08d63dc20162 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:DB6PR0802MB2248; x-ms-traffictypediagnostic: DB6PR0802MB2248: 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)(3231382)(944501410)(52105095)(93006095)(93001095)(3002001)(10201501046)(6055026)(148016)(149066)(150057)(6041310)(20161123560045)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(201708071742011)(7699051)(76991095); SRVR:DB6PR0802MB2248; BCL:0; PCL:0; RULEID:; SRVR:DB6PR0802MB2248; x-forefront-prvs: 084080FC15 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(396003)(39860400002)(376002)(366004)(346002)(136003)(189003)(199004)(86362001)(575784001)(186003)(8676002)(81156014)(25786009)(106356001)(6512007)(6636002)(6436002)(5660300001)(81166006)(446003)(36756003)(110136005)(54906003)(71200400001)(71190400001)(105586002)(486006)(53936002)(476003)(316002)(2900100001)(2616005)(11346002)(305945005)(72206003)(4326008)(2201001)(66066001)(5250100002)(478600001)(8936002)(7736002)(68736007)(2501003)(6506007)(386003)(99286004)(256004)(26005)(102836004)(97736004)(6486002)(14454004)(3846002)(6116002)(2906002)(52116002)(76176011)(1076002)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:DB6PR0802MB2248; 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: KAmCDDXYP0chZR7GOhC5iqEoC++vtDGCiqGjZWF8ivpwiWgleWLx6c4IgIas6GiAbomWz9Wa5zZBS6aYlqJYnv8FIfBcTX88HZ7wSL4aGUazPt042DytGKG2wYjoZUNADbGUg1G3wnR5gFhJn4jFO4fbTCJzfkkMMuyebtcmh89nlLAWvCYqOmf3cyyvUoK0Z6fFWVpZRzKesJrlNyl+f3WNb0lvjk/o5UXVClaYjYnGHu+t6sAJ338kx/iYlhzUnSXMn1BkN86gsgvpFQFHIYHecTYOuZjEVz3UAp7TcI3V2afTYoWjGCAhIhm2bimL2H17ntWQUgBLg3+bEmjFYKTINKujx0Td1tF395oftfU= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM MIME-Version: 1.0 X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-Network-Message-Id: 745d172e-b203-45ec-da8a-08d63dc20162 X-MS-Exchange-CrossTenant-originalarrivaltime: 29 Oct 2018 17:14:37.9742 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB6PR0802MB2248 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 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 a843a5fc8dbf..b2ca0c526c3c 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 242a1d72a1ce..b82f528202f7 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