Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 330869
b: refs/heads/master
c: 9f717e9
h: refs/heads/master
i:
  330867: fa7787f
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Aug 15, 2012
1 parent 2e35e19 commit e55fb2f
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 30 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 69c80dc90146463bf9a6820e5c0432fad8e0d0c1
refs/heads/master: 9f717e9022d60fb653bad47a320bf0499c6fb549
36 changes: 7 additions & 29 deletions trunk/drivers/media/i2c/soc_camera/ov772x.c
Original file line number Diff line number Diff line change
Expand Up @@ -919,38 +919,16 @@ static int ov772x_s_fmt(struct v4l2_subdev *sd, struct v4l2_mbus_framefmt *mf)
static int ov772x_try_fmt(struct v4l2_subdev *sd,
struct v4l2_mbus_framefmt *mf)
{
struct ov772x_priv *priv = container_of(sd, struct ov772x_priv, subdev);
const struct ov772x_color_format *cfmt;
const struct ov772x_win_size *win;
int i;

/*
* select suitable win
*/
win = ov772x_select_win(mf->width, mf->height);

mf->width = win->width;
mf->height = win->height;
mf->field = V4L2_FIELD_NONE;

for (i = 0; i < ARRAY_SIZE(ov772x_cfmts); i++)
if (mf->code == ov772x_cfmts[i].code)
break;
ov772x_select_params(mf, &cfmt, &win);

if (i == ARRAY_SIZE(ov772x_cfmts)) {
/* Unsupported format requested. Propose either */
if (priv->cfmt) {
/* the current one or */
mf->colorspace = priv->cfmt->colorspace;
mf->code = priv->cfmt->code;
} else {
/* the default one */
mf->colorspace = ov772x_cfmts[0].colorspace;
mf->code = ov772x_cfmts[0].code;
}
} else {
/* Also return the colorspace */
mf->colorspace = ov772x_cfmts[i].colorspace;
}
mf->code = cfmt->code;
mf->width = win->width;
mf->height = win->height;
mf->field = V4L2_FIELD_NONE;
mf->colorspace = cfmt->colorspace;

return 0;
}
Expand Down

0 comments on commit e55fb2f

Please sign in to comment.