All of lore.kernel.org
 help / color / mirror / Atom feed
From: Thierry Reding <thierry.reding@gmail.com>
To: Damien Lespiau <damien.lespiau@intel.com>
Cc: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 05/12] video/hdmi: Don't let the user of this API create invalid infoframes
Date: Thu, 15 Aug 2013 16:44:09 +0200	[thread overview]
Message-ID: <20130815144408.GA16951@ulmo> (raw)
In-Reply-To: <1376500755-30227-6-git-send-email-damien.lespiau@intel.com>


[-- Attachment #1.1: Type: text/plain, Size: 1911 bytes --]

On Wed, Aug 14, 2013 at 06:19:08PM +0100, Damien Lespiau wrote:
> To set the active aspect ratio value in the AVI infoframe today, you not
> only have to set the active_aspect field, but also the active_info_valid
> bit. Out of the 1 user of this API, we had 100% misuse, forgetting the
> _valid bit. This was fixed in:
> 
>   Author: Damien Lespiau <damien.lespiau@intel.com>
>   Date:   Tue Aug 6 20:32:17 2013 +0100
> 
>       drm: Don't generate invalid AVI infoframes for CEA modes
> 
> We can do better and derive the _valid bit from the user wanting to set
> the active aspect ratio.
[...]
> diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
[...]
> @@ -96,7 +96,9 @@ ssize_t hdmi_avi_infoframe_pack(struct hdmi_avi_infoframe *frame, void *buffer,
>  
>  	ptr[0] = ((frame->colorspace & 0x3) << 5) | (frame->scan_mode & 0x3);
>  
> -	if (frame->active_info_valid)
> +	/* Data byte 1, bit 4 has to be set if we provide the active format
> +	 * aspect ratio */

Nit: According to the coding style rules this should be:

	/*
	 * Data byte 1, ...
	 * ... ratio.
	 */

> +	if (frame->active_aspect & 0xf)
>  		ptr[0] |= BIT(4);
>  
>  	if (frame->horizontal_bar_valid)
> diff --git a/include/linux/hdmi.h b/include/linux/hdmi.h
> index bc6743e..931474c6 100644
> --- a/include/linux/hdmi.h
> +++ b/include/linux/hdmi.h
> @@ -109,7 +109,6 @@ struct hdmi_avi_infoframe {
>  	unsigned char version;
>  	unsigned char length;
>  	enum hdmi_colorspace colorspace;
> -	bool active_info_valid;

When I initially came up with these data structure I wanted them to
explicitly expose all the fields that CEA/HDMI specifies. The idea was
that a user would actually be allowed to generate invalid infoframes if
they chose to by modifying the hdmi_avi_infoframe structure directly.

Instead I'd prefer to see this handled by some higher level function.

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

  reply	other threads:[~2013-08-15 14:44 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-14 17:19 HDMI 4k support v3 Damien Lespiau
2013-08-14 17:19 ` [PATCH 01/12] drm: Don't export drm_find_cea_extension() any more Damien Lespiau
2013-08-14 17:19 ` [PATCH 02/12] drm/edid: Fix add_cea_modes() style issues Damien Lespiau
2013-08-14 17:19 ` [PATCH 03/12] drm/edid: Parse the HDMI CEA block and look for 4k modes Damien Lespiau
2013-08-14 17:19 ` [PATCH 04/12] drm: Add support for alternate clocks of " Damien Lespiau
2013-08-14 17:19 ` [PATCH 05/12] video/hdmi: Don't let the user of this API create invalid infoframes Damien Lespiau
2013-08-15 14:44   ` Thierry Reding [this message]
2013-08-14 17:19 ` [PATCH 06/12] video/hdmi: Derive the bar data valid bit from the bar data fields Damien Lespiau
2013-08-15 14:45   ` Thierry Reding
2013-08-19 16:11     ` Damien Lespiau
2013-08-14 17:19 ` [PATCH 07/12] video/hdmi: Introduce helpers for the HDMI vendor specific infoframe Damien Lespiau
2013-08-14 18:36   ` [Intel-gfx] " Ville Syrjälä
2013-08-15 14:59   ` Thierry Reding
     [not found] ` <1376500755-30227-1-git-send-email-damien.lespiau-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2013-08-14 17:19   ` [PATCH 08/12] gpu: host1x: Port the HDMI vendor infoframe code the common helpers Damien Lespiau
2013-08-14 17:19 ` [PATCH 09/12] drm/edid: Move HDMI_IDENTIFIER to hdmi.h Damien Lespiau
2013-08-15 15:12   ` Thierry Reding
2013-08-19 13:49     ` Damien Lespiau
2013-08-19 19:31       ` Thierry Reding
2013-08-21 17:16         ` Damien Lespiau
2013-08-14 17:19 ` [PATCH 10/12] video/hdmi: Hook the HDMI vendor infoframe with the generic _pack() Damien Lespiau
2013-08-15 15:14   ` Thierry Reding
2013-08-14 17:19 ` [PATCH 11/12] drm: Add a helper to forge HDMI vendor infoframes Damien Lespiau
2013-08-14 17:19 ` [PATCH 12/12] drm/i915/hdmi: Write HDMI vendor specific infoframes Damien Lespiau
2013-08-14 18:42 ` HDMI 4k support v3 Ville Syrjälä
  -- strict thread matches above, loose matches on Subject: below --
2013-08-13 23:17 HDMI 4k support v2 Damien Lespiau
2013-08-13 23:17 ` [PATCH 05/12] video/hdmi: Don't let the user of this API create invalid infoframes Damien Lespiau

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=20130815144408.GA16951@ulmo \
    --to=thierry.reding@gmail.com \
    --cc=damien.lespiau@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 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.