diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 405afd75241b..bba0aba15a96 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -48,6 +48,12 @@ static struct intel_hdmi *enc_to_intel_hdmi(struct drm_encoder *encoder) | |||
48 | return container_of(encoder, struct intel_hdmi, base.base); | 48 | return container_of(encoder, struct intel_hdmi, base.base); |
49 | } | 49 | } |
50 | 50 | ||
51 | static struct intel_hdmi *intel_attached_hdmi(struct drm_connector *connector) | ||
52 | { | ||
53 | return container_of(intel_attached_encoder(connector), | ||
54 | struct intel_hdmi, base); | ||
55 | } | ||
56 | |||
51 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, | 57 | static void intel_hdmi_mode_set(struct drm_encoder *encoder, |
52 | struct drm_display_mode *mode, | 58 | struct drm_display_mode *mode, |
53 | struct drm_display_mode *adjusted_mode) | 59 | struct drm_display_mode *adjusted_mode) |
@@ -141,8 +147,7 @@ static bool intel_hdmi_mode_fixup(struct drm_encoder *encoder, | |||
141 | static enum drm_connector_status | 147 | static enum drm_connector_status |
142 | intel_hdmi_detect(struct drm_connector *connector) | 148 | intel_hdmi_detect(struct drm_connector *connector) |
143 | { | 149 | { |
144 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 150 | struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); |
145 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | ||
146 | struct edid *edid = NULL; | 151 | struct edid *edid = NULL; |
147 | enum drm_connector_status status = connector_status_disconnected; | 152 | enum drm_connector_status status = connector_status_disconnected; |
148 | 153 | ||
@@ -163,8 +168,7 @@ intel_hdmi_detect(struct drm_connector *connector) | |||
163 | 168 | ||
164 | static int intel_hdmi_get_modes(struct drm_connector *connector) | 169 | static int intel_hdmi_get_modes(struct drm_connector *connector) |
165 | { | 170 | { |
166 | struct drm_encoder *encoder = intel_attached_encoder(connector); | 171 | struct intel_hdmi *intel_hdmi = intel_attached_hdmi(connector); |
167 | struct intel_hdmi *intel_hdmi = enc_to_intel_hdmi(encoder); | ||
168 | 172 | ||
169 | /* We should parse the EDID data and find out if it's an HDMI sink so | 173 | /* We should parse the EDID data and find out if it's an HDMI sink so |
170 | * we can send audio to it. | 174 | * we can send audio to it. |
@@ -198,7 +202,7 @@ static const struct drm_connector_funcs intel_hdmi_connector_funcs = { | |||
198 | static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = { | 202 | static const struct drm_connector_helper_funcs intel_hdmi_connector_helper_funcs = { |
199 | .get_modes = intel_hdmi_get_modes, | 203 | .get_modes = intel_hdmi_get_modes, |
200 | .mode_valid = intel_hdmi_mode_valid, | 204 | .mode_valid = intel_hdmi_mode_valid, |
201 | .best_encoder = intel_attached_encoder, | 205 | .best_encoder = intel_best_encoder, |
202 | }; | 206 | }; |
203 | 207 | ||
204 | static const struct drm_encoder_funcs intel_hdmi_enc_funcs = { | 208 | static const struct drm_encoder_funcs intel_hdmi_enc_funcs = { |
@@ -270,8 +274,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | |||
270 | DRM_MODE_ENCODER_TMDS); | 274 | DRM_MODE_ENCODER_TMDS); |
271 | drm_encoder_helper_add(&intel_encoder->base, &intel_hdmi_helper_funcs); | 275 | drm_encoder_helper_add(&intel_encoder->base, &intel_hdmi_helper_funcs); |
272 | 276 | ||
273 | drm_mode_connector_attach_encoder(&intel_connector->base, | 277 | intel_connector_attach_encoder(intel_connector, intel_encoder); |
274 | &intel_encoder->base); | ||
275 | drm_sysfs_connector_add(connector); | 278 | drm_sysfs_connector_add(connector); |
276 | 279 | ||
277 | /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written | 280 | /* For G4X desktop chip, PEG_BAND_GAP_DATA 3:0 must first be written |