All of lore.kernel.org
 help / color / mirror / Atom feed
From: Daniel Vetter <daniel@ffwll.ch>
To: Thierry Reding <thierry.reding@avionic-design.de>
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:16:31 +0100	[thread overview]
Message-ID: <20121206141631.GU11556@phenom.ffwll.local> (raw)
In-Reply-To: <1354725944-1862-6-git-send-email-thierry.reding@avionic-design.de>

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).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch

  reply	other threads:[~2012-12-06 14:15 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 [this message]
2012-12-06 14:23     ` Thierry Reding
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=20121206141631.GU11556@phenom.ffwll.local \
    --to=daniel@ffwll.ch \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=thierry.reding@avionic-design.de \
    /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.