[Intel-gfx] [PATCH 1/4 V2] drm/i915: Safely detect SDVO/HDMI output

Ma, Ling ling.ma at intel.com
Mon Jul 20 11:36:13 CEST 2009



>-----Original Message-----
>From: Ma, Ling
>Sent: 2009年7月20日 17:25
>To: Ma, Ling; eric at anholt.net
>Cc: intel-gfx at lists.freedesktop.org
>Subject: RE: [PATCH 1/4 V2] drm/i915: Safely detect SDVO/HDMI output
>
>
>Comments for this patch? Sometime on G4x platform we also need
>to check SDVOB port for sdvoc output when we plug SDVO card
>on G4X platform.
For example if we plug sdvo tv card on X-BLUE(G45C) platform,
our current code determine to init sdvoc output or not based on
condition :if (I915_READ(reg) & SDVO_DETECTED)/* reg is SDVOC */.
But on this platform the condition is false, so we failed to find
sdvo tv card.
Actually the patch is only sync patch with UMS code. 
>
>Thanks
>Ma Ling
>>-----Original Message-----
>>From: Ma, Ling
>>Sent: 2009年7月13日 17:58
>>To: eric at anholt.net
>>Cc: intel-gfx at lists.freedesktop.org; Ma, Ling
>>Subject: [PATCH 1/4 V2] drm/i915: Safely detect SDVO/HDMI output
>>
>>We detect DVI-1 output(HDMI-1 or SDVO-1) according result from
>>sdvoB output init and GMBUS port 4 on all 9xx platforms, DVI-2 output
>>(HDMI-2 or SDVO-2) according to result from sdvoC output init and
>>GMBUS port 4 on pre-4x platform or GMBUS port 3 on 4x platform.
>>
>>It fixed freedescktop.org bug #20639
>>
>>Signed-off-by: Ma Ling <ling.ma at intel.com>
>>---
>> drivers/gpu/drm/i915/intel_display.c |   18 +++++++++---------
>> 1 files changed, 9 insertions(+), 9 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/intel_display.c
>>b/drivers/gpu/drm/i915/intel_display.c
>>index 508838e..57de9a5 100644
>>--- a/drivers/gpu/drm/i915/intel_display.c
>>+++ b/drivers/gpu/drm/i915/intel_display.c
>>@@ -2966,30 +2966,30 @@ static void intel_setup_outputs(struct drm_device
>*dev)
>> 			intel_hdmi_init(dev, HDMID);
>>
>> 	} 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
>>--
>>1.5.4.4



More information about the Intel-gfx mailing list