public inbox for linux-media@vger.kernel.org
 help / color / mirror / Atom feed
From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
To: Sergei Shtylyov <sergei.shtylyov@gmail.com>
Cc: linux-media@vger.kernel.org, linux-renesas-soc@vger.kernel.org,
	Hans Verkuil <hverkuil-cisco@xs4all.nl>
Subject: Re: [PATCH 2/2] media: i2c: adv7604: Fix range of hue control
Date: Mon, 13 Feb 2023 13:12:00 +0200	[thread overview]
Message-ID: <Y+obAApZXgtb08k5@pendragon.ideasonboard.com> (raw)
In-Reply-To: <e2f92695-c681-616d-a565-89d348f00a3b@gmail.com>

Hi Sergei,

On Sat, Feb 11, 2023 at 12:11:17PM +0300, Sergei Shtylyov wrote:
> Hello!
> 
> On 2/11/23 1:56 AM, Laurent Pinchart wrote:
> 
> > The ADV7604, ADV7611 and ADV7612 software manuals different the CP_HUE
> 
>    s/different/document/?

Indeed. I'll fix this in v2, but will wait for Hans to test the patches
on ADV7604 and/or ADV7611 before sending the new version.

> > value differently:
> > 
> > - For ADV7604 and ADV7611, the hue is specified as an unsigned 8-bit
> >   value, and calculated as
> > 
> >   (CP_HUE[7:0] * 180) / 256 - 90
> > 
> >   with the range set to [-90°, 90°]. Additionally, the values 0x00, 0x0f
> >   and 0xff are documented as corresponding to -90°, 0° and 90°
> >   respectively.
> > 
> > - For ADV7612, the hue is specified as a signed 8-bit value in the range
> >   [0°, 360°[ without any formula. Additionally, the value 0x00 is
> >   documented as corresponding to 0°.
> > 
> > The ADV7604 and ADV7611 documentation is clearly wrong as the example
> > values don't correspond to the formula. Furthermore, the [-90°, 90°]
> > range seems incorrect as it would cover only half of the hue space.
> > 
> > The ADV7612 documentation is better, although the range should likely be
> > [-180°, 180°[ if the value is signed. Given that the values wrap around,
> > this makes no difference in practice.
> > 
> > The hue values have been verified on ADV7612 to follow the
> > documentation. There is a high chance they do as well on ADV7604 and
> > ADV7611.
> > 
> > In any case, all software manuals document the register as 8-bit, so the
> > current range of the V4L2 hue control [0, 128] is not correct. Expand it
> > to cover the full 8-bit space, using unsigned values to avoid breaking
> > any application that may rely on 128 being a valid value.
> > 
> > Signed-off-by: Laurent Pinchart <laurent.pinchart+renesas@ideasonboard.com>
> [...]
> 
> MBR, Sergey

-- 
Regards,

Laurent Pinchart

  reply	other threads:[~2023-02-13 11:12 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-10 22:56 [PATCH 0/2] media: i2c: adv7604: Fix handling of video adjustments Laurent Pinchart
2023-02-10 22:56 ` [PATCH 1/2] media: i2c: adv7604: Enable video adjustment Laurent Pinchart
2023-02-15 12:49   ` Hans Verkuil
2023-02-10 22:56 ` [PATCH 2/2] media: i2c: adv7604: Fix range of hue control Laurent Pinchart
2023-02-11  9:11   ` Sergei Shtylyov
2023-02-13 11:12     ` Laurent Pinchart [this message]
2023-02-15 12:49   ` Hans Verkuil

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=Y+obAApZXgtb08k5@pendragon.ideasonboard.com \
    --to=laurent.pinchart@ideasonboard.com \
    --cc=hverkuil-cisco@xs4all.nl \
    --cc=linux-media@vger.kernel.org \
    --cc=linux-renesas-soc@vger.kernel.org \
    --cc=sergei.shtylyov@gmail.com \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox