aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc/uvc_isight.c
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2011-10-24 10:49:19 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2011-12-11 08:12:05 -0500
commit3d95e932573c316ad56b8e2f283e26de0b9c891c (patch)
treead5fd2e33f2fe21c67d5b5bc367a8597591f7926 /drivers/media/video/uvc/uvc_isight.c
parent4be9c8fb58e48cd0110bd9504b0af1e18fa54467 (diff)
[media] uvcvideo: Move fields from uvc_buffer::buf to uvc_buffer
Add mem, length and bytesused fields to the uvc_buffer structure and use them instead of accessing the uvc_buffer::buf m.offset, length and bytesused fields directly. This prepares the driver to the conversion to videobuf2. Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc/uvc_isight.c')
-rw-r--r--drivers/media/video/uvc/uvc_isight.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/media/video/uvc/uvc_isight.c b/drivers/media/video/uvc/uvc_isight.c
index 74bbe8f18f3e..8510e7259e76 100644
--- a/drivers/media/video/uvc/uvc_isight.c
+++ b/drivers/media/video/uvc/uvc_isight.c
@@ -74,7 +74,7 @@ static int isight_decode(struct uvc_video_queue *queue, struct uvc_buffer *buf,
74 * Empty buffers (bytesused == 0) don't trigger end of frame detection 74 * Empty buffers (bytesused == 0) don't trigger end of frame detection
75 * as it doesn't make sense to return an empty buffer. 75 * as it doesn't make sense to return an empty buffer.
76 */ 76 */
77 if (is_header && buf->buf.bytesused != 0) { 77 if (is_header && buf->bytesused != 0) {
78 buf->state = UVC_BUF_STATE_DONE; 78 buf->state = UVC_BUF_STATE_DONE;
79 return -EAGAIN; 79 return -EAGAIN;
80 } 80 }
@@ -83,13 +83,13 @@ static int isight_decode(struct uvc_video_queue *queue, struct uvc_buffer *buf,
83 * contain no data. 83 * contain no data.
84 */ 84 */
85 if (!is_header) { 85 if (!is_header) {
86 maxlen = buf->buf.length - buf->buf.bytesused; 86 maxlen = buf->length - buf->bytesused;
87 mem = queue->mem + buf->buf.m.offset + buf->buf.bytesused; 87 mem = buf->mem + buf->bytesused;
88 nbytes = min(len, maxlen); 88 nbytes = min(len, maxlen);
89 memcpy(mem, data, nbytes); 89 memcpy(mem, data, nbytes);
90 buf->buf.bytesused += nbytes; 90 buf->bytesused += nbytes;
91 91
92 if (len > maxlen || buf->buf.bytesused == buf->buf.length) { 92 if (len > maxlen || buf->bytesused == buf->length) {
93 uvc_trace(UVC_TRACE_FRAME, "Frame complete " 93 uvc_trace(UVC_TRACE_FRAME, "Frame complete "
94 "(overflow).\n"); 94 "(overflow).\n");
95 buf->state = UVC_BUF_STATE_DONE; 95 buf->state = UVC_BUF_STATE_DONE;