[PATCH 60/74] media: qcom: camss: vfe: Select line-based mode for the pixel path's video node

From: bod

Date: Mon Oct 05 2026 - 13:36:50 EST


From: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>

The pixel path's video node is always marked line based. A line-based
node caps its buffer at CAMSS_FRAME_MAX_HEIGHT_PIX lines of bytesperline,
counting every plane's lines together. That fits the VFE 4.x and TFE
pixel outputs, but not the SM8650 IFE, which writes luma and chroma
through separate write masters, each programmed with its own height.
There, single-buffer NV12 at 4080x3072 needs 4608 lines: the buffer is
cut to 4096 lines and the CbCr write runs off its end.

Add vfe_pix_line_based(), alongside vfe_bpl_align_pix(). Every existing
pixel path stays line based. SM8650 is not.

Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@xxxxxxxxxx>
---
drivers/media/platform/qcom/camss/camss-vfe.c | 23 ++++++++++++++++++++++-
1 file changed, 22 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c b/drivers/media/platform/qcom/camss/camss-vfe.c
index 0c7be87d7bd57..bf8ae6a6bfae0 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -2285,6 +2285,27 @@ static int vfe_bpl_align_rdi(struct vfe_device *vfe)
return ret;
}

+/*
+ * vfe_pix_line_based - Select line-based mode for the pixel path's video node
+ * @vfe: VFE device
+ *
+ * A line-based video node caps its buffer at CAMSS_FRAME_MAX_HEIGHT_PIX lines,
+ * counting every plane's lines together. That fits the VFE 4.x and TFE pixel
+ * outputs. The SM8650 IFE writes luma and chroma through separate write
+ * masters, each programmed with its own height, so the cap does not apply.
+ *
+ * Return true if the pixel path's video node is line based
+ */
+static bool vfe_pix_line_based(struct vfe_device *vfe)
+{
+ switch (vfe->camss->res->version) {
+ case CAMSS_8650:
+ return false;
+ default:
+ return true;
+ }
+}
+
static int vfe_bpl_align_pix(struct vfe_device *vfe)
{
int ret = 16;
@@ -2377,7 +2398,7 @@ int msm_vfe_register_entities(struct vfe_device *vfe,
video_out->ops = &vfe->video_ops;
if (vfe->line[i].is_pix) {
video_out->bpl_alignment = vfe_bpl_align_pix(vfe);
- video_out->line_based = 1;
+ video_out->line_based = vfe_pix_line_based(vfe);
} else {
video_out->bpl_alignment = vfe_bpl_align_rdi(vfe);
video_out->line_based = 0;

--
2.55.0