All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] Implement .format_mod_supported in mxsfb
@ 2020-10-24 16:59 Daniel Abrecht
  2020-10-25 15:52 ` Guido Günther
  0 siblings, 1 reply; 6+ messages in thread
From: Daniel Abrecht @ 2020-10-24 16:59 UTC (permalink / raw)
  To: dri-devel; +Cc: Marek Vasut, kernel, linux-imx

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 <public@danielabrecht.ch>
---
  drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
  1 file changed, 8 insertions(+)

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 = {
  	.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,
-- 
2.20.1
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] Implement .format_mod_supported in mxsfb
  2020-10-24 16:59 [PATCH] Implement .format_mod_supported in mxsfb Daniel Abrecht
@ 2020-10-25 15:52 ` Guido Günther
  2020-10-25 19:50   ` Daniel Abrecht
  2020-10-26  9:05   ` Daniel Vetter
  0 siblings, 2 replies; 6+ messages in thread
From: Guido Günther @ 2020-10-25 15:52 UTC (permalink / raw)
  To: Daniel Abrecht; +Cc: Marek Vasut, kernel, dri-devel, linux-imx

Hi Daniel,
On Sat, Oct 24, 2020 at 04:59:16PM +0000, Daniel Abrecht wrote:
> 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.

Since this got broken by the switch away for the simple display
pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could
you add a fixes tag?
Cheers,
 -- Guido

> 
> Signed-off-by: Daniel Abrecht <public@danielabrecht.ch>
> ---
>  drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> 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
> = {
>  	.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,
> -- 
> 2.20.1
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Implement .format_mod_supported in mxsfb
  2020-10-25 15:52 ` Guido Günther
@ 2020-10-25 19:50   ` Daniel Abrecht
  2020-10-26  9:05   ` Daniel Vetter
  1 sibling, 0 replies; 6+ messages in thread
From: Daniel Abrecht @ 2020-10-25 19:50 UTC (permalink / raw)
  To: Guido Günther; +Cc: Marek Vasut, kernel, dri-devel, linux-imx

Hi Guido

Am 2020-10-25 15:52, schrieb Guido Günther:
> Since this got broken by the switch away for the simple display
> pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could
> you add a fixes tag?
> Cheers,
>  -- Guido

Thanks, I've sent a v2 with the fixes tag added.

Regards,
Daniel Abrecht
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Implement .format_mod_supported in mxsfb
  2020-10-25 15:52 ` Guido Günther
  2020-10-25 19:50   ` Daniel Abrecht
@ 2020-10-26  9:05   ` Daniel Vetter
  2020-10-26 10:52     ` Ville Syrjälä
  1 sibling, 1 reply; 6+ messages in thread
From: Daniel Vetter @ 2020-10-26  9:05 UTC (permalink / raw)
  To: Guido Günther
  Cc: Marek Vasut, dl-linux-imx, dri-devel, Sascha Hauer, Daniel Abrecht

On Sun, Oct 25, 2020 at 4:52 PM Guido Günther <agx@sigxcpu.org> wrote:
>
> Hi Daniel,
> On Sat, Oct 24, 2020 at 04:59:16PM +0000, Daniel Abrecht wrote:
> > 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.
>
> Since this got broken by the switch away for the simple display
> pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could
> you add a fixes tag?

mxsfb is also missing setting the allow_fb_modifiers flag, without
which all this modifier stuff won't work great. Please add that too. I
guess some igt testing for this might be useful too, but not sure we
can do that with sufficient generality. It should fall over though
since if you try to create an fb with modifiers you'll fail, so no
idea what userspace you have here.
-Daniel

> Cheers,
>  -- Guido
>
> >
> > Signed-off-by: Daniel Abrecht <public@danielabrecht.ch>
> > ---
> >  drivers/gpu/drm/mxsfb/mxsfb_kms.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > 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
> > = {
> >       .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,
> > --
> > 2.20.1
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > https://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Implement .format_mod_supported in mxsfb
  2020-10-26  9:05   ` Daniel Vetter
@ 2020-10-26 10:52     ` Ville Syrjälä
  2020-10-26 11:19       ` Daniel Vetter
  0 siblings, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2020-10-26 10:52 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Marek Vasut, Guido Günther, dri-devel, dl-linux-imx,
	Sascha Hauer, Daniel Abrecht

On Mon, Oct 26, 2020 at 10:05:17AM +0100, Daniel Vetter wrote:
> On Sun, Oct 25, 2020 at 4:52 PM Guido Günther <agx@sigxcpu.org> wrote:
> >
> > Hi Daniel,
> > On Sat, Oct 24, 2020 at 04:59:16PM +0000, Daniel Abrecht wrote:
> > > 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.
> >
> > Since this got broken by the switch away for the simple display
> > pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could
> > you add a fixes tag?
> 
> mxsfb is also missing setting the allow_fb_modifiers flag, without
> which all this modifier stuff won't work great.

drm_universal_plane_init() automagically adds it if a modifier list
is passed in.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] Implement .format_mod_supported in mxsfb
  2020-10-26 10:52     ` Ville Syrjälä
@ 2020-10-26 11:19       ` Daniel Vetter
  0 siblings, 0 replies; 6+ messages in thread
From: Daniel Vetter @ 2020-10-26 11:19 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Marek Vasut, Guido Günther, dri-devel, dl-linux-imx,
	Sascha Hauer, Daniel Abrecht

On Mon, Oct 26, 2020 at 12:52:07PM +0200, Ville Syrjälä wrote:
> On Mon, Oct 26, 2020 at 10:05:17AM +0100, Daniel Vetter wrote:
> > On Sun, Oct 25, 2020 at 4:52 PM Guido Günther <agx@sigxcpu.org> wrote:
> > >
> > > Hi Daniel,
> > > On Sat, Oct 24, 2020 at 04:59:16PM +0000, Daniel Abrecht wrote:
> > > > 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.
> > >
> > > Since this got broken by the switch away for the simple display
> > > pipeline helper (ae1ed0093281939b80664a687689f12436c0e874) could
> > > you add a fixes tag?
> > 
> > mxsfb is also missing setting the allow_fb_modifiers flag, without
> > which all this modifier stuff won't work great.
> 
> drm_universal_plane_init() automagically adds it if a modifier list
> is passed in.

Oh right I missed that :-/ I guess then removing the explicit setting from
drivers would be good, and maybe adding a comment to the kerneldoc about
that.

And more of a mess indeed ...
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-10-26 11:19 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-10-24 16:59 [PATCH] Implement .format_mod_supported in mxsfb Daniel Abrecht
2020-10-25 15:52 ` Guido Günther
2020-10-25 19:50   ` Daniel Abrecht
2020-10-26  9:05   ` Daniel Vetter
2020-10-26 10:52     ` Ville Syrjälä
2020-10-26 11:19       ` Daniel Vetter

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.