dri-devel Archive on lore.kernel.org
 help / color / Atom feed
* [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion
@ 2019-12-13 17:26 Daniel Vetter
  2019-12-13 17:26 ` [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc Daniel Vetter
                   ` (8 more replies)
  0 siblings, 9 replies; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

It's frankly a mess, and the confusion around plane_state->crtc/fb
that I fixed up in this series is the least of the problems. Add a
todo as a future note of how this could be done a lot better, and with
a lot less driver confusion.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 Documentation/gpu/todo.rst | 22 ++++++++++++++++++++++
 1 file changed, 22 insertions(+)

diff --git a/Documentation/gpu/todo.rst b/Documentation/gpu/todo.rst
index 2d85f37284a1..63b657ecc9ce 100644
--- a/Documentation/gpu/todo.rst
+++ b/Documentation/gpu/todo.rst
@@ -72,6 +72,28 @@ Contact: Ville Syrjälä, Daniel Vetter, driver maintainers
 
 Level: Advanced
 
+Improve plane atomic_check helpers
+----------------------------------
+
+Aside from the clipped coordinates right above there's a few suboptimal things
+with the current helpers:
+
+- drm_plane_helper_funcs->atomic_check gets called for enabled or disabled
+  planes. At best this seems to confuse drivers, worst it means they blow up
+  when the plane is disabled without the CRTC. The only special handling is
+  resetting values in the plane state structures, which instead should be moved
+  into the drm_plane_funcs->atomic_duplicate_state functions.
+
+- Once that's done, helpers could stop calling ->atomic_check for disabled
+  planes.
+
+- Then we could go through all the drivers and remove the more-or-less confused
+  checks for plane_state->fb and plane_state->crtc.
+
+Contact: Daniel Vetter
+
+Level: Advanced
+
 Convert early atomic drivers to async commit helpers
 ----------------------------------------------------
 
-- 
2.24.0

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

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

* [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
@ 2019-12-13 17:26 ` Daniel Vetter
  2019-12-16  9:19   ` Liviu Dudau
  2019-12-13 17:26 ` [PATCH 03/10] drm/atmel: " Daniel Vetter
                   ` (7 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Liviu Dudau, Daniel Vetter

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Liviu Dudau <liviu.dudau@arm.com>
Cc: Brian Starkey <brian.starkey@arm.com>
Cc:
---
 drivers/gpu/drm/arm/malidp_planes.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
index 3c70a53813bf..37715cc6064e 100644
--- a/drivers/gpu/drm/arm/malidp_planes.c
+++ b/drivers/gpu/drm/arm/malidp_planes.c
@@ -512,7 +512,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
 	int i, ret;
 	unsigned int block_w, block_h;
 
-	if (!state->crtc || !state->fb)
+	if (!state->crtc || WARN_ON(!state->fb))
 		return 0;
 
 	fb = state->fb;
-- 
2.24.0

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

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

* [PATCH 03/10] drm/atmel: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
  2019-12-13 17:26 ` [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-13 19:53   ` Sam Ravnborg
  2019-12-13 17:26 ` [PATCH 04/10] drm/malidp: " Daniel Vetter
                   ` (6 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: Alexandre Belloni, Boris Brezillon, Daniel Vetter, Nicolas Ferre,
	Ludovic Desroches, Daniel Vetter, Sam Ravnborg, linux-arm-kernel

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sam Ravnborg <sam@ravnborg.org>
Cc: Boris Brezillon <bbrezillon@kernel.org>
Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
index 034f202dfe8f..40800ec5700a 100644
--- a/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
+++ b/drivers/gpu/drm/atmel-hlcdc/atmel_hlcdc_plane.c
@@ -604,7 +604,7 @@ static int atmel_hlcdc_plane_atomic_check(struct drm_plane *p,
 	int ret;
 	int i;
 
-	if (!state->base.crtc || !fb)
+	if (!state->base.crtc || WARN_ON(!fb))
 		return 0;
 
 	crtc_state = drm_atomic_get_existing_crtc_state(s->state, s->crtc);
-- 
2.24.0

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

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

* [PATCH 04/10] drm/malidp: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
  2019-12-13 17:26 ` [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc Daniel Vetter
  2019-12-13 17:26 ` [PATCH 03/10] drm/atmel: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-17 13:11   ` Daniel Vetter
  2019-12-13 17:26 ` [PATCH 05/10] drm/mediatek: " Daniel Vetter
                   ` (5 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Sascha Hauer, NXP Linux Team,
	Pengutronix Kernel Team, Daniel Vetter, Shawn Guo,
	linux-arm-kernel

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Shawn Guo <shawnguo@kernel.org>
Cc: Sascha Hauer <s.hauer@pengutronix.de>
Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
Cc: Fabio Estevam <festevam@gmail.com>
Cc: NXP Linux Team <linux-imx@nxp.com>
Cc: linux-arm-kernel@lists.infradead.org
---
 drivers/gpu/drm/imx/ipuv3-plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
index 28826c0aa24a..6776ebb3246d 100644
--- a/drivers/gpu/drm/imx/ipuv3-plane.c
+++ b/drivers/gpu/drm/imx/ipuv3-plane.c
@@ -359,7 +359,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
 	if (!fb)
 		return 0;
 
-	if (!state->crtc)
+	if (WARN_ON(!state->crtc))
 		return -EINVAL;
 
 	crtc_state =
-- 
2.24.0

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

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

* [PATCH 05/10] drm/mediatek: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (2 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 04/10] drm/malidp: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-17  1:13   ` CK Hu
  2019-12-13 17:26 ` [PATCH 06/10] drm/xrockchip: " Daniel Vetter
                   ` (4 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Matthias Brugger, linux-mediatek, Daniel Vetter,
	linux-arm-kernel

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: CK Hu <ck.hu@mediatek.com>
Cc: Philipp Zabel <p.zabel@pengutronix.de>
Cc: Matthias Brugger <matthias.bgg@gmail.com>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-mediatek@lists.infradead.org
---
 drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
index 540ef2faa40a..f0b0325381e0 100644
--- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
+++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
@@ -94,7 +94,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
 	if (!fb)
 		return 0;
 
-	if (!state->crtc)
+	if (WARN_ON(!state->crtc))
 		return 0;
 
 	ret = mtk_drm_crtc_plane_check(state->crtc, plane,
-- 
2.24.0

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

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

* [PATCH 06/10] drm/xrockchip: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (3 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 05/10] drm/mediatek: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-13 18:03   ` Heiko Stübner
  2019-12-13 17:26 ` [PATCH 07/10] drm/vc4: " Daniel Vetter
                   ` (3 subsequent siblings)
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Sandy Huang, linux-rockchip, Daniel Vetter,
	linux-arm-kernel

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Sandy Huang <hjc@rock-chips.com>
Cc: "Heiko Stübner" <heiko@sntech.de>
Cc: linux-arm-kernel@lists.infradead.org
Cc: linux-rockchip@lists.infradead.org
---
 drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
index d04b3492bdac..cecb2cc781f5 100644
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
@@ -724,7 +724,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
 	int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :
 					DRM_PLANE_HELPER_NO_SCALING;
 
-	if (!crtc || !fb)
+	if (!crtc || WARN_ON(!fb))
 		return 0;
 
 	crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
-- 
2.24.0

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

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

* [PATCH 07/10] drm/vc4: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (4 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 06/10] drm/xrockchip: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-13 17:26 ` [PATCH 08/10] drm/virtio: " Daniel Vetter
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Daniel Vetter

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 drivers/gpu/drm/vc4/vc4_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vc4/vc4_plane.c b/drivers/gpu/drm/vc4/vc4_plane.c
index 4934127f0d76..91e408f7a56e 100644
--- a/drivers/gpu/drm/vc4/vc4_plane.c
+++ b/drivers/gpu/drm/vc4/vc4_plane.c
@@ -139,7 +139,7 @@ static enum vc4_scaling_mode vc4_get_scaling_mode(u32 src, u32 dst)
 
 static bool plane_enabled(struct drm_plane_state *state)
 {
-	return state->fb && state->crtc;
+	return state->fb && !WARN_ON(!state->crtc);
 }
 
 static struct drm_plane_state *vc4_plane_duplicate_state(struct drm_plane *plane)
-- 
2.24.0

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

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

* [PATCH 08/10] drm/virtio: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (5 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 07/10] drm/vc4: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2019-12-13 17:26 ` [PATCH 09/10] drm/vkms: " Daniel Vetter
  2019-12-13 17:26 ` [PATCH 10/10] drm/zte: " Daniel Vetter
  8 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: David Airlie, Daniel Vetter, virtualization, Gerd Hoffmann,
	Daniel Vetter

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: David Airlie <airlied@linux.ie>
Cc: Gerd Hoffmann <kraxel@redhat.com>
Cc: virtualization@lists.linux-foundation.org
---
 drivers/gpu/drm/virtio/virtgpu_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/virtio/virtgpu_plane.c b/drivers/gpu/drm/virtio/virtgpu_plane.c
index bc4bc4475a8c..947e65b51555 100644
--- a/drivers/gpu/drm/virtio/virtgpu_plane.c
+++ b/drivers/gpu/drm/virtio/virtgpu_plane.c
@@ -88,7 +88,7 @@ static int virtio_gpu_plane_atomic_check(struct drm_plane *plane,
 	struct drm_crtc_state *crtc_state;
 	int ret;
 
-	if (!state->fb || !state->crtc)
+	if (!state->fb || WARN_ON(!state->crtc))
 		return 0;
 
 	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
-- 
2.24.0

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

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

* [PATCH 09/10] drm/vkms: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (6 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 08/10] drm/virtio: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  2020-01-14 23:50   ` Rodrigo Siqueira
  2019-12-13 17:26 ` [PATCH 10/10] drm/zte: " Daniel Vetter
  8 siblings, 1 reply; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Haneen Mohammed, Rodrigo Siqueira, Daniel Vetter

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
Cc: Daniel Vetter <daniel@ffwll.ch>
---
 drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
index 5fc8f85aaf3d..6d31265a2ab7 100644
--- a/drivers/gpu/drm/vkms/vkms_plane.c
+++ b/drivers/gpu/drm/vkms/vkms_plane.c
@@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
 	bool can_position = false;
 	int ret;
 
-	if (!state->fb | !state->crtc)
+	if (!state->fb || WARN_ON(!state->crtc))
 		return 0;
 
 	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
-- 
2.24.0

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

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

* [PATCH 10/10] drm/zte: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
                   ` (7 preceding siblings ...)
  2019-12-13 17:26 ` [PATCH 09/10] drm/vkms: " Daniel Vetter
@ 2019-12-13 17:26 ` " Daniel Vetter
  8 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2019-12-13 17:26 UTC (permalink / raw)
  To: DRI Development; +Cc: Daniel Vetter, Shawn Guo, Daniel Vetter

Checking both is one too much, so wrap a WARN_ON around it to stope
the copypasta.

Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
Cc: Shawn Guo <shawnguo@kernel.org>
---
 drivers/gpu/drm/zte/zx_plane.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/zte/zx_plane.c b/drivers/gpu/drm/zte/zx_plane.c
index 086c50fac689..c8f7b21fa09e 100644
--- a/drivers/gpu/drm/zte/zx_plane.c
+++ b/drivers/gpu/drm/zte/zx_plane.c
@@ -54,7 +54,7 @@ static int zx_vl_plane_atomic_check(struct drm_plane *plane,
 	int min_scale = FRAC_16_16(1, 8);
 	int max_scale = FRAC_16_16(8, 1);
 
-	if (!crtc || !fb)
+	if (!crtc || WARN_ON(!fb))
 		return 0;
 
 	crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state,
@@ -281,7 +281,7 @@ static int zx_gl_plane_atomic_check(struct drm_plane *plane,
 	struct drm_crtc *crtc = plane_state->crtc;
 	struct drm_crtc_state *crtc_state;
 
-	if (!crtc || !fb)
+	if (!crtc || WARN_ON(!fb))
 		return 0;
 
 	crtc_state = drm_atomic_get_existing_crtc_state(plane_state->state,
-- 
2.24.0

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

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

* Re: [PATCH 06/10] drm/xrockchip: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 06/10] drm/xrockchip: " Daniel Vetter
@ 2019-12-13 18:03   ` Heiko Stübner
  0 siblings, 0 replies; 18+ messages in thread
From: Heiko Stübner @ 2019-12-13 18:03 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: linux-arm-kernel, Daniel Vetter, Sandy Huang, DRI Development,
	linux-rockchip

Am Freitag, 13. Dezember 2019, 18:26:08 CET schrieb Daniel Vetter:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Sandy Huang <hjc@rock-chips.com>
> Cc: "Heiko Stübner" <heiko@sntech.de>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-rockchip@lists.infradead.org

patch subject should be "drm/rockchip" without the x, otherwise
Reviewed-by: Heiko Stuebner <heiko@sntech.de>


> ---
>  drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> index d04b3492bdac..cecb2cc781f5 100644
> --- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> +++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c
> @@ -724,7 +724,7 @@ static int vop_plane_atomic_check(struct drm_plane *plane,
>  	int max_scale = win->phy->scl ? FRAC_16_16(8, 1) :
>  					DRM_PLANE_HELPER_NO_SCALING;
>  
> -	if (!crtc || !fb)
> +	if (!crtc || WARN_ON(!fb))
>  		return 0;
>  
>  	crtc_state = drm_atomic_get_existing_crtc_state(state->state, crtc);
> 




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

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

* Re: [PATCH 03/10] drm/atmel: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 03/10] drm/atmel: " Daniel Vetter
@ 2019-12-13 19:53   ` Sam Ravnborg
  0 siblings, 0 replies; 18+ messages in thread
From: Sam Ravnborg @ 2019-12-13 19:53 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: Alexandre Belloni, Boris Brezillon, Nicolas Ferre,
	DRI Development, Ludovic Desroches, Daniel Vetter,
	linux-arm-kernel

Hi Daniel.

On Fri, Dec 13, 2019 at 06:26:05PM +0100, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Sam Ravnborg <sam@ravnborg.org>
> Cc: Boris Brezillon <bbrezillon@kernel.org>
> Cc: Nicolas Ferre <nicolas.ferre@microchip.com>
> Cc: Alexandre Belloni <alexandre.belloni@bootlin.com>
> Cc: Ludovic Desroches <ludovic.desroches@microchip.com>
> Cc: linux-arm-kernel@lists.infradead.org

Applied to drm-misc-next.
Looked through the whole series:
Acked-by: Sam Ravnborg <sam@ravnborg.org>
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc Daniel Vetter
@ 2019-12-16  9:19   ` Liviu Dudau
  0 siblings, 0 replies; 18+ messages in thread
From: Liviu Dudau @ 2019-12-16  9:19 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development

On Fri, Dec 13, 2019 at 06:26:04PM +0100, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Liviu Dudau <liviu.dudau@arm.com>

Acked-by: Liviu Dudau <liviu.dudau@arm.com>

Best regards,
Liviu

> Cc: Brian Starkey <brian.starkey@arm.com>
> Cc:
> ---
>  drivers/gpu/drm/arm/malidp_planes.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/arm/malidp_planes.c b/drivers/gpu/drm/arm/malidp_planes.c
> index 3c70a53813bf..37715cc6064e 100644
> --- a/drivers/gpu/drm/arm/malidp_planes.c
> +++ b/drivers/gpu/drm/arm/malidp_planes.c
> @@ -512,7 +512,7 @@ static int malidp_de_plane_check(struct drm_plane *plane,
>  	int i, ret;
>  	unsigned int block_w, block_h;
>  
> -	if (!state->crtc || !state->fb)
> +	if (!state->crtc || WARN_ON(!state->fb))
>  		return 0;
>  
>  	fb = state->fb;
> -- 
> 2.24.0
> 

-- 
====================
| I would like to |
| fix the world,  |
| but they're not |
| giving me the   |
 \ source code!  /
  ---------------
    ¯\_(ツ)_/¯
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH 05/10] drm/mediatek: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 05/10] drm/mediatek: " Daniel Vetter
@ 2019-12-17  1:13   ` CK Hu
  0 siblings, 0 replies; 18+ messages in thread
From: CK Hu @ 2019-12-17  1:13 UTC (permalink / raw)
  To: Daniel Vetter
  Cc: DRI Development, linux-mediatek, Matthias Brugger, Daniel Vetter,
	linux-arm-kernel

Hi, Daniel:

On Fri, 2019-12-13 at 18:26 +0100, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.

Even though I don't know what is copypasta,

Acked-by: CK Hu <ck.hu@mediatek.com>

> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: CK Hu <ck.hu@mediatek.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Matthias Brugger <matthias.bgg@gmail.com>
> Cc: linux-arm-kernel@lists.infradead.org
> Cc: linux-mediatek@lists.infradead.org
> ---
>  drivers/gpu/drm/mediatek/mtk_drm_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/mediatek/mtk_drm_plane.c b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> index 540ef2faa40a..f0b0325381e0 100644
> --- a/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> +++ b/drivers/gpu/drm/mediatek/mtk_drm_plane.c
> @@ -94,7 +94,7 @@ static int mtk_plane_atomic_check(struct drm_plane *plane,
>  	if (!fb)
>  		return 0;
>  
> -	if (!state->crtc)
> +	if (WARN_ON(!state->crtc))
>  		return 0;
>  
>  	ret = mtk_drm_crtc_plane_check(state->crtc, plane,

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

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

* Re: [PATCH 04/10] drm/malidp: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 04/10] drm/malidp: " Daniel Vetter
@ 2019-12-17 13:11   ` Daniel Vetter
  0 siblings, 0 replies; 18+ messages in thread
From: Daniel Vetter @ 2019-12-17 13:11 UTC (permalink / raw)
  To: DRI Development
  Cc: Daniel Vetter, Sascha Hauer, NXP Linux Team,
	Pengutronix Kernel Team, Daniel Vetter, Shawn Guo,
	linux-arm-kernel

On Fri, Dec 13, 2019 at 06:26:06PM +0100, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Philipp Zabel <p.zabel@pengutronix.de>
> Cc: Shawn Guo <shawnguo@kernel.org>
> Cc: Sascha Hauer <s.hauer@pengutronix.de>
> Cc: Pengutronix Kernel Team <kernel@pengutronix.de>
> Cc: Fabio Estevam <festevam@gmail.com>
> Cc: NXP Linux Team <linux-imx@nxp.com>
> Cc: linux-arm-kernel@lists.infradead.org

Oops, subect should be drm/imx: ofc here.
-Daniel

> ---
>  drivers/gpu/drm/imx/ipuv3-plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/imx/ipuv3-plane.c b/drivers/gpu/drm/imx/ipuv3-plane.c
> index 28826c0aa24a..6776ebb3246d 100644
> --- a/drivers/gpu/drm/imx/ipuv3-plane.c
> +++ b/drivers/gpu/drm/imx/ipuv3-plane.c
> @@ -359,7 +359,7 @@ static int ipu_plane_atomic_check(struct drm_plane *plane,
>  	if (!fb)
>  		return 0;
>  
> -	if (!state->crtc)
> +	if (WARN_ON(!state->crtc))
>  		return -EINVAL;
>  
>  	crtc_state =
> -- 
> 2.24.0
> 

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

* Re: [PATCH 09/10] drm/vkms: plane_state->fb iff plane_state->crtc
  2019-12-13 17:26 ` [PATCH 09/10] drm/vkms: " Daniel Vetter
@ 2020-01-14 23:50   ` Rodrigo Siqueira
  2020-01-15  1:27     ` Sam Ravnborg
  0 siblings, 1 reply; 18+ messages in thread
From: Rodrigo Siqueira @ 2020-01-14 23:50 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Daniel Vetter, DRI Development, Haneen Mohammed

[-- Attachment #1.1: Type: text/plain, Size: 1420 bytes --]

On 12/13, Daniel Vetter wrote:
> Checking both is one too much, so wrap a WARN_ON around it to stope
> the copypasta.
> 
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> Cc: Daniel Vetter <daniel@ffwll.ch>
> ---
>  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> index 5fc8f85aaf3d..6d31265a2ab7 100644
> --- a/drivers/gpu/drm/vkms/vkms_plane.c
> +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
>  	bool can_position = false;
>  	int ret;
>  
> -	if (!state->fb | !state->crtc)
> +	if (!state->fb || WARN_ON(!state->crtc))
>  		return 0;
>  
>  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> -- 
> 2.24.0
>

Hi,

Sorry, the delay in taking a look at this patch.

I tried to find the whole series for getting the context related to this
patch, but I could not find it in my mailbox. Could you shed some light
here? Why check fb and crtc is too much? How the WARN_ON fix the issue?

Best Regards

Ps.: in the commit message: "stope" -> "stop"

-- 
Rodrigo Siqueira
Software Engineer, Advanced Micro Devices (AMD)
https://siqueira.tech

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

* Re: [PATCH 09/10] drm/vkms: plane_state->fb iff plane_state->crtc
  2020-01-14 23:50   ` Rodrigo Siqueira
@ 2020-01-15  1:27     ` Sam Ravnborg
  2020-01-15 23:16       ` Rodrigo Siqueira
  0 siblings, 1 reply; 18+ messages in thread
From: Sam Ravnborg @ 2020-01-15  1:27 UTC (permalink / raw)
  To: Rodrigo Siqueira
  Cc: Daniel Vetter, Haneen Mohammed, DRI Development, Daniel Vetter

Hi Rodrigo.

On Tue, Jan 14, 2020 at 06:50:13PM -0500, Rodrigo Siqueira wrote:
> On 12/13, Daniel Vetter wrote:
> > Checking both is one too much, so wrap a WARN_ON around it to stope
> > the copypasta.
> > 
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > Cc: Daniel Vetter <daniel@ffwll.ch>
> > ---
> >  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> > index 5fc8f85aaf3d..6d31265a2ab7 100644
> > --- a/drivers/gpu/drm/vkms/vkms_plane.c
> > +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> > @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
> >  	bool can_position = false;
> >  	int ret;
> >  
> > -	if (!state->fb | !state->crtc)
> > +	if (!state->fb || WARN_ON(!state->crtc))
> >  		return 0;
> >  
> >  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> > -- 
> > 2.24.0
> >
> 
> Hi,
> 
> Sorry, the delay in taking a look at this patch.
> 
> I tried to find the whole series for getting the context related to this
> patch, but I could not find it in my mailbox. Could you shed some light
> here? Why check fb and crtc is too much? How the WARN_ON fix the issue?

You can find some background in the first patch:
https://lists.freedesktop.org/archives/dri-devel/2019-December/248981.html

Hope this sched enough light on the topic.

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

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

* Re: [PATCH 09/10] drm/vkms: plane_state->fb iff plane_state->crtc
  2020-01-15  1:27     ` Sam Ravnborg
@ 2020-01-15 23:16       ` Rodrigo Siqueira
  0 siblings, 0 replies; 18+ messages in thread
From: Rodrigo Siqueira @ 2020-01-15 23:16 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: Daniel Vetter, Haneen Mohammed, DRI Development, Daniel Vetter

[-- Attachment #1.1: Type: text/plain, Size: 1982 bytes --]

Hi Sam,

On 01/15, Sam Ravnborg wrote:
> Hi Rodrigo.
> 
> On Tue, Jan 14, 2020 at 06:50:13PM -0500, Rodrigo Siqueira wrote:
> > On 12/13, Daniel Vetter wrote:
> > > Checking both is one too much, so wrap a WARN_ON around it to stope
> > > the copypasta.
> > > 
> > > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > > Cc: Rodrigo Siqueira <rodrigosiqueiramelo@gmail.com>
> > > Cc: Haneen Mohammed <hamohammed.sa@gmail.com>
> > > Cc: Daniel Vetter <daniel@ffwll.ch>
> > > ---
> > >  drivers/gpu/drm/vkms/vkms_plane.c | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > 
> > > diff --git a/drivers/gpu/drm/vkms/vkms_plane.c b/drivers/gpu/drm/vkms/vkms_plane.c
> > > index 5fc8f85aaf3d..6d31265a2ab7 100644
> > > --- a/drivers/gpu/drm/vkms/vkms_plane.c
> > > +++ b/drivers/gpu/drm/vkms/vkms_plane.c
> > > @@ -117,7 +117,7 @@ static int vkms_plane_atomic_check(struct drm_plane *plane,
> > >  	bool can_position = false;
> > >  	int ret;
> > >  
> > > -	if (!state->fb | !state->crtc)
> > > +	if (!state->fb || WARN_ON(!state->crtc))
> > >  		return 0;
> > >  
> > >  	crtc_state = drm_atomic_get_crtc_state(state->state, state->crtc);
> > > -- 
> > > 2.24.0
> > >
> > 
> > Hi,
> > 
> > Sorry, the delay in taking a look at this patch.
> > 
> > I tried to find the whole series for getting the context related to this
> > patch, but I could not find it in my mailbox. Could you shed some light
> > here? Why check fb and crtc is too much? How the WARN_ON fix the issue?
> 
> You can find some background in the first patch:
> https://lists.freedesktop.org/archives/dri-devel/2019-December/248981.html

Thanks for the link.

Reviewed-by: Rodrigo Siqueira <rodrigosiqueira@gmail.com>
Tested-by: Rodrigo Siqueira <rodrigosiqueira@gmail.com>

Best Regards
 
> Hope this sched enough light on the topic.
> 
> 	Sam

-- 
Rodrigo Siqueira
Software Engineer, Advanced Micro Devices (AMD)
https://siqueira.tech

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

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

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

end of thread, back to index

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-13 17:26 [PATCH 01/10] drm/todo: Add item for the plane->atomic_check confusion Daniel Vetter
2019-12-13 17:26 ` [PATCH 02/10] drm/malidp: plane_state->fb iff plane_state->crtc Daniel Vetter
2019-12-16  9:19   ` Liviu Dudau
2019-12-13 17:26 ` [PATCH 03/10] drm/atmel: " Daniel Vetter
2019-12-13 19:53   ` Sam Ravnborg
2019-12-13 17:26 ` [PATCH 04/10] drm/malidp: " Daniel Vetter
2019-12-17 13:11   ` Daniel Vetter
2019-12-13 17:26 ` [PATCH 05/10] drm/mediatek: " Daniel Vetter
2019-12-17  1:13   ` CK Hu
2019-12-13 17:26 ` [PATCH 06/10] drm/xrockchip: " Daniel Vetter
2019-12-13 18:03   ` Heiko Stübner
2019-12-13 17:26 ` [PATCH 07/10] drm/vc4: " Daniel Vetter
2019-12-13 17:26 ` [PATCH 08/10] drm/virtio: " Daniel Vetter
2019-12-13 17:26 ` [PATCH 09/10] drm/vkms: " Daniel Vetter
2020-01-14 23:50   ` Rodrigo Siqueira
2020-01-15  1:27     ` Sam Ravnborg
2020-01-15 23:16       ` Rodrigo Siqueira
2019-12-13 17:26 ` [PATCH 10/10] drm/zte: " Daniel Vetter

dri-devel Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/dri-devel/0 dri-devel/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 dri-devel dri-devel/ https://lore.kernel.org/dri-devel \
		dri-devel@lists.freedesktop.org
	public-inbox-index dri-devel

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.freedesktop.lists.dri-devel


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git