From: Chris Wilson <chris@chris-wilson.co.uk>
To: Zhenyu Wang <zhenyuw@linux.intel.com>, dri-devel@lists.freedesktop.org
Cc: intel-gfx@lists.freedesktop.org, fengguang.wu@intel.com
Subject: Re: [Intel-gfx] [PATCH 1/4] drm/edid: add helper function to detect monitor audio capability
Date: Sun, 19 Sep 2010 08:38:07 +0100 [thread overview]
Message-ID: <89k77n$p02t9j@fmsmga001.fm.intel.com> (raw)
In-Reply-To: <1284879129-19720-2-git-send-email-zhenyuw@linux.intel.com>
[Lets see if I have a working vpn connection today...]
On Sun, 19 Sep 2010 14:52:06 +0800, Zhenyu Wang <zhenyuw@linux.intel.com> wrote:
> To help to determine if digital display port needs to enable
> audio output or not. This one adds a helper to get monitor's
> audio capability via EDID CEA extension block.
>
> Tested-by: Wu Fengguang <fengguang.wu@intel.com>
> Signed-off-by: Zhenyu Wang <zhenyuw@linux.intel.com>
This should be cc'ed for Adam Jackson's attention as well.
> ---
> drivers/gpu/drm/drm_edid.c | 92 +++++++++++++++++++++++++++++++++++++-------
> include/drm/drm_crtc.h | 1 +
> 2 files changed, 79 insertions(+), 14 deletions(-)
>
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 96e9631..7f356af 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -1268,34 +1268,51 @@ add_detailed_modes(struct drm_connector *connector, struct edid *edid,
> }
>
> #define HDMI_IDENTIFIER 0x000C03
> +#define AUDIO_BLOCK 0x01
> #define VENDOR_BLOCK 0x03
> +#define EDID_BASIC_AUDIO (1 << 6)
> +
> /**
> + * drm_detect_monitor_audio - check monitor audio capability
> + *
> + * Monitor should have CEA extension block.
> + * If monitor has 'basic audio', but no CEA audio blocks, it's 'basic
> + * audio' only. If there is any audio extension block and supported
> + * audio format, assume at least 'basic audio' support, even if 'basic
> + * audio' is not defined in EDID.
> + *
> + */
> +bool drm_detect_monitor_audio(struct edid *edid)
drm_edid_has_monitor_audio()? That is a little more self-descriptive.
(I also think drm_detect_hdmi_monitor is poorly named.)
> +{
> + u8 *edid_ext;
> + int i, j;
> + bool has_audio = false;
> + int start_offset, end_offset;
> +
> + edid_ext = drm_find_cea_extension(edid);
> + if (!edid_ext)
> + goto end;
> +
> + has_audio = ((edid_ext[3] & EDID_BASIC_AUDIO) != 0);
Too many brackets do not lead to code clarity. ;-)
> +
> + if (has_audio) {
The last time Adam had a chance to comment on this EDID check, he
suggested that we cannot rely on has_audio being a reliable indicator of
the sink's properties. If the EDID has no audio support, then return
early, otherwise perform the secondary check that extension block contains
audio data.
-Chris
--
Chris Wilson, Intel Open Source Technology Centre
next prev parent reply other threads:[~2010-09-19 7:38 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-09-19 6:52 [PATCH 0/4] updated patches for KMS audio Zhenyu Wang
2010-09-19 6:52 ` [PATCH 1/4] drm/edid: add helper function to detect monitor audio capability Zhenyu Wang
2010-09-19 7:38 ` Chris Wilson [this message]
2010-09-19 7:56 ` [Intel-gfx] " Zhenyu Wang
2010-10-19 7:24 ` Ben Skeggs
2010-09-19 6:52 ` [PATCH 2/4] drm/i915: Enable DisplayPort audio Zhenyu Wang
2010-09-19 7:43 ` Chris Wilson
2010-09-19 7:57 ` Zhenyu Wang
2010-09-19 6:52 ` [PATCH 3/4] drm/i915: Enable HDMI audio for monitor with audio support Zhenyu Wang
2010-09-19 6:52 ` [PATCH 4/4] drm/i915: add new param to force audio on or off for HDMI/DP port Zhenyu Wang
2010-09-19 8:14 ` Chris Wilson
2010-09-19 8:22 ` Zhenyu Wang
2010-09-19 8:57 ` Chris Wilson
2010-09-20 19:42 ` [PATCH 0/4] updated patches for KMS audio Adam Jackson
2010-10-14 10:24 ` Chris Wilson
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='89k77n$p02t9j@fmsmga001.fm.intel.com' \
--to=chris@chris-wilson.co.uk \
--cc=dri-devel@lists.freedesktop.org \
--cc=fengguang.wu@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=zhenyuw@linux.intel.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.