提交 e27d8538 编写于 作者: C Chris Wilson

drm/i915/sdvo: Remove unused encoding member

This block is only used when detecting whether the connector is HDMI and
never again, so scope the variable to the detection routine.
Signed-off-by: NChris Wilson <chris@chris-wilson.co.uk>
上级 3c17fe4b
...@@ -120,12 +120,6 @@ struct intel_sdvo { ...@@ -120,12 +120,6 @@ struct intel_sdvo {
*/ */
struct drm_display_mode *sdvo_lvds_fixed_mode; 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 */ /* DDC bus used by this SDVO encoder */
uint8_t ddc_bus; uint8_t ddc_bus;
...@@ -799,17 +793,13 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode, ...@@ -799,17 +793,13 @@ static void intel_sdvo_get_mode_from_dtd(struct drm_display_mode * mode,
mode->flags |= DRM_MODE_FLAG_PVSYNC; mode->flags |= DRM_MODE_FLAG_PVSYNC;
} }
static bool intel_sdvo_get_supp_encode(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_check_supp_encode(struct intel_sdvo *intel_sdvo)
struct intel_sdvo_encode *encode)
{ {
if (intel_sdvo_get_value(intel_sdvo, struct intel_sdvo_encode encode;
SDVO_CMD_GET_SUPP_ENCODE,
encode, sizeof(*encode)))
return true;
/* non-support means DVI */ return intel_sdvo_get_value(intel_sdvo,
memset(encode, 0, sizeof(*encode)); SDVO_CMD_GET_SUPP_ENCODE,
return false; &encode, sizeof(encode));
} }
static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo, static bool intel_sdvo_set_encode(struct intel_sdvo *intel_sdvo,
...@@ -1958,12 +1948,22 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv, ...@@ -1958,12 +1948,22 @@ intel_sdvo_select_i2c_bus(struct drm_i915_private *dev_priv,
} }
static bool 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, int is_hdmi;
device == 0 ? SDVO_OUTPUT_TMDS0 : SDVO_OUTPUT_TMDS1) &&
intel_sdvo_get_value(intel_sdvo, SDVO_CMD_GET_ENCODE, if (!intel_sdvo_check_supp_encode(intel_sdvo))
&intel_sdvo->is_hdmi, 1); 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 static u8
...@@ -2064,14 +2064,13 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device) ...@@ -2064,14 +2064,13 @@ intel_sdvo_dvi_init(struct intel_sdvo *intel_sdvo, int device)
encoder->encoder_type = DRM_MODE_ENCODER_TMDS; encoder->encoder_type = DRM_MODE_ENCODER_TMDS;
connector->connector_type = DRM_MODE_CONNECTOR_DVID; connector->connector_type = DRM_MODE_CONNECTOR_DVID;
if (intel_sdvo_get_supp_encode(intel_sdvo, &intel_sdvo->encode) if (intel_sdvo_is_hdmi_connector(intel_sdvo, device)) {
&& intel_sdvo_get_digital_encoding_mode(intel_sdvo, device)
&& intel_sdvo->is_hdmi) {
/* enable hdmi encoding mode if supported */ /* enable hdmi encoding mode if supported */
intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI); intel_sdvo_set_encode(intel_sdvo, SDVO_ENCODE_HDMI);
intel_sdvo_set_colorimetry(intel_sdvo, intel_sdvo_set_colorimetry(intel_sdvo,
SDVO_COLORIMETRY_RGB256); SDVO_COLORIMETRY_RGB256);
connector->connector_type = DRM_MODE_CONNECTOR_HDMIA; connector->connector_type = DRM_MODE_CONNECTOR_HDMIA;
intel_sdvo->is_hdmi = true;
} }
intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) | intel_sdvo->base.clone_mask = ((1 << INTEL_SDVO_NON_TV_CLONE_BIT) |
(1 << INTEL_ANALOG_CLONE_BIT)); (1 << INTEL_ANALOG_CLONE_BIT));
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册