diff mbox

[5/6] drm/i915: Implement ibx_digital_port_connected() for IBX

Message ID 1355414944-1494-5-git-send-email-damien.lespiau@gmail.com (mailing list archive)
State New, archived
Headers show

Commit Message

Damien Lespiau Dec. 13, 2012, 4:09 p.m. UTC
From: Damien Lespiau <damien.lespiau@intel.com>

CPT+ PCHs have different bit definition to read the HPD live status. I
don't have an ILK with digital ports handy, which is why this patch is
separate from the CPT+ implementation. If the docs don't lie, it should
all be fine though.

Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c | 44 +++++++++++++++++++++++-------------
 1 file changed, 28 insertions(+), 16 deletions(-)

Comments

Jani Nikula Dec. 14, 2012, 9:43 a.m. UTC | #1
On Thu, 13 Dec 2012, Damien Lespiau <damien.lespiau@gmail.com> wrote:
> From: Damien Lespiau <damien.lespiau@intel.com>
>
> CPT+ PCHs have different bit definition to read the HPD live status. I
> don't have an ILK with digital ports handy, which is why this patch is
> separate from the CPT+ implementation. If the docs don't lie, it should
> all be fine though.

As said, could be squashed into 2/6, but I understand your reason to
keep it separate.

Reviewed-by: Jani Nikula <jani.nikula@intel.com>


>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c | 44 +++++++++++++++++++++++-------------
>  1 file changed, 28 insertions(+), 16 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
> index 21fedf7..10759ea 100644
> --- a/drivers/gpu/drm/i915/intel_display.c
> +++ b/drivers/gpu/drm/i915/intel_display.c
> @@ -1006,22 +1006,34 @@ bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
>  {
>  	u32 bit;
>  
> -	/* XXX: IBX has different SDEISR bits */
> -	if (HAS_PCH_IBX(dev_priv->dev))
> -		return true;
> -
> -	switch(port->port) {
> -	case PORT_B:
> -		bit = SDE_PORTB_HOTPLUG_CPT;
> -		break;
> -	case PORT_C:
> -		bit = SDE_PORTC_HOTPLUG_CPT;
> -		break;
> -	case PORT_D:
> -		bit = SDE_PORTD_HOTPLUG_CPT;
> -		break;
> -	default:
> -		return true;
> +	if (HAS_PCH_IBX(dev_priv->dev)) {
> +		switch(port->port) {
> +		case PORT_B:
> +			bit = SDE_PORTB_HOTPLUG;
> +			break;
> +		case PORT_C:
> +			bit = SDE_PORTC_HOTPLUG;
> +			break;
> +		case PORT_D:
> +			bit = SDE_PORTD_HOTPLUG;
> +			break;
> +		default:
> +			return true;
> +		}
> +	} else {
> +		switch(port->port) {
> +		case PORT_B:
> +			bit = SDE_PORTB_HOTPLUG_CPT;
> +			break;
> +		case PORT_C:
> +			bit = SDE_PORTC_HOTPLUG_CPT;
> +			break;
> +		case PORT_D:
> +			bit = SDE_PORTD_HOTPLUG_CPT;
> +			break;
> +		default:
> +			return true;
> +		}
>  	}
>  
>  	return I915_READ(SDEISR) & bit;
> -- 
> 1.7.11.7
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

diff --git a/drivers/gpu/drm/i915/intel_display.c b/drivers/gpu/drm/i915/intel_display.c
index 21fedf7..10759ea 100644
--- a/drivers/gpu/drm/i915/intel_display.c
+++ b/drivers/gpu/drm/i915/intel_display.c
@@ -1006,22 +1006,34 @@  bool ibx_digital_port_connected(struct drm_i915_private *dev_priv,
 {
 	u32 bit;
 
-	/* XXX: IBX has different SDEISR bits */
-	if (HAS_PCH_IBX(dev_priv->dev))
-		return true;
-
-	switch(port->port) {
-	case PORT_B:
-		bit = SDE_PORTB_HOTPLUG_CPT;
-		break;
-	case PORT_C:
-		bit = SDE_PORTC_HOTPLUG_CPT;
-		break;
-	case PORT_D:
-		bit = SDE_PORTD_HOTPLUG_CPT;
-		break;
-	default:
-		return true;
+	if (HAS_PCH_IBX(dev_priv->dev)) {
+		switch(port->port) {
+		case PORT_B:
+			bit = SDE_PORTB_HOTPLUG;
+			break;
+		case PORT_C:
+			bit = SDE_PORTC_HOTPLUG;
+			break;
+		case PORT_D:
+			bit = SDE_PORTD_HOTPLUG;
+			break;
+		default:
+			return true;
+		}
+	} else {
+		switch(port->port) {
+		case PORT_B:
+			bit = SDE_PORTB_HOTPLUG_CPT;
+			break;
+		case PORT_C:
+			bit = SDE_PORTC_HOTPLUG_CPT;
+			break;
+		case PORT_D:
+			bit = SDE_PORTD_HOTPLUG_CPT;
+			break;
+		default:
+			return true;
+		}
 	}
 
 	return I915_READ(SDEISR) & bit;