Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 218340
b: refs/heads/master
c: e27d853
h: refs/heads/master
v: v3
  • Loading branch information
Chris Wilson committed Oct 22, 2010
1 parent 8e41a79 commit eb2023d
Show file tree
Hide file tree
Showing 2 changed files with 23 additions and 24 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: 3c17fe4b8f40a112a85758a9ab2aebf772bdd647
refs/heads/master: e27d8538695d1aee69eb4fdd6f98988e6ffc5c33
45 changes: 22 additions & 23 deletions trunk/drivers/gpu/drm/i915/intel_sdvo.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ struct intel_sdvo {
*/
struct drm_display_mode *sdvo_lvds_fixed_mode;

/*
* supported encoding mode, used to determine whether HDMI is
* supported
*/
struct intel_sdvo_encode encode;

/* DDC bus used by this SDVO encoder */
uint8_t ddc_bus;

Expand Down Expand Up @@ -799,17 +793,13 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
mode->flags |= DRM_MODE_FLAG_PVSYNC;
}

static bool intel_sdvo_get_supp_encode(struct intel_sdvo *intel_sdvo,
struct intel_sdvo_encode *encode)
static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
{
if (intel_sdvo_get_value(intel_sdvo,
SDVO_CMD_GET_SUPP_ENCODE,
encode, sizeof(*encode)))
return true;
struct intel_sdvo_encode encode;

/* non-support means DVI */
memset(encode, 0, sizeof(*encode));
return false;
return intel_sdvo_get_value(intel_sdvo,
SDVO_CMD_GET_SUPP_ENCODE,
&encode, sizeof(encode));
}

static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
Expand Down Expand Up @@ -1958,12 +1948,22 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
}

static bool
intel_sdvo_get_digital_encoding_mode(struct intel_sdvo *intel_sdvo, int device)
intel_sdvo_is_hdmi_connector(struct intel_sdvo *intel_sdvo, int device)
{
return intel_sdvo_set_target_output(intel_sdvo,
device == 0 ? SDVO_OUTPUT_TMDS0 : SDVO_OUTPUT_TMDS1) &&
intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE,
&intel_sdvo->is_hdmi, 1);
int is_hdmi;

if (!intel_sdvo_check_supp_encode(intel_sdvo))
return false;

if (!intel_sdvo_set_target_output(intel_sdvo,
device == 0 ? SDVO_OUTPUT_TMDS0 : SDVO_OUTPUT_TMDS1))
return false;

is_hdmi = 0;
if (!intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE, &is_hdmi, 1))
return false;

return !!is_hdmi;
}

static u8
Expand Down Expand Up @@ -2064,14 +2064,13 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
encoder->encoder_type = DRM_MODE_ENCODER_TMDS;
connector->connector_type = DRM_MODE_CONNECTOR_DVID;

if (intel_sdvo_get_supp_encode(intel_sdvo, &intel_sdvo->encode)
&& intel_sdvo_get_digital_encoding_mode(intel_sdvo, device)
&& intel_sdvo->is_hdmi) {
if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) {
/* enable hdmi encoding mode if supported */
intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI);
intel_sdvo_set_colorimetry(intel_sdvo,
SDVO_COLORIMETRY_RGB256);
connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
intel_sdvo->is_hdmi = true;
}
intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
(1 << INTEL_ANALOG_CLONE_BIT));
Expand Down

0 comments on commit eb2023d

Please sign in to comment.