All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCHv2 0/4] drm: exynos: update/fixes to HDMI driver
@ 2014-04-15  9:27 ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: Tomasz Stanislawski, pawel.moll, b.zolnierkie, sw0312.kim,
	kyungmin.park, robh+dt, rahul.sharma, m.chehab

Hi everyone,
This patchset adds 4 fixes/updates to EXYNOS DRM driver for
HDMI subsystem.

All comments are welcome.

Regards,
Tomasz Stanislawski

Changelog:

v2:
* fix check with gpio_is_valid()
* use U32_MAX instead of ULONG_MAX to be 64-bit-friendly
* use hdmi_driver_data as hdmi's compatile data

v1:
* initial version

Tomasz Stanislawski (4):
  drm: exynos: hdmi: simplify extracting hpd-gpio from DT
  drm: exynos: mixer: fix using usleep() in atomic context
  drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210
    SoC
  drm: exynos: hdmi: add support for pixel clock limitation

 .../devicetree/bindings/video/exynos_hdmi.txt      |    4 +++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |   30 ++++++++++++++------
 drivers/gpu/drm/exynos/exynos_mixer.c              |    5 +++-
 include/media/s5p_hdmi.h                           |    1 +
 4 files changed, 31 insertions(+), 9 deletions(-)

-- 
1.7.9.5

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

* [PATCHv2 0/4] drm: exynos: update/fixes to HDMI driver
@ 2014-04-15  9:27 ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: m.chehab, robh+dt, inki.dae, kyungmin.park, sw0312.kim, t.figa,
	b.zolnierkie, jy0922.shim, rahul.sharma, pawel.moll,
	Tomasz Stanislawski

Hi everyone,
This patchset adds 4 fixes/updates to EXYNOS DRM driver for
HDMI subsystem.

All comments are welcome.

Regards,
Tomasz Stanislawski

Changelog:

v2:
* fix check with gpio_is_valid()
* use U32_MAX instead of ULONG_MAX to be 64-bit-friendly
* use hdmi_driver_data as hdmi's compatile data

v1:
* initial version

Tomasz Stanislawski (4):
  drm: exynos: hdmi: simplify extracting hpd-gpio from DT
  drm: exynos: mixer: fix using usleep() in atomic context
  drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210
    SoC
  drm: exynos: hdmi: add support for pixel clock limitation

 .../devicetree/bindings/video/exynos_hdmi.txt      |    4 +++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |   30 ++++++++++++++------
 drivers/gpu/drm/exynos/exynos_mixer.c              |    5 +++-
 include/media/s5p_hdmi.h                           |    1 +
 4 files changed, 31 insertions(+), 9 deletions(-)

-- 
1.7.9.5


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

* [PATCHv2 1/4] drm: exynos: hdmi: simplify extracting hpd-gpio from DT
  2014-04-15  9:27 ` Tomasz Stanislawski
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  -1 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: Tomasz Stanislawski, pawel.moll, b.zolnierkie, sw0312.kim,
	kyungmin.park, robh+dt, rahul.sharma, m.chehab

This patch eliminates redundant checks while retrieving HPD gpio from DT during
HDMI's probe().

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 9a6d652..47c6e85 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2016,23 +2016,18 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 {
 	struct device_node *np = dev->of_node;
 	struct s5p_hdmi_platform_data *pd;
-	u32 value;
 
 	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
 	if (!pd)
-		goto err_data;
+		return NULL;
 
-	if (!of_find_property(np, "hpd-gpio", &value)) {
+	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
+	if (!gpio_is_valid(pd->hpd_gpio)) {
 		DRM_ERROR("no hpd gpio property found\n");
-		goto err_data;
+		return NULL;
 	}
 
-	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
-
 	return pd;
-
-err_data:
-	return NULL;
 }
 
 static struct of_device_id hdmi_match_types[] = {
-- 
1.7.9.5

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

* [PATCHv2 1/4] drm: exynos: hdmi: simplify extracting hpd-gpio from DT
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: m.chehab, robh+dt, inki.dae, kyungmin.park, sw0312.kim, t.figa,
	b.zolnierkie, jy0922.shim, rahul.sharma, pawel.moll,
	Tomasz Stanislawski

This patch eliminates redundant checks while retrieving HPD gpio from DT during
HDMI's probe().

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c |   13 ++++---------
 1 file changed, 4 insertions(+), 9 deletions(-)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 9a6d652..47c6e85 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -2016,23 +2016,18 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 {
 	struct device_node *np = dev->of_node;
 	struct s5p_hdmi_platform_data *pd;
-	u32 value;
 
 	pd = devm_kzalloc(dev, sizeof(*pd), GFP_KERNEL);
 	if (!pd)
-		goto err_data;
+		return NULL;
 
-	if (!of_find_property(np, "hpd-gpio", &value)) {
+	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
+	if (!gpio_is_valid(pd->hpd_gpio)) {
 		DRM_ERROR("no hpd gpio property found\n");
-		goto err_data;
+		return NULL;
 	}
 
-	pd->hpd_gpio = of_get_named_gpio(np, "hpd-gpio", 0);
-
 	return pd;
-
-err_data:
-	return NULL;
 }
 
 static struct of_device_id hdmi_match_types[] = {
-- 
1.7.9.5


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

* [PATCHv2 2/4] drm: exynos: mixer: fix using usleep() in atomic context
  2014-04-15  9:27 ` Tomasz Stanislawski
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  -1 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: Tomasz Stanislawski, pawel.moll, b.zolnierkie, sw0312.kim,
	kyungmin.park, robh+dt, rahul.sharma, m.chehab

This patch fixes calling usleep_range() after taking reg_slock
using spin_lock_irqsave(). The mdelay() is used instead.
Waiting in atomic context is not the best idea in general.
Hopefully, waiting occurs only when Video Processor fails
to reset correctly.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ce28881..e3306c8 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -615,7 +615,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;
-		usleep_range(10000, 12000);
+		mdelay(10);
 	}
 	WARN(tries == 0, "failed to reset Video Processor\n");
 }
-- 
1.7.9.5

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

* [PATCHv2 2/4] drm: exynos: mixer: fix using usleep() in atomic context
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: m.chehab, robh+dt, inki.dae, kyungmin.park, sw0312.kim, t.figa,
	b.zolnierkie, jy0922.shim, rahul.sharma, pawel.moll,
	Tomasz Stanislawski

This patch fixes calling usleep_range() after taking reg_slock
using spin_lock_irqsave(). The mdelay() is used instead.
Waiting in atomic context is not the best idea in general.
Hopefully, waiting occurs only when Video Processor fails
to reset correctly.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_mixer.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index ce28881..e3306c8 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -615,7 +615,7 @@ static void vp_win_reset(struct mixer_context *ctx)
 		/* waiting until VP_SRESET_PROCESSING is 0 */
 		if (~vp_reg_read(res, VP_SRESET) & VP_SRESET_PROCESSING)
 			break;
-		usleep_range(10000, 12000);
+		mdelay(10);
 	}
 	WARN(tries == 0, "failed to reset Video Processor\n");
 }
-- 
1.7.9.5


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

* [PATCHv2 3/4] drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210 SoC
  2014-04-15  9:27 ` Tomasz Stanislawski
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  -1 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: Tomasz Stanislawski, pawel.moll, b.zolnierkie, sw0312.kim,
	kyungmin.park, robh+dt, rahul.sharma, m.chehab

This patch add proper compatibles for Mixer and HDMI chip
available on exynos4210 SoCs.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    7 +++++++
 drivers/gpu/drm/exynos/exynos_mixer.c |    3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 47c6e85..2a18f4e 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -204,6 +204,10 @@ struct hdmiphy_config {
 	u8 conf[32];
 };
 
+struct hdmi_driver_data exynos4210_hdmi_driver_data = {
+	.type	= HDMI_TYPE13,
+};
+
 struct hdmi_driver_data exynos4212_hdmi_driver_data = {
 	.type	= HDMI_TYPE14,
 };
@@ -2032,6 +2036,9 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 
 static struct of_device_id hdmi_match_types[] = {
 	{
+		.compatible = "samsung,exynos4210-hdmi",
+		.data = &exynos4210_hdmi_driver_data,
+	}, {
 		.compatible = "samsung,exynos5-hdmi",
 		.data = &exynos5_hdmi_driver_data,
 	}, {
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index e3306c8..fd8a9a0 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1187,6 +1187,9 @@ static struct platform_device_id mixer_driver_types[] = {
 
 static struct of_device_id mixer_match_types[] = {
 	{
+		.compatible = "samsung,exynos4210-mixer",
+		.data	= &exynos4210_mxr_drv_data,
+	}, {
 		.compatible = "samsung,exynos5-mixer",
 		.data	= &exynos5250_mxr_drv_data,
 	}, {
-- 
1.7.9.5

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

* [PATCHv2 3/4] drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210 SoC
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: m.chehab, robh+dt, inki.dae, kyungmin.park, sw0312.kim, t.figa,
	b.zolnierkie, jy0922.shim, rahul.sharma, pawel.moll,
	Tomasz Stanislawski

This patch add proper compatibles for Mixer and HDMI chip
available on exynos4210 SoCs.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 drivers/gpu/drm/exynos/exynos_hdmi.c  |    7 +++++++
 drivers/gpu/drm/exynos/exynos_mixer.c |    3 +++
 2 files changed, 10 insertions(+)

diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 47c6e85..2a18f4e 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -204,6 +204,10 @@ struct hdmiphy_config {
 	u8 conf[32];
 };
 
+struct hdmi_driver_data exynos4210_hdmi_driver_data = {
+	.type	= HDMI_TYPE13,
+};
+
 struct hdmi_driver_data exynos4212_hdmi_driver_data = {
 	.type	= HDMI_TYPE14,
 };
@@ -2032,6 +2036,9 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 
 static struct of_device_id hdmi_match_types[] = {
 	{
+		.compatible = "samsung,exynos4210-hdmi",
+		.data = &exynos4210_hdmi_driver_data,
+	}, {
 		.compatible = "samsung,exynos5-hdmi",
 		.data = &exynos5_hdmi_driver_data,
 	}, {
diff --git a/drivers/gpu/drm/exynos/exynos_mixer.c b/drivers/gpu/drm/exynos/exynos_mixer.c
index e3306c8..fd8a9a0 100644
--- a/drivers/gpu/drm/exynos/exynos_mixer.c
+++ b/drivers/gpu/drm/exynos/exynos_mixer.c
@@ -1187,6 +1187,9 @@ static struct platform_device_id mixer_driver_types[] = {
 
 static struct of_device_id mixer_match_types[] = {
 	{
+		.compatible = "samsung,exynos4210-mixer",
+		.data	= &exynos4210_mxr_drv_data,
+	}, {
 		.compatible = "samsung,exynos5-mixer",
 		.data	= &exynos5250_mxr_drv_data,
 	}, {
-- 
1.7.9.5


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

* [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15  9:27 ` Tomasz Stanislawski
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  -1 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: Tomasz Stanislawski, pawel.moll, b.zolnierkie, sw0312.kim,
	kyungmin.park, robh+dt, rahul.sharma, m.chehab

Adds support for limitation of maximal pixel clock of HDMI
signal. This feature is needed on boards that contains
lines or bridges with frequency limitations.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
 include/media/s5p_hdmi.h                           |    1 +
 3 files changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
index f9187a2..8718f8d 100644
--- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
+++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
@@ -28,6 +28,10 @@ Required properties:
 - ddc: phandle to the hdmi ddc node
 - phy: phandle to the hdmi phy node
 
+Optional properties:
+- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
+	connectors or bridges not capable of carring higher frequencies
+
 Example:
 
 	hdmi {
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 2a18f4e..404f1b7 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -195,6 +195,7 @@ struct hdmi_context {
 	struct hdmi_resources		res;
 
 	int				hpd_gpio;
+	u32				max_pixel_clock;
 
 	enum hdmi_type			type;
 };
@@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
 	if (ret)
 		return MODE_BAD;
 
+	if (mode->clock * 1000 > hdata->max_pixel_clock)
+		return MODE_BAD;
+
 	ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
 	if (ret < 0)
 		return MODE_BAD;
@@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 		return NULL;
 	}
 
+	of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
+
 	return pd;
 }
 
@@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -EINVAL;
 
+	if (!pdata->max_pixel_clock) {
+		DRM_INFO("max-pixel-clock is zero, using INF\n");
+		pdata->max_pixel_clock = U32_MAX;
+	}
+
 	hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
 	if (!hdata)
 		return -ENOMEM;
@@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
 	hdata->type = drv_data->type;
 
 	hdata->hpd_gpio = pdata->hpd_gpio;
+	hdata->max_pixel_clock = pdata->max_pixel_clock;
 	hdata->dev = dev;
 
 	ret = hdmi_resources_init(hdata);
diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
index 181642b..7272d65 100644
--- a/include/media/s5p_hdmi.h
+++ b/include/media/s5p_hdmi.h
@@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
 	int mhl_bus;
 	struct i2c_board_info *mhl_info;
 	int hpd_gpio;
+	u32 max_pixel_clock;
 };
 
 #endif /* S5P_HDMI_H */
-- 
1.7.9.5

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

* [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
@ 2014-04-15  9:27   ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15  9:27 UTC (permalink / raw)
  To: linux-samsung-soc, dri-devel, linux-media
  Cc: m.chehab, robh+dt, inki.dae, kyungmin.park, sw0312.kim, t.figa,
	b.zolnierkie, jy0922.shim, rahul.sharma, pawel.moll,
	Tomasz Stanislawski

Adds support for limitation of maximal pixel clock of HDMI
signal. This feature is needed on boards that contains
lines or bridges with frequency limitations.

Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
---
 .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
 drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
 include/media/s5p_hdmi.h                           |    1 +
 3 files changed, 17 insertions(+)

diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
index f9187a2..8718f8d 100644
--- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
+++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
@@ -28,6 +28,10 @@ Required properties:
 - ddc: phandle to the hdmi ddc node
 - phy: phandle to the hdmi phy node
 
+Optional properties:
+- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
+	connectors or bridges not capable of carring higher frequencies
+
 Example:
 
 	hdmi {
diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
index 2a18f4e..404f1b7 100644
--- a/drivers/gpu/drm/exynos/exynos_hdmi.c
+++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
@@ -195,6 +195,7 @@ struct hdmi_context {
 	struct hdmi_resources		res;
 
 	int				hpd_gpio;
+	u32				max_pixel_clock;
 
 	enum hdmi_type			type;
 };
@@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
 	if (ret)
 		return MODE_BAD;
 
+	if (mode->clock * 1000 > hdata->max_pixel_clock)
+		return MODE_BAD;
+
 	ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
 	if (ret < 0)
 		return MODE_BAD;
@@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
 		return NULL;
 	}
 
+	of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
+
 	return pd;
 }
 
@@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
 	if (!pdata)
 		return -EINVAL;
 
+	if (!pdata->max_pixel_clock) {
+		DRM_INFO("max-pixel-clock is zero, using INF\n");
+		pdata->max_pixel_clock = U32_MAX;
+	}
+
 	hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
 	if (!hdata)
 		return -ENOMEM;
@@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
 	hdata->type = drv_data->type;
 
 	hdata->hpd_gpio = pdata->hpd_gpio;
+	hdata->max_pixel_clock = pdata->max_pixel_clock;
 	hdata->dev = dev;
 
 	ret = hdmi_resources_init(hdata);
diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
index 181642b..7272d65 100644
--- a/include/media/s5p_hdmi.h
+++ b/include/media/s5p_hdmi.h
@@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
 	int mhl_bus;
 	struct i2c_board_info *mhl_info;
 	int hpd_gpio;
+	u32 max_pixel_clock;
 };
 
 #endif /* S5P_HDMI_H */
-- 
1.7.9.5


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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15  9:27   ` Tomasz Stanislawski
@ 2014-04-15  9:42     ` Rahul Sharma
  -1 siblings, 0 replies; 20+ messages in thread
From: Rahul Sharma @ 2014-04-15  9:42 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, Pawel Moll, b.zolnierkie, sw0312.kim,
	sunil joshi, dri-devel@lists.freedesktop.org, m.chehab,
	Kyungmin Park, Rob Herring, Rahul Sharma,
	linux-media@vger.kernel.org

Hi Tomasz,

On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
> Adds support for limitation of maximal pixel clock of HDMI
> signal. This feature is needed on boards that contains
> lines or bridges with frequency limitations.
>
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> ---
>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>  include/media/s5p_hdmi.h                           |    1 +
>  3 files changed, 17 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> index f9187a2..8718f8d 100644
> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> @@ -28,6 +28,10 @@ Required properties:
>  - ddc: phandle to the hdmi ddc node
>  - phy: phandle to the hdmi phy node
>
> +Optional properties:
> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
> +       connectors or bridges not capable of carring higher frequencies
> +
>  Example:
>
>         hdmi {
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2a18f4e..404f1b7 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -195,6 +195,7 @@ struct hdmi_context {
>         struct hdmi_resources           res;
>
>         int                             hpd_gpio;
> +       u32                             max_pixel_clock;
>
>         enum hdmi_type                  type;
>  };
> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>         if (ret)
>                 return MODE_BAD;
>
> +       if (mode->clock * 1000 > hdata->max_pixel_clock)
> +               return MODE_BAD;
> +
>         ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
>         if (ret < 0)
>                 return MODE_BAD;
> @@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>                 return NULL;
>         }
>
> +       of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
> +
>         return pd;
>  }
>
> @@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
>         if (!pdata)
>                 return -EINVAL;
>
> +       if (!pdata->max_pixel_clock) {
> +               DRM_INFO("max-pixel-clock is zero, using INF\n");
> +               pdata->max_pixel_clock = U32_MAX;
> +       }
> +
>         hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
>         if (!hdata)
>                 return -ENOMEM;
> @@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
>         hdata->type = drv_data->type;
>
>         hdata->hpd_gpio = pdata->hpd_gpio;
> +       hdata->max_pixel_clock = pdata->max_pixel_clock;
>         hdata->dev = dev;
>
>         ret = hdmi_resources_init(hdata);
> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
> index 181642b..7272d65 100644
> --- a/include/media/s5p_hdmi.h
> +++ b/include/media/s5p_hdmi.h
> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>         int mhl_bus;
>         struct i2c_board_info *mhl_info;
>         int hpd_gpio;
> +       u32 max_pixel_clock;
>  };

We have already removed Non DT support from the drm hdmi
driver. IMO we should not be extending the pdata struct.

Regards,
Rahul Sharma

>
>  #endif /* S5P_HDMI_H */
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
@ 2014-04-15  9:42     ` Rahul Sharma
  0 siblings, 0 replies; 20+ messages in thread
From: Rahul Sharma @ 2014-04-15  9:42 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, dri-devel@lists.freedesktop.org,
	linux-media@vger.kernel.org, Pawel Moll, b.zolnierkie, sw0312.kim,
	Kyungmin Park, Rob Herring, Rahul Sharma, m.chehab, sunil joshi

Hi Tomasz,

On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
> Adds support for limitation of maximal pixel clock of HDMI
> signal. This feature is needed on boards that contains
> lines or bridges with frequency limitations.
>
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> ---
>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>  include/media/s5p_hdmi.h                           |    1 +
>  3 files changed, 17 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> index f9187a2..8718f8d 100644
> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> @@ -28,6 +28,10 @@ Required properties:
>  - ddc: phandle to the hdmi ddc node
>  - phy: phandle to the hdmi phy node
>
> +Optional properties:
> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
> +       connectors or bridges not capable of carring higher frequencies
> +
>  Example:
>
>         hdmi {
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2a18f4e..404f1b7 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -195,6 +195,7 @@ struct hdmi_context {
>         struct hdmi_resources           res;
>
>         int                             hpd_gpio;
> +       u32                             max_pixel_clock;
>
>         enum hdmi_type                  type;
>  };
> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>         if (ret)
>                 return MODE_BAD;
>
> +       if (mode->clock * 1000 > hdata->max_pixel_clock)
> +               return MODE_BAD;
> +
>         ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
>         if (ret < 0)
>                 return MODE_BAD;
> @@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>                 return NULL;
>         }
>
> +       of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
> +
>         return pd;
>  }
>
> @@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
>         if (!pdata)
>                 return -EINVAL;
>
> +       if (!pdata->max_pixel_clock) {
> +               DRM_INFO("max-pixel-clock is zero, using INF\n");
> +               pdata->max_pixel_clock = U32_MAX;
> +       }
> +
>         hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
>         if (!hdata)
>                 return -ENOMEM;
> @@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
>         hdata->type = drv_data->type;
>
>         hdata->hpd_gpio = pdata->hpd_gpio;
> +       hdata->max_pixel_clock = pdata->max_pixel_clock;
>         hdata->dev = dev;
>
>         ret = hdmi_resources_init(hdata);
> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
> index 181642b..7272d65 100644
> --- a/include/media/s5p_hdmi.h
> +++ b/include/media/s5p_hdmi.h
> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>         int mhl_bus;
>         struct i2c_board_info *mhl_info;
>         int hpd_gpio;
> +       u32 max_pixel_clock;
>  };

We have already removed Non DT support from the drm hdmi
driver. IMO we should not be extending the pdata struct.

Regards,
Rahul Sharma

>
>  #endif /* S5P_HDMI_H */
> --
> 1.7.9.5
>
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15  9:27   ` Tomasz Stanislawski
@ 2014-04-15  9:49     ` Lucas Stach
  -1 siblings, 0 replies; 20+ messages in thread
From: Lucas Stach @ 2014-04-15  9:49 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, pawel.moll, b.zolnierkie, sw0312.kim,
	dri-devel, m.chehab, kyungmin.park, robh+dt, rahul.sharma,
	linux-media

Am Dienstag, den 15.04.2014, 11:27 +0200 schrieb Tomasz Stanislawski:
> Adds support for limitation of maximal pixel clock of HDMI
> signal. This feature is needed on boards that contains
> lines or bridges with frequency limitations.
> 
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> ---
>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>  include/media/s5p_hdmi.h                           |    1 +
>  3 files changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> index f9187a2..8718f8d 100644
> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> @@ -28,6 +28,10 @@ Required properties:
>  - ddc: phandle to the hdmi ddc node
>  - phy: phandle to the hdmi phy node
>  
> +Optional properties:
> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
> +	connectors or bridges not capable of carring higher frequencies
> +
>  Example:
>  
>  	hdmi {
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2a18f4e..404f1b7 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -195,6 +195,7 @@ struct hdmi_context {
>  	struct hdmi_resources		res;
>  
>  	int				hpd_gpio;
> +	u32				max_pixel_clock;
>  
>  	enum hdmi_type			type;
>  };
> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>  	if (ret)
>  		return MODE_BAD;
>  
> +	if (mode->clock * 1000 > hdata->max_pixel_clock)
> +		return MODE_BAD;
> +
This should be MODE_CLOCK_HIGH

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
@ 2014-04-15  9:49     ` Lucas Stach
  0 siblings, 0 replies; 20+ messages in thread
From: Lucas Stach @ 2014-04-15  9:49 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, dri-devel, linux-media, pawel.moll,
	b.zolnierkie, sw0312.kim, kyungmin.park, robh+dt, rahul.sharma,
	m.chehab

Am Dienstag, den 15.04.2014, 11:27 +0200 schrieb Tomasz Stanislawski:
> Adds support for limitation of maximal pixel clock of HDMI
> signal. This feature is needed on boards that contains
> lines or bridges with frequency limitations.
> 
> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> ---
>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>  include/media/s5p_hdmi.h                           |    1 +
>  3 files changed, 17 insertions(+)
> 
> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> index f9187a2..8718f8d 100644
> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
> @@ -28,6 +28,10 @@ Required properties:
>  - ddc: phandle to the hdmi ddc node
>  - phy: phandle to the hdmi phy node
>  
> +Optional properties:
> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
> +	connectors or bridges not capable of carring higher frequencies
> +
>  Example:
>  
>  	hdmi {
> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
> index 2a18f4e..404f1b7 100644
> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
> @@ -195,6 +195,7 @@ struct hdmi_context {
>  	struct hdmi_resources		res;
>  
>  	int				hpd_gpio;
> +	u32				max_pixel_clock;
>  
>  	enum hdmi_type			type;
>  };
> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>  	if (ret)
>  		return MODE_BAD;
>  
> +	if (mode->clock * 1000 > hdata->max_pixel_clock)
> +		return MODE_BAD;
> +
This should be MODE_CLOCK_HIGH

Regards,
Lucas
-- 
Pengutronix e.K.             | Lucas Stach                 |
Industrial Linux Solutions   | http://www.pengutronix.de/  |


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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15  9:42     ` Rahul Sharma
@ 2014-04-15 13:11       ` Tomasz Stanislawski
  -1 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15 13:11 UTC (permalink / raw)
  To: Rahul Sharma
  Cc: linux-samsung-soc, linux-media@vger.kernel.org, Pawel Moll,
	b.zolnierkie, sw0312.kim, sunil joshi,
	dri-devel@lists.freedesktop.org, Kyungmin Park, Rob Herring,
	Rahul Sharma, m.chehab

On 04/15/2014 11:42 AM, Rahul Sharma wrote:
> Hi Tomasz,
> 
> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>> Adds support for limitation of maximal pixel clock of HDMI
>> signal. This feature is needed on boards that contains
>> lines or bridges with frequency limitations.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>>  include/media/s5p_hdmi.h                           |    1 +
>>  3 files changed, 17 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> index f9187a2..8718f8d 100644
>> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> @@ -28,6 +28,10 @@ Required properties:
>>  - ddc: phandle to the hdmi ddc node
>>  - phy: phandle to the hdmi phy node
>>
>> +Optional properties:
>> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
>> +       connectors or bridges not capable of carring higher frequencies
>> +
>>  Example:
>>
>>         hdmi {
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> index 2a18f4e..404f1b7 100644
>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> @@ -195,6 +195,7 @@ struct hdmi_context {
>>         struct hdmi_resources           res;
>>
>>         int                             hpd_gpio;
>> +       u32                             max_pixel_clock;
>>
>>         enum hdmi_type                  type;
>>  };
>> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>>         if (ret)
>>                 return MODE_BAD;
>>
>> +       if (mode->clock * 1000 > hdata->max_pixel_clock)
>> +               return MODE_BAD;
>> +
>>         ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
>>         if (ret < 0)
>>                 return MODE_BAD;
>> @@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>>                 return NULL;
>>         }
>>
>> +       of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
>> +
>>         return pd;
>>  }
>>
>> @@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
>>         if (!pdata)
>>                 return -EINVAL;
>>
>> +       if (!pdata->max_pixel_clock) {
>> +               DRM_INFO("max-pixel-clock is zero, using INF\n");
>> +               pdata->max_pixel_clock = U32_MAX;
>> +       }
>> +
>>         hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
>>         if (!hdata)
>>                 return -ENOMEM;
>> @@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
>>         hdata->type = drv_data->type;
>>
>>         hdata->hpd_gpio = pdata->hpd_gpio;
>> +       hdata->max_pixel_clock = pdata->max_pixel_clock;
>>         hdata->dev = dev;
>>
>>         ret = hdmi_resources_init(hdata);
>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>> index 181642b..7272d65 100644
>> --- a/include/media/s5p_hdmi.h
>> +++ b/include/media/s5p_hdmi.h
>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>         int mhl_bus;
>>         struct i2c_board_info *mhl_info;
>>         int hpd_gpio;
>> +       u32 max_pixel_clock;
>>  };
> 
> We have already removed Non DT support from the drm hdmi
> driver. IMO we should not be extending the pdata struct.
> 
> Regards,
> Rahul Sharma

Hi Rahul,

This is not a non-DT patch. The s5p_hdmi_platform_data is
generated from DT itself. This structure is just
a parsed version of DT attributes.

It may be a good idea to rename s5p_hdmi_platform_data
to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
or parse DT directly in probe function.

I can prepare a patch for that.

Regards,
Tomasz Stanislawski


> 
>>
>>  #endif /* S5P_HDMI_H */
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
@ 2014-04-15 13:11       ` Tomasz Stanislawski
  0 siblings, 0 replies; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15 13:11 UTC (permalink / raw)
  To: Rahul Sharma
  Cc: linux-samsung-soc, Pawel Moll, b.zolnierkie, sw0312.kim,
	sunil joshi, dri-devel@lists.freedesktop.org, m.chehab,
	Kyungmin Park, Rob Herring, Rahul Sharma,
	linux-media@vger.kernel.org

On 04/15/2014 11:42 AM, Rahul Sharma wrote:
> Hi Tomasz,
> 
> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>> Adds support for limitation of maximal pixel clock of HDMI
>> signal. This feature is needed on boards that contains
>> lines or bridges with frequency limitations.
>>
>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>> ---
>>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>>  include/media/s5p_hdmi.h                           |    1 +
>>  3 files changed, 17 insertions(+)
>>
>> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> index f9187a2..8718f8d 100644
>> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>> @@ -28,6 +28,10 @@ Required properties:
>>  - ddc: phandle to the hdmi ddc node
>>  - phy: phandle to the hdmi phy node
>>
>> +Optional properties:
>> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
>> +       connectors or bridges not capable of carring higher frequencies
>> +
>>  Example:
>>
>>         hdmi {
>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> index 2a18f4e..404f1b7 100644
>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>> @@ -195,6 +195,7 @@ struct hdmi_context {
>>         struct hdmi_resources           res;
>>
>>         int                             hpd_gpio;
>> +       u32                             max_pixel_clock;
>>
>>         enum hdmi_type                  type;
>>  };
>> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>>         if (ret)
>>                 return MODE_BAD;
>>
>> +       if (mode->clock * 1000 > hdata->max_pixel_clock)
>> +               return MODE_BAD;
>> +
>>         ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
>>         if (ret < 0)
>>                 return MODE_BAD;
>> @@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>>                 return NULL;
>>         }
>>
>> +       of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
>> +
>>         return pd;
>>  }
>>
>> @@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
>>         if (!pdata)
>>                 return -EINVAL;
>>
>> +       if (!pdata->max_pixel_clock) {
>> +               DRM_INFO("max-pixel-clock is zero, using INF\n");
>> +               pdata->max_pixel_clock = U32_MAX;
>> +       }
>> +
>>         hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
>>         if (!hdata)
>>                 return -ENOMEM;
>> @@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
>>         hdata->type = drv_data->type;
>>
>>         hdata->hpd_gpio = pdata->hpd_gpio;
>> +       hdata->max_pixel_clock = pdata->max_pixel_clock;
>>         hdata->dev = dev;
>>
>>         ret = hdmi_resources_init(hdata);
>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>> index 181642b..7272d65 100644
>> --- a/include/media/s5p_hdmi.h
>> +++ b/include/media/s5p_hdmi.h
>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>         int mhl_bus;
>>         struct i2c_board_info *mhl_info;
>>         int hpd_gpio;
>> +       u32 max_pixel_clock;
>>  };
> 
> We have already removed Non DT support from the drm hdmi
> driver. IMO we should not be extending the pdata struct.
> 
> Regards,
> Rahul Sharma

Hi Rahul,

This is not a non-DT patch. The s5p_hdmi_platform_data is
generated from DT itself. This structure is just
a parsed version of DT attributes.

It may be a good idea to rename s5p_hdmi_platform_data
to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
or parse DT directly in probe function.

I can prepare a patch for that.

Regards,
Tomasz Stanislawski


> 
>>
>>  #endif /* S5P_HDMI_H */
>> --
>> 1.7.9.5
>>
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel


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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15 13:11       ` Tomasz Stanislawski
  (?)
@ 2014-04-15 13:42       ` Rahul Sharma
  2014-04-15 14:29         ` Tomasz Stanislawski
  -1 siblings, 1 reply; 20+ messages in thread
From: Rahul Sharma @ 2014-04-15 13:42 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, Pawel Moll, b.zolnierkie, sw0312.kim,
	sunil joshi, dri-devel@lists.freedesktop.org, m.chehab,
	Kyungmin Park, Rob Herring, Rahul Sharma,
	linux-media@vger.kernel.org

On 15 April 2014 18:41, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
> On 04/15/2014 11:42 AM, Rahul Sharma wrote:
>> Hi Tomasz,
>>
>> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>> Adds support for limitation of maximal pixel clock of HDMI
>>> signal. This feature is needed on boards that contains
>>> lines or bridges with frequency limitations.
>>>
>>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
>>> ---
>>>  .../devicetree/bindings/video/exynos_hdmi.txt      |    4 ++++
>>>  drivers/gpu/drm/exynos/exynos_hdmi.c               |   12 ++++++++++++
>>>  include/media/s5p_hdmi.h                           |    1 +
>>>  3 files changed, 17 insertions(+)
>>>
>>> diff --git a/Documentation/devicetree/bindings/video/exynos_hdmi.txt b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>>> index f9187a2..8718f8d 100644
>>> --- a/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>>> +++ b/Documentation/devicetree/bindings/video/exynos_hdmi.txt
>>> @@ -28,6 +28,10 @@ Required properties:
>>>  - ddc: phandle to the hdmi ddc node
>>>  - phy: phandle to the hdmi phy node
>>>
>>> +Optional properties:
>>> +- max-pixel-clock: used to limit the maximal pixel clock if a board has lines,
>>> +       connectors or bridges not capable of carring higher frequencies
>>> +
>>>  Example:
>>>
>>>         hdmi {
>>> diff --git a/drivers/gpu/drm/exynos/exynos_hdmi.c b/drivers/gpu/drm/exynos/exynos_hdmi.c
>>> index 2a18f4e..404f1b7 100644
>>> --- a/drivers/gpu/drm/exynos/exynos_hdmi.c
>>> +++ b/drivers/gpu/drm/exynos/exynos_hdmi.c
>>> @@ -195,6 +195,7 @@ struct hdmi_context {
>>>         struct hdmi_resources           res;
>>>
>>>         int                             hpd_gpio;
>>> +       u32                             max_pixel_clock;
>>>
>>>         enum hdmi_type                  type;
>>>  };
>>> @@ -887,6 +888,9 @@ static int hdmi_mode_valid(struct drm_connector *connector,
>>>         if (ret)
>>>                 return MODE_BAD;
>>>
>>> +       if (mode->clock * 1000 > hdata->max_pixel_clock)
>>> +               return MODE_BAD;
>>> +
>>>         ret = hdmi_find_phy_conf(hdata, mode->clock * 1000);
>>>         if (ret < 0)
>>>                 return MODE_BAD;
>>> @@ -2031,6 +2035,8 @@ static struct s5p_hdmi_platform_data *drm_hdmi_dt_parse_pdata
>>>                 return NULL;
>>>         }
>>>
>>> +       of_property_read_u32(np, "max-pixel-clock", &pd->max_pixel_clock);
>>> +
>>>         return pd;
>>>  }
>>>
>>> @@ -2067,6 +2073,11 @@ static int hdmi_probe(struct platform_device *pdev)
>>>         if (!pdata)
>>>                 return -EINVAL;
>>>
>>> +       if (!pdata->max_pixel_clock) {
>>> +               DRM_INFO("max-pixel-clock is zero, using INF\n");
>>> +               pdata->max_pixel_clock = U32_MAX;
>>> +       }
>>> +
>>>         hdata = devm_kzalloc(dev, sizeof(struct hdmi_context), GFP_KERNEL);
>>>         if (!hdata)
>>>                 return -ENOMEM;
>>> @@ -2083,6 +2094,7 @@ static int hdmi_probe(struct platform_device *pdev)
>>>         hdata->type = drv_data->type;
>>>
>>>         hdata->hpd_gpio = pdata->hpd_gpio;
>>> +       hdata->max_pixel_clock = pdata->max_pixel_clock;
>>>         hdata->dev = dev;
>>>
>>>         ret = hdmi_resources_init(hdata);
>>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>>> index 181642b..7272d65 100644
>>> --- a/include/media/s5p_hdmi.h
>>> +++ b/include/media/s5p_hdmi.h
>>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>>         int mhl_bus;
>>>         struct i2c_board_info *mhl_info;
>>>         int hpd_gpio;
>>> +       u32 max_pixel_clock;
>>>  };
>>
>> We have already removed Non DT support from the drm hdmi
>> driver. IMO we should not be extending the pdata struct.
>>
>> Regards,
>> Rahul Sharma
>
> Hi Rahul,
>
> This is not a non-DT patch. The s5p_hdmi_platform_data is
> generated from DT itself. This structure is just
> a parsed version of DT attributes.
>
> It may be a good idea to rename s5p_hdmi_platform_data
> to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
> or parse DT directly in probe function.
>
> I can prepare a patch for that.

Else we can completely remove the dependency from
s5p_hdmi_platform_data. We can directly assign to hdmi context
variables. Later we can remove that struct itself from include/.
What you say?

Regards,
Rahul Sharma

>
> Regards,
> Tomasz Stanislawski
>
>
>>
>>>
>>>  #endif /* S5P_HDMI_H */
>>> --
>>> 1.7.9.5
>>>
>>> _______________________________________________
>>> dri-devel mailing list
>>> dri-devel@lists.freedesktop.org
>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15 13:42       ` Rahul Sharma
@ 2014-04-15 14:29         ` Tomasz Stanislawski
  2014-04-16  2:07             ` Rahul Sharma
  0 siblings, 1 reply; 20+ messages in thread
From: Tomasz Stanislawski @ 2014-04-15 14:29 UTC (permalink / raw)
  To: Rahul Sharma
  Cc: linux-samsung-soc, Pawel Moll, b.zolnierkie, sw0312.kim,
	sunil joshi, dri-devel@lists.freedesktop.org, m.chehab,
	Kyungmin Park, Rob Herring, Rahul Sharma,
	linux-media@vger.kernel.org

On 04/15/2014 03:42 PM, Rahul Sharma wrote:
> On 15 April 2014 18:41, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>> On 04/15/2014 11:42 AM, Rahul Sharma wrote:
>>> Hi Tomasz,
>>>
>>> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>>> Adds support for limitation of maximal pixel clock of HDMI
>>>> signal. This feature is needed on boards that contains
>>>> lines or bridges with frequency limitations.
>>>>
>>>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
[snip]

>>>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>>>> index 181642b..7272d65 100644
>>>> --- a/include/media/s5p_hdmi.h
>>>> +++ b/include/media/s5p_hdmi.h
>>>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>>>         int mhl_bus;
>>>>         struct i2c_board_info *mhl_info;
>>>>         int hpd_gpio;
>>>> +       u32 max_pixel_clock;
>>>>  };
>>>
>>> We have already removed Non DT support from the drm hdmi
>>> driver. IMO we should not be extending the pdata struct.
>>>
>>> Regards,
>>> Rahul Sharma
>>
>> Hi Rahul,
>>
>> This is not a non-DT patch. The s5p_hdmi_platform_data is
>> generated from DT itself. This structure is just
>> a parsed version of DT attributes.
>>
>> It may be a good idea to rename s5p_hdmi_platform_data
>> to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
>> or parse DT directly in probe function.
>>
>> I can prepare a patch for that.
> 
> Else we can completely remove the dependency from
> s5p_hdmi_platform_data. We can directly assign to hdmi context
> variables. Later we can remove that struct itself from include/.
> What you say?

This structure cannot be removed from include yet because it is used by s5p-tv driver.
However its usage can be removed from both drivers.
I can prepare both.

> 
> Regards,
> Rahul Sharma
> 

Regards,
Tomasz Stanislawski

>>
>> Regards,
>> Tomasz Stanislawski
>>
>>
>>>
>>>>
>>>>  #endif /* S5P_HDMI_H */
>>>> --
>>>> 1.7.9.5
>>>>
>>>> _______________________________________________
>>>> dri-devel mailing list
>>>> dri-devel@lists.freedesktop.org
>>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>
> 

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
  2014-04-15 14:29         ` Tomasz Stanislawski
@ 2014-04-16  2:07             ` Rahul Sharma
  0 siblings, 0 replies; 20+ messages in thread
From: Rahul Sharma @ 2014-04-16  2:07 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, linux-media@vger.kernel.org, Pawel Moll,
	b.zolnierkie, sw0312.kim, sunil joshi,
	dri-devel@lists.freedesktop.org, Kyungmin Park, Rob Herring,
	Rahul Sharma, m.chehab

On 15 April 2014 19:59, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
> On 04/15/2014 03:42 PM, Rahul Sharma wrote:
>> On 15 April 2014 18:41, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>> On 04/15/2014 11:42 AM, Rahul Sharma wrote:
>>>> Hi Tomasz,
>>>>
>>>> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>>>> Adds support for limitation of maximal pixel clock of HDMI
>>>>> signal. This feature is needed on boards that contains
>>>>> lines or bridges with frequency limitations.
>>>>>
>>>>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> [snip]
>
>>>>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>>>>> index 181642b..7272d65 100644
>>>>> --- a/include/media/s5p_hdmi.h
>>>>> +++ b/include/media/s5p_hdmi.h
>>>>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>>>>         int mhl_bus;
>>>>>         struct i2c_board_info *mhl_info;
>>>>>         int hpd_gpio;
>>>>> +       u32 max_pixel_clock;
>>>>>  };
>>>>
>>>> We have already removed Non DT support from the drm hdmi
>>>> driver. IMO we should not be extending the pdata struct.
>>>>
>>>> Regards,
>>>> Rahul Sharma
>>>
>>> Hi Rahul,
>>>
>>> This is not a non-DT patch. The s5p_hdmi_platform_data is
>>> generated from DT itself. This structure is just
>>> a parsed version of DT attributes.
>>>
>>> It may be a good idea to rename s5p_hdmi_platform_data
>>> to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
>>> or parse DT directly in probe function.
>>>
>>> I can prepare a patch for that.
>>
>> Else we can completely remove the dependency from
>> s5p_hdmi_platform_data. We can directly assign to hdmi context
>> variables. Later we can remove that struct itself from include/.
>> What you say?
>
> This structure cannot be removed from include yet because it is used by s5p-tv driver.
> However its usage can be removed from both drivers.
> I can prepare both.
>

yea correct. but if you doing it for both of them, it can be removed, I guess.
your call.

Regards,
Rahul Sharma

>>
>> Regards,
>> Rahul Sharma
>>
>
> Regards,
> Tomasz Stanislawski
>
>>>
>>> Regards,
>>> Tomasz Stanislawski
>>>
>>>
>>>>
>>>>>
>>>>>  #endif /* S5P_HDMI_H */
>>>>> --
>>>>> 1.7.9.5
>>>>>
>>>>> _______________________________________________
>>>>> dri-devel mailing list
>>>>> dri-devel@lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>

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

* Re: [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation
@ 2014-04-16  2:07             ` Rahul Sharma
  0 siblings, 0 replies; 20+ messages in thread
From: Rahul Sharma @ 2014-04-16  2:07 UTC (permalink / raw)
  To: Tomasz Stanislawski
  Cc: linux-samsung-soc, Pawel Moll, b.zolnierkie, sw0312.kim,
	sunil joshi, dri-devel@lists.freedesktop.org, m.chehab,
	Kyungmin Park, Rob Herring, Rahul Sharma,
	linux-media@vger.kernel.org

On 15 April 2014 19:59, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
> On 04/15/2014 03:42 PM, Rahul Sharma wrote:
>> On 15 April 2014 18:41, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>> On 04/15/2014 11:42 AM, Rahul Sharma wrote:
>>>> Hi Tomasz,
>>>>
>>>> On 15 April 2014 14:57, Tomasz Stanislawski <t.stanislaws@samsung.com> wrote:
>>>>> Adds support for limitation of maximal pixel clock of HDMI
>>>>> signal. This feature is needed on boards that contains
>>>>> lines or bridges with frequency limitations.
>>>>>
>>>>> Signed-off-by: Tomasz Stanislawski <t.stanislaws@samsung.com>
> [snip]
>
>>>>> diff --git a/include/media/s5p_hdmi.h b/include/media/s5p_hdmi.h
>>>>> index 181642b..7272d65 100644
>>>>> --- a/include/media/s5p_hdmi.h
>>>>> +++ b/include/media/s5p_hdmi.h
>>>>> @@ -31,6 +31,7 @@ struct s5p_hdmi_platform_data {
>>>>>         int mhl_bus;
>>>>>         struct i2c_board_info *mhl_info;
>>>>>         int hpd_gpio;
>>>>> +       u32 max_pixel_clock;
>>>>>  };
>>>>
>>>> We have already removed Non DT support from the drm hdmi
>>>> driver. IMO we should not be extending the pdata struct.
>>>>
>>>> Regards,
>>>> Rahul Sharma
>>>
>>> Hi Rahul,
>>>
>>> This is not a non-DT patch. The s5p_hdmi_platform_data is
>>> generated from DT itself. This structure is just
>>> a parsed version of DT attributes.
>>>
>>> It may be a good idea to rename s5p_hdmi_platform_data
>>> to exynos_hdmi_pdata and move it to exynos_hdmi_drm.c file
>>> or parse DT directly in probe function.
>>>
>>> I can prepare a patch for that.
>>
>> Else we can completely remove the dependency from
>> s5p_hdmi_platform_data. We can directly assign to hdmi context
>> variables. Later we can remove that struct itself from include/.
>> What you say?
>
> This structure cannot be removed from include yet because it is used by s5p-tv driver.
> However its usage can be removed from both drivers.
> I can prepare both.
>

yea correct. but if you doing it for both of them, it can be removed, I guess.
your call.

Regards,
Rahul Sharma

>>
>> Regards,
>> Rahul Sharma
>>
>
> Regards,
> Tomasz Stanislawski
>
>>>
>>> Regards,
>>> Tomasz Stanislawski
>>>
>>>
>>>>
>>>>>
>>>>>  #endif /* S5P_HDMI_H */
>>>>> --
>>>>> 1.7.9.5
>>>>>
>>>>> _______________________________________________
>>>>> dri-devel mailing list
>>>>> dri-devel@lists.freedesktop.org
>>>>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
>>>
>>
>

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

end of thread, other threads:[~2014-04-16  2:07 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-04-15  9:27 [PATCHv2 0/4] drm: exynos: update/fixes to HDMI driver Tomasz Stanislawski
2014-04-15  9:27 ` Tomasz Stanislawski
2014-04-15  9:27 ` [PATCHv2 1/4] drm: exynos: hdmi: simplify extracting hpd-gpio from DT Tomasz Stanislawski
2014-04-15  9:27   ` Tomasz Stanislawski
2014-04-15  9:27 ` [PATCHv2 2/4] drm: exynos: mixer: fix using usleep() in atomic context Tomasz Stanislawski
2014-04-15  9:27   ` Tomasz Stanislawski
2014-04-15  9:27 ` [PATCHv2 3/4] drm: exynos: add compatibles for HDMI and Mixer chips and exynos4210 SoC Tomasz Stanislawski
2014-04-15  9:27   ` Tomasz Stanislawski
2014-04-15  9:27 ` [PATCHv2 4/4] drm: exynos: hdmi: add support for pixel clock limitation Tomasz Stanislawski
2014-04-15  9:27   ` Tomasz Stanislawski
2014-04-15  9:42   ` Rahul Sharma
2014-04-15  9:42     ` Rahul Sharma
2014-04-15 13:11     ` Tomasz Stanislawski
2014-04-15 13:11       ` Tomasz Stanislawski
2014-04-15 13:42       ` Rahul Sharma
2014-04-15 14:29         ` Tomasz Stanislawski
2014-04-16  2:07           ` Rahul Sharma
2014-04-16  2:07             ` Rahul Sharma
2014-04-15  9:49   ` Lucas Stach
2014-04-15  9:49     ` Lucas Stach

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.