media: rockchip: vicap fixes size error of rgb888

Change-Id: I695e906bb07e62fb79348d15fe522cd06f506cad
Signed-off-by: Zefa Chen <zefa.chen@rock-chips.com>
This commit is contained in:
Zefa Chen
2025-07-10 18:09:35 +08:00
committed by Tao Huang
parent b68d0098b2
commit a32d290ab8

View File

@@ -4058,7 +4058,7 @@ static int rkcif_csi_channel_init(struct rkcif_stream *stream,
channel->fmt_val == CSI_WRDDR_TYPE_RGB565)
channel->width = channel->width * fmt->bpp[0] / 8;
if (channel->fmt_val == CSI_WRDDR_TYPE_RGB888)
if (channel->fmt_val == CSI_WRDDR_TYPE_RGB888 && dev->chip_id < CHIP_RK3576_CIF)
channel->width /= 2;
/*
* rk cif don't support output yuyv fmt data
@@ -11218,7 +11218,7 @@ static void rkcif_dynamic_crop(struct rkcif_stream *stream)
mbus->type == V4L2_MBUS_CCP2) {
struct csi_channel_info *channel = &cif_dev->channels[stream->id];
if (channel->fmt_val == CSI_WRDDR_TYPE_RGB888)
if (channel->fmt_val == CSI_WRDDR_TYPE_RGB888 && cif_dev->chip_id < CHIP_RK3576_CIF)
crop_x = 3 * stream->crop[CROP_SRC_ACT].left / 2;
else if (channel->fmt_val == CSI_WRDDR_TYPE_RGB565)
crop_x = 2 * stream->crop[CROP_SRC_ACT].left;