aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSandor Yu <R01008@freescale.com>2014-06-26 03:46:37 -0400
committerSandor Yu <R01008@freescale.com>2014-06-29 22:51:00 -0400
commitd965cfdbf03d972baac616e9f1d6c9e50d0d3c5c (patch)
treec307cc67e1256d3b507dcb5956fa20b6dfdd0bb8 /drivers
parentd4478b9ab9feebbd2b3c663afedf9dfa9fe8526b (diff)
ENGR00312699 mxsfb: RGB888 as default format for lvds
Check bpp value in check_var function, any other than bpp=32 and bpp=16 been setting to bpp=32. Set default RGB888 format for lvds bpp=32 mode. Signed-off-by: Sandor Yu <R01008@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r--drivers/video/mxsfb.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/drivers/video/mxsfb.c b/drivers/video/mxsfb.c
index c9fcd8d0af0d..d4312467a55b 100644
--- a/drivers/video/mxsfb.c
+++ b/drivers/video/mxsfb.c
@@ -415,6 +415,9 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
415 if (var->yres_virtual < var->yres) 415 if (var->yres_virtual < var->yres)
416 var->yres_virtual = var->yres; 416 var->yres_virtual = var->yres;
417 417
418 if ((var->bits_per_pixel != 32) && (var->bits_per_pixel != 16))
419 var->bits_per_pixel = 32;
420
418 switch (var->bits_per_pixel) { 421 switch (var->bits_per_pixel) {
419 case 16: 422 case 16:
420 /* always expect RGB 565 */ 423 /* always expect RGB 565 */
@@ -430,11 +433,11 @@ static int mxsfb_check_var(struct fb_var_screeninfo *var,
430 rgb = def_rgb666; 433 rgb = def_rgb666;
431 break; 434 break;
432 case STMLCDIF_18BIT: 435 case STMLCDIF_18BIT:
433 if (pixfmt_is_equal(var, def_rgb888)) 436 if (pixfmt_is_equal(var, def_rgb666))
434 rgb = def_rgb888;
435 else
436 /* 24 bit to 18 bit mapping */ 437 /* 24 bit to 18 bit mapping */
437 rgb = def_rgb666; 438 rgb = def_rgb666;
439 else
440 rgb = def_rgb888;
438 break; 441 break;
439 case STMLCDIF_24BIT: 442 case STMLCDIF_24BIT:
440 /* real 24 bit */ 443 /* real 24 bit */
@@ -633,9 +636,7 @@ static int mxsfb_set_par(struct fb_info *fb_info)
633 */ 636 */
634 break; 637 break;
635 case STMLCDIF_18BIT: 638 case STMLCDIF_18BIT:
636 if (pixfmt_is_equal(&fb_info->var, def_rgb888)) 639 if (pixfmt_is_equal(&fb_info->var, def_rgb666))
637 break;
638 else
639 /* 24 bit to 18 bit mapping */ 640 /* 24 bit to 18 bit mapping */
640 ctrl |= CTRL_DF24; /* ignore the upper 2 bits in 641 ctrl |= CTRL_DF24; /* ignore the upper 2 bits in
641 * each colour component 642 * each colour component