From: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: dri-devel@lists.freedesktop.org
Subject: [PATCH v6 08/12] drm/i915: Make intel_dp->has_audio reflect hw state only
Date: Mon, 1 May 2017 15:38:00 +0200 [thread overview]
Message-ID: <20170501133804.8116-9-maarten.lankhorst@linux.intel.com> (raw)
In-Reply-To: <20170501133804.8116-1-maarten.lankhorst@linux.intel.com>
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>
---
drivers/gpu/drm/i915/intel_dp.c | 38 ++++++++++++++++----------------------
1 file changed, 16 insertions(+), 22 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_dp.c b/drivers/gpu/drm/i915/intel_dp.c
index 8eb381ebbea6..0966b9319332 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,
@@ -4598,10 +4603,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
@@ -4809,19 +4811,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,
@@ -4838,22 +4827,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;
}
--
2.9.3
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-05-01 13:38 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-05-01 13:37 [PATCH v6 00/12] drm/i915: Convert connector properties to atomic Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 01/12] drm/atomic: Handle picture_aspect_ratio in atomic core Maarten Lankhorst
2017-05-01 18:27 ` Manasi Navare
2017-05-02 9:54 ` Daniel Vetter
2017-05-01 13:37 ` [PATCH v6 02/12] drm/atomic: Add support for custom scaling mode properties, v2 Maarten Lankhorst
2017-05-02 9:44 ` Daniel Vetter
2017-05-02 11:06 ` Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 03/12] drm/i915: Use atomic scaling_mode instead of panel.fitting_mode Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 04/12] drm/i915: Use per-connector scaling mode property Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 05/12] drm/i915: Add plumbing for digital connector state, v3 Maarten Lankhorst
2017-05-02 9:56 ` Daniel Vetter
2017-05-30 10:28 ` Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 06/12] drm/i915: Convert DSI connector properties to atomic Maarten Lankhorst
2017-05-01 13:37 ` [PATCH v6 07/12] drm/i915: Convert LVDS " Maarten Lankhorst
2017-05-01 13:38 ` Maarten Lankhorst [this message]
2017-05-01 13:38 ` [PATCH v6 09/12] drm/i915: Convert intel_dp properties to atomic, v2 Maarten Lankhorst
2017-05-01 13:38 ` [PATCH v6 10/12] drm/i915: Convert intel_hdmi connector properties to atomic Maarten Lankhorst
2017-05-01 13:38 ` [PATCH v6 11/12] drm/i915: Handle force_audio correctly in intel_sdvo Maarten Lankhorst
2017-05-01 13:38 ` [PATCH v6 12/12] drm/i915: Convert intel_sdvo connector properties to atomic Maarten Lankhorst
2017-05-01 14:14 ` ✗ Fi.CI.BAT: failure for drm/i915: Convert connector properties to atomic. (rev7) Patchwork
2017-05-02 6:28 ` ✓ Fi.CI.BAT: success " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170501133804.8116-9-maarten.lankhorst@linux.intel.com \
--to=maarten.lankhorst@linux.intel.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).