All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it
@ 2018-01-12  9:38 Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 1/6] drm: Add drm_device->normalize_zpos boolean Peter Ujfalusi
                   ` (6 more replies)
  0 siblings, 7 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: dri-devel

Hi,

The first patch is adding a flag to drm_device that drivers can set if they want
the zpos to be normalized.

Then convert exynos, tegra, sti and rcar-du to use this flag instead of
re-implementing the drm_atomic_helper_check() locally just to add the call to
drm_atomic_normalize_zpos().

The last patch is moving omapdrm to use the zpos normalization as well to comply
with the UAPI documentation regarding to zpos.

Laurent's note in an earlier thread:
https://marc.info/?l=dri-devel&m=151567355225029&w=2

"The problem is that zpos normalization requires accessing the state of all 
enabled planes for a CRTC in order to compute (and store) the normalized zpos 
values. This thus forces all planes to be added to the commit state, even when 
the commit doesn't touch the zpos property. I assume this caused issues 
(possibly performance issues) in drivers that then performed hardware setup of 
all planes as a result."

can be addressed later in the core for all users of drm_atomic_normalize_zpos()

Regards,
Peter
---
Peter Ujfalusi (6):
  drm: Add drm_device->normalize_zpos boolean
  drm/exynos: Let core take care of normalizing the zpos
  drm/tegra: Let core take care of normalizing the zpos
  drm/sti: Let core take care of normalizing the zpos
  drm: rcar-du: Let core take care of normalizing the zpos
  drm/omap: Use normalized zpos for plane placement

 drivers/gpu/drm/drm_atomic_helper.c     |  6 ++++++
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 21 +--------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h |  1 -
 drivers/gpu/drm/exynos/exynos_drm_fb.c  |  2 +-
 drivers/gpu/drm/omapdrm/omap_drv.c      |  1 +
 drivers/gpu/drm/omapdrm/omap_plane.c    |  2 +-
 drivers/gpu/drm/rcar-du/rcar_du_drv.c   |  1 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c   | 10 +---------
 drivers/gpu/drm/sti/sti_drv.c           | 23 ++---------------------
 drivers/gpu/drm/tegra/drm.c             | 27 +++------------------------
 include/drm/drm_device.h                |  8 ++++++++
 11 files changed, 25 insertions(+), 77 deletions(-)

-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 1/6] drm: Add drm_device->normalize_zpos boolean
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 2/6] drm/exynos: Let core take care of normalizing the zpos Peter Ujfalusi
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: dri-devel

Instead of drivers duplicating the drm_atomic_helper_check() code to be
able to normalize the zpos they can use the normalize_zpos flag to let the
drm core to do it.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
---
 drivers/gpu/drm/drm_atomic_helper.c | 6 ++++++
 include/drm/drm_device.h            | 8 ++++++++
 2 files changed, 14 insertions(+)

diff --git a/drivers/gpu/drm/drm_atomic_helper.c b/drivers/gpu/drm/drm_atomic_helper.c
index ab4032167094..143cab4b2a89 100644
--- a/drivers/gpu/drm/drm_atomic_helper.c
+++ b/drivers/gpu/drm/drm_atomic_helper.c
@@ -885,6 +885,12 @@ int drm_atomic_helper_check(struct drm_device *dev,
 	if (ret)
 		return ret;
 
+	if (dev->normalize_zpos) {
+		ret = drm_atomic_normalize_zpos(dev, state);
+		if (ret)
+			return ret;
+	}
+
 	ret = drm_atomic_helper_check_planes(dev, state);
 	if (ret)
 		return ret;
diff --git a/include/drm/drm_device.h b/include/drm/drm_device.h
index 7c4fa32f3fc6..9c45d1155bfd 100644
--- a/include/drm/drm_device.h
+++ b/include/drm/drm_device.h
@@ -121,6 +121,14 @@ struct drm_device {
 	 */
 	bool vblank_disable_immediate;
 
+	/**
+	 * @normalize_zpos:
+	 *
+	 * If true the drm core will call drm_atomic_normalize_zpos() as part of
+	 * atomic mode checking from drm_atomic_helper_check()
+	 */
+	bool normalize_zpos;
+
 	/**
 	 * @vblank:
 	 *
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 2/6] drm/exynos: Let core take care of normalizing the zpos
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 1/6] drm: Add drm_device->normalize_zpos boolean Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 3/6] drm/tegra: " Peter Ujfalusi
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: Seung-Woo Kim, dri-devel, Kyungmin Park

Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_device->normalize_zpos.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Inki Dae <inki.dae@samsung.com>
CC: Joonyoung Shim <jy0922.shim@samsung.com>
CC: Seung-Woo Kim <sw0312.kim@samsung.com>
CC: Kyungmin Park <kyungmin.park@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_drm_drv.c | 21 +--------------------
 drivers/gpu/drm/exynos/exynos_drm_drv.h |  1 -
 drivers/gpu/drm/exynos/exynos_drm_fb.c  |  2 +-
 3 files changed, 2 insertions(+), 22 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.c b/drivers/gpu/drm/exynos/exynos_drm_drv.c
index b96bd5a781b2..181ebd42fc9f 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.c
@@ -38,26 +38,6 @@
 #define DRIVER_MAJOR	1
 #define DRIVER_MINOR	0
 
-int exynos_atomic_check(struct drm_device *dev,
-			struct drm_atomic_state *state)
-{
-	int ret;
-
-	ret = drm_atomic_helper_check_modeset(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_normalize_zpos(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_helper_check_planes(dev, state);
-	if (ret)
-		return ret;
-
-	return ret;
-}
-
 static int exynos_drm_open(struct drm_device *dev, struct drm_file *file)
 {
 	struct drm_exynos_file_private *file_priv;
@@ -339,6 +319,7 @@ static int exynos_drm_bind(struct device *dev)
 
 	dev_set_drvdata(dev, drm);
 	drm->dev_private = (void *)private;
+	drm->normalize_zpos = true;
 
 	/* the first real CRTC device is used for all dma mapping operations */
 	private->dma_dev = exynos_drm_get_dma_device();
diff --git a/drivers/gpu/drm/exynos/exynos_drm_drv.h b/drivers/gpu/drm/exynos/exynos_drm_drv.h
index 589d465a7f88..4585d9e00c87 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_drv.h
+++ b/drivers/gpu/drm/exynos/exynos_drm_drv.h
@@ -276,7 +276,6 @@ static inline int exynos_dpi_bind(struct drm_device *dev,
 
 int exynos_atomic_commit(struct drm_device *dev, struct drm_atomic_state *state,
 			 bool nonblock);
-int exynos_atomic_check(struct drm_device *dev, struct drm_atomic_state *state);
 
 
 extern struct platform_driver fimd_driver;
diff --git a/drivers/gpu/drm/exynos/exynos_drm_fb.c b/drivers/gpu/drm/exynos/exynos_drm_fb.c
index 0faaf829f5bf..d388231e43e1 100644
--- a/drivers/gpu/drm/exynos/exynos_drm_fb.c
+++ b/drivers/gpu/drm/exynos/exynos_drm_fb.c
@@ -206,7 +206,7 @@ static struct drm_mode_config_helper_funcs exynos_drm_mode_config_helpers = {
 static const struct drm_mode_config_funcs exynos_drm_mode_config_funcs = {
 	.fb_create = exynos_user_fb_create,
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
-	.atomic_check = exynos_atomic_check,
+	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 3/6] drm/tegra: Let core take care of normalizing the zpos
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 1/6] drm: Add drm_device->normalize_zpos boolean Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 2/6] drm/exynos: Let core take care of normalizing the zpos Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 4/6] drm/sti: " Peter Ujfalusi
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: Thierry Reding, dri-devel

Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_device->normalize_zpos.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Thierry Reding <thierry.reding@gmail.com>
---
 drivers/gpu/drm/tegra/drm.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)

diff --git a/drivers/gpu/drm/tegra/drm.c b/drivers/gpu/drm/tegra/drm.c
index d50bddb2e447..1ef9f4eede07 100644
--- a/drivers/gpu/drm/tegra/drm.c
+++ b/drivers/gpu/drm/tegra/drm.c
@@ -33,29 +33,6 @@ struct tegra_drm_file {
 	struct mutex lock;
 };
 
-static int tegra_atomic_check(struct drm_device *drm,
-			      struct drm_atomic_state *state)
-{
-	int err;
-
-	err = drm_atomic_helper_check_modeset(drm, state);
-	if (err < 0)
-		return err;
-
-	err = drm_atomic_normalize_zpos(drm, state);
-	if (err < 0)
-		return err;
-
-	err = drm_atomic_helper_check_planes(drm, state);
-	if (err < 0)
-		return err;
-
-	if (state->legacy_cursor_update)
-		state->async_update = !drm_atomic_helper_async_check(drm, state);
-
-	return 0;
-}
-
 static struct drm_atomic_state *
 tegra_atomic_state_alloc(struct drm_device *drm)
 {
@@ -90,7 +67,7 @@ static const struct drm_mode_config_funcs tegra_drm_mode_config_funcs = {
 #ifdef CONFIG_DRM_FBDEV_EMULATION
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
 #endif
-	.atomic_check = tegra_atomic_check,
+	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 	.atomic_state_alloc = tegra_atomic_state_alloc,
 	.atomic_state_clear = tegra_atomic_state_clear,
@@ -1230,6 +1207,8 @@ static int host1x_drm_probe(struct host1x_device *dev)
 
 	dev_set_drvdata(&dev->dev, drm);
 
+	drm->normalize_zpos = true;
+
 	err = drm_dev_register(drm, 0);
 	if (err < 0)
 		goto unref;
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 4/6] drm/sti: Let core take care of normalizing the zpos
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
                   ` (2 preceding siblings ...)
  2018-01-12  9:38 ` [PATCH 3/6] drm/tegra: " Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 5/6] drm: rcar-du: " Peter Ujfalusi
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: Vincent Abriou, dri-devel

Instead of re-implementing the drm_atomic_helper_check() locally with just
adding drm_atomic_normalize_zpos() into it, set the
drm_device->normalize_zpos.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Benjamin Gaignard <benjamin.gaignard@linaro.org>
CC: Vincent Abriou <vincent.abriou@st.com>
---
 drivers/gpu/drm/sti/sti_drv.c | 23 ++---------------------
 1 file changed, 2 insertions(+), 21 deletions(-)

diff --git a/drivers/gpu/drm/sti/sti_drv.c b/drivers/gpu/drm/sti/sti_drv.c
index 55b6967d27e1..a0ffbb1ea3ba 100644
--- a/drivers/gpu/drm/sti/sti_drv.c
+++ b/drivers/gpu/drm/sti/sti_drv.c
@@ -119,30 +119,10 @@ static int sti_drm_dbg_init(struct drm_minor *minor)
 	return ret;
 }
 
-static int sti_atomic_check(struct drm_device *dev,
-			    struct drm_atomic_state *state)
-{
-	int ret;
-
-	ret = drm_atomic_helper_check_modeset(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_normalize_zpos(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_helper_check_planes(dev, state);
-	if (ret)
-		return ret;
-
-	return ret;
-}
-
 static const struct drm_mode_config_funcs sti_mode_config_funcs = {
 	.fb_create = drm_gem_fb_create,
 	.output_poll_changed = drm_fb_helper_output_poll_changed,
-	.atomic_check = sti_atomic_check,
+	.atomic_check = drm_atomic_helper_check,
 	.atomic_commit = drm_atomic_helper_commit,
 };
 
@@ -208,6 +188,7 @@ static int sti_init(struct drm_device *ddev)
 		return -ENOMEM;
 
 	ddev->dev_private = (void *)private;
+	ddev->normalize_zpos = true;
 	dev_set_drvdata(ddev->dev, ddev);
 	private->drm_dev = ddev;
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 5/6] drm: rcar-du: Let core take care of normalizing the zpos
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
                   ` (3 preceding siblings ...)
  2018-01-12  9:38 ` [PATCH 4/6] drm/sti: " Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:38 ` [PATCH 6/6] drm/omap: Use normalized zpos for plane placement Peter Ujfalusi
  2018-01-12  9:57 ` [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Daniel Vetter
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: dri-devel

Set the drm_device->normalize_zpos and call drm_atomic_helper_check() from
rcar_du_atomic_check() instead of re implementing the function locally.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
---
 drivers/gpu/drm/rcar-du/rcar_du_drv.c |  1 +
 drivers/gpu/drm/rcar-du/rcar_du_kms.c | 10 +---------
 2 files changed, 2 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/rcar-du/rcar_du_drv.c b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
index 6e02c762a557..61dc773b9df0 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_drv.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_drv.c
@@ -405,6 +405,7 @@ static int rcar_du_probe(struct platform_device *pdev)
 	}
 
 	ddev->irq_enabled = 1;
+	ddev->normalize_zpos = true;
 
 	/*
 	 * Register the DRM device with the core and the connectors with
diff --git a/drivers/gpu/drm/rcar-du/rcar_du_kms.c b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
index 566d1a948c8f..fa82adfe0982 100644
--- a/drivers/gpu/drm/rcar-du/rcar_du_kms.c
+++ b/drivers/gpu/drm/rcar-du/rcar_du_kms.c
@@ -234,15 +234,7 @@ static int rcar_du_atomic_check(struct drm_device *dev,
 	struct rcar_du_device *rcdu = dev->dev_private;
 	int ret;
 
-	ret = drm_atomic_helper_check_modeset(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_normalize_zpos(dev, state);
-	if (ret)
-		return ret;
-
-	ret = drm_atomic_helper_check_planes(dev, state);
+	ret = drm_atomic_helper_check(dev, state);
 	if (ret)
 		return ret;
 
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* [PATCH 6/6] drm/omap: Use normalized zpos for plane placement
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
                   ` (4 preceding siblings ...)
  2018-01-12  9:38 ` [PATCH 5/6] drm: rcar-du: " Peter Ujfalusi
@ 2018-01-12  9:38 ` Peter Ujfalusi
  2018-01-12  9:57 ` [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Daniel Vetter
  6 siblings, 0 replies; 8+ messages in thread
From: Peter Ujfalusi @ 2018-01-12  9:38 UTC (permalink / raw)
  To: laurent.pinchart, daniel, airlied; +Cc: Tomi Valkeinen, dri-devel

Planes with identical zpos value will result undefined behavior:
disappearing planes, screen flickering and it is not supported by the
hardware.

Use normalized zpos to make sure that we don't encounter invalid
configuration.

Signed-off-by: Peter Ujfalusi <peter.ujfalusi@ti.com>
CC: Tomi Valkeinen <tomi.valkeinen@ti.com>
---
 drivers/gpu/drm/omapdrm/omap_drv.c   | 1 +
 drivers/gpu/drm/omapdrm/omap_plane.c | 2 +-
 2 files changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/omap_drv.c b/drivers/gpu/drm/omapdrm/omap_drv.c
index 2c02b955dd52..25f06f09fbe2 100644
--- a/drivers/gpu/drm/omapdrm/omap_drv.c
+++ b/drivers/gpu/drm/omapdrm/omap_drv.c
@@ -651,6 +651,7 @@ static int pdev_probe(struct platform_device *pdev)
 		return PTR_ERR(ddev);
 
 	ddev->dev_private = priv;
+	ddev->normalize_zpos = true;
 	platform_set_drvdata(pdev, ddev);
 
 	omap_crtc_pre_init();
diff --git a/drivers/gpu/drm/omapdrm/omap_plane.c b/drivers/gpu/drm/omapdrm/omap_plane.c
index 7d789d1551a1..2c19d2239bc5 100644
--- a/drivers/gpu/drm/omapdrm/omap_plane.c
+++ b/drivers/gpu/drm/omapdrm/omap_plane.c
@@ -65,7 +65,7 @@ static void omap_plane_atomic_update(struct drm_plane *plane,
 	info.rotation_type = OMAP_DSS_ROT_NONE;
 	info.rotation = DRM_MODE_ROTATE_0;
 	info.global_alpha = 0xff;
-	info.zorder = state->zpos;
+	info.zorder = state->normalized_zpos;
 
 	/* update scanout: */
 	omap_framebuffer_update_scanout(state->fb, state, &info);
-- 
Peter

Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki

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

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

* Re: [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it
  2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
                   ` (5 preceding siblings ...)
  2018-01-12  9:38 ` [PATCH 6/6] drm/omap: Use normalized zpos for plane placement Peter Ujfalusi
@ 2018-01-12  9:57 ` Daniel Vetter
  6 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2018-01-12  9:57 UTC (permalink / raw)
  To: Peter Ujfalusi; +Cc: airlied, dri-devel, laurent.pinchart

On Fri, Jan 12, 2018 at 11:38:03AM +0200, Peter Ujfalusi wrote:
> Hi,
> 
> The first patch is adding a flag to drm_device that drivers can set if they want
> the zpos to be normalized.

If we go with the flag it should imo be put into struct drm_mode_config.

> Then convert exynos, tegra, sti and rcar-du to use this flag instead of
> re-implementing the drm_atomic_helper_check() locally just to add the call to
> drm_atomic_normalize_zpos().
> 
> The last patch is moving omapdrm to use the zpos normalization as well to comply
> with the UAPI documentation regarding to zpos.
> 
> Laurent's note in an earlier thread:
> https://marc.info/?l=dri-devel&m=151567355225029&w=2
> 
> "The problem is that zpos normalization requires accessing the state of all 
> enabled planes for a CRTC in order to compute (and store) the normalized zpos 
> values. This thus forces all planes to be added to the commit state, even when 
> the commit doesn't touch the zpos property. I assume this caused issues 
> (possibly performance issues) in drivers that then performed hardware setup of 
> all planes as a result."

I've dug some more and per Ville the issue seems to have been cursor
updates starting to block. Gustavo Padovan has created patches to handle
async cursor plane updates like the cursor much better, in a side-path,
which would resolve this. Once that has landed we wouldn't need to make
the zpos normalization optional anymore. See Ville's original removal of
all this.

Can you pls add a comment to the atomic_check function to that effect.

With those two things addressed the series is:

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

> 
> can be addressed later in the core for all users of drm_atomic_normalize_zpos()
> 
> Regards,
> Peter
> ---
> Peter Ujfalusi (6):
>   drm: Add drm_device->normalize_zpos boolean
>   drm/exynos: Let core take care of normalizing the zpos
>   drm/tegra: Let core take care of normalizing the zpos
>   drm/sti: Let core take care of normalizing the zpos
>   drm: rcar-du: Let core take care of normalizing the zpos
>   drm/omap: Use normalized zpos for plane placement
> 
>  drivers/gpu/drm/drm_atomic_helper.c     |  6 ++++++
>  drivers/gpu/drm/exynos/exynos_drm_drv.c | 21 +--------------------
>  drivers/gpu/drm/exynos/exynos_drm_drv.h |  1 -
>  drivers/gpu/drm/exynos/exynos_drm_fb.c  |  2 +-
>  drivers/gpu/drm/omapdrm/omap_drv.c      |  1 +
>  drivers/gpu/drm/omapdrm/omap_plane.c    |  2 +-
>  drivers/gpu/drm/rcar-du/rcar_du_drv.c   |  1 +
>  drivers/gpu/drm/rcar-du/rcar_du_kms.c   | 10 +---------
>  drivers/gpu/drm/sti/sti_drv.c           | 23 ++---------------------
>  drivers/gpu/drm/tegra/drm.c             | 27 +++------------------------
>  include/drm/drm_device.h                |  8 ++++++++
>  11 files changed, 25 insertions(+), 77 deletions(-)
> 
> -- 
> Peter
> 
> Texas Instruments Finland Oy, Porkkalankatu 22, 00180 Helsinki.
> Y-tunnus/Business ID: 0615521-4. Kotipaikka/Domicile: Helsinki
> 

-- 
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] 8+ messages in thread

end of thread, other threads:[~2018-01-13  0:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-12  9:38 [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 1/6] drm: Add drm_device->normalize_zpos boolean Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 2/6] drm/exynos: Let core take care of normalizing the zpos Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 3/6] drm/tegra: " Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 4/6] drm/sti: " Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 5/6] drm: rcar-du: " Peter Ujfalusi
2018-01-12  9:38 ` [PATCH 6/6] drm/omap: Use normalized zpos for plane placement Peter Ujfalusi
2018-01-12  9:57 ` [PATCH 0/6] drm: zpos normalization cleanup and omapdrm to use it 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.