]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
media: qcom: camss: Use a macro to specify the initial buffer count
authorHangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Thu, 30 Oct 2025 23:24:56 +0000 (23:24 +0000)
committerHans Verkuil <hverkuil+cisco@kernel.org>
Thu, 6 Nov 2025 11:43:55 +0000 (12:43 +0100)
Replace the hardcoded buffer count value with a macro to enable
operating on these buffers elsewhere in the CAMSS driver based on this
count. Some of the hardware architectures require deferring the AUP and
REG update until after the CSID configuration and this macro is expected
to be useful in such scenarios.

Signed-off-by: Hangxiang Ma <hangxiang.ma@oss.qualcomm.com>
Reviewed-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Signed-off-by: Bryan O'Donoghue <bod@kernel.org>
Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org>
drivers/media/platform/qcom/camss/camss-vfe.c
drivers/media/platform/qcom/camss/camss.h

index dff8d0a1e8c228878d03d95aaf91f262b208f9e7..15a1524cd2df298aa9141b5debff820f3272c9dd 100644 (file)
@@ -541,7 +541,7 @@ int vfe_enable_output_v2(struct vfe_line *line)
 
        ops->vfe_wm_start(vfe, output->wm_idx[0], line);
 
-       for (i = 0; i < 2; i++) {
+       for (i = 0; i < CAMSS_INIT_BUF_COUNT; i++) {
                output->buf[i] = vfe_buf_get_pending(output);
                if (!output->buf[i])
                        break;
index a70fbc78ccc307c0abc2f3c834fb1e2dafd83c6b..901f84efaf7d2b713213b69eee653cc5af7f58d4 100644 (file)
@@ -41,6 +41,7 @@
        (to_camss_index(ptr_module, index)->dev)
 
 #define CAMSS_RES_MAX 17
+#define CAMSS_INIT_BUF_COUNT 2
 
 struct camss_subdev_resources {
        char *regulators[CAMSS_RES_MAX];