Re: [Intel-gfx] [PATCH 10/12] drm/tegra: Don't set allow_fb_modifiers explicitly

2021-04-15 Thread Daniel Vetter
On Tue, Apr 13, 2021 at 01:37:38PM +0200, Thierry Reding wrote:
> On Tue, Apr 13, 2021 at 11:49:01AM +0200, Daniel Vetter wrote:
> > Since
> > 
> > commit 890880ddfdbe256083170866e49c87618b706ac7
> > Author: Paul Kocialkowski 
> > Date:   Fri Jan 4 09:56:10 2019 +0100
> > 
> > drm: Auto-set allow_fb_modifiers when given modifiers at plane init
> > 
> > this is done automatically as part of plane init, if drivers set the
> > modifier list correctly. Which is the case here.
> > 
> > It was slightly inconsistently though, since planes with only linear
> > modifier support haven't listed that explicitly. Fix that, and cc:
> > stable to allow userspace to rely on this. Again don't backport
> > further than where Paul's patch got added.
> > 
> > Cc: sta...@vger.kernel.org # v5.1 +
> > Cc: Pekka Paalanen 
> > Signed-off-by: Daniel Vetter 
> > Cc: Thierry Reding 
> > Cc: Jonathan Hunter 
> > Cc: linux-te...@vger.kernel.org
> > ---
> >  drivers/gpu/drm/tegra/dc.c  | 10 --
> >  drivers/gpu/drm/tegra/drm.c |  2 --
> >  2 files changed, 8 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> > index c9385cfd0fc1..f9845a50f866 100644
> > --- a/drivers/gpu/drm/tegra/dc.c
> > +++ b/drivers/gpu/drm/tegra/dc.c
> > @@ -959,6 +959,11 @@ static const struct drm_plane_helper_funcs 
> > tegra_cursor_plane_helper_funcs = {
> > .atomic_disable = tegra_cursor_atomic_disable,
> >  };
> >  
> > +static const uint64_t linear_modifiers[] = {
> > +   DRM_FORMAT_MOD_LINEAR,
> > +   DRM_FORMAT_MOD_INVALID
> > +};
> > +
> >  static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device 
> > *drm,
> >   struct tegra_dc *dc)
> >  {
> > @@ -987,7 +992,7 @@ static struct drm_plane 
> > *tegra_dc_cursor_plane_create(struct drm_device *drm,
> >  
> > err = drm_universal_plane_init(drm, >base, possible_crtcs,
> >_plane_funcs, formats,
> > -  num_formats, NULL,
> > +  num_formats, linear_modifiers,
> >DRM_PLANE_TYPE_CURSOR, NULL);
> > if (err < 0) {
> > kfree(plane);
> > @@ -1106,7 +,8 @@ static struct drm_plane 
> > *tegra_dc_overlay_plane_create(struct drm_device *drm,
> >  
> > err = drm_universal_plane_init(drm, >base, possible_crtcs,
> >_plane_funcs, formats,
> > -  num_formats, NULL, type, NULL);
> > +  num_formats, linear_modifiers,
> > +  type, NULL);
> 
> I think we can do better than linear_modifiers for overlay planes, but
> given that this doesn't change existing behaviour, I'll do that in a
> separate patch.
> 
> Acked-by: Thierry Reding 

Applied to drm-misc-next, thanks for taking a look.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH 10/12] drm/tegra: Don't set allow_fb_modifiers explicitly

2021-04-13 Thread Thierry Reding
On Tue, Apr 13, 2021 at 11:49:01AM +0200, Daniel Vetter wrote:
> Since
> 
> commit 890880ddfdbe256083170866e49c87618b706ac7
> Author: Paul Kocialkowski 
> Date:   Fri Jan 4 09:56:10 2019 +0100
> 
> drm: Auto-set allow_fb_modifiers when given modifiers at plane init
> 
> this is done automatically as part of plane init, if drivers set the
> modifier list correctly. Which is the case here.
> 
> It was slightly inconsistently though, since planes with only linear
> modifier support haven't listed that explicitly. Fix that, and cc:
> stable to allow userspace to rely on this. Again don't backport
> further than where Paul's patch got added.
> 
> Cc: sta...@vger.kernel.org # v5.1 +
> Cc: Pekka Paalanen 
> Signed-off-by: Daniel Vetter 
> Cc: Thierry Reding 
> Cc: Jonathan Hunter 
> Cc: linux-te...@vger.kernel.org
> ---
>  drivers/gpu/drm/tegra/dc.c  | 10 --
>  drivers/gpu/drm/tegra/drm.c |  2 --
>  2 files changed, 8 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
> index c9385cfd0fc1..f9845a50f866 100644
> --- a/drivers/gpu/drm/tegra/dc.c
> +++ b/drivers/gpu/drm/tegra/dc.c
> @@ -959,6 +959,11 @@ static const struct drm_plane_helper_funcs 
> tegra_cursor_plane_helper_funcs = {
>   .atomic_disable = tegra_cursor_atomic_disable,
>  };
>  
> +static const uint64_t linear_modifiers[] = {
> + DRM_FORMAT_MOD_LINEAR,
> + DRM_FORMAT_MOD_INVALID
> +};
> +
>  static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm,
> struct tegra_dc *dc)
>  {
> @@ -987,7 +992,7 @@ static struct drm_plane 
> *tegra_dc_cursor_plane_create(struct drm_device *drm,
>  
>   err = drm_universal_plane_init(drm, >base, possible_crtcs,
>  _plane_funcs, formats,
> -num_formats, NULL,
> +num_formats, linear_modifiers,
>  DRM_PLANE_TYPE_CURSOR, NULL);
>   if (err < 0) {
>   kfree(plane);
> @@ -1106,7 +,8 @@ static struct drm_plane 
> *tegra_dc_overlay_plane_create(struct drm_device *drm,
>  
>   err = drm_universal_plane_init(drm, >base, possible_crtcs,
>  _plane_funcs, formats,
> -num_formats, NULL, type, NULL);
> +num_formats, linear_modifiers,
> +type, NULL);

I think we can do better than linear_modifiers for overlay planes, but
given that this doesn't change existing behaviour, I'll do that in a
separate patch.

Acked-by: Thierry Reding 


signature.asc
Description: PGP signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx