rk3566 HDMI hot plug HDMI shows no signal

environment:

rk3566 android11

kernel kernel version, 4.19.172

Problem Description:

        Problems related to hdmi hot plugging, when plugged into the HDMI system, the system starts up and runs normally, the HDMI display is normal, and there is no problem with hot plugging, when the system is started without the HDMI port, plug the HDMI display port into it The HDMI display has no signal, and cannot be hot-plugged, and the screen cannot be displayed normally. After the system starts for a while, plug in the HDMI and then plug in the HDMI to display normally, and it can be hot-swapped.

problem analysis:

        First of all, we can ensure that our HDMI display driver is no problem, because our HDMI can be displayed normally, then consider the problem of hot plugging, and whether the detection of HDMI interrupt insertion pin has changed, and whether it can detect the change of our HDMI insertion , and then consider the hardware circuit problem. It checks the above conjectures one by one.

Problem solving ideas:

        From the above judgment, it can be confirmed that there is no problem with the display part of the HDMI driver. By communicating with the hardware and using the oscilloscope to measure the interrupt pin, when the HDMI is plugged in and pulled out, the level of the HDMI interrupt pin changes, and when the HDMI is plugged in, it is high. level, unplugged for low level. The analysis shows that the booting system with HDMI inserted is exactly the same as the kernel without HDMI inserted at startup, and the related logs of HDMI are exactly the same, no error is reported, and the HDMI initialization is normal. . . . . . , To be honest, I feel a little speechless, unable to start to solve the problem, but there is no way to continue to wait for the delivery, and I suddenly found: (Key point) There are many external display interfaces in this project, including edp, hdmi, mipi, lvds display interface, and rk3566 has only one display controller, that is, VOP, RK356X platform has only one VOP, but separates out different PORTs, RK3566 has 2 PORTs, namely VP0 and VP1. And my project uses edp and HDMI display through VP0, while MIPI and LVDS use VP1. And this is the problem of multi-screen preemption and hot swap design. And our article is caused by this problem. I found that my edp screen is always connected no matter whether it is plugged in or unplugged. When multi-screen preemption, the priority of EDP setting is set to the highest. Even if we plug in the HDMI and there is no signal output, the above problem can be explained, and when the power is initialized, when the HDMI is plugged in, the system will load the HDMI display module first, so the HDMI will be displayed and in the connected state.

 Multi-screen preemption and hot swap analysis:

        

display_subsystem: display-subsystem {
		compatible = "rockchip,display-subsystem";
		memory-region = <&drm_logo>, <&drm_cubic_lut>;
		memory-region-names = "drm-logo", "drm-cubic-lut";
		ports = <&vop_out>;
		devfreq = <&dmc>;

		route {
			route_dsi0: route-dsi0 {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp0_out_dsi0>;
			};
			route_dsi1: route-dsi1 {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp0_out_dsi1>;
			};
			route_hdmi: route-hdmi {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp1_out_hdmi>;
			};
			route_lvds: route-lvds {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp1_out_lvds>;
			};
			route_edp: route-edp {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp0_out_edp>;
			};
			route_rgb: route-rgb {
				status = "disabled";
				logo,uboot = "logo.bmp";
				logo,kernel = "logo_kernel.bmp";
				logo,mode = "center";
				charge_logo,mode = "center";
				connect = <&vp2_out_rgb>;
			};
		};
	};

Preemption:
The nodes of the route have a sequence priority relationship. As above, route_hdmi is before route_mipi, and they all use vopb as the display output. When hdmi and mipi are connected at the same time, hdmi will first snatch vopb, so that mipi will allocate There is no more vop, and the phenomenon is: hdmi is displayed, but mipi is not displayed.
Hot-swapping:
        As can be seen from the preemptive content above, when hdmi is plugged in, the phenomenon is that hdmi is displayed, but mipi is not displayed. But when hdmi is in the unplugged state, the route_hdmi will not work, that is, it can be realized; hdmi is not displayed, mipi is not displayed Display. In this way, the same configuration is achieved. The state of the path during startup is different between plugging in hdmi and unplugging hdmi. Here we set the preemption priority of hdmi to the highest.

        Another important configuration port is the gpio attribute of edp (hpd-gpios).

hpd-gpios For Box-to-box Connection, the HPD function is generally required, and this property needs to be configured.

&edp {
	 status = "okay";
	 //force-hpd;
	 hpd-gpios = <&gpio4 RK_PC4 GPIO_ACTIVE_HIGH>;
	 ports {
		port@1 {
			reg = <1>;
			edp_out_edp: endpoint {
				remote-endpoint = <&panel_in_edp>;
			};
		};
	};
};

Compile and download, the problem is solved! !

IBOX66:/d/dri/0 # cat summary   //该目录下可查看显示连接状态                                                                                                                                                                            
Video Port0: DISABLED
Video Port1: ACTIVE
    Connector: LVDS-1
	bus_format[1011]: RGB888_1X7X4_SPWG
	overlay_mode[0] output_mode[0] color_space[0]
    Display mode: 1280x800p60
	clk[71100] real_clk[71100] type[48] flag[a]
	H: 1280 1390 1400 1440
	V: 800 810 813 823
    Cluster0-win0: ACTIVE
	win_id: 0
	format: AB24 little-endian (0x34324241)[AFBC] SDR[0] color_space[0] glb_alpha[0xff]
	rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
	csc: y2r[0] r2y[0] csc mode[0]
	zpos: 0
	src: pos[0, 0] rect[1280 x 800]
	dst: pos[0, 0] rect[1280 x 800]
	buf[0]: addr: 0x00000000017fc000 pitch: 5120 offset: 0
    Esmart0-win0: ACTIVE
	win_id: 4
	format: AB24 little-endian (0x34324241) SDR[0] color_space[0] glb_alpha[0xff]
	rotate: xmirror: 0 ymirror: 0 rotate_90: 0 rotate_270: 0
	csc: y2r[0] r2y[0] csc mode[0]
	zpos: 1
	src: pos[0, 0] rect[1280 x 48]
	dst: pos[0, 0] rect[1280 x 48]
	buf[0]: addr: 0x0000000000bd8000 pitch: 5120 offset: 0
Video Port2: DISABLED

Guess you like

Origin blog.csdn.net/qq_48709036/article/details/125265532