summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLiu Ying <Ying.Liu@freescale.com>2015-05-28 16:32:30 +0800
committerLiu Ying <Ying.Liu@freescale.com>2015-05-29 12:42:51 +0800
commit543b0799a446ecddedaa33847021bfc87d8262e1 (patch)
tree2a024df48fd59fc4c5427040060c5fb7abb35e85
parente3ba3c9a4dba57af6c7c40573c48fc3caabd0914 (diff)
MLK-10998 video: mxc ipuv3 fb: Fix wrong pixel component map when PRE is enabled
In the on-the-fly cases to enable PRE, the PRE input/output pixel formats are likely not the same, hence, we need to use PRE pixel component mapping feature to make sure the pixel may be correctly deciphered by IPU. However, in the non on-the-fly cases to enable PRE, we should have PRE generate the original fb pixel format for IPU to consume as long as the pixel format is one that IPU can process. The PRE specific input pixel formats(NV21, NV61 and GPU tile formats) are not one of them, thus, we have to use PRE to convert them into dedicated IPU formats. Signed-off-by: Liu Ying <Ying.Liu@freescale.com> (cherry picked from commit 0c33038319b71464dae0d894902e6e6da4dd42a9)
-rw-r--r--drivers/video/mxc/mxc_ipuv3_fb.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/drivers/video/mxc/mxc_ipuv3_fb.c b/drivers/video/mxc/mxc_ipuv3_fb.c
index a4a6556254bd..776b66fcc0fd 100644
--- a/drivers/video/mxc/mxc_ipuv3_fb.c
+++ b/drivers/video/mxc/mxc_ipuv3_fb.c
@@ -763,8 +763,9 @@ static int _setup_disp_channel2(struct fb_info *fbi)
if (!mxc_fbi->on_the_fly) {
retval = ipu_init_channel_buffer(mxc_fbi->ipu,
mxc_fbi->ipu_ch, IPU_INPUT_BUFFER,
- mxc_fbi->on_the_fly ? mxc_fbi->final_pfmt :
- fbi_to_pixfmt(fbi, false),
+ fbi_to_pixfmt(fbi,
+ !ipu_pixel_format_is_pre_yuv(fbi_to_pixfmt(fbi, true)) &&
+ !ipu_pixel_format_is_gpu_tile(fbi_to_pixfmt(fbi, true))),
fbi->var.xres, fbi->var.yres,
ipu_stride,
fbi->var.rotate,
@@ -1354,7 +1355,9 @@ static int mxcfb_set_par(struct fb_info *fbi)
mxc_fbi->cur_var = fbi->var;
mxc_fbi->cur_ipu_pfmt = on_the_fly ? mxc_fbi->final_pfmt :
- fbi_to_pixfmt(fbi, false);
+ fbi_to_pixfmt(fbi,
+ !ipu_pixel_format_is_pre_yuv(fbi_to_pixfmt(fbi, true)) &&
+ !ipu_pixel_format_is_gpu_tile(fbi_to_pixfmt(fbi, true)));
mxc_fbi->cur_fb_pfmt = fbi_to_pixfmt(fbi, true);
mxc_fbi->cur_prefetch = mxc_fbi->prefetch;