diff mbox series

[4/5] drm/msm/dpu: Initialize supported modifiers

Message ID 20181211184224.131478-4-frkoenig@google.com (mailing list archive)
State New, archived
Headers show
Series [1/5] drm/msm/dpu: Remove unused format tables. | expand

Commit Message

Fritz Koenig Dec. 11, 2018, 6:42 p.m. UTC
Pass list of supported modifiers to plane init.

Signed-off-by: Fritz Koenig <frkoenig@google.com>
---
 drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Comments

Sean Paul Dec. 12, 2018, 4:12 p.m. UTC | #1
On Tue, Dec 11, 2018 at 10:42:23AM -0800, Fritz Koenig wrote:
> Pass list of supported modifiers to plane init.
> 
> Signed-off-by: Fritz Koenig <frkoenig@google.com>
> ---
>  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 +++++++-
>  1 file changed, 7 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> index 9381c8af76d7..d2d4720f6f8c 100644
> --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> @@ -119,6 +119,12 @@ struct dpu_plane {
>  	bool debugfs_default_scale;
>  };
>  
> +static const uint64_t supported_format_modifiers[] = {
> +	DRM_FORMAT_MOD_QCOM_COMPRESSED,

Did you confirm that all the planes support this?

Change is

Reviewed-by: Sean Paul <sean@poorly.run>


> +	DRM_FORMAT_MOD_LINEAR,
> +	DRM_FORMAT_MOD_INVALID
> +};
> +
>  #define to_dpu_plane(x) container_of(x, struct dpu_plane, base)
>  
>  static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
> @@ -1521,7 +1527,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
>  
>  	ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
>  				format_list, num_formats,
> -				NULL, type, NULL);
> +				supported_format_modifiers, type, NULL);
>  	if (ret)
>  		goto clean_sspp;
>  
> -- 
> 2.20.0.rc2.403.gdbc3b29805-goog
>
Fritz Koenig Dec. 12, 2018, 6:02 p.m. UTC | #2
On Wed, Dec 12, 2018 at 8:12 AM Sean Paul <sean@poorly.run> wrote:
>
> On Tue, Dec 11, 2018 at 10:42:23AM -0800, Fritz Koenig wrote:
> > Pass list of supported modifiers to plane init.
> >
> > Signed-off-by: Fritz Koenig <frkoenig@google.com>
> > ---
> >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 +++++++-
> >  1 file changed, 7 insertions(+), 1 deletion(-)
> >
> > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > index 9381c8af76d7..d2d4720f6f8c 100644
> > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > @@ -119,6 +119,12 @@ struct dpu_plane {
> >       bool debugfs_default_scale;
> >  };
> >
> > +static const uint64_t supported_format_modifiers[] = {
> > +     DRM_FORMAT_MOD_QCOM_COMPRESSED,
>
> Did you confirm that all the planes support this?
>

I have not confirmed that all planes support this.  My testing has
been mostly with null_platform_test.  There are a few comments on in
the code that seem to indicate to me that the same modifier must be
used on all planes.

from dpu_formats.c
/*
* Currently only support exactly zero or one modifier.
* All planes use the same modifier.
*/

from dpu_hw_catalog.h
/**
 * struct dpu_format_extended - define dpu specific pixel format+modifier
 * @fourcc_format: Base FOURCC pixel format code
 * @modifier: 64-bit drm format modifier, same modifier must be applied to all
 *            framebuffer planes
 */

> Change is
>
> Reviewed-by: Sean Paul <sean@poorly.run>
>
>
> > +     DRM_FORMAT_MOD_LINEAR,
> > +     DRM_FORMAT_MOD_INVALID
> > +};
> > +
> >  #define to_dpu_plane(x) container_of(x, struct dpu_plane, base)
> >
> >  static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
> > @@ -1521,7 +1527,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
> >
> >       ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
> >                               format_list, num_formats,
> > -                             NULL, type, NULL);
> > +                             supported_format_modifiers, type, NULL);
> >       if (ret)
> >               goto clean_sspp;
> >
> > --
> > 2.20.0.rc2.403.gdbc3b29805-goog
> >
>
> --
> Sean Paul, Software Engineer, Google / Chromium OS
Sean Paul Dec. 12, 2018, 8:35 p.m. UTC | #3
On Wed, Dec 12, 2018 at 10:02:26AM -0800, Fritz Koenig wrote:
> On Wed, Dec 12, 2018 at 8:12 AM Sean Paul <sean@poorly.run> wrote:
> >
> > On Tue, Dec 11, 2018 at 10:42:23AM -0800, Fritz Koenig wrote:
> > > Pass list of supported modifiers to plane init.
> > >
> > > Signed-off-by: Fritz Koenig <frkoenig@google.com>
> > > ---
> > >  drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c | 8 +++++++-
> > >  1 file changed, 7 insertions(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > > index 9381c8af76d7..d2d4720f6f8c 100644
> > > --- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > > +++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
> > > @@ -119,6 +119,12 @@ struct dpu_plane {
> > >       bool debugfs_default_scale;
> > >  };
> > >
> > > +static const uint64_t supported_format_modifiers[] = {
> > > +     DRM_FORMAT_MOD_QCOM_COMPRESSED,
> >
> > Did you confirm that all the planes support this?
> >
> 
> I have not confirmed that all planes support this.  My testing has
> been mostly with null_platform_test.  There are a few comments on in
> the code that seem to indicate to me that the same modifier must be
> used on all planes.
> 
> from dpu_formats.c
> /*
> * Currently only support exactly zero or one modifier.
> * All planes use the same modifier.
> */
> 
> from dpu_hw_catalog.h
> /**
>  * struct dpu_format_extended - define dpu specific pixel format+modifier
>  * @fourcc_format: Base FOURCC pixel format code
>  * @modifier: 64-bit drm format modifier, same modifier must be applied to all
>  *            framebuffer planes
>  */

Ah cool, that's good enough for me. I'll pick these into dpu-staging.

Sean

> 
> > Change is
> >
> > Reviewed-by: Sean Paul <sean@poorly.run>
> >
> >
> > > +     DRM_FORMAT_MOD_LINEAR,
> > > +     DRM_FORMAT_MOD_INVALID
> > > +};
> > > +
> > >  #define to_dpu_plane(x) container_of(x, struct dpu_plane, base)
> > >
> > >  static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
> > > @@ -1521,7 +1527,7 @@ struct drm_plane *dpu_plane_init(struct drm_device *dev,
> > >
> > >       ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
> > >                               format_list, num_formats,
> > > -                             NULL, type, NULL);
> > > +                             supported_format_modifiers, type, NULL);
> > >       if (ret)
> > >               goto clean_sspp;
> > >
> > > --
> > > 2.20.0.rc2.403.gdbc3b29805-goog
> > >
> >
> > --
> > Sean Paul, Software Engineer, Google / Chromium OS
diff mbox series

Patch

diff --git a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
index 9381c8af76d7..d2d4720f6f8c 100644
--- a/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
+++ b/drivers/gpu/drm/msm/disp/dpu1/dpu_plane.c
@@ -119,6 +119,12 @@  struct dpu_plane {
 	bool debugfs_default_scale;
 };
 
+static const uint64_t supported_format_modifiers[] = {
+	DRM_FORMAT_MOD_QCOM_COMPRESSED,
+	DRM_FORMAT_MOD_LINEAR,
+	DRM_FORMAT_MOD_INVALID
+};
+
 #define to_dpu_plane(x) container_of(x, struct dpu_plane, base)
 
 static struct dpu_kms *_dpu_plane_get_kms(struct drm_plane *plane)
@@ -1521,7 +1527,7 @@  struct drm_plane *dpu_plane_init(struct drm_device *dev,
 
 	ret = drm_universal_plane_init(dev, plane, 0xff, &dpu_plane_funcs,
 				format_list, num_formats,
-				NULL, type, NULL);
+				supported_format_modifiers, type, NULL);
 	if (ret)
 		goto clean_sspp;