From: "Ville Syrjälä" <ville.syrjala@linux.intel.com>
To: Jani Nikula <jani.nikula@intel.com>
Cc: intel-gfx@lists.freedesktop.org, Joseph Nuzman <jnuzman@gmail.com>
Subject: Re: [PATCH] drm/i915: always update ELD connector type after get modes
Date: Tue, 19 Sep 2017 18:53:26 +0300 [thread overview]
Message-ID: <20170919155326.GX4914@intel.com> (raw)
In-Reply-To: <20170919153813.29808-1-jani.nikula@intel.com>
On Tue, Sep 19, 2017 at 06:38:13PM +0300, Jani Nikula wrote:
> drm_edid_to_eld() initializes the connector ELD to zero, overwriting the
> ELD connector type initialized in intel_audio_codec_enable(). If
> userspace does getconnector and thus get_modes after modeset, a
> subsequent audio component i915_audio_component_get_eld() call will
> receive an ELD without the connector type properly set. It's fine for
> HDMI, but screws up audio for DP.
>
> Always set the ELD connector type at intel_connector_update_modes()
> based on the connector type. We can drop the connector type update from
> intel_audio_codec_enable().
>
> Credits to Joseph Nuzman <jnuzman@gmail.com> for figuring this out.
>
> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
> Cc: Joseph Nuzman <jnuzman@gmail.com>
> Reported-by: Joseph Nuzman <jnuzman@gmail.com>
> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101583
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>
> ---
>
> We'll still need to cache and fix the av sync delay as well, but we need
> adjusted mode for that.
> ---
> drivers/gpu/drm/i915/intel_audio.c | 5 -----
> drivers/gpu/drm/i915/intel_modes.c | 17 +++++++++++++++++
> 2 files changed, 17 insertions(+), 5 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_audio.c b/drivers/gpu/drm/i915/intel_audio.c
> index d805b6e6fe71..27743be5b768 100644
> --- a/drivers/gpu/drm/i915/intel_audio.c
> +++ b/drivers/gpu/drm/i915/intel_audio.c
> @@ -606,11 +606,6 @@ void intel_audio_codec_enable(struct intel_encoder *intel_encoder,
> connector->encoder->base.id,
> connector->encoder->name);
>
> - /* ELD Conn_Type */
> - connector->eld[5] &= ~(3 << 2);
> - if (intel_crtc_has_dp_encoder(crtc_state))
> - connector->eld[5] |= (1 << 2);
> -
> connector->eld[6] = drm_av_sync_delay(connector, adjusted_mode) / 2;
>
> if (dev_priv->display.audio_codec_enable)
> diff --git a/drivers/gpu/drm/i915/intel_modes.c b/drivers/gpu/drm/i915/intel_modes.c
> index 951e834dd274..28a778b785ac 100644
> --- a/drivers/gpu/drm/i915/intel_modes.c
> +++ b/drivers/gpu/drm/i915/intel_modes.c
> @@ -30,6 +30,21 @@
> #include "intel_drv.h"
> #include "i915_drv.h"
>
> +static void intel_connector_update_eld_conn_type(struct drm_connector *connector)
> +{
> + u8 conn_type;
> +
> + if (connector->connector_type == DRM_MODE_CONNECTOR_DisplayPort ||
> + connector->connector_type == DRM_MODE_CONNECTOR_eDP) {
> + conn_type = DRM_ELD_CONN_TYPE_DP;
> + } else {
> + conn_type = DRM_ELD_CONN_TYPE_HDMI;
> + }
> +
> + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE] &= ~DRM_ELD_CONN_TYPE_MASK;
> + connector->eld[DRM_ELD_SAD_COUNT_CONN_TYPE] |= conn_type;
> +}
Or should we just smash this into drm_edid_to_eld() ? Would
require a quick review of other drivers I suppose.
It's a step forward so
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
And I guess we should still do something about the av sync delay
always getting clobbered by get_modes()?
> +
> /**
> * intel_connector_update_modes - update connector from edid
> * @connector: DRM connector device to use
> @@ -44,6 +59,8 @@ int intel_connector_update_modes(struct drm_connector *connector,
> ret = drm_add_edid_modes(connector, edid);
> drm_edid_to_eld(connector, edid);
>
> + intel_connector_update_eld_conn_type(connector);
> +
> return ret;
> }
>
> --
> 2.11.0
--
Ville Syrjälä
Intel OTC
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
next prev parent reply other threads:[~2017-09-19 15:53 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-19 15:38 [PATCH] drm/i915: always update ELD connector type after get modes Jani Nikula
2017-09-19 15:49 ` Jani Nikula
2017-09-19 15:53 ` Ville Syrjälä [this message]
2017-09-19 19:41 ` ✗ Fi.CI.BAT: warning for " Patchwork
2017-09-20 8:07 ` ✗ Fi.CI.BAT: failure " Patchwork
2017-09-20 9:09 ` ✓ Fi.CI.BAT: success " Patchwork
2017-09-20 10:11 ` ✓ Fi.CI.IGT: " 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=20170919155326.GX4914@intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@intel.com \
--cc=jnuzman@gmail.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.