From: Imre Deak <imre.deak@intel.com>
To: Gustavo Sousa <gustavo.sousa@intel.com>
Cc: Mohammed Thasleem <mohammed.thasleem@intel.com>,
intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH] drm/i915/dmc: Add debugfs for dc6 counter
Date: Mon, 3 Feb 2025 18:49:15 +0200 [thread overview]
Message-ID: <Z6DzizSRJ_8I_B_y@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <173860063749.77773.17599385587852958412@intel.com>
On Mon, Feb 03, 2025 at 01:37:17PM -0300, Gustavo Sousa wrote:
> Quoting Imre Deak (2025-02-03 12:14:10-03:00)
> >On Mon, Feb 03, 2025 at 11:59:59AM -0300, Gustavo Sousa wrote:
> >> Quoting Imre Deak (2025-02-03 11:26:19-03:00)
> >> >On Mon, Feb 03, 2025 at 10:39:54AM -0300, Gustavo Sousa wrote:
> >> >> Quoting Imre Deak (2025-02-03 09:43:38-03:00)
> >> >> >On Mon, Feb 03, 2025 at 02:26:13PM +0530, Mohammed Thasleem wrote:
> >> >> >> Starting from MTl we don't have a platform agnostic way to validate DC6 state
> >> >> >> due to dc6 counter has been removed to validate DC state.
> >> >> >> Adding dc6_entry_counter at display dirver to validate dc6 state.
> >> >> >>
> >> >> >> Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
> >> >> >> ---
> >> >> >> drivers/gpu/drm/i915/display/intel_display_core.h | 1 +
> >> >> >> drivers/gpu/drm/i915/display/intel_display_power_well.c | 2 ++
> >> >> >> drivers/gpu/drm/i915/display/intel_dmc.c | 1 +
> >> >> >> 3 files changed, 4 insertions(+)
> >> >> >>
> >> >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
> >> >> >> index 554870d2494b..cc244617011f 100644
> >> >> >> --- a/drivers/gpu/drm/i915/display/intel_display_core.h
> >> >> >> +++ b/drivers/gpu/drm/i915/display/intel_display_core.h
> >> >> >> @@ -376,6 +376,7 @@ struct intel_display {
> >> >> >> struct {
> >> >> >> struct intel_dmc *dmc;
> >> >> >> intel_wakeref_t wakeref;
> >> >> >> + u32 dc6_entry_counter;
> >> >> >> } dmc;
> >> >> >>
> >> >> >> struct {
> >> >> >> diff --git a/drivers/gpu/drm/i915/display/intel_display_power_well.c b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> >> >> >> index f45a4f9ba23c..0eb178aa618d 100644
> >> >> >> --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> >> >> >> +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> >> >> >> @@ -869,6 +869,8 @@ void skl_enable_dc6(struct intel_display *display)
> >> >> >> intel_dmc_wl_enable(display, DC_STATE_EN_UPTO_DC6);
> >> >> >>
> >> >> >> gen9_set_dc_state(display, DC_STATE_EN_UPTO_DC6);
> >> >> >> +
> >> >> >> + display->dmc.dc6_entry_counter++;
> >> >> >
> >> >> >AFAIU the goal is to validate that the display HW can reach the DC6
> >> >> >power state. There is no HW DC6 residency counter (and there wasn't such
> >> >> >a counter earlier either), so an alternative way is required. According
> >> >> >to the HW team the display driver has programmed everything correctly in
> >> >> >order to allow the DC6 power state if the DC5 power state is reached
> >> >> >(indicated by the HW DC5 residency counter incrementing) and DC6 is
> >> >> >enabled by the driver.
> >> >>
> >> >> Yep. That's what I learned as well when looking into this stuff a while
> >> >> ago.
> >> >>
> >> >> >Based on the above, we'd need a DC6 residency counter maintained by the
> >> >> >driver which is incremented if the DC5 residency counter increments
> >>
> >> By the way, the counter that we currently have in our driver is the one
> >> incremented by the DMC. I was meaning to send a patch for the residency
> >> counter maintained by the hardware, but have not yet... In theory, that
> >> one should be more accurate, but would require us to enable and disable
> >> that counter as the IGT test starts and finishes.
> >>
> >> >> >while DC6 is enabled. The dc6_entry_counter in this patch is not enough
> >> >> >for this, since it doesn't take into account the DC5 residency. While
> >> >> >user space could check both dc6_entry_counter and the DC5 residency,
> >> >> >that check would be racy wrt. the driver enabling/disabling the DC6
> >> >> >state asynchronously.
> >> >>
> >> >> I'm not sure doing a driver-maintained dc6 entry counter would be
> >> >> something worth implementing. Even if we have successfully entered DC5
> >> >> and, in theory, DC6 would follow if enabled, this would be a synthetic
> >> >> counter and it could be masking some hardware bug that could be
> >> >> preventing DC6.
> >> >
> >> >According to the HW team the DC5 residency counter incrementing while
> >> >DC6 is enabled is a guarantee that the display is configured correctly
> >> >to allow the HW entering DC6 at all times. IOW this is the HW team's
> >> >suggestion to validate DC6 at the moment.
> >> >
> >> >> On the IGT side, we could just skip if we are on a platform that does
> >> >> not support DC6 counters, at least while we do not have a reliable
> >> >> alternative way of checking for DC6.
> >> >
> >> >I think IGT would need to validate DC6 in the above way suggested by the
> >> >HW team.
> >>
> >> I'm still inclined to think that we should defer DC6 checking for when
> >> we actually have a way to verify it. The way suggested above sounds
> >> like: *trust* that DC6 is reached when DC5 is reached with DC6 enabled.
> >>
> >> In that case, just checking for DC5 should be enough for the time
> >> being...
> >
> >That's not the same as DC5 incrementing while DC6 is enabled.
>
> Ah, I see.
>
> You mean that, with DC6 enabled, hardware/firmware flows for DC5 might
> be different, right?
Yes, that's possible, or some driver configuration while the driver
keeps DC6 enabled would block both DC5 and DC6.
> Yeah, that would make sense. In that case, maybe a flag (or counter)
> from driver that we got into DC5 with DC6 enabled would be helpful
> indeed.
>
> --
> Gustavo Sousa
>
> >
> >> I won't object further if we do the other way though.
> >>
> >> >
> >> >> It would be good if we could detect that PG0 was in fact disabled, which
> >> >> I believe is a stronger indication of DC6.
> >> >
> >> >It would be good to have a HW DC6 residency counter, but there isn't one
> >> >at the moment. Other ways may have a dependency on other, non-display HW
> >> >blocks, for instance in case of shared clock/voltage resources, the
> >> >display functionality validation shouldn't be affected by these HW
> >> >blocks.
> >>
> >> As far as I understand by reading the docs, DC6 is DC5 with PG0
> >> disabled. That's why my suggestion above.
> >>
> >> --
> >> Gustavo Sousa
> >>
> >> >
> >> >> --
> >> >> Gustavo Sousa
> >> >>
> >> >> >
> >> >> >I suppose the driver could take a snapshot of the DC5 residency counter
> >> >> >right after it enables DC6 (dc5_residency_start) and increment the SW
> >> >> >DC6 residency counter right before it disables DC6 or when user space
> >> >> >reads the DC6 counter. So the driver would update the counter at these
> >> >> >two points in the following way:
> >> >> >dc6_residency += dc5_residency_current - dc5_residency_start
> >> >> >
> >> >> >The commit log would need a justification, something along the above
> >> >> >lines.
> >> >> >
> >> >> >> }
> >> >> >>
> >> >> >> void bxt_enable_dc9(struct intel_display *display)
> >> >> >> diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
> >> >> >> index 221d3abda791..f51bd8e6011d 100644
> >> >> >> --- a/drivers/gpu/drm/i915/display/intel_dmc.c
> >> >> >> +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
> >> >> >> @@ -1293,6 +1293,7 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
> >> >> >> if (i915_mmio_reg_valid(dc6_reg))
> >> >> >> seq_printf(m, "DC5 -> DC6 count: %d\n",
> >> >> >> intel_de_read(display, dc6_reg));
> >> >> >> + seq_printf(m, "DC6 entry count: %d\n", display->dmc.dc6_entry_counter);
> >> >> >>
> >> >> >> seq_printf(m, "program base: 0x%08x\n",
> >> >> >> intel_de_read(display, DMC_PROGRAM(dmc->dmc_info[DMC_FW_MAIN].start_mmioaddr, 0)));
> >> >> >> --
> >> >> >> 2.43.0
> >> >> >>
next prev parent reply other threads:[~2025-02-03 16:48 UTC|newest]
Thread overview: 68+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-03 8:56 [PATCH] drm/i915/dmc: Add debugfs for dc6 counter Mohammed Thasleem
2025-02-03 9:23 ` Jani Nikula
2025-02-03 15:46 ` Rodrigo Vivi
2025-02-03 12:43 ` Imre Deak
2025-02-03 13:39 ` Gustavo Sousa
2025-02-03 14:26 ` Imre Deak
2025-02-03 14:59 ` Gustavo Sousa
2025-02-03 15:14 ` Imre Deak
2025-02-03 15:45 ` Rodrigo Vivi
2025-02-03 16:01 ` Imre Deak
2025-02-03 16:12 ` Rodrigo Vivi
2025-02-03 16:27 ` Imre Deak
2025-02-03 16:42 ` Rodrigo Vivi
2025-02-03 16:51 ` Imre Deak
2025-02-03 17:15 ` Rodrigo Vivi
2025-02-03 19:22 ` Imre Deak
2025-02-03 20:19 ` Gustavo Sousa
2025-02-03 20:23 ` Vivi, Rodrigo
2025-02-03 20:40 ` Gustavo Sousa
2025-02-03 20:59 ` Vivi, Rodrigo
2025-02-03 21:18 ` Gustavo Sousa
2025-02-04 18:10 ` Imre Deak
2025-02-04 17:15 ` Imre Deak
2025-02-03 16:37 ` Gustavo Sousa
2025-02-03 16:49 ` Imre Deak [this message]
2025-02-03 17:15 ` ✗ Fi.CI.CHECKPATCH: warning for " Patchwork
2025-02-03 17:15 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-03 17:31 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-03 20:06 ` ✗ i915.CI.Full: failure " Patchwork
2025-02-12 11:49 ` [PATCH v2] drm/i915/dmc: Create debugfs entry " Mohammed Thasleem
2025-02-19 1:33 ` [v2] " Almahallawy, Khaled
2025-02-21 17:53 ` Rodrigo Vivi
2025-02-21 17:49 ` [PATCH v2] " Rodrigo Vivi
2025-02-21 18:35 ` Imre Deak
2025-02-21 18:44 ` Imre Deak
2025-02-12 14:17 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dmc: Add debugfs for dc6 counter (rev2) Patchwork
2025-02-12 14:17 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-02-12 14:51 ` ✓ i915.CI.BAT: success " Patchwork
2025-02-12 21:47 ` ✗ i915.CI.Full: failure " Patchwork
2025-03-03 19:23 ` [PATCH v3] drm/i915/dmc: Create debugfs entry for dc6 counter Mohammed Thasleem
2025-03-04 8:32 ` Jani Nikula
2025-03-04 8:33 ` Jani Nikula
2025-03-04 11:00 ` Imre Deak
2025-03-04 12:16 ` Jani Nikula
2025-03-04 12:22 ` Imre Deak
2025-03-09 8:10 ` [PATCH v4] " Mohammed Thasleem
2025-03-10 15:04 ` Imre Deak
2025-03-10 15:12 ` Imre Deak
2025-03-03 21:23 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dmc: Add debugfs for dc6 counter (rev3) Patchwork
2025-03-03 21:23 ` ✗ Fi.CI.SPARSE: " Patchwork
2025-03-03 21:42 ` ✗ i915.CI.BAT: failure " Patchwork
2025-03-09 9:28 ` ✗ i915.CI.BAT: failure for drm/i915/dmc: Add debugfs for dc6 counter (rev4) Patchwork
2025-03-12 14:43 ` [PATCH v5] drm/i915/dmc: Create debugfs entry for dc6 counter Mohammed Thasleem
2025-03-12 15:08 ` Imre Deak
2025-03-12 18:14 ` Naladala, Ramanaidu
2025-03-12 18:49 ` Imre Deak
2025-03-12 19:32 ` Naladala, Ramanaidu
2025-03-12 20:06 ` Imre Deak
2025-03-12 16:48 ` ✗ i915.CI.BAT: failure for drm/i915/dmc: Add debugfs for dc6 counter (rev5) Patchwork
2025-03-12 20:30 ` [PATCH v6] drm/i915/dmc: Create debugfs entry for dc6 counter Mohammed Thasleem
2025-03-12 20:54 ` [PATCH v7] " Mohammed Thasleem
2025-03-13 10:51 ` Jani Nikula
2025-03-12 21:17 ` ✗ i915.CI.BAT: failure for drm/i915/dmc: Add debugfs for dc6 counter (rev6) Patchwork
2025-03-12 21:52 ` ✗ i915.CI.BAT: failure for drm/i915/dmc: Add debugfs for dc6 counter (rev7) Patchwork
2025-03-14 14:56 ` ✓ i915.CI.BAT: success " Patchwork
2025-03-14 15:24 ` Patchwork
2025-03-19 11:48 ` ✓ i915.CI.Full: " Patchwork
2025-03-19 15:14 ` 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=Z6DzizSRJ_8I_B_y@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=gustavo.sousa@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mohammed.thasleem@intel.com \
/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