Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [Intel-gfx] [PATCH 1/2] drm/i915/display: Group DC9 mask set
@ 2020-11-11 16:24 José Roberto de Souza
  2020-11-11 16:24 ` [Intel-gfx] [PATCH 2/2] drm/i915/display: Make get_allowed_dc_mask().max_dc set a chain of if and elses José Roberto de Souza
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: José Roberto de Souza @ 2020-11-11 16:24 UTC (permalink / raw)
  To: intel-gfx; +Cc: Lucas De Marchi

DC9 has a separate HW flow from the rest of the DC states and it is
available in GEN9 LP platforms and on GEN11 and newer, so here
moving the assignment of the mask to a single conditional block to
simplifly code.

Cc: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: Anusha Srivatsa <anusha.srivatsa@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
---
 .../gpu/drm/i915/display/intel_display_power.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
index 689922480661..48d41a43fbb2 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power.c
@@ -4497,26 +4497,24 @@ static u32 get_allowed_dc_mask(const struct drm_i915_private *dev_priv,
 			max_dc = 3;
 		else
 			max_dc = 4;
-		/*
-		 * DC9 has a separate HW flow from the rest of the DC states,
-		 * not depending on the DMC firmware. It's needed by system
-		 * suspend/resume, so allow it unconditionally.
-		 */
-		mask = DC_STATE_EN_DC9;
 	} else if (IS_GEN(dev_priv, 11)) {
 		max_dc = 2;
-		mask = DC_STATE_EN_DC9;
 	} else if (IS_GEN(dev_priv, 10) || IS_GEN9_BC(dev_priv)) {
 		max_dc = 2;
-		mask = 0;
 	} else if (IS_GEN9_LP(dev_priv)) {
 		max_dc = 1;
-		mask = DC_STATE_EN_DC9;
 	} else {
 		max_dc = 0;
-		mask = 0;
 	}
 
+	/*
+	 * DC9 has a separate HW flow from the rest of the DC states,
+	 * not depending on the DMC firmware. It's needed by system
+	 * suspend/resume, so allow it unconditionally.
+	 */
+	mask = IS_GEN9_LP(dev_priv) || INTEL_GEN(dev_priv) >= 11 ?
+	       DC_STATE_EN_DC9 : 0;
+
 	if (!dev_priv->params.disable_power_well)
 		max_dc = 0;
 
-- 
2.29.2

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

end of thread, other threads:[~2020-11-12 14:03 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-11-11 16:24 [Intel-gfx] [PATCH 1/2] drm/i915/display: Group DC9 mask set José Roberto de Souza
2020-11-11 16:24 ` [Intel-gfx] [PATCH 2/2] drm/i915/display: Make get_allowed_dc_mask().max_dc set a chain of if and elses José Roberto de Souza
2020-11-11 21:15   ` Lucas De Marchi
2020-11-11 19:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/2] drm/i915/display: Group DC9 mask set Patchwork
2020-11-11 21:12 ` [Intel-gfx] [PATCH 1/2] " Lucas De Marchi
2020-11-12 13:22   ` Souza, Jose
2020-11-11 21:57 ` [Intel-gfx] ✓ Fi.CI.IGT: success for series starting with [1/2] " Patchwork
2020-11-12 14:02   ` Souza, Jose

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