]> git.kernelconcepts.de Git - karo-tx-linux.git/commitdiff
ENGR00281186 dmaengine: pxp: not fetch data from AS buffer if it's not used
authorRobby Cai <R63905@freescale.com>
Wed, 25 Sep 2013 05:35:46 +0000 (13:35 +0800)
committerLothar Waßmann <LW@KARO-electronics.de>
Mon, 16 Jun 2014 16:00:48 +0000 (18:00 +0200)
There's no explicit BIT in PxP register to disable AS buffer.
The right way to disable AS is to set ULC to a higher value than the LRC.
It has been done once in probe time, but not in run time.
This could cause one potential problem because even when ULC, LRC
and buffer address is set to 0 PxP will still fetch one pixel data from addr 0.
This patch fixes it by set ULC higher than LRC for AS if it's not used (i.e.,
no alpha-blending) at run time.

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

index 9641adc3fca5b40cdec3e87fcf992b3ffa05c529..55bc3cdb0e85e413193ed376b5602e53c6664631 100644 (file)
@@ -396,11 +396,16 @@ static void pxp_set_oln(int layer_no, struct pxps *pxp)
        dma_addr_t phys_addr = olparams_data->paddr;
        __raw_writel(phys_addr, pxp->base + HW_PXP_AS_BUF);
 
-       /* Fixme */
-       __raw_writel(0x0, pxp->base + HW_PXP_OUT_AS_ULC);
-       __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->combine_enable) {
+               __raw_writel(0x0, pxp->base + HW_PXP_OUT_AS_ULC);
+               __raw_writel(BF_PXP_OUT_AS_LRC_X(olparams_data->width - 1) |
+                            BF_PXP_OUT_AS_LRC_Y(olparams_data->height - 1),
+                            pxp->base + HW_PXP_OUT_AS_LRC);
+       } else {
+               /* will not fetch data from AS if ULC is at left top of LRC */
+               __raw_writel(0xFFFFFFFF, pxp->base + HW_PXP_OUT_AS_ULC);
+               __raw_writel(0x0, pxp->base + HW_PXP_OUT_AS_LRC);
+       }
 
        if (olparams_data->pixel_fmt == PXP_PIX_FMT_RGB24)
                __raw_writel(olparams_data->width << 2,
@@ -429,8 +434,7 @@ static void pxp_set_olparam(int layer_no, struct pxps *pxp)
                    (BV_PXP_AS_CTRL_ALPHA_CTRL__Override);
        if (olparams_data->color_key_enable)
                olparam |= BM_PXP_AS_CTRL_ENABLE_COLORKEY;
-       if (olparams_data->combine_enable)
-               ;
+
        __raw_writel(olparam, pxp->base + HW_PXP_AS_CTRL);
 }