drm/i915/wm: add .get_hw_state to watermark funcs
authorJani Nikula <jani.nikula@intel.com>
Mon, 13 Feb 2023 19:59:59 +0000 (21:59 +0200)
committerJani Nikula <jani.nikula@intel.com>
Wed, 15 Feb 2023 10:00:50 +0000 (12:00 +0200)
commit0e7a16f9ddde61d7d65bae9c7ddda2e4a22cbc12
tree909fd4594df53870ccfb7570754b7ddf64cf5af6
parent284c5baa44218ef615ed8f5edcd6cfdedaef6abc
drm/i915/wm: add .get_hw_state to watermark funcs

Get rid of the if ladder in intel_modeset_setup_hw_state() and hide a
number of functions by adding a .get_hw_state() hook to watermark
functions. At least for now, combine the platform specific sanitization
to the hw state readouts on the relevant platforms instead of adding a
separate hook for that.

There's a functional change on PCH split platforms: If i9xx_wm_init()
fails to read plane latency and chooses the nop functions,
ilk_wm_get_hw_state() won't get called for readout. Add the
ilk_init_lp_watermarks() call on that path which now won't be called in
.get_hw_state(), as it looks like the only thing that could make a
difference.

v2:
- Add missing static (kernel test robot)

Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6da32831e40606cc8b90491b83196917f2ce36ab.1676317696.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/i9xx_wm.c
drivers/gpu/drm/i915/display/i9xx_wm.h
drivers/gpu/drm/i915/display/intel_display_core.h
drivers/gpu/drm/i915/display/intel_modeset_setup.c
drivers/gpu/drm/i915/display/intel_wm.c
drivers/gpu/drm/i915/display/intel_wm.h
drivers/gpu/drm/i915/display/skl_watermark.c
drivers/gpu/drm/i915/display/skl_watermark.h