[PATCH v2 0/6] media: qcom: camss: share VFE clock sources on SM8250

From: Atanas Filipov

Date: Sat Oct 24 2026 - 05:44:23 EST


On SM8250 several VFE clocks are fed by one clock source: the AREG
clocks of the two full VFEs share the fast AHB source, the two VFE Lite
share one core clock source, and all four VFEs share the camera NoC AXI
source. Each VFE sets such a source to its own rate, so the last VFE to
power on wins and can lower the rate under a VFE that is still running.
The CSID also sets the VFE core clocks to their lowest level when it
powers on after the VFE, and nothing sets the camera NoC AXI rate, so
the camera NoC runs from XO and two concurrent streams stall.

Two examples on RB5 (QRB5165):

- VFE0 streams the CSID test pattern and VFE1 then starts an imx577
stream. Nothing sets the camera NoC AXI rate, so the camera NoC stays
at XO (19.2 MHz) and one of the two streams stalls. With the series
the VFEs set it to 300 or 400 MHz and both streams complete.

- VFE Lite 0 streams the CSID test pattern at 480 MHz and VFE Lite 1
then starts an imx577 stream that needs 400 MHz. The two share one
core clock source, so VFE Lite 1 lowers it to 400 MHz under the
running VFE Lite 0. With the series the source stays at 480 MHz until
VFE Lite 0 stops.

This series lets the VFE own its clock rates and aggregates the shared
sources within CAMSS:

- Patch 1 moves the minimum rate computation out of the VFE clock
loops, with no functional change.
- Patch 2 clamps each VFE clock to its highest listed rate instead of
failing, as the VFE clock rate tables need not have the same number
of levels.
- Patch 3 stops the CSID from setting the VFE core clock rates.
- Patch 4 groups the VFE clocks by clock source, so that a shared
source runs at the highest rate requested by the running VFEs. It is
enabled per SoC, so far only on SM8250.
- Patch 5 lets the VFE set the AREG clock rate.
- Patch 6 drops the unused camera NoC AXI RCG from the VFE clocks and
lets the VFE set the camera NoC AXI rate.

The camera NoC AXI clock is also used by drivers outside CAMSS, and how
to aggregate their requests with the CAMSS one is still being discussed
on the CAMNOC interconnect series. Patch 6 does not depend on that
choice: it only aggregates the CAMSS VFEs, which share one source, and
fixes the concurrent stall today. Once the shared camera NoC clock is
represented, the VFE will request its rate through that interface
instead of setting the clock directly.

Tested on RB5 (QRB5165) with imx577 and ov9282 sensors and the CSID test
pattern generator, on single, concurrent test pattern plus sensor, and
concurrent dual sensor RDI captures on all four VFEs: all streams
complete, the shared sources stay at the highest requested rate while
another VFE runs, dedicated clocks drop to XO on power off, and the
camera NoC AXI clock runs at 300 or 400 MHz while streaming, without
the concurrent capture stalls seen before the series.

Changes in v2:
- Split the minimum rate computation out of the clock loops into its
own patch (Loic Poulain)
- Add the Fixes tag to the CSID patch (Bryan O'Donoghue)
- Split the clock grouping from the AREG clock change and add an
example to the grouping commit message (Bryan O'Donoghue)
- Rename the per-clock entries of a clock domain from user to vote
(Bryan O'Donoghue)

Atanas Filipov (6):
media: qcom: camss: factor out the VFE minimum clock rate
media: qcom: camss: clamp VFE clock rates to the highest level
media: qcom: camss: sm8250: do not set VFE core clock rates from CSID
media: qcom: camss: share VFE clock sources by the highest rate
media: qcom: camss: sm8250: set the VFE AREG clock rate from the VFE
media: qcom: camss: sm8250: set the camera NoC AXI rate from the VFE

drivers/media/platform/qcom/camss/camss-vfe.c | 138 ++++++-----
drivers/media/platform/qcom/camss/camss.c | 215 ++++++++++++++++--
drivers/media/platform/qcom/camss/camss.h | 13 ++
3 files changed, 272 insertions(+), 94 deletions(-)


base-commit: bd1ecbb61afefc6a8b876ccbc31e9228b44e9eab
--
2.34.1