diff options
Diffstat (limited to 'drivers/gpu/drm/i915/intel_hdmi.c')
-rw-r--r-- | drivers/gpu/drm/i915/intel_hdmi.c | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/drivers/gpu/drm/i915/intel_hdmi.c b/drivers/gpu/drm/i915/intel_hdmi.c index 64541f7ef900..cae3e5f17a49 100644 --- a/drivers/gpu/drm/i915/intel_hdmi.c +++ b/drivers/gpu/drm/i915/intel_hdmi.c | |||
@@ -44,7 +44,7 @@ struct intel_hdmi { | |||
44 | uint32_t color_range; | 44 | uint32_t color_range; |
45 | bool has_hdmi_sink; | 45 | bool has_hdmi_sink; |
46 | bool has_audio; | 46 | bool has_audio; |
47 | int force_audio; | 47 | enum hdmi_force_audio force_audio; |
48 | void (*write_infoframe)(struct drm_encoder *encoder, | 48 | void (*write_infoframe)(struct drm_encoder *encoder, |
49 | struct dip_infoframe *frame); | 49 | struct dip_infoframe *frame); |
50 | }; | 50 | }; |
@@ -339,7 +339,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) | |||
339 | if (edid) { | 339 | if (edid) { |
340 | if (edid->input & DRM_EDID_INPUT_DIGITAL) { | 340 | if (edid->input & DRM_EDID_INPUT_DIGITAL) { |
341 | status = connector_status_connected; | 341 | status = connector_status_connected; |
342 | intel_hdmi->has_hdmi_sink = drm_detect_hdmi_monitor(edid); | 342 | if (intel_hdmi->force_audio != HDMI_AUDIO_OFF_DVI) |
343 | intel_hdmi->has_hdmi_sink = | ||
344 | drm_detect_hdmi_monitor(edid); | ||
343 | intel_hdmi->has_audio = drm_detect_monitor_audio(edid); | 345 | intel_hdmi->has_audio = drm_detect_monitor_audio(edid); |
344 | } | 346 | } |
345 | connector->display_info.raw_edid = NULL; | 347 | connector->display_info.raw_edid = NULL; |
@@ -347,8 +349,9 @@ intel_hdmi_detect(struct drm_connector *connector, bool force) | |||
347 | } | 349 | } |
348 | 350 | ||
349 | if (status == connector_status_connected) { | 351 | if (status == connector_status_connected) { |
350 | if (intel_hdmi->force_audio) | 352 | if (intel_hdmi->force_audio != HDMI_AUDIO_AUTO) |
351 | intel_hdmi->has_audio = intel_hdmi->force_audio > 0; | 353 | intel_hdmi->has_audio = |
354 | (intel_hdmi->force_audio == HDMI_AUDIO_ON); | ||
352 | } | 355 | } |
353 | 356 | ||
354 | return status; | 357 | return status; |
@@ -402,7 +405,7 @@ intel_hdmi_set_property(struct drm_connector *connector, | |||
402 | return ret; | 405 | return ret; |
403 | 406 | ||
404 | if (property == dev_priv->force_audio_property) { | 407 | if (property == dev_priv->force_audio_property) { |
405 | int i = val; | 408 | enum hdmi_force_audio i = val; |
406 | bool has_audio; | 409 | bool has_audio; |
407 | 410 | ||
408 | if (i == intel_hdmi->force_audio) | 411 | if (i == intel_hdmi->force_audio) |
@@ -410,13 +413,13 @@ intel_hdmi_set_property(struct drm_connector *connector, | |||
410 | 413 | ||
411 | intel_hdmi->force_audio = i; | 414 | intel_hdmi->force_audio = i; |
412 | 415 | ||
413 | if (i == 0) | 416 | if (i == HDMI_AUDIO_AUTO) |
414 | has_audio = intel_hdmi_detect_audio(connector); | 417 | has_audio = intel_hdmi_detect_audio(connector); |
415 | else | 418 | else |
416 | has_audio = i > 0; | 419 | has_audio = (i == HDMI_AUDIO_ON); |
417 | 420 | ||
418 | if (has_audio == intel_hdmi->has_audio) | 421 | if (i == HDMI_AUDIO_OFF_DVI) |
419 | return 0; | 422 | intel_hdmi->has_hdmi_sink = 0; |
420 | 423 | ||
421 | intel_hdmi->has_audio = has_audio; | 424 | intel_hdmi->has_audio = has_audio; |
422 | goto done; | 425 | goto done; |
@@ -514,7 +517,7 @@ void intel_hdmi_init(struct drm_device *dev, int sdvox_reg) | |||
514 | intel_encoder->type = INTEL_OUTPUT_HDMI; | 517 | intel_encoder->type = INTEL_OUTPUT_HDMI; |
515 | 518 | ||
516 | connector->polled = DRM_CONNECTOR_POLL_HPD; | 519 | connector->polled = DRM_CONNECTOR_POLL_HPD; |
517 | connector->interlace_allowed = 0; | 520 | connector->interlace_allowed = 1; |
518 | connector->doublescan_allowed = 0; | 521 | connector->doublescan_allowed = 0; |
519 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); | 522 | intel_encoder->crtc_mask = (1 << 0) | (1 << 1) | (1 << 2); |
520 | 523 | ||