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

Shankar, Uma
2026-04-13T21:04:56Z

> -----Original Message-----
> From: Dibin Moolakadan Subrahmanian
> <dibin.moolakadan.subrahmanian@intel.com>
> Sent: Thursday, March 26, 2026 10:46 PM
> To: intel-gfx@lists.freedesktop.org; intel-xe@lists.freedesktop.org
> Cc: Manna, Animesh <animesh.manna@intel.com>; Shankar, Uma
> <uma.shankar@intel.com>; Kurmi, Suresh Kumar
> <suresh.kumar.kurmi@intel.com>
> Subject: [PATCH 05/19] drm/i915/display: Validate target DC state against
> allowed_dc_mask
>
> Validate the requested target DC state against allowed_dc_mask to avoid
> programming unsupported DC states.

Looks Good to me.
Reviewed-by: Uma Shankar <uma.shankar@intel.com>

> 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