]> git.baikalelectronics.ru Git - kernel.git/commit
drm/sun4i: validate modes for HDMI
authorHans Verkuil <hverkuil@xs4all.nl>
Fri, 15 Dec 2017 15:21:50 +0000 (16:21 +0100)
committerMaxime Ripard <maxime.ripard@free-electrons.com>
Fri, 15 Dec 2017 21:24:03 +0000 (22:24 +0100)
commit20028a86a6df86d1e748931ce834d456fd77ecd3
tree65b7874cc1664af83df979e728ea7658dc9c8812
parent94cfd8046681c74f9a3aa55bdb26ba4c13742351
drm/sun4i: validate modes for HDMI

When I connected my cubieboard running 4.15-rc1 to my 4k display I got no
picture. Some digging found that there is no check against the upper
pixelclock limit of the HDMI output, so X selects a 4kp60 format at 594
MHz, which obviously won't work.

The patch below adds a check for the upper bound of what this hardware can
do, and it checks if the requested tmds clock can be obtained.

It also allows for the +/- 0.5% pixel clock variation that the HDMI spec permits.

That code is based on commit 5782966ed3eb ("drm: arcpgu: Allow some clock
deviation in crtc->mode_valid() callback") from Jose Abreu for drm/arc.

Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com>
Thanks-to: Jose Abreu <Jose.Abreu@synopsys.com>
Signed-off-by: Maxime Ripard <maxime.ripard@free-electrons.com>
Link: https://patchwork.freedesktop.org/patch/msgid/162854cb-c7bd-d9ce-9fa0-9a6cd89c621b@xs4all.nl
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c