diff options
author | Liu Ying <Ying.Liu@freescale.com> | 2013-12-02 16:56:00 +0800 |
---|---|---|
committer | Liu Ying <Ying.Liu@freescale.com> | 2013-12-05 18:04:54 +0800 |
commit | 2957fb27c9c267b2d16ecacc761dc809a215faef (patch) | |
tree | b135902334de3b1a02d82aa0e2bdff863da0d7f1 | |
parent | 25e98bf6307fa601f8bce5da92baaa77a68df593 (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>
(cherry picked from commit 005224b96ce3d4bd20d27faa4f2b055bc763daea)
-rw-r--r-- | drivers/video/mxc/mxc_ipuv3_fb.c | 29 |
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) struct mxcfb_info *mxc_fbi_fg = NULL; bool ovfbi_enable = false; + if (ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi)) && + mxc_fbi->alpha_chan_en) { + dev_err(fbi->device, "Bad pixel format for " + "graphics plane fb\n"); + return -EINVAL; + } + if (mxc_fbi->ovfbi) mxc_fbi_fg = (struct mxcfb_info *)mxc_fbi->ovfbi->par; @@ -986,22 +993,25 @@ static int mxcfb_ioctl(struct fb_info *fbi, unsigned int cmd, unsigned long arg) case MXCFB_SET_LOC_ALPHA: { struct mxcfb_loc_alpha la; + bool bad_pixfmt = + ipu_ch_param_bad_alpha_pos(fbi_to_pixfmt(fbi)); if (copy_from_user(&la, (void *)arg, sizeof(la))) { retval = -EFAULT; break; } - if (ipu_disp_set_global_alpha(mxc_fbi->ipu, mxc_fbi->ipu_ch, - !(bool)la.enable, 0)) { - retval = -EINVAL; - break; - } - if (la.enable && !la.alpha_in_pixel) { struct fb_info *fbi_tmp; ipu_channel_t ipu_ch; + if (bad_pixfmt) { + dev_err(fbi->device, "Bad pixel format " + "for graphics plane fb\n"); + retval = -EINVAL; + break; + } + mxc_fbi->alpha_chan_en = true; 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) } else mxc_fbi->alpha_chan_en = false; + if (ipu_disp_set_global_alpha(mxc_fbi->ipu, + mxc_fbi->ipu_ch, + !(bool)la.enable, 0)) { + retval = -EINVAL; + break; + } + fbi->var.activate = (fbi->var.activate & ~FB_ACTIVATE_MASK) | FB_ACTIVATE_NOW | FB_ACTIVATE_FORCE; mxcfb_set_par(fbi); |