From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 6BDFBC433F5 for ; Thu, 23 Dec 2021 11:58:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=CUpVDg1zZQEQUlsDhYIE5vqZcatiQNs7Tr7VSnz4GHM=; b=mXHW3oMOhyENHg aG3fyoKsWp4btJumkVPJlr132PnG/Bcvu09NisJzo6AEx1yptTR88GTSZ/ZkyL+iSD5/rcKueyvp4 KSbX8HUJ+1NM3Yvie+GiTPGvnfpZX8MpqL/xzKhtOyMiRM4SH/+9ehFIFeVyRtiTCdfzh2pzaDVWw o8jCOa+mxX/k+XvJ2S1YclYedNp2gCArP93USXlJHQ/Jn9SqQeqX0MSf2/zqm5pwzpPH0/m9/DBd+ kMN3EMG5WTMhsbm6PO+ytCicTq8R6zoViy7Itto7UhRYJD+rNrnzBn/aAvnDfVvhpT/Ys7CKC7kl2 CLNJUdfEERt53nR60PNQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0Mia-00Ce5h-JB; Thu, 23 Dec 2021 11:57:08 +0000 Received: from mga05.intel.com ([192.55.52.43]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1n0MiX-00Ce4c-0h for linux-arm-kernel@lists.infradead.org; Thu, 23 Dec 2021 11:57:06 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1640260625; x=1671796625; h=date:from:to:cc:subject:message-id:references: mime-version:content-transfer-encoding:in-reply-to; bh=l7/Ec1k8g+Fuqc+4+s0zclAcRcBVVg9oTnf/81Ddgz8=; b=lrv7m87/7YBxQQkoqUzh71e6KWovKTR/3O9XDnlIUdOt98uhluJQGM+h D33TdKqtrc1gMoQeyAiOfITy+S7txomy88+lijxPS1S3M5VZQ2hRxpknM CG6LHNEuYR8RKgj3jEw8RouL/Hk2pkUYJNlQ5qNWcwpqUiucQSBYkc7Kd en/PMp/I/wNSOubHvv311rox6/u11CrE5ercNU3KL6VYrgY1ddcGY7HHH Wrspr3ymqAysvkxhUNNUYKtXWva5EkvR6UANc+2aX263h0LKt5LUoX5xY xNrjt9k1zI07rR0ajIqybLKIxWN/OhqPqpLLUlZhFleIac+5PusWWIYzG g==; X-IronPort-AV: E=McAfee;i="6200,9189,10206"; a="327123552" X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="327123552" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by fmsmga105.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 23 Dec 2021 03:57:02 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.88,229,1635231600"; d="scan'208";a="607735683" Received: from stinkbox.fi.intel.com (HELO stinkbox) ([10.237.72.147]) by FMSMGA003.fm.intel.com with SMTP; 23 Dec 2021 03:56:55 -0800 Received: by stinkbox (sSMTP sendmail emulation); Thu, 23 Dec 2021 13:56:55 +0200 Date: Thu, 23 Dec 2021 13:56:55 +0200 From: Ville =?iso-8859-1?Q?Syrj=E4l=E4?= To: =?iso-8859-1?Q?Jos=E9_Exp=F3sito?= Cc: contact@emersion.fr, airlied@linux.ie, alexandre.torgue@foss.st.com, benjamin.gaignard@linaro.org, linux-stm32@st-md-mailman.stormreply.com, marex@denx.de, linux-imx@nxp.com, intel-gfx@lists.freedesktop.org, tzimmermann@suse.de, s.hauer@pengutronix.de, rodrigo.vivi@intel.com, kernel@pengutronix.de, linux-arm-kernel@lists.infradead.org, dri-devel@lists.freedesktop.org, yannick.fertre@foss.st.com, linux-kernel@vger.kernel.org, philippe.cornu@foss.st.com, mcoquelin.stm32@gmail.com, dmitry.baryshkov@linaro.org, shawnguo@kernel.org Subject: Re: [PATCH v2 1/6] =?iso-8859-1?Q?drm=2Fpl?= =?iso-8859-1?Q?ane=3A_Make_format=5Fmod=5Fsupported_truly=A0optional?= Message-ID: References: <20211222090552.25972-1-jose.exposito89@gmail.com> <20211222090552.25972-2-jose.exposito89@gmail.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20211222090552.25972-2-jose.exposito89@gmail.com> X-Patchwork-Hint: comment X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20211223_035705_132743_5E770C87 X-CRM114-Status: GOOD ( 24.50 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Wed, Dec 22, 2021 at 10:05:47AM +0100, Jos=E9 Exp=F3sito wrote: > The documentation for "drm_plane_funcs.format_mod_supported" reads: > = > This *optional* hook is used for the DRM to determine if the given > format/modifier combination is valid for the plane. This allows the > DRM to generate the correct format bitmask (which formats apply to > which modifier), and to validate modifiers at atomic_check time. > = > *If not present*, then any modifier in the plane's modifier > list is allowed with any of the plane's formats. > = > However, where the function is not present, an invalid IN_FORMATS blob > property with modifiers but no formats is exposed to user-space. > = > This breaks the latest Weston [1]. For testing purposes, I extracted the > affected code to a standalone program [2]. > = > Make "create_in_format_blob" behave as documented. > = > [1] https://gitlab.freedesktop.org/wayland/weston/-/blob/9.0/libweston/ba= ckend-drm/kms.c#L431 > [2] https://github.com/JoseExposito/drm-sandbox/blob/main/in_formats.c > = > Signed-off-by: Jos=E9 Exp=F3sito > --- > drivers/gpu/drm/drm_plane.c | 8 ++------ > 1 file changed, 2 insertions(+), 6 deletions(-) > = > diff --git a/drivers/gpu/drm/drm_plane.c b/drivers/gpu/drm/drm_plane.c > index 82afb854141b..c1186b7215ee 100644 > --- a/drivers/gpu/drm/drm_plane.c > +++ b/drivers/gpu/drm/drm_plane.c > @@ -202,17 +202,13 @@ static int create_in_format_blob(struct drm_device = *dev, struct drm_plane *plane > = > memcpy(formats_ptr(blob_data), plane->format_types, formats_size); > = > - /* If we can't determine support, just bail */ > - if (!plane->funcs->format_mod_supported) > - goto done; > - > mod =3D modifiers_ptr(blob_data); > for (i =3D 0; i < plane->modifier_count; i++) { > for (j =3D 0; j < plane->format_count; j++) { > - if (plane->funcs->format_mod_supported(plane, > + if (!plane->funcs->format_mod_supported || > + plane->funcs->format_mod_supported(plane, > plane->format_types[j], > plane->modifiers[i])) { So instead of skipping the whole loop you just skip doing anything inside the loop? Can't see how that achieves anything at all. https://patchwork.freedesktop.org/series/83018/ is what I had in mind earlier but no one reviewed it and = the discussion veered off track IIRC. -- = Ville Syrj=E4l=E4 Intel _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel