summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/i915/intel_dp.c
diff options
context:
space:
mode:
authorMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-05-01 15:38:00 +0200
committerMaarten Lankhorst <maarten.lankhorst@linux.intel.com>2017-05-30 10:33:26 +0200
commite6b72c949376ca7a594ea585e6c8d85053fbe440 (patch)
tree592cfaad630cef01d4cb1f13d38c485de37fc55f /drivers/gpu/drm/i915/intel_dp.c
parentca937582d9b2e2d041fb8a9f087a93cd62f00c2f (diff)
downloadop-kernel-dev-e6b72c949376ca7a594ea585e6c8d85053fbe440.zip
op-kernel-dev-e6b72c949376ca7a594ea585e6c8d85053fbe440.tar.gz
drm/i915: Make intel_dp->has_audio reflect hw state only
Always detect if audio is available during edid detection. With less magic switching it's easier to convert the dp connector properties to atomic. Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com> Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch> Link: http://patchwork.freedesktop.org/patch/msgid/20170501133804.8116-9-maarten.lankhorst@linux.intel.com
Diffstat (limited to 'drivers/gpu/drm/i915/intel_dp.c')
-rw-r--r--drivers/gpu/drm/i915/intel_dp.c38
1 files changed, 16 insertions, 22 deletions
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 476cac0..22822c2 100644
--- a/drivers/gpu/drm/i915/intel_dp.c
+++ b/drivers/gpu/drm/i915/intel_dp.c
@@ -1671,7 +1671,12 @@ intel_dp_compute_config(struct intel_encoder *encoder,
pipe_config->has_pch_encoder = true;
pipe_config->has_drrs = false;
- pipe_config->has_audio = intel_dp->has_audio && port != PORT_A;
+ if (port == PORT_A)
+ pipe_config->has_audio = false;
+ else if (intel_dp->force_audio == HDMI_AUDIO_AUTO)
+ pipe_config->has_audio = intel_dp->has_audio;
+ else
+ pipe_config->has_audio = intel_dp->force_audio == HDMI_AUDIO_ON;
if (is_edp(intel_dp) && intel_connector->panel.fixed_mode) {
intel_fixed_panel_mode(intel_connector->panel.fixed_mode,
@@ -4602,10 +4607,7 @@ intel_dp_set_edid(struct intel_dp *intel_dp)
edid = intel_dp_get_edid(intel_dp);
intel_connector->detect_edid = edid;
- if (intel_dp->force_audio != HDMI_AUDIO_AUTO)
- intel_dp->has_audio = intel_dp->force_audio == HDMI_AUDIO_ON;
- else
- intel_dp->has_audio = drm_detect_monitor_audio(edid);
+ intel_dp->has_audio = drm_detect_monitor_audio(edid);
}
static void
@@ -4813,19 +4815,6 @@ static int intel_dp_get_modes(struct drm_connector *connector)
return 0;
}
-static bool
-intel_dp_detect_audio(struct drm_connector *connector)
-{
- bool has_audio = false;
- struct edid *edid;
-
- edid = to_intel_connector(connector)->detect_edid;
- if (edid)
- has_audio = drm_detect_monitor_audio(edid);
-
- return has_audio;
-}
-
static int
intel_dp_set_property(struct drm_connector *connector,
struct drm_property *property,
@@ -4842,22 +4831,27 @@ intel_dp_set_property(struct drm_connector *connector,
if (property == dev_priv->force_audio_property) {
int i = val;
- bool has_audio;
+ bool has_audio, old_has_audio;
+ int old_force_audio = intel_dp->force_audio;
if (i == intel_dp->force_audio)
return 0;
+ if (old_force_audio == HDMI_AUDIO_AUTO)
+ old_has_audio = intel_dp->has_audio;
+ else
+ old_has_audio = old_force_audio;
+
intel_dp->force_audio = i;
if (i == HDMI_AUDIO_AUTO)
- has_audio = intel_dp_detect_audio(connector);
+ has_audio = intel_dp->has_audio;
else
has_audio = (i == HDMI_AUDIO_ON);
- if (has_audio == intel_dp->has_audio)
+ if (has_audio == old_has_audio)
return 0;
- intel_dp->has_audio = has_audio;
goto done;
}
OpenPOWER on IntegriCloud