aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/media/video/uvc
diff options
context:
space:
mode:
authorLaurent Pinchart <laurent.pinchart@ideasonboard.com>2009-08-06 10:41:17 -0400
committerMauro Carvalho Chehab <mchehab@redhat.com>2009-12-05 15:40:34 -0500
commit663a419203cc9690d16502be509ffb8acc40552a (patch)
tree33d99c3d006b67830891fcca37d3164f17b4bfbb /drivers/media/video/uvc
parentf4eabafeb3ea41801260fba624cbf2da971d19f8 (diff)
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: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
Diffstat (limited to 'drivers/media/video/uvc')
-rw-r--r--drivers/media/video/uvc/uvc_video.c18
-rw-r--r--drivers/media/video/uvc/uvcvideo.h1
2 files changed, 15 insertions, 4 deletions
diff --git a/drivers/media/video/uvc/uvc_video.c b/drivers/media/video/uvc/uvc_video.c
index a6e41d12b221..bb9fed669363 100644
--- a/drivers/media/video/uvc/uvc_video.c
+++ b/drivers/media/video/uvc/uvc_video.c
@@ -781,10 +781,15 @@ static int uvc_alloc_urb_buffers(struct uvc_streaming *stream,
781 781
782 if (i == UVC_URBS) { 782 if (i == UVC_URBS) {
783 stream->urb_size = psize * npackets; 783 stream->urb_size = psize * npackets;
784 uvc_trace(UVC_TRACE_VIDEO, "Allocated %u URB buffers "
785 "of %ux%u bytes each.\n", UVC_URBS, npackets,
786 psize);
784 return npackets; 787 return npackets;
785 } 788 }
786 } 789 }
787 790
791 uvc_trace(UVC_TRACE_VIDEO, "Failed to allocate URB buffers (%u bytes "
792 "per packet).\n", psize);
788 return 0; 793 return 0;
789} 794}
790 795
@@ -935,10 +940,12 @@ static int uvc_init_video(struct uvc_streaming *stream, gfp_t gfp_flags)
935 bandwidth = stream->ctrl.dwMaxPayloadTransferSize; 940 bandwidth = stream->ctrl.dwMaxPayloadTransferSize;
936 941
937 if (bandwidth == 0) { 942 if (bandwidth == 0) {
938 uvc_printk(KERN_WARNING, "device %s requested null " 943 uvc_trace(UVC_TRACE_VIDEO, "Device requested null "
939 "bandwidth, defaulting to lowest.\n", 944 "bandwidth, defaulting to lowest.\n");
940 stream->dev->name);
941 bandwidth = 1; 945 bandwidth = 1;
946 } else {
947 uvc_trace(UVC_TRACE_VIDEO, "Device requested %u "
948 "B/frame bandwidth.\n", bandwidth);
942 } 949 }
943 950
944 for (i = 0; i < intf->num_altsetting; ++i) { 951 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 break; 962 break;
956 } 963 }
957 964
958 if (i >= intf->num_altsetting) 965 if (i >= intf->num_altsetting) {
966 uvc_trace(UVC_TRACE_VIDEO, "No fast enough alt setting "
967 "for requested bandwidth.\n");
959 return -EIO; 968 return -EIO;
969 }
960 970
961 ret = usb_set_interface(stream->dev->udev, intfnum, i); 971 ret = usb_set_interface(stream->dev->udev, intfnum, i);
962 if (ret < 0) 972 if (ret < 0)
diff --git a/drivers/media/video/uvc/uvcvideo.h b/drivers/media/video/uvc/uvcvideo.h
index e7958aa454ce..f5c40c0f0b49 100644
--- a/drivers/media/video/uvc/uvcvideo.h
+++ b/drivers/media/video/uvc/uvcvideo.h
@@ -533,6 +533,7 @@ struct uvc_driver {
533#define UVC_TRACE_FRAME (1 << 7) 533#define UVC_TRACE_FRAME (1 << 7)
534#define UVC_TRACE_SUSPEND (1 << 8) 534#define UVC_TRACE_SUSPEND (1 << 8)
535#define UVC_TRACE_STATUS (1 << 9) 535#define UVC_TRACE_STATUS (1 << 9)
536#define UVC_TRACE_VIDEO (1 << 10)
536 537
537#define UVC_WARN_MINMAX 0 538#define UVC_WARN_MINMAX 0
538#define UVC_WARN_PROBE_DEF 1 539#define UVC_WARN_PROBE_DEF 1