drm/i915: Decouple I915_NUM_PLLS from PLL IDs
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Tue, 3 Oct 2023 20:06:18 +0000 (23:06 +0300)
committerVille Syrjälä <ville.syrjala@linux.intel.com>
Wed, 4 Oct 2023 13:46:36 +0000 (16:46 +0300)
commit99e5a010e8153bf2454ceefe725fea5de72e7d64
treebed8e999f783ff7cc5b46d17a3cbe8aa019e6151
parent027c57017795de145b8800f00665aae9a313ab26
drm/i915: Decouple I915_NUM_PLLS from PLL IDs

Stop assuming the size of PLL ID based bitmask is restricted
to I915_NUM_PLLS bits. This is the last thing coupling the
two things together and thus artificially limiting PLL IDs.

We could just pass any arbitrary (large enough) size to
for_each_set_bit() and be done with it, but the WARN
requiring the caller to not pass in a bogus bitmask seems
potentially useful to keep around. So let's just calculate
the full bitmask on the spot.

And while at it let's assert that the PLL IDs will fit
into the bitmask we use for them.

TODO: could also get rid of I915_NUM_PLLS entirely and just
dynamically allocate i915->shared_dplls[] and state->shared_dpll[].
But that would involve error handling in the modeset init path. Uff.

v2: Warn about conflicting PLL IDs (Jani)

Reviewed-by: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20231003200620.11633-3-ville.syrjala@linux.intel.com
drivers/gpu/drm/i915/display/intel_dpll_mgr.c