diff options
Diffstat (limited to 'drivers/media/video/v4l2-ioctl.c')
-rw-r--r-- | drivers/media/video/v4l2-ioctl.c | 36 |
1 files changed, 36 insertions, 0 deletions
diff --git a/drivers/media/video/v4l2-ioctl.c b/drivers/media/video/v4l2-ioctl.c index 24fd4332215..e1da8fc9dd2 100644 --- a/drivers/media/video/v4l2-ioctl.c +++ b/drivers/media/video/v4l2-ioctl.c | |||
@@ -273,6 +273,8 @@ static const char *v4l2_ioctls[] = { | |||
273 | [_IOC_NR(VIDIOC_DQEVENT)] = "VIDIOC_DQEVENT", | 273 | [_IOC_NR(VIDIOC_DQEVENT)] = "VIDIOC_DQEVENT", |
274 | [_IOC_NR(VIDIOC_SUBSCRIBE_EVENT)] = "VIDIOC_SUBSCRIBE_EVENT", | 274 | [_IOC_NR(VIDIOC_SUBSCRIBE_EVENT)] = "VIDIOC_SUBSCRIBE_EVENT", |
275 | [_IOC_NR(VIDIOC_UNSUBSCRIBE_EVENT)] = "VIDIOC_UNSUBSCRIBE_EVENT", | 275 | [_IOC_NR(VIDIOC_UNSUBSCRIBE_EVENT)] = "VIDIOC_UNSUBSCRIBE_EVENT", |
276 | [_IOC_NR(VIDIOC_CREATE_BUFS)] = "VIDIOC_CREATE_BUFS", | ||
277 | [_IOC_NR(VIDIOC_PREPARE_BUF)] = "VIDIOC_PREPARE_BUF", | ||
276 | }; | 278 | }; |
277 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) | 279 | #define V4L2_IOCTLS ARRAY_SIZE(v4l2_ioctls) |
278 | 280 | ||
@@ -2104,6 +2106,40 @@ static long __video_do_ioctl(struct file *file, | |||
2104 | dbgarg(cmd, "type=0x%8.8x", sub->type); | 2106 | dbgarg(cmd, "type=0x%8.8x", sub->type); |
2105 | break; | 2107 | break; |
2106 | } | 2108 | } |
2109 | case VIDIOC_CREATE_BUFS: | ||
2110 | { | ||
2111 | struct v4l2_create_buffers *create = arg; | ||
2112 | |||
2113 | if (!ops->vidioc_create_bufs) | ||
2114 | break; | ||
2115 | if (ret_prio) { | ||
2116 | ret = ret_prio; | ||
2117 | break; | ||
2118 | } | ||
2119 | ret = check_fmt(ops, create->format.type); | ||
2120 | if (ret) | ||
2121 | break; | ||
2122 | |||
2123 | ret = ops->vidioc_create_bufs(file, fh, create); | ||
2124 | |||
2125 | dbgarg(cmd, "count=%d @ %d\n", create->count, create->index); | ||
2126 | break; | ||
2127 | } | ||
2128 | case VIDIOC_PREPARE_BUF: | ||
2129 | { | ||
2130 | struct v4l2_buffer *b = arg; | ||
2131 | |||
2132 | if (!ops->vidioc_prepare_buf) | ||
2133 | break; | ||
2134 | ret = check_fmt(ops, b->type); | ||
2135 | if (ret) | ||
2136 | break; | ||
2137 | |||
2138 | ret = ops->vidioc_prepare_buf(file, fh, b); | ||
2139 | |||
2140 | dbgarg(cmd, "index=%d", b->index); | ||
2141 | break; | ||
2142 | } | ||
2107 | default: | 2143 | default: |
2108 | if (!ops->vidioc_default) | 2144 | if (!ops->vidioc_default) |
2109 | break; | 2145 | break; |