From 17028cdb74bf8bb593aebe5550bc90325fa9af88 Mon Sep 17 00:00:00 2001 From: Hans Verkuil Date: Mon, 1 Dec 2014 10:10:44 -0300 Subject: [media] v4l2 core: improve debug flag handling The old debug field is renamed to dev_debug to ensure that existing drivers (including out-of-tree drivers) that try to use the old name will no longer compile. A comment has also been added that makes it explicit that drivers shouldn't use this field. Additional bits have been added to the debug flag to be more fine-grained when debugging, especially when dealing with streaming ioctls and read, write and poll. You want to enable those explicitly to prevent flooding the log when streaming unless you actually want to do that. Signed-off-by: Hans Verkuil Acked-by: Sakari Ailus Signed-off-by: Mauro Carvalho Chehab --- include/media/v4l2-dev.h | 3 ++- include/media/v4l2-ioctl.h | 15 ++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) (limited to 'include/media') diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index eb76cfd47189..3e4fddfc840c 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -124,7 +124,8 @@ struct video_device spinlock_t fh_lock; /* Lock for all v4l2_fhs */ struct list_head fh_list; /* List of struct v4l2_fh */ - int debug; /* Activates debug level*/ + /* Internal device debug flags, not for use by drivers */ + int dev_debug; /* Video standard vars */ v4l2_std_id tvnorms; /* Supported tv norms */ diff --git a/include/media/v4l2-ioctl.h b/include/media/v4l2-ioctl.h index 53605f0f9903..8537983b9b22 100644 --- a/include/media/v4l2-ioctl.h +++ b/include/media/v4l2-ioctl.h @@ -291,9 +291,18 @@ struct v4l2_ioctl_ops { /* v4l debugging and diagnostics */ -/* Debug bitmask flags to be used on V4L2 */ -#define V4L2_DEBUG_IOCTL 0x01 -#define V4L2_DEBUG_IOCTL_ARG 0x02 +/* Device debug flags to be used with the video device debug attribute */ + +/* Just log the ioctl name + error code */ +#define V4L2_DEV_DEBUG_IOCTL 0x01 +/* Log the ioctl name arguments + error code */ +#define V4L2_DEV_DEBUG_IOCTL_ARG 0x02 +/* Log the file operations open, release, mmap and get_unmapped_area */ +#define V4L2_DEV_DEBUG_FOP 0x04 +/* Log the read and write file operations and the VIDIOC_(D)QBUF ioctls */ +#define V4L2_DEV_DEBUG_STREAMING 0x08 +/* Log poll() */ +#define V4L2_DEV_DEBUG_POLL 0x10 /* Video standard functions */ extern const char *v4l2_norm_to_name(v4l2_std_id id); -- cgit v1.2.3