From patchwork Tue Aug 21 18:30:00 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: 10572287 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 BD74F13B6 for ; Tue, 21 Aug 2018 18:30:48 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id AB3A72AB8A for ; Tue, 21 Aug 2018 18:30:48 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A91862AC28; Tue, 21 Aug 2018 18:30:48 +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 A377E2AD3C for ; Tue, 21 Aug 2018 18:30:47 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 7CBFA6E1C4; Tue, 21 Aug 2018 18:30:46 +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-eopbgr70073.outbound.protection.outlook.com [40.107.7.73]) by gabe.freedesktop.org (Postfix) with ESMTPS id 163E46E1C4 for ; Tue, 21 Aug 2018 18:30:45 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:30:38 +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 Subject: [PATCH v2 1/5] drm/fourcc: Add new fourcc for malidp uncompressed formats Date: Tue, 21 Aug 2018 19:30:00 +0100 Message-Id: <20180821183004.6775-2-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 29023f6a-6d63-45b0-ac09-08d6079433d6 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:cQRR63czMlz2LnMZlLM1lh9K/fhRChb/j7bA6tLfWlehmqhYZfCFqoV1zD6xaAlis2NQzMZuuB1HwEu8NNonXReVovlNnFGxdLwsvbvDR8LgcP/JJuJpJf2UaYajgCSJzZmn/uRp1dVs7OwBPauMmTz/9giwqqcYUTj3WpnGYx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wIb33GYg/xbgwG/QkBLExyHdQ==; 4:zFXT9vDh6vSDLujHJmQh/2k4SviLDAAUB2IBOjevZ47Mu0hX2LnkgQ86Hl97xpIOjasM528r7ZllVB5RLhReaNQkcMQaWv4tTPDrWCU7TAid1Jf2kJjv7OWCfjHQyzrPXJrR6m1m532QFKFK6EXEb++wSotAN6kwwBEr+T/q5ifHuD4yYSr/vOAjlgi7XfSaUMJQHFTrt0Kbqwb1KnuqxTQb0Je9RVcglBqcJ7DSR9cGpXxH7VmLyZgNlZ8mBrb74DFFprmuS8OIG2ILP86GaNIo3BFmpaGCjf2lW/9V1bIYM0mzh005LD3ii+0NW9Yw 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(6666003)(105586002)(47776003)(16586007)(316002)(6116002)(575784001)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(14444005)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:u3hLQp3sMoCJmWFsDE6wPFAsS9q+80G/dQSZNvN?= vf28afuOixDD9HOPxd3+aWD1ICfR/RBFEny7g6cXmKOL4/IHJ3GZ81/hcmTmbzW5KoIo5unEwd2U1x7IQ06peZ8tK2wM1ZAHZ/nw4YB0hB8sN+JkvauJzqILtKTTjYyquglwIuP6CgWAqFB9NxRv7Yg9zg5aPBxn4QJwNsQeEpqi0MnNhFsg6l20FLtk8cPk6u8oI8BjCopQqzFO5NyHp1x5m1U1mycRd3EIUoBIk+uIYy42RRn+3C5cm0lLM7cz2Qbi5IzrM0g4ZtMtDF5tmsxlRezcyEKHxxGRTd4gCvKq81opwtnvpPh8Zx0MW9X44/8SeNU8gK5r1IRpCPHl92ARuPKfVh43lHzLMlm1Gk/h4vu4+IL8DDgYpBZk71iHkeX+h7NEfpCbmo5rseFXnzskdtrLmHJ8CQKWsL4ty2kzpyIETfCEMxV982RRnvPsWj4eM27OZ42BMFWGsNao4uPgp9lZ2fYe/iiGfxQryc8ZEFTz1jFSBx2JF0CfEchoQOJ14NxaJK1G/gqlponPx1npOiwV5B9NthcOPtEYQDg2Fi/ZfXMw4AfhWkE67G81Lq67hCAPp9CnEDSGKhC9DHlFdvTQNSJYpkHXLQrkd5v5W4CJrs9366KIt23evgWY/GvPrSY/55fK2qGD+Vpnv4nDvjugGk7lVMUj02Iot7eONongu0EUhJYpojUxbK/fVCHsgbPOkjMgU1ISmqLXiO+RRqN324tpTvf8i1k4auZpP5xK+YC1GW+VAILugby53EA5LShBvHVfonTRjih8eN5eY5IIJQxfmhsCmPaOytkgqpX6/CyQ2owJFiS+uX0O5B7Xo2N2l4cskO2xcxfJa7Np+M36IMRf4dyb1HYATl21UcXZsYOwkhE9Wc/7wX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LjQ9QPE+gWev2rMJ+L8Paf/gOAQGPuHxMIr24cdEvF91D4i1pVS6/vxJiG8rB9VaUAZxvfgpPAF40EOxSyWiaKPKro9bQNHjkNqH6gRIWZLCMgJUA0ZqZUq4vw4mV7RreaG02k1o2K7jw==; 5:wsfxWyVYvZWPL79UiuyZax60mE9fVoMCxxy4UaRBIncnkAx6Fn7gLzfC1itz6zU7I3Fm5usrJ2Cgv3i34aPKzYPZkJdiqfMqOYOVtmUUQQyJZpgIIL7Grljf4pZ06KzKF5oceyIGcB/dUMFS+QIa2baA7AQG/f9YvsGPizlH8cg=; 7:T/QWy0BTQch3s2bty9C2g30OQkVCAPR05B17vqm/E3DqazYOiJUEf+QUptt2B/71lQJS/rTW/xYf+bND1Il12EJ8T8GsUskFFkf6NvQ8KOdwp536NqJ/XeTLjhtwNTxbcZS+Xp3OXfDEztVK5V1EcKr/URqJfw4fckRpL2xVa7lKbWtEBu60tM2PeEBiaSoKkPveWj4TsfMDi3m5B/KKWgtuRBKitHyUMUptBvE+TC1TiIs5L0fAEnp/8ZXjDaH9 SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:30:38.4039 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 29023f6a-6d63-45b0-ac09-08d6079433d6 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 Malidp implements a number of yuv buffer formats which are not currently described in drm_fourcc.h. This adds those definitions and describes their memory layout. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 7 +++++++ include/uapi/drm/drm_fourcc.h | 27 ++++++++++++++++++++++++++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 35c1e2742c27..18bb960e9943 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -173,6 +173,13 @@ 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_XYUV8888, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_XVYU2101010, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 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 21c50b39596f..5e01fbcd7a30 100644 --- a/include/uapi/drm/drm_fourcc.h +++ b/include/uapi/drm/drm_fourcc.h @@ -141,13 +141,31 @@ extern "C" { #define DRM_FORMAT_RGBA1010102 fourcc_code('R', 'A', '3', '0') /* [31:0] R:G:B:A 10:10:10:2 little endian */ #define DRM_FORMAT_BGRA1010102 fourcc_code('B', 'A', '3', '0') /* [31:0] B:G:R:A 10:10:10:2 little endian */ -/* packed YCbCr */ +/* packed YCbCr422 */ #define DRM_FORMAT_YUYV fourcc_code('Y', 'U', 'Y', 'V') /* [31:0] Cr0:Y1:Cb0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_YVYU fourcc_code('Y', 'V', 'Y', 'U') /* [31:0] Cb0:Y1:Cr0:Y0 8:8:8:8 little endian */ #define DRM_FORMAT_UYVY fourcc_code('U', 'Y', 'V', 'Y') /* [31:0] Y1:Cr0:Y0:Cb0 8:8:8:8 little endian */ #define DRM_FORMAT_VYUY fourcc_code('V', 'Y', 'U', 'Y') /* [31:0] Y1:Cb0:Y0:Cr0 8:8:8:8 little endian */ +/* packed YCbCr444 */ #define DRM_FORMAT_AYUV fourcc_code('A', 'Y', 'U', 'V') /* [31:0] A:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XYUV8888 fourcc_code('X', 'Y', 'U', 'V') /* [31:0] X:Y:Cb:Cr 8:8:8:8 little endian */ +#define DRM_FORMAT_XVYU2101010 fourcc_code('X', 'V', '3', '0') /* [31:0] X:Cr:Y:Cb 2:10:10:10 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 @@ -177,6 +195,13 @@ extern "C" { #define DRM_FORMAT_NV24 fourcc_code('N', 'V', '2', '4') /* non-subsampled Cr:Cb plane */ #define DRM_FORMAT_NV42 fourcc_code('N', 'V', '4', '2') /* non-subsampled Cb:Cr plane */ +/* + * Each sample packed into the top 10 bits of a 16-bit word. + * Y plane: [63:0] Y3:0:Y2:0:Y1:0:Y0:0, 10:6:10:6:10:6:10:6 + * CrCb plane: [63:0] Cr2:0:Cb2:0:Cr0:0:Cb0:0, 10:6:10:6:10:6:10:6 + */ +#define DRM_FORMAT_P010 fourcc_code('P', '0', '1', '0') /* 2x2 subsampled Cr:Cb plane */ + /* * 3 plane YCbCr * index 0: Y plane, [7:0] Y From patchwork Tue Aug 21 18:30:01 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: 10572289 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 93954109C for ; Tue, 21 Aug 2018 18:31:04 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7F17B2AD30 for ; Tue, 21 Aug 2018 18:31:04 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 7848A2AD83; Tue, 21 Aug 2018 18:31:04 +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 038AF2AD54 for ; Tue, 21 Aug 2018 18:31:02 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 4303D6E21A; Tue, 21 Aug 2018 18:31:01 +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-eopbgr70041.outbound.protection.outlook.com [40.107.7.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id F0CE56E21A for ; Tue, 21 Aug 2018 18:30:58 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:30:51 +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 Subject: [PATCH v2 2/5] drm/fourcc: Add tile width and height to drm_format_info Date: Tue, 21 Aug 2018 19:30:01 +0100 Message-Id: <20180821183004.6775-3-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 7317ddc8-7a29-46a7-54ca-08d607943bbe X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:13DmmxQ+oBFMWw81j/sX4U1rqgILl96vtqN8sCqYiee0p/fnxfI058TMzYPC6aRh+O/ZXKXFE7jNY/o3kaqjquIb7f5S7h/4ID1by4m0jz3Jrm4EVv+zZWdjJLiuQ9Dk0fsuOq1Q6B4cHbL09k8qQAnP37VSIkXm3IEl6DzT5vzkAMW5FFWICzrMJ97mlQWulSO2rQu+hYTAc9/b0W/Pcd3GDQr5YPO0WFDnB4spW3Cx/Uu7OXaOpQfQT/leuac/; 25:T22O0KS17xRJrs1fbQV08f7qQUaPMDu+KU9sGDz8Oe79lZUXEDHOiGpNkmEmIbnBUIIjsqXBYPAz5TDKT2jM7PJMEhac05HSN4bO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I+PANhlFHAc1rAigBAmj2ggRnUuLmfMCV7LXNVuRzfY14PGBlnw5ps8dE6Y8CDlVP2D/xdbBCvNUtzGcwfTxIf8AKzgsldE+q372wt67cxdmDvBLSmRf226oLWSQ+X8Cz45f4R2jNIbk6uNEj/rM4ZSpx5id/a+lwgXi453 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(979002)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(6666003)(105586002)(47776003)(16586007)(316002)(6116002)(575784001)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(14444005)(305945005)(921003)(1121003)(969003)(989001)(999001)(1009001)(1019001); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:cGNdFJ94ycUhLm/C0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rp4MCAf465vfaAWvOaVNto7SOC4hLTYfZ6YrFDcDOVC7XYd7Iubs+297Q==; 5:sZA+JSBQXhlZCUYOtmWB+ihjSyYnxtZl1B2BqJR//ebs9tDrbv4A4nerfxdpTWCmH8LTP6uOWIXd0ewMY9arhFcYc85sXLt2mvuUrV2xV6vvI/lJj7nb6FAPd4+USZUOd9KXR3WK66XT++RwKMsQcF5s8f/icTT/j1TPVmDkolE=; 7:RuFYUTFGqgQeZgQ5YyHGq8wxAZHJZnSe4dIaRqUBQPshFJPj9DXqBabQCYN3sV5noguL29jHramt0mFCeSeFJrLmCUnaAOFh3xSHv781kaOgrzDePb/cFYJp7VFti1wnjav2DF5887LAnLkww/StOBSNXW3CXJzMYJ0h8UPt7p6eJKKktQJX2J+y8tmzEpXMHCwfbP/hn8d1mcImcTCFbHRjT40wyOsXuVxHFWjNH9tNmSN0NswQhsXHZuDSczDf SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:30:51.6672 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7317ddc8-7a29-46a7-54ca-08d607943bbe X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 Add two new fields(tile_w and tile_h) to drm_format_info, which represent the horizontal and vertical sizes of a tile in tiled formats. This fields will be used by the next patch to add support in drm core for handling framebuffer restrictions and to correctly handle source cropping. Additionally, since I was touching drm_format_info table I decided to break the lines to the 80 characters limit, they were already getting out of hand, but let's not focus on that, I don't have any problem going back to the original line sizes or style them other way, if someone wants me to. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/drm_fourcc.c | 352 +++++++++++++++++++++++++++-------- include/drm/drm_fourcc.h | 4 + 2 files changed, 281 insertions(+), 75 deletions(-) diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index 18bb960e9943..f55cd93ba2d0 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -105,81 +105,283 @@ EXPORT_SYMBOL(drm_get_format_name); const struct drm_format_info *__drm_format_info(u32 format) { static const struct drm_format_info formats[] = { - { .format = DRM_FORMAT_C8, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGB332, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGR233, .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XRGB4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XBGR4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGBX4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGRX4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_ARGB4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_ABGR4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGBA4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGRA4444, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_XRGB1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XBGR1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGBX5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGRX5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_ARGB1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_ABGR1555, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGBA5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGRA5551, .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGB565, .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGR565, .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGB888, .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGR888, .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XRGB8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGBX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGRX8888, .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGB565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGR565_A8, .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_XRGB2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_XBGR2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_RGBX1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_BGRX1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1 }, - { .format = DRM_FORMAT_ARGB2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_ABGR2101010, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGBA1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGRA1010102, .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_ARGB8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGBA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGRA8888, .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGB888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGR888_A8, .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_XRGB8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_XBGR8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_RGBX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_BGRX8888_A8, .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, .hsub = 1, .vsub = 1, .has_alpha = true }, - { .format = DRM_FORMAT_YUV410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true }, - { .format = DRM_FORMAT_YVU410, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 4, .is_yuv = true }, - { .format = DRM_FORMAT_YUV411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YVU411, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 4, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YUV420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_YVU420, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_YUV422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YVU422, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YUV444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YVU444, .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_NV12, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_NV21, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_NV16, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_NV61, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_NV24, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_NV42, .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YUYV, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_YVYU, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 1, .is_yuv = true }, - { .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_XYUV8888, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_XVYU2101010, .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, .hsub = 1, .vsub = 1, .is_yuv = true }, - { .format = DRM_FORMAT_Y0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, - { .format = DRM_FORMAT_X0L0, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_Y0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .has_alpha = true, .is_yuv = true }, - { .format = DRM_FORMAT_X0L2, .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, - { .format = DRM_FORMAT_P010, .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, .hsub = 2, .vsub = 2, .is_yuv = true }, + { .format = DRM_FORMAT_C8, + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGB332, + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGR233, + .depth = 8, .num_planes = 1, .cpp = { 1, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XRGB4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XBGR4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGBX4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGRX4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_ARGB4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_ABGR4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGBA4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGRA4444, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_XRGB1555, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XBGR1555, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGBX5551, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGRX5551, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, }, + { .format = DRM_FORMAT_ARGB1555, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_ABGR1555, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGBA5551, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGRA5551, + .depth = 15, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGB565, + .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGR565, + .depth = 16, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGB888, + .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGR888, + .depth = 24, .num_planes = 1, .cpp = { 3, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XRGB8888, + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XBGR8888, + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGBX8888, + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGRX8888, + .depth = 24, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGB565_A8, + .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGR565_A8, + .depth = 24, .num_planes = 2, .cpp = { 2, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_XRGB2101010, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XBGR2101010, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_RGBX1010102, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_BGRX1010102, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_ARGB2101010, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_ABGR2101010, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGBA1010102, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGRA1010102, + .depth = 30, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_ARGB8888, + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_ABGR8888, + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGBA8888, + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGRA8888, + .depth = 32, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGB888_A8, + .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGR888_A8, + .depth = 32, .num_planes = 2, .cpp = { 3, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_XRGB8888_A8, + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_XBGR8888_A8, + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_RGBX8888_A8, + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_BGRX8888_A8, + .depth = 32, .num_planes = 2, .cpp = { 4, 1, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true }, + { .format = DRM_FORMAT_YUV410, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 4, .vsub = 4, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVU410, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 4, .vsub = 4, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YUV411, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 4, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVU411, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 4, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YUV420, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVU420, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YUV422, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVU422, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YUV444, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVU444, + .depth = 0, .num_planes = 3, .cpp = { 1, 1, 1 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV12, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV21, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV16, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV61, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV24, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_NV42, + .depth = 0, .num_planes = 2, .cpp = { 1, 2, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YUYV, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_YVYU, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_UYVY, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_VYUY, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_AYUV, + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_XYUV8888, + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_XVYU2101010, + .depth = 0, .num_planes = 1, .cpp = { 4, 0, 0 }, + .hsub = 1, .vsub = 1, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, + { .format = DRM_FORMAT_Y0L0, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2, + .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L0, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2, + .is_yuv = true }, + { .format = DRM_FORMAT_Y0L2, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2, + .has_alpha = true, .is_yuv = true }, + { .format = DRM_FORMAT_X0L2, + .depth = 0, .num_planes = 1, .cpp = { 2, 0, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 2, .tile_h = 2, + .is_yuv = true }, + { .format = DRM_FORMAT_P010, + .depth = 0, .num_planes = 2, .cpp = { 2, 4, 0 }, + .hsub = 2, .vsub = 2, .tile_w = 1, .tile_h = 1, + .is_yuv = true }, }; unsigned int i; diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index f9c15845f465..41681cf2b140 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -38,6 +38,8 @@ struct drm_mode_fb_cmd2; * @cpp: Number of bytes per pixel (per plane) * @hsub: Horizontal chroma subsampling factor * @vsub: Vertical chroma subsampling factor + * @tile_w: Width of a tile in pixels, for non-tiled formats this should be 1 + * @tile_h: Height of a tile in pixels, for non-tiled formats this should be 1 * @has_alpha: Does the format embeds an alpha component? * @is_yuv: Is it a YUV format? */ @@ -48,6 +50,8 @@ struct drm_format_info { u8 cpp[3]; u8 hsub; u8 vsub; + u8 tile_w; + u8 tile_h; bool has_alpha; bool is_yuv; }; From patchwork Tue Aug 21 18:30:02 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: 10572291 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 A68C51803 for ; Tue, 21 Aug 2018 18:31:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8CAF52AD9F for ; Tue, 21 Aug 2018 18:31:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8A5A22AD85; Tue, 21 Aug 2018 18:31:11 +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 2D5202AD58 for ; Tue, 21 Aug 2018 18:31:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id C98B56E319; Tue, 21 Aug 2018 18:31:08 +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-eopbgr70087.outbound.protection.outlook.com [40.107.7.87]) by gabe.freedesktop.org (Postfix) with ESMTPS id 8A9DB6E319 for ; Tue, 21 Aug 2018 18:31:07 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:31:00 +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 Subject: [PATCH v2 3/5] drm/i915: Set tile sizes in drm_format_info Date: Tue, 21 Aug 2018 19:30:02 +0100 Message-Id: <20180821183004.6775-4-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 6dc1c704-ca18-4c9c-ff44-08d60794413e X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:E/HYDcRilcUpc5SCy0tPq/NKiPAuGgjAgKmSbHBs10CeCjg9lG5qDaNJ7CBrBsCen6ZHgO4O4QP0/kxdXwAJLb+RLzGbkuMFCnS2TvopabfhsZBWq9DRh312Idq9jF7wAynNCA3IlIEzmKfuCkhoSXb2dZoRHGRS9Fiy1FGPAPUBloLwNtRCYtDemI2stqo3svKhyuPXjwkZn/vMAisF2mn6MoHnbuWKpga9NDduEWHnYtAPQp22BEPKde+XO5mo; 25:hJEP/1sAbqs8jk5sXSsQD9ZIuvrXwACEkFZVTb64dUnFNtw3mp5H+V63nD2TNugNRoQOkX0MCyNge69xvzJ+9x6EpXPeLD8Bq/T9i07GBerpMoFWTlhHef6tvQsm2rn9I40o9qVK+jhd7SykncMj7rH7eLLgQ850oyo4jbzlvs9SZeQ+x82L0Lt0/Rv1Obtgmi0yZtt6VYGXyIDB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MXUkEShUjHJDL2OVqUl41A/doGPzHhNvfHuIOwid0LVkeX6DeU3Jls9sjvUrS1CovDHxGQo 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(105586002)(47776003)(16586007)(316002)(6116002)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:GcP2+2q+TPHcGRhseneqDKK9hxVK7ViEdwOaX8I?= 5+G8EjHdSelZi3J2JsDMrVna+dyAFQFR0uLdYtmsdIjW2baBj0/TBU00s1ZlF2NgnjrpiKPEQbjOp0AORdHxOTJkYdr/jExPjLfcTSTI1u2l+kTWjEOK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BPpFAAaf6qb7iurkrNgvgN6/6r3YlLj+syeJ+N/2Ft7Sx9FjsChmEJTj5qtUd7Qp9GP0EmLVfoYJ96LA+838bRWCV/FOtOKeEiPMS0Xxi1Wtg0KeUjTJif5mv7DJ/IONkAIA8EJtE15Y/YfftfsvsgBf2LP4aklrtkfiAGItGGSWYDpxp9G/ikMftFdNDFDPBTot8MLr3D9vdAOUbhyp1M2QRPVSSRqTfb3Kpsa+ SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:31:00.8980 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 6dc1c704-ca18-4c9c-ff44-08d60794413e X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 Two new fields had been added to drm_format_info struct, tile_w and tile_h, this need to be set to 1 for all non-tiled formats. Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/i915/intel_display.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c index bd8956f2544d..fdc679e9dfa3 100644 --- a/drivers/gpu/drm/i915/intel_display.c +++ b/drivers/gpu/drm/i915/intel_display.c @@ -2440,10 +2440,14 @@ static unsigned int intel_fb_modifier_to_tiling(uint64_t fb_modifier) * main surface. */ static const struct drm_format_info ccs_formats[] = { - { .format = DRM_FORMAT_XRGB8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 8, .vsub = 16, }, - { .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 8, .vsub = 16, }, - { .format = DRM_FORMAT_ARGB8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 8, .vsub = 16, }, - { .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, .hsub = 8, .vsub = 16, }, + { .format = DRM_FORMAT_XRGB8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, + .hsub = 8, .vsub = 16, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_XBGR8888, .depth = 24, .num_planes = 2, .cpp = { 4, 1, }, + .hsub = 8, .vsub = 16, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_ARGB8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, + .hsub = 8, .vsub = 16, .tile_w = 1, .tile_h = 1 }, + { .format = DRM_FORMAT_ABGR8888, .depth = 32, .num_planes = 2, .cpp = { 4, 1, }, + .hsub = 8, .vsub = 16, .tile_w = 1, .tile_h = 1 }, }; static const struct drm_format_info * From patchwork Tue Aug 21 18:30:03 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: 10572293 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 98EFA17E0 for ; Tue, 21 Aug 2018 18:31:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 849702AB8A for ; Tue, 21 Aug 2018 18:31:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 827082AC33; Tue, 21 Aug 2018 18:31:19 +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 B631E2AB8A for ; Tue, 21 Aug 2018 18:31:18 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id A77936E360; Tue, 21 Aug 2018 18:31:17 +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-eopbgr70041.outbound.protection.outlook.com [40.107.7.41]) by gabe.freedesktop.org (Postfix) with ESMTPS id C15E26E360 for ; Tue, 21 Aug 2018 18:31:15 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:31:08 +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 Subject: [PATCH v2 4/5] drm: Add support for handling linear tile formats Date: Tue, 21 Aug 2018 19:30:03 +0100 Message-Id: <20180821183004.6775-5-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 372df687-4a5b-4c0a-83e1-08d607944603 X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:spXIycoJeOyeKahzFGaSDQ74JeJlpiFqZFIoQKEW7xB1zFbs4hDCSoW65UdjMd5h1qDia6hxjntCK6zdTk3Kgr+zJkYXZC12prU30KQqb+sViwWpnECQzskjA5KUK9lxuPoVTB/Gw84xBx9mVCabarD6nKkWHycxEEUMIWTxI7c84VobD1aDgQ7NFzrerASSvJLTWweemEU9Ee/kLBTigG+P8XwBcMTjSnqa3LUQdB3xCm/Gw0w43YGJY3glDmDL; 25:Q8BNGciJkkGEJXubEPNEyGjBH9iSQMwcTG0UVLQh/F1Fe7vC87eLJpk1WCraEp+G6Oh7APL9FVxFYUxqTVkfFvqff9562mjfP5ZhR8p7VmiDJ1NG00dEnvPoYa/rDWQazCGSeDj+n9Oxud7vPinpBEuF2POvxH17POdwD9TRCyQMQRXjfNlElTQrEjnhJhyb3i+E/j76qAJcdH2BReqcFX+iULz0XmBMUkiwbneMKQv3wi0vTJN0C98P+acK7ZjjFYoB22Kyjf/vDTpiGMgAB8LPyXij8Mzby4EKL3q0yZ/bw+nZToaHa7oiqGPOKl9tM6nZL9zWwBBVcYCkBaqqcg==; 31:aZzhm48VwPZ8upwYgSBwlCxIQDx3F3b7aTZ+z6gBQsix6k3x+lw4l2XhaemdPZqZJTMp2dYLY6YZPZqchdnkU9CdXI9y4AXPFhgrMS7NK4Y51xmQdlhg8pB4PQuer7SnIjdRjcQNckXrCts3RUmMGiQg/cnonq6d63rfgxUrLZQqQxigkKWbt41fC6BCUIXRplUVhw6xj1vhxylF4aOlA/FZKNeXacPx9Srt9DNPdEs= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2548: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 20:MYPhOlnEacf8gNvZV2GzdWtNzP2Y3+UQot4fp/afi1HXRN16tUWBB+SjP7jJ8OvS+/MVuN+EwoIoWs591yKjl2tzs9yfo4ZI+1lq7M2Fv6rvQ1spcynUGWLvluQ9dEfY0drbvjg3o30gWztLg2EOW87PLELYj+A4QzJtYJx81+csel0np50K/Pl1pkFfysiIp6FRGEaF/pnV/5Vs9QpHGm056YzUn1nklkqTYmBCFj9l3hfXF8eXbswdPTT53BfxOPO+CcYBls0Iz7bX5r14V9aHq5NL2plphnfDAWGWwWpBe59IxRSbx39H71vLZ/2vS4VzfBEdIOL20+3xzZtE4Q==; 4:GjbIrCmZcx00qaY8XgykkxdCvnJSthptQ2ALbxfHFn27uSRDWHKFp2xE7EYnPXu8lZH+tlJRAFGKsc8w+dFvs0q+fxlffm2LNh7d288n7LWQmWQY1oJavy5U/sQtG08iuEagpc3qgof0alvV/DVIUTGk1hkVZC7yKD50F+I7CvbOykEix7TMWSgK3pPKoDEdxZwB81kfEadSbg/27MVk8VYEejIzyDmioleNO4he+wb/2nFdIs8wu4Ok7Xr7whYaHGFyyJ7AgMa5abqfTt37npCC6PwtKUWkVKGXX5A4VB4a/ii4zpLsSef8FsPJM5WY 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(52314003)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(6666003)(105586002)(47776003)(16586007)(316002)(6116002)(575784001)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(14444005)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:BpIfE5gI7prTbObMT7C7SJegwiDJqCsFDDo+iAA?= vKqyxmj2OXDMk/xQsQl6ijw5UQHiIA7rdXzrpYO70cBOiRE0zf0uFTJMYCeI7NxhEvT+i93s2IjAldR4Q2EJEWrJ0671jHB+mMaJe4HsOi9NDLlcu1RijPzdazB1jkx4h9UxXX81SgQB9lEhBe0BdUqUKPeDbMt7xFODPYCOQu1gN/kTQMrcwvBCTXDepsCTDS3v1RHNps/IUS6ldNgk1mm7csyN+M/c1yn88kzIqniT2+eRdH3+Gr9MpQi2fg6+OxXY5Po1ksC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EsDjDKRgxfv8rYsNVCm3jBXkdCE813Ts1Fo5DN5+TSc9dYViIB9I6Hw9nl9DnIFUbb+kAp4SmRjBC3wtlYO8VlESqTIeuz70LWGruv9bYtuEH7N4gepCMeSXJAnTR SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:31:08.8988 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 372df687-4a5b-4c0a-83e1-08d607944603 X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 The previous patch added tile_w and tile_h, which represent the horizontal and vertical sizes of a tile. This one uses that to plumb through drm core in order to be able to handle linear tile formats without the need for drivers to roll up their own implementation. This patch had been written with Mali-dp X0L2 and X0L0 in mind which is a 1 plane YCbCr 420 format with a 2x2 tile, that uses in average 2 bytes per pixel and where tiles are laid out in a linear manner. Now what are the restrictions: 1. Pitch in bytes is expected to cover at least tile_h * width in pixels. Due to this the places where the pitch is checked/used need to be updated to take into consideration the tile_w, tile_h and tile_size. tile_size = cpp * tile_w * tile_h 2. When doing source cropping plane_src_x/y need to be a multiple of tile_w/tile_h and we need to take into consideration the tile_w/tile_h when computing the start address. For all non-tiled formats the tile_w and tile_h will be 1, so if I didn't miss anything nothing should change. Regarding multi-planar linear tile formats, I'm not sure how those should be handle I kind of assumed that tile_h/tile_w will have to be divided by horizontal/subsampling. Anyway, I think it's best to just put an warning in there and handle it when someone tries to add support for them. Signed-off-by: Alexandru Gheorghe Reviewed-by: Liviu Dudau --- drivers/gpu/drm/drm_atomic.c | 8 +++ drivers/gpu/drm/drm_fb_cma_helper.c | 11 ++++- drivers/gpu/drm/drm_fourcc.c | 52 ++++++++++++++++++++ drivers/gpu/drm/drm_framebuffer.c | 19 +++++-- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 10 ++-- include/drm/drm_fourcc.h | 2 + 6 files changed, 94 insertions(+), 8 deletions(-) diff --git a/drivers/gpu/drm/drm_atomic.c b/drivers/gpu/drm/drm_atomic.c index 3eb061e11e2e..7a3e893a4cd1 100644 --- a/drivers/gpu/drm/drm_atomic.c +++ b/drivers/gpu/drm/drm_atomic.c @@ -1087,6 +1087,14 @@ static int drm_atomic_plane_check(struct drm_plane *plane, return -ENOSPC; } + /* Make sure source coordinates are a multiple of tile sizes */ + if ((state->src_x >> 16) % state->fb->format->tile_w || + (state->src_y >> 16) % state->fb->format->tile_h) { + DRM_DEBUG_ATOMIC("[PLANE:%d:%s] Source coordinates do not meet tile restrictions", + plane->base.id, plane->name); + return -EINVAL; + } + if (plane_switching_crtc(state->state, plane, state)) { DRM_DEBUG_ATOMIC("[PLANE:%d:%s] switching CRTC directly\n", plane->base.id, plane->name); diff --git a/drivers/gpu/drm/drm_fb_cma_helper.c b/drivers/gpu/drm/drm_fb_cma_helper.c index 47e0e2f6642d..4d8052adce67 100644 --- a/drivers/gpu/drm/drm_fb_cma_helper.c +++ b/drivers/gpu/drm/drm_fb_cma_helper.c @@ -87,6 +87,8 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, struct drm_gem_cma_object *obj; dma_addr_t paddr; u8 h_div = 1, v_div = 1; + u32 tile_w = drm_format_tile_width(fb->format, plane); + u32 tile_h = drm_format_tile_height(fb->format, plane); obj = drm_fb_cma_get_gem_obj(fb, plane); if (!obj) @@ -99,8 +101,13 @@ dma_addr_t drm_fb_cma_get_gem_addr(struct drm_framebuffer *fb, v_div = fb->format->vsub; } - paddr += (fb->format->cpp[plane] * (state->src_x >> 16)) / h_div; - paddr += (fb->pitches[plane] * (state->src_y >> 16)) / v_div; + paddr += (fb->format->cpp[plane] * tile_w * (state->src_x >> 16)) + / h_div; + /* + * For tile formats pitches are expected to cover at least + * width * tile_h pixels + */ + paddr += ((fb->pitches[plane] / tile_h) * (state->src_y >> 16)) / v_div; return paddr; } diff --git a/drivers/gpu/drm/drm_fourcc.c b/drivers/gpu/drm/drm_fourcc.c index f55cd93ba2d0..d6c9c5aa4036 100644 --- a/drivers/gpu/drm/drm_fourcc.c +++ b/drivers/gpu/drm/drm_fourcc.c @@ -557,3 +557,55 @@ int drm_format_plane_height(int height, uint32_t format, int plane) return height / info->vsub; } EXPORT_SYMBOL(drm_format_plane_height); + +/** + * drm_format_tile_width - width of a tile for tile formats, should be 1 for all + * non-tiled formats. + * @format: pixel format + * @plane: plane index + * + * Returns: + * The width of a tile, depending on the plane index and horizontal sub-sampling + */ +uint32_t drm_format_tile_width(const struct drm_format_info *info, int plane) +{ + WARN_ON(!info->tile_w); + if (plane == 0 || info->tile_w == 1) + return info->tile_w; + + /* + * Multi planar tiled formats have never been tested, check that + * buffer restrictions and source cropping meet the format layout + * expectations. + */ + WARN_ON("Multi-planar tiled formats unsupported"); + WARN_ON(info->tile_w % info->hsub); + return info->tile_w / info->hsub; +} +EXPORT_SYMBOL(drm_format_tile_width); + +/** + * drm_format_tile_height - height of a tile for tile formats, should be 1 for + * all non-tiled formats. + * @format: pixel format + * @plane: plane index + * + * Returns: + * The height of a tile, depending on the plane index and vertical sub-sampling + */ +uint32_t drm_format_tile_height(const struct drm_format_info *info, int plane) +{ + WARN_ON(!info->tile_h); + if (plane == 0 || info->tile_h == 1) + return info->tile_h; + + /* + * Multi planar tiled formats have never been tested, check that + * buffer restrictions and source cropping meet the format layout + * expectations. + */ + WARN_ON("Multi-planar tiled formats unsupported"); + WARN_ON(info->tile_h % info->vsub); + return info->tile_h / info->vsub; +} +EXPORT_SYMBOL(drm_format_tile_height); diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 781af1d42d76..57509e51cb80 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -191,19 +191,32 @@ static int framebuffer_check(struct drm_device *dev, unsigned int width = fb_plane_width(r->width, info, i); unsigned int height = fb_plane_height(r->height, info, i); unsigned int cpp = info->cpp[i]; + unsigned int tile_w = drm_format_tile_width(info, i); + unsigned int tile_h = drm_format_tile_height(info, i); + unsigned int tile_size = cpp * tile_w * tile_h; + unsigned int num_htiles; + unsigned int num_vtiles; if (!r->handles[i]) { DRM_DEBUG_KMS("no buffer object handle for plane %d\n", i); return -EINVAL; } - if ((uint64_t) width * cpp > UINT_MAX) + if ((width % tile_w) || (height % tile_h)) { + DRM_DEBUG_KMS("buffer width/height need to be a multiple of tile dimensions\n"); + return -EINVAL; + } + + num_htiles = width / tile_w; + num_vtiles = height / tile_h; + + if ((uint64_t)num_htiles * tile_size > UINT_MAX) return -ERANGE; - if ((uint64_t) height * r->pitches[i] + r->offsets[i] > UINT_MAX) + if ((uint64_t)num_vtiles * r->pitches[i] + r->offsets[i] > UINT_MAX) return -ERANGE; - if (r->pitches[i] < width * cpp) { + if (r->pitches[i] < num_htiles * tile_size) { DRM_DEBUG_KMS("bad pitch %u for plane %d\n", r->pitches[i], i); return -EINVAL; } diff --git a/drivers/gpu/drm/drm_gem_framebuffer_helper.c b/drivers/gpu/drm/drm_gem_framebuffer_helper.c index 2810d4131411..3d01a1a9d5d2 100644 --- a/drivers/gpu/drm/drm_gem_framebuffer_helper.c +++ b/drivers/gpu/drm/drm_gem_framebuffer_helper.c @@ -161,6 +161,11 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file, unsigned int width = mode_cmd->width / (i ? info->hsub : 1); unsigned int height = mode_cmd->height / (i ? info->vsub : 1); unsigned int min_size; + unsigned int tile_w = drm_format_tile_width(info, i); + unsigned int tile_h = drm_format_tile_height(info, i); + unsigned int tile_size = info->cpp[i] * tile_w * tile_h; + unsigned int num_htiles = width / tile_w; + unsigned int num_vtiles = height / tile_h; objs[i] = drm_gem_object_lookup(file, mode_cmd->handles[i]); if (!objs[i]) { @@ -169,9 +174,8 @@ drm_gem_fb_create_with_funcs(struct drm_device *dev, struct drm_file *file, goto err_gem_object_put; } - min_size = (height - 1) * mode_cmd->pitches[i] - + width * info->cpp[i] - + mode_cmd->offsets[i]; + min_size = (num_vtiles - 1) * mode_cmd->pitches[i] + + num_htiles * tile_size + mode_cmd->offsets[i]; if (objs[i]->size < min_size) { drm_gem_object_put_unlocked(objs[i]); diff --git a/include/drm/drm_fourcc.h b/include/drm/drm_fourcc.h index 41681cf2b140..001afca9bcff 100644 --- a/include/drm/drm_fourcc.h +++ b/include/drm/drm_fourcc.h @@ -76,6 +76,8 @@ int drm_format_horz_chroma_subsampling(uint32_t format); int drm_format_vert_chroma_subsampling(uint32_t format); int drm_format_plane_width(int width, uint32_t format, int plane); int drm_format_plane_height(int height, uint32_t format, int plane); +uint32_t drm_format_tile_width(const struct drm_format_info *info, int plane); +uint32_t drm_format_tile_height(const struct drm_format_info *info, int plane); const char *drm_get_format_name(uint32_t format, struct drm_format_name_buf *buf); #endif /* __DRM_FOURCC_H__ */ From patchwork Tue Aug 21 18:30:04 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: 10572295 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 59747109C for ; Tue, 21 Aug 2018 18:31:24 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4578B2AD9B for ; Tue, 21 Aug 2018 18:31:24 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 432E92AD9E; Tue, 21 Aug 2018 18:31:24 +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 EDFA82AD0F for ; Tue, 21 Aug 2018 18:31:23 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id E89806E36B; Tue, 21 Aug 2018 18:31:22 +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-eopbgr70054.outbound.protection.outlook.com [40.107.7.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 968DE6E370 for ; Tue, 21 Aug 2018 18:31:21 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.106.49) by AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1059.23; Tue, 21 Aug 2018 18:31:14 +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 Subject: [PATCH v2 5/5] drm: mali-dp: Enable mali specific buffer formats Date: Tue, 21 Aug 2018 19:30:04 +0100 Message-Id: <20180821183004.6775-6-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 In-Reply-To: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> References: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> MIME-Version: 1.0 X-Originating-IP: [217.140.106.49] X-ClientProxiedBy: MWHPR2001CA0020.namprd20.prod.outlook.com (2603:10b6:301:15::30) To AM5PR0802MB2548.eurprd08.prod.outlook.com (2603:10a6:203:a1::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: c27dcf18-523c-4a09-8545-08d6079449ab X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989137)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(5600074)(711020)(4618075)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2548; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 3:ACfvCQGaxdKSVHTwPZ8ojM4TFgF2we0ky0n6i1vwV9jX1oAJBVP743ZCnGnzBf2Mw1CNsOwxaHAKNFlCKTT+DSjz7pbAL46sH8yGjfqy+H0vMYP+9F2tJCUgGOzNhQIyHQoOLS68Eff4WDTjLwkOiW6oEsfXavAEcyL7dendzeTlyXPzUzssROXPjwG65Vee6kXwn0Z1V2jNk/9qCddDZ10Yt31tNx1txpTc6xGCdwYrMPDC+l84XkJ4t07wbDyJ; 25:JoOFu/Uk3mE4ZnivFBA1hHn4eSTt1gk7EgtDQmXWZ4ctaWkQCsKM+GjrNEvqtfRwRp2EIIpnjq+YF5ErEsWvbDfBTcVPorP5oIhAyRY9bR1aOcACB0wrnWIRXe4yqLAn8JOe9qaztF/PKxo7N9rTKyLeobLNDroZDIoF10uZRuGF8jl11yeSOQt4sOdet688378YLGEJybq1ixnfyjnIJlxder4Vwg2uhURmyi5GCNdmZihHAHHCW+BY4uUruJsQ4K07UC7K9JbUt4DCAuJTtJNPXmOidnLDBgCbQ5bBAVUx3WbWCLu6zUEH7Sd/OxTkj7U0BJmWELnEXT5vUkKA9g==; 31:+cK98tulEhDQAisQzY9b3otj64o+R437M+/uCGadX4Xps1uVnrWWH1rPOiuUyc4UF9zNfvfD0BErz1b96YfU12r6gyIyxnwi6Ksy1/zK9g/nSKN2/gOlgzGB1YG5bL0B+5OJUpR1b4A1IJ/7McZ4g9RR0dwZdo2IVcWe8V9jzsagldUcUT//1eiidY178mdFsZ9ezgU1XVegY9r/G6qd29HszUP7WPvEYJV0vxxEvaQ= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2548: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2548; 20:nKbWnfX1d3sR0RUlo0c4cOLAeKEbH26C3chWasAGScJkm12oX2sOqYnNJZQZvSgBPos6WDBgfiqexXkihRvYH3rKDnQBXPV3R0LzvPhKo/Uxo8fq+S2HrGLoVIzeFpKspwIgp3E9kDF9V2cPkPxVgB1GjuPzoU6jdq0aB02zFPCg55zwvWX4+1xSb8HZLMnWxXx5+GI7RNSiC475SXofvd4Va/EOzWfaY85gT/nsafxYnhU/sFDWFl2rk0HLz4sa7Kpyl40bN68HH7vwKGq1w180WY51H22JMtO/uotvWk/mjj4bGNxtKU0pKMKFyf0m2pKobZZEcnRywp9J9bRLbQ==; 4:hMQcnmpCjWO9Nqydy4jDg2RwsaTESt+uJyYal+XIUgbQHhU+WK3qQECjYF9cX/s28E1uCw+0pqUaRJh83vGdmBnbHAVwjuam8fftKT9ZdaYdrOtvhOZqmprsrFA14FSzKR44FrALuAl9aXhlhVcAjpiVmY1Tw3uyhq3rFFz7hbIrxY7IwHLmza/cic+jiMedViCPzyMCUUlfzmok+VV+BdSkZ32pYugZ00/UyPI6TkLoT3nqIQPaL1AG72FTL2SCP59Nuy3myzCuvXeeMsXt9nU7tzfzIXjrex/9EqDnUz6hAgiKJGJpXE3EuFnSjYqs 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)(823301075)(3002001)(10201501046)(3231311)(944501410)(52105095)(93006095)(93001095)(6055026)(149027)(150027)(6041310)(20161123558120)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123560045)(20161123562045)(20161123564045)(201708071742011)(7699016); SRVR:AM5PR0802MB2548; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2548; X-Forefront-PRVS: 0771670921 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(39860400002)(136003)(396003)(376002)(366004)(189003)(199004)(8676002)(68736007)(72206003)(97736004)(50226002)(36756003)(106356001)(53936002)(6666003)(105586002)(47776003)(16586007)(316002)(6116002)(575784001)(66066001)(2906002)(86362001)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6486002)(7736002)(81156014)(81166006)(476003)(76176011)(50466002)(26005)(186003)(11346002)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(446003)(386003)(16526019)(5660300001)(14444005)(305945005)(921003)(1121003); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2548; H:e114479-lin.cambridge.arm.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-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2548; 23:anZPh+kX6UO1FuV4gWBe1rROWwtVyKousNBq3EC?= aiL39yLbWx8Sr35hOm25IQFCH1Bctwi7KkDSNIsbRxqrVb/J+DntYjORbL3wNQuq9z1KjVQcAdc1+TWLLJB+I+7mU3cfT5drq08xPdTe+JO/aZH/exBktYBqI3KBa5xfdvwyVc+ynie8tx3cp/z79q69OFPzklp9R9IEpL48EJrbQRDJF23PSizQA1xdtsKSIbDDq76wS3nY5V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XZJRk3PXKXRg5fGcjjQodSfWbB3Ddw5dUvP662aa/ZqjyFiUqX3momnrizpmFY356UDvMCXILWsCArhTzoB9DPbROM2PgA7X4xZ1870BNvB53RHK0yMtOtNWDqltSo+Me5mTXEp4dQ/9uz2Pao543m5J31YAZD61mYf3KAon6LB1qfd6Q9PSoWhbFTaXv+L7NI0rU SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:31:14.9939 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c27dcf18-523c-4a09-8545-08d6079449ab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2548 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 Enable the following formats - DRM_FORMAT_XYUV8888 - DRM_FORMAT_XVYU2101010 - DRM_FORMAT_X0L0 - DRM_FORMAT_X0L2 - DRM_FORMAT_P010 Signed-off-by: Alexandru Gheorghe --- drivers/gpu/drm/arm/malidp_hw.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/arm/malidp_hw.c b/drivers/gpu/drm/arm/malidp_hw.c index c94a4422e0e9..472cae76e19b 100644 --- a/drivers/gpu/drm/arm/malidp_hw.c +++ b/drivers/gpu/drm/arm/malidp_hw.c @@ -74,10 +74,15 @@ static const struct malidp_format_id malidp500_de_formats[] = { { DRM_FORMAT_ABGR1555, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 1) }, \ { DRM_FORMAT_RGB565, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 2) }, \ { DRM_FORMAT_BGR565, DE_VIDEO1 | DE_GRAPHICS1 | DE_VIDEO2, MALIDP_ID(4, 3) }, \ + { DRM_FORMAT_XYUV8888, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 0) }, \ { DRM_FORMAT_YUYV, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 2) }, \ { DRM_FORMAT_UYVY, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 3) }, \ + { DRM_FORMAT_X0L0, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 4)}, \ { DRM_FORMAT_NV12, DE_VIDEO1 | DE_VIDEO2 | SE_MEMWRITE, MALIDP_ID(5, 6) }, \ - { DRM_FORMAT_YUV420, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 7) } + { DRM_FORMAT_YUV420, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(5, 7) }, \ + { DRM_FORMAT_XVYU2101010, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 0)}, \ + { DRM_FORMAT_X0L2, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 6)}, \ + { DRM_FORMAT_P010, DE_VIDEO1 | DE_VIDEO2, MALIDP_ID(6, 7)} static const struct malidp_format_id malidp550_de_formats[] = { MALIDP_COMMON_FORMATS,