media: rockchip: isp: enum the max frame size to isp input size

Change-Id: I316ac980c54f7720b37c96d3698c259fb8ce7eca
Signed-off-by: Cai YiWei <cyw@rock-chips.com>
This commit is contained in:
Cai YiWei
2022-08-26 17:24:07 +08:00
committed by Tao Huang
parent 47a518251f
commit dba70e6c6c
2 changed files with 5 additions and 4 deletions

View File

@@ -885,6 +885,7 @@ static int rkisp_enum_framesizes(struct file *file, void *prov,
struct v4l2_frmsize_discrete *d = &fsize->discrete;
struct rkisp_device *dev = stream->ispdev;
struct v4l2_rect max_rsz;
struct v4l2_rect *input_win = rkisp_get_isp_sd_win(&dev->isp_sdev);
if (fsize->index != 0)
return -EINVAL;
@@ -908,8 +909,8 @@ static int rkisp_enum_framesizes(struct file *file, void *prov,
fsize->type = V4L2_FRMSIZE_TYPE_STEPWISE;
s->min_width = STREAM_MIN_RSZ_OUTPUT_WIDTH;
s->min_height = STREAM_MIN_RSZ_OUTPUT_HEIGHT;
s->max_width = max_rsz.width;
s->max_height = max_rsz.height;
s->max_width = min_t(u32, max_rsz.width, input_win->width);
s->max_height = input_win->height;
s->step_width = STREAM_OUTPUT_STEP_WISE;
s->step_height = STREAM_OUTPUT_STEP_WISE;
}

View File

@@ -295,8 +295,8 @@ int rkisp_align_sensor_resolution(struct rkisp_device *dev,
if ((code & RKISP_MEDIA_BUS_FMT_MASK) != RKISP_MEDIA_BUS_FMT_BAYER) {
crop->left = 0;
crop->top = 0;
crop->width = min_t(u32, src_w, max_w);
crop->height = min_t(u32, src_h, max_h);
crop->width = min_t(u32, src_w, CIF_ISP_INPUT_W_MAX);
crop->height = min_t(u32, src_h, CIF_ISP_INPUT_H_MAX);
return 0;
}