MLK-16252: PxP: fix video shift issue
authorGuoniu.Zhou <guoniu.zhou@nxp.com>
Fri, 25 Aug 2017 10:48:32 +0000 (18:48 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:21 +0000 (15:38 -0500)
If pxp use crop x/y valuse as the upper left coordinate in
out buffer, pxp driver only need to write out buffer base
address to pxp out_buf register. If pxp driver use zero as
ps_ulc register value, pxp out_buf register need an offset
added with out buffer base address.

Signed-off-by: Guoniu.Zhou <guoniu.zhou@nxp.com>
Reviewed-by: Robby Cai <robby.cai@nxp.com>
Reviewed-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit 14c988f1eb7e9471b0875016df29708865727fbb)

drivers/dma/pxp/pxp_dma_v3.c

index 9aec499..50e1d79 100644 (file)
@@ -2314,8 +2314,8 @@ static int pxp_ps_config(struct pxp_pixmap *input,
        case 0:
                out_ps_ulc.x = output->crop.x;
                out_ps_ulc.y = output->crop.y;
-               out_ps_lrc.x = output->crop.width - 1;
-               out_ps_lrc.y = output->crop.height - 1;
+               out_ps_lrc.x = out_ps_ulc.x + output->crop.width - 1;
+               out_ps_lrc.y = out_ps_ulc.y + output->crop.height - 1;
                break;
        case 90:
                out_ps_ulc.x = output->crop.y;
@@ -2618,7 +2618,7 @@ static int pxp_out_config(struct pxp_pixmap *output)
 
        pxp_writel(*(uint32_t *)&ctrl, HW_PXP_OUT_CTRL);
 
-       pxp_writel(output->paddr + offset, HW_PXP_OUT_BUF);
+       pxp_writel(output->paddr, HW_PXP_OUT_BUF);
        if (is_yuv(output->format) == 2) {
                UV = output->paddr + output->width * output->height;
                if ((output->format == PXP_PIX_FMT_NV16) ||