mbox series

[0/3] media: i2c: adv748x: Enable pattern generator without external HDMI source

Message ID 20230222221249.1324102-1-niklas.soderlund+renesas@ragnatech.se
Headers show
Series media: i2c: adv748x: Enable pattern generator without external HDMI source | expand

Message

Niklas Söderlund Feb. 22, 2023, 10:12 p.m. UTC
Hello,

This small series enables the pattern generator for the HDMI block to 
function correctly without an external HDMI source connected.

Without this series there are a few small errors in the timings code 
which prevents the user from setting the timings, instead they need to 
be queried from an external device.

Patch 1/3 fix the lookup and matching of requested timings to the 
timings the device supports, this lookup was incorrectly implemented.  

Patch 2/3 fixes a corner case where the initial timing selected by the 
driver to have something to report to user-space can't be used correctly 
if it is the first set of timings the user wish to use.

Finally patch 3/3 removes the need for an external HDMI source to 
operate the pattern generator. Instead of failing when querying DV 
timings and their is no HDMI signal but the pattern generator is 
enabled, report the timings programmed by the user. These user 
programmed timings are then picked up by the pattern generator to 
produce a test image using those timings.

Tested on a few different R-Car Gen3 boards (H3, M3-N) with no 
regressions.

I can finally run all my automated tests without turning on my Xbox! :-)

Niklas Söderlund (3):
  media: i2c: adv748x: Fix lookup of DV timings
  media: i2c: adv748x: Write initial DV timings to device
  media: i2c: adv748x: Report correct DV timings for pattern generator

 drivers/media/i2c/adv748x/adv748x-hdmi.c | 21 +++++++++++++++------
 1 file changed, 15 insertions(+), 6 deletions(-)

Comments

Geert Uytterhoeven Feb. 23, 2023, 10:05 a.m. UTC | #1
Hi Niklas,

On Wed, Feb 22, 2023 at 11:15 PM Niklas Söderlund
<niklas.soderlund+renesas@ragnatech.se> wrote:
> The loop to match the requested timings with the ones supported by the
> driver is incorrect. It always iterates thru the whole array of
> supported modes. The bounds check after the loop always triggers
> resulting in adv748x_hdmi_set_video_timings() always returning -EINVAL.
>
> Fix this by correcting the lookup to break the loop when a match is
> found.

Nice catch!

> Signed-off-by: Niklas Söderlund <niklas.soderlund+renesas@ragnatech.se>

Fixes: 3e89586a64dfd286 ("media: i2c: adv748x: add adv748x driver")
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Gr{oetje,eeting}s,

                        Geert