From e46979d2ba0d4174a0f61395dec8aaa2874758d3 Mon Sep 17 00:00:00 2001 From: Chandan Uddaraju Date: Tue, 17 Jul 2012 16:54:28 -0700 Subject: [PATCH] msm_fb: Display: Fix Dithering issue for rgb565 format Using RGB888 as source format and rgb565 as destination pixel format, will cause image corruption on the display. Fix this issue by setting the destination format as RGB888 in MDP and DSI controller pixel format as RGB565 for DSI specific panels. CRs-Fixed: 377484 Change-Id: If58976ee9cd4825efb39437170e54796fa2213e0 Signed-off-by: Chandan Uddaraju --- drivers/video/msm/mdp4_overlay.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/video/msm/mdp4_overlay.c b/drivers/video/msm/mdp4_overlay.c index 9454dfef7cba..9fe521453e6b 100644 --- a/drivers/video/msm/mdp4_overlay.c +++ b/drivers/video/msm/mdp4_overlay.c @@ -475,14 +475,18 @@ void mdp4_overlay_dmap_cfg(struct msm_fb_data_type *mfd, int lcdc) dma2_cfg_reg |= DMA_PACK_PATTERN_RGB; - if (mfd->panel_info.bpp == 18) { + if ((mfd->panel_info.type == MIPI_CMD_PANEL) || + (mfd->panel_info.type == MIPI_VIDEO_PANEL)) { + dma2_cfg_reg |= DMA_DSTC0G_8BITS | /* 888 24BPP */ + DMA_DSTC1B_8BITS | DMA_DSTC2R_8BITS; + } else if (mfd->panel_info.bpp == 18) { dma2_cfg_reg |= DMA_DSTC0G_6BITS | /* 666 18BPP */ DMA_DSTC1B_6BITS | DMA_DSTC2R_6BITS; } else if (mfd->panel_info.bpp == 16) { dma2_cfg_reg |= DMA_DSTC0G_6BITS | /* 565 16BPP */ DMA_DSTC1B_5BITS | DMA_DSTC2R_5BITS; } else { - dma2_cfg_reg |= DMA_DSTC0G_8BITS | /* 888 16BPP */ + dma2_cfg_reg |= DMA_DSTC0G_8BITS | /* 888 24BPP */ DMA_DSTC1B_8BITS | DMA_DSTC2R_8BITS; }