drm/i915/dmc: check incoming dmc id validity
authorJani Nikula <jani.nikula@intel.com>
Thu, 2 Feb 2023 12:04:52 +0000 (14:04 +0200)
committerJani Nikula <jani.nikula@intel.com>
Thu, 2 Feb 2023 19:34:21 +0000 (21:34 +0200)
commit247c7a4cdad87564da49a7879aca2f0653689502
treeb3b76f3659025ffd7deee9c360eb250224e904a9
parentda97065e4692247767d2a7f2850d193eb2f65229
drm/i915/dmc: check incoming dmc id validity

Add validity checks for the dmc ids computed from pipe parameters in
intel_dmc_enable_pipe() and intel_dmc_disable_pipe(). It's slightly
difficult for humans and static analyzers alike to ensure the resulting
dmc ids are within bounds. Just check them and reject invalid ones.

Signed-off-by: Jani Nikula <jani.nikula@intel.com>
Reviewed-by: Imre Deak <imre.deak@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/6a349c3a2b2def5fc31a48c9844ebd72ee55a22b.1675339447.git.jani.nikula@intel.com
drivers/gpu/drm/i915/display/intel_dmc.c