From: Thierry Reding <thierry.reding@avionic-design.de>
To: Daniel Vetter <daniel@ffwll.ch>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [RFC v2 5/5] drm/i915: Use generic HDMI infoframe helpers
Date: Thu, 6 Dec 2012 15:23:33 +0100 [thread overview]
Message-ID: <20121206142333.GA15982@avionic-0098.adnet.avionic-design.de> (raw)
In-Reply-To: <20121206141631.GU11556@phenom.ffwll.local>
[-- Attachment #1.1: Type: text/plain, Size: 2583 bytes --]
On Thu, Dec 06, 2012 at 03:16:31PM +0100, Daniel Vetter wrote:
> On Wed, Dec 05, 2012 at 05:45:44PM +0100, Thierry Reding wrote:
> > Use the generic HDMI infoframe helpers to get rid of the duplicate
> > implementation in the i915 driver.
> >
> > Signed-off-by: Thierry Reding <thierry.reding@avionic-design.de>
>
> > diff --git a/drivers/gpu/drm/i915/intel_sdvo.c b/drivers/gpu/drm/i915/intel_sdvo.c
> > index 4b07401..192d791 100644
> > --- a/drivers/gpu/drm/i915/intel_sdvo.c
> > +++ b/drivers/gpu/drm/i915/intel_sdvo.c
> > @@ -29,6 +29,7 @@
> > #include <linux/slab.h>
> > #include <linux/delay.h>
> > #include <linux/export.h>
> > +#include <linux/hdmi.h>
> > #include <drm/drmP.h>
> > #include <drm/drm_crtc.h>
> > #include <drm/drm_edid.h>
> > @@ -935,20 +936,17 @@ static bool intel_sdvo_write_infoframe(struct intel_sdvo *intel_sdvo,
> >
> > static bool intel_sdvo_set_avi_infoframe(struct intel_sdvo *intel_sdvo)
> > {
> > - struct dip_infoframe avi_if = {
> > - .type = DIP_TYPE_AVI,
> > - .ver = DIP_VERSION_AVI,
> > - .len = DIP_LEN_AVI,
> > - };
> > - uint8_t sdvo_data[4 + sizeof(avi_if.body.avi)];
> > + uint8_t sdvo_data[HDMI_AVI_INFOFRAME_SIZE];
> > + struct hdmi_avi_infoframe frame;
> > + ssize_t len;
> >
> > - intel_dip_infoframe_csum(&avi_if);
> > + len = hdmi_avi_infoframe_init(&frame);
> > + if (len < 0)
> > + return false;
> >
> > - /* sdvo spec says that the ecc is handled by the hw, and it looks like
> > - * we must not send the ecc field, either. */
> > - memcpy(sdvo_data, &avi_if, 3);
> > - sdvo_data[3] = avi_if.checksum;
>
> This difference between how we need to send the infoframe to the hw
> between sdvo (without ecc field present) and native hdmi (ecc field
> present, but still computed by the hw) seems to have been lost. On a quick
> read from your infoframe packer it looks like the ecc field isn't part of
> the packed infoframe, so this patch would break native hdmi ports (in the
> intel_hdmi.c file).
Actually this ECC field seems to be something specific to Intel
hardware. It doesn't appear in the HDMI specification nor in CEA-861-D.
So it the binary infoframe representation doesn't contain it, therefore
it should be handled by the respective drivers. So in fact the code
should be working fine for HDMI and SDVO, since for the HDMI ports I
explicitly left the fourth byte of the header empty, while for SDVO, the
checksum is the one as computed by hdmi_avi_infoframe_pack(), which is
at byte 3 and therefore matches the previous code.
Thierry
[-- Attachment #1.2: Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 159 bytes --]
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel
next prev parent reply other threads:[~2012-12-06 14:23 UTC|newest]
Thread overview: 30+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-12-05 16:45 [RFC v2 0/5] Add HDMI infoframe helpers Thierry Reding
2012-12-05 16:45 ` [RFC v2 1/5] drm: Add some missing forward declarations Thierry Reding
2012-12-05 16:45 ` [RFC v2 2/5] video: Add generic HDMI infoframe helpers Thierry Reding
2012-12-07 14:32 ` Paulo Zanoni
2012-12-11 7:58 ` Thierry Reding
2012-12-05 16:45 ` [RFC v2 3/5] drm: Add " Thierry Reding
2012-12-05 17:51 ` Lars-Peter Clausen
2012-12-06 7:28 ` Thierry Reding
2012-12-06 8:28 ` Lars-Peter Clausen
2012-12-06 14:09 ` Daniel Vetter
2012-12-06 14:28 ` Thierry Reding
2012-12-06 15:44 ` Daniel Vetter
2012-12-06 16:02 ` Thierry Reding
2012-12-07 19:00 ` Daniel Vetter
2012-12-05 16:45 ` [RFC v2 4/5] drm: tegra: Use generic " Thierry Reding
2012-12-05 16:45 ` [RFC v2 5/5] drm/i915: " Thierry Reding
2012-12-06 14:16 ` Daniel Vetter
2012-12-06 14:23 ` Thierry Reding [this message]
2012-12-06 15:57 ` Daniel Vetter
2012-12-06 16:02 ` Thierry Reding
2012-12-06 16:11 ` Paulo Zanoni
2012-12-06 16:55 ` Paulo Zanoni
2012-12-07 7:28 ` Thierry Reding
2012-12-07 8:30 ` Daniel Vetter
2012-12-07 8:49 ` Thierry Reding
2012-12-07 7:22 ` Thierry Reding
2012-12-07 15:11 ` [RFC] " Paulo Zanoni
2012-12-07 15:32 ` Daniel Vetter
2012-12-11 10:39 ` Daniel Vetter
2012-12-11 8:35 ` Thierry Reding
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=20121206142333.GA15982@avionic-0098.adnet.avionic-design.de \
--to=thierry.reding@avionic-design.de \
--cc=daniel@ffwll.ch \
--cc=dri-devel@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 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.