From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org
Subject: [PATCH v4 11/21] drm/i915/dmc: Shuffle code around
Date: Mon, 9 Jun 2025 17:10:36 +0300 [thread overview]
Message-ID: <20250609141046.6244-12-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20250609141046.6244-1-ville.syrjala@linux.intel.com>
From: Ville Syrjälä <ville.syrjala@linux.intel.com>
Shuffle the DMC_EVT_CTL related stuff around once more. We'll need
this stuff during intel_dmc_enable_pipe(), and this lets us avoid
forward declarations.
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
drivers/gpu/drm/i915/display/intel_dmc.c | 144 +++++++++++------------
1 file changed, 72 insertions(+), 72 deletions(-)
diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
index 6392fa928e08..5a43298cd0e7 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
@@ -505,42 +505,6 @@ static u32 pipedmc_interrupt_mask(struct intel_display *display)
PIPEDMC_ATS_FAULT;
}
-void intel_dmc_enable_pipe(struct intel_display *display, enum pipe pipe)
-{
- enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(pipe);
-
- if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
- return;
-
- if (DISPLAY_VER(display) >= 20) {
- intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
- intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~pipedmc_interrupt_mask(display));
- }
-
- if (DISPLAY_VER(display) >= 14)
- intel_de_rmw(display, MTL_PIPEDMC_CONTROL, 0, PIPEDMC_ENABLE_MTL(pipe));
- else
- intel_de_rmw(display, PIPEDMC_CONTROL(pipe), 0, PIPEDMC_ENABLE);
-}
-
-void intel_dmc_disable_pipe(struct intel_display *display, enum pipe pipe)
-{
- enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(pipe);
-
- if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
- return;
-
- if (DISPLAY_VER(display) >= 14)
- intel_de_rmw(display, MTL_PIPEDMC_CONTROL, PIPEDMC_ENABLE_MTL(pipe), 0);
- else
- intel_de_rmw(display, PIPEDMC_CONTROL(pipe), PIPEDMC_ENABLE, 0);
-
- if (DISPLAY_VER(display) >= 20) {
- intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~0);
- intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
- }
-}
-
static u32 dmc_evt_ctl_disable(void)
{
return REG_FIELD_PREP(DMC_EVT_CTL_TYPE_MASK,
@@ -578,6 +542,78 @@ static bool is_event_handler(struct intel_display *display,
REG_FIELD_GET(DMC_EVT_CTL_EVENT_ID_MASK, data) == event_id;
}
+static bool disable_dmc_evt(struct intel_display *display,
+ enum intel_dmc_id dmc_id,
+ i915_reg_t reg, u32 data)
+{
+ if (!is_dmc_evt_ctl_reg(display, dmc_id, reg))
+ return false;
+
+ /* keep all pipe DMC events disabled by default */
+ if (dmc_id != DMC_FW_MAIN)
+ return true;
+
+ /* also disable the flip queue event on the main DMC on TGL */
+ if (display->platform.tigerlake &&
+ is_event_handler(display, dmc_id, MAINDMC_EVENT_CLK_MSEC, reg, data))
+ return true;
+
+ /* also disable the HRR event on the main DMC on TGL/ADLS */
+ if ((display->platform.tigerlake || display->platform.alderlake_s) &&
+ is_event_handler(display, dmc_id, MAINDMC_EVENT_VBLANK_A, reg, data))
+ return true;
+
+ return false;
+}
+
+static u32 dmc_mmiodata(struct intel_display *display,
+ struct intel_dmc *dmc,
+ enum intel_dmc_id dmc_id, int i)
+{
+ if (disable_dmc_evt(display, dmc_id,
+ dmc->dmc_info[dmc_id].mmioaddr[i],
+ dmc->dmc_info[dmc_id].mmiodata[i]))
+ return dmc_evt_ctl_disable();
+ else
+ return dmc->dmc_info[dmc_id].mmiodata[i];
+}
+
+void intel_dmc_enable_pipe(struct intel_display *display, enum pipe pipe)
+{
+ enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(pipe);
+
+ if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
+ return;
+
+ if (DISPLAY_VER(display) >= 20) {
+ intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
+ intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~pipedmc_interrupt_mask(display));
+ }
+
+ if (DISPLAY_VER(display) >= 14)
+ intel_de_rmw(display, MTL_PIPEDMC_CONTROL, 0, PIPEDMC_ENABLE_MTL(pipe));
+ else
+ intel_de_rmw(display, PIPEDMC_CONTROL(pipe), 0, PIPEDMC_ENABLE);
+}
+
+void intel_dmc_disable_pipe(struct intel_display *display, enum pipe pipe)
+{
+ enum intel_dmc_id dmc_id = PIPE_TO_DMC_ID(pipe);
+
+ if (!is_valid_dmc_id(dmc_id) || !has_dmc_id_fw(display, dmc_id))
+ return;
+
+ if (DISPLAY_VER(display) >= 14)
+ intel_de_rmw(display, MTL_PIPEDMC_CONTROL, PIPEDMC_ENABLE_MTL(pipe), 0);
+ else
+ intel_de_rmw(display, PIPEDMC_CONTROL(pipe), PIPEDMC_ENABLE, 0);
+
+ if (DISPLAY_VER(display) >= 20) {
+ intel_de_write(display, PIPEDMC_INTERRUPT_MASK(pipe), ~0);
+ intel_de_write(display, PIPEDMC_INTERRUPT(pipe), pipedmc_interrupt_mask(display));
+ }
+}
+
static void dmc_configure_event(struct intel_display *display,
enum intel_dmc_id dmc_id,
unsigned int event_id,
@@ -638,42 +674,6 @@ void intel_dmc_start_pkgc_exit_at_start_of_undelayed_vblank(struct intel_display
dmc_configure_event(display, dmc_id, PIPEDMC_EVENT_VBLANK, enable);
}
-static bool disable_dmc_evt(struct intel_display *display,
- enum intel_dmc_id dmc_id,
- i915_reg_t reg, u32 data)
-{
- if (!is_dmc_evt_ctl_reg(display, dmc_id, reg))
- return false;
-
- /* keep all pipe DMC events disabled by default */
- if (dmc_id != DMC_FW_MAIN)
- return true;
-
- /* also disable the flip queue event on the main DMC on TGL */
- if (display->platform.tigerlake &&
- is_event_handler(display, dmc_id, MAINDMC_EVENT_CLK_MSEC, reg, data))
- return true;
-
- /* also disable the HRR event on the main DMC on TGL/ADLS */
- if ((display->platform.tigerlake || display->platform.alderlake_s) &&
- is_event_handler(display, dmc_id, MAINDMC_EVENT_VBLANK_A, reg, data))
- return true;
-
- return false;
-}
-
-static u32 dmc_mmiodata(struct intel_display *display,
- struct intel_dmc *dmc,
- enum intel_dmc_id dmc_id, int i)
-{
- if (disable_dmc_evt(display, dmc_id,
- dmc->dmc_info[dmc_id].mmioaddr[i],
- dmc->dmc_info[dmc_id].mmiodata[i]))
- return dmc_evt_ctl_disable();
- else
- return dmc->dmc_info[dmc_id].mmiodata[i];
-}
-
/**
* intel_dmc_load_program() - write the firmware from memory to register.
* @display: display instance
--
2.49.0
next prev parent reply other threads:[~2025-06-09 14:11 UTC|newest]
Thread overview: 51+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-09 14:10 [PATCH v4 00/21] drm/i915/flipq: Rough flip queue implementation Ville Syrjala
2025-06-09 14:10 ` [PATCH v4 01/21] drm/i915/dsb: Use intel_dsb_ins_align() in intel_dsb_align_tail() Ville Syrjala
2025-06-10 21:24 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 02/21] drm/i915/dsb: Provide intel_dsb_head() and intel_dsb_size() Ville Syrjala
2025-06-10 21:28 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 03/21] drm/i915/dsb: Introduce intel_dsb_exec_time_us() Ville Syrjala
2025-06-10 21:32 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 04/21] drm/i915/dsb: Garbage collect the MMIO DEwake stuff Ville Syrjala
2025-06-10 21:41 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 05/21] drm/i915/dsb: Move the DSB_PMCTRL* reset out of intel_dsb_finish() Ville Syrjala
2025-06-10 21:50 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 06/21] drm/i915/dsb: Disable the GOSUB interrupt Ville Syrjala
2025-06-10 21:53 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 07/21] drm/i915/dmc: Limit PIPEDMC clock gating w/a to just ADL/DG2/MTL Ville Syrjala
2025-06-10 22:06 ` Shankar, Uma
2025-06-11 13:30 ` Ville Syrjälä
2025-06-12 5:12 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 08/21] drm/i915/dmc: Parametrize MTL_PIPEDMC_GATING_DIS Ville Syrjala
2025-06-10 22:07 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 09/21] drm/i915: Set PKG_C_LATENCY.added_wake_time to 0 Ville Syrjala
2025-06-10 22:18 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 10/21] drm/i915: Try to program PKG_C_LATENCY more correctly Ville Syrjala
2025-06-09 14:10 ` Ville Syrjala [this message]
2025-06-10 22:20 ` [PATCH v4 11/21] drm/i915/dmc: Shuffle code around Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 12/21] drm/i915/dmc: Reload PIPEDMC MMIO registers for pipe C/D on PTL+ Ville Syrjala
2025-06-10 23:24 ` Shankar, Uma
2025-06-11 14:25 ` Ville Syrjälä
2025-06-12 5:05 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 13/21] drm/i915/dmc: Assert DMC is loaded harder Ville Syrjala
2025-06-09 14:10 ` [PATCH v4 14/21] drm/i915/dmc: Define flip queue related PIPEDMC registers Ville Syrjala
2025-06-19 7:29 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 15/21] drm/i915/flipq: Provide the nuts and bolts code for flip queue Ville Syrjala
2025-06-23 19:54 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 16/21] drm/i915/flipq: Implement flip queue based commit path Ville Syrjala
2025-06-23 19:58 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 17/21] drm/i915/flipq: Implement Wa_18034343758 Ville Syrjala
2025-06-23 20:05 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 18/21] drm/i915/flipq: Implement Wa_16018781658 for LNL-A0 Ville Syrjala
2025-06-23 20:08 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 19/21] drm/i915/flipq: Add intel_flipq_dump() Ville Syrjala
2025-06-23 20:09 ` Shankar, Uma
2025-06-09 14:10 ` [PATCH v4 20/21] drm/i915/flipq: Enable flipq by default for testing Ville Syrjala
2025-06-09 14:10 ` [PATCH v4 21/21] drm/i915/flipq: Disable PSR for extra flip queue coverage Ville Syrjala
2025-06-09 19:22 ` ✓ CI.Patch_applied: success for drm/i915/flipq: Rough flip queue implementation (rev6) Patchwork
2025-06-09 19:23 ` ✗ CI.checkpatch: warning " Patchwork
2025-06-09 19:24 ` ✓ CI.KUnit: success " Patchwork
2025-06-09 19:35 ` ✓ CI.Build: " Patchwork
2025-06-09 19:37 ` ✓ CI.Hooks: " Patchwork
2025-06-09 19:39 ` ✗ CI.checksparse: warning " Patchwork
2025-06-09 20:01 ` ✗ Xe.CI.BAT: failure " Patchwork
2025-06-09 21:50 ` ✗ Xe.CI.Full: " Patchwork
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250609141046.6244-12-ville.syrjala@linux.intel.com \
--to=ville.syrjala@linux.intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox