mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jai Luthra <jai.luthra@ideasonboard.com>
To: Sakari Ailus <sakari.ailus@linux.intel.com>
Cc: Jacopo Mondi <jacopo.mondi@ideasonboard.com>,
	Mauro Carvalho Chehab <mchehab@kernel.org>,
	Laurent Pinchart <laurent.pinchart@ideasonboard.com>,
	Kieran Bingham <kieran.bingham@ideasonboard.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org,
	Dave Stevenson <dave.stevenson@raspberrypi.org>
Subject: Re: [PATCH] media: Documentation: Fix frame interval calculation for raw camera sensors
Date: Wed, 25 Feb 2026 14:23:22 +0530	[thread overview]
Message-ID: <177200960262.14753.8678718901155184945@freya> (raw)
In-Reply-To: <aZ1jy6QIdNqYgDXa@kekkonen.localdomain>

Quoting Sakari Ailus (2026-02-24 14:09:39)
> Hi Jai,
> 
> On Tue, Feb 24, 2026 at 10:55:33AM +0530, Jai Luthra wrote:
> > >         LLP = (analog_crop_width + HBLANK) / binning_timing_h
> > >         FLL = (analog_crop_height + VBLANK) / binning_timing_v
> > >         frame_interval = LLP * FLL / pixel_rate
> > > 
> > > I'm not 100% sure this is correct however, as the blankings should be
> > > expressed on a different clock domain that the pixel sampling rate,
> > > but I guess this is a reasonable approximation ?
> > 
> > What does these two extra controls really offer us?
> 
> The conclusion earlier on (well, maybe 10 years ago?) was that we should
> have had these to begin with, and not to use the blanking values to control
> the frame rate, largely because it requires a reference rectangle -- and
> the current drivers use a wrong one, mostly because the API doesn't offer
> the right one. The assumption back then was that everything would soon be
> SMIA (or now CCS) compliant so this wouldn't matter much. But here we
> are...
> 
> The VBLANK and HBLANK controls effectively also use the wrong reference
> (output size) in most drivers and that can't really be changed meaningfully
> without breaking things.
> 

Argh, makes sense.

> > 
> > All sensors we have seen thus far map their LLP/FLL (or equivalent HTOT/VTOT)
> > values with respect to the digital readout, and not the analogue pixel array.
> > 
> > If we add these two controls, we will have to support two different models for
> > frame interval calculation in the application layer too. Which I'm fine with if
> > it has a practical benefit, that is, it makes it easier to deal with some
> > particular sensor.
> 
> There are three models, effectively:
> 
> 1. CCS, where vblank and hblank are related to analogue crop rectangle, as in
>    hardware;
> 
> 2. Common raw sensor model, with LLP and FLL; and
> 
> 3. the rest of the existing drivers (vblank and hblank relative to format
>    on source pad).
> 

Thanks that's helpful summary. I will update v2 to reflect 1 and 3, while
details for common raw sensor model can be finalized later.

> In the case of frame length vs. blanking, I'd presume the difference in the
> user space will be relatively small.
> 

Indeed, switching to a different LLP/FFL control is easy, what's annoying
is having two different reference rectangles for the H/VBLANK controls.

> > 
> > And if exposing the LLP/FLL directly offer the same benefit, then that is
> > cleaner, as it leaves the HBLANK/VBLANK as-is in the new model.
> 
> -- 
> Kind regards,
> 
> Sakari Ailus

Thanks,
    Jai

  reply	other threads:[~2026-02-25  8:53 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19  7:50 Jai Luthra
2026-02-19  9:51 ` Sakari Ailus
2026-02-19 14:56   ` Jai Luthra
2026-02-20 10:11     ` Sakari Ailus
2026-02-23  9:11 ` Jacopo Mondi
2026-02-23 10:06   ` Sakari Ailus
2026-02-23 10:25     ` Jacopo Mondi
2026-02-24  5:25   ` Jai Luthra
2026-02-24  8:39     ` Sakari Ailus
2026-02-25  8:53       ` Jai Luthra [this message]
2026-02-24 18:22     ` Jacopo Mondi
2026-02-25  8:12       ` Jacopo Mondi
2026-02-25  8:58         ` Jai Luthra

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=177200960262.14753.8678718901155184945@freya \
    --to=jai.luthra@ideasonboard.com \
    --cc=dave.stevenson@raspberrypi.org \
    --cc=jacopo.mondi@ideasonboard.com \
    --cc=kieran.bingham@ideasonboard.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@kernel.org \
    --cc=sakari.ailus@linux.intel.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

all inboxes | Powered by JetHome®