drm: sun4i: hdmi: Remove extra HPD polling
Chen-Yu Tsai
maintainerPATCH 1/1 drm: sun4i: hdmi: Remove extra HPD polling
From: Chen-Yu Tsai <[email protected]>
The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more or less an input-only GPIO. Other GPIO-based HPD implementations directly return the current state, instead of polling for a specific state and returning the other if that times out.
Remove the I/O polling from sun4i_hdmi_connector_detect() and directly return a known state based on the current reading. This also gets rid of excessive CPU usage by kworker as reported on Stack Exchange [1] and Armbian forums [2].
[1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi
[2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/
--- drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c +2 -3
@@ -259,9 +259,8 @@ sun4i_hdmi_connector_detect(struct drm_connector *connector, bool force)struct sun4i_hdmi *hdmi =drm_connector_to_sun4i_hdmi (connector);unsigned long reg; -if (readl_poll_timeout (hdmi->base +SUN4I_HDMI_HPD_REG , reg, - reg &SUN4I_HDMI_HPD_HIGH , -0 ,500000 )) { + reg =readl (hdmi->base +SUN4I_HDMI_HPD_REG ); +if (reg &SUN4I_HDMI_HPD_HIGH ) {cec_phys_addr_invalidate (hdmi->cec_adap);return connector_status_disconnected; }
Signature · 6 lines
2.27.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel
Maxime Ripard
AppliedHi,
Quoted 12 lines · Chen-Yu Tsai
From: Chen-Yu Tsai <[email protected]>
The HPD sense mechanism in Allwinner's old HDMI encoder hardware is more or less an input-only GPIO. Other GPIO-based HPD implementations directly return the current state, instead of polling for a specific state and returning the other if that times out.
Remove the I/O polling from
sun4i_hdmi_connector_detect()and directly return a known state based on the current reading. This also gets rid of excessive CPU usage by kworker as reported on Stack Exchange [1] and Armbian forums [2].
Quoted 5 lines
[1] https://superuser.com/questions/1515001/debian-10-buster-on-cubietruck-with-bug-in-sun4i-drm-hdmi
[2] https://forum.armbian.com/topic/14282-headless-systems-and-sun4i_drm_hdmi-a10a20/Fixes 9c5681011a0c ("drm/sun4i: Add HDMI support")Signed-off-by Chen-Yu Tsai <[email protected]>
Applied, thanks for figuring that out
Maxime