linux-renesas-soc.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: rcar-du: Create immutable zpos property for primary planes
@ 2020-04-02 10:40 Laurent Pinchart
  2020-04-02 10:56 ` Daniel Stone
  2020-04-02 11:12 ` Geert Uytterhoeven
  0 siblings, 2 replies; 5+ messages in thread
From: Laurent Pinchart @ 2020-04-02 10:40 UTC (permalink / raw)
  To: dri-devel; +Cc: linux-renesas-soc, Kuninori Morimoto

The R-Car DU driver creates a zpos property, ranging from 1 to 7, for
all the overlay planes, but leaves the primary plane without a zpos
property. The DRM/KMS API doesn't clearly specify if this is acceptable,
of it the property is mandatory for all planes when exposed for some of
the planes. Nonetheless, weston v8.0 has been reported to have trouble
handling this situation.

The DRM core offers support for immutable zpos properties. Creating an
immutable zpos property set to 0 for the primary planes seems to be a
good way forward, as it shouldn't introduce any regression, and can fix
the issue. Do so.

Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_plane.c | 16 +++++++++-------
 1 file changed, 9 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_plane.c b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
index c6430027169f..a0021fc25b27 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
@@ -785,13 +785,15 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
 
 		drm_plane_create_alpha_property(&plane->plane);
 
-		if (type == DRM_PLANE_TYPE_PRIMARY)
-			continue;
-
-		drm_object_attach_property(&plane->plane.base,
-					   rcdu->props.colorkey,
-					   RCAR_DU_COLORKEY_NONE);
-		drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
+		if (type == DRM_PLANE_TYPE_PRIMARY) {
+			drm_plane_create_zpos_immutable_property(&plane->plane,
+								 0);
+		} else {
+			drm_object_attach_property(&plane->plane.base,
+						   rcdu->props.colorkey,
+						   RCAR_DU_COLORKEY_NONE);
+			drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
+		}
 	}
 
 	return 0;
-- 
Regards,

Laurent Pinchart


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

* Re: [PATCH] drm: rcar-du: Create immutable zpos property for primary planes
  2020-04-02 10:40 [PATCH] drm: rcar-du: Create immutable zpos property for primary planes Laurent Pinchart
@ 2020-04-02 10:56 ` Daniel Stone
  2020-04-02 11:13   ` Daniel Vetter
  2020-04-02 11:12 ` Geert Uytterhoeven
  1 sibling, 1 reply; 5+ messages in thread
From: Daniel Stone @ 2020-04-02 10:56 UTC (permalink / raw)
  To: Laurent Pinchart; +Cc: dri-devel, linux-renesas-soc, Kuninori Morimoto

On Thu, 2 Apr 2020 at 11:40, Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> The R-Car DU driver creates a zpos property, ranging from 1 to 7, for
> all the overlay planes, but leaves the primary plane without a zpos
> property. The DRM/KMS API doesn't clearly specify if this is acceptable,
> of it the property is mandatory for all planes when exposed for some of
> the planes. Nonetheless, weston v8.0 has been reported to have trouble
> handling this situation.

Yeah. It didn't even occur to me/us that someone would do that, to be
honest. We need to have zpos information for all planes that we're
using in order for zpos to be at all meaningful, and we can't exactly
avoid using the primary plane. Without knowing the primary plane's
zpos, we can't know if the overlays are actually overlays or in fact
underlays.

> The DRM core offers support for immutable zpos properties. Creating an
> immutable zpos property set to 0 for the primary planes seems to be a
> good way forward, as it shouldn't introduce any regression, and can fix
> the issue. Do so.

Perfect. We support immutable properties entirely well, we just need
to know about them.

> Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Reviewed-by: Daniel Stone <daniels@collabora.com>

Cheers,
Daniel

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

* Re: [PATCH] drm: rcar-du: Create immutable zpos property for primary planes
  2020-04-02 10:40 [PATCH] drm: rcar-du: Create immutable zpos property for primary planes Laurent Pinchart
  2020-04-02 10:56 ` Daniel Stone
@ 2020-04-02 11:12 ` Geert Uytterhoeven
  2020-04-04 18:25   ` Laurent Pinchart
  1 sibling, 1 reply; 5+ messages in thread
From: Geert Uytterhoeven @ 2020-04-02 11:12 UTC (permalink / raw)
  To: Laurent Pinchart
  Cc: DRI Development, Linux-Renesas, Kuninori Morimoto, Tomohito Esaki

Hi Laurent,

On Thu, Apr 2, 2020 at 12:42 PM Laurent Pinchart
<laurent.pinchart+renesas@ideasonboard.com> wrote:
> The R-Car DU driver creates a zpos property, ranging from 1 to 7, for
> all the overlay planes, but leaves the primary plane without a zpos
> property. The DRM/KMS API doesn't clearly specify if this is acceptable,
> of it the property is mandatory for all planes when exposed for some of
> the planes. Nonetheless, weston v8.0 has been reported to have trouble
> handling this situation.
>
> The DRM core offers support for immutable zpos properties. Creating an
> immutable zpos property set to 0 for the primary planes seems to be a
> good way forward, as it shouldn't introduce any regression, and can fix
> the issue. Do so.
>
> Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>

Thanks for your patch!

> --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> @@ -785,13 +785,15 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
>
>                 drm_plane_create_alpha_property(&plane->plane);
>
> -               if (type == DRM_PLANE_TYPE_PRIMARY)
> -                       continue;
> -
> -               drm_object_attach_property(&plane->plane.base,
> -                                          rcdu->props.colorkey,
> -                                          RCAR_DU_COLORKEY_NONE);
> -               drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
> +               if (type == DRM_PLANE_TYPE_PRIMARY) {
> +                       drm_plane_create_zpos_immutable_property(&plane->plane,
> +                                                                0);
> +               } else {
> +                       drm_object_attach_property(&plane->plane.base,
> +                                                  rcdu->props.colorkey,
> +                                                  RCAR_DU_COLORKEY_NONE);
> +                       drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
> +               }
>         }
>
>         return 0;

This is very similar to Esaki-san's patch[*] posted yesterday.
However, there's one big difference: your patch doesn't update
rcar_du_vsp_init(). Isn't that needed?

[*] "[PATCH] drm: rcar-du: Set primary plane zpos immutably at initializing"
    https://lore.kernel.org/linux-renesas-soc/20200401061100.7379-1-etom@igel.co.jp/

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

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

* Re: [PATCH] drm: rcar-du: Create immutable zpos property for primary planes
  2020-04-02 10:56 ` Daniel Stone
@ 2020-04-02 11:13   ` Daniel Vetter
  0 siblings, 0 replies; 5+ messages in thread
From: Daniel Vetter @ 2020-04-02 11:13 UTC (permalink / raw)
  To: Daniel Stone
  Cc: Laurent Pinchart, open list:DRM DRIVERS FOR RENESAS,
	Kuninori Morimoto, dri-devel

On Thu, Apr 2, 2020 at 12:57 PM Daniel Stone <daniel@fooishbar.org> wrote:
>
> On Thu, 2 Apr 2020 at 11:40, Laurent Pinchart
> <laurent.pinchart+renesas@ideasonboard.com> wrote:
> > The R-Car DU driver creates a zpos property, ranging from 1 to 7, for
> > all the overlay planes, but leaves the primary plane without a zpos
> > property. The DRM/KMS API doesn't clearly specify if this is acceptable,
> > of it the property is mandatory for all planes when exposed for some of
> > the planes. Nonetheless, weston v8.0 has been reported to have trouble
> > handling this situation.
>
> Yeah. It didn't even occur to me/us that someone would do that, to be
> honest. We need to have zpos information for all planes that we're
> using in order for zpos to be at all meaningful, and we can't exactly
> avoid using the primary plane. Without knowing the primary plane's
> zpos, we can't know if the overlays are actually overlays or in fact
> underlays.

Maybe we need to clarify docs that if you expose zpos, then you should
expose it on all planes (opting for immutable zpos where it can't be
adjusted)? Care to type up that quick doc patch please?
-Daniel

>
> > The DRM core offers support for immutable zpos properties. Creating an
> > immutable zpos property set to 0 for the primary planes seems to be a
> > good way forward, as it shouldn't introduce any regression, and can fix
> > the issue. Do so.
>
> Perfect. We support immutable properties entirely well, we just need
> to know about them.
>
> > Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
>
> Reviewed-by: Daniel Stone <daniels@collabora.com>
>
> Cheers,
> Daniel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel



-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH] drm: rcar-du: Create immutable zpos property for primary planes
  2020-04-02 11:12 ` Geert Uytterhoeven
@ 2020-04-04 18:25   ` Laurent Pinchart
  0 siblings, 0 replies; 5+ messages in thread
From: Laurent Pinchart @ 2020-04-04 18:25 UTC (permalink / raw)
  To: Geert Uytterhoeven
  Cc: Laurent Pinchart, DRI Development, Linux-Renesas,
	Kuninori Morimoto, Tomohito Esaki

Hi Geert,

On Thu, Apr 02, 2020 at 01:12:51PM +0200, Geert Uytterhoeven wrote:
> On Thu, Apr 2, 2020 at 12:42 PM Laurent Pinchart wrote:
> > The R-Car DU driver creates a zpos property, ranging from 1 to 7, for
> > all the overlay planes, but leaves the primary plane without a zpos
> > property. The DRM/KMS API doesn't clearly specify if this is acceptable,
> > of it the property is mandatory for all planes when exposed for some of
> > the planes. Nonetheless, weston v8.0 has been reported to have trouble
> > handling this situation.
> >
> > The DRM core offers support for immutable zpos properties. Creating an
> > immutable zpos property set to 0 for the primary planes seems to be a
> > good way forward, as it shouldn't introduce any regression, and can fix
> > the issue. Do so.
> >
> > Reported-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> 
> Thanks for your patch!
> 
> > --- a/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> > +++ b/drivers/gpu/drm/rcar-du/rcar_du_plane.c
> > @@ -785,13 +785,15 @@ int rcar_du_planes_init(struct rcar_du_group *rgrp)
> >
> >                 drm_plane_create_alpha_property(&plane->plane);
> >
> > -               if (type == DRM_PLANE_TYPE_PRIMARY)
> > -                       continue;
> > -
> > -               drm_object_attach_property(&plane->plane.base,
> > -                                          rcdu->props.colorkey,
> > -                                          RCAR_DU_COLORKEY_NONE);
> > -               drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
> > +               if (type == DRM_PLANE_TYPE_PRIMARY) {
> > +                       drm_plane_create_zpos_immutable_property(&plane->plane,
> > +                                                                0);
> > +               } else {
> > +                       drm_object_attach_property(&plane->plane.base,
> > +                                                  rcdu->props.colorkey,
> > +                                                  RCAR_DU_COLORKEY_NONE);
> > +                       drm_plane_create_zpos_property(&plane->plane, 1, 1, 7);
> > +               }
> >         }
> >
> >         return 0;
> 
> This is very similar to Esaki-san's patch[*] posted yesterday.

Thank you for pointing me to it, I had missed that patch.

> However, there's one big difference: your patch doesn't update
> rcar_du_vsp_init(). Isn't that needed?
> 
> [*] "[PATCH] drm: rcar-du: Set primary plane zpos immutably at initializing"
>     https://lore.kernel.org/linux-renesas-soc/20200401061100.7379-1-etom@igel.co.jp/

My bad. I've sent a v2 of Esaki-san's patch to CC the dri-devel mailing
list, and have applied it to my tree.

-- 
Regards,

Laurent Pinchart

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

end of thread, other threads:[~2020-04-04 18:25 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-02 10:40 [PATCH] drm: rcar-du: Create immutable zpos property for primary planes Laurent Pinchart
2020-04-02 10:56 ` Daniel Stone
2020-04-02 11:13   ` Daniel Vetter
2020-04-02 11:12 ` Geert Uytterhoeven
2020-04-04 18:25   ` Laurent Pinchart

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).