diff mbox

[1/4] drm/i915: Detect SDVO/HDMI output always based on SDVO_B detection bit

Message ID 1249520572-28972-1-git-send-email-yakui.zhao@intel.com (mailing list archive)
State Superseded
Headers show

Commit Message

Zhao, Yakui Aug. 6, 2009, 1:02 a.m. UTC
From: Ma Ling <ling.ma@intel.com>

After the following commit is shipped, the SDVO C detection will depend on
the SDVO_C/DP detion bit. 
commit 13520b051e8888dd3af9bda639d83e7df76613d1
Author: Kristian Høgsberg <krh@redhat.com>
Date:   Fri Mar 13 15:42:14 2009 -0400

    drm/i915: Read the right SDVO register when detecting SVDO/HDMI.

In fact it is incorrect. According to the spec we should continue to
detect the SDVO_B/C based on the SDVO_B detection bit.
Of course the detection bit is defined in G4X platform. But it is for
the HDMI_C detection rather than SDVO_C detection.

https://bugs.freedesktop.org/show_bug.cgi?id=20639

Signed-off-by: Ma Ling <ling.ma@intel.com>
Acked-by: Zhao Yakui <yakui.zhao@intel.com>
---
 drivers/gpu/drm/i915/intel_display.c |   18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

Comments

Zhao, Yakui Aug. 6, 2009, 2 a.m. UTC | #1
On Thu, 2009-08-06 at 09:02 +0800, yakui.zhao@intel.com wrote:
> From: Ma Ling <ling.ma@intel.com>
Will you please pick up this patch set from Ma ling?
   The following four patches are included in this patch set:
   1. Detect SDVO output always based on SDVO_B detection bit
	this is a regression. And according to the spec we should continue to
detect SDVO_C by using SDVO_B detection bit.
   2. Set the crtc/clone_mask in every output device
	This will be set in the initialization of every output device. In such
case we can set the crtc/clone mask correctly. And this patch is to
avoid that one pipe is shared by two HDMIs.
   3. Set the TV_format based on connector type(integrated TV)
      When the connector type is S-video/composite, we had better use
the TV format that is for component. And we can get the correct
modeline.
   4. Enable PAL/SCEAM TV and add the property for SDVO TV 
	Add the support of PAL/SCEAM for SDVO TV. At the same time the property
is also added for SDVO TV.

thanks.
   Yakui
> 
> After the following commit is shipped, the SDVO C detection will depend on
> the SDVO_C/DP detion bit. 
> commit 13520b051e8888dd3af9bda639d83e7df76613d1
> Author: Kristian Høgsberg <krh@redhat.com>
> Date:   Fri Mar 13 15:42:14 2009 -0400
> 
>     drm/i915: Read the right SDVO register when detecting SVDO/HDMI.
> 
> In fact it is incorrect. According to the spec we should continue to
> detect the SDVO_B/C based on the SDVO_B detection bit.
> Of course the detection bit is defined in G4X platform. But it is for
> the HDMI_C detection rather than SDVO_C detection.
> 
> https://bugs.freedesktop.org/show_bug.cgi?id=20639
> 
> Signed-off-by: Ma Ling <ling.ma@intel.com>
> Acked-by: Zhao Yakui <yakui.zhao@intel.com>
> ---
>  drivers/gpu/drm/i915/intel_display.c |   18 +++++++++---------
>  1 file changed, 9 insertions(+), 9 deletions(-)
> 
> Index: linux-2.6/drivers/gpu/drm/i915/intel_display.c
> ===================================================================
> --- linux-2.6.orig/drivers/gpu/drm/i915/intel_display.c	2009-08-05 16:56:38.000000000 +0800
> +++ linux-2.6/drivers/gpu/drm/i915/intel_display.c	2009-08-05 17:09:20.000000000 +0800
> @@ -3218,30 +3218,30 @@
>  			intel_dp_init(dev, PCH_DP_D);
>  
>  	} else if (IS_I9XX(dev)) {
> -		int found;
> -		u32 reg;
> +		bool found = false;
>  
>  		if (I915_READ(SDVOB) & SDVO_DETECTED) {
>  			found = intel_sdvo_init(dev, SDVOB);
>  			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
>  				intel_hdmi_init(dev, SDVOB);
> +
>  			if (!found && SUPPORTS_INTEGRATED_DP(dev))
>  				intel_dp_init(dev, DP_B);
>  		}
>  
>  		/* Before G4X SDVOC doesn't have its own detect register */
> -		if (IS_G4X(dev))
> -			reg = SDVOC;
> -		else
> -			reg = SDVOB;
>  
> -		if (I915_READ(reg) & SDVO_DETECTED) {
> +		if (I915_READ(SDVOB) & SDVO_DETECTED)
>  			found = intel_sdvo_init(dev, SDVOC);
> -			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
> +
> +		if (!found && (I915_READ(SDVOC) & SDVO_DETECTED)) {
> +
> +			if (SUPPORTS_INTEGRATED_HDMI(dev))
>  				intel_hdmi_init(dev, SDVOC);
> -			if (!found && SUPPORTS_INTEGRATED_DP(dev))
> +			if (SUPPORTS_INTEGRATED_DP(dev))
>  				intel_dp_init(dev, DP_C);
>  		}
> +
>  		if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED))
>  			intel_dp_init(dev, DP_D);
>  	} else
Zhao, Yakui Aug. 13, 2009, 1:39 a.m. UTC | #2
On Thu, 2009-08-06 at 10:00 +0800, ykzhao wrote:
> On Thu, 2009-08-06 at 09:02 +0800, yakui.zhao@intel.com wrote:
> > From: Ma Ling <ling.ma@intel.com>
> Will you please pick up this patch set from Ma ling?
>    The following four patches are included in this patch set:
>    1. Detect SDVO output always based on SDVO_B detection bit
> 	this is a regression. And according to the spec we should continue to
> detect SDVO_C by using SDVO_B detection bit.
>    2. Set the crtc/clone_mask in every output device
> 	This will be set in the initialization of every output device. In such
> case we can set the crtc/clone mask correctly. And this patch is to
> avoid that one pipe is shared by two HDMIs.
>    3. Set the TV_format based on connector type(integrated TV)
>       When the connector type is S-video/composite, we had better use
> the TV format that is for component. And we can get the correct
> modeline.
>    4. Enable PAL/SCEAM TV and add the property for SDVO TV 
> 	Add the support of PAL/SCEAM for SDVO TV. At the same time the property
> is also added for SDVO TV.
Hi, Eric
    How about the patch set?
    Will you please apply the patch set?
thanks.
   Yakui
> 
> thanks.
>    Yakui
> > 
> > After the following commit is shipped, the SDVO C detection will depend on
> > the SDVO_C/DP detion bit. 
> > commit 13520b051e8888dd3af9bda639d83e7df76613d1
> > Author: Kristian Høgsberg <krh@redhat.com>
> > Date:   Fri Mar 13 15:42:14 2009 -0400
> > 
> >     drm/i915: Read the right SDVO register when detecting SVDO/HDMI.
> > 
> > In fact it is incorrect. According to the spec we should continue to
> > detect the SDVO_B/C based on the SDVO_B detection bit.
> > Of course the detection bit is defined in G4X platform. But it is for
> > the HDMI_C detection rather than SDVO_C detection.
> > 
> > https://bugs.freedesktop.org/show_bug.cgi?id=20639
> > 
> > Signed-off-by: Ma Ling <ling.ma@intel.com>
> > Acked-by: Zhao Yakui <yakui.zhao@intel.com>
> > ---
> >  drivers/gpu/drm/i915/intel_display.c |   18 +++++++++---------
> >  1 file changed, 9 insertions(+), 9 deletions(-)
> > 
> > Index: linux-2.6/drivers/gpu/drm/i915/intel_display.c
> > ===================================================================
> > --- linux-2.6.orig/drivers/gpu/drm/i915/intel_display.c	2009-08-05 16:56:38.000000000 +0800
> > +++ linux-2.6/drivers/gpu/drm/i915/intel_display.c	2009-08-05 17:09:20.000000000 +0800
> > @@ -3218,30 +3218,30 @@
> >  			intel_dp_init(dev, PCH_DP_D);
> >  
> >  	} else if (IS_I9XX(dev)) {
> > -		int found;
> > -		u32 reg;
> > +		bool found = false;
> >  
> >  		if (I915_READ(SDVOB) & SDVO_DETECTED) {
> >  			found = intel_sdvo_init(dev, SDVOB);
> >  			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
> >  				intel_hdmi_init(dev, SDVOB);
> > +
> >  			if (!found && SUPPORTS_INTEGRATED_DP(dev))
> >  				intel_dp_init(dev, DP_B);
> >  		}
> >  
> >  		/* Before G4X SDVOC doesn't have its own detect register */
> > -		if (IS_G4X(dev))
> > -			reg = SDVOC;
> > -		else
> > -			reg = SDVOB;
> >  
> > -		if (I915_READ(reg) & SDVO_DETECTED) {
> > +		if (I915_READ(SDVOB) & SDVO_DETECTED)
> >  			found = intel_sdvo_init(dev, SDVOC);
> > -			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
> > +
> > +		if (!found && (I915_READ(SDVOC) & SDVO_DETECTED)) {
> > +
> > +			if (SUPPORTS_INTEGRATED_HDMI(dev))
> >  				intel_hdmi_init(dev, SDVOC);
> > -			if (!found && SUPPORTS_INTEGRATED_DP(dev))
> > +			if (SUPPORTS_INTEGRATED_DP(dev))
> >  				intel_dp_init(dev, DP_C);
> >  		}
> > +
> >  		if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED))
> >  			intel_dp_init(dev, DP_D);
> >  	} else
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
diff mbox

Patch

Index: linux-2.6/drivers/gpu/drm/i915/intel_display.c
===================================================================
--- linux-2.6.orig/drivers/gpu/drm/i915/intel_display.c	2009-08-05 16:56:38.000000000 +0800
+++ linux-2.6/drivers/gpu/drm/i915/intel_display.c	2009-08-05 17:09:20.000000000 +0800
@@ -3218,30 +3218,30 @@ 
 			intel_dp_init(dev, PCH_DP_D);
 
 	} else if (IS_I9XX(dev)) {
-		int found;
-		u32 reg;
+		bool found = false;
 
 		if (I915_READ(SDVOB) & SDVO_DETECTED) {
 			found = intel_sdvo_init(dev, SDVOB);
 			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
 				intel_hdmi_init(dev, SDVOB);
+
 			if (!found && SUPPORTS_INTEGRATED_DP(dev))
 				intel_dp_init(dev, DP_B);
 		}
 
 		/* Before G4X SDVOC doesn't have its own detect register */
-		if (IS_G4X(dev))
-			reg = SDVOC;
-		else
-			reg = SDVOB;
 
-		if (I915_READ(reg) & SDVO_DETECTED) {
+		if (I915_READ(SDVOB) & SDVO_DETECTED)
 			found = intel_sdvo_init(dev, SDVOC);
-			if (!found && SUPPORTS_INTEGRATED_HDMI(dev))
+
+		if (!found && (I915_READ(SDVOC) & SDVO_DETECTED)) {
+
+			if (SUPPORTS_INTEGRATED_HDMI(dev))
 				intel_hdmi_init(dev, SDVOC);
-			if (!found && SUPPORTS_INTEGRATED_DP(dev))
+			if (SUPPORTS_INTEGRATED_DP(dev))
 				intel_dp_init(dev, DP_C);
 		}
+
 		if (SUPPORTS_INTEGRATED_DP(dev) && (I915_READ(DP_D) & DP_DETECTED))
 			intel_dp_init(dev, DP_D);
 	} else