All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2 0/2] Rockchip rk3066_hdmi update
@ 2023-12-18 15:47 ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:47 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Changed V2:
  Drop already applied patches
  Remove "Remove useless output format" patch for now
  Add fill_modes hook removal patch

Johan Jonker (2):
  drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--
2.39.2


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

* [PATCH v2 0/2] Rockchip rk3066_hdmi update
@ 2023-12-18 15:47 ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:47 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Changed V2:
  Drop already applied patches
  Remove "Remove useless output format" patch for now
  Add fill_modes hook removal patch

Johan Jonker (2):
  drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 0/2] Rockchip rk3066_hdmi update
@ 2023-12-18 15:47 ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:47 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Changed V2:
  Drop already applied patches
  Remove "Remove useless output format" patch for now
  Add fill_modes hook removal patch

Johan Jonker (2):
  drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 0/2] Rockchip rk3066_hdmi update
@ 2023-12-18 15:47 ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:47 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: tzimmermann, linux-kernel, dri-devel, linux-rockchip, mripard,
	linux-arm-kernel

Update the Rockchip rk3066_hdmi driver in a somewhat similar way
to what is proposed for the inno_hdmi driver.

Changed V2:
  Drop already applied patches
  Remove "Remove useless output format" patch for now
  Add fill_modes hook removal patch

Johan Jonker (2):
  drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  drm/rockchip: rk3066_hdmi: drop custom fill_modes hook

 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 16 +---------------
 1 file changed, 1 insertion(+), 15 deletions(-)

--
2.39.2


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

* [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  2023-12-18 15:47 ` Johan Jonker
  (?)
  (?)
@ 2023-12-18 15:48   ` Johan Jonker
  -1 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:48 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 62e6d8187de7..0dac6d133767 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -40,7 +40,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
 	struct device *dev;
-	struct drm_device *drm_dev;
 	struct regmap *grf_regmap;
 	int irq;
 	struct clk *hclk;
@@ -752,7 +751,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
 		return -ENOMEM;

 	hdmi->dev = dev;
-	hdmi->drm_dev = drm;
 	hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
--
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-18 15:48   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:48 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 62e6d8187de7..0dac6d133767 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -40,7 +40,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
 	struct device *dev;
-	struct drm_device *drm_dev;
 	struct regmap *grf_regmap;
 	int irq;
 	struct clk *hclk;
@@ -752,7 +751,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
 		return -ENOMEM;

 	hdmi->dev = dev;
-	hdmi->drm_dev = drm;
 	hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
--
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-18 15:48   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:48 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 62e6d8187de7..0dac6d133767 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -40,7 +40,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
 	struct device *dev;
-	struct drm_device *drm_dev;
 	struct regmap *grf_regmap;
 	int irq;
 	struct clk *hclk;
@@ -752,7 +751,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
 		return -ENOMEM;

 	hdmi->dev = dev;
-	hdmi->drm_dev = drm;
 	hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
--
2.39.2


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

* [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-18 15:48   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:48 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: tzimmermann, linux-kernel, dri-devel, linux-rockchip, mripard,
	linux-arm-kernel

The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
device but is never used anywhere in the driver. Let's remove it.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 62e6d8187de7..0dac6d133767 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -40,7 +40,6 @@ struct rk3066_hdmi_i2c {

 struct rk3066_hdmi {
 	struct device *dev;
-	struct drm_device *drm_dev;
 	struct regmap *grf_regmap;
 	int irq;
 	struct clk *hclk;
@@ -752,7 +751,6 @@ static int rk3066_hdmi_bind(struct device *dev, struct device *master,
 		return -ENOMEM;

 	hdmi->dev = dev;
-	hdmi->drm_dev = drm;
 	hdmi->regs = devm_platform_ioremap_resource(pdev, 0);
 	if (IS_ERR(hdmi->regs))
 		return PTR_ERR(hdmi->regs);
--
2.39.2


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

* [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
  2023-12-18 15:47 ` Johan Jonker
  (?)
  (?)
@ 2023-12-18 15:49   ` Johan Jonker
  -1 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:49 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0dac6d133767..6dadd753985c 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector *connector)
 	return &hdmi->encoder.encoder;
 }

-static int
-rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
-					 uint32_t maxX, uint32_t maxY)
-{
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}
-
 static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 {
 	drm_connector_unregister(connector);
@@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 }

 static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = {
-	.fill_modes = rk3066_hdmi_probe_single_connector_modes,
+	.fill_modes = drm_helper_probe_single_connector_modes,
 	.detect = rk3066_hdmi_connector_detect,
 	.destroy = rk3066_hdmi_connector_destroy,
 	.reset = drm_atomic_helper_connector_reset,
--
2.39.2


_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-18 15:49   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:49 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0dac6d133767..6dadd753985c 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector *connector)
 	return &hdmi->encoder.encoder;
 }

-static int
-rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
-					 uint32_t maxX, uint32_t maxY)
-{
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}
-
 static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 {
 	drm_connector_unregister(connector);
@@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 }

 static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = {
-	.fill_modes = rk3066_hdmi_probe_single_connector_modes,
+	.fill_modes = drm_helper_probe_single_connector_modes,
 	.detect = rk3066_hdmi_connector_detect,
 	.destroy = rk3066_hdmi_connector_destroy,
 	.reset = drm_atomic_helper_connector_reset,
--
2.39.2


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

* [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-18 15:49   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:49 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: maarten.lankhorst, mripard, tzimmermann, airlied, daniel,
	dri-devel, linux-arm-kernel, linux-rockchip, linux-kernel

CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0dac6d133767..6dadd753985c 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector *connector)
 	return &hdmi->encoder.encoder;
 }

-static int
-rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
-					 uint32_t maxX, uint32_t maxY)
-{
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}
-
 static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 {
 	drm_connector_unregister(connector);
@@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 }

 static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = {
-	.fill_modes = rk3066_hdmi_probe_single_connector_modes,
+	.fill_modes = drm_helper_probe_single_connector_modes,
 	.detect = rk3066_hdmi_connector_detect,
 	.destroy = rk3066_hdmi_connector_destroy,
 	.reset = drm_atomic_helper_connector_reset,
--
2.39.2


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-18 15:49   ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-18 15:49 UTC (permalink / raw)
  To: hjc, heiko, andy.yan
  Cc: tzimmermann, linux-kernel, dri-devel, linux-rockchip, mripard,
	linux-arm-kernel

CRTC size validation for the display controller has been added with
Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
hardware capabilities"), so we can drop the custom fill_modes hook.

Signed-off-by: Johan Jonker <jbx6244@gmail.com>
---
 drivers/gpu/drm/rockchip/rk3066_hdmi.c | 14 +-------------
 1 file changed, 1 insertion(+), 13 deletions(-)

diff --git a/drivers/gpu/drm/rockchip/rk3066_hdmi.c b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
index 0dac6d133767..6dadd753985c 100644
--- a/drivers/gpu/drm/rockchip/rk3066_hdmi.c
+++ b/drivers/gpu/drm/rockchip/rk3066_hdmi.c
@@ -501,18 +501,6 @@ rk3066_hdmi_connector_best_encoder(struct drm_connector *connector)
 	return &hdmi->encoder.encoder;
 }

-static int
-rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
-					 uint32_t maxX, uint32_t maxY)
-{
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}
-
 static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 {
 	drm_connector_unregister(connector);
@@ -520,7 +508,7 @@ static void rk3066_hdmi_connector_destroy(struct drm_connector *connector)
 }

 static const struct drm_connector_funcs rk3066_hdmi_connector_funcs = {
-	.fill_modes = rk3066_hdmi_probe_single_connector_modes,
+	.fill_modes = drm_helper_probe_single_connector_modes,
 	.detect = rk3066_hdmi_connector_detect,
 	.destroy = rk3066_hdmi_connector_destroy,
 	.reset = drm_atomic_helper_connector_reset,
--
2.39.2


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

* Re: [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
  2023-12-18 15:48   ` Johan Jonker
  (?)
  (?)
@ 2023-12-19 12:53     ` Maxime Ripard
  -1 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:53 UTC (permalink / raw)
  To: Johan Jonker
  Cc: tzimmermann, hjc, dri-devel, linux-kernel, linux-rockchip,
	Maxime Ripard, andy.yan, airlied, linux-arm-kernel

On Mon, 18 Dec 2023 16:48:40 +0100, Johan Jonker wrote:
> The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
> device but is never used anywhere in the driver. Let's remove it.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

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

* Re: [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-19 12:53     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:53 UTC (permalink / raw)
  To: Johan Jonker
  Cc: airlied, andy.yan, daniel, dri-devel, heiko, hjc,
	linux-arm-kernel, linux-kernel, linux-rockchip,
	maarten.lankhorst, mripard, tzimmermann, Maxime Ripard

On Mon, 18 Dec 2023 16:48:40 +0100, Johan Jonker wrote:
> The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
> device but is never used anywhere in the driver. Let's remove it.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

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

* Re: [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-19 12:53     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:53 UTC (permalink / raw)
  To: Johan Jonker
  Cc: airlied, andy.yan, daniel, dri-devel, heiko, hjc,
	linux-arm-kernel, linux-kernel, linux-rockchip,
	maarten.lankhorst, mripard, tzimmermann, Maxime Ripard

On Mon, 18 Dec 2023 16:48:40 +0100, Johan Jonker wrote:
> The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
> device but is never used anywhere in the driver. Let's remove it.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer
@ 2023-12-19 12:53     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:53 UTC (permalink / raw)
  To: Johan Jonker
  Cc: airlied, andy.yan, daniel, dri-devel, heiko, hjc,
	linux-arm-kernel, linux-kernel, linux-rockchip,
	maarten.lankhorst, mripard, tzimmermann, Maxime Ripard

On Mon, 18 Dec 2023 16:48:40 +0100, Johan Jonker wrote:
> The drm_dev field in the rk3066_hdmi struct stores a pointer to the DRM
> device but is never used anywhere in the driver. Let's remove it.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

Reviewed-by: Maxime Ripard <mripard@kernel.org>

Thanks!
Maxime

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
  2023-12-18 15:49   ` Johan Jonker
  (?)
  (?)
@ 2023-12-19 12:55     ` Maxime Ripard
  -1 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:55 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel


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

Hi,

On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> CRTC size validation for the display controller has been added with
> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> hardware capabilities"), so we can drop the custom fill_modes hook.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

I'm not sure those two are equivalent. CRTC and connectors usually have
different requirements and capabilities, and thus different,
supplementary, mode_valid/atomic_check implementations.

Maxime

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

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 12:55     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:55 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, dri-devel, linux-kernel, linux-rockchip, tzimmermann,
	andy.yan, airlied, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

Hi,

On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> CRTC size validation for the display controller has been added with
> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> hardware capabilities"), so we can drop the custom fill_modes hook.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

I'm not sure those two are equivalent. CRTC and connectors usually have
different requirements and capabilities, and thus different,
supplementary, mode_valid/atomic_check implementations.

Maxime

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

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 12:55     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:55 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 543 bytes --]

Hi,

On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> CRTC size validation for the display controller has been added with
> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> hardware capabilities"), so we can drop the custom fill_modes hook.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

I'm not sure those two are equivalent. CRTC and connectors usually have
different requirements and capabilities, and thus different,
supplementary, mode_valid/atomic_check implementations.

Maxime

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

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 12:55     ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-19 12:55 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel


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

Hi,

On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> CRTC size validation for the display controller has been added with
> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> hardware capabilities"), so we can drop the custom fill_modes hook.
> 
> Signed-off-by: Johan Jonker <jbx6244@gmail.com>

I'm not sure those two are equivalent. CRTC and connectors usually have
different requirements and capabilities, and thus different,
supplementary, mode_valid/atomic_check implementations.

Maxime

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

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
  2023-12-19 12:55     ` Maxime Ripard
  (?)
  (?)
@ 2023-12-19 15:40       ` Johan Jonker
  -1 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-19 15:40 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/

+	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
+		return MODE_BAD_HVALUE;
+
+	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
+		return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

	.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I submitted:
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+					 uint32_t maxX, uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 15:40       ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-19 15:40 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: hjc, dri-devel, linux-kernel, linux-rockchip, tzimmermann,
	andy.yan, airlied, linux-arm-kernel



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/

+	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
+		return MODE_BAD_HVALUE;
+
+	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
+		return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

	.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I submitted:
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+					 uint32_t maxX, uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 15:40       ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-19 15:40 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/

+	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
+		return MODE_BAD_HVALUE;
+
+	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
+		return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

	.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I submitted:
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+					 uint32_t maxX, uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-19 15:40       ` Johan Jonker
  0 siblings, 0 replies; 28+ messages in thread
From: Johan Jonker @ 2023-12-19 15:40 UTC (permalink / raw)
  To: Maxime Ripard
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel



On 12/19/23 13:55, Maxime Ripard wrote:
> Hi,
> 
> On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
>> CRTC size validation for the display controller has been added with
>> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
>> hardware capabilities"), so we can drop the custom fill_modes hook.
>>
>> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> 

> I'm not sure those two are equivalent. CRTC and connectors usually have
> different requirements and capabilities, and thus different,
> supplementary, mode_valid/atomic_check implementations.

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

From Rockchip PX2 TRM V1.0.pdf page 17:
- Video Encoder
  Maximum frame rate is up to 30fps@1920x1080

- Display Interface
  Support LCD or TFT interfaces up to 1920x1080

- HDMI TX Interface
   HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
   Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2


Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output

Checked in rockchip_drm_vop.c is:
https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/

+	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
+		return MODE_BAD_HVALUE;
+
+	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
+		return MODE_BAD_VVALUE;

For RK3066 VOP max_output:
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506

This patch was made with HDMI in mind.

	.max_output = { 1920, 1080 },

This first part was added by Heiko, but not was not part my patch that I submitted:
-	if (maxX > 1920)
-		maxX = 1920;
-	if (maxY > 1080)
-		maxY = 1080;
-
-	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
-}

Original patch:
https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com

+static int
+rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
+					 uint32_t maxX, uint32_t maxY)
+{
+	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
+}

Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

Johan

> 
> Maxime

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
  2023-12-19 15:40       ` Johan Jonker
  (?)
  (?)
@ 2023-12-21  9:07         ` Maxime Ripard
  -1 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-21  9:07 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel

[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]

On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote:
> 
> 
> On 12/19/23 13:55, Maxime Ripard wrote:
> > Hi,
> > 
> > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> >> CRTC size validation for the display controller has been added with
> >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> >> hardware capabilities"), so we can drop the custom fill_modes hook.
> >>
> >> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> > 
> 
> > I'm not sure those two are equivalent. CRTC and connectors usually have
> > different requirements and capabilities, and thus different,
> > supplementary, mode_valid/atomic_check implementations.
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.
> 
> From Rockchip PX2 TRM V1.0.pdf page 17:
> - Video Encoder
>   Maximum frame rate is up to 30fps@1920x1080
> 
> - Display Interface
>   Support LCD or TFT interfaces up to 1920x1080
> 
> - HDMI TX Interface
>    HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
>    Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2

My point is that there's two limits: the CRTC and HDMI controller ones.
You should put the CRTC ones in the CRTC driver, and the HDMI controller
ones in the HDMI controller driver.

If they are equivalent, great, it's going to filter out the same things, but...

> Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output
> 
> Checked in rockchip_drm_vop.c is:
> https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/
> 
> +	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
> +		return MODE_BAD_HVALUE;
> +
> +	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
> +		return MODE_BAD_VVALUE;
> 
> For RK3066 VOP max_output:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506
> 
> This patch was made with HDMI in mind.
> 
> 	.max_output = { 1920, 1080 },
> 
> This first part was added by Heiko, but not was not part my patch that I submitted:
> -	if (maxX > 1920)
> -		maxX = 1920;
> -	if (maxY > 1080)
> -		maxY = 1080;
> -
> -	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
> -}
> 
> Original patch:
> https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com
> 
> +static int
> +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
> +					 uint32_t maxX, uint32_t maxY)
> +{
> +	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
> +}
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

... a user / dev unfamiliar with the SoC won't have to go through that
to figure out how it's handled, it will be obvious.

Maxime

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

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-21  9:07         ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-21  9:07 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel


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

On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote:
> 
> 
> On 12/19/23 13:55, Maxime Ripard wrote:
> > Hi,
> > 
> > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> >> CRTC size validation for the display controller has been added with
> >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> >> hardware capabilities"), so we can drop the custom fill_modes hook.
> >>
> >> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> > 
> 
> > I'm not sure those two are equivalent. CRTC and connectors usually have
> > different requirements and capabilities, and thus different,
> > supplementary, mode_valid/atomic_check implementations.
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.
> 
> From Rockchip PX2 TRM V1.0.pdf page 17:
> - Video Encoder
>   Maximum frame rate is up to 30fps@1920x1080
> 
> - Display Interface
>   Support LCD or TFT interfaces up to 1920x1080
> 
> - HDMI TX Interface
>    HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
>    Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2

My point is that there's two limits: the CRTC and HDMI controller ones.
You should put the CRTC ones in the CRTC driver, and the HDMI controller
ones in the HDMI controller driver.

If they are equivalent, great, it's going to filter out the same things, but...

> Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output
> 
> Checked in rockchip_drm_vop.c is:
> https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/
> 
> +	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
> +		return MODE_BAD_HVALUE;
> +
> +	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
> +		return MODE_BAD_VVALUE;
> 
> For RK3066 VOP max_output:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506
> 
> This patch was made with HDMI in mind.
> 
> 	.max_output = { 1920, 1080 },
> 
> This first part was added by Heiko, but not was not part my patch that I submitted:
> -	if (maxX > 1920)
> -		maxX = 1920;
> -	if (maxY > 1080)
> -		maxY = 1080;
> -
> -	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
> -}
> 
> Original patch:
> https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com
> 
> +static int
> +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
> +					 uint32_t maxX, uint32_t maxY)
> +{
> +	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
> +}
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

... a user / dev unfamiliar with the SoC won't have to go through that
to figure out how it's handled, it will be obvious.

Maxime

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

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

_______________________________________________
Linux-rockchip mailing list
Linux-rockchip@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-rockchip

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-21  9:07         ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-21  9:07 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, heiko, andy.yan, maarten.lankhorst, tzimmermann, airlied,
	daniel, dri-devel, linux-arm-kernel, linux-rockchip,
	linux-kernel


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

On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote:
> 
> 
> On 12/19/23 13:55, Maxime Ripard wrote:
> > Hi,
> > 
> > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> >> CRTC size validation for the display controller has been added with
> >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> >> hardware capabilities"), so we can drop the custom fill_modes hook.
> >>
> >> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> > 
> 
> > I'm not sure those two are equivalent. CRTC and connectors usually have
> > different requirements and capabilities, and thus different,
> > supplementary, mode_valid/atomic_check implementations.
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.
> 
> From Rockchip PX2 TRM V1.0.pdf page 17:
> - Video Encoder
>   Maximum frame rate is up to 30fps@1920x1080
> 
> - Display Interface
>   Support LCD or TFT interfaces up to 1920x1080
> 
> - HDMI TX Interface
>    HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
>    Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2

My point is that there's two limits: the CRTC and HDMI controller ones.
You should put the CRTC ones in the CRTC driver, and the HDMI controller
ones in the HDMI controller driver.

If they are equivalent, great, it's going to filter out the same things, but...

> Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output
> 
> Checked in rockchip_drm_vop.c is:
> https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/
> 
> +	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
> +		return MODE_BAD_HVALUE;
> +
> +	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
> +		return MODE_BAD_VVALUE;
> 
> For RK3066 VOP max_output:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506
> 
> This patch was made with HDMI in mind.
> 
> 	.max_output = { 1920, 1080 },
> 
> This first part was added by Heiko, but not was not part my patch that I submitted:
> -	if (maxX > 1920)
> -		maxX = 1920;
> -	if (maxY > 1080)
> -		maxY = 1080;
> -
> -	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
> -}
> 
> Original patch:
> https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com
> 
> +static int
> +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
> +					 uint32_t maxX, uint32_t maxY)
> +{
> +	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
> +}
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

... a user / dev unfamiliar with the SoC won't have to go through that
to figure out how it's handled, it will be obvious.

Maxime

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

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

_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* Re: [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook
@ 2023-12-21  9:07         ` Maxime Ripard
  0 siblings, 0 replies; 28+ messages in thread
From: Maxime Ripard @ 2023-12-21  9:07 UTC (permalink / raw)
  To: Johan Jonker
  Cc: hjc, dri-devel, linux-kernel, linux-rockchip, tzimmermann,
	andy.yan, airlied, linux-arm-kernel

[-- Attachment #1: Type: text/plain, Size: 2988 bytes --]

On Tue, Dec 19, 2023 at 04:40:12PM +0100, Johan Jonker wrote:
> 
> 
> On 12/19/23 13:55, Maxime Ripard wrote:
> > Hi,
> > 
> > On Mon, Dec 18, 2023 at 04:49:06PM +0100, Johan Jonker wrote:
> >> CRTC size validation for the display controller has been added with
> >> Commit 8e140cb60270 ("drm/rockchip: vop: limit maximum resolution to
> >> hardware capabilities"), so we can drop the custom fill_modes hook.
> >>
> >> Signed-off-by: Johan Jonker <jbx6244@gmail.com>
> > 
> 
> > I'm not sure those two are equivalent. CRTC and connectors usually have
> > different requirements and capabilities, and thus different,
> > supplementary, mode_valid/atomic_check implementations.
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.
> 
> From Rockchip PX2 TRM V1.0.pdf page 17:
> - Video Encoder
>   Maximum frame rate is up to 30fps@1920x1080
> 
> - Display Interface
>   Support LCD or TFT interfaces up to 1920x1080
> 
> - HDMI TX Interface
>    HDMI version 1.4a, HDCP revision 1.4 and DVI version 1.0 compliant transmitter
>    Supports DTV from 480i to 1080i/p HD resolution, and PC from VGA to UXGA by LCDC0 or LCDC1 in RK PX2

My point is that there's two limits: the CRTC and HDMI controller ones.
You should put the CRTC ones in the CRTC driver, and the HDMI controller
ones in the HDMI controller driver.

If they are equivalent, great, it's going to filter out the same things, but...

> Compared to the drm_helper_probe_single_connector_modes() this function added an extra max_output
> 
> Checked in rockchip_drm_vop.c is:
> https://lore.kernel.org/linux-rockchip/20230216102447.582905-2-s.hauer@pengutronix.de/
> 
> +	if (vop->data->max_output.width && mode->hdisplay > vop->data->max_output.width)
> +		return MODE_BAD_HVALUE;
> +
> +	if (vop->data->max_output.height && mode->vdisplay > vop->data->max_output.height)
> +		return MODE_BAD_VVALUE;
> 
> For RK3066 VOP max_output:
> https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git/tree/drivers/gpu/drm/rockchip/rockchip_vop_reg.c#n506
> 
> This patch was made with HDMI in mind.
> 
> 	.max_output = { 1920, 1080 },
> 
> This first part was added by Heiko, but not was not part my patch that I submitted:
> -	if (maxX > 1920)
> -		maxX = 1920;
> -	if (maxY > 1080)
> -		maxY = 1080;
> -
> -	return drm_helper_probe_single_connector_modes(connector, maxX, maxY);
> -}
> 
> Original patch:
> https://patchwork.freedesktop.org/patch/msgid/20190330095639.14626-2-jbx6244@gmail.com
> 
> +static int
> +rk3066_hdmi_probe_single_connector_modes(struct drm_connector *connector,
> +					 uint32_t maxX, uint32_t maxY)
> +{
> +	return drm_helper_probe_single_connector_modes(connector, 1920, 1080);
> +}
> 
> Rockchip RK3066 CRTC and connector resolution max_output are equivalent.

... a user / dev unfamiliar with the SoC won't have to go through that
to figure out how it's handled, it will be obvious.

Maxime

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

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

end of thread, other threads:[~2023-12-21  9:07 UTC | newest]

Thread overview: 28+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-12-18 15:47 [PATCH v2 0/2] Rockchip rk3066_hdmi update Johan Jonker
2023-12-18 15:47 ` Johan Jonker
2023-12-18 15:47 ` Johan Jonker
2023-12-18 15:47 ` Johan Jonker
2023-12-18 15:48 ` [PATCH v2 1/2] drm/rockchip: rk3066_hdmi: remove unused drm device pointer Johan Jonker
2023-12-18 15:48   ` Johan Jonker
2023-12-18 15:48   ` Johan Jonker
2023-12-18 15:48   ` Johan Jonker
2023-12-19 12:53   ` Maxime Ripard
2023-12-19 12:53     ` Maxime Ripard
2023-12-19 12:53     ` Maxime Ripard
2023-12-19 12:53     ` Maxime Ripard
2023-12-18 15:49 ` [PATCH v2 2/2] drm/rockchip: rk3066_hdmi: drop custom fill_modes hook Johan Jonker
2023-12-18 15:49   ` Johan Jonker
2023-12-18 15:49   ` Johan Jonker
2023-12-18 15:49   ` Johan Jonker
2023-12-19 12:55   ` Maxime Ripard
2023-12-19 12:55     ` Maxime Ripard
2023-12-19 12:55     ` Maxime Ripard
2023-12-19 12:55     ` Maxime Ripard
2023-12-19 15:40     ` Johan Jonker
2023-12-19 15:40       ` Johan Jonker
2023-12-19 15:40       ` Johan Jonker
2023-12-19 15:40       ` Johan Jonker
2023-12-21  9:07       ` Maxime Ripard
2023-12-21  9:07         ` Maxime Ripard
2023-12-21  9:07         ` Maxime Ripard
2023-12-21  9:07         ` Maxime Ripard

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.