linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe
@ 2015-07-28 13:59 Jean-Francois Moine
  0 siblings, 0 replies; 4+ messages in thread
From: Jean-Francois Moine @ 2015-07-28 13:59 UTC (permalink / raw)
  To: linux-arm-kernel

Using hdmi_avi_infoframe_pack() to create the AVI infoframe calculates
the checksum of the frame and breaks the second calculation which is
done in tda998x_write_if(). Then the HDMI AVI frame is wrong and
the display device does not handle correctly the video frames.

Fixes: 8c7a075da9f7980c ("use drm_hdmi_avi_infoframe_from_display_mode()")
Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
---
v2: add the Fixes: tag
---
 drivers/gpu/drm/i2c/tda998x_drv.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
index fe1599d..424228b 100644
--- a/drivers/gpu/drm/i2c/tda998x_drv.c
+++ b/drivers/gpu/drm/i2c/tda998x_drv.c
@@ -606,8 +606,6 @@ static void
 tda998x_write_if(struct tda998x_priv *priv, uint8_t bit, uint16_t addr,
 		 uint8_t *buf, size_t size)
 {
-	buf[PB(0)] = tda998x_cksum(buf, size);
-
 	reg_clear(priv, REG_DIP_IF_FLAGS, bit);
 	reg_write_range(priv, addr, buf, size);
 	reg_set(priv, REG_DIP_IF_FLAGS, bit);
@@ -627,6 +625,8 @@ tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p)
 	buf[PB(4)] = p->audio_frame[4];
 	buf[PB(5)] = p->audio_frame[5] & 0xf8; /* DM_INH + LSV */
 
+	buf[PB(0)] = tda998x_cksum(buf, sizeof(buf));
+
 	tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf,
 			 sizeof(buf));
 }
-- 
2.4.6

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

* [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe
       [not found] <E1ZK5bb-00079F-WC@bombadil.infradead.org>
@ 2015-08-04  6:05 ` Jean-Francois Moine
  2015-08-04 23:01   ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Jean-Francois Moine @ 2015-08-04  6:05 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, 28 Jul 2015 15:59:17 +0200
Jean-Francois Moine <moinejf@free.fr> wrote:

> Using hdmi_avi_infoframe_pack() to create the AVI infoframe calculates
> the checksum of the frame and breaks the second calculation which is
> done in tda998x_write_if(). Then the HDMI AVI frame is wrong and
> the display device does not handle correctly the video frames.
> 
> Fixes: 8c7a075da9f7980c ("use drm_hdmi_avi_infoframe_from_display_mode()")
> Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> ---
> v2: add the Fixes: tag
> ---
>  drivers/gpu/drm/i2c/tda998x_drv.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i2c/tda998x_drv.c b/drivers/gpu/drm/i2c/tda998x_drv.c
> index fe1599d..424228b 100644
> --- a/drivers/gpu/drm/i2c/tda998x_drv.c
> +++ b/drivers/gpu/drm/i2c/tda998x_drv.c
> @@ -606,8 +606,6 @@ static void
>  tda998x_write_if(struct tda998x_priv *priv, uint8_t bit, uint16_t addr,
>  		 uint8_t *buf, size_t size)
>  {
> -	buf[PB(0)] = tda998x_cksum(buf, size);
> -
>  	reg_clear(priv, REG_DIP_IF_FLAGS, bit);
>  	reg_write_range(priv, addr, buf, size);
>  	reg_set(priv, REG_DIP_IF_FLAGS, bit);
> @@ -627,6 +625,8 @@ tda998x_write_aif(struct tda998x_priv *priv, struct tda998x_encoder_params *p)
>  	buf[PB(4)] = p->audio_frame[4];
>  	buf[PB(5)] = p->audio_frame[5] & 0xf8; /* DM_INH + LSV */
>  
> +	buf[PB(0)] = tda998x_cksum(buf, sizeof(buf));
> +
>  	tda998x_write_if(priv, DIP_IF_FLAGS_IF4, REG_IF4_HB0, buf,
>  			 sizeof(buf));
>  }

Ping!

-- 
Ken ar c'henta?	|	      ** Breizh ha Linux atav! **
Jef		|		http://moinejf.free.fr/

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

* [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe
  2015-08-04  6:05 ` [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe Jean-Francois Moine
@ 2015-08-04 23:01   ` Russell King - ARM Linux
  2015-08-05 17:09     ` Russell King - ARM Linux
  0 siblings, 1 reply; 4+ messages in thread
From: Russell King - ARM Linux @ 2015-08-04 23:01 UTC (permalink / raw)
  To: linux-arm-kernel

On Tue, Aug 04, 2015 at 08:05:57AM +0200, Jean-Francois Moine wrote:
> On Tue, 28 Jul 2015 15:59:17 +0200
> Jean-Francois Moine <moinejf@free.fr> wrote:
> 
> > Using hdmi_avi_infoframe_pack() to create the AVI infoframe calculates
> > the checksum of the frame and breaks the second calculation which is
> > done in tda998x_write_if(). Then the HDMI AVI frame is wrong and
> > the display device does not handle correctly the video frames.
> > 
> > Fixes: 8c7a075da9f7980c ("use drm_hdmi_avi_infoframe_from_display_mode()")
> > Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> 
> Ping!

I applied the patch a while back (July 17th to be exact) and in the queue
to be sent - I'll update the commit message prior to doing that.  Thanks.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

* [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe
  2015-08-04 23:01   ` Russell King - ARM Linux
@ 2015-08-05 17:09     ` Russell King - ARM Linux
  0 siblings, 0 replies; 4+ messages in thread
From: Russell King - ARM Linux @ 2015-08-05 17:09 UTC (permalink / raw)
  To: linux-arm-kernel

On Wed, Aug 05, 2015 at 12:01:53AM +0100, Russell King - ARM Linux wrote:
> On Tue, Aug 04, 2015 at 08:05:57AM +0200, Jean-Francois Moine wrote:
> > On Tue, 28 Jul 2015 15:59:17 +0200
> > Jean-Francois Moine <moinejf@free.fr> wrote:
> > 
> > > Using hdmi_avi_infoframe_pack() to create the AVI infoframe calculates
> > > the checksum of the frame and breaks the second calculation which is
> > > done in tda998x_write_if(). Then the HDMI AVI frame is wrong and
> > > the display device does not handle correctly the video frames.
> > > 
> > > Fixes: 8c7a075da9f7980c ("use drm_hdmi_avi_infoframe_from_display_mode()")
> > > Signed-off-by: Jean-Francois Moine <moinejf@free.fr>
> > 
> > Ping!
> 
> I applied the patch a while back (July 17th to be exact) and in the queue
> to be sent - I'll update the commit message prior to doing that.  Thanks.

I've been able to get my hands on an AV amp, and I was hoping to use
that to validate things like the info frames.  Having investigated
today, while I'm able to get information from it, it's not as complete
as I'd like - for example, it gives me for the AVI:

	82 02 0D 12 28 08 1F 00 00 00 00 00 00 00 00 00

which is the CEA-861-D AVI, not the HDMI AVI (it's missing the checksum
between bytes 2 and 3).  Even more unfortunate is that it accepts the
transmitted AVI frame whether or not the checksum is valid.  However,
the AV amp reports that it sends the AVI frame onto the TV with a correct
checksum:

	82 02 0D 0E 12 28 08 1F ...

What this means is that I now have a way to read the various control
packets on HDMI, but not with their checksums, and no way to validate
whether the checksums are correct.

-- 
FTTC broadband for 0.8mile line: currently at 10.5Mbps down 400kbps up
according to speedtest.net.

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

end of thread, other threads:[~2015-08-05 17:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <E1ZK5bb-00079F-WC@bombadil.infradead.org>
2015-08-04  6:05 ` [PATCH v2] drm/i2c: tda998x: Fix bad checksum of the HDMI AVI infoframe Jean-Francois Moine
2015-08-04 23:01   ` Russell King - ARM Linux
2015-08-05 17:09     ` Russell King - ARM Linux
2015-07-28 13:59 Jean-Francois Moine

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).