dri-devel.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
@ 2013-08-05 13:36 Damien Lespiau
  2013-08-05 13:54 ` Ville Syrjälä
  2013-08-05 18:07 ` Ville Syrjälä
  0 siblings, 2 replies; 6+ messages in thread
From: Damien Lespiau @ 2013-08-05 13:36 UTC (permalink / raw)
  To: dri-devel; +Cc: Thierry Reding

>From CEA-861:

  Data Byte 1, bit A0 indicates whether Active Format Data is present in
  Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
  any of the AFD bits are set.

ie. if we want to set active_aspect, we need to set the
active_info_valid bit to 1 as well.

Cc: Thierry Reding <thierry.reding@avionic-design.de>
Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
---
 drivers/gpu/drm/drm_edid.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
index 95d6f4b..8d1139f 100644
--- a/drivers/gpu/drm/drm_edid.c
+++ b/drivers/gpu/drm/drm_edid.c
@@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
 		return 0;
 
 	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
+	frame->active_info_valid = 1;
 	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
 
 	return 0;
-- 
1.8.3.1

^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
  2013-08-05 13:36 [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes Damien Lespiau
@ 2013-08-05 13:54 ` Ville Syrjälä
  2013-08-05 14:13   ` Damien Lespiau
  2013-08-05 18:07 ` Ville Syrjälä
  1 sibling, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2013-08-05 13:54 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: Thierry Reding, dri-devel

On Mon, Aug 05, 2013 at 02:36:47PM +0100, Damien Lespiau wrote:
> >From CEA-861:
> 
>   Data Byte 1, bit A0 indicates whether Active Format Data is present in
>   Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
>   any of the AFD bits are set.
> 
> ie. if we want to set active_aspect, we need to set the
> active_info_valid bit to 1 as well.
> 
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>

Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>

But why don't we just kill active_info_valid and instead just
check active_aspect in hdmi_avi_infoframe_pack()?

> ---
>  drivers/gpu/drm/drm_edid.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 95d6f4b..8d1139f 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  		return 0;
>  
>  	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
> +	frame->active_info_valid = 1;
>  	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
>  
>  	return 0;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
  2013-08-05 13:54 ` Ville Syrjälä
@ 2013-08-05 14:13   ` Damien Lespiau
  0 siblings, 0 replies; 6+ messages in thread
From: Damien Lespiau @ 2013-08-05 14:13 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Thierry Reding, dri-devel

On Mon, Aug 05, 2013 at 04:54:06PM +0300, Ville Syrjälä wrote:
> On Mon, Aug 05, 2013 at 02:36:47PM +0100, Damien Lespiau wrote:
> > >From CEA-861:
> > 
> >   Data Byte 1, bit A0 indicates whether Active Format Data is present in
> >   Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
> >   any of the AFD bits are set.
> > 
> > ie. if we want to set active_aspect, we need to set the
> > active_info_valid bit to 1 as well.
> > 
> > Cc: Thierry Reding <thierry.reding@avionic-design.de>
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> 
> Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> But why don't we just kill active_info_valid and instead just
> check active_aspect in hdmi_avi_infoframe_pack()?

Right, so I thought about that, I'd love to have an API that doesn't
allow its user to do something wrong. My reflections so far:

 1/ I did not want to depend on a fix that was outside of the drm/
 directory for people that pull that directory between different
 kernels, they will end up missing the patch in video/hdmi.c.

 On the other hand, we could just tell people to sync
 drivers/video/hdmi.c and include/linux/hdmi.h along with drm/.

 2/ I was thinking that killing the _valid bits in the
 hdmi_avi_infoframe struct would not allow an _unpack() function that
 can check if the infoframe was valid.

Probably thinking too much though...

-- 
Damien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
  2013-08-05 13:36 [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes Damien Lespiau
  2013-08-05 13:54 ` Ville Syrjälä
@ 2013-08-05 18:07 ` Ville Syrjälä
  2013-08-05 18:18   ` Damien Lespiau
  1 sibling, 1 reply; 6+ messages in thread
From: Ville Syrjälä @ 2013-08-05 18:07 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: Thierry Reding, dri-devel

On Mon, Aug 05, 2013 at 02:36:47PM +0100, Damien Lespiau wrote:
> >From CEA-861:
> 
>   Data Byte 1, bit A0 indicates whether Active Format Data is present in
>   Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
>   any of the AFD bits are set.
> 
> ie. if we want to set active_aspect, we need to set the
> active_info_valid bit to 1 as well.
> 
> Cc: Thierry Reding <thierry.reding@avionic-design.de>
> Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> ---
>  drivers/gpu/drm/drm_edid.c | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> index 95d6f4b..8d1139f 100644
> --- a/drivers/gpu/drm/drm_edid.c
> +++ b/drivers/gpu/drm/drm_edid.c
> @@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
>  		return 0;

Nothing to do with this patch, but I just spotted this return here. So
we're not populating the aspect ratio stuff if VIC=0. Doesn't really
make sense to me. Who will tell me what this is trying to achieve?

>  
>  	frame->picture_aspect = HDMI_PICTURE_ASPECT_NONE;
> +	frame->active_info_valid = 1;
>  	frame->active_aspect = HDMI_ACTIVE_ASPECT_PICTURE;
>  
>  	return 0;
> -- 
> 1.8.3.1
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
  2013-08-05 18:07 ` Ville Syrjälä
@ 2013-08-05 18:18   ` Damien Lespiau
  2013-08-05 18:40     ` Ville Syrjälä
  0 siblings, 1 reply; 6+ messages in thread
From: Damien Lespiau @ 2013-08-05 18:18 UTC (permalink / raw)
  To: Ville Syrjälä; +Cc: Thierry Reding, dri-devel

On Mon, Aug 05, 2013 at 09:07:05PM +0300, Ville Syrjälä wrote:
> On Mon, Aug 05, 2013 at 02:36:47PM +0100, Damien Lespiau wrote:
> > >From CEA-861:
> > 
> >   Data Byte 1, bit A0 indicates whether Active Format Data is present in
> >   Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
> >   any of the AFD bits are set.
> > 
> > ie. if we want to set active_aspect, we need to set the
> > active_info_valid bit to 1 as well.
> > 
> > Cc: Thierry Reding <thierry.reding@avionic-design.de>
> > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > ---
> >  drivers/gpu/drm/drm_edid.c | 1 +
> >  1 file changed, 1 insertion(+)
> > 
> > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > index 95d6f4b..8d1139f 100644
> > --- a/drivers/gpu/drm/drm_edid.c
> > +++ b/drivers/gpu/drm/drm_edid.c
> > @@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
> >  		return 0;
> 
> Nothing to do with this patch, but I just spotted this return here. So
> we're not populating the aspect ratio stuff if VIC=0. Doesn't really
> make sense to me. Who will tell me what this is trying to achieve?

I wondered about that to. The intent seems to not set those bits when
we're not setting a CEA mode. I guess the author thought that only CEA
modes can understand the infoframes described in CEA-861. I haven't
found any evidence of that, but made some sense to me.

-- 
Damien

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes
  2013-08-05 18:18   ` Damien Lespiau
@ 2013-08-05 18:40     ` Ville Syrjälä
  0 siblings, 0 replies; 6+ messages in thread
From: Ville Syrjälä @ 2013-08-05 18:40 UTC (permalink / raw)
  To: Damien Lespiau; +Cc: Thierry Reding, dri-devel

On Mon, Aug 05, 2013 at 07:18:27PM +0100, Damien Lespiau wrote:
> On Mon, Aug 05, 2013 at 09:07:05PM +0300, Ville Syrjälä wrote:
> > On Mon, Aug 05, 2013 at 02:36:47PM +0100, Damien Lespiau wrote:
> > > >From CEA-861:
> > > 
> > >   Data Byte 1, bit A0 indicates whether Active Format Data is present in
> > >   Data Byte 2 bits R3 through R0. A source device shall set A0=1 when
> > >   any of the AFD bits are set.
> > > 
> > > ie. if we want to set active_aspect, we need to set the
> > > active_info_valid bit to 1 as well.
> > > 
> > > Cc: Thierry Reding <thierry.reding@avionic-design.de>
> > > Signed-off-by: Damien Lespiau <damien.lespiau@intel.com>
> > > ---
> > >  drivers/gpu/drm/drm_edid.c | 1 +
> > >  1 file changed, 1 insertion(+)
> > > 
> > > diff --git a/drivers/gpu/drm/drm_edid.c b/drivers/gpu/drm/drm_edid.c
> > > index 95d6f4b..8d1139f 100644
> > > --- a/drivers/gpu/drm/drm_edid.c
> > > +++ b/drivers/gpu/drm/drm_edid.c
> > > @@ -3107,6 +3107,7 @@ drm_hdmi_avi_infoframe_from_display_mode(struct hdmi_avi_infoframe *frame,
> > >  		return 0;
> > 
> > Nothing to do with this patch, but I just spotted this return here. So
> > we're not populating the aspect ratio stuff if VIC=0. Doesn't really
> > make sense to me. Who will tell me what this is trying to achieve?
> 
> I wondered about that to. The intent seems to not set those bits when
> we're not setting a CEA mode. I guess the author thought that only CEA
> modes can understand the infoframes described in CEA-861. I haven't
> found any evidence of that, but made some sense to me.

Perhaps. I'm leaning towards just killing that check though.

-- 
Ville Syrjälä
Intel OTC

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2013-08-05 18:40 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-05 13:36 [PATCH] drm: Don't generate invalid AVI infoframes for CEA modes Damien Lespiau
2013-08-05 13:54 ` Ville Syrjälä
2013-08-05 14:13   ` Damien Lespiau
2013-08-05 18:07 ` Ville Syrjälä
2013-08-05 18:18   ` Damien Lespiau
2013-08-05 18:40     ` Ville Syrjälä

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).