Ejemplo n.º 1
0
static int fimc_qbuf(struct file *filp, void *fh, struct v4l2_buffer *b)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

#ifdef CONFIG_SLP_DMABUF
	if (V4L2_TYPE_IS_OUTPUT(b->type)) {
		ret = fimc_qbuf_output(fh, b);
	} else if (b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE
		|| b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE_MPLANE) {
		ret = fimc_qbuf_capture(ctrl, b);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}
#else
	if (b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
		ret = fimc_qbuf_capture(ctrl, b);
	} else if (b->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_qbuf_output(fh, b);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}
#endif

	return ret;
}
Ejemplo n.º 2
0
static int fimc_qbuf(struct file *filp, void *fh, struct v4l2_buffer *b)
{
	struct fimc_control *ctrl = ((struct fimc_prv_data *)fh)->ctrl;
	int ret = -1;

	if (b->type == V4L2_BUF_TYPE_VIDEO_CAPTURE) {
		ret = fimc_qbuf_capture(ctrl, b);
	} else if (b->type == V4L2_BUF_TYPE_VIDEO_OUTPUT) {
		ret = fimc_qbuf_output(fh, b);
	} else {
		fimc_err("V4L2_BUF_TYPE_VIDEO_CAPTURE and "
			"V4L2_BUF_TYPE_VIDEO_OUTPUT are only supported\n");
		ret = -EINVAL;
	}

	return ret;
}