Commit 663a4192 authored by Laurent Pinchart's avatar Laurent Pinchart Committed by Mauro Carvalho Chehab

V4L/DVB (13149): uvcvideo: Add a new UVC_TRACE_VIDEO trace level

Use the trace level for messages related to video URB buffers allocation and
alternate setting selection.
Signed-off-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab@redhat.com>
parent f4eabafe
...@@ -781,10 +781,15 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream, ...@@ -781,10 +781,15 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
if (i == UVC_URBS) { if (i == UVC_URBS) {
stream->urb_size = psize * npackets; 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; return npackets;
} }
} }
uvc_trace(UVC_TRACE_VIDEO, "Failed to allocate URB buffers (%u bytes "
"per packet).\n", psize);
return 0; return 0;
} }
...@@ -935,10 +940,12 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) ...@@ -935,10 +940,12 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
bandwidth = stream->ctrl.dwMaxPayloadTransferSize; bandwidth = stream->ctrl.dwMaxPayloadTransferSize;
if (bandwidth == 0) { if (bandwidth == 0) {
uvc_printk(KERN_WARNING, "device %s requested null " uvc_trace(UVC_TRACE_VIDEO, "Device requested null "
"bandwidth, defaulting to lowest.\n", "bandwidth, defaulting to lowest.\n");
stream->dev->name);
bandwidth = 1; bandwidth = 1;
} else {
uvc_trace(UVC_TRACE_VIDEO, "Device requested %u "
"B/frame bandwidth.\n", bandwidth);
} }
for (i = 0; i < intf->num_altsetting; ++i) { for (i = 0; i < intf->num_altsetting; ++i) {
...@@ -955,8 +962,11 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags) ...@@ -955,8 +962,11 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
break; 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; return -EIO;
}
ret = usb_set_interface(stream->dev->udev, intfnum, i); ret = usb_set_interface(stream->dev->udev, intfnum, i);
if (ret < 0) if (ret < 0)
......
...@@ -533,6 +533,7 @@ struct uvc_driver { ...@@ -533,6 +533,7 @@ struct uvc_driver {
#define UVC_TRACE_FRAME (1 << 7) #define UVC_TRACE_FRAME (1 << 7)
#define UVC_TRACE_SUSPEND (1 << 8) #define UVC_TRACE_SUSPEND (1 << 8)
#define UVC_TRACE_STATUS (1 << 9) #define UVC_TRACE_STATUS (1 << 9)
#define UVC_TRACE_VIDEO (1 << 10)
#define UVC_WARN_MINMAX 0 #define UVC_WARN_MINMAX 0
#define UVC_WARN_PROBE_DEF 1 #define UVC_WARN_PROBE_DEF 1
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment