Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 318614
b: refs/heads/master
c: 7d2c24e
h: refs/heads/master
v: v3
  • Loading branch information
Jesse Barnes authored and Daniel Vetter committed Jun 20, 2012
1 parent f7496ae commit 3d93adf
Show file tree
Hide file tree
Showing 2 changed files with 40 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 98364379e1d967b8a070070797498c3708e73eb7
refs/heads/master: 7d2c24e8cd997867936b41a94a9984382af1566a
39 changes: 39 additions & 0 deletions trunk/drivers/gpu/drm/i915/intel_crt.c
Original file line number Diff line number Diff line change
Expand Up @@ -230,6 +230,42 @@ static bool intel_ironlake_crt_detect_hotplug(struct drm_connector *connector)
return ret;
}

static bool valleyview_crt_detect_hotplug(struct drm_connector *connector)
{
struct drm_device *dev = connector->dev;
struct drm_i915_private *dev_priv = dev->dev_private;
u32 adpa;
bool ret;
u32 save_adpa;

save_adpa = adpa = I915_READ(ADPA);
DRM_DEBUG_KMS("trigger hotplug detect cycle: adpa=0x%x\n", adpa);

adpa |= ADPA_CRT_HOTPLUG_FORCE_TRIGGER;

I915_WRITE(ADPA, adpa);

if (wait_for((I915_READ(ADPA) & ADPA_CRT_HOTPLUG_FORCE_TRIGGER) == 0,
1000)) {
DRM_DEBUG_KMS("timed out waiting for FORCE_TRIGGER");
I915_WRITE(ADPA, save_adpa);
}

/* Check the status to see if both blue and green are on now */
adpa = I915_READ(ADPA);
if ((adpa & ADPA_CRT_HOTPLUG_MONITOR_MASK) != 0)
ret = true;
else
ret = false;

DRM_DEBUG_KMS("valleyview hotplug adpa=0x%x, result %d\n", adpa, ret);

/* FIXME: debug force function and remove */
ret = true;

return ret;
}

/**
* Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect CRT presence.
*
Expand All @@ -249,6 +285,9 @@ static bool intel_crt_detect_hotplug(struct drm_connector *connector)
if (HAS_PCH_SPLIT(dev))
return intel_ironlake_crt_detect_hotplug(connector);

if (IS_VALLEYVIEW(dev))
return valleyview_crt_detect_hotplug(connector);

/*
* On 4 series desktop, CRT detect sequence need to be done twice
* to get a reliable result.
Expand Down

0 comments on commit 3d93adf

Please sign in to comment.