From patchwork Tue Aug 21 18:29:59 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: 10572285 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 E4C9713B6 for ; Tue, 21 Aug 2018 18:30:40 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D1DFD2ACEA for ; Tue, 21 Aug 2018 18:30:40 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id CE5D92AD4E; Tue, 21 Aug 2018 18:30:40 +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 50BCC2ACEA for ; Tue, 21 Aug 2018 18:30:40 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id ED9F489CD7; Tue, 21 Aug 2018 18:30:37 +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-eopbgr70050.outbound.protection.outlook.com [40.107.7.50]) by gabe.freedesktop.org (Postfix) with ESMTPS id A4A3B89C0A for ; Tue, 21 Aug 2018 18:30:35 +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:28 +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 0/5] Add Mali DP non-compressed pixel formats Date: Tue, 21 Aug 2018 19:29:59 +0100 Message-Id: <20180821183004.6775-1-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 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: b7de7a79-469a-41ba-33c9-08d607942de8 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:qlClaNzRbulACWKSXJzqmPIjpI5GbbAgYMWG2vPTELSj4+vCBjqKxBVLq4Hx3unEj+1SNIANNHlbGnqOeUB5FVgD7CX67u3ekhe8O0yi5ES/gjURoR/jGNQJs5uACkjp6rzXXnSFa1v/5udD84aebvFQjSH8rKTAcGTla/U5joipXw6Gu6j6R+oQsmliBCs4s8pPQ8suQDyRqOKSaDJVp8wjw2tTY+68UKZHUpkHjyudOXxvm7lOZWCWU0fVf/O2; 25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yAUhscadP8+paOArtz2Moon+KvmThlQBYJY6/+Fyipi6ZHSG5yzg2nTUfKxxUV2npC/cqCJz//TbHTq3AX37Ft/CgCBzT35zUHfu89tEwRKFS7Fi1UCF5VWKazS75z1zgoDLzAjyu/15g+j4iADCnk/A+RwsQUhemimLeX9DIa2HCapogTBdVt+fPWLb2DowfFMIYC4ug06piaS3SVd8e4rFJ90ymaDQ0uoHr/5tBfiy2hndkQMB6UuX8MSE+YBjO X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(217544274631240); 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)(966005)(8936002)(3846002)(478600001)(4326008)(1076002)(25786009)(6306002)(6486002)(7736002)(81156014)(81166006)(476003)(50466002)(26005)(186003)(2616005)(48376002)(51416003)(486006)(7696005)(956004)(52116002)(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: =?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 5:4bNDAC4+eC4MKnxhTOVlmF7yzGS0s/Umvgi1gQ6TrjD4HdDtw3SZCWZMv2eZP8KJ6Q0iLUBUXvPkKO0hGlOtl/cv3k+IEd3EDsreZtNMZVXM+UMC2CF/jrFjxNwoLP6Q9ykSsGw8nFGx5FbgXXYkodyCDp/tYdlWkZYEgrRrYqQ=; 7:NVVzYMADKZkhqbGzw/YfTkYMhTY7QPZpQOQA2yBlBCLAGpZWHneyYWy18LmEnagUwMnATRDGzrKPxN6PWO97/MEG7DgU0bCb1dstBe7CkwBw+z/4sS4hhTPniNLMbrAD8dUtWJC/8ZrHOHKaI+q7aceKUse1AGSjCCKr83C6TGs47yzp6qiQuaACUFy3ql6afJw5zP+ZY3sJ0SjPPkvajUUrLPVLrgVaR+D2OvmAI5Ms+BXHjRNGUYtrQbY4ZVvD SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Aug 2018 18:30:28.3864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b7de7a79-469a-41ba-33c9-08d607942de8 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 Change since v1 [1]: - Droped changes that add special handling of the tile formats X0L0/X0L2 in the driver and extend drm_core, by adding tile_h and tile_w in drm_format_info, suggested by Daniel Vetter here [2], see patches 2 to 4. - Use a differnt fourcc code for DRM_FORMAT_XVYU2101010, as suggested by Brian Starkey here [3]. Mali DP supports a bunch of pixel formats that don't have a fourcc code defined in drm_fourcc.h, so this patchset adds the definition for those formats and enables them in mali-dp driver. The following new formats will be added: Packed YCbCr444 * DRM_FORMAT_XYUV8888 * DRM_FORMAT_XVYU2101010 Two plane 10 bits format. * DRM_FORMAT_P010 Packed YCbCr420 2x2 tiled formats * DRM_FORMAT_Y0L0 * DRM_FORMAT_X0L0 * DRM_FORMAT_Y0L2 * DRM_FORMAT_X0L2 The difference between X0L0/X0L2 vs Y0L0/Y0L2 is that the later group have two alpha bits per pixel. This group is a bit special because we are dealing with a tiled format where the first 64 bits in memory represent the pixels for a 2x2 tile, so it needs a bit of special handling when it comes to: - pitch: needs to cover both rows that are in the same tile. - min allocation size: since a pitch cover both rows the formulas defined in drm_gem_fb_create don't work anymore. - handling of src_x and src_y offset: same as above since we are dealing with a tiled format drm_fb_cma_get_gem_obj doesn't return the correct address offset. [1] https://lists.freedesktop.org/archives/dri-devel/2018-July/184597.html [2] https://lists.freedesktop.org/archives/dri-devel/2018-August/186465.html [3] https://lists.freedesktop.org/archives/dri-devel/2018-August/186057.html Alexandru Gheorghe (5): drm/fourcc: Add new fourcc for malidp uncompressed formats drm/fourcc: Add tile width and height to drm_format_info drm/i915: Set tile sizes in drm_format_info drm: Add support for handling linear tile formats drm: mali-dp: Enable mali specific buffer formats drivers/gpu/drm/arm/malidp_hw.c | 7 +- drivers/gpu/drm/drm_atomic.c | 8 + drivers/gpu/drm/drm_fb_cma_helper.c | 11 +- drivers/gpu/drm/drm_fourcc.c | 397 +++++++++++++++---- drivers/gpu/drm/drm_framebuffer.c | 19 +- drivers/gpu/drm/drm_gem_framebuffer_helper.c | 10 +- drivers/gpu/drm/i915/intel_display.c | 12 +- include/drm/drm_fourcc.h | 6 + include/uapi/drm/drm_fourcc.h | 27 +- 9 files changed, 415 insertions(+), 82 deletions(-)