From patchwork Sat Oct 24 16:59:16 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Daniel Abrecht X-Patchwork-Id: 11854945 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.5 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id CC933C5517A for ; Sat, 24 Oct 2020 17:05:51 +0000 (UTC) Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E008E2085B for ; Sat, 24 Oct 2020 17:05:50 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=danielabrecht.ch header.i=@danielabrecht.ch header.b="LM12OErJ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E008E2085B Authentication-Results: mail.kernel.org; dmarc=fail (p=reject dis=none) header.from=danielabrecht.ch Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=dri-devel-bounces@lists.freedesktop.org Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id D6CCC6E908; Sat, 24 Oct 2020 17:05:48 +0000 (UTC) X-Greylist: delayed 379 seconds by postgrey-1.36 at gabe; Sat, 24 Oct 2020 17:05:37 UTC Received: from abrecht.li (75-128-16-94.static.cable.fcom.ch [94.16.128.75]) by gabe.freedesktop.org (Postfix) with ESMTPS id 23F216E902 for ; Sat, 24 Oct 2020 17:05:37 +0000 (UTC) Received: from mail.abrecht.li (unknown [10.60.1.3]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by abrecht.li (Postfix) with ESMTPSA id BBA672D97C5B; Sat, 24 Oct 2020 16:59:16 +0000 (UTC) DKIM-Filter: OpenDKIM Filter v2.11.0 abrecht.li BBA672D97C5B DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=danielabrecht.ch; s=mail; t=1603558756; bh=HsJULwZf6cG3rWJMuqPzecGHdGk+1847RFAtqmArmVU=; h=From:To:Cc:From; b=LM12OErJy3GaJD/884SQoEOYRQEdJdTlomfb+bHVw5fVBm445k5hkOwW+aSl354Fh 6MK8m8zIAylFWfcD/3X709jSdV6fWUF8SHfeprOMbrWsr3L2Kq4JCkoFrKUS8G724c 172oClBSWppeGOoLIlOfS1CKMS+YN8r4ZBlJr548= MIME-Version: 1.0 Date: Sat, 24 Oct 2020 16:59:16 +0000 From: Daniel Abrecht To: dri-devel@lists.freedesktop.org Subject: [PATCH] Implement .format_mod_supported in mxsfb Message-ID: <96f62304bad202e4f920d2f4ed62c485@abrecht.li> X-Sender: freedesktop-linux-dri-devel@danielabrecht.ch User-Agent: Roundcube Webmail/1.3.15 X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Marek Vasut , kernel@pengutronix.de, linux-imx@nxp.com Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" This will make sure applications which use the IN_FORMATS blob to figure out which modifiers they can use will pick up the linear modifier which is needed by mxsfb. Such applications will not work otherwise if an incompatible implicit modifier ends up being selected. Signed-off-by: Daniel Abrecht --- drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++ 1 file changed, 8 insertions(+) .atomic_check = mxsfb_plane_atomic_check, .atomic_update = mxsfb_plane_primary_atomic_update, @@ -495,6 +502,7 @@ static const struct drm_plane_helper_funcs mxsfb_plane_overlay_helper_funcs = { }; static const struct drm_plane_funcs mxsfb_plane_funcs = { + .format_mod_supported = mxsfb_format_mod_supported, .update_plane = drm_atomic_helper_update_plane, .disable_plane = drm_atomic_helper_disable_plane, .destroy = drm_plane_cleanup, diff --git a/drivers/gpu/drm/mxsfb/mxsfb_kms.c b/drivers/gpu/drm/mxsfb/mxsfb_kms.c index 956f631997f2..fc4b1626261b 100644 --- a/drivers/gpu/drm/mxsfb/mxsfb_kms.c +++ b/drivers/gpu/drm/mxsfb/mxsfb_kms.c @@ -484,6 +484,13 @@ static void mxsfb_plane_overlay_atomic_update(struct drm_plane *plane, writel(ctrl, mxsfb->base + LCDC_AS_CTRL); } +static bool mxsfb_format_mod_supported(struct drm_plane *plane, + uint32_t format, + uint64_t modifier) +{ + return modifier == DRM_FORMAT_MOD_LINEAR; +} + static const struct drm_plane_helper_funcs mxsfb_plane_primary_helper_funcs = {