stable.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback
       [not found] <20200516215057.392609-1-paul@crapouillou.net>
@ 2020-05-16 21:50 ` Paul Cercueil
  2020-05-17  6:17   ` Sam Ravnborg
  2020-05-16 21:50 ` [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type Paul Cercueil
  2020-05-16 21:50 ` [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index Paul Cercueil
  2 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2020-05-16 21:50 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki
  Cc: od, dri-devel, devicetree, linux-kernel, Paul Cercueil, stable

The code was comparing the SoC's maximum height with the mode's width,
and vice-versa. D'oh.

Cc: stable@vger.kernel.org # v5.6
Fixes: a7c909b7c037 ("gpu/drm: ingenic: Check for display size in CRTC atomic check")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---

Notes:
    This patch was previously sent standalone.
    I marked it as superseded in patchwork.
    Nothing has been changed here.

 drivers/gpu/drm/ingenic/ingenic-drm.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 632d72177123..0c472382a08b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -330,8 +330,8 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,
 	if (!drm_atomic_crtc_needs_modeset(state))
 		return 0;
 
-	if (state->mode.hdisplay > priv->soc_info->max_height ||
-	    state->mode.vdisplay > priv->soc_info->max_width)
+	if (state->mode.hdisplay > priv->soc_info->max_width ||
+	    state->mode.vdisplay > priv->soc_info->max_height)
 		return -EINVAL;
 
 	rate = clk_round_rate(priv->pix_clk,
-- 
2.26.2


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

* [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type
       [not found] <20200516215057.392609-1-paul@crapouillou.net>
  2020-05-16 21:50 ` [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback Paul Cercueil
@ 2020-05-16 21:50 ` Paul Cercueil
  2020-05-17  6:21   ` Sam Ravnborg
  2020-05-16 21:50 ` [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index Paul Cercueil
  2 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2020-05-16 21:50 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki
  Cc: od, dri-devel, devicetree, linux-kernel, Paul Cercueil, stable

The opaque pointer passed to the IRQ handler is a pointer to the
drm_device, not a pointer to our ingenic_drm structure.

It still worked, because our ingenic_drm structure contains the
drm_device as its first field, so the pointer received had the same
value, but this was not semantically correct.

Cc: stable@vger.kernel.org # v5.3
Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 0c472382a08b..97244462599b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -476,7 +476,7 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
 
 static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg)
 {
-	struct ingenic_drm *priv = arg;
+	struct ingenic_drm *priv = drm_device_get_priv(arg);
 	unsigned int state;
 
 	regmap_read(priv->map, JZ_REG_LCD_STATE, &state);
-- 
2.26.2


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

* [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index
       [not found] <20200516215057.392609-1-paul@crapouillou.net>
  2020-05-16 21:50 ` [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback Paul Cercueil
  2020-05-16 21:50 ` [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type Paul Cercueil
@ 2020-05-16 21:50 ` Paul Cercueil
  2020-05-19 11:49   ` Sasha Levin
  2 siblings, 1 reply; 8+ messages in thread
From: Paul Cercueil @ 2020-05-16 21:50 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki
  Cc: od, dri-devel, devicetree, linux-kernel, Paul Cercueil, stable

plane->index is NOT the index of the color plane in a YUV frame.
Actually, a YUV frame is represented by a single drm_plane, even though
it contains three Y, U, V planes.

Cc: stable@vger.kernel.org # v5.3
Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs")
Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 97244462599b..3207105755c9 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -386,7 +386,7 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 		addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
 		width = state->src_w >> 16;
 		height = state->src_h >> 16;
-		cpp = state->fb->format->cpp[plane->index];
+		cpp = state->fb->format->cpp[0];
 
 		priv->dma_hwdesc->addr = addr;
 		priv->dma_hwdesc->cmd = width * height * cpp / 4;
-- 
2.26.2


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

* Re: [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback
  2020-05-16 21:50 ` [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback Paul Cercueil
@ 2020-05-17  6:17   ` Sam Ravnborg
  2020-05-17 12:19     ` Paul Cercueil
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2020-05-17  6:17 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki, devicetree, linux-kernel, stable, od,
	dri-devel

On Sat, May 16, 2020 at 11:50:49PM +0200, Paul Cercueil wrote:
> The code was comparing the SoC's maximum height with the mode's width,
> and vice-versa. D'oh.
> 
> Cc: stable@vger.kernel.org # v5.6
> Fixes: a7c909b7c037 ("gpu/drm: ingenic: Check for display size in CRTC atomic check")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>

Looks correct.
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
> 
> Notes:
>     This patch was previously sent standalone.
>     I marked it as superseded in patchwork.
>     Nothing has been changed here.
> 
>  drivers/gpu/drm/ingenic/ingenic-drm.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
> index 632d72177123..0c472382a08b 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
> @@ -330,8 +330,8 @@ static int ingenic_drm_crtc_atomic_check(struct drm_crtc *crtc,
>  	if (!drm_atomic_crtc_needs_modeset(state))
>  		return 0;
>  
> -	if (state->mode.hdisplay > priv->soc_info->max_height ||
> -	    state->mode.vdisplay > priv->soc_info->max_width)
> +	if (state->mode.hdisplay > priv->soc_info->max_width ||
> +	    state->mode.vdisplay > priv->soc_info->max_height)
>  		return -EINVAL;
>  
>  	rate = clk_round_rate(priv->pix_clk,
> -- 
> 2.26.2
> 
> _______________________________________________
> 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

* Re: [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type
  2020-05-16 21:50 ` [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type Paul Cercueil
@ 2020-05-17  6:21   ` Sam Ravnborg
  2020-05-17 12:19     ` Paul Cercueil
  0 siblings, 1 reply; 8+ messages in thread
From: Sam Ravnborg @ 2020-05-17  6:21 UTC (permalink / raw)
  To: Paul Cercueil
  Cc: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki, devicetree, linux-kernel, stable, od,
	dri-devel

On Sat, May 16, 2020 at 11:50:50PM +0200, Paul Cercueil wrote:
> The opaque pointer passed to the IRQ handler is a pointer to the
> drm_device, not a pointer to our ingenic_drm structure.
> 
> It still worked, because our ingenic_drm structure contains the
> drm_device as its first field, so the pointer received had the same
> value, but this was not semantically correct.
> 
> Cc: stable@vger.kernel.org # v5.3
> Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs")
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Sam Ravnborg <sam@ravnborg.org>
> ---
>  drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
> index 0c472382a08b..97244462599b 100644
> --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
> +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
> @@ -476,7 +476,7 @@ static int ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
>  
>  static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg)
>  {
> -	struct ingenic_drm *priv = arg;
> +	struct ingenic_drm *priv = drm_device_get_priv(arg);
>  	unsigned int state;
>  
>  	regmap_read(priv->map, JZ_REG_LCD_STATE, &state);
> -- 
> 2.26.2
> 
> _______________________________________________
> 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

* Re: [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback
  2020-05-17  6:17   ` Sam Ravnborg
@ 2020-05-17 12:19     ` Paul Cercueil
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Cercueil @ 2020-05-17 12:19 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki, devicetree, linux-kernel, stable, od,
	dri-devel

Hi Sam,

Le dim. 17 mai 2020 à 8:17, Sam Ravnborg <sam@ravnborg.org> a écrit :
> On Sat, May 16, 2020 at 11:50:49PM +0200, Paul Cercueil wrote:
>>  The code was comparing the SoC's maximum height with the mode's 
>> width,
>>  and vice-versa. D'oh.
>> 
>>  Cc: stable@vger.kernel.org # v5.6
>>  Fixes: a7c909b7c037 ("gpu/drm: ingenic: Check for display size in 
>> CRTC atomic check")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> 
> Looks correct.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Pushed to drm-misc-fixes, thanks for the review.

-Paul

>>  ---
>> 
>>  Notes:
>>      This patch was previously sent standalone.
>>      I marked it as superseded in patchwork.
>>      Nothing has been changed here.
>> 
>>   drivers/gpu/drm/ingenic/ingenic-drm.c | 4 ++--
>>   1 file changed, 2 insertions(+), 2 deletions(-)
>> 
>>  diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c 
>> b/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  index 632d72177123..0c472382a08b 100644
>>  --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  @@ -330,8 +330,8 @@ static int ingenic_drm_crtc_atomic_check(struct 
>> drm_crtc *crtc,
>>   	if (!drm_atomic_crtc_needs_modeset(state))
>>   		return 0;
>> 
>>  -	if (state->mode.hdisplay > priv->soc_info->max_height ||
>>  -	    state->mode.vdisplay > priv->soc_info->max_width)
>>  +	if (state->mode.hdisplay > priv->soc_info->max_width ||
>>  +	    state->mode.vdisplay > priv->soc_info->max_height)
>>   		return -EINVAL;
>> 
>>   	rate = clk_round_rate(priv->pix_clk,
>>  --
>>  2.26.2
>> 
>>  _______________________________________________
>>  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

* Re: [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type
  2020-05-17  6:21   ` Sam Ravnborg
@ 2020-05-17 12:19     ` Paul Cercueil
  0 siblings, 0 replies; 8+ messages in thread
From: Paul Cercueil @ 2020-05-17 12:19 UTC (permalink / raw)
  To: Sam Ravnborg
  Cc: David Airlie, Daniel Vetter, Rob Herring, Greg Kroah-Hartman,
	Rafael J . Wysocki, devicetree, linux-kernel, stable, od,
	dri-devel

Hi Sam,

Le dim. 17 mai 2020 à 8:21, Sam Ravnborg <sam@ravnborg.org> a écrit :
> On Sat, May 16, 2020 at 11:50:50PM +0200, Paul Cercueil wrote:
>>  The opaque pointer passed to the IRQ handler is a pointer to the
>>  drm_device, not a pointer to our ingenic_drm structure.
>> 
>>  It still worked, because our ingenic_drm structure contains the
>>  drm_device as its first field, so the pointer received had the same
>>  value, but this was not semantically correct.
>> 
>>  Cc: stable@vger.kernel.org # v5.3
>>  Fixes: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx 
>> SoCs")
>>  Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Pushed to drm-misc-fixes, thanks for the review.

-Paul

>>  ---
>>   drivers/gpu/drm/ingenic/ingenic-drm.c | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>> 
>>  diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c 
>> b/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  index 0c472382a08b..97244462599b 100644
>>  --- a/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  +++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
>>  @@ -476,7 +476,7 @@ static int 
>> ingenic_drm_encoder_atomic_check(struct drm_encoder *encoder,
>> 
>>   static irqreturn_t ingenic_drm_irq_handler(int irq, void *arg)
>>   {
>>  -	struct ingenic_drm *priv = arg;
>>  +	struct ingenic_drm *priv = drm_device_get_priv(arg);
>>   	unsigned int state;
>> 
>>   	regmap_read(priv->map, JZ_REG_LCD_STATE, &state);
>>  --
>>  2.26.2
>> 
>>  _______________________________________________
>>  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

* Re: [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index
  2020-05-16 21:50 ` [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index Paul Cercueil
@ 2020-05-19 11:49   ` Sasha Levin
  0 siblings, 0 replies; 8+ messages in thread
From: Sasha Levin @ 2020-05-19 11:49 UTC (permalink / raw)
  To: Sasha Levin, Paul Cercueil, David Airlie, Daniel Vetter
  Cc: od, dri-devel, stable

Hi

[This is an automated email]

This commit has been processed because it contains a "Fixes:" tag
fixing commit: 90b86fcc47b4 ("DRM: Add KMS driver for the Ingenic JZ47xx SoCs").

The bot has tested the following trees: v5.6.13, v5.4.41.

v5.6.13: Build OK!
v5.4.41: Failed to apply! Possible dependencies:
    52e4607dace1 ("gpu/drm: ingenic: Use the plane's src_[x,y] to configure DMA length")


NOTE: The patch will not be queued to stable trees until it is upstream.

How should we proceed with this patch?

-- 
Thanks
Sasha

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

end of thread, other threads:[~2020-05-19 11:49 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <20200516215057.392609-1-paul@crapouillou.net>
2020-05-16 21:50 ` [PATCH 04/12] gpu/drm: ingenic: Fix bogus crtc_atomic_check callback Paul Cercueil
2020-05-17  6:17   ` Sam Ravnborg
2020-05-17 12:19     ` Paul Cercueil
2020-05-16 21:50 ` [PATCH 05/12] gpu/drm: Ingenic: Fix opaque pointer casted to wrong type Paul Cercueil
2020-05-17  6:21   ` Sam Ravnborg
2020-05-17 12:19     ` Paul Cercueil
2020-05-16 21:50 ` [PATCH 06/12] gpu/drm: Ingenic: Fix incorrect assumption about plane->index Paul Cercueil
2020-05-19 11:49   ` Sasha Levin

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).