* [PATCH] drm/tegra: Add zpos property for cursor planes
@ 2020-06-10 11:30 Thierry Reding
[not found] ` <20200610113059.2164132-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
0 siblings, 1 reply; 5+ messages in thread
From: Thierry Reding @ 2020-06-10 11:30 UTC (permalink / raw)
To: Thierry Reding
Cc: Jon Hunter, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW,
linux-tegra-u79uwXL29TY76Z2rM5mHXA
From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes
have a zpos property") a warning is emitted if there's a mix of planes
with and without a zpos property.
On Tegra, cursor planes are always composited on top of all other
planes, which is why they never had a zpos property attached to them.
However, since the composition order is fixed, this is trivial to
remedy by simply attaching an immutable zpos property to them.
Reported-by: Jonathan Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org>
---
drivers/gpu/drm/tegra/dc.c | 10 ++++++++--
drivers/gpu/drm/tegra/hub.c | 2 +-
2 files changed, 9 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c
index 83f31c6e891c..e7a6eb952ece 100644
--- a/drivers/gpu/drm/tegra/dc.c
+++ b/drivers/gpu/drm/tegra/dc.c
@@ -787,7 +787,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm,
}
drm_plane_helper_add(&plane->base, &tegra_plane_helper_funcs);
- drm_plane_create_zpos_property(&plane->base, plane->index, 0, 255);
+ drm_plane_create_zpos_property(&plane->base, 1 + plane->index, 1, 255);
err = drm_plane_create_rotation_property(&plane->base,
DRM_MODE_ROTATE_0,
@@ -957,6 +957,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm,
}
drm_plane_helper_add(&plane->base, &tegra_cursor_plane_helper_funcs);
+ drm_plane_create_zpos_immutable_property(&plane->base, 0);
return &plane->base;
}
@@ -1074,7 +1075,12 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm,
}
drm_plane_helper_add(&plane->base, &tegra_plane_helper_funcs);
- drm_plane_create_zpos_property(&plane->base, plane->index, 0, 255);
+
+ if (!cursor)
+ drm_plane_create_zpos_property(&plane->base, 1 + plane->index,
+ 1, 255);
+ else
+ drm_plane_create_zpos_immutable_property(&plane->base, 0);
err = drm_plane_create_rotation_property(&plane->base,
DRM_MODE_ROTATE_0,
diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c
index a2ef8f218d4e..697d75bbb9fa 100644
--- a/drivers/gpu/drm/tegra/hub.c
+++ b/drivers/gpu/drm/tegra/hub.c
@@ -590,7 +590,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm,
}
drm_plane_helper_add(p, &tegra_shared_plane_helper_funcs);
- drm_plane_create_zpos_property(p, 0, 0, 255);
+ drm_plane_create_zpos_property(p, 1 + index, 1, 255);
return p;
}
--
2.24.1
^ permalink raw reply related [flat|nested] 5+ messages in thread[parent not found: <20200610113059.2164132-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] drm/tegra: Add zpos property for cursor planes [not found] ` <20200610113059.2164132-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2020-06-10 12:10 ` Ville Syrjälä 2020-06-10 13:16 ` Dmitry Osipenko 1 sibling, 0 replies; 5+ messages in thread From: Ville Syrjälä @ 2020-06-10 12:10 UTC (permalink / raw) To: Thierry Reding Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Jon Hunter On Wed, Jun 10, 2020 at 01:30:59PM +0200, Thierry Reding wrote: > From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes > have a zpos property") a warning is emitted if there's a mix of planes > with and without a zpos property. > > On Tegra, cursor planes are always composited on top of all other > planes, which is why they never had a zpos property attached to them. > However, since the composition order is fixed, this is trivial to > remedy by simply attaching an immutable zpos property to them. > > Reported-by: Jonathan Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > --- > drivers/gpu/drm/tegra/dc.c | 10 ++++++++-- > drivers/gpu/drm/tegra/hub.c | 2 +- > 2 files changed, 9 insertions(+), 3 deletions(-) > > diff --git a/drivers/gpu/drm/tegra/dc.c b/drivers/gpu/drm/tegra/dc.c > index 83f31c6e891c..e7a6eb952ece 100644 > --- a/drivers/gpu/drm/tegra/dc.c > +++ b/drivers/gpu/drm/tegra/dc.c > @@ -787,7 +787,7 @@ static struct drm_plane *tegra_primary_plane_create(struct drm_device *drm, > } > > drm_plane_helper_add(&plane->base, &tegra_plane_helper_funcs); > - drm_plane_create_zpos_property(&plane->base, plane->index, 0, 255); > + drm_plane_create_zpos_property(&plane->base, 1 + plane->index, 1, 255); > > err = drm_plane_create_rotation_property(&plane->base, > DRM_MODE_ROTATE_0, > @@ -957,6 +957,7 @@ static struct drm_plane *tegra_dc_cursor_plane_create(struct drm_device *drm, > } > > drm_plane_helper_add(&plane->base, &tegra_cursor_plane_helper_funcs); > + drm_plane_create_zpos_immutable_property(&plane->base, 0); zpos==0 means the plane is at the bottom of the pile. Doesn't seem to agree what you say in the commit msg. > > return &plane->base; > } > @@ -1074,7 +1075,12 @@ static struct drm_plane *tegra_dc_overlay_plane_create(struct drm_device *drm, > } > > drm_plane_helper_add(&plane->base, &tegra_plane_helper_funcs); > - drm_plane_create_zpos_property(&plane->base, plane->index, 0, 255); > + > + if (!cursor) > + drm_plane_create_zpos_property(&plane->base, 1 + plane->index, > + 1, 255); > + else > + drm_plane_create_zpos_immutable_property(&plane->base, 0); > > err = drm_plane_create_rotation_property(&plane->base, > DRM_MODE_ROTATE_0, > diff --git a/drivers/gpu/drm/tegra/hub.c b/drivers/gpu/drm/tegra/hub.c > index a2ef8f218d4e..697d75bbb9fa 100644 > --- a/drivers/gpu/drm/tegra/hub.c > +++ b/drivers/gpu/drm/tegra/hub.c > @@ -590,7 +590,7 @@ struct drm_plane *tegra_shared_plane_create(struct drm_device *drm, > } > > drm_plane_helper_add(p, &tegra_shared_plane_helper_funcs); > - drm_plane_create_zpos_property(p, 0, 0, 255); > + drm_plane_create_zpos_property(p, 1 + index, 1, 255); > > return p; > } > -- > 2.24.1 > > _______________________________________________ > dri-devel mailing list > dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW@public.gmane.org > https://lists.freedesktop.org/mailman/listinfo/dri-devel -- Ville Syrjälä Intel ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] drm/tegra: Add zpos property for cursor planes [not found] ` <20200610113059.2164132-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 2020-06-10 12:10 ` Ville Syrjälä @ 2020-06-10 13:16 ` Dmitry Osipenko [not found] ` <ca53d82f-1fd0-b2da-cfbf-7183a977e1d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> 1 sibling, 1 reply; 5+ messages in thread From: Dmitry Osipenko @ 2020-06-10 13:16 UTC (permalink / raw) To: Thierry Reding Cc: linux-tegra-u79uwXL29TY76Z2rM5mHXA, dri-devel-PD4FTy7X32lNgt0PjOBp9y5qC8QIuHrW, Jon Hunter 10.06.2020 14:30, Thierry Reding пишет: > From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes > have a zpos property") a warning is emitted if there's a mix of planes > with and without a zpos property. > > On Tegra, cursor planes are always composited on top of all other > planes, which is why they never had a zpos property attached to them. > However, since the composition order is fixed, this is trivial to > remedy by simply attaching an immutable zpos property to them. > > Reported-by: Jonathan Hunter <jonathanh-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > Signed-off-by: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > --- What problem does it solve? ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <ca53d82f-1fd0-b2da-cfbf-7183a977e1d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>]
* Re: [PATCH] drm/tegra: Add zpos property for cursor planes [not found] ` <ca53d82f-1fd0-b2da-cfbf-7183a977e1d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> @ 2020-06-11 8:17 ` Daniel Stone [not found] ` <CAPj87rMcXQozYX90wGYbv_vNnQ0-fLLnEdH3Lzio+B1L7xZuYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> 0 siblings, 1 reply; 5+ messages in thread From: Daniel Stone @ 2020-06-11 8:17 UTC (permalink / raw) To: Dmitry Osipenko Cc: Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, dri-devel, Jon Hunter Hi Dmitry, On Thu, 11 Jun 2020 at 08:54, Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: > 10.06.2020 14:30, Thierry Reding пишет: > > From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> > > As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes > > have a zpos property") a warning is emitted if there's a mix of planes > > with and without a zpos property. > > What problem does it solve? Well, it fixes the WARN_ON, which asserts that either no planes have the zpos property attached, or all planes have the zpos property attached. When only _some_ planes have the property, the property is pretty much useless: zpos exists to guarantee to userspace the relative ordering between planes, defined by the value of the property. If not all planes have the property, then userspace cannot reason about the ordering, since some of the planes have undefined ordering. Cheers, Daniel ^ permalink raw reply [flat|nested] 5+ messages in thread
[parent not found: <CAPj87rMcXQozYX90wGYbv_vNnQ0-fLLnEdH3Lzio+B1L7xZuYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>]
* Re: [PATCH] drm/tegra: Add zpos property for cursor planes [not found] ` <CAPj87rMcXQozYX90wGYbv_vNnQ0-fLLnEdH3Lzio+B1L7xZuYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org> @ 2020-06-11 11:27 ` Dmitry Osipenko 0 siblings, 0 replies; 5+ messages in thread From: Dmitry Osipenko @ 2020-06-11 11:27 UTC (permalink / raw) To: Daniel Stone Cc: Thierry Reding, linux-tegra-u79uwXL29TY76Z2rM5mHXA, dri-devel, Jon Hunter 11.06.2020 11:17, Daniel Stone пишет: > Hi Dmitry, > > On Thu, 11 Jun 2020 at 08:54, Dmitry Osipenko <digetx-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote: >> 10.06.2020 14:30, Thierry Reding пишет: >>> From: Thierry Reding <treding-DDmLM1+adcrQT0dZR+AlfA@public.gmane.org> >>> As of commit 4dc55525b095 ("drm: plane: Verify that no or all planes >>> have a zpos property") a warning is emitted if there's a mix of planes >>> with and without a zpos property. >> >> What problem does it solve? > > Well, it fixes the WARN_ON, which asserts that either no planes have > the zpos property attached, or all planes have the zpos property > attached. When only _some_ planes have the property, the property is > pretty much useless: zpos exists to guarantee to userspace the > relative ordering between planes, defined by the value of the > property. If not all planes have the property, then userspace cannot > reason about the ordering, since some of the planes have undefined > ordering. Hello Daniel, So it's a kernel warning, thank you for the clarification! I'm running only older Tegras that have a black-n-white cursor plane, but this is not supported by the upstream kernel. No wonder that I haven't seen the warning, this made me curious what this patch is about :) ^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2020-06-11 11:27 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-06-10 11:30 [PATCH] drm/tegra: Add zpos property for cursor planes Thierry Reding
[not found] ` <20200610113059.2164132-1-thierry.reding-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-10 12:10 ` Ville Syrjälä
2020-06-10 13:16 ` Dmitry Osipenko
[not found] ` <ca53d82f-1fd0-b2da-cfbf-7183a977e1d1-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org>
2020-06-11 8:17 ` Daniel Stone
[not found] ` <CAPj87rMcXQozYX90wGYbv_vNnQ0-fLLnEdH3Lzio+B1L7xZuYg-JsoAwUIsXosN+BqQ9rBEUg@public.gmane.org>
2020-06-11 11:27 ` Dmitry Osipenko
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox