All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-10 14:41 ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter
  Cc: dri-devel, linux-kernel, Paul Cercueil, Rob Herring

Add a compatible string for the LCD controller found in the JZ4770 SoC.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/display/ingenic,lcd.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
index 7b536c8c6dde..01e3261defb6 100644
--- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
+++ b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
@@ -4,6 +4,7 @@ Required properties:
 - compatible: one of:
   * ingenic,jz4740-lcd
   * ingenic,jz4725b-lcd
+  * ingenic,jz4770-lcd
 - reg: LCD registers location and length
 - clocks: LCD pixclock and device clock specifiers.
 	   The device clock is only required on the JZ4740.
-- 
2.24.0


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

* [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-10 14:41 ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

Add a compatible string for the LCD controller found in the JZ4770 SoC.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Acked-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/display/ingenic,lcd.txt | 1 +
 1 file changed, 1 insertion(+)

diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
index 7b536c8c6dde..01e3261defb6 100644
--- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
+++ b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
@@ -4,6 +4,7 @@ Required properties:
 - compatible: one of:
   * ingenic,jz4740-lcd
   * ingenic,jz4725b-lcd
+  * ingenic,jz4770-lcd
 - reg: LCD registers location and length
 - clocks: LCD pixclock and device clock specifiers.
 	   The device clock is only required on the JZ4740.
-- 
2.24.0

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

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

* [PATCH v2 2/6] gpu/drm: ingenic: Avoid null pointer deference in plane atomic update
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-10 14:41   ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: dri-devel, linux-kernel, Paul Cercueil

It is possible that there is no drm_framebuffer associated with a given
plane state.

v2: Handle drm_plane->state which can be NULL too

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 2e2ed653e9c6..f156f245fdec 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -371,14 +371,18 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 	struct ingenic_drm *priv = drm_plane_get_priv(plane);
 	struct drm_plane_state *state = plane->state;
 	unsigned int width, height, cpp;
+	dma_addr_t addr;
 
-	width = state->crtc->state->adjusted_mode.hdisplay;
-	height = state->crtc->state->adjusted_mode.vdisplay;
-	cpp = state->fb->format->cpp[plane->index];
+	if (state && state->fb) {
+		addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
+		width = state->crtc->state->adjusted_mode.hdisplay;
+		height = state->crtc->state->adjusted_mode.vdisplay;
+		cpp = state->fb->format->cpp[plane->index];
 
-	priv->dma_hwdesc->addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
-	priv->dma_hwdesc->cmd = width * height * cpp / 4;
-	priv->dma_hwdesc->cmd |= JZ_LCD_CMD_EOF_IRQ;
+		priv->dma_hwdesc->addr = addr;
+		priv->dma_hwdesc->cmd = width * height * cpp / 4;
+		priv->dma_hwdesc->cmd |= JZ_LCD_CMD_EOF_IRQ;
+	}
 }
 
 static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder,
-- 
2.24.0


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

* [PATCH v2 2/6] gpu/drm: ingenic: Avoid null pointer deference in plane atomic update
@ 2019-12-10 14:41   ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

It is possible that there is no drm_framebuffer associated with a given
plane state.

v2: Handle drm_plane->state which can be NULL too

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 16 ++++++++++------
 1 file changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index 2e2ed653e9c6..f156f245fdec 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -371,14 +371,18 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 	struct ingenic_drm *priv = drm_plane_get_priv(plane);
 	struct drm_plane_state *state = plane->state;
 	unsigned int width, height, cpp;
+	dma_addr_t addr;
 
-	width = state->crtc->state->adjusted_mode.hdisplay;
-	height = state->crtc->state->adjusted_mode.vdisplay;
-	cpp = state->fb->format->cpp[plane->index];
+	if (state && state->fb) {
+		addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
+		width = state->crtc->state->adjusted_mode.hdisplay;
+		height = state->crtc->state->adjusted_mode.vdisplay;
+		cpp = state->fb->format->cpp[plane->index];
 
-	priv->dma_hwdesc->addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
-	priv->dma_hwdesc->cmd = width * height * cpp / 4;
-	priv->dma_hwdesc->cmd |= JZ_LCD_CMD_EOF_IRQ;
+		priv->dma_hwdesc->addr = addr;
+		priv->dma_hwdesc->cmd = width * height * cpp / 4;
+		priv->dma_hwdesc->cmd |= JZ_LCD_CMD_EOF_IRQ;
+	}
 }
 
 static void ingenic_drm_encoder_atomic_mode_set(struct drm_encoder *encoder,
-- 
2.24.0

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

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

* [PATCH v2 3/6] gpu/drm: ingenic: Use the plane's src_[x,y] to configure DMA length
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-10 14:41   ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: dri-devel, linux-kernel, Paul Cercueil

Instead of obtaining the width/height of the framebuffer from the CRTC
state, obtain it from the current plane state.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 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 f156f245fdec..8713f09df448 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -375,8 +375,8 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 
 	if (state && state->fb) {
 		addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
-		width = state->crtc->state->adjusted_mode.hdisplay;
-		height = state->crtc->state->adjusted_mode.vdisplay;
+		width = state->src_w >> 16;
+		height = state->src_h >> 16;
 		cpp = state->fb->format->cpp[plane->index];
 
 		priv->dma_hwdesc->addr = addr;
-- 
2.24.0


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

* [PATCH v2 3/6] gpu/drm: ingenic: Use the plane's src_[x, y] to configure DMA length
@ 2019-12-10 14:41   ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

Instead of obtaining the width/height of the framebuffer from the CRTC
state, obtain it from the current plane state.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 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 f156f245fdec..8713f09df448 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -375,8 +375,8 @@ static void ingenic_drm_plane_atomic_update(struct drm_plane *plane,
 
 	if (state && state->fb) {
 		addr = drm_fb_cma_get_gem_addr(state->fb, state, 0);
-		width = state->crtc->state->adjusted_mode.hdisplay;
-		height = state->crtc->state->adjusted_mode.vdisplay;
+		width = state->src_w >> 16;
+		height = state->src_h >> 16;
 		cpp = state->fb->format->cpp[plane->index];
 
 		priv->dma_hwdesc->addr = addr;
-- 
2.24.0

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

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

* [PATCH v2 4/6] gpu/drm: ingenic: Set max FB height to 4095
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-10 14:41   ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: dri-devel, linux-kernel, Paul Cercueil

While the LCD controller can effectively only support a maximum
resolution of 800x600, the framebuffer's height can be much higher,
since we can change the Y start offset.

v2: No change

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 8713f09df448..cef2f29a9d7a 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -636,7 +636,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	drm->mode_config.min_width = 0;
 	drm->mode_config.min_height = 0;
 	drm->mode_config.max_width = 800;
-	drm->mode_config.max_height = 600;
+	drm->mode_config.max_height = 4095;
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 
 	base = devm_platform_ioremap_resource(pdev, 0);
-- 
2.24.0


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

* [PATCH v2 4/6] gpu/drm: ingenic: Set max FB height to 4095
@ 2019-12-10 14:41   ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

While the LCD controller can effectively only support a maximum
resolution of 800x600, the framebuffer's height can be much higher,
since we can change the Y start offset.

v2: No change

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 8713f09df448..cef2f29a9d7a 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -636,7 +636,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	drm->mode_config.min_width = 0;
 	drm->mode_config.min_height = 0;
 	drm->mode_config.max_width = 800;
-	drm->mode_config.max_height = 600;
+	drm->mode_config.max_height = 4095;
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 
 	base = devm_platform_ioremap_resource(pdev, 0);
-- 
2.24.0

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

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

* [PATCH v2 5/6] gpu/drm: ingenic: Check for display size in CRTC atomic check
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-10 14:41   ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: dri-devel, linux-kernel, Paul Cercueil

Check that the requested display size isn't above the limits supported
by the CRTC.

- JZ4750 and older support up to 800x600;
- JZ4755 supports up to 1024x576;
- JZ4760 and JZ4770 support up to 720p;
- JZ4780 supports up to 2k.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index cef2f29a9d7a..da681214d0b6 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -152,6 +152,7 @@ struct ingenic_dma_hwdesc {
 
 struct jz_soc_info {
 	bool needs_dev_clk;
+	unsigned int max_width, max_height;
 };
 
 struct ingenic_drm {
@@ -163,6 +164,7 @@ struct ingenic_drm {
 	struct device *dev;
 	struct regmap *map;
 	struct clk *lcd_clk, *pix_clk;
+	const struct jz_soc_info *soc_info;
 
 	struct ingenic_dma_hwdesc *dma_hwdesc;
 	dma_addr_t dma_hwdesc_phys;
@@ -325,6 +327,10 @@ 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)
+		return -EINVAL;
+
 	rate = clk_round_rate(priv->pix_clk,
 			      state->adjusted_mode.clock * 1000);
 	if (rate < 0)
@@ -620,6 +626,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
+	priv->soc_info = soc_info;
 	priv->dev = dev;
 	drm = &priv->drm;
 	drm->dev_private = priv;
@@ -635,7 +642,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	drm_mode_config_init(drm);
 	drm->mode_config.min_width = 0;
 	drm->mode_config.min_height = 0;
-	drm->mode_config.max_width = 800;
+	drm->mode_config.max_width = soc_info->max_width;
 	drm->mode_config.max_height = 4095;
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 
@@ -813,10 +820,14 @@ static int ingenic_drm_remove(struct platform_device *pdev)
 
 static const struct jz_soc_info jz4740_soc_info = {
 	.needs_dev_clk = true,
+	.max_width = 800,
+	.max_height = 600,
 };
 
 static const struct jz_soc_info jz4725b_soc_info = {
 	.needs_dev_clk = false,
+	.max_width = 800,
+	.max_height = 600,
 };
 
 static const struct of_device_id ingenic_drm_of_match[] = {
-- 
2.24.0


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

* [PATCH v2 5/6] gpu/drm: ingenic: Check for display size in CRTC atomic check
@ 2019-12-10 14:41   ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

Check that the requested display size isn't above the limits supported
by the CRTC.

- JZ4750 and older support up to 800x600;
- JZ4755 supports up to 1024x576;
- JZ4760 and JZ4770 support up to 720p;
- JZ4780 supports up to 2k.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 13 ++++++++++++-
 1 file changed, 12 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index cef2f29a9d7a..da681214d0b6 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -152,6 +152,7 @@ struct ingenic_dma_hwdesc {
 
 struct jz_soc_info {
 	bool needs_dev_clk;
+	unsigned int max_width, max_height;
 };
 
 struct ingenic_drm {
@@ -163,6 +164,7 @@ struct ingenic_drm {
 	struct device *dev;
 	struct regmap *map;
 	struct clk *lcd_clk, *pix_clk;
+	const struct jz_soc_info *soc_info;
 
 	struct ingenic_dma_hwdesc *dma_hwdesc;
 	dma_addr_t dma_hwdesc_phys;
@@ -325,6 +327,10 @@ 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)
+		return -EINVAL;
+
 	rate = clk_round_rate(priv->pix_clk,
 			      state->adjusted_mode.clock * 1000);
 	if (rate < 0)
@@ -620,6 +626,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	if (!priv)
 		return -ENOMEM;
 
+	priv->soc_info = soc_info;
 	priv->dev = dev;
 	drm = &priv->drm;
 	drm->dev_private = priv;
@@ -635,7 +642,7 @@ static int ingenic_drm_probe(struct platform_device *pdev)
 	drm_mode_config_init(drm);
 	drm->mode_config.min_width = 0;
 	drm->mode_config.min_height = 0;
-	drm->mode_config.max_width = 800;
+	drm->mode_config.max_width = soc_info->max_width;
 	drm->mode_config.max_height = 4095;
 	drm->mode_config.funcs = &ingenic_drm_mode_config_funcs;
 
@@ -813,10 +820,14 @@ static int ingenic_drm_remove(struct platform_device *pdev)
 
 static const struct jz_soc_info jz4740_soc_info = {
 	.needs_dev_clk = true,
+	.max_width = 800,
+	.max_height = 600,
 };
 
 static const struct jz_soc_info jz4725b_soc_info = {
 	.needs_dev_clk = false,
+	.max_width = 800,
+	.max_height = 600,
 };
 
 static const struct of_device_id ingenic_drm_of_match[] = {
-- 
2.24.0

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

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

* [PATCH v2 6/6] gpu/drm: ingenic: Add support for the JZ4770
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-10 14:41   ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: dri-devel, linux-kernel, Paul Cercueil

The LCD controller in the JZ4770 supports up to 720p. While there has
been many new features added since the old JZ4740, which are not yet
handled here, this driver still works fine.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index da681214d0b6..daa3dbeb736b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -830,9 +830,16 @@ static const struct jz_soc_info jz4725b_soc_info = {
 	.max_height = 600,
 };
 
+static const struct jz_soc_info jz4770_soc_info = {
+	.needs_dev_clk = false,
+	.max_width = 1280,
+	.max_height = 720,
+};
+
 static const struct of_device_id ingenic_drm_of_match[] = {
 	{ .compatible = "ingenic,jz4740-lcd", .data = &jz4740_soc_info },
 	{ .compatible = "ingenic,jz4725b-lcd", .data = &jz4725b_soc_info },
+	{ .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
 	{ /* sentinel */ },
 };
 
-- 
2.24.0


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

* [PATCH v2 6/6] gpu/drm: ingenic: Add support for the JZ4770
@ 2019-12-10 14:41   ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-10 14:41 UTC (permalink / raw)
  To: David Airlie, Daniel Vetter; +Cc: Paul Cercueil, linux-kernel, dri-devel

The LCD controller in the JZ4770 supports up to 720p. While there has
been many new features added since the old JZ4740, which are not yet
handled here, this driver still works fine.

v2: No change

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
---
 drivers/gpu/drm/ingenic/ingenic-drm.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/ingenic/ingenic-drm.c b/drivers/gpu/drm/ingenic/ingenic-drm.c
index da681214d0b6..daa3dbeb736b 100644
--- a/drivers/gpu/drm/ingenic/ingenic-drm.c
+++ b/drivers/gpu/drm/ingenic/ingenic-drm.c
@@ -830,9 +830,16 @@ static const struct jz_soc_info jz4725b_soc_info = {
 	.max_height = 600,
 };
 
+static const struct jz_soc_info jz4770_soc_info = {
+	.needs_dev_clk = false,
+	.max_width = 1280,
+	.max_height = 720,
+};
+
 static const struct of_device_id ingenic_drm_of_match[] = {
 	{ .compatible = "ingenic,jz4740-lcd", .data = &jz4740_soc_info },
 	{ .compatible = "ingenic,jz4725b-lcd", .data = &jz4725b_soc_info },
+	{ .compatible = "ingenic,jz4770-lcd", .data = &jz4770_soc_info },
 	{ /* sentinel */ },
 };
 
-- 
2.24.0

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

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
  2019-12-10 14:41 ` Paul Cercueil
@ 2019-12-14 10:54   ` Sam Ravnborg
  -1 siblings, 0 replies; 20+ messages in thread
From: Sam Ravnborg @ 2019-12-14 10:54 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: David Airlie, Daniel Vetter, linux-kernel, dri-devel

Hi Paul.

On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> Add a compatible string for the LCD controller found in the JZ4770 SoC.
> 
> v2: No change
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Acked-by: Rob Herring <robh@kernel.org>

Whole series looks good.
Acked-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  Documentation/devicetree/bindings/display/ingenic,lcd.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> index 7b536c8c6dde..01e3261defb6 100644
> --- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> +++ b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> @@ -4,6 +4,7 @@ Required properties:
>  - compatible: one of:
>    * ingenic,jz4740-lcd
>    * ingenic,jz4725b-lcd
> +  * ingenic,jz4770-lcd
>  - reg: LCD registers location and length
>  - clocks: LCD pixclock and device clock specifiers.
>  	   The device clock is only required on the JZ4740.
> -- 
> 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] 20+ messages in thread

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-14 10:54   ` Sam Ravnborg
  0 siblings, 0 replies; 20+ messages in thread
From: Sam Ravnborg @ 2019-12-14 10:54 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: David Airlie, dri-devel, linux-kernel

Hi Paul.

On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> Add a compatible string for the LCD controller found in the JZ4770 SoC.
> 
> v2: No change
> 
> Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> Acked-by: Rob Herring <robh@kernel.org>

Whole series looks good.
Acked-by: Sam Ravnborg <sam@ravnborg.org>

> ---
>  Documentation/devicetree/bindings/display/ingenic,lcd.txt | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/Documentation/devicetree/bindings/display/ingenic,lcd.txt b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> index 7b536c8c6dde..01e3261defb6 100644
> --- a/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> +++ b/Documentation/devicetree/bindings/display/ingenic,lcd.txt
> @@ -4,6 +4,7 @@ Required properties:
>  - compatible: one of:
>    * ingenic,jz4740-lcd
>    * ingenic,jz4725b-lcd
> +  * ingenic,jz4770-lcd
>  - reg: LCD registers location and length
>  - clocks: LCD pixclock and device clock specifiers.
>  	   The device clock is only required on the JZ4740.
> -- 
> 2.24.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
  2019-12-14 10:54   ` Sam Ravnborg
@ 2019-12-16 13:15     ` Ville Syrjälä
  -1 siblings, 0 replies; 20+ messages in thread
From: Ville Syrjälä @ 2019-12-16 13:15 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Paul Cercueil, David Airlie, dri-devel, linux-kernel

On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
> Hi Paul.
> 
> On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> > Add a compatible string for the LCD controller found in the JZ4770 SoC.
> > 
> > v2: No change
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Acked-by: Rob Herring <robh@kernel.org>
> 
> Whole series looks good.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Paul, looks like you forgot to git commit --amend after adding the tags.
Now the commit messages have and extra "# *** extracted tags ***" in them.

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-16 13:15     ` Ville Syrjälä
  0 siblings, 0 replies; 20+ messages in thread
From: Ville Syrjälä @ 2019-12-16 13:15 UTC (permalink / raw)
  To: Sam Ravnborg; +Cc: Paul Cercueil, David Airlie, linux-kernel, dri-devel

On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
> Hi Paul.
> 
> On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> > Add a compatible string for the LCD controller found in the JZ4770 SoC.
> > 
> > v2: No change
> > 
> > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> > Acked-by: Rob Herring <robh@kernel.org>
> 
> Whole series looks good.
> Acked-by: Sam Ravnborg <sam@ravnborg.org>

Paul, looks like you forgot to git commit --amend after adding the tags.
Now the commit messages have and extra "# *** extracted tags ***" in them.

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
  2019-12-16 13:15     ` Ville Syrjälä
@ 2019-12-16 13:39       ` Paul Cercueil
  -1 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-16 13:39 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: Sam Ravnborg, David Airlie, dri-devel, linux-kernel

Hi Ville,


Le lun., déc. 16, 2019 at 15:15, Ville Syrjälä 
<ville.syrjala@linux.intel.com> a écrit :
> On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
>>  Hi Paul.
>> 
>>  On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
>>  > Add a compatible string for the LCD controller found in the 
>> JZ4770 SoC.
>>  >
>>  > v2: No change
>>  >
>>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  > Acked-by: Rob Herring <robh@kernel.org>
>> 
>>  Whole series looks good.
>>  Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> Paul, looks like you forgot to git commit --amend after adding the 
> tags.
> Now the commit messages have and extra "# *** extracted tags ***" in 
> them.

Sorry, I'm still relatively new to this :(

I thought they were going to be automatically removed since they are 
comments.

-Paul



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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-16 13:39       ` Paul Cercueil
  0 siblings, 0 replies; 20+ messages in thread
From: Paul Cercueil @ 2019-12-16 13:39 UTC (permalink / raw)
  To: Ville Syrjälä
  Cc: David Airlie, Sam Ravnborg, linux-kernel, dri-devel

Hi Ville,


Le lun., déc. 16, 2019 at 15:15, Ville Syrjälä 
<ville.syrjala@linux.intel.com> a écrit :
> On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
>>  Hi Paul.
>> 
>>  On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
>>  > Add a compatible string for the LCD controller found in the 
>> JZ4770 SoC.
>>  >
>>  > v2: No change
>>  >
>>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
>>  > Acked-by: Rob Herring <robh@kernel.org>
>> 
>>  Whole series looks good.
>>  Acked-by: Sam Ravnborg <sam@ravnborg.org>
> 
> Paul, looks like you forgot to git commit --amend after adding the 
> tags.
> Now the commit messages have and extra "# *** extracted tags ***" in 
> them.

Sorry, I'm still relatively new to this :(

I thought they were going to be automatically removed since they are 
comments.

-Paul


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

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
  2019-12-16 13:39       ` Paul Cercueil
@ 2019-12-16 14:43         ` Ville Syrjälä
  -1 siblings, 0 replies; 20+ messages in thread
From: Ville Syrjälä @ 2019-12-16 14:43 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: Sam Ravnborg, David Airlie, dri-devel, linux-kernel

On Mon, Dec 16, 2019 at 02:39:53PM +0100, Paul Cercueil wrote:
> Hi Ville,
> 
> 
> Le lun., déc. 16, 2019 at 15:15, Ville Syrjälä 
> <ville.syrjala@linux.intel.com> a écrit :
> > On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
> >>  Hi Paul.
> >> 
> >>  On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> >>  > Add a compatible string for the LCD controller found in the 
> >> JZ4770 SoC.
> >>  >
> >>  > v2: No change
> >>  >
> >>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> >>  > Acked-by: Rob Herring <robh@kernel.org>
> >> 
> >>  Whole series looks good.
> >>  Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > 
> > Paul, looks like you forgot to git commit --amend after adding the 
> > tags.
> > Now the commit messages have and extra "# *** extracted tags ***" in 
> > them.
> 
> Sorry, I'm still relatively new to this :(
> 
> I thought they were going to be automatically removed since they are 
> comments.

They will be of you commit --amend. But not without that.

People tend to typo these things quite often so I made dim extract-tags
rather liberal in what it accepts. And sometimes that means it'll pull
in all kinds of crap when people put a ':' in the wrong place. And
that's the reason I added the extra marker so it's trivial to see what
got pulled in by dim and what was there already. But it does mean you
always have to do the --amend to get rid of the markers.

I guess there are at least two options to improve the situation:
a) make dim extract-tags more strict and risk missing typoed tags
b) make dim push check that there marker has been removed from the
   commit msg

-- 
Ville Syrjälä
Intel

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

* Re: [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770
@ 2019-12-16 14:43         ` Ville Syrjälä
  0 siblings, 0 replies; 20+ messages in thread
From: Ville Syrjälä @ 2019-12-16 14:43 UTC (permalink / raw)
  To: Paul Cercueil; +Cc: David Airlie, Sam Ravnborg, linux-kernel, dri-devel

On Mon, Dec 16, 2019 at 02:39:53PM +0100, Paul Cercueil wrote:
> Hi Ville,
> 
> 
> Le lun., déc. 16, 2019 at 15:15, Ville Syrjälä 
> <ville.syrjala@linux.intel.com> a écrit :
> > On Sat, Dec 14, 2019 at 11:54:18AM +0100, Sam Ravnborg wrote:
> >>  Hi Paul.
> >> 
> >>  On Tue, Dec 10, 2019 at 03:41:37PM +0100, Paul Cercueil wrote:
> >>  > Add a compatible string for the LCD controller found in the 
> >> JZ4770 SoC.
> >>  >
> >>  > v2: No change
> >>  >
> >>  > Signed-off-by: Paul Cercueil <paul@crapouillou.net>
> >>  > Acked-by: Rob Herring <robh@kernel.org>
> >> 
> >>  Whole series looks good.
> >>  Acked-by: Sam Ravnborg <sam@ravnborg.org>
> > 
> > Paul, looks like you forgot to git commit --amend after adding the 
> > tags.
> > Now the commit messages have and extra "# *** extracted tags ***" in 
> > them.
> 
> Sorry, I'm still relatively new to this :(
> 
> I thought they were going to be automatically removed since they are 
> comments.

They will be of you commit --amend. But not without that.

People tend to typo these things quite often so I made dim extract-tags
rather liberal in what it accepts. And sometimes that means it'll pull
in all kinds of crap when people put a ':' in the wrong place. And
that's the reason I added the extra marker so it's trivial to see what
got pulled in by dim and what was there already. But it does mean you
always have to do the --amend to get rid of the markers.

I guess there are at least two options to improve the situation:
a) make dim extract-tags more strict and risk missing typoed tags
b) make dim push check that there marker has been removed from the
   commit msg

-- 
Ville Syrjälä
Intel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

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

end of thread, other threads:[~2019-12-17 10:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-12-10 14:41 [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770 Paul Cercueil
2019-12-10 14:41 ` Paul Cercueil
2019-12-10 14:41 ` [PATCH v2 2/6] gpu/drm: ingenic: Avoid null pointer deference in plane atomic update Paul Cercueil
2019-12-10 14:41   ` Paul Cercueil
2019-12-10 14:41 ` [PATCH v2 3/6] gpu/drm: ingenic: Use the plane's src_[x,y] to configure DMA length Paul Cercueil
2019-12-10 14:41   ` [PATCH v2 3/6] gpu/drm: ingenic: Use the plane's src_[x, y] " Paul Cercueil
2019-12-10 14:41 ` [PATCH v2 4/6] gpu/drm: ingenic: Set max FB height to 4095 Paul Cercueil
2019-12-10 14:41   ` Paul Cercueil
2019-12-10 14:41 ` [PATCH v2 5/6] gpu/drm: ingenic: Check for display size in CRTC atomic check Paul Cercueil
2019-12-10 14:41   ` Paul Cercueil
2019-12-10 14:41 ` [PATCH v2 6/6] gpu/drm: ingenic: Add support for the JZ4770 Paul Cercueil
2019-12-10 14:41   ` Paul Cercueil
2019-12-14 10:54 ` [PATCH v2 1/6] dt-bindings: display/ingenic: Add compatible string for JZ4770 Sam Ravnborg
2019-12-14 10:54   ` Sam Ravnborg
2019-12-16 13:15   ` Ville Syrjälä
2019-12-16 13:15     ` Ville Syrjälä
2019-12-16 13:39     ` Paul Cercueil
2019-12-16 13:39       ` Paul Cercueil
2019-12-16 14:43       ` Ville Syrjälä
2019-12-16 14:43         ` Ville Syrjälä

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.