[PATCH 61/74] media: qcom: camss: vfe: Size the pixel path clock by its pixels per clock
From: bod
Date: Mon Oct 05 2026 - 13:39:10 EST
From: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
vfe_check_clock_rates() and vfe_set_clock_rates() size the VFE clock for
a pixel line at one pixel per clock. That holds for the VFE 4.x and TFE
pixel paths, but the SM8650 IFE pixel path takes two pixels per clock.
There the PIX line asks for more than the highest VFE clock level and
fails to power up with "Pixel clock is too high for VFE".
Add vfe_pix_ppc(), alongside vfe_bpl_align_pix(), and divide the pixel
rate by it. Every existing pixel path stays at one pixel per clock.
SM8650 takes two.
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-vfe.c | 21 +++++++++++++++++++--
1 file changed, 19 insertions(+), 2 deletions(-)
diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index bf8ae6a6bfae0..588a355b67ff0 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -1137,6 +1137,23 @@ static bool vfe_check_clock_levels(struct camss_clock *clock)
return false;
}
+/*
+ * vfe_pix_ppc - Pixels the pixel path consumes per VFE clock
+ * @vfe: VFE device
+ *
+ * The VFE 4.x and TFE pixel paths take one pixel per clock, the SM8650 IFE
+ * pixel path two.
+ */
+static u32 vfe_pix_ppc(struct vfe_device *vfe)
+{
+ switch (vfe->camss->res->version) {
+ case CAMSS_8650:
+ return 2;
+ default:
+ return 1;
+ }
+}
+
/*
* vfe_set_clock_rates - Calculate and set clock rates on VFE module
* @vfe: VFE device
@@ -1169,7 +1186,7 @@ static int vfe_set_clock_rates(struct vfe_device *vfe)
u8 bpp;
if (vfe->line[j].is_pix) {
- tmp = pixel_clock[j];
+ tmp = div_u64(pixel_clock[j], vfe_pix_ppc(vfe));
} else {
struct vfe_line *l = &vfe->line[j];
@@ -1250,7 +1267,7 @@ static int vfe_check_clock_rates(struct vfe_device *vfe)
u8 bpp;
if (vfe->line[j].is_pix) {
- tmp = pixel_clock[j];
+ tmp = div_u64(pixel_clock[j], vfe_pix_ppc(vfe));
} else {
struct vfe_line *l = &vfe->line[j];
--
2.55.0