drm/i915: Replace wm.max_levels with wm.num_levels and use it everywhere
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 9 Feb 2023 22:25:04 +0000 (00:25 +0200)
committerJani Nikula <jani.nikula@intel.com>
Fri, 10 Feb 2023 10:26:43 +0000 (12:26 +0200)
commit7ee6f99dbc45eb457c87241aac1067fef3f263d9
tree1a4699f34d973856848caf1e55755bcdea046625
parent064b3eee8e0260d8053b588c71a3f71b762cc0f3
drm/i915: Replace wm.max_levels with wm.num_levels and use it everywhere

Replaces wm.max_level with wm.num_levels, since that generally
results in nicer looking code (for-loops can be in standard
form etc.).

Also get rid of the two different wrappers we have for this
(ilk_wm_max_level() and intel_wm_num_levels()). They don't
really do anything for us other than potentially slow things
down if the compiler actually emits the function calls every
time (num_planes*num_wm_levels*higher_level_wm_function_calls
could be a big number). The watermark code already shows up
far too prominently in cpu profiles. Though I must admit that
I didn't look at the generated code this time.

v2: Fix the ilk_wm_merge() off-by-one (Jani)

Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230209222504.31478-1-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_display_core.h
drivers/gpu/drm/i915/display/intel_display_debugfs.c
drivers/gpu/drm/i915/display/skl_watermark.c
drivers/gpu/drm/i915/intel_pm.c
drivers/gpu/drm/i915/intel_pm.h