drm/stm: ltdc: add mode_valid()
authorPhilippe CORNU <philippe.cornu@st.com>
Tue, 17 Apr 2018 11:40:26 +0000 (13:40 +0200)
committerPhilippe Cornu <philippe.cornu@st.com>
Fri, 27 Apr 2018 08:58:06 +0000 (10:58 +0200)
commit0cefff963bf2af9ec9b2e2b537c3d3e6a43ceb9b
tree4814e894220e54da2e3e13a9bab0b5a4d0b0554d
parentc2af73645d3a67cc2e4a750179048a4c6d5110a1
drm/stm: ltdc: add mode_valid()

Add mode_valid() function to filter modes according to available
pll clock values and "preferred" modes. It is particularly
useful for hdmi modes that require precise pixel clocks.

Note that "preferred" modes are always accepted:
- this is important for panels because panel clock tolerances are
  bigger than hdmi ones and there is no reason to not accept them
  (the fps may vary a little but it is not a problem).
- the hdmi preferred mode will be accepted too, but userland will
  be able to use others hdmi "valid" modes if necessary.

Signed-off-by: Philippe Cornu <philippe.cornu@st.com>
Reviewed-by: Yannick Fertré <yannick.fertre@st.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180417114026.8709-1-philippe.cornu@st.com
drivers/gpu/drm/stm/ltdc.c