MLK-16075-19 gpu: imx: dpu: common: Add fetchecos support in dpu plane group
authorLiu Ying <victor.liu@nxp.com>
Mon, 24 Jul 2017 02:48:29 +0000 (10:48 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:33:52 +0000 (15:33 -0500)
This patch adds fetchecos support in dpu plane group.
We currently supports fetcheco0 and fetcheco1.

Signed-off-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/imx/dpu/dpu-common.c
include/video/dpu.h

index 5ab02e2..15f14ef 100644 (file)
@@ -866,6 +866,12 @@ static int dpu_get_plane_resource(struct dpu_soc *dpu,
                if (IS_ERR(res->fd[i]))
                        return PTR_ERR(res->fd[i]);
        }
+       for (i = 0; i < ARRAY_SIZE(res->fe); i++) {
+               res->fe[i] = dpu_fe_get(dpu, i);
+               if (IS_ERR(res->fe[i]))
+                       return PTR_ERR(res->fe[i]);
+               grp->hw_plane_fetcheco_num = ARRAY_SIZE(res->fe);
+       }
        /* HScaler could be shared with capture. */
        if (display_plane_video_proc) {
                for (i = 0; i < ARRAY_SIZE(res->hs); i++) {
@@ -912,6 +918,10 @@ static void dpu_put_plane_resource(struct dpu_plane_res *res)
                if (!IS_ERR_OR_NULL(res->fd[i]))
                        dpu_fd_put(res->fd[i]);
        }
+       for (i = 0; i < ARRAY_SIZE(res->fe); i++) {
+               if (!IS_ERR_OR_NULL(res->fe[i]))
+                       dpu_fe_put(res->fe[i]);
+       }
        for (i = 0; i < ARRAY_SIZE(res->hs); i++) {
                if (!IS_ERR_OR_NULL(res->hs[i]))
                        dpu_hs_put(res->hs[i]);
index d099e4f..bd2582e 100644 (file)
@@ -658,6 +658,7 @@ struct dpu_plane_res {
        struct dpu_constframe   *cf[2];
        struct dpu_extdst       *ed[2];
        struct dpu_fetchdecode  *fd[MAX_FD_NUM];
+       struct dpu_fetcheco     *fe[2];
        struct dpu_framegen     *fg;
        struct dpu_hscaler      *hs[2];
        struct dpu_layerblend   *lb[MAX_LB_NUM];
@@ -673,6 +674,7 @@ struct dpu_plane_grp {
        struct list_head        list;
        struct mutex            lock;
        unsigned int            hw_plane_num;
+       unsigned int            hw_plane_fetcheco_num;
        unsigned int            hw_plane_hscaler_num;
        unsigned int            hw_plane_vscaler_num;
        unsigned int            id;