summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJason Chen <b02280@freescale.com>2010-04-21 16:17:31 +0800
committerAlejandro Gonzalez <alex.gonzalez@digi.com>2010-05-25 11:20:25 +0200
commitb86fc292694532b424854b2eccbef158ee7c6b8e (patch)
treed680eb277d780150a45736ad309dc0896496fc8e
parentae011dbc4e94b523cc702d3fc6246e59f7f0bb40 (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) Signed-off-by: Alejandro Gonzalez <alex.gonzalez@digi.com>
-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 4c794ab4b3c2..a8beb77bbd4f 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;
}