aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2013-12-02 03:56:00 -0500
committerNitin Garg <nitin.garg@freescale.com>2014-04-16 09:47:26 -0400
commit84acbb5de547cf0b378b55f3c016491218239c4a (patch)
tree8db2e9d8288df18f99b724e4aac43d3f2b4f60d9 /drivers/video
parent3756246a40dc805f84811d63f9343b88c66b20a7 (diff)
ENGR00290361-2 MXC IPUv3 fb:Add check for a IDMAC errata
The IPUv3 IDMAC has a bug to read 32bpp pixels from a graphics plane whose alpha component is at the most significant 8 bits. The bug only impacts on cases in which the relevant separate alpha channel is enabled. This patch adds check for the errata so that the bad cases won't be triggered. Signed-off-by: Liu Ying <Ying.Liu@freescale.com>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/mxc/mxc_ipuv3_fb.c29
1 files changed, 23 insertions, 6 deletions
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c
index 29b7333a0b6c..49abe8c284fc 100644
--- a/drivers/video/mxc/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc/mxc_ipuv3_fb.c
@@ -445,6 +445,13 @@ static int mxcfb_set_par(struct fb_info *fbi)
445 struct mxcfb_info *mxc_fbi_fg = NULL; 445 struct mxcfb_info *mxc_fbi_fg = NULL;
446 bool ovfbi_enable = false; 446 bool ovfbi_enable = false;
447 447
448 if (ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi)) &&
449 mxc_fbi->alpha_chan_en) {
450 dev_err(fbi->device, "Bad pixel format for "
451 "graphics plane fb\n");
452 return -EINVAL;
453 }
454
448 if (mxc_fbi->ovfbi) 455 if (mxc_fbi->ovfbi)
449 mxc_fbi_fg = (struct mxcfb_info *)mxc_fbi->ovfbi->par; 456 mxc_fbi_fg = (struct mxcfb_info *)mxc_fbi->ovfbi->par;
450 457
@@ -986,22 +993,25 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
986 case MXCFB_SET_LOC_ALPHA: 993 case MXCFB_SET_LOC_ALPHA:
987 { 994 {
988 struct mxcfb_loc_alpha la; 995 struct mxcfb_loc_alpha la;
996 bool bad_pixfmt =
997 ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi));
989 998
990 if (copy_from_user(&la, (void *)arg, sizeof(la))) { 999 if (copy_from_user(&la, (void *)arg, sizeof(la))) {
991 retval = -EFAULT; 1000 retval = -EFAULT;
992 break; 1001 break;
993 } 1002 }
994 1003
995 if (ipu_disp_set_global_alpha(mxc_fbi->ipu, mxc_fbi->ipu_ch,
996 !(bool)la.enable, 0)) {
997 retval = -EINVAL;
998 break;
999 }
1000
1001 if (la.enable && !la.alpha_in_pixel) { 1004 if (la.enable && !la.alpha_in_pixel) {
1002 struct fb_info *fbi_tmp; 1005 struct fb_info *fbi_tmp;
1003 ipu_channel_t ipu_ch; 1006 ipu_channel_t ipu_ch;
1004 1007
1008 if (bad_pixfmt) {
1009 dev_err(fbi->device, "Bad pixel format "
1010 "for graphics plane fb\n");
1011 retval = -EINVAL;
1012 break;
1013 }
1014
1005 mxc_fbi->alpha_chan_en = true; 1015 mxc_fbi->alpha_chan_en = true;
1006 1016
1007 if (mxc_fbi->ipu_ch == MEM_FG_SYNC) 1017 if (mxc_fbi->ipu_ch == MEM_FG_SYNC)
@@ -1019,6 +1029,13 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg)
1019 } else 1029 } else
1020 mxc_fbi->alpha_chan_en = false; 1030 mxc_fbi->alpha_chan_en = false;
1021 1031
1032 if (ipu_disp_set_global_alpha(mxc_fbi->ipu,
1033 mxc_fbi->ipu_ch,
1034 !(bool)la.enable, 0)) {
1035 retval = -EINVAL;
1036 break;
1037 }
1038
1022 fbi->var.activate = (fbi->var.activate & ~FB_ACTIVATE_MASK) | 1039 fbi->var.activate = (fbi->var.activate & ~FB_ACTIVATE_MASK) |
1023 FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; 1040 FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE;
1024 mxcfb_set_par(fbi); 1041 mxcfb_set_par(fbi);