From dbf364b3d0123e5328ae28455c57e588635232c7 Mon Sep 17 00:00:00 2001 From: Robby Cai Date: Thu, 12 Sep 2013 19:11:54 +0800 Subject: ENGR00279413 pxp/v4l2: get the right framebuffer start address at run time Previously the driver gets the framebuffer start address at probe time. But this address might be changed if the framebuffer drivers re-allocate the frame buffers due to the application changes the yres_virtual. As a result, some garbage data can be observed on display. This patch adjusts the way to detect the start address at run time to fix this problem. Signed-off-by: Robby Cai --- drivers/media/platform/mxc/output/mxc_pxp_v4l2.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c index 6a57d2c5ad02..355b9251c070 100644 --- a/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c +++ b/drivers/media/platform/mxc/output/mxc_pxp_v4l2.c @@ -291,6 +291,12 @@ static int pxp_show_buf(struct pxps *pxp, bool toshow) struct fb_info *fbi = pxp->fbi; int ret; + ret = pxp_set_fbinfo(pxp); + if (ret) { + dev_err(&pxp->pdev->dev, "failed to call pxp_set_fbinfo\n"); + return ret; + } + console_lock(); fbi->fix.smem_start = toshow ? pxp->outb_phys : (unsigned long)pxp->fb.base; @@ -787,6 +793,12 @@ static int pxp_buf_prepare(struct videobuf_queue *q, sizeof(struct pxp_layer_param)); } else if (pxp_conf->ol_param[0].combine_enable) { /* Overlay */ + ret = pxp_set_fbinfo(pxp); + if (ret) { + dev_err(&pxp->pdev->dev, + "call pxp_set_fbinfo failed"); + goto fail; + } pxp_conf->ol_param[0].paddr = (dma_addr_t)pxp->fb.base; pxp_conf->ol_param[0].width = pxp->fb.fmt.width; -- cgit v1.2.3