From b80a7d089f9daa80aa773875a09a3efa89ad9ca8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=BB=84=E5=AD=90=E6=87=BF?= Date: Thu, 29 Aug 2024 16:57:22 +0800 Subject: [PATCH] drivers: k230: support HDMI MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 黄子懿 --- .../dts/canaan/display-hx8399-1080x1920.dtsi | 97 +++++++------ .../dts/canaan/display-st7701-480x800.dtsi | 132 ++++++++++-------- arch/riscv/boot/dts/canaan/k230-canmv-lcd.dts | 83 +++++++++++ arch/riscv/boot/dts/canaan/k230-canmv.dts | 61 ++++++-- arch/riscv/boot/dts/canaan/k230.dtsi | 19 ++- arch/riscv/configs/k230_defconfig | 2 + drivers/gpu/drm/canaan/canaan_dsi.c | 65 ++++++--- drivers/gpu/drm/canaan/canaan_dsi.h | 1 + drivers/gpu/drm/canaan/canaan_vo.c | 12 +- 9 files changed, 322 insertions(+), 150 deletions(-) create mode 100644 arch/riscv/boot/dts/canaan/k230-canmv-lcd.dts diff --git a/arch/riscv/boot/dts/canaan/display-hx8399-1080x1920.dtsi b/arch/riscv/boot/dts/canaan/display-hx8399-1080x1920.dtsi index b46c940b03b44..4335a7cbd304d 100644 --- a/arch/riscv/boot/dts/canaan/display-hx8399-1080x1920.dtsi +++ b/arch/riscv/boot/dts/canaan/display-hx8399-1080x1920.dtsi @@ -3,54 +3,59 @@ vth_line = <11>; }; -&lcd { - panel-width-mm = <1080>; - panel-height-mm = <1920>; - panel-dsi-lane = <4>; +&dsi { + lcd: panel@0 { + compatible = "canaan,universal"; + reg = <0>; - panel-init-sequence = [ - 39 00 04 B9 FF 83 99 - 39 00 02 D2 AA - 39 00 10 B1 02 04 71 91 01 32 33 11 11 ab 4d 56 73 02 02 - 39 00 10 B2 00 80 80 ae 05 07 5a 11 00 00 10 1e 70 03 d4 - 39 00 2d B4 00 FF 02 C0 02 c0 00 00 08 00 04 06 00 32 04 0a - 08 21 03 01 - 00 0f b8 8b 02 c0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 01 - 00 0f b8 01 - 39 00 22 D3 00 00 00 00 00 00 06 00 00 10 04 00 04 00 00 00 - 00 00 00 00 00 00 00 01 00 05 05 07 00 00 00 05 40 - 39 00 21 D5 18 18 19 19 18 18 21 20 01 00 07 06 05 04 03 02 - 18 18 18 18 18 18 2f 2f 30 30 31 31 18 18 18 18 - 39 00 21 D6 18 18 19 19 40 40 20 21 02 03 04 05 06 07 00 01 - 40 40 40 40 40 40 2f 2f 30 30 31 31 40 40 40 40 - 39 00 11 D8 a2 aa 02 a0 a2 a8 02 a0 b0 00 00 00 b0 00 00 00 - 39 00 02 BD 01 - 39 00 11 D8 B0 00 00 00 B0 00 00 00 E2 AA 03 F0 E2 AA 03 F0 - 39 00 02 BD 02 - 39 00 09 D8 E2 AA 03 F0 E2 AA 03 F0 - 39 00 02 BD 00 - 39 00 03 B6 8D 8D - 39 00 02 CC 04 - 39 00 03 C6 FF F9 - 39 00 37 E0 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 - 95 9f a3 ad a2 b2 B6 5e 5a 65 77 00 12 1f 1a 40 4a 59 55 5e - 67 6f 75 7a 82 8b 90 95 - 9f a3 ad a2 b2 B6 5e 5a 65 77 - 39 ff 01 11 - 39 ff 01 29 - ]; + panel-width-mm = <1080>; + panel-height-mm = <1920>; + panel-dsi-lane = <4>; - display-timings { - timing-0 { - clock-frequency = <74250000>; - hactive = <1080>; - vactive = <1920>; - hfront-porch = <40>; - hback-porch = <20>; - hsync-len = <20>; - vfront-porch = <206>; - vback-porch = <8>; - vsync-len = <5>; + panel-init-sequence = [ + 39 00 04 B9 FF 83 99 + 39 00 02 D2 AA + 39 00 10 B1 02 04 71 91 01 32 33 11 11 ab 4d 56 73 02 02 + 39 00 10 B2 00 80 80 ae 05 07 5a 11 00 00 10 1e 70 03 d4 + 39 00 2d B4 00 FF 02 C0 02 c0 00 00 08 00 04 06 00 32 04 0a + 08 21 03 01 + 00 0f b8 8b 02 c0 02 c0 00 00 08 00 04 06 00 32 04 0a 08 01 + 00 0f b8 01 + 39 00 22 D3 00 00 00 00 00 00 06 00 00 10 04 00 04 00 00 00 + 00 00 00 00 00 00 00 01 00 05 05 07 00 00 00 05 40 + 39 00 21 D5 18 18 19 19 18 18 21 20 01 00 07 06 05 04 03 02 + 18 18 18 18 18 18 2f 2f 30 30 31 31 18 18 18 18 + 39 00 21 D6 18 18 19 19 40 40 20 21 02 03 04 05 06 07 00 01 + 40 40 40 40 40 40 2f 2f 30 30 31 31 40 40 40 40 + 39 00 11 D8 a2 aa 02 a0 a2 a8 02 a0 b0 00 00 00 b0 00 00 00 + 39 00 02 BD 01 + 39 00 11 D8 B0 00 00 00 B0 00 00 00 E2 AA 03 F0 E2 AA 03 F0 + 39 00 02 BD 02 + 39 00 09 D8 E2 AA 03 F0 E2 AA 03 F0 + 39 00 02 BD 00 + 39 00 03 B6 8D 8D + 39 00 02 CC 04 + 39 00 03 C6 FF F9 + 39 00 37 E0 00 12 1f 1a 40 4a 59 55 5e 67 6f 75 7a 82 8b 90 + 95 9f a3 ad a2 b2 B6 5e 5a 65 77 00 12 1f 1a 40 4a 59 55 5e + 67 6f 75 7a 82 8b 90 95 + 9f a3 ad a2 b2 B6 5e 5a 65 77 + 39 ff 01 11 + 39 ff 01 29 + ]; + + display-timings { + timing-0 { + clock-frequency = <74250000>; + hactive = <1080>; + vactive = <1920>; + hfront-porch = <40>; + hback-porch = <20>; + hsync-len = <20>; + vfront-porch = <206>; + vback-porch = <8>; + vsync-len = <5>; + }; }; }; }; diff --git a/arch/riscv/boot/dts/canaan/display-st7701-480x800.dtsi b/arch/riscv/boot/dts/canaan/display-st7701-480x800.dtsi index 967134eaac533..62f2ca011b9db 100644 --- a/arch/riscv/boot/dts/canaan/display-st7701-480x800.dtsi +++ b/arch/riscv/boot/dts/canaan/display-st7701-480x800.dtsi @@ -3,69 +3,79 @@ vth_line = <10>; }; -&lcd { - panel-width-mm = <480>; - panel-height-mm = <800>; - panel-dsi-lane = <2>; +&dsi { + lcd: panel@0 { + compatible = "canaan,universal"; + reg = <0>; - panel-init-sequence = [ - 39 00 06 ff 77 01 00 00 13 - 39 00 02 ef 08 - 39 00 06 ff 77 01 00 00 10 - 39 00 03 c0 63 00 - 39 00 03 c1 10 02 - 39 00 03 c2 31 02 - 39 00 02 cc 10 - 39 00 11 b0 c0 0c 92 0c 10 05 02 0d 07 21 04 53 11 6a 32 1f - 39 00 11 b1 c0 87 cf 0c 10 06 00 03 08 1d 06 54 12 e6 ec 0f - 39 00 06 ff 77 01 00 00 11 - 39 00 02 b0 5d - 39 00 02 b1 62 - 39 00 02 b2 82 - 39 00 02 b3 80 - 39 00 02 b5 42 - 39 00 02 b7 85 - 39 00 02 b8 20 - 39 00 02 c0 09 - 39 00 02 c1 78 - 39 00 02 c2 78 - 39 00 02 d0 88 - 39 ff 02 ee 42 - 39 00 04 e0 00 00 02 - 39 00 0c e1 04 a0 06 a0 05 a0 07 a0 00 44 44 - 39 00 0d e2 00 00 33 33 01 a0 00 00 01 a0 00 00 - 39 00 05 e3 00 00 33 33 - 39 00 03 e4 44 44 - 39 00 11 e5 0c 30 a0 a0 0e 32 a0 a0 08 2c a0 a0 0a 2e a0 a0 - 39 00 05 e6 00 00 33 33 - 39 00 03 e7 44 44 - 39 00 11 e8 0d 31 a0 a0 0f 33 a0 a0 09 2d a0 a0 0b 2f a0 a0 - 39 00 08 eb 00 01 e4 e4 44 88 00 - 39 00 11 ed ff f5 47 6f 0b a1 a2 bf fb 2a 1a b0 f6 74 5f ff - 39 00 07 ef 08 08 08 40 3f 64 - 39 00 06 ff 77 01 00 00 13 - 39 00 03 e8 00 0e - 39 00 06 ff 77 01 00 00 00 - 39 ff 01 11 - 39 00 06 ff 77 01 00 00 13 - 39 ff 03 e8 00 0c - 39 00 03 e8 00 00 - 39 00 06 ff 77 01 00 00 00 - 39 00 02 3a 50 - 39 ff 01 29 - ]; + panel-width-mm = <480>; + panel-height-mm = <800>; + panel-dsi-lane = <2>; - display-timings { - timing-0 { - clock-frequency = <39600000>; - hactive = <480>; - vactive = <800>; - hfront-porch = <80>; - hback-porch = <20>; - hsync-len = <20>; - vfront-porch = <220>; - vback-porch = <70>; - vsync-len = <10>; + panel-init-sequence = [ + 39 00 06 ff 77 01 00 00 13 + 39 00 02 ef 08 + 39 00 06 ff 77 01 00 00 10 + 39 00 03 c0 63 00 + 39 00 03 c1 10 02 + 39 00 03 c2 31 02 + 39 00 02 cc 10 + 39 00 11 b0 c0 0c 92 0c 10 05 02 0d 07 21 04 53 11 6a 32 1f + 39 00 11 b1 c0 87 cf 0c 10 06 00 03 08 1d 06 54 12 e6 ec 0f + 39 00 06 ff 77 01 00 00 11 + 39 00 02 b0 5d + 39 00 02 b1 62 + 39 00 02 b2 82 + 39 00 02 b3 80 + 39 00 02 b5 42 + 39 00 02 b7 85 + 39 00 02 b8 20 + 39 00 02 c0 09 + 39 00 02 c1 78 + 39 00 02 c2 78 + 39 00 02 d0 88 + 39 ff 02 ee 42 + 39 00 04 e0 00 00 02 + 39 00 0c e1 04 a0 06 a0 05 a0 07 a0 00 44 44 + 39 00 0d e2 00 00 33 33 01 a0 00 00 01 a0 00 00 + 39 00 05 e3 00 00 33 33 + 39 00 03 e4 44 44 + 39 00 11 e5 0c 30 a0 a0 0e 32 a0 a0 08 2c a0 a0 0a 2e a0 a0 + 39 00 05 e6 00 00 33 33 + 39 00 03 e7 44 44 + 39 00 11 e8 0d 31 a0 a0 0f 33 a0 a0 09 2d a0 a0 0b 2f a0 a0 + 39 00 08 eb 00 01 e4 e4 44 88 00 + 39 00 11 ed ff f5 47 6f 0b a1 a2 bf fb 2a 1a b0 f6 74 5f ff + 39 00 07 ef 08 08 08 40 3f 64 + 39 00 06 ff 77 01 00 00 13 + 39 00 03 e8 00 0e + 39 00 06 ff 77 01 00 00 00 + 39 ff 01 11 + 39 00 06 ff 77 01 00 00 13 + 39 ff 03 e8 00 0c + 39 00 03 e8 00 00 + 39 00 06 ff 77 01 00 00 00 + 39 00 02 3a 50 + 39 ff 01 29 + ]; + + display-timings { + timing-0 { + clock-frequency = <39600000>; + hactive = <480>; + vactive = <800>; + hfront-porch = <80>; + hback-porch = <20>; + hsync-len = <20>; + vfront-porch = <220>; + vback-porch = <70>; + vsync-len = <10>; + }; + }; + + ports { + #address-cells = <1>; + #size-cells = <0>; }; }; }; diff --git a/arch/riscv/boot/dts/canaan/k230-canmv-lcd.dts b/arch/riscv/boot/dts/canaan/k230-canmv-lcd.dts new file mode 100644 index 0000000000000..77b11fc037e2d --- /dev/null +++ b/arch/riscv/boot/dts/canaan/k230-canmv-lcd.dts @@ -0,0 +1,83 @@ +// SPDX-License-Identifier: GPL-2.0 OR MIT +/* + * Copyright (C) 2024 Yangyu Chen + */ + +#include "k230.dtsi" +#include "display-st7701-480x800.dtsi" + +/ { + model = "Canaan CanMV-K230"; + compatible = "canaan,canmv-k230", "canaan,kendryte-k230"; + + aliases { + serial3 = &uart3; + }; + + chosen { + stdout-path = "serial0:115200n8"; + }; + + ddr: memory@0 { + device_type = "memory"; + reg = <0x0 0x0 0x0 0x20000000>; + }; +}; + +&uart0 { + status = "okay"; +}; +&uart3 { + status = "okay"; +}; +&mmc_sd1{ + status = "okay"; + no-1-8-v; + cap-sd-highspeed; + mshc_ctrl_r = <0x00>; +}; + +&usb0 { + status = "okay"; +}; +&usb1 { + status = "okay"; +}; + +&i2c3 { + status = "okay"; +}; + +&i2c4 { + status = "okay"; + touchscreen@38 { + compatible = "edt,edt-ft5306"; + reg = <0x38>; + reset-gpios = <&gpio0_ports 21 GPIO_ACTIVE_LOW>; + interrupt-parent = <&gpio0_ports>; + interrupts = <22 IRQ_TYPE_EDGE_FALLING>; + }; +}; +&dsi { + ports { + port@1 { + reg = <1>; + dsi_out_st7701: endpoint { + remote-endpoint = <&st7701_in>; + }; + }; + }; +}; + +&lcd { + dsi_reset-gpios = <&gpio0_ports 20 GPIO_ACTIVE_HIGH>; + backlight_gpio-gpios = <&gpio0_ports 25 GPIO_ACTIVE_HIGH>; + ports { + port@0 { + reg = <0>; + st7701_in: endpoint { + remote-endpoint = <&dsi_out_st7701>; + }; + }; + }; +}; diff --git a/arch/riscv/boot/dts/canaan/k230-canmv.dts b/arch/riscv/boot/dts/canaan/k230-canmv.dts index a08a8fc8494b1..01da0a2a14dfe 100644 --- a/arch/riscv/boot/dts/canaan/k230-canmv.dts +++ b/arch/riscv/boot/dts/canaan/k230-canmv.dts @@ -4,7 +4,6 @@ */ #include "k230.dtsi" -#include "display-st7701-480x800.dtsi" / { model = "Canaan CanMV-K230"; @@ -50,16 +49,58 @@ &i2c4 { status = "okay"; - touchscreen@38 { - compatible = "edt,edt-ft5306"; - reg = <0x38>; - reset-gpios = <&gpio0_ports 21 GPIO_ACTIVE_LOW>; - interrupt-parent = <&gpio0_ports>; - interrupts = <22 IRQ_TYPE_EDGE_FALLING>; + + lt9611: hdmi-bridge@3b { + compatible = "lontium,lt9611"; + reg = <0x3b>; + reset-gpios = <&gpio1_ports 10 GPIO_ACTIVE_HIGH>; + interrupt-parent = <&gpio1_ports>; + interrupts = <11 IRQ_TYPE_EDGE_FALLING>; + ports { + #address-cells = <1>; + #size-cells = <0>; + port@1 { + reg = <1>; + lt9611_in: endpoint { + remote-endpoint = <&dsi_out_lt9611>; + }; + }; + + port@2 { + reg = <2>; + lt9611_out: endpoint { + remote-endpoint = <&hdmi_connector_in>; + }; + }; + }; + }; +}; + +&dsi { + ports { + port@1 { + reg = <1>; + dsi_out_lt9611: endpoint { + remote-endpoint = <<9611_in>; + }; + }; + }; +}; + +/ { + hdmi: connector { + compatible = "hdmi-connector"; + label = "hdmi"; + type = "a"; + + port { + hdmi_connector_in: endpoint { + remote-endpoint = <<9611_out>; + }; + }; }; }; -&lcd { - dsi_reset-gpios = <&gpio0_ports 20 GPIO_ACTIVE_HIGH>; - backlight_gpio-gpios = <&gpio0_ports 25 GPIO_ACTIVE_HIGH>; +&vo { + vth_line = <10>; }; diff --git a/arch/riscv/boot/dts/canaan/k230.dtsi b/arch/riscv/boot/dts/canaan/k230.dtsi index 34c610d00f8d5..0f5b37f4f1057 100644 --- a/arch/riscv/boot/dts/canaan/k230.dtsi +++ b/arch/riscv/boot/dts/canaan/k230.dtsi @@ -585,11 +585,15 @@ status = "okay"; background = <0xffffff>; - vth_line = <11>; + vth_line = <10>; vo_out: port { #address-cells = <1>; #size-cells = <0>; + vop_out_dsi: endpoint@1 { + reg = <0>; + remote-endpoint = <&dsi_in_vop>; + }; }; }; @@ -600,9 +604,16 @@ #size-cells = <0>; status = "okay"; - lcd: panel@0 { - compatible = "canaan,universal"; - reg = <0>; + ports { + #address-cells = <1>; + #size-cells = <0>; + + port@0 { + reg = <0>; + dsi_in_vop: endpoint { + remote-endpoint = <&vop_out_dsi>; + }; + }; }; }; diff --git a/arch/riscv/configs/k230_defconfig b/arch/riscv/configs/k230_defconfig index 816e7e26d8fa5..5154cb7feb819 100644 --- a/arch/riscv/configs/k230_defconfig +++ b/arch/riscv/configs/k230_defconfig @@ -295,3 +295,5 @@ CONFIG_MEDIA_SUPPORT=y CONFIG_MEDIA_PLATFORM_SUPPORT=y CONFIG_V4L_PLATFORM_DRIVERS=y CONFIG_VPU_CANAAN=y +CONFIG_DRM_DISPLAY_CONNECTOR=y +CONFIG_DRM_LONTIUM_LT9611=y diff --git a/drivers/gpu/drm/canaan/canaan_dsi.c b/drivers/gpu/drm/canaan/canaan_dsi.c index 582a8d6e305d1..cebb0e827c2d2 100644 --- a/drivers/gpu/drm/canaan/canaan_dsi.c +++ b/drivers/gpu/drm/canaan/canaan_dsi.c @@ -6,6 +6,8 @@ * */ +#include "drm/drm_bridge.h" +#include "drm/drm_of.h" #include #include #include @@ -69,8 +71,8 @@ #define TXPHY_445_5_VOC (0x17) #define TXPHY_445_5_HS_FREQ (0x96) -#define TXPHY_891_M (165) -#define TXPHY_891_N (8) +#define TXPHY_891_M (295) +#define TXPHY_891_N (15) #define TXPHY_891_VOC (0x09) #define TXPHY_891_HS_FREQ (0x96) @@ -331,14 +333,25 @@ static void canaan_dsi_encoder_enable(struct drm_encoder *encoder) dsi->phy_freq = 445500; dsi->clk_freq = 74250; break; - case 148500: + case 148500: { // 144.5M + void *dis_clk = ioremap(0x91100000, 0x1000); + u32 reg = 0; + u32 div = 3; + + reg = readl(dis_clk + 0x78); + reg = (reg & ~(GENMASK(10, 3))) | + (div << 3); // 8M = pll1(2376) / 4 / 66 + reg = reg | (1 << 31); + writel(reg, dis_clk + 0x78); + k230_dsi_config_4lan_phy(dsi, TXPHY_891_M, TXPHY_891_N, TXPHY_891_VOC, TXPHY_891_HS_FREQ); // set clk todo dsi->phy_freq = 890666; dsi->clk_freq = 14850; break; + } case 39600: { void *dis_clk = ioremap(0x91100000, 0x1000); u32 reg = 0; @@ -410,8 +423,10 @@ static void canaan_dsi_encoder_disable(struct drm_encoder *encoder) static int canaan_dsi_get_modes(struct drm_connector *connector) { struct canaan_dsi *dsi = connector_to_canaan_dsi(connector); - - return drm_panel_get_modes(dsi->panel, connector); + if (dsi->panel) + return drm_panel_get_modes(dsi->panel, connector); + else + return drm_bridge_get_modes(dsi->bridge, connector); } static const struct drm_connector_helper_funcs @@ -424,7 +439,7 @@ canaan_dsi_connector_detect(struct drm_connector *connector, bool force) { struct canaan_dsi *dsi = connector_to_canaan_dsi(connector); - return dsi->panel ? connector_status_connected : + return (dsi->panel || dsi->bridge) ? connector_status_connected : connector_status_disconnected; } @@ -446,13 +461,8 @@ static int canaan_dsi_attach(struct mipi_dsi_host *host, struct mipi_dsi_device *device) { struct canaan_dsi *dsi = host_to_canaan_dsi(host); - struct drm_panel *panel = of_drm_find_panel(device->dev.of_node); - - if (IS_ERR(panel)) - return PTR_ERR(panel); dsi->connector.status = connector_status_connected; - dsi->panel = panel; dsi->device = device; dev_info(host->dev, "Attached device %s\n", device->name); @@ -467,6 +477,7 @@ static int canaan_dsi_detach(struct mipi_dsi_host *host, dsi->panel = NULL; dsi->device = NULL; + dsi->bridge = NULL; return 0; } @@ -524,19 +535,28 @@ static int canaan_dsi_bind(struct device *dev, struct device *master, } dsi->encoder.possible_crtcs = BIT(0); - drm_connector_helper_add(&dsi->connector, - &canaan_dsi_connector_helper_funcs); - ret = drm_connector_init(drm, &dsi->connector, - &canaan_dsi_connector_funcs, - DRM_MODE_CONNECTOR_DSI); - if (ret) { - dev_err(dsi->dev, "Couldn't initialise the DSI connector\n"); - goto err_cleanup_connector; - } + dsi->drm = drm; - drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); + ret = drm_of_find_panel_or_bridge(dsi->dev->of_node, 1, -1, &dsi->panel, &dsi->bridge); + if (!dsi->panel && !dsi->bridge) + return ret; - dsi->drm = drm; + if (dsi->panel) { + drm_connector_helper_add(&dsi->connector, + &canaan_dsi_connector_helper_funcs); + ret = drm_connector_init(dsi->drm, &dsi->connector, + &canaan_dsi_connector_funcs, + DRM_MODE_CONNECTOR_DSI); + if (ret) { + dev_err(dsi->dev, "Couldn't initialise the DSI connector\n"); + goto err_cleanup_connector; + } + + drm_connector_attach_encoder(&dsi->connector, &dsi->encoder); + } + + if (dsi->bridge) + drm_bridge_attach(&dsi->encoder, dsi->bridge, NULL, DRM_BRIDGE_ATTACH_NO_CONNECTOR); return 0; @@ -565,7 +585,6 @@ static int canaan_dsi_probe(struct platform_device *pdev) struct resource *res; int ret; - dev_info(&pdev->dev, "probe\n"); dsi = devm_kzalloc(dev, sizeof(*dsi), GFP_KERNEL); if (!dsi) return -ENOMEM; diff --git a/drivers/gpu/drm/canaan/canaan_dsi.h b/drivers/gpu/drm/canaan/canaan_dsi.h index 6f91ab36d98bb..cfc3f51d8ad13 100644 --- a/drivers/gpu/drm/canaan/canaan_dsi.h +++ b/drivers/gpu/drm/canaan/canaan_dsi.h @@ -29,6 +29,7 @@ struct canaan_dsi { struct mipi_dsi_device *device; struct drm_device *drm; struct drm_panel *panel; + struct drm_bridge *bridge; void __iomem *base; u32 phy_freq; diff --git a/drivers/gpu/drm/canaan/canaan_vo.c b/drivers/gpu/drm/canaan/canaan_vo.c index db1ae9daba064..86c8c3cb2449a 100644 --- a/drivers/gpu/drm/canaan/canaan_vo.c +++ b/drivers/gpu/drm/canaan/canaan_vo.c @@ -453,22 +453,22 @@ static void canaan_vo_set_timing(struct canaan_vo *vo, vtotal = mode->vtotal; // 0 - 12 start ; 16 - 28 end - reg = (0x2 << 16) + 0x1; + reg = (0x5 << 16) + 0x2; canaan_vo_write(vo, VO_DISP_HSYNC_CTL, reg); - reg = (0x6 << 16) + 0x5; + reg = (0x5 << 16) + 0x2; canaan_vo_write(vo, VO_DISP_HSYNC1_CTL, reg); - reg = (0x5 << 16) + 0x1; + reg = (0x5 << 16) + 0x2; canaan_vo_write(vo, VO_DISP_HSYNC2_CTL, reg); - reg = (0x1 << 16) + 0x1; + reg = (0x0 << 16) + 0x0; canaan_vo_write(vo, VO_DISP_VSYNC1_CTL, reg); - reg = (0x1 << 16) + 0x1; + reg = (0x0 << 16) + 0x0; canaan_vo_write(vo, VO_DISP_VSYNC2_CTL, reg); - reg = (5 + hsa + hbp + 1) + (((hact + (5 + hsa + hbp + 1)) - 1) << 16); + reg = (hbp) + ((hact + hbp - 1) << 16); canaan_vo_write(vo, VO_DISP_XZONE_CTL, reg); // set yzone