From: Gustavo Sousa <gustavo.sousa@intel.com>
To: "Deak, Imre" <imre.deak@intel.com>,
"Vivi, Rodrigo" <rodrigo.vivi@intel.com>
Cc: "Thasleem, Mohammed" <mohammed.thasleem@intel.com>,
"intel-gfx@lists.freedesktop.org"
<intel-gfx@lists.freedesktop.org>
Subject: Re: [PATCH] drm/i915/dmc: Add debugfs for dc6 counter
Date: Mon, 3 Feb 2025 18:18:29 -0300 [thread overview]
Message-ID: <173861750965.77773.16119113504082709088@intel.com> (raw)
In-Reply-To: <816975f84d2005fad3f870f9d7486f18cfef3578.camel@intel.com>
Quoting Vivi, Rodrigo (2025-02-03 17:59:19-03:00)
>On Mon, 2025-02-03 at 17:40 -0300, Gustavo Sousa wrote:
>> Quoting Vivi, Rodrigo (2025-02-03 17:23:53-03:00)
>> > On Mon, 2025-02-03 at 17:19 -0300, Gustavo Sousa wrote:
>> > > Quoting Imre Deak (2025-02-03 16:22:44-03:00)
>> > > > On Mon, Feb 03, 2025 at 12:15:26PM -0500, Rodrigo Vivi wrote:
>> > > > > > > > [...]
>> > > > > > > >
>> > > > > > > > The driver enabling DC6 is not an enough condition for
>> > > > > > > > DC6
>> > > > > > > > being allowed
>> > > > > > > > from the display side. Some display clock gating etc.
>> > > > > > > > configuration by
>> > > > > > > > the driver could be blocking it. According to the HW
>> > > > > > > > team,
>> > > > > > > > DC5 being
>> > > > > > > > entered while DC6 is enabled is a guarantee that DC6 is
>> > > > > > > > allowed from the
>> > > > > > > > display side - i.e. the driver has configured
>> > > > > > > > everything
>> > > > > > > > correctly for
>> > > > > > > > that.
>> > > > > > >
>> > > > > > > Fair enough. So IGT test case would check directly if DC5
>> > > > > > > counter is
>> > > > > > > increasing and DC6 is allowed.
>> > > > > > >
>> > > > > > > Something as simple as this in the kernel code would tell
>> > > > > > > that
>> > > > > > > DC6 is enabled:
>> > > > > > >
>> > > > > > > --- a/drivers/gpu/drm/i915/display/intel_dmc.c
>> > > > > > > +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
>> > > > > > > @@ -1294,6 +1294,10 @@ static int
>> > > > > > > intel_dmc_debugfs_status_show(struct seq_file *m, void
>> > > > > > > *unused)
>> > > > > > > seq_printf(m, "DC5 -> DC6 count: %d\n",
>> > > > > > > intel_de_read(display,
>> > > > > > > dc6_reg));
>> > > > > > >
>> > > > > > > + seq_printf(m, "DC6 allowed: %s\n",
>> > > > > > > str_yes_no((intel_de_read(display,
>> > > > > > > +
>> > > > > > >
>> > > > > > > DC_STATE_EN)
>> > > > > > > + &
>> > > > > > > 0x3)
>> > > > > > > == 2));
>> > > > > > > +
>> > > > > > >
>> > > > > > > and
>> > > > > > >
>> > > > > > > $ cat i915_dmc_info
>> > > > > > > [snip]
>> > > > > > > DC3 -> DC5 count: 286
>> > > > > > > DC5 -> DC6 count: 0
>> > > > > > > DC6 allowed: yes
>> > > > > > > [snip]
>> > > > > > >
>> > > > > > > $ cat i915_dmc_info
>> > > > > > > [snip]
>> > > > > > > DC3 -> DC5 count: 292
>> > > > > > > DC5 -> DC6 count: 0
>> > > > > > > DC6 allowed: yes
>> > > > > > > [snip]
>> > > > > > >
>> > > > > > > Thoughts?
>> > > > > >
>> > > > > > The DC5 increment could've happened while DC6 was disabled
>> > > > > > by
>> > > > > > the driver.
>> > > > >
>> > > > > Yes, it could... in general the dc6 bit would be zero, but
>> > > > > right,
>> > > > > there's
>> > > > > a possible race.
>> > > > >
>> > > > > But should we complicate things when we know that on the test
>> > > > > case itself
>> > > > > we are in full control of the modeset?! From the test
>> > > > > perspective
>> > > > > I believe
>> > > > > this would be more than enough without complicating things.
>> > > >
>> > > > Imo having a counter which works based on the condition that
>> > > > guarantees the
>> > > > display to allow DC6, would help later in debugging.
>> >
>> > yeap, it makes sense
>> >
>> > > >
>> > > > > But well, if you really believe that we need to go further in
>> > > > > the
>> > > > > driver
>> > > > > to cover that it is fine by me.
>> > > > >
>> > > > > But just to ensure that we are in the same page, could you
>> > > > > please
>> > > > > open
>> > > > > up a bit more of your idea on when to increase the dc5 sw
>> > > > > counters
>> > > > > in a way that we would ensure that we don't have race and
>> > > > > that we
>> > > > > get the dc6 allowed counter correctly?
>> > > >
>> > > > Something like the following:
>> > > >
>> > > > 1. Right after the driver sets DC6_EN, it stores the DC5 HW
>> > > > counter's
>> > > > current value:
>> > > > dc5_start = dc5_current
>> > > > 2. Right before the driver clears DC6_EN, it updates the DC6
>> > > > allowed
>> > > > counter:
>> > > > dc6_allowed += dc5_current - dc5_start
>> > > > dc5_start = dc5_current
>> > > > 3. When userspace reads the counters via debugfs the driver
>> > > > first
>> > > > updates dc6_allowed the same way as 2. did if DC6_EN is set.
>> > >
>> > > This sounds good to me.
>> >
>> > I like that as well.
>> >
>> > >
>> > > I'd like to add that we should ensure that DC6 is really being
>> > > allowed,
>> > > so that might need to be handled inside gen9_set_dc_state(),
>> > > where
>> > > allowed_dc_mask is applied.
>> >
>> > well, for that we can also have the
>> >
>> > --- a/drivers/gpu/drm/i915/display/intel_dmc.c
>> > +++ b/drivers/gpu/drm/i915/display/intel_dmc.c
>> > @@ -1294,6 +1294,10 @@ static int
>> > intel_dmc_debugfs_status_show(struct
>> > seq_file *m, void *unused)
>> > seq_printf(m, "DC5 -> DC6 count: %d\n",
>> > intel_de_read(display, dc6_reg));
>> >
>> > + seq_printf(m, "DC6 allowed: %s\n",
>> > str_yes_no((intel_de_read(display,
>> > +
>> > DC_STATE_EN)
>> > + & 0x3) ==
>> > 2));
>> >
>> > on top of what Imre suggested right?
>> > so the dc6 count is updated and also we have the live view of the
>> > register set
>>
>> Hm... Not sure if that would be required to validate that the display
>> engine was ready for DC6. I guess the dc6_allowed counter would be
>> enough.
>>
>> >
>> > no?
>> >
>> > not sure why we need to go to the dc9 func...
>>
>> Hm... dc9? Did you mean gen9_set_dc_state()?
>
>doh! I really need to stop trying work without glasses :)
>
>>
>> Function sanitizes the target value for DC_STATE_EN so that we do not
>> use a value that is not allowed (e.g. when the driver was loaded with
>> enable_dc=0).
>
>but this function is the only one that really writes the right values
>to the registers, so if we need something here, why not just reading
>the register directly?
>
>so perhaps I really missed your point on why we would need this...
Perhaps Imre can explain this better, but I believe the point is that we
want to track increments to DC5 counter when we have DC6 enabled. That
driver-managed counter would be in dc6_allowed.
Repeating Imre's suggestions with a minor tweak:
1. Before we tell the hardware that we are allowing DC6 (disable ->
DC6), we store the value of the current DC5 counter.
2. After we disable DC states from DC6 (DC6 -> disable), we read the DC5
counter again and subtract the value from (1). The result would then
be added to the current value of dc6_allowed.
In (1) I think we should read the DC5 counter before we update
DC_STATE_EN, just to be sure we avoid some sort of race (although that
appears to be unlikely to happen).
During DC6 validation, if the test sees that dc6_allowed was
incremented, that means that the display engine reached a state where
the SOC would be able to put the display in DC6.
--
Gustavo Sousa
>
>>
>> --
>> Gustavo Sousa
>>
>> >
>> > >
>> > > --
>> > > Gustavo Sousa
>> > >
>> > > >
>> > > > > Btw, while doing this experiment I noticed that the debugfs
>> > > > > and
>> > > > > test
>> > > > > also doesn't call that residency anyway and it is just count.
>> > > > > So
>> > > > > perhaps with your idea we don't need to change the debugfs
>> > > > > interface.
>> >
>
next prev parent reply other threads:[~2025-02-03 21:18 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 [this message]
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
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=173861750965.77773.16119113504082709088@intel.com \
--to=gustavo.sousa@intel.com \
--cc=imre.deak@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=mohammed.thasleem@intel.com \
--cc=rodrigo.vivi@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