All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915: fix hdmi portclock limits on Haswell
@ 2013-07-21 14:14 Daniel Vetter
  2013-07-22  6:05 ` [PATCH] drm/i915: fix hdmi portclock limits Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2013-07-21 14:14 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

In

commit 325b9d048810f7689ec644595061c0b700e64bce
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Apr 19 11:24:33 2013 +0200

    drm/i915: fixup 12bpc hdmi dotclock handling

I've errornously claimed that we don't yet support the hdmi 1.4
dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
the wrpll table showed that we've supported port clocks up to 300MHz.

With the new code to dynamically compute wrpll limits we should have
no issues going up to the full 340 MHz range of hdmi 1.4, so let's
just use that to fix this regression. That'll allow 4k over hdmi for
free!

v2: Drop the random hunk that somehow slipped in.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
Tested-by: Andreas Reis <andreas.reis@gmail.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 98df2a0..29b6028 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -806,6 +806,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	struct drm_device *dev = encoder->base.dev;
 	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
 	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
+	int portclock_limit = IS_HASWELL(dev) ? 340000 : 225000;
 	int desired_bpp;
 
 	if (intel_hdmi->color_range_auto) {
@@ -829,7 +830,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	 * outputs. We also need to check that the higher clock still fits
 	 * within limits.
 	 */
-	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
+	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
 	    && HAS_PCH_SPLIT(dev)) {
 		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
 		desired_bpp = 12*3;
@@ -846,7 +847,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 		pipe_config->pipe_bpp = desired_bpp;
 	}
 
-	if (adjusted_mode->clock > 225000) {
+	if (adjusted_mode->clock > portclock_limit) {
 		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
 		return false;
 	}
-- 
1.8.3.2

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

* [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-21 14:14 [PATCH] drm/i915: fix hdmi portclock limits on Haswell Daniel Vetter
@ 2013-07-22  6:05 ` Daniel Vetter
  2013-07-22 11:11   ` Daniel Vetter
  2013-07-22 11:17   ` Damien Lespiau
  0 siblings, 2 replies; 8+ messages in thread
From: Daniel Vetter @ 2013-07-22  6:05 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

In

commit 325b9d048810f7689ec644595061c0b700e64bce
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Apr 19 11:24:33 2013 +0200

    drm/i915: fixup 12bpc hdmi dotclock handling

I've errornously claimed that we don't yet support the hdmi 1.4
dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
the wrpll table showed that we've supported port clocks up to 300MHz.

With the new code to dynamically compute wrpll limits we should have
no issues going up to the full 340 MHz range of hdmi 1.4, so let's
just use that to fix this regression. That'll allow 4k over hdmi for
free!

v2: Drop the random hunk that somehow slipped in.

v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
patch up the mode filtering. To do so extract the dotclock limits into
a little helper function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 98df2a0..23874a3 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -785,10 +785,22 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
 	}
 }
 
+static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
+{
+	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
+
+	if (IS_G4X(dev))
+		return 165000;
+	else if (IS_HASWELL(dev))
+		return 340000;
+	else
+		return 225000;
+}
+
 static int intel_hdmi_mode_valid(struct drm_connector *connector,
 				 struct drm_display_mode *mode)
 {
-	if (mode->clock > 165000)
+	if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector)))
 		return MODE_CLOCK_HIGH;
 	if (mode->clock < 20000)
 		return MODE_CLOCK_LOW;
@@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	struct drm_device *dev = encoder->base.dev;
 	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
 	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
+	int portclock_limit = hdmi_portclock_limit(intel_hdmi);
 	int desired_bpp;
 
 	if (intel_hdmi->color_range_auto) {
@@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	 * outputs. We also need to check that the higher clock still fits
 	 * within limits.
 	 */
-	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
+	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
 	    && HAS_PCH_SPLIT(dev)) {
 		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
 		desired_bpp = 12*3;
@@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 		pipe_config->pipe_bpp = desired_bpp;
 	}
 
-	if (adjusted_mode->clock > 225000) {
+	if (adjusted_mode->clock > portclock_limit) {
 		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
 		return false;
 	}
-- 
1.8.3.2

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

* Re: [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22  6:05 ` [PATCH] drm/i915: fix hdmi portclock limits Daniel Vetter
@ 2013-07-22 11:11   ` Daniel Vetter
  2013-07-22 11:17   ` Damien Lespiau
  1 sibling, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2013-07-22 11:11 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

On Mon, Jul 22, 2013 at 08:05:10AM +0200, Daniel Vetter wrote:
> In
> 
> commit 325b9d048810f7689ec644595061c0b700e64bce
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Fri Apr 19 11:24:33 2013 +0200
> 
>     drm/i915: fixup 12bpc hdmi dotclock handling
> 
> I've errornously claimed that we don't yet support the hdmi 1.4
> dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
> the wrpll table showed that we've supported port clocks up to 300MHz.
> 
> With the new code to dynamically compute wrpll limits we should have
> no issues going up to the full 340 MHz range of hdmi 1.4, so let's
> just use that to fix this regression. That'll allow 4k over hdmi for
> free!
> 
> v2: Drop the random hunk that somehow slipped in.
> 
> v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
> patch up the mode filtering. To do so extract the dotclock limits into
> a little helper function.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
> Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Andreas Reis just upgrade his tested-by to v3.
-Daniel

> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 98df2a0..23874a3 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -785,10 +785,22 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
>  	}
>  }
>  
> +static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
> +{
> +	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> +
> +	if (IS_G4X(dev))
> +		return 165000;
> +	else if (IS_HASWELL(dev))
> +		return 340000;
> +	else
> +		return 225000;
> +}
> +
>  static int intel_hdmi_mode_valid(struct drm_connector *connector,
>  				 struct drm_display_mode *mode)
>  {
> -	if (mode->clock > 165000)
> +	if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector)))
>  		return MODE_CLOCK_HIGH;
>  	if (mode->clock < 20000)
>  		return MODE_CLOCK_LOW;
> @@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	struct drm_device *dev = encoder->base.dev;
>  	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
>  	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
> +	int portclock_limit = hdmi_portclock_limit(intel_hdmi);
>  	int desired_bpp;
>  
>  	if (intel_hdmi->color_range_auto) {
> @@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	 * outputs. We also need to check that the higher clock still fits
>  	 * within limits.
>  	 */
> -	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
> +	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
>  	    && HAS_PCH_SPLIT(dev)) {
>  		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
>  		desired_bpp = 12*3;
> @@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  		pipe_config->pipe_bpp = desired_bpp;
>  	}
>  
> -	if (adjusted_mode->clock > 225000) {
> +	if (adjusted_mode->clock > portclock_limit) {
>  		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
>  		return false;
>  	}
> -- 
> 1.8.3.2
> 

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

* Re: [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22  6:05 ` [PATCH] drm/i915: fix hdmi portclock limits Daniel Vetter
  2013-07-22 11:11   ` Daniel Vetter
@ 2013-07-22 11:17   ` Damien Lespiau
  2013-07-22 14:36     ` Damien Lespiau
  1 sibling, 1 reply; 8+ messages in thread
From: Damien Lespiau @ 2013-07-22 11:17 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Mon, Jul 22, 2013 at 08:05:10AM +0200, Daniel Vetter wrote:
> +static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
> +{
> +	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> +
> +	if (IS_G4X(dev))
> +		return 165000;
> +	else if (IS_HASWELL(dev))
> +		return 340000;

I read 300MHz in the BSpec?

> +	else
> +		return 225000;
> +}
> +
>  static int intel_hdmi_mode_valid(struct drm_connector *connector,
>  				 struct drm_display_mode *mode)
>  {
> -	if (mode->clock > 165000)
> +	if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector)))
>  		return MODE_CLOCK_HIGH;
>  	if (mode->clock < 20000)
>  		return MODE_CLOCK_LOW;
> @@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	struct drm_device *dev = encoder->base.dev;
>  	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
>  	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
> +	int portclock_limit = hdmi_portclock_limit(intel_hdmi);
>  	int desired_bpp;
>  
>  	if (intel_hdmi->color_range_auto) {
> @@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	 * outputs. We also need to check that the higher clock still fits
>  	 * within limits.
>  	 */
> -	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
> +	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
>  	    && HAS_PCH_SPLIT(dev)) {
>  		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
>  		desired_bpp = 12*3;
> @@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  		pipe_config->pipe_bpp = desired_bpp;
>  	}
>  
> -	if (adjusted_mode->clock > 225000) {
> +	if (adjusted_mode->clock > portclock_limit) {
>  		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
>  		return false;
>  	}
> -- 
> 1.8.3.2
> 

-- 
Damien

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

* Re: [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22 11:17   ` Damien Lespiau
@ 2013-07-22 14:36     ` Damien Lespiau
  2013-07-22 16:02       ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Lespiau @ 2013-07-22 14:36 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Mon, Jul 22, 2013 at 12:17:12PM +0100, Damien Lespiau wrote:
> On Mon, Jul 22, 2013 at 08:05:10AM +0200, Daniel Vetter wrote:
> > +static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
> > +{
> > +	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> > +
> > +	if (IS_G4X(dev))
> > +		return 165000;
> > +	else if (IS_HASWELL(dev))
> > +		return 340000;
> 
> I read 300MHz in the BSpec?

To expand a bit here, HDMI 1.3 and 1.4 have their upper limit defined to
340MHz, but not every piece of hardware is able to achieve that. In our
case the limit seems to be 300MHz for HSW (which apparently is already
enough for some 4k resolutions).

HDMI 1.x and QHD is not that interesting, it can only up to 30Hz. DP
seems the way to go there until HDMI 2.0

-- 
Damien

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

* [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22 14:36     ` Damien Lespiau
@ 2013-07-22 16:02       ` Daniel Vetter
  2013-07-22 16:24         ` Damien Lespiau
  0 siblings, 1 reply; 8+ messages in thread
From: Daniel Vetter @ 2013-07-22 16:02 UTC (permalink / raw)
  To: Intel Graphics Development; +Cc: Daniel Vetter

In

commit 325b9d048810f7689ec644595061c0b700e64bce
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date:   Fri Apr 19 11:24:33 2013 +0200

    drm/i915: fixup 12bpc hdmi dotclock handling

I've errornously claimed that we don't yet support the hdmi 1.4
dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
the wrpll table showed that we've supported port clocks up to 300MHz.

With the new code to dynamically compute wrpll limits we should have
no issues going up to the full 340 MHz range of hdmi 1.4, so let's
just use that to fix this regression. That'll allow 4k over hdmi for
free!

v2: Drop the random hunk that somehow slipped in.

v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
patch up the mode filtering. To do so extract the dotclock limits into
a little helper function.

v4: Use 300MHz (from Bspec) instead of 340MHz (upper limit for hdmi
1.3), apparently hw is not required to be able to drive the highest
dotclocks. Suggested by Damien.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
Cc: Damien Lespiau <damien.lespiau@intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
---
 drivers/gpu/drm/i915/intel_hdmi.c | 19 ++++++++++++++++---
 1 file changed, 16 insertions(+), 3 deletions(-)

diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
index 98df2a0..2fd3fd5 100644
--- a/drivers/gpu/drm/i915/intel_hdmi.c
+++ b/drivers/gpu/drm/i915/intel_hdmi.c
@@ -785,10 +785,22 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
 	}
 }
 
+static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
+{
+	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
+
+	if (IS_G4X(dev))
+		return 165000;
+	else if (IS_HASWELL(dev))
+		return 300000;
+	else
+		return 225000;
+}
+
 static int intel_hdmi_mode_valid(struct drm_connector *connector,
 				 struct drm_display_mode *mode)
 {
-	if (mode->clock > 165000)
+	if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector)))
 		return MODE_CLOCK_HIGH;
 	if (mode->clock < 20000)
 		return MODE_CLOCK_LOW;
@@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	struct drm_device *dev = encoder->base.dev;
 	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
 	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
+	int portclock_limit = hdmi_portclock_limit(intel_hdmi);
 	int desired_bpp;
 
 	if (intel_hdmi->color_range_auto) {
@@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 	 * outputs. We also need to check that the higher clock still fits
 	 * within limits.
 	 */
-	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
+	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
 	    && HAS_PCH_SPLIT(dev)) {
 		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
 		desired_bpp = 12*3;
@@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
 		pipe_config->pipe_bpp = desired_bpp;
 	}
 
-	if (adjusted_mode->clock > 225000) {
+	if (adjusted_mode->clock > portclock_limit) {
 		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
 		return false;
 	}
-- 
1.8.3.2

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

* Re: [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22 16:02       ` Daniel Vetter
@ 2013-07-22 16:24         ` Damien Lespiau
  2013-07-22 16:35           ` Daniel Vetter
  0 siblings, 1 reply; 8+ messages in thread
From: Damien Lespiau @ 2013-07-22 16:24 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: Intel Graphics Development

On Mon, Jul 22, 2013 at 06:02:39PM +0200, Daniel Vetter wrote:
> In
> 
> commit 325b9d048810f7689ec644595061c0b700e64bce
> Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> Date:   Fri Apr 19 11:24:33 2013 +0200
> 
>     drm/i915: fixup 12bpc hdmi dotclock handling
> 
> I've errornously claimed that we don't yet support the hdmi 1.4
> dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
> the wrpll table showed that we've supported port clocks up to 300MHz.
> 
> With the new code to dynamically compute wrpll limits we should have
> no issues going up to the full 340 MHz range of hdmi 1.4, so let's
> just use that to fix this regression. That'll allow 4k over hdmi for
> free!
> 
> v2: Drop the random hunk that somehow slipped in.
> 
> v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
> patch up the mode filtering. To do so extract the dotclock limits into
> a little helper function.
> 
> v4: Use 300MHz (from Bspec) instead of 340MHz (upper limit for hdmi
> 1.3), apparently hw is not required to be able to drive the highest
> dotclocks. Suggested by Damien.
> 
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
> Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
> Cc: Damien Lespiau <damien.lespiau@intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>

Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

-- 
Damien

> ---
>  drivers/gpu/drm/i915/intel_hdmi.c | 19 ++++++++++++++++---
>  1 file changed, 16 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c
> index 98df2a0..2fd3fd5 100644
> --- a/drivers/gpu/drm/i915/intel_hdmi.c
> +++ b/drivers/gpu/drm/i915/intel_hdmi.c
> @@ -785,10 +785,22 @@ static void intel_disable_hdmi(struct intel_encoder *encoder)
>  	}
>  }
>  
> +static int hdmi_portclock_limit(struct intel_hdmi *hdmi)
> +{
> +	struct drm_device *dev = intel_hdmi_to_dev(hdmi);
> +
> +	if (IS_G4X(dev))
> +		return 165000;
> +	else if (IS_HASWELL(dev))
> +		return 300000;
> +	else
> +		return 225000;
> +}
> +
>  static int intel_hdmi_mode_valid(struct drm_connector *connector,
>  				 struct drm_display_mode *mode)
>  {
> -	if (mode->clock > 165000)
> +	if (mode->clock > hdmi_portclock_limit(intel_attached_hdmi(connector)))
>  		return MODE_CLOCK_HIGH;
>  	if (mode->clock < 20000)
>  		return MODE_CLOCK_LOW;
> @@ -806,6 +818,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	struct drm_device *dev = encoder->base.dev;
>  	struct drm_display_mode *adjusted_mode = &pipe_config->adjusted_mode;
>  	int clock_12bpc = pipe_config->requested_mode.clock * 3 / 2;
> +	int portclock_limit = hdmi_portclock_limit(intel_hdmi);
>  	int desired_bpp;
>  
>  	if (intel_hdmi->color_range_auto) {
> @@ -829,7 +842,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  	 * outputs. We also need to check that the higher clock still fits
>  	 * within limits.
>  	 */
> -	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= 225000
> +	if (pipe_config->pipe_bpp > 8*3 && clock_12bpc <= portclock_limit
>  	    && HAS_PCH_SPLIT(dev)) {
>  		DRM_DEBUG_KMS("picking bpc to 12 for HDMI output\n");
>  		desired_bpp = 12*3;
> @@ -846,7 +859,7 @@ bool intel_hdmi_compute_config(struct intel_encoder *encoder,
>  		pipe_config->pipe_bpp = desired_bpp;
>  	}
>  
> -	if (adjusted_mode->clock > 225000) {
> +	if (adjusted_mode->clock > portclock_limit) {
>  		DRM_DEBUG_KMS("too high HDMI clock, rejecting mode\n");
>  		return false;
>  	}
> -- 
> 1.8.3.2
> 

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

* Re: [PATCH] drm/i915: fix hdmi portclock limits
  2013-07-22 16:24         ` Damien Lespiau
@ 2013-07-22 16:35           ` Daniel Vetter
  0 siblings, 0 replies; 8+ messages in thread
From: Daniel Vetter @ 2013-07-22 16:35 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: Daniel Vetter, Intel Graphics Development

On Mon, Jul 22, 2013 at 05:24:34PM +0100, Damien Lespiau wrote:
> On Mon, Jul 22, 2013 at 06:02:39PM +0200, Daniel Vetter wrote:
> > In
> > 
> > commit 325b9d048810f7689ec644595061c0b700e64bce
> > Author: Daniel Vetter <daniel.vetter@ffwll.ch>
> > Date:   Fri Apr 19 11:24:33 2013 +0200
> > 
> >     drm/i915: fixup 12bpc hdmi dotclock handling
> > 
> > I've errornously claimed that we don't yet support the hdmi 1.4
> > dotclocks > 225 MHz on Haswell. But a bug report and a closer look at
> > the wrpll table showed that we've supported port clocks up to 300MHz.
> > 
> > With the new code to dynamically compute wrpll limits we should have
> > no issues going up to the full 340 MHz range of hdmi 1.4, so let's
> > just use that to fix this regression. That'll allow 4k over hdmi for
> > free!
> > 
> > v2: Drop the random hunk that somehow slipped in.
> > 
> > v3: Cantiga has the original HDMI dotclock limit of 165MHz. And also
> > patch up the mode filtering. To do so extract the dotclock limits into
> > a little helper function.
> > 
> > v4: Use 300MHz (from Bspec) instead of 340MHz (upper limit for hdmi
> > 1.3), apparently hw is not required to be able to drive the highest
> > dotclocks. Suggested by Damien.
> > 
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67048
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67030
> > Tested-by: Andreas Reis <andreas.reis@gmail.com> (v2)
> > Cc: Damien Lespiau <damien.lespiau@intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> Reviewed-by: Damien Lespiau <damien.lespiau@intel.com>

Picked up for -fixes, thanks for the review.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

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

end of thread, other threads:[~2013-07-22 16:35 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-07-21 14:14 [PATCH] drm/i915: fix hdmi portclock limits on Haswell Daniel Vetter
2013-07-22  6:05 ` [PATCH] drm/i915: fix hdmi portclock limits Daniel Vetter
2013-07-22 11:11   ` Daniel Vetter
2013-07-22 11:17   ` Damien Lespiau
2013-07-22 14:36     ` Damien Lespiau
2013-07-22 16:02       ` Daniel Vetter
2013-07-22 16:24         ` Damien Lespiau
2013-07-22 16:35           ` Daniel Vetter

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.