Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging: media: starfive: Add the dynamic resolution support

Add the dynamic resolution support for video "capture_raw" device.
Otherwise it will capture the wrong image data if the width is
not 1920.

Fixes: e080f339c80a ("media: staging: media: starfive: camss: Add capture driver")
Signed-off-by: Changhuang Liang <changhuang.liang@starfivetech.com>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/r/20240820112002.560432-1-changhuang.liang@starfivetech.com
Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>

authored by

Changhuang Liang and committed by
Laurent Pinchart
b5dec48c 6c573f25

+3 -1
+3 -1
drivers/staging/media/starfive/camss/stf-capture.c
··· 180 180 u32 val; 181 181 182 182 if (cap->type == STF_CAPTURE_RAW) { 183 + const struct v4l2_pix_format *pix = &video->active_fmt.fmt.pix; 184 + 183 185 val = stf_syscon_reg_read(stfcamss, VIN_CHANNEL_SEL_EN); 184 186 val &= ~U0_VIN_CHANNEL_SEL_MASK; 185 187 val |= CHANNEL(0); ··· 195 193 val |= PIXEL_HEIGH_BIT_SEL(0); 196 194 197 195 val &= ~U0_VIN_PIX_CNT_END_MASK; 198 - val |= PIX_CNT_END(IMAGE_MAX_WIDTH / 4 - 1); 196 + val |= PIX_CNT_END(pix->width / 4 - 1); 199 197 200 198 stf_syscon_reg_write(stfcamss, VIN_INRT_PIX_CFG, val); 201 199 } else if (cap->type == STF_CAPTURE_YUV) {