Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 226323
b: refs/heads/master
c: 07e8030
h: refs/heads/master
i:
  226321: 2679f0e
  226319: d918d30
v: v3
  • Loading branch information
Marek Szyprowski authored and Mauro Carvalho Chehab committed Dec 29, 2010
1 parent 434f22d commit 5f56e72
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 13 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: dcd745b723efc875ec5a8f44be028bd0704b12d6
refs/heads/master: 07e80305babb27a332ce0f04a3c38ce495cbe711
21 changes: 9 additions & 12 deletions trunk/drivers/media/video/mem2mem_testdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,6 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f)
{
struct m2mtest_q_data *q_data;
struct videobuf_queue *vq;
int ret = 0;

vq = v4l2_m2m_get_vq(ctx->m2m_ctx, f->type);
if (!vq)
Expand All @@ -534,12 +533,9 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f)
if (!q_data)
return -EINVAL;

mutex_lock(&vq->vb_lock);

if (videobuf_queue_is_busy(vq)) {
v4l2_err(&ctx->dev->v4l2_dev, "%s queue busy\n", __func__);
ret = -EBUSY;
goto out;
return -EBUSY;
}

q_data->fmt = find_format(f);
Expand All @@ -553,9 +549,7 @@ static int vidioc_s_fmt(struct m2mtest_ctx *ctx, struct v4l2_format *f)
"Setting format for type %d, wxh: %dx%d, fmt: %d\n",
f->type, q_data->width, q_data->height, q_data->fmt->fourcc);

out:
mutex_unlock(&vq->vb_lock);
return ret;
return 0;
}

static int vidioc_s_fmt_vid_cap(struct file *file, void *priv,
Expand Down Expand Up @@ -845,10 +839,12 @@ static void queue_init(void *priv, struct videobuf_queue *vq,
enum v4l2_buf_type type)
{
struct m2mtest_ctx *ctx = priv;
struct m2mtest_dev *dev = ctx->dev;

videobuf_queue_vmalloc_init(vq, &m2mtest_qops, ctx->dev->v4l2_dev.dev,
&ctx->dev->irqlock, type, V4L2_FIELD_NONE,
sizeof(struct m2mtest_buffer), priv, NULL);
videobuf_queue_vmalloc_init(vq, &m2mtest_qops, dev->v4l2_dev.dev,
&dev->irqlock, type, V4L2_FIELD_NONE,
sizeof(struct m2mtest_buffer), priv,
&dev->dev_mutex);
}


Expand Down Expand Up @@ -920,7 +916,7 @@ static const struct v4l2_file_operations m2mtest_fops = {
.open = m2mtest_open,
.release = m2mtest_release,
.poll = m2mtest_poll,
.ioctl = video_ioctl2,
.unlocked_ioctl = video_ioctl2,
.mmap = m2mtest_mmap,
};

Expand Down Expand Up @@ -965,6 +961,7 @@ static int m2mtest_probe(struct platform_device *pdev)
}

*vfd = m2mtest_videodev;
vfd->lock = &dev->dev_mutex;

ret = video_register_device(vfd, VFL_TYPE_GRABBER, 0);
if (ret) {
Expand Down

0 comments on commit 5f56e72

Please sign in to comment.