Commit 60821606 authored by Enrico Scholz's avatar Enrico Scholz

fixup! onsemi-core: implemented ENUM_FRAMESIZES

Return frame size based on crop parameters
Signed-off-by: Enrico Scholz's avatarEnrico Scholz <enrico.scholz@sigma-chemnitz.de>
parent fe80a6cb
......@@ -1934,8 +1934,8 @@ static int onsemi_enum_frame_size(struct v4l2_subdev *sd,
struct onsemi_core *onsemi = sd_to_onsemi(sd);
struct onsemi_v4l_parm *parm = onsemi->v4l_parm;
struct onsemi_businfo const *info;
unsigned int max_w;
unsigned int max_h;
unsigned int w;
unsigned int h;
if (fse->index > 0)
return -EINVAL;
......@@ -1944,17 +1944,16 @@ static int onsemi_enum_frame_size(struct v4l2_subdev *sd,
if (!info)
return -EINVAL;
/* TODO: check fse->code? */
w = parm->crop.width;
w /= parm->x_scale;
max_w = onsemi->limits->x.max - onsemi->limits->x.min + 1;
max_h = onsemi->limits->y.max - onsemi->limits->y.min + 1;
max_w /= parm->x_scale;
max_h /= parm->y_scale;
h = parm->crop.height;
h /= parm->y_scale;
fse->min_width = 2; /* TODO: calculate this value somehow */
fse->max_width = max_w;
fse->min_height = 2; /* TODO: calculate this value somehow */
fse->max_height = max_h;
fse->min_width = w;
fse->max_width = w;
fse->min_height = h;
fse->max_height = h;
return 0;
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment