public inbox for intel-gfx@lists.freedesktop.org
 help / color / mirror / Atom feed
From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Simon Ser <contact@emersion.fr>
Cc: marex@denx.de, mcoquelin.stm32@gmail.com, kernel@pengutronix.de,
	s.hauer@pengutronix.de, tzimmermann@suse.de, airlied@linux.ie,
	intel-gfx@lists.freedesktop.org, alexandre.torgue@foss.st.com,
	dri-devel@lists.freedesktop.org, linux-kernel@vger.kernel.org,
	yannick.fertre@foss.st.com, linux-imx@nxp.com,
	benjamin.gaignard@linaro.org, dmitry.baryshkov@linaro.org,
	"José Expósito" <jose.exposito89@gmail.com>,
	shawnguo@kernel.org, linux-stm32@st-md-mailman.stormreply.com,
	linux-arm-kernel@lists.infradead.org, philippe.cornu@foss.st.com
Subject: Re: [Intel-gfx]  [PATCH v2 1/6] drm/plane: Make format_mod_supported truly optional
Date: Thu, 23 Dec 2021 17:03:19 +0200	[thread overview]
Message-ID: <YcSPt+81fuzteeCu@intel.com> (raw)
In-Reply-To: <PIq2EEI7giz2rOuv2cfySbdxwht8AaCye140X5C7NejjXT6kD67E3E28uvg4Ebhob12EJUBtAxGPFNOgZwSWLYEfMtdhRNt3mR8bBGBJmU4=@emersion.fr>

On Thu, Dec 23, 2021 at 01:42:32PM +0000, Simon Ser wrote:
> On Thursday, December 23rd, 2021 at 12:56, Ville Syrjälä <ville.syrjala@linux.intel.com> wrote:
> 
> > > -	/* If we can't determine support, just bail */
> > > -	if (!plane->funcs->format_mod_supported)
> > > -		goto done;
> > > -
> > >  	mod = modifiers_ptr(blob_data);
> > >  	for (i = 0; i < plane->modifier_count; i++) {
> > >  		for (j = 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.
> 
> No, the check is skipped when the function isn't populated by the driver.

Ah right. So we advertise all modifiers in that case. Looks like
drm_plane_check_pixel_format() does support that model, so seems OK.

Another related thing that might be worth checking is whether
drivers generally do anything to validate the modifiers in
the addfb2 ioctl. Looks like i915 and amdgpu are the only ones
to use drm_any_plane_has_format() for that, so all the other
drivers must either be checking it manually (or they're just
potentially broken when handed unexpected modifiers by evil
userspace).

-- 
Ville Syrjälä
Intel

  reply	other threads:[~2021-12-23 15:03 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-22  9:05 [Intel-gfx] [PATCH v2 0/6] Add missing format_mod_supported functions José Expósito
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 1/6] drm/plane: Make format_mod_supported truly optional José Expósito
2021-12-23 10:10   ` Simon Ser
2021-12-23 11:56   ` Ville Syrjälä
2021-12-23 13:42     ` Simon Ser
2021-12-23 15:03       ` Ville Syrjälä [this message]
2021-12-23 16:57         ` José Expósito
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 2/6] drm/plane: Fix typo in format_mod_supported documentation José Expósito
2021-12-23 10:07   ` Simon Ser
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 3/6] drm/simple-kms: Drop format_mod_supported function José Expósito
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 4/6] drm/i915/display: " José Expósito
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 5/6] drm: mxsfb: " José Expósito
2021-12-22  9:05 ` [Intel-gfx] [PATCH v2 6/6] drm/stm: ltdc: " José Expósito
2022-01-12  9:44   ` yannick Fertre
2022-01-12 10:01   ` Jagan Teki
2022-01-10 19:14 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for Add missing format_mod_supported functions (rev2) Patchwork

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YcSPt+81fuzteeCu@intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=airlied@linux.ie \
    --cc=alexandre.torgue@foss.st.com \
    --cc=benjamin.gaignard@linaro.org \
    --cc=contact@emersion.fr \
    --cc=dmitry.baryshkov@linaro.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jose.exposito89@gmail.com \
    --cc=kernel@pengutronix.de \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-imx@nxp.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-stm32@st-md-mailman.stormreply.com \
    --cc=marex@denx.de \
    --cc=mcoquelin.stm32@gmail.com \
    --cc=philippe.cornu@foss.st.com \
    --cc=s.hauer@pengutronix.de \
    --cc=shawnguo@kernel.org \
    --cc=tzimmermann@suse.de \
    --cc=yannick.fertre@foss.st.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox