On Fri Mar 13 20:51:52 2026 +0100, Loic Poulain wrote:
> Split the VFE bytes-per-line (BPL) alignment logic into separate
> helpers for RDI and PIX paths. RDI is usually aligned on RDI write
> engine bus constraint such as 64-bit or 128-bit. But PIX engine
> is usually (at least on platform I looked at) based on pixel format.
> 
> On CAMSS_2290, PIX BPL alignment is set to 0 to indicate that the
> alignment must be derived from the pixel format. This allows the
> pipeline to use camss_format_get_bpl_alignment().
> 
> For other platforms, retain the legacy PIX default (16 bytes), until
> PIX is properly tested/enabled.
> 
> A future improvement would be to remove platform-specific conditionals
> from the VFE code and move the alignment requirements into the
> per-platform VFE resource data.
> 
> Signed-off-by: Loic Poulain <[email protected]>
> Reviewed-by: Bryan O'Donoghue <[email protected]>
> [bod: Fixed straggling newlines]
> Signed-off-by: Bryan O'Donoghue <[email protected]>

Patch committed.

Thanks,
Bryan O'Donoghue

 drivers/media/platform/qcom/camss/camss-vfe.c | 27 +++++++++++++++++++++++----
 1 file changed, 23 insertions(+), 4 deletions(-)

---

diff --git a/drivers/media/platform/qcom/camss/camss-vfe.c 
b/drivers/media/platform/qcom/camss/camss-vfe.c
index cc9a9685f6b5..319d19158988 100644
--- a/drivers/media/platform/qcom/camss/camss-vfe.c
+++ b/drivers/media/platform/qcom/camss/camss-vfe.c
@@ -1998,7 +1998,7 @@ static const struct media_entity_operations vfe_media_ops 
= {
        .link_validate = v4l2_subdev_link_validate,
 };
 
-static int vfe_bpl_align(struct vfe_device *vfe)
+static int vfe_bpl_align_rdi(struct vfe_device *vfe)
 {
        int ret = 8;
 
@@ -2023,6 +2023,24 @@ static int vfe_bpl_align(struct vfe_device *vfe)
        return ret;
 }
 
+static int vfe_bpl_align_pix(struct vfe_device *vfe)
+{
+       int ret = 16;
+
+       switch (vfe->camss->res->version) {
+       case CAMSS_2290:
+               /* The alignment/bpl depends solely on the pixel format and is
+                * computed dynamically in camss_format_get_bpl_alignment().
+                */
+               ret = 0;
+               break;
+       default:
+               break;
+       }
+
+       return ret;
+}
+
 /*
  * msm_vfe_register_entities - Register subdev node for VFE module
  * @vfe: VFE device
@@ -2089,11 +2107,12 @@ int msm_vfe_register_entities(struct vfe_device *vfe,
                }
 
                video_out->ops = &vfe->video_ops;
-               video_out->bpl_alignment = vfe_bpl_align(vfe);
-               video_out->line_based = 0;
                if (i == VFE_LINE_PIX) {
-                       video_out->bpl_alignment = 16;
+                       video_out->bpl_alignment = vfe_bpl_align_pix(vfe);
                        video_out->line_based = 1;
+               } else {
+                       video_out->bpl_alignment = vfe_bpl_align_rdi(vfe);
+                       video_out->line_based = 0;
                }
 
                video_out->nformats = vfe->line[i].nformats;
_______________________________________________
linuxtv-commits mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to