[PATCH RFC 4/4] media: qcom: camss: vfe: Add the IFE 780 pixel pipe description

From: William Bright

Date: Tue Oct 13 2026 - 04:59:40 EST


The IFE 780 WB gain registers only take bits 31:17. A Q10 gain there
reaches full scale at 1.0, while the 0x1000 used on the IFE 880 reads
back as zero and every frame comes out black.

Its demosaic also leaks red and blue into green whenever green sits on
a black level pedestal. With AR1335 colour bars magenta comes out white
and red and blue pick up half scale green. Subtracting the black level
in demux + BLS fixes it.

Describe both and use the description on SM8550.

Assisted-by: Claude:claude-opus-5-5
Signed-off-by: William Bright <william.bright@xxxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-vfe-780.c | 3 +++
drivers/media/platform/qcom/camss/camss-vfe-880-pp.c | 6 ++++++
drivers/media/platform/qcom/camss/camss-vfe-880-pp.h | 1 +
3 files changed, 10 insertions(+)

diff --git a/drivers/media/platform/qcom/camss/camss-vfe-780.c b/drivers/media/platform/qcom/camss/camss-vfe-780.c
index 032786c4ed74..63fee6ab64fe 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-780.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe-780.c
@@ -238,6 +238,9 @@ static inline void vfe_reg_update_clear(struct vfe_device *vfe,
*/
static const struct vfe_pp_desc *vfe_pp_desc(struct vfe_device *vfe)
{
+ if (vfe->camss->res->version == CAMSS_8550)
+ return &vfe_pp_desc_780;
+
return &vfe_pp_desc_880;
}

diff --git a/drivers/media/platform/qcom/camss/camss-vfe-880-pp.c b/drivers/media/platform/qcom/camss/camss-vfe-880-pp.c
index 87e6a241ec05..2d58d31fddec 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-880-pp.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe-880-pp.c
@@ -374,6 +374,12 @@ static void vfe_setup_demux_bls(struct vfe_device *vfe, u32 code)
writel_relaxed(IFE_DEMUX_BLS_PERIOD(1) | 1, vfe->base + IFE_DEMUX_BLS_MODULE_CFG);
}

+/* IFE 780: Q10 gain held in bits 31:17, its demosaic needs the black level gone */
+const struct vfe_pp_desc vfe_pp_desc_780 = {
+ .wb_gain = 0x400 << 17,
+ .demux_bls = true,
+};
+
/* IFE 880: Q10 gain of 4.0 */
const struct vfe_pp_desc vfe_pp_desc_880 = {
.wb_gain = 0x00001000,
diff --git a/drivers/media/platform/qcom/camss/camss-vfe-880-pp.h b/drivers/media/platform/qcom/camss/camss-vfe-880-pp.h
index 0a5ee6d85312..90e118fa5bde 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe-880-pp.h
+++ b/drivers/media/platform/qcom/camss/camss-vfe-880-pp.h
@@ -12,6 +12,7 @@ struct vfe_pp_desc {
bool demux_bls; /* subtract the black level in demux + BLS */
};

+extern const struct vfe_pp_desc vfe_pp_desc_780;
extern const struct vfe_pp_desc vfe_pp_desc_880;

void vfe_880_setup_pixel_pipe(struct vfe_device *vfe, const struct vfe_pp_desc *desc,

--
2.43.0