From: Imre Deak <imre.deak@intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>,
Mohammed Thasleem <mohammed.thasleem@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH v3] drm/i915/dmc: Create debugfs entry for dc6 counter
Date: Tue, 4 Mar 2025 14:22:09 +0200 [thread overview]
Message-ID: <Z8bwYgJ7Gch2Ldr2@ideak-desk.fi.intel.com> (raw)
In-Reply-To: <87mse1yos0.fsf@intel.com>
On Tue, Mar 04, 2025 at 02:16:15PM +0200, Jani Nikula wrote:
> On Tue, 04 Mar 2025, Imre Deak <imre.deak@intel.com> wrote:
> > On Tue, Mar 04, 2025 at 12:53:19AM +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.
> >>
> >> 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.
> >>
> >> 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_counter += dc5_current_count - dc5_start_count
> >>
> >> v2: Update the discription. (Imre)
> >> Read dc5 count during dc6 enable and disable then and update
> >> dc6 residency counter. (Imre)
> >> Remove variable from dmc structure. (Jani)
> >> Updated the subject title.
> >> v3: Add i915_power_domains lock to updated dc6 count in debugfs. (Imre)
> >> Use flags to check dc6 enable/disable states. (Imre)
> >> Move the display version check and counter read/update to
> >> a helper. (Imre)
> >> Resize the variable length. (Rodrigo)
> >> Use old dc6 debugfs entry for every platform. (Rodrigo)
> >>
> >> Signed-off-by: Mohammed Thasleem <mohammed.thasleem@intel.com>
> >> ---
> >> .../gpu/drm/i915/display/intel_display_core.h | 2 ++
> >> .../i915/display/intel_display_power_well.c | 26 +++++++++++++++++++
> >> .../i915/display/intel_display_power_well.h | 1 +
> >> drivers/gpu/drm/i915/display/intel_dmc.c | 21 ++++++++++++---
> >> 4 files changed, 47 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/gpu/drm/i915/display/intel_display_core.h b/drivers/gpu/drm/i915/display/intel_display_core.h
> >> index 554870d2494b..1608268bd9e2 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_display_core.h
> >> +++ b/drivers/gpu/drm/i915/display/intel_display_core.h
> >> @@ -490,6 +490,8 @@ struct intel_display {
> >>
> >> /* perform PHY state sanity checks? */
> >> bool chv_phy_assert[2];
> >> + unsigned int dc6_count;
> >
> > I think it's better to use dc6_allowed_count as Rodrigo suggested, not
> > regarding it as a counter for actual DC6 transitions.
> >
> >> + unsigned int dc5_start_count;
> >> } power;
> >>
> >> 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 5b60db597329..8478e687abb7 100644
> >> --- a/drivers/gpu/drm/i915/display/intel_display_power_well.c
> >> +++ b/drivers/gpu/drm/i915/display/intel_display_power_well.c
> >> @@ -17,6 +17,7 @@
> >> #include "intel_dkl_phy.h"
> >> #include "intel_dkl_phy_regs.h"
> >> #include "intel_dmc.h"
> >> +#include "intel_dmc_regs.h"
> >> #include "intel_dmc_wl.h"
> >> #include "intel_dp_aux_regs.h"
> >> #include "intel_dpio_phy.h"
> >> @@ -728,6 +729,22 @@ void gen9_sanitize_dc_state(struct intel_display *display)
> >> power_domains->dc_state = val;
> >> }
> >>
> >> +void update_dc6_count(struct intel_display *display, bool dc6_en_dis)
> >
> > Maybe rename dc6_en_dis to start_tracking?
> >
> > As Jani suggested the function should be in intel_dmc.c
>
> Well, maybe.
>
> I think the DMC register read should be in intel_dmc.c.
>
> But maybe the display->power.* handling should be in
> intel_display_power(_well).c?
I think the counters should be stored in the intel_dmc struct and the
dc6_allowed_count should be returned via an interface (for instance just
make the above function return it).
> IOW, make the functions and interfaces make sense for both. Now there's
> no logic in the division.
>
>
> BR,
> Jani.
>
> --
> Jani Nikula, Intel
next prev parent reply other threads:[~2025-03-04 12:22 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
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 [this message]
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=Z8bwYgJ7Gch2Ldr2@ideak-desk.fi.intel.com \
--to=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jani.nikula@linux.intel.com \
--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