提交 8c241fef 编写于 作者: K Keith Packard

drm/i915: Wrap DP EDID fetch functions to enable eDP panel power

Talking to the eDP DDC channel requires that the panel be powered
up. Wrap both the EDID and modes fetch code with calls to turn the vdd
power on and back off.
Signed-off-by: NKeith Packard <keithp@keithp.com>
Reviewed-by: NDaniel Vetter <daniel.vetter@ffwll.ch>
上级 552fb0b7
...@@ -1721,6 +1721,31 @@ g4x_dp_detect(struct intel_dp *intel_dp) ...@@ -1721,6 +1721,31 @@ g4x_dp_detect(struct intel_dp *intel_dp)
return intel_dp_detect_dpcd(intel_dp); return intel_dp_detect_dpcd(intel_dp);
} }
static struct edid *
intel_dp_get_edid(struct drm_connector *connector, struct i2c_adapter *adapter)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
struct edid *edid;
ironlake_edp_panel_vdd_on(intel_dp);
edid = drm_get_edid(connector, adapter);
ironlake_edp_panel_vdd_off(intel_dp);
return edid;
}
static int
intel_dp_get_edid_modes(struct drm_connector *connector, struct i2c_adapter *adapter)
{
struct intel_dp *intel_dp = intel_attached_dp(connector);
int ret;
ironlake_edp_panel_vdd_on(intel_dp);
ret = intel_ddc_get_modes(connector, adapter);
ironlake_edp_panel_vdd_off(intel_dp);
return ret;
}
/** /**
* Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect DP connection. * Uses CRT_HOTPLUG_EN and CRT_HOTPLUG_STAT to detect DP connection.
* *
...@@ -1753,7 +1778,7 @@ intel_dp_detect(struct drm_connector *connector, bool force) ...@@ -1753,7 +1778,7 @@ intel_dp_detect(struct drm_connector *connector, bool force)
if (intel_dp->force_audio) { if (intel_dp->force_audio) {
intel_dp->has_audio = intel_dp->force_audio > 0; intel_dp->has_audio = intel_dp->force_audio > 0;
} else { } else {
edid = drm_get_edid(connector, &intel_dp->adapter); edid = intel_dp_get_edid(connector, &intel_dp->adapter);
if (edid) { if (edid) {
intel_dp->has_audio = drm_detect_monitor_audio(edid); intel_dp->has_audio = drm_detect_monitor_audio(edid);
connector->display_info.raw_edid = NULL; connector->display_info.raw_edid = NULL;
...@@ -1774,7 +1799,7 @@ static int intel_dp_get_modes(struct drm_connector *connector) ...@@ -1774,7 +1799,7 @@ static int intel_dp_get_modes(struct drm_connector *connector)
/* We should parse the EDID data and find out if it has an audio sink /* We should parse the EDID data and find out if it has an audio sink
*/ */
ret = intel_ddc_get_modes(connector, &intel_dp->adapter); ret = intel_dp_get_edid_modes(connector, &intel_dp->adapter);
if (ret) { if (ret) {
if (is_edp(intel_dp) && !dev_priv->panel_fixed_mode) { if (is_edp(intel_dp) && !dev_priv->panel_fixed_mode) {
struct drm_display_mode *newmode; struct drm_display_mode *newmode;
...@@ -1819,7 +1844,7 @@ intel_dp_detect_audio(struct drm_connector *connector) ...@@ -1819,7 +1844,7 @@ intel_dp_detect_audio(struct drm_connector *connector)
struct edid *edid; struct edid *edid;
bool has_audio = false; bool has_audio = false;
edid = drm_get_edid(connector, &intel_dp->adapter); edid = intel_dp_get_edid(connector, &intel_dp->adapter);
if (edid) { if (edid) {
has_audio = drm_detect_monitor_audio(edid); has_audio = drm_detect_monitor_audio(edid);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册