Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge tag 'du-next-20191016' of git://linuxtv.org/pinchartl/media into drm-next

- R-Car DU support for R8A774B1 SoC
- R-Car DU fixes for H2 ES2.0 and later revisions

Signed-off-by: Dave Airlie <airlied@redhat.com>

From: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20191015215116.GF19403@pendragon.ideasonboard.com

+61 -8
+1
Documentation/devicetree/bindings/display/bridge/renesas,dw-hdmi.txt
··· 13 13 14 14 - compatible : Shall contain one or more of 15 15 - "renesas,r8a774a1-hdmi" for R8A774A1 (RZ/G2M) compatible HDMI TX 16 + - "renesas,r8a774b1-hdmi" for R8A774B1 (RZ/G2N) compatible HDMI TX 16 17 - "renesas,r8a7795-hdmi" for R8A7795 (R-Car H3) compatible HDMI TX 17 18 - "renesas,r8a7796-hdmi" for R8A7796 (R-Car M3-W) compatible HDMI TX 18 19 - "renesas,r8a77965-hdmi" for R8A77965 (R-Car M3-N) compatible HDMI TX
+1
Documentation/devicetree/bindings/display/bridge/renesas,lvds.txt
··· 10 10 - "renesas,r8a7743-lvds" for R8A7743 (RZ/G1M) compatible LVDS encoders 11 11 - "renesas,r8a7744-lvds" for R8A7744 (RZ/G1N) compatible LVDS encoders 12 12 - "renesas,r8a774a1-lvds" for R8A774A1 (RZ/G2M) compatible LVDS encoders 13 + - "renesas,r8a774b1-lvds" for R8A774B1 (RZ/G2N) compatible LVDS encoders 13 14 - "renesas,r8a774c0-lvds" for R8A774C0 (RZ/G2E) compatible LVDS encoders 14 15 - "renesas,r8a7790-lvds" for R8A7790 (R-Car H2) compatible LVDS encoders 15 16 - "renesas,r8a7791-lvds" for R8A7791 (R-Car M2-W) compatible LVDS encoders
+2
Documentation/devicetree/bindings/display/renesas,du.txt
··· 8 8 - "renesas,du-r8a7745" for R8A7745 (RZ/G1E) compatible DU 9 9 - "renesas,du-r8a77470" for R8A77470 (RZ/G1C) compatible DU 10 10 - "renesas,du-r8a774a1" for R8A774A1 (RZ/G2M) compatible DU 11 + - "renesas,du-r8a774b1" for R8A774B1 (RZ/G2N) compatible DU 11 12 - "renesas,du-r8a774c0" for R8A774C0 (RZ/G2E) compatible DU 12 13 - "renesas,du-r8a7779" for R8A7779 (R-Car H1) compatible DU 13 14 - "renesas,du-r8a7790" for R8A7790 (R-Car H2) compatible DU ··· 61 60 R8A7745 (RZ/G1E) DPAD 0 DPAD 1 - - 62 61 R8A77470 (RZ/G1C) DPAD 0 DPAD 1 LVDS 0 - 63 62 R8A774A1 (RZ/G2M) DPAD 0 HDMI 0 LVDS 0 - 63 + R8A774B1 (RZ/G2N) DPAD 0 HDMI 0 LVDS 0 - 64 64 R8A774C0 (RZ/G2E) DPAD 0 LVDS 0 LVDS 1 - 65 65 R8A7779 (R-Car H1) DPAD 0 DPAD 1 - - 66 66 R8A7790 (R-Car H2) DPAD 0 LVDS 0 LVDS 1 -
+30
drivers/gpu/drm/rcar-du/rcar_du_drv.c
··· 131 131 .dpll_mask = BIT(1), 132 132 }; 133 133 134 + static const struct rcar_du_device_info rcar_du_r8a774b1_info = { 135 + .gen = 3, 136 + .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK 137 + | RCAR_DU_FEATURE_VSP1_SOURCE 138 + | RCAR_DU_FEATURE_INTERLACED 139 + | RCAR_DU_FEATURE_TVM_SYNC, 140 + .channels_mask = BIT(3) | BIT(1) | BIT(0), 141 + .routes = { 142 + /* 143 + * R8A774B1 has one RGB output, one LVDS output and one HDMI 144 + * output. 145 + */ 146 + [RCAR_DU_OUTPUT_DPAD0] = { 147 + .possible_crtcs = BIT(2), 148 + .port = 0, 149 + }, 150 + [RCAR_DU_OUTPUT_HDMI0] = { 151 + .possible_crtcs = BIT(1), 152 + .port = 1, 153 + }, 154 + [RCAR_DU_OUTPUT_LVDS0] = { 155 + .possible_crtcs = BIT(0), 156 + .port = 2, 157 + }, 158 + }, 159 + .num_lvds = 1, 160 + .dpll_mask = BIT(1), 161 + }; 162 + 134 163 static const struct rcar_du_device_info rcar_du_r8a774c0_info = { 135 164 .gen = 3, 136 165 .features = RCAR_DU_FEATURE_CRTC_IRQ_CLOCK ··· 445 416 { .compatible = "renesas,du-r8a7745", .data = &rzg1_du_r8a7745_info }, 446 417 { .compatible = "renesas,du-r8a77470", .data = &rzg1_du_r8a77470_info }, 447 418 { .compatible = "renesas,du-r8a774a1", .data = &rcar_du_r8a774a1_info }, 419 + { .compatible = "renesas,du-r8a774b1", .data = &rcar_du_r8a774b1_info }, 448 420 { .compatible = "renesas,du-r8a774c0", .data = &rcar_du_r8a774c0_info }, 449 421 { .compatible = "renesas,du-r8a7779", .data = &rcar_du_r8a7779_info }, 450 422 { .compatible = "renesas,du-r8a7790", .data = &rcar_du_r8a7790_info },
+5 -1
drivers/gpu/drm/rcar-du/rcar_du_kms.c
··· 585 585 586 586 vsps[j].crtcs_mask |= BIT(i); 587 587 588 - /* Store the VSP pointer and pipe index in the CRTC. */ 588 + /* 589 + * Store the VSP pointer and pipe index in the CRTC. If the 590 + * second cell of the 'vsps' specifier isn't present, default 591 + * to 0 to remain compatible with older DT bindings. 592 + */ 589 593 rcdu->crtcs[i].vsp = &rcdu->vsps[j]; 590 594 rcdu->crtcs[i].vsp_pipe = cells >= 1 ? args.args[0] : 0; 591 595 }
+22 -7
drivers/gpu/drm/rcar-du/rcar_lvds.c
··· 16 16 #include <linux/of_graph.h> 17 17 #include <linux/platform_device.h> 18 18 #include <linux/slab.h> 19 + #include <linux/sys_soc.h> 19 20 20 21 #include <drm/drm_atomic.h> 21 22 #include <drm/drm_atomic_helper.h> ··· 843 842 return 0; 844 843 } 845 844 845 + static const struct rcar_lvds_device_info rcar_lvds_r8a7790es1_info = { 846 + .gen = 2, 847 + .quirks = RCAR_LVDS_QUIRK_LANES, 848 + .pll_setup = rcar_lvds_pll_setup_gen2, 849 + }; 850 + 851 + static const struct soc_device_attribute lvds_quirk_matches[] = { 852 + { 853 + .soc_id = "r8a7790", .revision = "ES1.*", 854 + .data = &rcar_lvds_r8a7790es1_info, 855 + }, 856 + { /* sentinel */ } 857 + }; 858 + 846 859 static int rcar_lvds_probe(struct platform_device *pdev) 847 860 { 861 + const struct soc_device_attribute *attr; 848 862 struct rcar_lvds *lvds; 849 863 struct resource *mem; 850 864 int ret; ··· 872 856 873 857 lvds->dev = &pdev->dev; 874 858 lvds->info = of_device_get_match_data(&pdev->dev); 859 + 860 + attr = soc_device_match(lvds_quirk_matches); 861 + if (attr) 862 + lvds->info = attr->data; 875 863 876 864 ret = rcar_lvds_parse_dt(lvds); 877 865 if (ret < 0) ··· 913 893 .pll_setup = rcar_lvds_pll_setup_gen2, 914 894 }; 915 895 916 - static const struct rcar_lvds_device_info rcar_lvds_r8a7790_info = { 917 - .gen = 2, 918 - .quirks = RCAR_LVDS_QUIRK_LANES, 919 - .pll_setup = rcar_lvds_pll_setup_gen2, 920 - }; 921 - 922 896 static const struct rcar_lvds_device_info rcar_lvds_gen3_info = { 923 897 .gen = 3, 924 898 .quirks = RCAR_LVDS_QUIRK_PWD, ··· 943 929 { .compatible = "renesas,r8a7743-lvds", .data = &rcar_lvds_gen2_info }, 944 930 { .compatible = "renesas,r8a7744-lvds", .data = &rcar_lvds_gen2_info }, 945 931 { .compatible = "renesas,r8a774a1-lvds", .data = &rcar_lvds_gen3_info }, 932 + { .compatible = "renesas,r8a774b1-lvds", .data = &rcar_lvds_gen3_info }, 946 933 { .compatible = "renesas,r8a774c0-lvds", .data = &rcar_lvds_r8a77990_info }, 947 - { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_r8a7790_info }, 934 + { .compatible = "renesas,r8a7790-lvds", .data = &rcar_lvds_gen2_info }, 948 935 { .compatible = "renesas,r8a7791-lvds", .data = &rcar_lvds_gen2_info }, 949 936 { .compatible = "renesas,r8a7793-lvds", .data = &rcar_lvds_gen2_info }, 950 937 { .compatible = "renesas,r8a7795-lvds", .data = &rcar_lvds_gen3_info },