From patchwork Fri Oct 12 16:35:54 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: 10638861 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 4EC5A933 for ; Fri, 12 Oct 2018 16:36:41 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D0BA2BEEE for ; Fri, 12 Oct 2018 16:36:41 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 306FF2BF8D; Fri, 12 Oct 2018 16:36: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=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 AED6E2BEEE for ; Fri, 12 Oct 2018 16:36:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E46976E4CC; Fri, 12 Oct 2018 16:36:34 +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-ve1eur02on062f.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe06::62f]) by gabe.freedesktop.org (Postfix) with ESMTPS id 88AC36E4C5 for ; Fri, 12 Oct 2018 16:36:28 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.51) 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.1228.24; Fri, 12 Oct 2018 16:36:26 +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, raymond.smith@arm.com, david.garbett@arm.com, lisa.wu@arm.com, matt.szczesiak@arm.com, charles.xu@arm.com, james.qian.wang@arm.com Subject: [PATCH v4 3/9] drm/fourcc: Add fourcc for Mali linear tiled formats Date: Fri, 12 Oct 2018 17:35:54 +0100 Message-Id: <20181012163600.20331-4-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181012163600.20331-1-alexandru-cosmin.gheorghe@arm.com> References: <20181012163600.20331-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.51] X-ClientProxiedBy: CWLP265CA0200.GBRP265.PROD.OUTLOOK.COM (2603:10a6:401:4e::20) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: f50cac17-e9f1-4497-2d44-08d63060dab4 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:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:XZyfJHQvWBwMqs6gpy2gdwhBujnYsGUjiRE0dFDfhVvLoDS9tYoQ+rxzcicTZoUNB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wXBG1Fe3K/L2TSsLiitk7l0K6IAjwhPTEmltu6c3FqphynZamZMK7Li/Jj2beD1QblPPqet1jdP7Mu6WKc7Kwh8P8i16a611rmY9BCHxBHmte0BWg+xDzzA2WE1GYiW8v9e9022hOU5gXMj89ndd9vrvsfY5edVsNQPqhz4fhEvNtMsBGQ1t/PODbeSCqgGhYZDT32yMe5b0JPg=; 4:f8aifJwvFhXfNZGveKs3mMRYjt4ZciLOvPaIAg6I8AhAkMCnsx1oxZho755JcrAggD9k8QMl9ShJ156r7zmEotwr6Z3Jk76DzXHRuDrDj4hlZEituriri+Xo8f63umreq53vp1onD5XdHXCu66Pyei3F9G653MiL35J291ZMVAXxpoi1F/r5A6QsMVytnF1zVkfzSWlBe0U1lZdROpKUpybeSulmCykYmlhoke8UoDQymAmnmZKgKNTKfQZau1LhA+ShfrHCSY9DmKbLmcsNUTqENOc8KdJddj70d3ndLzVPLhGAuKH0VNkrbOjmXSmg 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)(93006095)(93001095)(10201501046)(3002001)(3231355)(944501410)(52105095)(6055026)(149066)(150057)(6041310)(20161123564045)(20161123562045)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(201708071742011)(7699051); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 0823A5777B X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(396003)(136003)(39860400002)(346002)(376002)(366004)(199004)(189003)(25786009)(4326008)(81156014)(72206003)(106356001)(105586002)(81166006)(478600001)(5660300001)(47776003)(97736004)(26005)(8936002)(50226002)(66066001)(476003)(16526019)(6486002)(186003)(2906002)(8676002)(316002)(16586007)(7696005)(50466002)(956004)(2616005)(575784001)(486006)(6666004)(7736002)(305945005)(52116002)(48376002)(68736007)(76176011)(51416003)(86362001)(36756003)(53936002)(386003)(446003)(1076002)(3846002)(6116002)(11346002)(6636002)(921003)(1121003); 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:eu6HVg8o8a01haY8Q8MUTWljHm2m5KyrxZyRXNo?= cSeRzIUXUOULh3K7fDBuu8u8GVY3UYHjp+JZY6Auo/R3fZAvyYMlkLgcnw8MRzrYH8ur84XYulZ8LDFnqwCu3lrLTqGG9RDkMkzTjhDa3wTpu17zb8Ygq0qIyNcAb6vZ/SEdkDjz8wo1pp5tH6sFbY2oUJdOelzcbQWARdrAIi0dosbhKsrt4jBMoHUD7EHlmA3rRhNl0HobKeu2bjqGOXLslswS3PkdZe0L6rJb+SKcTjnsgHzZ71fN6rOSe8OATkmr2G7CWr6wy4O+wHCNM7KIQwUJFOcC6iLRW91txprTRhFx9Hj7WGPwL3hX4pM2Dde1vuZi0IJvprmqvsxYPB7vnpLoZ5S6R+HReWdD2qMTK9aJjTXuY8WH/LrfzPQAas0pfZPh5MMZ3rknkl9Ly4pSd4Vnmm1Lv9q1nuCVGYjv7gRmupY+puELEN3KHpLScW9PzREktJ5x281MNHbNKm7iXYBRyzBYpqadiTGT3DQyNMkaq8vJDjOmIS1YmYB24Nqcpsz03DDh+QZzpRZkckHwijCwkAQfivKu8orUuqzH1aHBqP4EaGSsGj6gBmKB7O7u7H4Vhe+4lu/r0XUj7M7ChtXEiPRSEu01ZLUJ4mXrRi6PtvW65yXweA86/kqZE8RCNpooXp5D/EjO6PfspXKcs1vg9Wy9ZVA2g/u5vFcDZAzjHNbYXLism2iPICfuhRv+uG8NNcyVOpvX1O4P5cz77Q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GmUjb7XD40zLRCx9BB86n1yCDQb+MVGJigzb839lAkqrvt385ZCypxx2Rry42DIzdOQBr1qWh/CmZEh2bHjtidldY6yxeb9vAfqC6bB0jziQe2JPgsnf1pUdoVWSyr9gPLwnEQAjdTbi1UyJQ2s5XfGmt1d274mybLwspx3zQFgTDJANruhemaR27qnSNcyBT2Oy300wLIfw7IB8aC24Hfk1uzZg4fENsljMclKXI0OUIsmjYTR1ERfNNFCWRBljtOIx/PPi5he7aN1Bn0r6WTSFaYIZIGFSkUCrpyErXV8AqwQDcak+LrTz0j2CuLNvrwNf1FdpQ==; 5:X67QrnSoAFq2J6XKJnVtTfFecp9IMH/nTiQ7WosY1l0Q2/A5McYK2VW/ENx0Yllwa3A12bEgkUTCFeEG+hFtiM+nPklcH2gT2QpqX5dpJvdU3EiaNz0aHMkBu8BXNjM462XEPF6cTF9DxUOBH1NXuU9vviV8Vai6crFcvT2wZmA=; 7:hjos3QPZYJ1aQYbyL/jiTvKSLtjPDBYMQnadZFZZQVIQfVeFkSsRP+UyIWnvq1X/k4xkSyMqi2juk5RJ4Fj/pmNp3GDeFUUg+CCdpAruaVLkLK6bZvqmlL/ANF+vx8JhIPbKsTCXbqiVEuE4Xrtbou4Z+JAyrOoLj6FPro1X/nq/R1rUUh6zmjVrVcavIzVV205jgQmVavwR5Wo2jz+9BK/1cpBOQXaMjbiw9GJTbCAVHgEVKXEaalycqgHHdUz6 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 12 Oct 2018 16:36:26.0305 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: f50cac17-e9f1-4497-2d44-08d63060dab4 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 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 Acked-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 a843a5fc8dbf..69caa577149c 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