* [PATCH v3 0/8] drm/i915: move more display dependencies from i915
@ 2026-04-20 10:30 Luca Coelho
2026-04-20 10:30 ` [PATCH v3 1/8] drm/i915: move SKL clock gating init to display Luca Coelho
` (7 more replies)
0 siblings, 8 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
This series continues my work of refactoring the clock gating
initialization, so that i915 doesn't do display-specific stuff.
With this, all register dependencies should be gone.
Changes in v3, mostly addressing Jani's comments:
* Changed the shared Gen9 display clock gating helper not to
include i915_drv.h, to_i915() and HAS_LLC();
* Kept SKL_DE_COMPRESSED_HASH_MODE out of the shared Gen9
helper and programmed it only from the SKL/KBL wrappers;
* Moved the remaining ILK display register definitions from
i915_reg.h to intel_display_regs.h;
* Removed i915_reg.h from intel_display_clock_gating.c;
* Replaced i915-only platform checks in display code with
display->platform.* checks;
Please review.
Cheers,
Luca.
Luca Coelho (8):
drm/i915: move SKL clock gating init to display
drm/i915: move KBL clock gating init to display
drm/i915/display: move CFL clock gating init to display
drm/i915/display: move BXT clock gating init to display
drm/i915/display: move GLK clock gating init to display
drm/i915/display: move HSW and BDW clock gating init to display
drm/i915/display: move pre-HSW clock gating init to display
drm/i915: remove HAS_PCH_NOP() dependency from clock gating
drivers/gpu/drm/i915/Makefile | 1 +
.../i915/display/intel_display_clock_gating.c | 255 ++++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 27 ++
.../gpu/drm/i915/display/intel_display_regs.h | 31 +++
drivers/gpu/drm/i915/i915_reg.h | 31 ---
drivers/gpu/drm/i915/intel_clock_gating.c | 226 ++--------------
6 files changed, 331 insertions(+), 240 deletions(-)
create mode 100644 drivers/gpu/drm/i915/display/intel_display_clock_gating.c
create mode 100644 drivers/gpu/drm/i915/display/intel_display_clock_gating.h
--
2.53.0
^ permalink raw reply [flat|nested] 13+ messages in thread
* [PATCH v3 1/8] drm/i915: move SKL clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 2/8] drm/i915: move KBL " Luca Coelho
` (6 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the SKL-specific display clock gating programming into a new file
inside display.
This removes dependency from intel_clock_gating.c to the display's
intel_pch.h file, so we can remove the include statement.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/gpu/drm/i915/Makefile | 1 +
.../i915/display/intel_display_clock_gating.c | 19 +++++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 13 +++++++++++++
drivers/gpu/drm/i915/intel_clock_gating.c | 8 ++------
4 files changed, 35 insertions(+), 6 deletions(-)
create mode 100644 drivers/gpu/drm/i915/display/intel_display_clock_gating.c
create mode 100644 drivers/gpu/drm/i915/display/intel_display_clock_gating.h
diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
index b677720a1c2d..63a9e16826a9 100644
--- a/drivers/gpu/drm/i915/Makefile
+++ b/drivers/gpu/drm/i915/Makefile
@@ -255,6 +255,7 @@ i915-y += \
display/intel_cursor.o \
display/intel_dbuf_bw.o \
display/intel_de.o \
+ display/intel_display_clock_gating.o \
display/intel_display.o \
display/intel_display_conversion.o \
display/intel_display_driver.o \
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
new file mode 100644
index 000000000000..4a94593335e0
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -0,0 +1,19 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright 2026 Intel Corporation
+ */
+
+#include <drm/intel/intel_gmd_misc_regs.h>
+
+#include "intel_de.h"
+#include "intel_display_clock_gating.h"
+#include "intel_display_regs.h"
+
+void intel_display_skl_init_clock_gating(struct intel_display *display)
+{
+ /*
+ * WaFbcTurnOffFbcWatermark:skl
+ * Display WA #0562: skl
+ */
+ intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
new file mode 100644
index 000000000000..00f416db7f47
--- /dev/null
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -0,0 +1,13 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright 2026 Intel Corporation
+ */
+
+#ifndef __INTEL_DISPLAY_CLOCK_GATING_H__
+#define __INTEL_DISPLAY_CLOCK_GATING_H__
+
+struct intel_display;
+
+void intel_display_skl_init_clock_gating(struct intel_display *display);
+
+#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index ee2489a2fbe7..454334fef5e7 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -31,9 +31,9 @@
#include "display/i9xx_plane_regs.h"
#include "display/intel_display.h"
+#include "display/intel_display_clock_gating.h"
#include "display/intel_display_core.h"
#include "display/intel_display_regs.h"
-#include "display/intel_pch.h"
#include "gt/intel_engine_regs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_mcr.h"
@@ -349,11 +349,7 @@ static void skl_init_clock_gating(struct drm_i915_private *i915)
/* WAC6entrylatency:skl */
intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
- /*
- * WaFbcTurnOffFbcWatermark:skl
- * Display WA #0562: skl
- */
- intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+ intel_display_skl_init_clock_gating(i915->display);
}
static void bdw_init_clock_gating(struct drm_i915_private *i915)
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 2/8] drm/i915: move KBL clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
2026-04-20 10:30 ` [PATCH v3 1/8] drm/i915: move SKL clock gating init to display Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 3/8] drm/i915/display: move CFL " Luca Coelho
` (5 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the KBL-specific display clock gating programming into a
display intel_display_clock_gating.c, to remove more dependencies from
i915 to display registers.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../gpu/drm/i915/display/intel_display_clock_gating.c | 9 +++++++++
.../gpu/drm/i915/display/intel_display_clock_gating.h | 1 +
drivers/gpu/drm/i915/intel_clock_gating.c | 6 +-----
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index 4a94593335e0..508735212d6b 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -17,3 +17,12 @@ void intel_display_skl_init_clock_gating(struct intel_display *display)
*/
intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
}
+
+void intel_display_kbl_init_clock_gating(struct intel_display *display)
+{
+ /*
+ * WaFbcTurnOffFbcWatermark:kbl
+ * Display WA #0562: kbl
+ */
+ intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index 00f416db7f47..8c21217de66a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -9,5 +9,6 @@
struct intel_display;
void intel_display_skl_init_clock_gating(struct intel_display *display);
+void intel_display_kbl_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 454334fef5e7..5f7910dbe164 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -331,11 +331,7 @@ static void kbl_init_clock_gating(struct drm_i915_private *i915)
intel_uncore_rmw(&i915->uncore, GEN6_UCGCTL1,
0, GEN6_GAMUNIT_CLOCK_GATE_DISABLE);
- /*
- * WaFbcTurnOffFbcWatermark:kbl
- * Display WA #0562: kbl
- */
- intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+ intel_display_kbl_init_clock_gating(i915->display);
}
static void skl_init_clock_gating(struct drm_i915_private *i915)
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 3/8] drm/i915/display: move CFL clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
2026-04-20 10:30 ` [PATCH v3 1/8] drm/i915: move SKL clock gating init to display Luca Coelho
2026-04-20 10:30 ` [PATCH v3 2/8] drm/i915: move KBL " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 4/8] drm/i915/display: move BXT " Luca Coelho
` (4 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the CFL/CML-specific display clock gating programming into
display intel_display_clock_gating.c, to remove more dependencies from
i915 to display registers.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../gpu/drm/i915/display/intel_display_clock_gating.c | 9 +++++++++
.../gpu/drm/i915/display/intel_display_clock_gating.h | 1 +
drivers/gpu/drm/i915/intel_clock_gating.c | 6 +-----
3 files changed, 11 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index 508735212d6b..82ea21d7377d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -26,3 +26,12 @@ void intel_display_kbl_init_clock_gating(struct intel_display *display)
*/
intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
}
+
+void intel_display_cfl_init_clock_gating(struct intel_display *display)
+{
+ /*
+ * WaFbcTurnOffFbcWatermark:cfl
+ * Display WA #0562: cfl
+ */
+ intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index 8c21217de66a..63960f1e80fc 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -10,5 +10,6 @@ struct intel_display;
void intel_display_skl_init_clock_gating(struct intel_display *display);
void intel_display_kbl_init_clock_gating(struct intel_display *display);
+void intel_display_cfl_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 5f7910dbe164..b9bd23c2731e 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -307,11 +307,7 @@ static void cfl_init_clock_gating(struct drm_i915_private *i915)
/* WAC6entrylatency:cfl */
intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
- /*
- * WaFbcTurnOffFbcWatermark:cfl
- * Display WA #0562: cfl
- */
- intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+ intel_display_cfl_init_clock_gating(i915->display);
}
static void kbl_init_clock_gating(struct drm_i915_private *i915)
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 4/8] drm/i915/display: move BXT clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
` (2 preceding siblings ...)
2026-04-20 10:30 ` [PATCH v3 3/8] drm/i915/display: move CFL " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 5/8] drm/i915/display: move GLK " Luca Coelho
` (3 subsequent siblings)
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the BXT-specific display clock gating programming into display
intel_display_clock_gating.c, to remove more dependencies from i915.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../i915/display/intel_display_clock_gating.c | 25 +++++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 1 +
drivers/gpu/drm/i915/intel_clock_gating.c | 22 +---------------
3 files changed, 27 insertions(+), 21 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index 82ea21d7377d..59041c807d6d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -35,3 +35,28 @@ void intel_display_cfl_init_clock_gating(struct intel_display *display)
*/
intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
}
+
+void intel_display_bxt_init_clock_gating(struct intel_display *display)
+{
+ /*
+ * Wa: Backlight PWM may stop in the asserted state, causing backlight
+ * to stay fully on.
+ */
+ intel_de_write(display, GEN9_CLKGATE_DIS_0,
+ intel_de_read(display, GEN9_CLKGATE_DIS_0) |
+ PWM1_GATING_DIS | PWM2_GATING_DIS);
+
+ /*
+ * Lower the display internal timeout.
+ * This is needed to avoid any hard hangs when DSI port PLL
+ * is off and a MMIO access is attempted by any privilege
+ * application, using batch buffers or any other means.
+ */
+ intel_de_write(display, RM_TIMEOUT, MMIO_TIMEOUT_US(950));
+
+ /*
+ * WaFbcTurnOffFbcWatermark:bxt
+ * Display WA #0562: bxt
+ */
+ intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index 63960f1e80fc..6bc84a9a4342 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -11,5 +11,6 @@ struct intel_display;
void intel_display_skl_init_clock_gating(struct intel_display *display);
void intel_display_kbl_init_clock_gating(struct intel_display *display);
void intel_display_cfl_init_clock_gating(struct intel_display *display);
+void intel_display_bxt_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index b9bd23c2731e..4c1937d922b2 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -88,27 +88,7 @@ static void bxt_init_clock_gating(struct drm_i915_private *i915)
*/
intel_uncore_rmw(&i915->uncore, GEN8_UCGCTL6, 0, GEN8_HDCUNIT_CLOCK_GATE_DISABLE_HDCREQ);
- /*
- * Wa: Backlight PWM may stop in the asserted state, causing backlight
- * to stay fully on.
- */
- intel_uncore_write(&i915->uncore, GEN9_CLKGATE_DIS_0,
- intel_uncore_read(&i915->uncore, GEN9_CLKGATE_DIS_0) |
- PWM1_GATING_DIS | PWM2_GATING_DIS);
-
- /*
- * Lower the display internal timeout.
- * This is needed to avoid any hard hangs when DSI port PLL
- * is off and a MMIO access is attempted by any privilege
- * application, using batch buffers or any other means.
- */
- intel_uncore_write(&i915->uncore, RM_TIMEOUT, MMIO_TIMEOUT_US(950));
-
- /*
- * WaFbcTurnOffFbcWatermark:bxt
- * Display WA #0562: bxt
- */
- intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
+ intel_display_bxt_init_clock_gating(i915->display);
}
static void glk_init_clock_gating(struct drm_i915_private *i915)
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 5/8] drm/i915/display: move GLK clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
` (3 preceding siblings ...)
2026-04-20 10:30 ` [PATCH v3 4/8] drm/i915/display: move BXT " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 12:18 ` Jani Nikula
2026-04-20 10:30 ` [PATCH v3 6/8] drm/i915/display: move HSW and BDW " Luca Coelho
` (2 subsequent siblings)
7 siblings, 1 reply; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the GLK-specific display clock gating programming into display
intel_display_clock_gating.c, to remove more dependencies from i915 to
display registers.
Now that all remaining Gen9-family callers moved into display, we can
move the shared Gen9 display clock gating helper into display and
remove the old local helper from intel_clock_gating.c.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../i915/display/intel_display_clock_gating.c | 57 +++++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 1 +
drivers/gpu/drm/i915/intel_clock_gating.c | 44 +-------------
3 files changed, 59 insertions(+), 43 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index 59041c807d6d..b2cb18478577 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -6,11 +6,39 @@
#include <drm/intel/intel_gmd_misc_regs.h>
#include "intel_de.h"
+#include "intel_display.h"
#include "intel_display_clock_gating.h"
+#include "intel_display_core.h"
#include "intel_display_regs.h"
+static void intel_display_gen9_init_clock_gating(struct intel_display *display)
+{
+ /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
+ intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_EDP_PSR_FIX_RDWRAP);
+
+ /* WaEnableChickenDCPR:skl,bxt,kbl,glk,cfl */
+ intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, 0, MASK_WAKEMEM);
+
+ /*
+ * WaFbcWakeMemOn:skl,bxt,kbl,glk,cfl
+ * Display WA #0859: skl,bxt,kbl,glk,cfl
+ */
+ intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_MEMORY_WAKE);
+}
+
void intel_display_skl_init_clock_gating(struct intel_display *display)
{
+ /*
+ * WaCompressedResourceDisplayNewHashMode:skl,kbl
+ * Display WA #0390: skl,kbl
+ *
+ * Must match Sampler, Pixel Back End, and Media. See
+ * WaCompressedResourceSamplerPbeMediaNewHashMode.
+ */
+ intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
+
+ intel_display_gen9_init_clock_gating(display);
+
/*
* WaFbcTurnOffFbcWatermark:skl
* Display WA #0562: skl
@@ -20,6 +48,17 @@ void intel_display_skl_init_clock_gating(struct intel_display *display)
void intel_display_kbl_init_clock_gating(struct intel_display *display)
{
+ /*
+ * WaCompressedResourceDisplayNewHashMode:skl,kbl
+ * Display WA #0390: skl,kbl
+ *
+ * Must match Sampler, Pixel Back End, and Media. See
+ * WaCompressedResourceSamplerPbeMediaNewHashMode.
+ */
+ intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
+
+ intel_display_gen9_init_clock_gating(display);
+
/*
* WaFbcTurnOffFbcWatermark:kbl
* Display WA #0562: kbl
@@ -29,6 +68,8 @@ void intel_display_kbl_init_clock_gating(struct intel_display *display)
void intel_display_cfl_init_clock_gating(struct intel_display *display)
{
+ intel_display_gen9_init_clock_gating(display);
+
/*
* WaFbcTurnOffFbcWatermark:cfl
* Display WA #0562: cfl
@@ -38,6 +79,8 @@ void intel_display_cfl_init_clock_gating(struct intel_display *display)
void intel_display_bxt_init_clock_gating(struct intel_display *display)
{
+ intel_display_gen9_init_clock_gating(display);
+
/*
* Wa: Backlight PWM may stop in the asserted state, causing backlight
* to stay fully on.
@@ -60,3 +103,17 @@ void intel_display_bxt_init_clock_gating(struct intel_display *display)
*/
intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
}
+
+void intel_display_glk_init_clock_gating(struct intel_display *display)
+{
+ intel_display_gen9_init_clock_gating(display);
+
+ /*
+ * WaDisablePWMClockGating:glk
+ * Backlight PWM may stop in the asserted state, causing backlight
+ * to stay fully on.
+ */
+ intel_de_write(display, GEN9_CLKGATE_DIS_0,
+ intel_de_read(display, GEN9_CLKGATE_DIS_0) |
+ PWM1_GATING_DIS | PWM2_GATING_DIS);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index 6bc84a9a4342..a7784db9d97a 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -12,5 +12,6 @@ void intel_display_skl_init_clock_gating(struct intel_display *display);
void intel_display_kbl_init_clock_gating(struct intel_display *display);
void intel_display_cfl_init_clock_gating(struct intel_display *display);
void intel_display_bxt_init_clock_gating(struct intel_display *display);
+void intel_display_glk_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 4c1937d922b2..777314e0c75d 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -49,36 +49,8 @@ struct drm_i915_clock_gating_funcs {
void (*init_clock_gating)(struct drm_i915_private *i915);
};
-static void gen9_init_clock_gating(struct drm_i915_private *i915)
-{
- if (HAS_LLC(i915)) {
- /*
- * WaCompressedResourceDisplayNewHashMode:skl,kbl
- * Display WA #0390: skl,kbl
- *
- * Must match Sampler, Pixel Back End, and Media. See
- * WaCompressedResourceSamplerPbeMediaNewHashMode.
- */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
- }
-
- /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, SKL_EDP_PSR_FIX_RDWRAP);
-
- /* WaEnableChickenDCPR:skl,bxt,kbl,glk,cfl */
- intel_uncore_rmw(&i915->uncore, GEN8_CHICKEN_DCPR_1, 0, MASK_WAKEMEM);
-
- /*
- * WaFbcWakeMemOn:skl,bxt,kbl,glk,cfl
- * Display WA #0859: skl,bxt,kbl,glk,cfl
- */
- intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_MEMORY_WAKE);
-}
-
static void bxt_init_clock_gating(struct drm_i915_private *i915)
{
- gen9_init_clock_gating(i915);
-
/* WaDisableSDEUnitClockGating:bxt */
intel_uncore_rmw(&i915->uncore, GEN8_UCGCTL6, 0, GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
@@ -93,16 +65,7 @@ static void bxt_init_clock_gating(struct drm_i915_private *i915)
static void glk_init_clock_gating(struct drm_i915_private *i915)
{
- gen9_init_clock_gating(i915);
-
- /*
- * WaDisablePWMClockGating:glk
- * Backlight PWM may stop in the asserted state, causing backlight
- * to stay fully on.
- */
- intel_uncore_write(&i915->uncore, GEN9_CLKGATE_DIS_0,
- intel_uncore_read(&i915->uncore, GEN9_CLKGATE_DIS_0) |
- PWM1_GATING_DIS | PWM2_GATING_DIS);
+ intel_display_glk_init_clock_gating(i915->display);
}
static void g4x_disable_trickle_feed(struct drm_i915_private *dev_priv)
@@ -282,7 +245,6 @@ static void dg2_init_clock_gating(struct drm_i915_private *i915)
static void cfl_init_clock_gating(struct drm_i915_private *i915)
{
intel_pch_init_clock_gating(i915->display);
- gen9_init_clock_gating(i915);
/* WAC6entrylatency:cfl */
intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
@@ -292,8 +254,6 @@ static void cfl_init_clock_gating(struct drm_i915_private *i915)
static void kbl_init_clock_gating(struct drm_i915_private *i915)
{
- gen9_init_clock_gating(i915);
-
/* WAC6entrylatency:kbl */
intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
@@ -312,8 +272,6 @@ static void kbl_init_clock_gating(struct drm_i915_private *i915)
static void skl_init_clock_gating(struct drm_i915_private *i915)
{
- gen9_init_clock_gating(i915);
-
/* WaDisableDopClockGating:skl */
intel_uncore_rmw(&i915->uncore, GEN7_MISCCPCTL,
GEN7_DOP_CLOCK_GATE_ENABLE, 0);
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 6/8] drm/i915/display: move HSW and BDW clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
` (4 preceding siblings ...)
2026-04-20 10:30 ` [PATCH v3 5/8] drm/i915/display: move GLK " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 7/8] drm/i915/display: move pre-HSW " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating Luca Coelho
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the HSW and BDW display clock gating programming into the display
code. In this case we need two different helpers, because the common
code between these two is split in the middle.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../i915/display/intel_display_clock_gating.c | 44 +++++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 4 ++
.../gpu/drm/i915/display/intel_display_regs.h | 3 ++
drivers/gpu/drm/i915/i915_reg.h | 3 --
drivers/gpu/drm/i915/intel_clock_gating.c | 34 ++------------
5 files changed, 55 insertions(+), 33 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index b2cb18478577..6ba65f6cbeae 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -117,3 +117,47 @@ void intel_display_glk_init_clock_gating(struct intel_display *display)
intel_de_read(display, GEN9_CLKGATE_DIS_0) |
PWM1_GATING_DIS | PWM2_GATING_DIS);
}
+
+void intel_display_bdw_clock_gating_disable_fbcq(struct intel_display *display)
+{
+ /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
+ intel_de_rmw(display, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
+}
+
+void intel_display_bdw_clock_gating_vblank_in_srd(struct intel_display *display)
+{
+ enum pipe pipe;
+
+ /* WaPsrDPAMaskVBlankInSRD:hsw */
+ intel_de_rmw(display, CHICKEN_PAR1_1, 0, HSW_MASK_VBL_TO_PIPE_IN_SRD);
+
+ for_each_pipe(display, pipe) {
+ /* WaPsrDPRSUnmaskVBlankInSRD:hsw,bdw */
+ intel_de_rmw(display, CHICKEN_PIPESL_1(pipe), 0,
+ BDW_UNMASK_VBL_TO_REGS_IN_SRD);
+ }
+}
+
+void intel_display_bdw_clock_gating_kvm_notif(struct intel_display *display)
+{
+ /* WaKVMNotificationOnConfigChange:bdw */
+ intel_de_rmw(display, CHICKEN_PAR2_1, 0,
+ KVM_CONFIG_CHANGE_NOTIFICATION_SELECT);
+}
+
+void intel_display_hsw_init_clock_gating(struct intel_display *display)
+{
+ enum pipe pipe;
+
+ /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
+ intel_de_rmw(display, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
+
+ /* WaPsrDPAMaskVBlankInSRD:hsw */
+ intel_de_rmw(display, CHICKEN_PAR1_1, 0, HSW_MASK_VBL_TO_PIPE_IN_SRD);
+
+ for_each_pipe(display, pipe) {
+ /* WaPsrDPRSUnmaskVBlankInSRD:hsw,bdw */
+ intel_de_rmw(display, CHICKEN_PIPESL_1(pipe), 0,
+ HSW_UNMASK_VBL_TO_REGS_IN_SRD);
+ }
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index a7784db9d97a..e0300dc8b041 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -13,5 +13,9 @@ void intel_display_kbl_init_clock_gating(struct intel_display *display);
void intel_display_cfl_init_clock_gating(struct intel_display *display);
void intel_display_bxt_init_clock_gating(struct intel_display *display);
void intel_display_glk_init_clock_gating(struct intel_display *display);
+void intel_display_bdw_clock_gating_disable_fbcq(struct intel_display *display);
+void intel_display_bdw_clock_gating_vblank_in_srd(struct intel_display *display);
+void intel_display_bdw_clock_gating_kvm_notif(struct intel_display *display);
+void intel_display_hsw_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_display_regs.h b/drivers/gpu/drm/i915/display/intel_display_regs.h
index 4746e9ebd920..fc9d3bbb921c 100644
--- a/drivers/gpu/drm/i915/display/intel_display_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_display_regs.h
@@ -405,6 +405,9 @@
#define SKL_EDP_PSR_FIX_RDWRAP REG_BIT(3)
#define IGNORE_PSR2_HW_TRACKING REG_BIT(1)
+#define CHICKEN_PAR2_1 _MMIO(0x42090)
+#define KVM_CONFIG_CHANGE_NOTIFICATION_SELECT REG_BIT(14)
+
/*
* GEN9 clock gating regs
*/
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index 5d99b99b0c57..e9d7f1c3a288 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -717,9 +717,6 @@
#define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE REG_BIT(5)
#define CHICKEN3_DGMG_DONE_FIX_DISABLE REG_BIT(2)
-#define CHICKEN_PAR2_1 _MMIO(0x42090)
-#define KVM_CONFIG_CHANGE_NOTIFICATION_SELECT REG_BIT(14)
-
#define VLV_PMWGICZ _MMIO(0x1300a4)
#define HSW_EDRAM_CAP _MMIO(0x120010)
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 777314e0c75d..47b437a82f4e 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -284,23 +284,12 @@ static void skl_init_clock_gating(struct drm_i915_private *i915)
static void bdw_init_clock_gating(struct drm_i915_private *i915)
{
- struct intel_display *display = i915->display;
- enum pipe pipe;
-
- /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
+ intel_display_bdw_clock_gating_disable_fbcq(i915->display);
/* WaSwitchSolVfFArbitrationPriority:bdw */
intel_uncore_rmw(&i915->uncore, GAM_ECOCHK, 0, HSW_ECOCHK_ARB_PRIO_SOL);
- /* WaPsrDPAMaskVBlankInSRD:bdw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, HSW_MASK_VBL_TO_PIPE_IN_SRD);
-
- for_each_pipe(display, pipe) {
- /* WaPsrDPRSUnmaskVBlankInSRD:bdw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PIPESL_1(pipe),
- 0, BDW_UNMASK_VBL_TO_REGS_IN_SRD);
- }
+ intel_display_bdw_clock_gating_vblank_in_srd(i915->display);
/* WaVSRefCountFullforceMissDisable:bdw */
/* WaDSRefCountFullforceMissDisable:bdw */
@@ -316,9 +305,7 @@ static void bdw_init_clock_gating(struct drm_i915_private *i915)
/* WaProgramL3SqcReg1Default:bdw */
gen8_set_l3sqc_credits(i915, 30, 2);
- /* WaKVMNotificationOnConfigChange:bdw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PAR2_1,
- 0, KVM_CONFIG_CHANGE_NOTIFICATION_SELECT);
+ intel_display_bdw_clock_gating_kvm_notif(i915->display);
intel_pch_init_clock_gating(i915->display);
@@ -332,20 +319,7 @@ static void bdw_init_clock_gating(struct drm_i915_private *i915)
static void hsw_init_clock_gating(struct drm_i915_private *i915)
{
- struct intel_display *display = i915->display;
- enum pipe pipe;
-
- /* WaFbcAsynchFlipDisableFbcQueue:hsw,bdw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PIPESL_1(PIPE_A), 0, HSW_FBCQ_DIS);
-
- /* WaPsrDPAMaskVBlankInSRD:hsw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, HSW_MASK_VBL_TO_PIPE_IN_SRD);
-
- for_each_pipe(display, pipe) {
- /* WaPsrDPRSUnmaskVBlankInSRD:hsw */
- intel_uncore_rmw(&i915->uncore, CHICKEN_PIPESL_1(pipe),
- 0, HSW_UNMASK_VBL_TO_REGS_IN_SRD);
- }
+ intel_display_hsw_init_clock_gating(i915->display);
/* This is required by WaCatErrorRejectionIssue:hsw */
intel_uncore_rmw(&i915->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 7/8] drm/i915/display: move pre-HSW clock gating init to display
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
` (5 preceding siblings ...)
2026-04-20 10:30 ` [PATCH v3 6/8] drm/i915/display: move HSW and BDW " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating Luca Coelho
7 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
Move the remaining pre-HSW display clock gating programming into
display.
This also drops display register includes from intel_clock_gating.c.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
.../i915/display/intel_display_clock_gating.c | 92 ++++++++++++++++
.../i915/display/intel_display_clock_gating.h | 6 +
.../gpu/drm/i915/display/intel_display_regs.h | 28 +++++
drivers/gpu/drm/i915/i915_reg.h | 28 -----
drivers/gpu/drm/i915/intel_clock_gating.c | 103 +-----------------
5 files changed, 132 insertions(+), 125 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
index 6ba65f6cbeae..585b208fc6c9 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
@@ -6,6 +6,7 @@
#include <drm/intel/intel_gmd_misc_regs.h>
#include "intel_de.h"
+#include "i9xx_plane_regs.h"
#include "intel_display.h"
#include "intel_display_clock_gating.h"
#include "intel_display_core.h"
@@ -161,3 +162,94 @@ void intel_display_hsw_init_clock_gating(struct intel_display *display)
HSW_UNMASK_VBL_TO_REGS_IN_SRD);
}
}
+
+void intel_display_disable_trickle_feed(struct intel_display *display)
+{
+ enum pipe pipe;
+
+ for_each_pipe(display, pipe) {
+ intel_de_rmw(display, DSPCNTR(display, pipe), 0,
+ DISP_TRICKLE_FEED_DISABLE);
+
+ intel_de_rmw(display, DSPSURF(display, pipe), 0, 0);
+ intel_de_posting_read(display, DSPSURF(display, pipe));
+ }
+}
+
+void intel_display_ilk_init_clock_gating(struct intel_display *display)
+{
+ u32 dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
+
+ /*
+ * Required for FBC
+ * WaFbcDisableDpfcClockGating:ilk
+ */
+ dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
+ ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
+ ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
+
+ intel_de_write(display, ILK_DISPLAY_CHICKEN2,
+ intel_de_read(display, ILK_DISPLAY_CHICKEN2) |
+ ILK_DPARB_GATE | ILK_VSDPFD_FULL);
+ dspclk_gate |= ILK_DPARBUNIT_CLOCK_GATE_ENABLE;
+ intel_de_write(display, DISP_ARB_CTL,
+ intel_de_read(display, DISP_ARB_CTL) |
+ DISP_FBC_WM_DIS);
+
+ if (display->platform.ironlake && display->platform.mobile) {
+ /* WaFbcAsynchFlipDisableFbcQueue:ilk */
+ intel_de_rmw(display, ILK_DISPLAY_CHICKEN1, 0, ILK_FBCQ_DIS);
+ intel_de_rmw(display, ILK_DISPLAY_CHICKEN2, 0, ILK_DPARB_GATE);
+ }
+
+ intel_de_write(display, ILK_DSPCLK_GATE_D, dspclk_gate);
+ intel_de_rmw(display, ILK_DISPLAY_CHICKEN2, 0, ILK_ELPIN_409_SELECT);
+
+ intel_display_disable_trickle_feed(display);
+}
+
+void intel_display_gen6_init_clock_gating(struct intel_display *display)
+{
+ u32 dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
+
+ intel_de_write(display, ILK_DSPCLK_GATE_D, dspclk_gate);
+ intel_de_rmw(display, ILK_DISPLAY_CHICKEN2, 0, ILK_ELPIN_409_SELECT);
+
+ intel_de_write(display, ILK_DISPLAY_CHICKEN1,
+ intel_de_read(display, ILK_DISPLAY_CHICKEN1) |
+ ILK_FBCQ_DIS | ILK_PABSTRETCH_DIS);
+ intel_de_write(display, ILK_DISPLAY_CHICKEN2,
+ intel_de_read(display, ILK_DISPLAY_CHICKEN2) |
+ ILK_DPARB_GATE | ILK_VSDPFD_FULL);
+ intel_de_write(display, ILK_DSPCLK_GATE_D,
+ intel_de_read(display, ILK_DSPCLK_GATE_D) |
+ ILK_DPARBUNIT_CLOCK_GATE_ENABLE |
+ ILK_DPFDUNIT_CLOCK_GATE_ENABLE);
+
+ intel_display_disable_trickle_feed(display);
+}
+
+void intel_display_ivb_init_clock_gating(struct intel_display *display)
+{
+ intel_de_write(display, ILK_DSPCLK_GATE_D, ILK_VRHUNIT_CLOCK_GATE_DISABLE);
+ intel_de_rmw(display, ILK_DISPLAY_CHICKEN1, 0, ILK_FBCQ_DIS);
+}
+
+void intel_display_g4x_init_clock_gating(struct intel_display *display)
+{
+ u32 dspclk_gate = VRHUNIT_CLOCK_GATE_DISABLE |
+ OVRUNIT_CLOCK_GATE_DISABLE |
+ OVCUNIT_CLOCK_GATE_DISABLE;
+
+ if (display->platform.gm45)
+ dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE;
+
+ intel_de_write(display, DSPCLK_GATE_D, dspclk_gate);
+
+ intel_display_disable_trickle_feed(display);
+}
+
+void intel_display_i965gm_init_clock_gating(struct intel_display *display)
+{
+ intel_de_write(display, DSPCLK_GATE_D, 0);
+}
diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
index e0300dc8b041..b6dd34ca92dd 100644
--- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
+++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
@@ -17,5 +17,11 @@ void intel_display_bdw_clock_gating_disable_fbcq(struct intel_display *display);
void intel_display_bdw_clock_gating_vblank_in_srd(struct intel_display *display);
void intel_display_bdw_clock_gating_kvm_notif(struct intel_display *display);
void intel_display_hsw_init_clock_gating(struct intel_display *display);
+void intel_display_disable_trickle_feed(struct intel_display *display);
+void intel_display_ilk_init_clock_gating(struct intel_display *display);
+void intel_display_gen6_init_clock_gating(struct intel_display *display);
+void intel_display_ivb_init_clock_gating(struct intel_display *display);
+void intel_display_g4x_init_clock_gating(struct intel_display *display);
+void intel_display_i965gm_init_clock_gating(struct intel_display *display);
#endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
diff --git a/drivers/gpu/drm/i915/display/intel_display_regs.h b/drivers/gpu/drm/i915/display/intel_display_regs.h
index fc9d3bbb921c..1ef4a78aaa3d 100644
--- a/drivers/gpu/drm/i915/display/intel_display_regs.h
+++ b/drivers/gpu/drm/i915/display/intel_display_regs.h
@@ -217,6 +217,34 @@
# define DPIOUNIT_CLOCK_GATE_DISABLE (1 << 6) /* 915-945 */
# define OVFUNIT_CLOCK_GATE_DISABLE (1 << 5)
# define OVBUNIT_CLOCK_GATE_DISABLE (1 << 4)
+
+#define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000)
+#define ILK_FBCQ_DIS REG_BIT(22)
+#define ILK_PABSTRETCH_DIS REG_BIT(21)
+#define ILK_SABSTRETCH_DIS REG_BIT(20)
+#define IVB_PRI_STRETCH_MAX_MASK REG_GENMASK(21, 20)
+#define IVB_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 0)
+#define IVB_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 1)
+#define IVB_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 2)
+#define IVB_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 3)
+#define IVB_SPR_STRETCH_MAX_MASK REG_GENMASK(19, 18)
+#define IVB_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 0)
+#define IVB_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 1)
+#define IVB_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 2)
+#define IVB_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 3)
+
+#define ILK_DISPLAY_CHICKEN2 _MMIO(0x42004)
+/* Required on all Ironlake and Sandybridge according to the B-Spec. */
+#define ILK_ELPIN_409_SELECT REG_BIT(25)
+#define ILK_DPARB_GATE REG_BIT(22)
+#define ILK_VSDPFD_FULL REG_BIT(21)
+
+#define ILK_DSPCLK_GATE_D _MMIO(0x42020)
+#define ILK_VRHUNIT_CLOCK_GATE_DISABLE REG_BIT(28)
+#define ILK_DPFCUNIT_CLOCK_GATE_DISABLE REG_BIT(9)
+#define ILK_DPFCRUNIT_CLOCK_GATE_DISABLE REG_BIT(8)
+#define ILK_DPFDUNIT_CLOCK_GATE_ENABLE REG_BIT(7)
+#define ILK_DPARBUNIT_CLOCK_GATE_ENABLE REG_BIT(5)
/*
* This bit must be set on the 830 to prevent hangs when turning off the
* overlay scaler.
diff --git a/drivers/gpu/drm/i915/i915_reg.h b/drivers/gpu/drm/i915/i915_reg.h
index e9d7f1c3a288..64e906380131 100644
--- a/drivers/gpu/drm/i915/i915_reg.h
+++ b/drivers/gpu/drm/i915/i915_reg.h
@@ -494,21 +494,6 @@
#define GEN7_FF_DS_SCHED_LOAD_BALANCE (0x1 << 4) /* Default */
#define GEN7_FF_DS_SCHED_HW (0x0 << 4)
-#define ILK_DISPLAY_CHICKEN1 _MMIO(0x42000)
-#define ILK_FBCQ_DIS REG_BIT(22)
-#define ILK_PABSTRETCH_DIS REG_BIT(21)
-#define ILK_SABSTRETCH_DIS REG_BIT(20)
-#define IVB_PRI_STRETCH_MAX_MASK REG_GENMASK(21, 20)
-#define IVB_PRI_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 0)
-#define IVB_PRI_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 1)
-#define IVB_PRI_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 2)
-#define IVB_PRI_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_PRI_STRETCH_MAX_MASK, 3)
-#define IVB_SPR_STRETCH_MAX_MASK REG_GENMASK(19, 18)
-#define IVB_SPR_STRETCH_MAX_X8 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 0)
-#define IVB_SPR_STRETCH_MAX_X4 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 1)
-#define IVB_SPR_STRETCH_MAX_X2 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 2)
-#define IVB_SPR_STRETCH_MAX_X1 REG_FIELD_PREP(IVB_SPR_STRETCH_MAX_MASK, 3)
-
#define DPLL_TEST _MMIO(0x606c)
#define DPLLB_TEST_SDVO_DIV_1 (0 << 22)
#define DPLLB_TEST_SDVO_DIV_2 (1 << 22)
@@ -700,19 +685,6 @@
#define DG1_MSTR_IRQ REG_BIT(31)
#define DG1_MSTR_TILE(t) REG_BIT(t)
-#define ILK_DISPLAY_CHICKEN2 _MMIO(0x42004)
-/* Required on all Ironlake and Sandybridge according to the B-Spec. */
-#define ILK_ELPIN_409_SELECT REG_BIT(25)
-#define ILK_DPARB_GATE REG_BIT(22)
-#define ILK_VSDPFD_FULL REG_BIT(21)
-
-#define ILK_DSPCLK_GATE_D _MMIO(0x42020)
-#define ILK_VRHUNIT_CLOCK_GATE_DISABLE REG_BIT(28)
-#define ILK_DPFCUNIT_CLOCK_GATE_DISABLE REG_BIT(9)
-#define ILK_DPFCRUNIT_CLOCK_GATE_DISABLE REG_BIT(8)
-#define ILK_DPFDUNIT_CLOCK_GATE_ENABLE REG_BIT(7)
-#define ILK_DPARBUNIT_CLOCK_GATE_ENABLE REG_BIT(5)
-
#define IVB_CHICKEN3 _MMIO(0x4200c)
#define CHICKEN3_DGMG_REQ_OUT_FIX_DISABLE REG_BIT(5)
#define CHICKEN3_DGMG_DONE_FIX_DISABLE REG_BIT(2)
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 47b437a82f4e..12559db84cf4 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -29,11 +29,8 @@
#include <drm/intel/intel_gmd_misc_regs.h>
#include <drm/intel/intel_gmd_interrupt_regs.h>
-#include "display/i9xx_plane_regs.h"
-#include "display/intel_display.h"
#include "display/intel_display_clock_gating.h"
#include "display/intel_display_core.h"
-#include "display/intel_display_regs.h"
#include "gt/intel_engine_regs.h"
#include "gt/intel_gt.h"
#include "gt/intel_gt_mcr.h"
@@ -68,74 +65,15 @@ static void glk_init_clock_gating(struct drm_i915_private *i915)
intel_display_glk_init_clock_gating(i915->display);
}
-static void g4x_disable_trickle_feed(struct drm_i915_private *dev_priv)
-{
- struct intel_display *display = dev_priv->display;
- enum pipe pipe;
-
- for_each_pipe(display, pipe) {
- intel_uncore_rmw(&dev_priv->uncore, DSPCNTR(display, pipe),
- 0, DISP_TRICKLE_FEED_DISABLE);
-
- intel_uncore_rmw(&dev_priv->uncore, DSPSURF(display, pipe),
- 0, 0);
- intel_uncore_posting_read(&dev_priv->uncore,
- DSPSURF(display, pipe));
- }
-}
-
static void ilk_init_clock_gating(struct drm_i915_private *i915)
{
- u32 dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
-
- /*
- * Required for FBC
- * WaFbcDisableDpfcClockGating:ilk
- */
- dspclk_gate |= ILK_DPFCRUNIT_CLOCK_GATE_DISABLE |
- ILK_DPFCUNIT_CLOCK_GATE_DISABLE |
- ILK_DPFDUNIT_CLOCK_GATE_ENABLE;
-
intel_uncore_write(&i915->uncore, PCH_3DCGDIS0,
MARIUNIT_CLOCK_GATE_DISABLE |
SVSMUNIT_CLOCK_GATE_DISABLE);
intel_uncore_write(&i915->uncore, PCH_3DCGDIS1,
VFMUNIT_CLOCK_GATE_DISABLE);
- /*
- * According to the spec the following bits should be set in
- * order to enable memory self-refresh
- * The bit 22/21 of 0x42004
- * The bit 5 of 0x42020
- * The bit 15 of 0x45000
- */
- intel_uncore_write(&i915->uncore, ILK_DISPLAY_CHICKEN2,
- (intel_uncore_read(&i915->uncore, ILK_DISPLAY_CHICKEN2) |
- ILK_DPARB_GATE | ILK_VSDPFD_FULL));
- dspclk_gate |= ILK_DPARBUNIT_CLOCK_GATE_ENABLE;
- intel_uncore_write(&i915->uncore, DISP_ARB_CTL,
- (intel_uncore_read(&i915->uncore, DISP_ARB_CTL) |
- DISP_FBC_WM_DIS));
-
- /*
- * Based on the document from hardware guys the following bits
- * should be set unconditionally in order to enable FBC.
- * The bit 22 of 0x42000
- * The bit 22 of 0x42004
- * The bit 7,8,9 of 0x42020.
- */
- if (IS_IRONLAKE_M(i915)) {
- /* WaFbcAsynchFlipDisableFbcQueue:ilk */
- intel_uncore_rmw(&i915->uncore, ILK_DISPLAY_CHICKEN1, 0, ILK_FBCQ_DIS);
- intel_uncore_rmw(&i915->uncore, ILK_DISPLAY_CHICKEN2, 0, ILK_DPARB_GATE);
- }
-
- intel_uncore_write(&i915->uncore, ILK_DSPCLK_GATE_D, dspclk_gate);
-
- intel_uncore_rmw(&i915->uncore, ILK_DISPLAY_CHICKEN2, 0, ILK_ELPIN_409_SELECT);
-
- g4x_disable_trickle_feed(i915);
-
+ intel_display_ilk_init_clock_gating(i915->display);
intel_pch_init_clock_gating(i915->display);
}
@@ -152,11 +90,7 @@ static void gen6_check_mch_setup(struct drm_i915_private *i915)
static void gen6_init_clock_gating(struct drm_i915_private *i915)
{
- u32 dspclk_gate = ILK_VRHUNIT_CLOCK_GATE_DISABLE;
-
- intel_uncore_write(&i915->uncore, ILK_DSPCLK_GATE_D, dspclk_gate);
-
- intel_uncore_rmw(&i915->uncore, ILK_DISPLAY_CHICKEN2, 0, ILK_ELPIN_409_SELECT);
+ intel_display_gen6_init_clock_gating(i915->display);
intel_uncore_write(&i915->uncore, GEN6_UCGCTL1,
intel_uncore_read(&i915->uncore, GEN6_UCGCTL1) |
@@ -191,19 +125,6 @@ static void gen6_init_clock_gating(struct drm_i915_private *i915)
*
* WaFbcAsynchFlipDisableFbcQueue:snb
*/
- intel_uncore_write(&i915->uncore, ILK_DISPLAY_CHICKEN1,
- intel_uncore_read(&i915->uncore, ILK_DISPLAY_CHICKEN1) |
- ILK_FBCQ_DIS | ILK_PABSTRETCH_DIS);
- intel_uncore_write(&i915->uncore, ILK_DISPLAY_CHICKEN2,
- intel_uncore_read(&i915->uncore, ILK_DISPLAY_CHICKEN2) |
- ILK_DPARB_GATE | ILK_VSDPFD_FULL);
- intel_uncore_write(&i915->uncore, ILK_DSPCLK_GATE_D,
- intel_uncore_read(&i915->uncore, ILK_DSPCLK_GATE_D) |
- ILK_DPARBUNIT_CLOCK_GATE_ENABLE |
- ILK_DPFDUNIT_CLOCK_GATE_ENABLE);
-
- g4x_disable_trickle_feed(i915);
-
intel_pch_init_clock_gating(i915->display);
gen6_check_mch_setup(i915);
@@ -335,10 +256,7 @@ static void ivb_init_clock_gating(struct drm_i915_private *i915)
{
struct intel_display *display = i915->display;
- intel_uncore_write(&i915->uncore, ILK_DSPCLK_GATE_D, ILK_VRHUNIT_CLOCK_GATE_DISABLE);
-
- /* WaFbcAsynchFlipDisableFbcQueue:ivb */
- intel_uncore_rmw(&i915->uncore, ILK_DISPLAY_CHICKEN1, 0, ILK_FBCQ_DIS);
+ intel_display_ivb_init_clock_gating(display);
/* WaDisableBackToBackFlipFix:ivb */
intel_uncore_write(&i915->uncore, IVB_CHICKEN3,
@@ -367,7 +285,7 @@ static void ivb_init_clock_gating(struct drm_i915_private *i915)
intel_uncore_rmw(&i915->uncore, GEN7_SQ_CHICKEN_MBCUNIT_CONFIG,
0, GEN7_SQ_CHICKEN_MBCUNIT_SQINTMOB);
- g4x_disable_trickle_feed(i915);
+ intel_display_disable_trickle_feed(display);
intel_uncore_rmw(&i915->uncore, GEN6_MBCUNIT_SNPCR, GEN6_MBC_SNPCR_MASK,
GEN6_MBC_SNPCR_MED);
@@ -440,21 +358,12 @@ static void chv_init_clock_gating(struct drm_i915_private *i915)
static void g4x_init_clock_gating(struct drm_i915_private *i915)
{
- u32 dspclk_gate;
-
intel_uncore_write(&i915->uncore, RENCLK_GATE_D1, 0);
intel_uncore_write(&i915->uncore, RENCLK_GATE_D2, VF_UNIT_CLOCK_GATE_DISABLE |
GS_UNIT_CLOCK_GATE_DISABLE |
CL_UNIT_CLOCK_GATE_DISABLE);
intel_uncore_write(&i915->uncore, RAMCLK_GATE_D, 0);
- dspclk_gate = VRHUNIT_CLOCK_GATE_DISABLE |
- OVRUNIT_CLOCK_GATE_DISABLE |
- OVCUNIT_CLOCK_GATE_DISABLE;
- if (IS_GM45(i915))
- dspclk_gate |= DSSUNIT_CLOCK_GATE_DISABLE;
- intel_uncore_write(&i915->uncore, DSPCLK_GATE_D, dspclk_gate);
-
- g4x_disable_trickle_feed(i915);
+ intel_display_g4x_init_clock_gating(i915->display);
}
static void i965gm_init_clock_gating(struct drm_i915_private *i915)
@@ -463,7 +372,7 @@ static void i965gm_init_clock_gating(struct drm_i915_private *i915)
intel_uncore_write(uncore, RENCLK_GATE_D1, I965_RCC_CLOCK_GATE_DISABLE);
intel_uncore_write(uncore, RENCLK_GATE_D2, 0);
- intel_uncore_write(uncore, DSPCLK_GATE_D, 0);
+ intel_display_i965gm_init_clock_gating(i915->display);
intel_uncore_write(uncore, RAMCLK_GATE_D, 0);
intel_uncore_write16(uncore, DEUC, 0);
intel_uncore_write(uncore,
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
` (6 preceding siblings ...)
2026-04-20 10:30 ` [PATCH v3 7/8] drm/i915/display: move pre-HSW " Luca Coelho
@ 2026-04-20 10:30 ` Luca Coelho
2026-04-20 12:21 ` Jani Nikula
7 siblings, 1 reply; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 10:30 UTC (permalink / raw)
To: intel-gfx; +Cc: intel-xe, jani.nikula, ville.syrjala
intel_pch_init_clock_gating() already handles unsupported PCH types,
including PCH_NOP, by doing nothing.
Drop the explicit HAS_PCH_NOP() check from the IVB clock gating
path and always call the display helper directly. This removes one
more direct dependency on display-side PCH macros from
intel_clock_gating.c.
Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
drivers/gpu/drm/i915/intel_clock_gating.c | 3 +--
1 file changed, 1 insertion(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
index 12559db84cf4..d185199c43b8 100644
--- a/drivers/gpu/drm/i915/intel_clock_gating.c
+++ b/drivers/gpu/drm/i915/intel_clock_gating.c
@@ -290,8 +290,7 @@ static void ivb_init_clock_gating(struct drm_i915_private *i915)
intel_uncore_rmw(&i915->uncore, GEN6_MBCUNIT_SNPCR, GEN6_MBC_SNPCR_MASK,
GEN6_MBC_SNPCR_MED);
- if (!HAS_PCH_NOP(display))
- intel_pch_init_clock_gating(display);
+ intel_pch_init_clock_gating(display);
gen6_check_mch_setup(i915);
}
--
2.53.0
^ permalink raw reply related [flat|nested] 13+ messages in thread
* Re: [PATCH v3 5/8] drm/i915/display: move GLK clock gating init to display
2026-04-20 10:30 ` [PATCH v3 5/8] drm/i915/display: move GLK " Luca Coelho
@ 2026-04-20 12:18 ` Jani Nikula
2026-04-20 20:08 ` Luca Coelho
0 siblings, 1 reply; 13+ messages in thread
From: Jani Nikula @ 2026-04-20 12:18 UTC (permalink / raw)
To: Luca Coelho, intel-gfx; +Cc: intel-xe, ville.syrjala
On Mon, 20 Apr 2026, Luca Coelho <luciano.coelho@intel.com> wrote:
> Move the GLK-specific display clock gating programming into display
> intel_display_clock_gating.c, to remove more dependencies from i915 to
> display registers.
>
> Now that all remaining Gen9-family callers moved into display, we can
> move the shared Gen9 display clock gating helper into display and
> remove the old local helper from intel_clock_gating.c.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> .../i915/display/intel_display_clock_gating.c | 57 +++++++++++++++++++
> .../i915/display/intel_display_clock_gating.h | 1 +
> drivers/gpu/drm/i915/intel_clock_gating.c | 44 +-------------
> 3 files changed, 59 insertions(+), 43 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> index 59041c807d6d..b2cb18478577 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> +++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> @@ -6,11 +6,39 @@
> #include <drm/intel/intel_gmd_misc_regs.h>
>
> #include "intel_de.h"
> +#include "intel_display.h"
> #include "intel_display_clock_gating.h"
> +#include "intel_display_core.h"
> #include "intel_display_regs.h"
>
> +static void intel_display_gen9_init_clock_gating(struct intel_display *display)
> +{
> + /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
> + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_EDP_PSR_FIX_RDWRAP);
> +
> + /* WaEnableChickenDCPR:skl,bxt,kbl,glk,cfl */
> + intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, 0, MASK_WAKEMEM);
> +
> + /*
> + * WaFbcWakeMemOn:skl,bxt,kbl,glk,cfl
> + * Display WA #0859: skl,bxt,kbl,glk,cfl
> + */
> + intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_MEMORY_WAKE);
> +}
> +
> void intel_display_skl_init_clock_gating(struct intel_display *display)
> {
> + /*
> + * WaCompressedResourceDisplayNewHashMode:skl,kbl
> + * Display WA #0390: skl,kbl
> + *
> + * Must match Sampler, Pixel Back End, and Media. See
> + * WaCompressedResourceSamplerPbeMediaNewHashMode.
> + */
> + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
> +
> + intel_display_gen9_init_clock_gating(display);
> +
> /*
> * WaFbcTurnOffFbcWatermark:skl
> * Display WA #0562: skl
> @@ -20,6 +48,17 @@ void intel_display_skl_init_clock_gating(struct intel_display *display)
>
> void intel_display_kbl_init_clock_gating(struct intel_display *display)
> {
> + /*
> + * WaCompressedResourceDisplayNewHashMode:skl,kbl
> + * Display WA #0390: skl,kbl
> + *
> + * Must match Sampler, Pixel Back End, and Media. See
> + * WaCompressedResourceSamplerPbeMediaNewHashMode.
> + */
> + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
> +
> + intel_display_gen9_init_clock_gating(display);
> +
> /*
> * WaFbcTurnOffFbcWatermark:kbl
> * Display WA #0562: kbl
> @@ -29,6 +68,8 @@ void intel_display_kbl_init_clock_gating(struct intel_display *display)
>
> void intel_display_cfl_init_clock_gating(struct intel_display *display)
> {
> + intel_display_gen9_init_clock_gating(display);
> +
> /*
> * WaFbcTurnOffFbcWatermark:cfl
> * Display WA #0562: cfl
> @@ -38,6 +79,8 @@ void intel_display_cfl_init_clock_gating(struct intel_display *display)
>
> void intel_display_bxt_init_clock_gating(struct intel_display *display)
> {
> + intel_display_gen9_init_clock_gating(display);
> +
> /*
> * Wa: Backlight PWM may stop in the asserted state, causing backlight
> * to stay fully on.
> @@ -60,3 +103,17 @@ void intel_display_bxt_init_clock_gating(struct intel_display *display)
> */
> intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> }
> +
> +void intel_display_glk_init_clock_gating(struct intel_display *display)
> +{
> + intel_display_gen9_init_clock_gating(display);
> +
> + /*
> + * WaDisablePWMClockGating:glk
> + * Backlight PWM may stop in the asserted state, causing backlight
> + * to stay fully on.
> + */
> + intel_de_write(display, GEN9_CLKGATE_DIS_0,
> + intel_de_read(display, GEN9_CLKGATE_DIS_0) |
> + PWM1_GATING_DIS | PWM2_GATING_DIS);
> +}
> diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> index 6bc84a9a4342..a7784db9d97a 100644
> --- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> +++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> @@ -12,5 +12,6 @@ void intel_display_skl_init_clock_gating(struct intel_display *display);
> void intel_display_kbl_init_clock_gating(struct intel_display *display);
> void intel_display_cfl_init_clock_gating(struct intel_display *display);
> void intel_display_bxt_init_clock_gating(struct intel_display *display);
> +void intel_display_glk_init_clock_gating(struct intel_display *display);
>
> #endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
> diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
> index 4c1937d922b2..777314e0c75d 100644
> --- a/drivers/gpu/drm/i915/intel_clock_gating.c
> +++ b/drivers/gpu/drm/i915/intel_clock_gating.c
> @@ -49,36 +49,8 @@ struct drm_i915_clock_gating_funcs {
> void (*init_clock_gating)(struct drm_i915_private *i915);
> };
>
> -static void gen9_init_clock_gating(struct drm_i915_private *i915)
> -{
> - if (HAS_LLC(i915)) {
The commit message should explain why removing this is okay.
BR,
Jani.
> - /*
> - * WaCompressedResourceDisplayNewHashMode:skl,kbl
> - * Display WA #0390: skl,kbl
> - *
> - * Must match Sampler, Pixel Back End, and Media. See
> - * WaCompressedResourceSamplerPbeMediaNewHashMode.
> - */
> - intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
> - }
> -
> - /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
> - intel_uncore_rmw(&i915->uncore, CHICKEN_PAR1_1, 0, SKL_EDP_PSR_FIX_RDWRAP);
> -
> - /* WaEnableChickenDCPR:skl,bxt,kbl,glk,cfl */
> - intel_uncore_rmw(&i915->uncore, GEN8_CHICKEN_DCPR_1, 0, MASK_WAKEMEM);
> -
> - /*
> - * WaFbcWakeMemOn:skl,bxt,kbl,glk,cfl
> - * Display WA #0859: skl,bxt,kbl,glk,cfl
> - */
> - intel_uncore_rmw(&i915->uncore, DISP_ARB_CTL, 0, DISP_FBC_MEMORY_WAKE);
> -}
> -
> static void bxt_init_clock_gating(struct drm_i915_private *i915)
> {
> - gen9_init_clock_gating(i915);
> -
> /* WaDisableSDEUnitClockGating:bxt */
> intel_uncore_rmw(&i915->uncore, GEN8_UCGCTL6, 0, GEN8_SDEUNIT_CLOCK_GATE_DISABLE);
>
> @@ -93,16 +65,7 @@ static void bxt_init_clock_gating(struct drm_i915_private *i915)
>
> static void glk_init_clock_gating(struct drm_i915_private *i915)
> {
> - gen9_init_clock_gating(i915);
> -
> - /*
> - * WaDisablePWMClockGating:glk
> - * Backlight PWM may stop in the asserted state, causing backlight
> - * to stay fully on.
> - */
> - intel_uncore_write(&i915->uncore, GEN9_CLKGATE_DIS_0,
> - intel_uncore_read(&i915->uncore, GEN9_CLKGATE_DIS_0) |
> - PWM1_GATING_DIS | PWM2_GATING_DIS);
> + intel_display_glk_init_clock_gating(i915->display);
> }
>
> static void g4x_disable_trickle_feed(struct drm_i915_private *dev_priv)
> @@ -282,7 +245,6 @@ static void dg2_init_clock_gating(struct drm_i915_private *i915)
> static void cfl_init_clock_gating(struct drm_i915_private *i915)
> {
> intel_pch_init_clock_gating(i915->display);
> - gen9_init_clock_gating(i915);
>
> /* WAC6entrylatency:cfl */
> intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
> @@ -292,8 +254,6 @@ static void cfl_init_clock_gating(struct drm_i915_private *i915)
>
> static void kbl_init_clock_gating(struct drm_i915_private *i915)
> {
> - gen9_init_clock_gating(i915);
> -
> /* WAC6entrylatency:kbl */
> intel_uncore_rmw(&i915->uncore, FBC_LLC_READ_CTRL, 0, FBC_LLC_FULLY_OPEN);
>
> @@ -312,8 +272,6 @@ static void kbl_init_clock_gating(struct drm_i915_private *i915)
>
> static void skl_init_clock_gating(struct drm_i915_private *i915)
> {
> - gen9_init_clock_gating(i915);
> -
> /* WaDisableDopClockGating:skl */
> intel_uncore_rmw(&i915->uncore, GEN7_MISCCPCTL,
> GEN7_DOP_CLOCK_GATE_ENABLE, 0);
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating
2026-04-20 10:30 ` [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating Luca Coelho
@ 2026-04-20 12:21 ` Jani Nikula
2026-04-20 20:09 ` Luca Coelho
0 siblings, 1 reply; 13+ messages in thread
From: Jani Nikula @ 2026-04-20 12:21 UTC (permalink / raw)
To: Luca Coelho, intel-gfx; +Cc: intel-xe, ville.syrjala
On Mon, 20 Apr 2026, Luca Coelho <luciano.coelho@intel.com> wrote:
> intel_pch_init_clock_gating() already handles unsupported PCH types,
> including PCH_NOP, by doing nothing.
>
> Drop the explicit HAS_PCH_NOP() check from the IVB clock gating
> path and always call the display helper directly. This removes one
> more direct dependency on display-side PCH macros from
> intel_clock_gating.c.
>
> Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> ---
> drivers/gpu/drm/i915/intel_clock_gating.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
> index 12559db84cf4..d185199c43b8 100644
> --- a/drivers/gpu/drm/i915/intel_clock_gating.c
> +++ b/drivers/gpu/drm/i915/intel_clock_gating.c
> @@ -290,8 +290,7 @@ static void ivb_init_clock_gating(struct drm_i915_private *i915)
> intel_uncore_rmw(&i915->uncore, GEN6_MBCUNIT_SNPCR, GEN6_MBC_SNPCR_MASK,
> GEN6_MBC_SNPCR_MED);
>
> - if (!HAS_PCH_NOP(display))
> - intel_pch_init_clock_gating(display);
> + intel_pch_init_clock_gating(display);
With this, you could also do
-#include "display/intel_display_core.h"
+#include "display/intel_pch.h"
BR,
Jani.
>
> gen6_check_mch_setup(i915);
> }
--
Jani Nikula, Intel
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 5/8] drm/i915/display: move GLK clock gating init to display
2026-04-20 12:18 ` Jani Nikula
@ 2026-04-20 20:08 ` Luca Coelho
0 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 20:08 UTC (permalink / raw)
To: Jani Nikula, Luca Coelho, intel-gfx; +Cc: intel-xe, ville.syrjala
On Mon, 2026-04-20 at 15:18 +0300, Jani Nikula wrote:
> On Mon, 20 Apr 2026, Luca Coelho <luciano.coelho@intel.com> wrote:
> > Move the GLK-specific display clock gating programming into display
> > intel_display_clock_gating.c, to remove more dependencies from i915 to
> > display registers.
> >
> > Now that all remaining Gen9-family callers moved into display, we can
> > move the shared Gen9 display clock gating helper into display and
> > remove the old local helper from intel_clock_gating.c.
> >
> > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> > ---
> > .../i915/display/intel_display_clock_gating.c | 57 +++++++++++++++++++
> > .../i915/display/intel_display_clock_gating.h | 1 +
> > drivers/gpu/drm/i915/intel_clock_gating.c | 44 +-------------
> > 3 files changed, 59 insertions(+), 43 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > index 59041c807d6d..b2cb18478577 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > +++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.c
> > @@ -6,11 +6,39 @@
> > #include <drm/intel/intel_gmd_misc_regs.h>
> >
> > #include "intel_de.h"
> > +#include "intel_display.h"
> > #include "intel_display_clock_gating.h"
> > +#include "intel_display_core.h"
> > #include "intel_display_regs.h"
> >
> > +static void intel_display_gen9_init_clock_gating(struct intel_display *display)
> > +{
> > + /* See Bspec note for PSR2_CTL bit 31, Wa#828:skl,bxt,kbl,cfl */
> > + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_EDP_PSR_FIX_RDWRAP);
> > +
> > + /* WaEnableChickenDCPR:skl,bxt,kbl,glk,cfl */
> > + intel_de_rmw(display, GEN8_CHICKEN_DCPR_1, 0, MASK_WAKEMEM);
> > +
> > + /*
> > + * WaFbcWakeMemOn:skl,bxt,kbl,glk,cfl
> > + * Display WA #0859: skl,bxt,kbl,glk,cfl
> > + */
> > + intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_MEMORY_WAKE);
> > +}
> > +
> > void intel_display_skl_init_clock_gating(struct intel_display *display)
> > {
> > + /*
> > + * WaCompressedResourceDisplayNewHashMode:skl,kbl
> > + * Display WA #0390: skl,kbl
> > + *
> > + * Must match Sampler, Pixel Back End, and Media. See
> > + * WaCompressedResourceSamplerPbeMediaNewHashMode.
> > + */
> > + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
> > +
> > + intel_display_gen9_init_clock_gating(display);
> > +
> > /*
> > * WaFbcTurnOffFbcWatermark:skl
> > * Display WA #0562: skl
> > @@ -20,6 +48,17 @@ void intel_display_skl_init_clock_gating(struct intel_display *display)
> >
> > void intel_display_kbl_init_clock_gating(struct intel_display *display)
> > {
> > + /*
> > + * WaCompressedResourceDisplayNewHashMode:skl,kbl
> > + * Display WA #0390: skl,kbl
> > + *
> > + * Must match Sampler, Pixel Back End, and Media. See
> > + * WaCompressedResourceSamplerPbeMediaNewHashMode.
> > + */
> > + intel_de_rmw(display, CHICKEN_PAR1_1, 0, SKL_DE_COMPRESSED_HASH_MODE);
> > +
> > + intel_display_gen9_init_clock_gating(display);
> > +
> > /*
> > * WaFbcTurnOffFbcWatermark:kbl
> > * Display WA #0562: kbl
> > @@ -29,6 +68,8 @@ void intel_display_kbl_init_clock_gating(struct intel_display *display)
> >
> > void intel_display_cfl_init_clock_gating(struct intel_display *display)
> > {
> > + intel_display_gen9_init_clock_gating(display);
> > +
> > /*
> > * WaFbcTurnOffFbcWatermark:cfl
> > * Display WA #0562: cfl
> > @@ -38,6 +79,8 @@ void intel_display_cfl_init_clock_gating(struct intel_display *display)
> >
> > void intel_display_bxt_init_clock_gating(struct intel_display *display)
> > {
> > + intel_display_gen9_init_clock_gating(display);
> > +
> > /*
> > * Wa: Backlight PWM may stop in the asserted state, causing backlight
> > * to stay fully on.
> > @@ -60,3 +103,17 @@ void intel_display_bxt_init_clock_gating(struct intel_display *display)
> > */
> > intel_de_rmw(display, DISP_ARB_CTL, 0, DISP_FBC_WM_DIS);
> > }
> > +
> > +void intel_display_glk_init_clock_gating(struct intel_display *display)
> > +{
> > + intel_display_gen9_init_clock_gating(display);
> > +
> > + /*
> > + * WaDisablePWMClockGating:glk
> > + * Backlight PWM may stop in the asserted state, causing backlight
> > + * to stay fully on.
> > + */
> > + intel_de_write(display, GEN9_CLKGATE_DIS_0,
> > + intel_de_read(display, GEN9_CLKGATE_DIS_0) |
> > + PWM1_GATING_DIS | PWM2_GATING_DIS);
> > +}
> > diff --git a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> > index 6bc84a9a4342..a7784db9d97a 100644
> > --- a/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> > +++ b/drivers/gpu/drm/i915/display/intel_display_clock_gating.h
> > @@ -12,5 +12,6 @@ void intel_display_skl_init_clock_gating(struct intel_display *display);
> > void intel_display_kbl_init_clock_gating(struct intel_display *display);
> > void intel_display_cfl_init_clock_gating(struct intel_display *display);
> > void intel_display_bxt_init_clock_gating(struct intel_display *display);
> > +void intel_display_glk_init_clock_gating(struct intel_display *display);
> >
> > #endif /* __INTEL_DISPLAY_CLOCK_GATING_H__ */
> > diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
> > index 4c1937d922b2..777314e0c75d 100644
> > --- a/drivers/gpu/drm/i915/intel_clock_gating.c
> > +++ b/drivers/gpu/drm/i915/intel_clock_gating.c
> > @@ -49,36 +49,8 @@ struct drm_i915_clock_gating_funcs {
> > void (*init_clock_gating)(struct drm_i915_private *i915);
> > };
> >
> > -static void gen9_init_clock_gating(struct drm_i915_private *i915)
> > -{
> > - if (HAS_LLC(i915)) {
>
> The commit message should explain why removing this is okay.
Good point. This check was incidental because it just happened that
the only Gen9 platforms that need this workaround (namely SKL and KBL)
have LLC. Now that the code is moved, the check is not needed and we
apply the workaround in the SKL/KBL-specific functions instead of doing
it in the Gen9 function protected by HAS_LLC().
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 13+ messages in thread
* Re: [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating
2026-04-20 12:21 ` Jani Nikula
@ 2026-04-20 20:09 ` Luca Coelho
0 siblings, 0 replies; 13+ messages in thread
From: Luca Coelho @ 2026-04-20 20:09 UTC (permalink / raw)
To: Jani Nikula, Luca Coelho, intel-gfx; +Cc: intel-xe, ville.syrjala
On Mon, 2026-04-20 at 15:21 +0300, Jani Nikula wrote:
> On Mon, 20 Apr 2026, Luca Coelho <luciano.coelho@intel.com> wrote:
> > intel_pch_init_clock_gating() already handles unsupported PCH types,
> > including PCH_NOP, by doing nothing.
> >
> > Drop the explicit HAS_PCH_NOP() check from the IVB clock gating
> > path and always call the display helper directly. This removes one
> > more direct dependency on display-side PCH macros from
> > intel_clock_gating.c.
> >
> > Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
> > ---
> > drivers/gpu/drm/i915/intel_clock_gating.c | 3 +--
> > 1 file changed, 1 insertion(+), 2 deletions(-)
> >
> > diff --git a/drivers/gpu/drm/i915/intel_clock_gating.c b/drivers/gpu/drm/i915/intel_clock_gating.c
> > index 12559db84cf4..d185199c43b8 100644
> > --- a/drivers/gpu/drm/i915/intel_clock_gating.c
> > +++ b/drivers/gpu/drm/i915/intel_clock_gating.c
> > @@ -290,8 +290,7 @@ static void ivb_init_clock_gating(struct drm_i915_private *i915)
> > intel_uncore_rmw(&i915->uncore, GEN6_MBCUNIT_SNPCR, GEN6_MBC_SNPCR_MASK,
> > GEN6_MBC_SNPCR_MED);
> >
> > - if (!HAS_PCH_NOP(display))
> > - intel_pch_init_clock_gating(display);
> > + intel_pch_init_clock_gating(display);
>
> With this, you could also do
>
> -#include "display/intel_display_core.h"
> +#include "display/intel_pch.h"
Yes! Good catch.
--
Cheers,
Luca.
^ permalink raw reply [flat|nested] 13+ messages in thread
end of thread, other threads:[~2026-04-20 20:09 UTC | newest]
Thread overview: 13+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-04-20 10:30 [PATCH v3 0/8] drm/i915: move more display dependencies from i915 Luca Coelho
2026-04-20 10:30 ` [PATCH v3 1/8] drm/i915: move SKL clock gating init to display Luca Coelho
2026-04-20 10:30 ` [PATCH v3 2/8] drm/i915: move KBL " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 3/8] drm/i915/display: move CFL " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 4/8] drm/i915/display: move BXT " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 5/8] drm/i915/display: move GLK " Luca Coelho
2026-04-20 12:18 ` Jani Nikula
2026-04-20 20:08 ` Luca Coelho
2026-04-20 10:30 ` [PATCH v3 6/8] drm/i915/display: move HSW and BDW " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 7/8] drm/i915/display: move pre-HSW " Luca Coelho
2026-04-20 10:30 ` [PATCH v3 8/8] drm/i915: remove HAS_PCH_NOP() dependency from clock gating Luca Coelho
2026-04-20 12:21 ` Jani Nikula
2026-04-20 20:09 ` Luca Coelho
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox