linux-media.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] video/hdmi: Fix AVI bar unpack
@ 2019-09-19 13:28 Ville Syrjala
  2019-09-20 14:58 ` Thierry Reding
  0 siblings, 1 reply; 3+ messages in thread
From: Ville Syrjala @ 2019-09-19 13:28 UTC (permalink / raw)
  To: dri-devel
  Cc: intel-gfx, stable, linux-media, Martin Bugge, Hans Verkuil,
	Thierry Reding, Mauro Carvalho Chehab

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

The bar values are little endian, not big endian. The pack
function did it right but the unpack got it wrong. Fix it.

Cc: stable@vger.kernel.org
Cc: linux-media@vger.kernel.org
Cc: Martin Bugge <marbugge@cisco.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
Cc: Thierry Reding <treding@nvidia.com>
Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Fixes: 2c676f378edb ("[media] hdmi: added unpack and logging functions for InfoFrames")
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 drivers/video/hdmi.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/video/hdmi.c b/drivers/video/hdmi.c
index b939bc28d886..9c82e2a0a411 100644
--- a/drivers/video/hdmi.c
+++ b/drivers/video/hdmi.c
@@ -1576,12 +1576,12 @@ static int hdmi_avi_infoframe_unpack(struct hdmi_avi_infoframe *frame,
 	if (ptr[0] & 0x10)
 		frame->active_aspect = ptr[1] & 0xf;
 	if (ptr[0] & 0x8) {
-		frame->top_bar = (ptr[5] << 8) + ptr[6];
-		frame->bottom_bar = (ptr[7] << 8) + ptr[8];
+		frame->top_bar = (ptr[6] << 8) | ptr[5];
+		frame->bottom_bar = (ptr[8] << 8) | ptr[7];
 	}
 	if (ptr[0] & 0x4) {
-		frame->left_bar = (ptr[9] << 8) + ptr[10];
-		frame->right_bar = (ptr[11] << 8) + ptr[12];
+		frame->left_bar = (ptr[10] << 8) | ptr[9];
+		frame->right_bar = (ptr[12] << 8) | ptr[11];
 	}
 	frame->scan_mode = ptr[0] & 0x3;
 
-- 
2.21.0


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

* Re: [PATCH] video/hdmi: Fix AVI bar unpack
  2019-09-19 13:28 [PATCH] video/hdmi: Fix AVI bar unpack Ville Syrjala
@ 2019-09-20 14:58 ` Thierry Reding
  2019-09-20 16:06   ` Ville Syrjälä
  0 siblings, 1 reply; 3+ messages in thread
From: Thierry Reding @ 2019-09-20 14:58 UTC (permalink / raw)
  To: Ville Syrjala
  Cc: dri-devel, Mauro Carvalho Chehab, intel-gfx, stable,
	Hans Verkuil, Martin Bugge, Thierry Reding, linux-media

[-- Attachment #1: Type: text/plain, Size: 808 bytes --]

On Thu, Sep 19, 2019 at 04:28:53PM +0300, Ville Syrjala wrote:
> From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> 
> The bar values are little endian, not big endian. The pack
> function did it right but the unpack got it wrong. Fix it.
> 
> Cc: stable@vger.kernel.org
> Cc: linux-media@vger.kernel.org
> Cc: Martin Bugge <marbugge@cisco.com>
> Cc: Hans Verkuil <hans.verkuil@cisco.com>
> Cc: Thierry Reding <treding@nvidia.com>
> Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> Fixes: 2c676f378edb ("[media] hdmi: added unpack and logging functions for InfoFrames")
> Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> ---
>  drivers/video/hdmi.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)

Reviewed-by: Thierry Reding <treding@nvidia.com>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

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

* Re: [PATCH] video/hdmi: Fix AVI bar unpack
  2019-09-20 14:58 ` Thierry Reding
@ 2019-09-20 16:06   ` Ville Syrjälä
  0 siblings, 0 replies; 3+ messages in thread
From: Ville Syrjälä @ 2019-09-20 16:06 UTC (permalink / raw)
  To: Thierry Reding
  Cc: dri-devel, Mauro Carvalho Chehab, intel-gfx, stable,
	Hans Verkuil, Martin Bugge, Thierry Reding, linux-media

On Fri, Sep 20, 2019 at 04:58:53PM +0200, Thierry Reding wrote:
> On Thu, Sep 19, 2019 at 04:28:53PM +0300, Ville Syrjala wrote:
> > From: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > 
> > The bar values are little endian, not big endian. The pack
> > function did it right but the unpack got it wrong. Fix it.
> > 
> > Cc: stable@vger.kernel.org
> > Cc: linux-media@vger.kernel.org
> > Cc: Martin Bugge <marbugge@cisco.com>
> > Cc: Hans Verkuil <hans.verkuil@cisco.com>
> > Cc: Thierry Reding <treding@nvidia.com>
> > Cc: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
> > Fixes: 2c676f378edb ("[media] hdmi: added unpack and logging functions for InfoFrames")
> > Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
> > ---
> >  drivers/video/hdmi.c | 8 ++++----
> >  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> Reviewed-by: Thierry Reding <treding@nvidia.com>

Thanks. Pushed to drm-misc-next.

-- 
Ville Syrjälä
Intel

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

end of thread, other threads:[~2019-09-20 16:06 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-19 13:28 [PATCH] video/hdmi: Fix AVI bar unpack Ville Syrjala
2019-09-20 14:58 ` Thierry Reding
2019-09-20 16:06   ` 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).