drm/i915: Allow arbitrary refresh rates with VRR eDP panels
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 4 Apr 2023 17:54:29 +0000 (20:54 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 13 Apr 2023 18:02:16 +0000 (21:02 +0300)
commita2da67028cd05516343533c1609fcaf037237fed
tree5613ccfe64e062edafb967e5b00c5269921f2235
parente39c76b2160bbd005587f978d29603ef790aefcd
drm/i915: Allow arbitrary refresh rates with VRR eDP panels

If the panel supports VRR it must be capable of accepting
timings with arbitrary vblank length, within the valid VRR
range. Use that fact to allow the user to request any refresh
rate they like. We simply pick the next highest fixed mode
from our list, and adjust the vblank to get the desired refresh
rate in the end.

Of course currently everything to do with the vrefresh is
using 1Hz precision, so might not be exact. But we can improve
that in the future by just upping our vrefresh precision.

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230404175431.23064-1-ville.syrjala@linux.intel.com
Reviewed-by: Mitul Golani <mitulkumar.ajitkumar.golani@intel.com>
drivers/gpu/drm/i915/display/intel_panel.c