Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 164228
b: refs/heads/master
c: b897a91
h: refs/heads/master
v: v3
  • Loading branch information
Guennadi Liakhovetski authored and Mauro Carvalho Chehab committed Sep 19, 2009
1 parent 39a6d36 commit a9d5b88
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 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: 68a54f0e53b62806040fb7884b2e0d79b922bf00
refs/heads/master: b897a91afbed57558324ef4059efa2e2419e8b66
14 changes: 12 additions & 2 deletions trunk/drivers/media/video/soc_camera.c
Original file line number Diff line number Diff line change
Expand Up @@ -517,8 +517,8 @@ static int soc_camera_s_fmt_vid_cap(struct file *file, void *priv,

mutex_lock(&icf->vb_vidq.vb_lock);

if (videobuf_queue_is_busy(&icf->vb_vidq)) {
dev_err(&icd->dev, "S_FMT denied: queue busy\n");
if (icf->vb_vidq.bufs[0]) {
dev_err(&icd->dev, "S_FMT denied: queue initialised\n");
ret = -EBUSY;
goto unlock;
}
Expand Down Expand Up @@ -768,6 +768,15 @@ static int soc_camera_s_crop(struct file *file, void *fh,
/* Cropping is allowed during a running capture, guard consistency */
mutex_lock(&icf->vb_vidq.vb_lock);

/* Prohibit window size change with initialised buffers */
if (icf->vb_vidq.bufs[0] && (rect.width != icd->rect_current.width ||
rect.height != icd->rect_current.height)) {
dev_err(&icd->dev,
"S_CROP denied: queue initialised and sizes differ\n");
ret = -EBUSY;
goto unlock;
}

if (rect.width > icd->rect_max.width)
rect.width = icd->rect_max.width;

Expand All @@ -792,6 +801,7 @@ static int soc_camera_s_crop(struct file *file, void *fh,
if (!ret)
icd->rect_current = rect;

unlock:
mutex_unlock(&icf->vb_vidq.vb_lock);

return ret;
Expand Down

0 comments on commit a9d5b88

Please sign in to comment.