MLK-13198 pxp: imx7d: fix error histogram status report issue
authorRobby Cai <robby.cai@nxp.com>
Thu, 23 Feb 2017 12:50:06 +0000 (20:50 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:21:56 +0000 (15:21 -0500)
The cause is the legacy process involves PXP AS engine accidentally to
process data, which results to one pixel at (0,0) to be changed. This
will cause an incorrect histogram calculation.

Signed-off-by: Robby Cai <robby.cai@nxp.com>
drivers/dma/pxp/pxp_dma_v3.c

index a62487f..dc17d25 100644 (file)
@@ -1300,13 +1300,25 @@ static int pxp_config(struct pxps *pxp, struct pxp_channel *pxp_chan)
        pxp_set_s0crop(pxp);
        pxp_set_scaling(pxp);
        ol_nr = pxp_conf_data->layer_nr - 2;
-       while (ol_nr > 0) {
-               i = pxp_conf_data->layer_nr - 2 - ol_nr;
-               pxp_set_oln(i, pxp);
-               pxp_set_olparam(i, pxp);
-               /* only the color key in higher overlay will take effect. */
-               pxp_set_olcolorkey(i, pxp);
-               ol_nr--;
+
+       if (ol_nr == 0) {
+               /* disable AS engine */
+               __raw_writel(BF_PXP_OUT_AS_ULC_X(1) |
+                               BF_PXP_OUT_AS_ULC_Y(1),
+                               pxp->base + HW_PXP_OUT_AS_ULC);
+
+               __raw_writel(BF_PXP_OUT_AS_LRC_X(0) |
+                               BF_PXP_OUT_AS_LRC_Y(0),
+                               pxp->base + HW_PXP_OUT_AS_LRC);
+       } else {
+               while (ol_nr > 0) {
+                       i = pxp_conf_data->layer_nr - 2 - ol_nr;
+                       pxp_set_oln(i, pxp);
+                       pxp_set_olparam(i, pxp);
+                       /* only the color key in higher overlay will take effect. */
+                       pxp_set_olcolorkey(i, pxp);
+                       ol_nr--;
+               }
        }
        pxp_set_s0colorkey(pxp);
        pxp_set_csc(pxp);