aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2010-04-21 16:17:31 +0800
committerLily Zhang <r58066@freescale.com>2010-04-22 15:24:28 +0800
commit8d0b5ebf7219d2e7c57a908bc57ab258b0cda7e1 (patch)
treeb880ee33248a4414b258b9855757edbd2bcd3f74
parentcf848bba851157fb7c28ad2abd21f8210a4b0831 (diff)
ENGR00122694 v4l2 output: set correct bits_per_pixel for fbi
Uncorrect bits_per_pixel will make wrong fb memaloc size, which will cause Oops for filling black color operation. Signed-off-by: Jason Chen <b02280@freescale.com> (cherry picked from commit 1ac0858a4c6a384f039dfc3f8131d86040c14a58)
-rw-r--r--drivers/media/video/mxc/output/mxc_v4l2_output.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/drivers/media/video/mxc/output/mxc_v4l2_output.c b/drivers/media/video/mxc/output/mxc_v4l2_output.c
index 4c794ab4b3c..a8beb77bbd4 100644
--- a/drivers/media/video/mxc/output/mxc_v4l2_output.c
+++ b/drivers/media/video/mxc/output/mxc_v4l2_output.c
@@ -1341,8 +1341,19 @@ static int mxc_v4l2out_streamon(vout_data * vout)
if (vout->ic_bypass) {
pr_debug("Bypassing IC\n");
vout->work_irq = -1;
- fbvar.bits_per_pixel = 8*
- bytes_per_pixel(vout->v2f.fmt.pix.pixelformat);
+ switch (vout->v2f.fmt.pix.pixelformat) {
+ case V4L2_PIX_FMT_YUV420:
+ case V4L2_PIX_FMT_YVU420:
+ case V4L2_PIX_FMT_NV12:
+ fbvar.bits_per_pixel = 12;
+ break;
+ case V4L2_PIX_FMT_YUV422P:
+ fbvar.bits_per_pixel = 16;
+ break;
+ default:
+ fbvar.bits_per_pixel = 8*
+ bytes_per_pixel(vout->v2f.fmt.pix.pixelformat);
+ }
fbvar.nonstd = vout->v2f.fmt.pix.pixelformat;
}