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, ...@@ -1934,8 +1934,8 @@ static int onsemi_enum_frame_size(struct v4l2_subdev *sd,
struct onsemi_core *onsemi = sd_to_onsemi(sd); struct onsemi_core *onsemi = sd_to_onsemi(sd);
struct onsemi_v4l_parm *parm = onsemi->v4l_parm; struct onsemi_v4l_parm *parm = onsemi->v4l_parm;
struct onsemi_businfo const *info; struct onsemi_businfo const *info;
unsigned int max_w; unsigned int w;
unsigned int max_h; unsigned int h;
if (fse->index > 0) if (fse->index > 0)
return -EINVAL; return -EINVAL;
...@@ -1944,17 +1944,16 @@ static int onsemi_enum_frame_size(struct v4l2_subdev *sd, ...@@ -1944,17 +1944,16 @@ static int onsemi_enum_frame_size(struct v4l2_subdev *sd,
if (!info) if (!info)
return -EINVAL; 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; h = parm->crop.height;
max_h = onsemi->limits->y.max - onsemi->limits->y.min + 1; h /= parm->y_scale;
max_w /= parm->x_scale;
max_h /= parm->y_scale;
fse->min_width = 2; /* TODO: calculate this value somehow */ fse->min_width = w;
fse->max_width = max_w; fse->max_width = w;
fse->min_height = 2; /* TODO: calculate this value somehow */ fse->min_height = h;
fse->max_height = max_h; fse->max_height = h;
return 0; 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