Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 143301
b: refs/heads/master
c: 9dff6af
h: refs/heads/master
i:
  143299: 00bf115
v: v3
  • Loading branch information
Ma Ling authored and Eric Anholt committed Apr 8, 2009
1 parent 3dc9bd7 commit a52553f
Show file tree
Hide file tree
Showing 3 changed files with 41 additions and 6 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6115707be0e85a9b825f10e95143cb705b87fef8
refs/heads/master: 9dff6af860d6b7f661d4360eb859837afaca0a1b
23 changes: 20 additions & 3 deletions trunk/drivers/gpu/drm/i915/intel_hdmi.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@
struct intel_hdmi_priv {
u32 sdvox_reg;
u32 save_SDVOX;
int has_hdmi_sink;
bool has_hdmi_sink;
};

static void intel_hdmi_mode_set(struct drm_encoder *encoder,
Expand Down Expand Up @@ -128,6 +128,22 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder,
return true;
}

static void
intel_hdmi_sink_detect(struct drm_connector *connector)
{
struct intel_output *intel_output = to_intel_output(connector);
struct intel_hdmi_priv *hdmi_priv = intel_output->dev_priv;
struct edid *edid = NULL;

edid = drm_get_edid(&intel_output->base,
&intel_output->ddc_bus->adapter);
if (edid != NULL) {
hdmi_priv->has_hdmi_sink = drm_detect_hdmi_monitor(edid);
kfree(edid);
intel_output->base.display_info.raw_edid = NULL;
}
}

static enum drm_connector_status
intel_hdmi_detect(struct drm_connector *connector)
{
Expand Down Expand Up @@ -158,9 +174,10 @@ intel_hdmi_detect(struct drm_connector *connector)
return connector_status_unknown;
}

if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0)
if ((I915_READ(PORT_HOTPLUG_STAT) & bit) != 0) {
intel_hdmi_sink_detect(connector);
return connector_status_connected;
else
} else
return connector_status_disconnected;
}

Expand Down
22 changes: 20 additions & 2 deletions trunk/drivers/gpu/drm/i915/intel_sdvo.c
Original file line number Diff line number Diff line change
Expand Up @@ -1357,6 +1357,23 @@ void intel_sdvo_set_hotplug(struct drm_connector *connector, int on)
intel_sdvo_read_response(intel_output, &response, 2);
}

static void
intel_sdvo_hdmi_sink_detect(struct drm_connector *connector)
{
struct intel_output *intel_output = to_intel_output(connector);
struct intel_sdvo_priv *sdvo_priv = intel_output->dev_priv;
struct edid *edid = NULL;

intel_sdvo_set_control_bus_switch(intel_output, sdvo_priv->ddc_bus);
edid = drm_get_edid(&intel_output->base,
&intel_output->ddc_bus->adapter);
if (edid != NULL) {
sdvo_priv->is_hdmi = drm_detect_hdmi_monitor(edid);
kfree(edid);
intel_output->base.display_info.raw_edid = NULL;
}
}

static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connector)
{
u8 response[2];
Expand All @@ -1371,9 +1388,10 @@ static enum drm_connector_status intel_sdvo_detect(struct drm_connector *connect
if (status != SDVO_CMD_STATUS_SUCCESS)
return connector_status_unknown;

if ((response[0] != 0) || (response[1] != 0))
if ((response[0] != 0) || (response[1] != 0)) {
intel_sdvo_hdmi_sink_detect(connector);
return connector_status_connected;
else
} else
return connector_status_disconnected;
}

Expand Down

0 comments on commit a52553f

Please sign in to comment.