From patchwork Fri Oct 19 10:57:46 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: 10649011 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 3B3D915E2 for ; Fri, 19 Oct 2018 10:58:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2979D28A68 for ; Fri, 19 Oct 2018 10:58:53 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 1D34328A7F; Fri, 19 Oct 2018 10:58:53 +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 B1CE928A68 for ; Fri, 19 Oct 2018 10:58:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 3F0BA6E357; Fri, 19 Oct 2018 10:58:43 +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-he1eur04on0626.outbound.protection.outlook.com [IPv6:2a01:111:f400:fe0d::626]) by gabe.freedesktop.org (Postfix) with ESMTPS id D7A546E343 for ; Fri, 19 Oct 2018 10:58:36 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.51) by AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1228.25; Fri, 19 Oct 2018 10:58:34 +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, maxime.ripard@bootlin.com, 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 v5 3/9] drm/fourcc: Add fourcc for Mali linear tiled formats Date: Fri, 19 Oct 2018 11:57:46 +0100 Message-Id: <20181019105752.17741-4-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20181019105752.17741-1-alexandru-cosmin.gheorghe@arm.com> References: <20181019105752.17741-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.51] X-ClientProxiedBy: LO2P265CA0387.GBRP265.PROD.OUTLOOK.COM (2603:10a6:600:f::15) To AM5PR0802MB2546.eurprd08.prod.outlook.com (2603:10a6:203:a0::22) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 480b1f17-f367-49b7-28f9-08d635b1d0df 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:AM5PR0802MB2546; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2546; 3:M8R7doRPvJNTgU9ddc7FrkW5zqleussS5lFXjrQCsy4ZWPpO/rJ/0XoDj81K7h06j/bhf5v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EXCZVxkmi8auRrYHdBr/4m7UmX2hU269ouDxCWFqTDOOuBcD/pmmpFyeKLZMF08gxp4OsTwt/Y3IxIOJ4/G9Y5DfnMPCwidiWEg4FABSqXnQe4ceBlwEUvBRZrPxuW87leTG//+FihVirEfO2xeXW45ux92CC7lT3SwyKqa+W+F9sSFEr1Y+TI3YDdY3MPybytmtYzQ=; 4:LRQCutuoXGJLYdJwvJg1T2V37N4VB5UU/XXbZ44UELr7E7pMieCJDoXevNWKUfPQSNgzBxafTRgp4toNnueLNMXVyo8vxz/ZkdSSjcOQAPOsQqczheOtR5GRlUvENWWurRNo6CLcHzSfkloWi9NWXv1TO3Angcw/EYAzGwvhxQWyGeV0ZP4cMbryYH5HL6BmiBFIgb2xCBOoCrpy8obmER7YBa3AAY/zqUdCjLwWCan3KS+7pD78/A0ZUSVl5FoMDSVjDwAFHLfFgCKAonWvN/dSye2sc2Z6nQ/ORxpb4zj297DqiDMI+VghBTNgoRV+ 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)(10201501046)(93006095)(93001095)(3002001)(6055026)(149066)(150057)(6041310)(20161123564045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123562045)(20161123560045)(20161123558120)(201708071742011)(7699051)(76991095); SRVR:AM5PR0802MB2546; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2546; X-Forefront-PRVS: 0830866D19 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(376002)(366004)(39860400002)(136003)(346002)(396003)(199004)(189003)(6636002)(11346002)(105586002)(81156014)(81166006)(50226002)(106356001)(4326008)(97736004)(3846002)(476003)(25786009)(6116002)(16586007)(8676002)(53936002)(50466002)(486006)(1076002)(8936002)(316002)(2616005)(956004)(16526019)(48376002)(36756003)(26005)(478600001)(6486002)(386003)(7696005)(186003)(52116002)(51416003)(68736007)(446003)(5660300001)(305945005)(72206003)(76176011)(7736002)(2906002)(86362001)(575784001)(66066001)(47776003)(6666004)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2546; 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; AM5PR0802MB2546; 23:W6t3NXKYgD4ntpE50lov2iycO+cN7TsU4bil/ku?= NroVzX5CAIT1bUPOb+57QNwOWm15QfQnhElUpzrv2CoZ8wb2+Li04RMQ+xmdpapDERhPEKzTeLGQMnWPhqgzascHm73EcO9F+dnj/zmrMwycK95S096uASDiMEKJQ7L2JqMhZAxZK7Ioh4HLBWMjZW4LYGbdte10dGbYsAuc7vPyXELj/LgXyt2cp+5ewyXse/hEo1ebXfi4gylA5f7IHsF4mQSnPq0AQne0VunVNWrijGFIqsFGahvZ31q3qO6YRErcWXet8xTKXBJYqb9FxoXxbFwp2YIKWZemYjjdYn1vHIAWSr2a5+ymwpMo1xRLqlOHC1l5ofYQAn6xuWJj/1nOlyHTiDwJG0MfUaYry9xcI8/DmULxzLiG13r3u9I1gUAfznQpjD5AMtnBVVbe/jN5GuRfPSOakm/WvlaZJugHnxsVq4/Je/XPoAvHibty53I0bjOJOjIL3kDbkIS8N/Sy+uFp8oL8lgzsH06nUO22dO4pyshHJgFqeZQSQkJElkLoJVaV7LNbJ55qpc38IQl50BNQbA8+Sw3JKfR8WBUNYOnkQo/8zsQD0WLrHX4lIK6+xLAzUtoNLBIazl1Ht1wtYqUN+UPS0aDFMXQ2ZN44BTH1hdeNIhhuAPzD/fmIEJCix1H/jP46VYkMdFKTcF334xU4hjEJ+0TCddn6Ps+Gd1O1cHoFe1cYw1VWheHl3aABBuj3am4/an8VI6OSFCEPxW1uf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PDURTr5lUARn9fwOJGNB3ORep/kNnqycDDfJAq8DfRcGrSwKtRhUh5lhRxvjqymx6ben4RNp7O1/VwemryLKP+KdNfUH88fgCXRFwNU1TA3At2GJoDtiSAWZ4KX5UVqjyKDFxCGJr82wvsrzrhYa16pKcqE6tIdtgfFRoXuFdXfPw+ej5uAk0vBHBRHOIMyaPvw8DeHRQsqvqKuEWaxXhg2ZRMZvhi6FBSW+RN3TwW9pmfwESsoUs2c4MDecvbO928i7547aerLIyktp1EwIp/AKFlpQxsf941g==; 5:8xvjQlzinqc8fiB2S2AXNXBrPLJoOHPiBmgLT//nHhlWtxjPm4Kc/4q1MOd235S4Iy+u4HA+WiJqcQ+3gX2cwTVpnIJmyoYGO4pigE1YgE6U9BMCzdhzSPn5Y2QY34tErUw6vFzKnQl7QbmgHRT9xccJZQmf6r6kDbhlChb0ksA=; 7:SckPpm3l7iYg8PxujkBwYl1XQjlLEoeuBOITyoj3BxbEaULqKN2g0Jl/KDPVBAzv8fz+Jr4gyvsKs3CUp1ucMekF5gmr04LdCLWOJLfoCuj6TuSZzc99xynHwoc+10h8Yk7oyA8L9elrTLMVt4MKHHWmfx3Bl7i3Wuw43qa64og8wLPwHseURiZYTEYCMsKV+Oyd6ZURVB9lfqFDE69vstjNlq9dCP6ex6RTzn5BRUFDragJFGo7lKV9Ht3odsAq SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Oct 2018 10:58:34.6929 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 480b1f17-f367-49b7-28f9-08d635b1d0df X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2546 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 Reviewed-by: Brian Starkey --- 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