Intel-XE Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] drm/i915/display: Skip unavailable power wells based on pipe mask
@ 2025-07-17  5:16 Chaitanya Kumar Borah
  2025-07-17  5:39 ` ✗ CI.checkpatch: warning for " Patchwork
                   ` (4 more replies)
  0 siblings, 5 replies; 14+ messages in thread
From: Chaitanya Kumar Borah @ 2025-07-17  5:16 UTC (permalink / raw)
  To: intel-xe, intel-gfx
  Cc: gustavo.sousa, dnyaneshwar.bhadane, dibin.moolakadan.subrahmanian,
	imre.deak

Some power wells are only relevant for certain display pipes. Add a check
to ensure we only allocate and initialize power wells whose associated
pipes are available on the platform.

This avoids unnecessary mapping of power wells, particularly when platforms
support a subset of pipes described in the power well descriptors.

Suggested-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Chaitanya Kumar Borah <chaitanya.kumar.borah@intel.com>
---
 .../i915/display/intel_display_power_map.c    | 19 +++++++++++++++++--
 1 file changed, 17 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power_map.c b/drivers/gpu/drm/i915/display/intel_display_power_map.c
index 77268802b55e..ca73e4084354 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power_map.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power_map.c
@@ -1748,6 +1748,16 @@ static void init_power_well_domains(const struct i915_power_well_instance *inst,
 		for_each_power_well_instance_in_desc_list((_descs)->list, (_descs)->count, \
 							  (_desc), (_inst))
 
+static bool
+is_power_well_available(struct intel_display *display, const struct i915_power_well_desc *desc)
+{
+	if (desc->irq_pipe_mask &&
+	    !(desc->irq_pipe_mask & DISPLAY_RUNTIME_INFO(display)->pipe_mask))
+		return false;
+
+	return true;
+}
+
 static int
 __set_power_wells(struct i915_power_domains *power_domains,
 		  const struct i915_power_well_desc_list *power_well_descs,
@@ -1763,8 +1773,10 @@ __set_power_wells(struct i915_power_domains *power_domains,
 	int power_well_count = 0;
 	int plt_idx = 0;
 
-	for_each_power_well_instance(power_well_descs, power_well_descs_sz, desc_list, desc, inst)
-		power_well_count++;
+	for_each_power_well_instance(power_well_descs, power_well_descs_sz, desc_list, desc, inst) {
+		if (is_power_well_available(display, desc))
+			power_well_count++;
+	}
 
 	power_domains->power_well_count = power_well_count;
 	power_domains->power_wells =
@@ -1778,6 +1790,9 @@ __set_power_wells(struct i915_power_domains *power_domains,
 		struct i915_power_well *pw = &power_domains->power_wells[plt_idx];
 		enum i915_power_well_id id = inst->id;
 
+		if (!is_power_well_available(display, desc))
+			continue;
+
 		pw->desc = desc;
 		drm_WARN_ON(display->drm,
 			    overflows_type(inst - desc->instances->list, pw->instance_idx));
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 14+ messages in thread

end of thread, other threads:[~2025-07-21 16:22 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-07-17  5:16 [PATCH] drm/i915/display: Skip unavailable power wells based on pipe mask Chaitanya Kumar Borah
2025-07-17  5:39 ` ✗ CI.checkpatch: warning for " Patchwork
2025-07-17  5:41 ` ✓ CI.KUnit: success " Patchwork
2025-07-17  7:09 ` ✓ Xe.CI.BAT: " Patchwork
2025-07-17 12:02 ` [PATCH] " Gustavo Sousa
2025-07-18 15:54   ` Imre Deak
2025-07-18 16:33     ` Gustavo Sousa
2025-07-18 17:17       ` Imre Deak
2025-07-18 20:16         ` Gustavo Sousa
2025-07-19 10:37           ` Imre Deak
2025-07-21 14:17             ` Gustavo Sousa
2025-07-21 15:17             ` Borah, Chaitanya Kumar
2025-07-21 16:21               ` Imre Deak
2025-07-18  8:46 ` ✗ Xe.CI.Full: failure for " Patchwork

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox