OSDN Git Service

drm/ingenic: Reset pixclock rate when parent clock rate changes
authorPaul Cercueil <paul@crapouillou.net>
Sat, 26 Sep 2020 17:04:55 +0000 (19:04 +0200)
committerPaul Cercueil <paul@crapouillou.net>
Sat, 26 Sep 2020 19:53:27 +0000 (21:53 +0200)
commit33700f6f7d9f6b4e1e6df933ef7fd388889c662c
tree2b5354b62e5e04df0b396f6f2281d1b45b0a4404
parentca6cf78322d1b84744dd2772546c0e8f8707c0ad
drm/ingenic: Reset pixclock rate when parent clock rate changes

Old Ingenic SoCs can overclock very well, up to +50% of their nominal
clock rate, whithout requiring overvolting or anything like that, just
by changing the rate of the main PLL. Unfortunately, all clocks on the
system are derived from that PLL, and when the PLL rate is updated, so
is our pixel clock.

To counter that issue, we make sure that the panel is in VBLANK before
the rate change happens, and we will then re-set the pixel clock rate
afterwards, once the PLL has been changed, to be as close as possible to
the pixel rate requested by the encoder.

v2: Add comment about mutex usage

Signed-off-by: Paul Cercueil <paul@crapouillou.net>
Reviewed-by: Sam Ravnborg <sam@ravnborg.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20200926170501.1109197-2-paul@crapouillou.net
drivers/gpu/drm/ingenic/ingenic-drm-drv.c