mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH 00/14] Add SOF/EOF sequence logic
@ 2026-10-29  9:55 bryan.odonoghue
  2026-10-29  9:55 ` [PATCH 01/14] media: qcom: camss: Introduce CPU latency QoS during streaming bryan.odonoghue
                   ` (14 more replies)
  0 siblings, 15 replies; 26+ messages in thread
From: bryan.odonoghue @ 2026-10-29  9:55 UTC (permalink / raw)
  To: Bryan O'Donoghue, Vladimir Zapolskiy, Loic Poulain,
	Mauro Carvalho Chehab
  Cc: linux-media, linux-arm-msm, linux-kernel, Bryan O'Donoghue

This series enables SOF AND EOF event tracking making use of both events.
Whilst the code is actually very simple the functionality we want to build
off of that simple code is not.

- SOF
  Serves two functions. Firstly. Informing user-space of CSID SOF events.
  Standard Linux V4L2_EVENT_FRAME_SYNC is trigger from this event.
  User-space wants to capture this trigger because it allows user-space to
  better align the time a frame begins to events elsewhere such as IMU
  event timestamps.

  That functionality is directly applicable in this series.

  However we will also build on the SOF event in later patches to allow us
  to begin programming of shadow-registers for the next camera frame.

  When the EOF event happens, we switch from one shadow bank to the next.
  This is only possible if you have the SOF event.

  So SOF serves the immediate purpose of timestamp alignment in user-space
  as well as the 'evil plan' to trigger off of it programming camera
  parameters for the next frame.

- EOF
  EOF even on its own is useful because it allows us to increment
  vb.sequence for each frame as per the spec not just when we have
  buffer-data.

There is another purpose to having an SOF and EOF event with sequence
numbers and that is.

User-space submits a parameters buffer. Kernel accepts that parameters
buffer but can make no guarantee about _when_ the entire buffer will be
applied.

So when kernel finishes application of the entire params sequence the
returned buffer contains the sequence number - from the EOF tracking which
informs user-space _which_ frame vb.sequence its given params buffer was
applied.

Similarly when kernel produces a statistics buffer that buffer will have a
sequence number - and that sequence number will align to the frame sequence
number that the statistics describe.

Thus SOF/EOF tracking is fundamental to passing parameters, returning
statistics to user-space and for the IPA algorithm in user-space to
understand which stats, params and frames are related.

The first patch in the series addresses a corner-case when a quiescent
system can take quite a while to wake from idle, too long in fact such that
the SOF event is effectively missed.

On 'normal' systems doing lots of things, this is not a problem we would
see however on my test X1-CRD system running from ramdisk - there's
basically nothing else happening and the wake-time becomes apparent.

This is not strictly speaking a bugfix since right now nothing in CAMSS
cares about SOF or EOF so if we take an additional 2.5 ms to process a
data-buffer on a fully quiescent system, that's not the end of the world.

OTOH as soon as you start to care about SOF/EOF then missing those events
is no bueno.

The CPU latency value chosen is 100% stolen from IPU7 which seems like a
good starting point - the stealing obviously - and happens to also work.

This series is really an enabling series for more work to come but even on
its own is an improvement on the current situation.

Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
---
Bryan O'Donoghue (14):
      media: qcom: camss: Introduce CPU latency QoS during streaming
      media: qcom: camss: vfe: Add eof_seq to vfe_line
      media: qcom: camss: Introduce SOF sequence tracking
      media: qcom: camss: Introduce EOF sequence tracking
      media: qcom: camss: csid-gen3: Enable RDI SOF driving
      media: qcom: camss: csid-gen3: Enable RDI EOF tracking
      media: qcom: camss: csid-680: Enable RDI SOF tracking
      media: qcom: camss: csid-680: Enable RDI EOF tracking
      media: qcom: camss: csid-gen2: Enable RDI SOF tracking
      media: qcom: camss: csid-gen2: Enable RDI EOF tracking
      media: qcom: camss: Switch on frame_sync_en logic for sm8650
      media: qcom: camss: Switch on frame_sync_en for x1e/x2e
      media: qcom: camss: Switch on frame_sync_en for sm8250
      media: qcom: camss: Switch on frame_sync_en for sdm845

 drivers/media/platform/qcom/camss/camss-csid-680.c | 21 ++++++
 .../media/platform/qcom/camss/camss-csid-gen2.c    | 19 ++++++
 .../media/platform/qcom/camss/camss-csid-gen3.c    | 31 +++++++++
 drivers/media/platform/qcom/camss/camss-csid.c     | 74 +++++++++++++++++++++-
 drivers/media/platform/qcom/camss/camss-csid.h     | 31 +++++++++
 drivers/media/platform/qcom/camss/camss-vfe-17x.c  |  5 +-
 drivers/media/platform/qcom/camss/camss-vfe.c      |  9 ++-
 drivers/media/platform/qcom/camss/camss-vfe.h      |  1 +
 drivers/media/platform/qcom/camss/camss-video.c    |  4 ++
 drivers/media/platform/qcom/camss/camss.c          | 44 +++++++++++++
 drivers/media/platform/qcom/camss/camss.h          |  7 ++
 11 files changed, 243 insertions(+), 3 deletions(-)
---
base-commit: 6d0933ae9d46674a6ea63a87e9e9ab4e662670c9
change-id: 20261029-v4l2-frame-sync-0d6fb94ab6e6

Best regards,
--  
---
bod


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

end of thread, other threads:[~2026-10-29 16:36 UTC | newest]

Thread overview: 26+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-29  9:55 [PATCH 00/14] Add SOF/EOF sequence logic bryan.odonoghue
2026-10-29  9:55 ` [PATCH 01/14] media: qcom: camss: Introduce CPU latency QoS during streaming bryan.odonoghue
2026-10-29 10:10   ` Loic Poulain
2026-10-29 11:03     ` Bryan O'Donoghue
2026-10-29  9:55 ` [PATCH 02/14] media: qcom: camss: vfe: Add eof_seq to vfe_line bryan.odonoghue
2026-10-29  9:55 ` [PATCH 03/14] media: qcom: camss: Introduce SOF sequence tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 04/14] media: qcom: camss: Introduce EOF " bryan.odonoghue
2026-10-29  9:55 ` [PATCH 05/14] media: qcom: camss: csid-gen3: Enable RDI SOF driving bryan.odonoghue
2026-10-29 15:43   ` Loic Poulain
2026-10-29 15:46     ` Loic Poulain
2026-10-29 15:49       ` Bryan O'Donoghue
2026-10-29 16:25         ` Gjorgji Rosikopulos (Consultant)
2026-10-29 16:36           ` Loic Poulain
2026-10-29 15:47     ` Bryan O'Donoghue
2026-10-29  9:55 ` [PATCH 06/14] media: qcom: camss: csid-gen3: Enable RDI EOF tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 07/14] media: qcom: camss: csid-680: Enable RDI SOF tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 08/14] media: qcom: camss: csid-680: Enable RDI EOF tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 09/14] media: qcom: camss: csid-gen2: Enable RDI SOF tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 10/14] media: qcom: camss: csid-gen2: Enable RDI EOF tracking bryan.odonoghue
2026-10-29  9:55 ` [PATCH 11/14] media: qcom: camss: Switch on frame_sync_en logic for sm8650 bryan.odonoghue
2026-10-29  9:55 ` [PATCH 12/14] media: qcom: camss: Switch on frame_sync_en for x1e/x2e bryan.odonoghue
2026-10-29  9:55 ` [PATCH 13/14] media: qcom: camss: Switch on frame_sync_en for sm8250 bryan.odonoghue
2026-10-29  9:55 ` [PATCH 14/14] media: qcom: camss: Switch on frame_sync_en for sdm845 bryan.odonoghue
2026-10-29 13:28 ` [PATCH 00/14] Add SOF/EOF sequence logic Gjorgji Rosikopulos (Consultant)
2026-10-29 14:44   ` Bryan O'Donoghue
2026-10-29 14:51     ` Gjorgji Rosikopulos (Consultant)

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®