Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 173950
b: refs/heads/master
c: 663a419
h: refs/heads/master
v: v3
  • Loading branch information
Laurent Pinchart authored and Mauro Carvalho Chehab committed Dec 5, 2009
1 parent a500d44 commit 83130f8
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 5 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: f4eabafeb3ea41801260fba624cbf2da971d19f8
refs/heads/master: 663a419203cc9690d16502be509ffb8acc40552a
18 changes: 14 additions & 4 deletions trunk/drivers/media/video/uvc/uvc_video.c
Original file line number Diff line number Diff line change
Expand Up @@ -781,10 +781,15 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,

if (i == UVC_URBS) {
stream->urb_size = psize * npackets;
uvc_trace(UVC_TRACE_VIDEO, "Allocated %u URB buffers "
"of %ux%u bytes each.\n", UVC_URBS, npackets,
psize);
return npackets;
}
}

uvc_trace(UVC_TRACE_VIDEO, "Failed to allocate URB buffers (%u bytes "
"per packet).\n", psize);
return 0;
}

Expand Down Expand Up @@ -935,10 +940,12 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
bandwidth = stream->ctrl.dwMaxPayloadTransferSize;

if (bandwidth == 0) {
uvc_printk(KERN_WARNING, "device %s requested null "
"bandwidth, defaulting to lowest.\n",
stream->dev->name);
uvc_trace(UVC_TRACE_VIDEO, "Device requested null "
"bandwidth, defaulting to lowest.\n");
bandwidth = 1;
} else {
uvc_trace(UVC_TRACE_VIDEO, "Device requested %u "
"B/frame bandwidth.\n", bandwidth);
}

for (i = 0; i < intf->num_altsetting; ++i) {
Expand All @@ -955,8 +962,11 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
break;
}

if (i >= intf->num_altsetting)
if (i >= intf->num_altsetting) {
uvc_trace(UVC_TRACE_VIDEO, "No fast enough alt setting "
"for requested bandwidth.\n");
return -EIO;
}

ret = usb_set_interface(stream->dev->udev, intfnum, i);
if (ret < 0)
Expand Down
1 change: 1 addition & 0 deletions trunk/drivers/media/video/uvc/uvcvideo.h
Original file line number Diff line number Diff line change
Expand Up @@ -533,6 +533,7 @@ struct uvc_driver {
#define UVC_TRACE_FRAME (1 << 7)
#define UVC_TRACE_SUSPEND (1 << 8)
#define UVC_TRACE_STATUS (1 << 9)
#define UVC_TRACE_VIDEO (1 << 10)

#define UVC_WARN_MINMAX 0
#define UVC_WARN_PROBE_DEF 1
Expand Down

0 comments on commit 83130f8

Please sign in to comment.