[PATCH 05/19] drm/i915/display: Validate target DC state against allowed_dc_mask

Dibin Moolakadan Subrahmanian
2026-03-26T17:15:31Z

Validate the requested target DC state against allowed_dc_mask to
avoid programming unsupported DC states.

Signed-off-by: Dibin Moolakadan Subrahmanian <dibin.moolakadan.subrahmanian@intel.com>
---
drivers/gpu/drm/i915/display/intel_display_power.c | 7 +++++++
1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
index 0afae5c2f62b..12967db27c8d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power.c
@@ -302,6 +302,13 @@ void intel_display_power_set_target_dc_state(struct intel_display *display,
struct i915_power_domains *power_domains = &display->power.domains;

mutex_lock(&power_domains->lock);
+
+ if ((state & power_domains->allowed_dc_mask) != state) {
+ drm_dbg_kms(display->drm,
+ "Rejecting DC state 0x%x (allowed mask 0x%x)\n",
+ state, power_domains->allowed_dc_mask);
+ goto unlock;
+ }
power_well = lookup_power_well(display, SKL_DISP_DC_OFF);

if (drm_WARN_ON(display->drm, !power_well))
--
2.43.0