MLK-15321-1 gpu: imx: dpu: Add dpu blit engine device
authorMeng Mingming <mingming.meng@nxp.com>
Mon, 14 Aug 2017 05:33:54 +0000 (13:33 +0800)
committerNitin Garg <nitin.garg@nxp.com>
Mon, 19 Mar 2018 20:38:24 +0000 (15:38 -0500)
Implement Blt engine as DRM renderer.
Add dpu blit engine device. And as dpu bliteng has
no device tree node, so to set dpu's of_node as the
platform data for imx-drm component compare_of.

Signed-off-by: Meng Mingming <mingming.meng@nxp.com>
Acked-by: Liu Ying <victor.liu@nxp.com>
drivers/gpu/imx/dpu/dpu-common.c

index 30aff1d..84c7bee 100644 (file)
@@ -837,6 +837,9 @@ static struct dpu_platform_reg client_reg[] = {
                        .stream_id = 1,
                },
                .name = "imx-dpu-crtc",
+       }, {
+               .pdata = { },
+               .name = "imx-drm-dpu-bliteng",
        },
 };
 
@@ -979,21 +982,32 @@ static int dpu_add_client_devices(struct dpu_soc *dpu)
 
        for (i = 0; i < client_num; i++) {
                struct platform_device *pdev;
-               struct device_node *of_node;
-               bool is_disp;
-
-               if (devtype->has_capture)
-                       is_disp = (i / 2) ? true : false;
-               else
-                       is_disp = true;
-
-               /* Associate subdevice with the corresponding port node */
-               of_node = of_graph_get_port_by_id(dev->of_node, i);
-               if (!of_node) {
-                       dev_info(dev, "no port@%d node in %s, not using %s%d\n",
-                                i, dev->of_node->full_name,
-                                is_disp ? "DISP" : "CSI", i % 2);
-                       continue;
+               struct device_node *of_node = NULL;
+               bool is_disp, is_bliteng;
+
+               if (devtype->has_capture) {
+                       is_bliteng = (i == 4) ? true : false;
+                       is_disp = (!is_bliteng) && ((i / 2) ? true : false);
+               } else {
+                       is_bliteng = (i == 2) ? true : false;
+                       is_disp = !is_bliteng;
+               }
+
+               if (is_bliteng) {
+                       /* As bliteng has no of_node, so to use dpu's. */
+                       of_node = dev->of_node;
+               } else {
+                       /*
+                        * Associate subdevice with the
+                        * corresponding port node.
+                        */
+                       of_node = of_graph_get_port_by_id(dev->of_node, i);
+                       if (!of_node) {
+                               dev_info(dev, "no port@%d node in %s, not using %s%d\n",
+                                       i, dev->of_node->full_name,
+                                       is_disp ? "DISP" : "CSI", i % 2);
+                               continue;
+                       }
                }
 
                if (is_disp)