]> git.karo-electronics.de Git - karo-tx-linux.git/commitdiff
ENGR00220796-1: pxp: Add stride configuration for some pixel format
authorRobby Cai <R63905@freescale.com>
Fri, 24 Aug 2012 08:43:13 +0000 (16:43 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Fri, 24 May 2013 06:35:18 +0000 (08:35 +0200)
Set correct PITCH (aka, stride) for AS, PS, Output buffer.
This is needed for V4L2.

Signed-off-by: Robby Cai <R63905@freescale.com>
drivers/dma/pxp/pxp_dma_v2.c

index ceb72edbd39e0d2a80c250af66abd6233abdfbe6..87b8f558ae8c3c63bc70a10881427a745a9b2bcc 100644 (file)
@@ -339,7 +339,14 @@ static void pxp_set_outbuf(struct pxps *pxp)
                     BF_PXP_OUT_LRC_Y(out_params->height - 1),
                     pxp->base + HW_PXP_OUT_LRC);
 
-       __raw_writel(out_params->stride, pxp->base + HW_PXP_OUT_PITCH);
+       if (out_params->pixel_fmt == PXP_PIX_FMT_RGB24)
+               __raw_writel(out_params->stride << 2,
+                               pxp->base + HW_PXP_OUT_PITCH);
+       else if (out_params->pixel_fmt == PXP_PIX_FMT_RGB565)
+               __raw_writel(out_params->stride << 1,
+                               pxp->base + HW_PXP_OUT_PITCH);
+       else
+               __raw_writel(out_params->stride, pxp->base + HW_PXP_OUT_PITCH);
 }
 
 static void pxp_set_s0colorkey(struct pxps *pxp)
@@ -390,6 +397,13 @@ static void pxp_set_oln(int layer_no, struct pxps *pxp)
        __raw_writel(BF_PXP_OUT_AS_LRC_X(olparams_data->width) |
                     BF_PXP_OUT_AS_LRC_Y(olparams_data->height),
                     pxp->base + HW_PXP_OUT_AS_LRC);
+
+       if (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB24)
+               __raw_writel(olparams_data->width << 2,
+                               pxp->base + HW_PXP_AS_PITCH);
+       else
+               __raw_writel(olparams_data->width << 1,
+                               pxp->base + HW_PXP_AS_PITCH);
 }
 
 static void pxp_set_olparam(int layer_no, struct pxps *pxp)
@@ -704,8 +718,9 @@ static void pxp_set_s0buf(struct pxps *pxp)
                __raw_writel(V, pxp->base + HW_PXP_PS_VBUF);
        }
 
-       /* TODO: only support RGB565, Y8, Y4 */
-       if (s0_params->pixel_fmt == PXP_PIX_FMT_GREY)
+       /* TODO: only support RGB565, Y8, Y4, YUV420 */
+       if (s0_params->pixel_fmt == PXP_PIX_FMT_GREY ||
+           s0_params->pixel_fmt == PXP_PIX_FMT_YUV420P)
                __raw_writel(s0_params->width, pxp->base + HW_PXP_PS_PITCH);
        else if (s0_params->pixel_fmt == PXP_PIX_FMT_GY04)
                __raw_writel(s0_params->width >> 1, pxp->base + HW_PXP_PS_PITCH);