From patchwork Thu Jul 26 14:10: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: 10545943 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 07F2A1822 for ; Thu, 26 Jul 2018 14:10:53 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EB7792B3EA for ; Thu, 26 Jul 2018 14:10:52 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E96E12B392; Thu, 26 Jul 2018 14:10:52 +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 732BF2B404 for ; Thu, 26 Jul 2018 14:10:52 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 6B4F36E301; Thu, 26 Jul 2018 14:10:50 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from EUR01-DB5-obe.outbound.protection.outlook.com (mail-db5eur01on0064.outbound.protection.outlook.com [104.47.2.64]) by gabe.freedesktop.org (Postfix) with ESMTPS id ABDCA6E301 for ; Thu, 26 Jul 2018 14:10:48 +0000 (UTC) Received: from e114479-lin.cambridge.arm.com (217.140.96.140) by AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.995.16; Thu, 26 Jul 2018 14:10:45 +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 Subject: [PATCH 0/3] Add Mali DP pixel formats Date: Thu, 26 Jul 2018 15:10:02 +0100 Message-Id: <20180726141005.8321-1-alexandru-cosmin.gheorghe@arm.com> X-Mailer: git-send-email 2.18.0 MIME-Version: 1.0 X-Originating-IP: [217.140.96.140] X-ClientProxiedBy: AM4PR0701CA0032.eurprd07.prod.outlook.com (2603:10a6:200:42::42) To AM5PR0802MB2545.eurprd08.prod.outlook.com (2603:10a6:203:a0::21) X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 98338f51-9803-447d-1227-08d5f30194ab X-MS-Office365-Filtering-HT: Tenant X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989117)(5600073)(711020)(4618075)(4534165)(4627221)(201703031133081)(201702281549075)(8990107)(2017052603328)(7153060)(7193020); SRVR:AM5PR0802MB2545; X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 3:XDNBr7BIZQrOCln7u32YyzfDY2Eto0YH50+jURFQ3tHViidP1gPW8PBM6LI5OUqvRTnOhUwWJUhtdq2frOJ87KfeoPtcrrUQF7qHOkEJsYsvegYQ6MM2RUdQQa2Qm9oHXWHOpwzQwmr0dWCt9ls2Kfzlye77//eFu+5F45IS2c+jZQXjgvxY9UAq7S/rpRb5TFcEF89qo0T3fSULzYKPmXn+Wb2kN5nElXVoW3iDM5+miStTqQA7HuKbt5fqm/o8; 25:/xkhYbJCtM/ZvfLyeZAZ4y9UDTLjVkKtKwOszKhuQt9dtJ2cn/+oAO95DCTyhKPU33wCwwNLiDMEc1oLWGMQBq8G7tue3ko+6edSAkVlh3b6yP+mmxATyGj9ODJy48cB1Wfn88N9g/m4+HdItPKWzIuJ/lG6rT6NaUXGqWiYrpma8S8f5jUdurMC7KdjZla1FEjDKrx271SodlDxSGwn1AAAKCFhJe+26QGiymnL5leSBikvcyjT3nEFRqCY5jUFk6r+Bqyby+V1J5bIxjcPdywdNlbwRxsq2gSoGst/LJNgJT5FhHIQRMfeHNa+EVmGSFQkHFWvIjmPov4MxNKfJA==; 31:Ex39VDwEJ//7vQ+4g2PMoXalx5tWtAwKNGCCbYe9uBmtWV3aIgfFjP/AS1wvG+ztLqfLm2EPzNzwyOP0kCIsPOG+smAPrx2kRaf42cXSzP6ozTdkcVybMIvGGMIiIrJf7AoS75AiStuSxxq26ROxr0XlwMMOnCShGkN1153td4gtZiaU0M10dkqBldMJzybmwOmowzkQ3xHZMc2wR1MU7xi3OIz4vTqIjLzbUdEBYdg= X-MS-TrafficTypeDiagnostic: AM5PR0802MB2545: NoDisclaimer: True X-Microsoft-Exchange-Diagnostics: 1; AM5PR0802MB2545; 20:gFVvIQItxAERoGus2N6HOwEyWd64J8MfPlcL8diNQQJU7K/B9VMIjWspBgNq8mgyL3wJ0er6co81APeQ0zC9670nDLRQhQBsO1/G6lJfi2EVrc7truiYYp4SxxO2B0QegQRGQgyixL7Gvcrreger1VqMbI0cEfJfA/rZtCa0YU+u0jYaenSyahU6HajGGdysqWx/3qcdSNaf4IEriyic7aKpHOGCqgBbLxw5i95r+HVKBI9ne+dlWOARggh4O5cl5DkNgOYXBbCdYqFAbNb6ROnzWS79mnxnmDalx6DnTInarEP4rMc6ittgWBmV59Jjx97IKBTztEo/HVH4+yhm/A==; 4:UHafZSu5kdbQykqLuIb5NboZdw12bcpMeL/icTz1hRv8P6H220897Pey6h/hgWk8ulC/0nR/jmwHzkeVS9Cw88gXhj9vw6fLVlmfHLhEFsLtwl53t5c69zSxCIvDKM6qSi4Xig5LspqExPa5AwHZTfV/e/bFzjPIJ0Nj9Z+hmZgFXYZCf8PZnpWjl0gLSuufvgW4pOt38W4xBzmedBW1Kuo+5fwZl33MdmRCrjnso33S+mSU1Y6DP5M0QBFxzwNbgAQwRKBilts+f6qODB5umQ== X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-MS-Exchange-SenderADCheck: 1 X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(93006095)(93001095)(10201501046)(3231311)(944501410)(52105095)(3002001)(6055026)(149027)(150027)(6041310)(20161123564045)(20161123562045)(20161123558120)(20161123560045)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(6072148)(201708071742011)(7699016); SRVR:AM5PR0802MB2545; BCL:0; PCL:0; RULEID:; SRVR:AM5PR0802MB2545; X-Forefront-PRVS: 07459438AA X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10009020)(346002)(136003)(376002)(39860400002)(366004)(396003)(199004)(189003)(6486002)(7696005)(51416003)(16586007)(47776003)(52116002)(316002)(36756003)(956004)(476003)(386003)(486006)(2616005)(66066001)(86362001)(575784001)(478600001)(16526019)(186003)(26005)(14444005)(53936002)(72206003)(48376002)(8936002)(4326008)(81156014)(81166006)(5660300001)(6666003)(7736002)(305945005)(25786009)(8676002)(50466002)(50226002)(68736007)(106356001)(3846002)(6116002)(6636002)(97736004)(1076002)(105586002)(2906002); DIR:OUT; SFP:1101; SCL:1; SRVR:AM5PR0802MB2545; H:e114479-lin.cambridge.arm.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; Received-SPF: None (protection.outlook.com: arm.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; AM5PR0802MB2545; 23:GHE57Qjq56FojrsYDkWH8orLAB+QY8HJJBTHMAl?= eFAK3fdhK/t3V2bLpohof3ENSMqCqlU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T5xv8Wcd4V/YHICVyPp67un0ijux6luHWVcS3iS4iGFfGbEoqtVSySo=; 7:EkL7UkDdZTkWuS/3Q56MSA5hDPfjvbN9HRaM69S/RQ7PAsUOMfhJoKqbTgfi+G460+hE3rx00ycdbnqvDbpofdYb0977q1CMNzmwC3kRyRVRMyLYPoAT01eFjSXaeWDVHgyp8XWGOEwq1+MyKikbAvn4RCBAsBPQwH0JS9nFQamAdRj85iKKQXwVPvA2PBV5W4nT/SuPXxT8Ztq9csiF7bfScldnYj3JUHKHa+8H0RcTSuzYKw6sdSHCLvtlZkBv SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: arm.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 26 Jul 2018 14:10:45.4893 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 98338f51-9803-447d-1227-08d5f30194ab X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: f34e5979-57d9-4aaa-ad4d-b122a662184d X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM5PR0802MB2545 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: nd@arm.com, Alexandru Gheorghe Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP Mali DP 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. So, for this formats mali-dp needs a special implementation of drm_fb_cma_get_gem_obj and drm_fb_cma_get_gem_addr which are more or less clones of the core functions, except they take into account the tile_size. Other alternatives would be: 1) Add a tile_size to drm_format_info and plumb the drm_core functions to proper handle this special formats. 2) Add a driver hook that checks buffer min_size and avoid duplicating the code from drm_gem_fb_create_with_funcs. If you have an opinion about how this should be handled feel free to suggest it. Alexandru Gheorghe (3): drm/fourcc: Add malidp yuv formats drm: Make drm_gem_fb_alloc available for drivers to use drm: mali-dp: Enable mali specific buffer formats drivers/gpu/drm/arm/malidp_drv.c | 65 +++++++++++++++++++- drivers/gpu/drm/arm/malidp_hw.c | 7 ++- drivers/gpu/drm/arm/malidp_planes.c | 52 +++++++++++++--- drivers/gpu/drm/drm_fourcc.c | 7 +++ drivers/gpu/drm/drm_gem_framebuffer_helper.c | 3 +- include/drm/drm_gem_framebuffer_helper.h | 5 ++ include/uapi/drm/drm_fourcc.h | 27 +++++++- 7 files changed, 154 insertions(+), 12 deletions(-)