]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
drm/mediatek: add third ddp path
authorstu.hsieh@mediatek.com <stu.hsieh@mediatek.com>
Wed, 20 Jun 2018 08:19:30 +0000 (16:19 +0800)
committerCK Hu <ck.hu@mediatek.com>
Sun, 24 Jun 2018 04:09:01 +0000 (12:09 +0800)
This patch create third crtc by third ddp path

Signed-off-by: Stu Hsieh <stu.hsieh@mediatek.com>
Signed-off-by: CK Hu <ck.hu@mediatek.com>
drivers/gpu/drm/mediatek/mtk_drm_crtc.c
drivers/gpu/drm/mediatek/mtk_drm_drv.c
drivers/gpu/drm/mediatek/mtk_drm_drv.h

index 658b8dd45b834fb463cab8424e5067dc82258e39..2d6aa150a9ff08f0c0be658593abe1114d44a514 100644 (file)
@@ -539,6 +539,9 @@ int mtk_drm_crtc_create(struct drm_device *drm_dev,
        int ret;
        int i;
 
+       if (!path)
+               return 0;
+
        for (i = 0; i < path_len; i++) {
                enum mtk_ddp_comp_id comp_id = path[i];
                struct device_node *node;
index 08d5d0b47bfe578a343db06c45a6b05687b6cfac..3d279a2993830a2178cde9607898f2c7880fc1ff 100644 (file)
@@ -232,6 +232,11 @@ static int mtk_drm_kms_init(struct drm_device *drm)
        if (ret < 0)
                goto err_component_unbind;
 
+       ret = mtk_drm_crtc_create(drm, private->data->third_path,
+                                 private->data->third_len);
+       if (ret < 0)
+               goto err_component_unbind;
+
        /* Use OVL device for all DMA memory allocations */
        np = private->comp_node[private->data->main_path[0]] ?:
             private->comp_node[private->data->ext_path[0]];
index c3378c452c0a03134c1eaa6175921102fc8ab751..ecc00ca3221daa80f6952f3083f37dc5f1fad0cf 100644 (file)
@@ -17,7 +17,7 @@
 #include <linux/io.h>
 #include "mtk_drm_ddp_comp.h"
 
-#define MAX_CRTC       2
+#define MAX_CRTC       3
 #define MAX_CONNECTOR  2
 
 struct device;
@@ -33,6 +33,9 @@ struct mtk_mmsys_driver_data {
        unsigned int main_len;
        const enum mtk_ddp_comp_id *ext_path;
        unsigned int ext_len;
+       const enum mtk_ddp_comp_id *third_path;
+       unsigned int third_len;
+
        bool shadow_register;
 };