[Intel-gfx] [PATCH] drm/i915: add VGA hotplug support for 945+

Eric Anholt eric at anholt.net
Wed Apr 1 20:22:57 CEST 2009


On Tue, 2009-03-31 at 14:11 -0700, Jesse Barnes wrote:
> Add VGA port hotplug detection to the i915 driver.  When KMS is enabled,
> plugging in or removing a VGA cable from the VGA connector will
> generate a uevent, which indicates to userspace that it should re-probe
> outputs on this device (to determine modes, etc.).
> 
> Signed-off-by: Jesse Barnes <jbarnes at virtuousgeek.org>

>  #define PORT_HOTPLUG_STAT	0x61114
> diff --git a/drivers/gpu/drm/i915/intel_crt.c b/drivers/gpu/drm/i915/intel_crt.c
> index 2b6d443..e521a60 100644
> --- a/drivers/gpu/drm/i915/intel_crt.c
> +++ b/drivers/gpu/drm/i915/intel_crt.c
> @@ -182,9 +184,12 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
>  
>  	if ((I915_READ(PORT_HOTPLUG_STAT) & CRT_HOTPLUG_MONITOR_MASK) ==
>  	    CRT_HOTPLUG_MONITOR_COLOR)
> -		return true;
> +		ret = true;
> +
> +	/* Clear spurious status */
> +	I915_WRITE(PORT_HOTPLUG_STAT, CRT_HOTPLUG_INT_STATUS);
>  
> -	return false;
> +	return ret;
>  }
>  
>  static bool intel_crt_detect_ddc(struct drm_connector *connector)

This last hunk is weird -- why do we need to clear spurious status, if
we haven't actually disabled interrupts around this detection (likely
triggered by ioctl)?  Won't the status have triggered a hotplug
interrupt and thus sysfs reporting anyway?

-- 
Eric Anholt
eric at anholt.net                         eric.anholt at intel.com


-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part
URL: <http://lists.freedesktop.org/archives/intel-gfx/attachments/20090401/b4e61d00/attachment.sig>


More information about the Intel-gfx mailing list