MLK-14314-1 dma: pxp: remove unused multiple overlay layers support
authorFancy Fang <chen.fang@nxp.com>
Sat, 11 Mar 2017 07:48:27 +0000 (15:48 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:22:08 +0000 (15:22 -0500)
The multiple overlay layers are not used on pxp v2 and
v3 module, so remove this.

Signed-off-by: Fancy Fang <chen.fang@nxp.com>
(cherry picked from commit c4fd8b36dbf9b53079d88d55ccfedde3a444ec29)

drivers/dma/pxp/pxp_dma_v2.c
drivers/dma/pxp/pxp_dma_v3.c
drivers/video/fbdev/mxc/mxc_epdc_fb.c
drivers/video/fbdev/mxc/mxc_epdc_v2_fb.c
include/uapi/linux/pxp_dma.h

index 0b12a10..0446bc2 100644 (file)
@@ -1,5 +1,6 @@
 /*
- * Copyright (C) 2010-2015 Freescale Semiconductor, Inc.
+ * Copyright (C) 2010-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -1065,25 +1066,17 @@ static void pxp_set_s0buf(struct pxps *pxp)
  */
 static int pxp_config(struct pxps *pxp, struct pxp_channel *pxp_chan)
 {
-       struct pxp_config_data *pxp_conf_data = &pxp->pxp_conf_state;
-       int ol_nr;
-       int i;
-
        /* Configure PxP regs */
        pxp_set_ctrl(pxp);
        pxp_set_s0param(pxp);
        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--;
-       }
        pxp_set_s0colorkey(pxp);
+
+       pxp_set_oln(0, pxp);
+       pxp_set_olparam(0, pxp);
+       pxp_set_olcolorkey(0, pxp);
+
        pxp_set_csc(pxp);
        pxp_set_bg(pxp);
        pxp_set_lut(pxp);
index 5acbbd3..c03d9ec 100644 (file)
@@ -1242,11 +1242,8 @@ static int pxp_config(struct pxps *pxp, struct pxp_channel *pxp_chan)
 {
        struct pxp_config_data *pxp_conf_data = &pxp->pxp_conf_state;
        struct pxp_proc_data *proc_data = &pxp_conf_data->proc_data;
-       int ol_nr;
-       int i;
 
        if ((proc_data->working_mode & PXP_MODE_STANDARD) == PXP_MODE_STANDARD) {
-
                /* now only test dithering feature */
                if ((proc_data->engine_enable & PXP_ENABLE_DITHER) == PXP_ENABLE_DITHER) {
                        pxp_dithering_process(pxp);
@@ -1261,7 +1258,7 @@ static int pxp_config(struct pxps *pxp, struct pxp_channel *pxp_chan)
                                        pxp->base + HW_PXP_CTRL_SET);
                                return 0;
                        }
-}
+               }
 
                if ((proc_data->engine_enable & PXP_ENABLE_WFE_A) == PXP_ENABLE_WFE_A)
                {
@@ -1301,28 +1298,21 @@ static int pxp_config(struct pxps *pxp, struct pxp_channel *pxp_chan)
        pxp_set_s0param(pxp);
        pxp_set_s0crop(pxp);
        pxp_set_scaling(pxp);
-       ol_nr = pxp_conf_data->layer_nr - 2;
+       pxp_set_s0colorkey(pxp);
 
-       if (ol_nr == 0) {
+       if (pxp_conf_data->layer_nr == 2) {
                /* 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);
+       } else
+               pxp_set_oln(0, pxp);
+       pxp_set_olparam(0, pxp);
+       pxp_set_olcolorkey(0, pxp);
+
        pxp_set_csc(pxp);
        pxp_set_bg(pxp);
        pxp_set_lut(pxp);
@@ -1412,7 +1402,7 @@ static void __pxpdma_dostart(struct pxp_channel *pxp_chan)
 
        memset(&pxp->pxp_conf_state.s0_param, 0,  sizeof(struct pxp_layer_param));
        memset(&pxp->pxp_conf_state.out_param, 0,  sizeof(struct pxp_layer_param));
-       memset(pxp->pxp_conf_state.ol_param, 0,  sizeof(struct pxp_layer_param) * 8);
+       memset(pxp->pxp_conf_state.ol_param, 0,  sizeof(struct pxp_layer_param));
        memset(&pxp->pxp_conf_state.proc_data, 0,  sizeof(struct pxp_proc_data));
        /* S0 */
        desc = list_first_entry(&head, struct pxp_tx_desc, list);
index 1497f72..276d5c1 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2010-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -4979,17 +4980,15 @@ int mxc_epdc_fb_probe(struct platform_device *pdev)
         * Initialize OL0 channel parameters
         * No overlay will be used for PxP operation
         */
-       for (i = 0; i < 8; i++) {
-               pxp_conf->ol_param[i].combine_enable = false;
-               pxp_conf->ol_param[i].width = 0;
-               pxp_conf->ol_param[i].height = 0;
-               pxp_conf->ol_param[i].pixel_fmt = PXP_PIX_FMT_RGB565;
-               pxp_conf->ol_param[i].color_key_enable = false;
-               pxp_conf->ol_param[i].color_key = -1;
-               pxp_conf->ol_param[i].global_alpha_enable = false;
-               pxp_conf->ol_param[i].global_alpha = 0;
-               pxp_conf->ol_param[i].local_alpha_enable = false;
-       }
+       pxp_conf->ol_param[0].combine_enable = false;
+       pxp_conf->ol_param[0].width = 0;
+       pxp_conf->ol_param[0].height = 0;
+       pxp_conf->ol_param[0].pixel_fmt = PXP_PIX_FMT_RGB565;
+       pxp_conf->ol_param[0].color_key_enable = false;
+       pxp_conf->ol_param[0].color_key = -1;
+       pxp_conf->ol_param[0].global_alpha_enable = false;
+       pxp_conf->ol_param[0].global_alpha = 0;
+       pxp_conf->ol_param[0].local_alpha_enable = false;
 
        /*
         * Initialize Output channel parameters
index 36ae604..5be94dd 100644 (file)
@@ -1,5 +1,6 @@
 /*
  * Copyright (C) 2014-2016 Freescale Semiconductor, Inc.
+ * Copyright 2017 NXP
  *
  * This program is free software; you can redistribute it and/or modify
  * it under the terms of the GNU General Public License as published by
@@ -5510,17 +5511,15 @@ static int mxc_epdc_fb_probe(struct platform_device *pdev)
         * Initialize OL0 channel parameters
         * No overlay will be used for PxP operation
         */
-       for (i = 0; i < 8; i++) {
-               pxp_conf->ol_param[i].combine_enable = false;
-               pxp_conf->ol_param[i].width = 0;
-               pxp_conf->ol_param[i].height = 0;
-               pxp_conf->ol_param[i].pixel_fmt = PXP_PIX_FMT_RGB565;
-               pxp_conf->ol_param[i].color_key_enable = false;
-               pxp_conf->ol_param[i].color_key = -1;
-               pxp_conf->ol_param[i].global_alpha_enable = false;
-               pxp_conf->ol_param[i].global_alpha = 0;
-               pxp_conf->ol_param[i].local_alpha_enable = false;
-       }
+       pxp_conf->ol_param[0].combine_enable = false;
+       pxp_conf->ol_param[0].width = 0;
+       pxp_conf->ol_param[0].height = 0;
+       pxp_conf->ol_param[0].pixel_fmt = PXP_PIX_FMT_RGB565;
+       pxp_conf->ol_param[0].color_key_enable = false;
+       pxp_conf->ol_param[0].color_key = -1;
+       pxp_conf->ol_param[0].global_alpha_enable = false;
+       pxp_conf->ol_param[0].global_alpha = 0;
+       pxp_conf->ol_param[0].local_alpha_enable = false;
 
        /*
         * Initialize Output channel parameters
index d5d4c58..308bdd2 100644 (file)
@@ -270,7 +270,7 @@ struct pxp_proc_data {
 
 struct pxp_config_data {
        struct pxp_layer_param s0_param;
-       struct pxp_layer_param ol_param[8];
+       struct pxp_layer_param ol_param[1];
        struct pxp_layer_param out_param;
        struct pxp_layer_param wfe_a_fetch_param[2];
        struct pxp_layer_param wfe_a_store_param[2];