[PATCH 20/20] media: soc_camera: Add debugging for get_formats

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



From: Rob Taylor <rob.taylor@xxxxxxxxxxxxxxx>

Some helpful debugging for get_formats use, useful for debugging
v4l2-compliance issues.

Signed-off-by: Rob Taylor <rob.taylor@xxxxxxxxxxxxxxx>
Reviewed-by: William Towle <william.towle@xxxxxxxxxxxxxxx>
---
 drivers/media/platform/soc_camera/soc_camera.c |    7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/drivers/media/platform/soc_camera/soc_camera.c b/drivers/media/platform/soc_camera/soc_camera.c
index 583c5e6..503e9b6 100644
--- a/drivers/media/platform/soc_camera/soc_camera.c
+++ b/drivers/media/platform/soc_camera/soc_camera.c
@@ -522,7 +522,7 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd)
 
 	/* Second pass - actually fill data formats */
 	fmts = 0;
-	for (i = 0; i < raw_fmts; i++)
+	for (i = 0; i < raw_fmts; i++) {
 		if (!ici->ops->get_formats) {
 			code.index = i;
 			v4l2_subdev_call(sd, pad, enum_mbus_code, NULL, &code);
@@ -537,6 +537,8 @@ static int soc_camera_init_user_formats(struct soc_camera_device *icd)
 				goto egfmt;
 			fmts += ret;
 		}
+		dev_dbg(icd->pdev, " Format: %x %c%c%c%c", icd->user_formats[fmts-1].code, pixfmtstr(icd->user_formats[fmts-1].host_fmt->fourcc));
+	}
 
 	icd->num_user_formats = fmts;
 	icd->current_fmt = &icd->user_formats[0];
@@ -732,6 +734,8 @@ static int soc_camera_open(struct file *file)
 		 * apart from someone else calling open() simultaneously, but
 		 * .host_lock is protecting us against it.
 		 */
+
+		dev_dbg(icd->pdev, "%s:%d calling set_fmt with size %d x %d",__func__, __LINE__, f.fmt.pix.width, f.fmt.pix.height);
 		ret = soc_camera_set_fmt(icd, &f);
 		if (ret < 0)
 			goto esfmt;
@@ -2234,6 +2238,7 @@ static int soc_camera_pdrv_probe(struct platform_device *pdev)
 	icd->user_width		= DEFAULT_WIDTH;
 	icd->user_height	= DEFAULT_HEIGHT;
 
+	dev_dbg(icd->pdev, "%s:%d setting default user size to %d x %d",__func__, __LINE__, icd->user_width, icd->user_height);
 	return soc_camera_device_register(icd);
 }
 
-- 
1.7.10.4

--
To unsubscribe from this list: send the line "unsubscribe linux-media" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux