mt9m111: Fix YUYV format for pxa-camera
RFC PATCH 1/1 mt9m111: Fix YUYV format for pxa-camera
Hi,
I'd like to discuss this change to mt9m111, but I am not sure if the first hunk of the following patch is a proper fix for the problem I had:
when using YUYV the output buffer has to be WIDTH*HEIGHT*2, and not WIDTH*HEIGHT as it is now using 8bit YUYV format. Maybe the proper fix belongs to pxa-camera.c?
Anyway, with the following changes I have the right output from mt9m111 interfaced to pxa-camera on a Motorola A910 phone:
http://people.openezx.org/ao2/a910-camera-working.jpg
http://wiki.openezx.org/A910
Regards,
Antonio Ospite.
Here's the patch:
Use 16 bit depth for YUYV so the pxa-camera image buffer has the correct size, see the formula:
*size = icd->width * icd->height * ((icd->current_fmt->depth + 7) >> 3);
in drivers/media/video/pxa_camera.c: pxa_videobuf_setup().
Don't swap Cb and Cr components, to respect PXA Quick Capture Interface data format.
--- drivers/media/video/mt9m111.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
drivers/media/video/mt9m111.c +4 -1
@@ -130,7 +130,7 @@ COL_FMT(_name, _depth, _fourcc, V4L2_COLORSPACE_SRGB)static const struct soc_camera_data_format mt9m111_colour_formats[] = { -COL_FMT ("YCrYCb 8 bit" ,8 ,V4L2_PIX_FMT_YUYV ,V4L2_COLORSPACE_JPEG ), +COL_FMT ("YCrYCb 16 bit" ,16 ,V4L2_PIX_FMT_YUYV ,V4L2_COLORSPACE_JPEG ),RGB_FMT ("RGB 565" ,16 ,V4L2_PIX_FMT_RGB565 ),RGB_FMT ("RGB 555" ,16 ,V4L2_PIX_FMT_RGB555 ),RGB_FMT ("Bayer (sRGB) 10 bit" ,10 ,V4L2_PIX_FMT_SBGGR16 ),
@@ -864,6 +864,9 @@ static int mt9m111_video_probe(struct soc_camera_device *icd) mt9m111->swap_rgb_even_odd =1 ; mt9m111->swap_rgb_red_blue =1 ; + mt9m111->swap_yuv_y_chromas =1 ; + mt9m111->swap_yuv_cb_cr =0 ; +return 0 ; eisis: ei2c:
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list
Quoted 7 lines · Antonio Ospite
Hi,
I'd like to discuss this change to mt9m111, but I am not sure if the first hunk of the following patch is a proper fix for the problem I had:
when using YUYV the output buffer has to be WIDTH*HEIGHT*2, and not WIDTH*HEIGHT as it is now using 8bit YUYV format. Maybe the proper fix belongs topxa-camera.c?
No, your patch is the correct way of doing it. Please resubmit the same patch with your signoff, and Guennadi CCed which will give me time to make 1 test for security, and I'll add my Acked-by.
You can safely remove the "RFC" part, it is indeed a fix.
Cheers.
--
Robert
--
video4linux-list mailing list
Unsubscribe mailto:[email protected]?subject=unsubscribe
https://www.redhat.com/mailman/listinfo/video4linux-list