Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164220
b: refs/heads/master
c: e330919
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 9949812 commit 80ad15e
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 10 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: bf62e1da6ac848b0c3f72665d05939263e9f4128
refs/heads/master: e330919a215714796efb451984a753a46b570eb7
18 changes: 9 additions & 9 deletions trunk/drivers/media/video/mt9t031.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,15 +240,6 @@ static int mt9t031_set_params(struct soc_camera_device *icd,
const u16 hblank = MT9T031_HORIZONTAL_BLANK,
vblank = MT9T031_VERTICAL_BLANK;

/* Make sure we don't exceed sensor limits */
if (rect->left + rect->width > icd->rect_max.width)
rect->left = (icd->rect_max.width - rect->width) / 2 +
icd->rect_max.left;

if (rect->top + rect->height > icd->rect_max.height)
rect->top = (icd->rect_max.height - rect->height) / 2 +
icd->rect_max.top;

width = rect->width * xskip;
height = rect->height * yskip;
left = rect->left * xskip;
Expand Down Expand Up @@ -336,6 +327,15 @@ static int mt9t031_set_crop(struct soc_camera_device *icd,
struct i2c_client *client = to_i2c_client(to_soc_camera_control(icd));
struct mt9t031 *mt9t031 = to_mt9t031(client);

/* Make sure we don't exceed sensor limits */
if (rect->left + rect->width > icd->rect_max.left + icd->rect_max.width)
rect->left = icd->rect_max.width + icd->rect_max.left -
rect->width;

if (rect->top + rect->height > icd->rect_max.height + icd->rect_max.top)
rect->top = icd->rect_max.height + icd->rect_max.top -
rect->height;

/* CROP - no change in scaling, or in limits */
return mt9t031_set_params(icd, rect, mt9t031->xskip, mt9t031->yskip);
}
Expand Down

0 comments on commit 80ad15e

Please sign in to comment.