From: Gustavo Sousa <gustavo.sousa@intel.com>
To: Luca Coelho <luca@coelho.fi>, <intel-gfx@lists.freedesktop.org>,
<intel-xe@lists.freedesktop.org>
Subject: Re: [PATCH 3/4] drm/i915/dmc_wl: Add extra_ranges debugfs
Date: Thu, 23 Jan 2025 12:52:23 -0300 [thread overview]
Message-ID: <173764754350.34727.7322210679796237077@intel.com> (raw)
In-Reply-To: <540ff319476ce72f625d1c2205fbd4eb2f726333.camel@coelho.fi>
Quoting Luca Coelho (2025-01-22 07:19:35-03:00)
>On Fri, 2025-01-17 at 19:06 -0300, Gustavo Sousa wrote:
>> We already have a way of finding the set of untracked offsets for which
>> there has been one or more MMIO operations via the
>> "intel_dmc_wl/untracked" debugfs interface.
>>
>> However, in order to try adding one or more of those registers to the
>> set of tracked offsets, one would need to manually change the source
>> code and re-compile the driver.
>>
>> To make debugging easier, also add a "intel_dmc_wl/extra_ranges" debugfs
>> interface so that extra offsets to be tracked can be defined during
>> runtime, removing the need of re-compilation or even module reloading.
>>
>> With "intel_dmc_wl/untracked" and "intel_dmc_wl/extra_ranges", one could
>> even come up with a search algorithm to find missing offsets when
>> debugging a failing test case in a similar fashion to git-bisect. Such
>> an algorithm is subject for a future tool, probably implemented in
>> another repository (e.g. IGT).
>>
>> Signed-off-by: Gustavo Sousa <gustavo.sousa@intel.com>
>> ---
>
>Some comments below.
>
>
>[...]
>> diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.c b/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.c
>> index 41e59d775fe5..1493d296ac98 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.c
>> +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.c
>
>[...]
>> +bool intel_dmc_wl_debugfs_offset_in_extra_ranges(struct intel_display *display, u32 offset)
>> +{
>> + struct intel_dmc_wl_dbg *dbg = &display->wl.dbg;
>> + bool ret = false;
>> + unsigned long flags;
>> +
>> + spin_lock_irqsave(&dbg->lock, flags);
>> +
>> + if (!dbg->extra_ranges)
>> + goto out_unlock;
>> +
>> + for (int i = 0; dbg->extra_ranges[i].start; i++) {
>> + u32 end = dbg->extra_ranges[i].end ?: dbg->extra_ranges[i].start;
>> +
>> + if (dbg->extra_ranges[i].start <= offset && offset <= end) {
>> + ret = true;
>> + goto out_unlock;
>> + }
>> + }
>> +
>> +out_unlock:
>> + spin_unlock_irqrestore(&dbg->lock, flags);
>> +
>> + return ret;
>> +}
>
>This function is probably almost identical than the one used to check
>the hard-coded ranges, isn't it? In that case, couldn't you just pass
>the ranges array (in this case dbg->extra_ranges) to the same function?
Yeah. I thought about that when implementing this, but ended up going
with a separate implementation.
If you look at how the current series is done, there is a one-way
dependency between intel_dmc_wl_debugfs and intel_dmc_wl - the latter
depends on the former. I just didn't want to make this a circular
dependency, since the implementation is rather simple anyway...
Let me know if that convinced you :-)
>
>
>> diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.h b/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.h
>> index 9437c324966f..ae61217a2789 100644
>> --- a/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.h
>> +++ b/drivers/gpu/drm/i915/display/intel_dmc_wl_debugfs.h
>> @@ -11,6 +11,11 @@
>>
>> struct intel_display;
>>
>> +struct intel_dmc_wl_dbg_extra_range {
>> + u32 start;
>> + u32 end;
>> +};
>> +
>
>Why do you need another struct for this?
>
In the same spirit as with my answer above... I think of this much as an
implementation detail that would be better off not exposed in headers.
--
Gustavo Sousa
>[...]
>
>--
>Cheers,
>Luca.
>
next prev parent reply other threads:[~2025-01-23 15:53 UTC|newest]
Thread overview: 39+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-01-17 22:06 [PATCH 0/4] drm/i915/dmc_wl: Introduce debugfs interface Gustavo Sousa
2025-01-17 22:06 ` [PATCH 1/4] drm/i915/dmc_wl: Pass offset instead of reg to range table iterator Gustavo Sousa
2025-01-22 8:23 ` Luca Coelho
2025-01-17 22:06 ` [PATCH 2/4] drm/i915/dmc_wl: Add debugfs for untracked offsets Gustavo Sousa
2025-01-22 9:06 ` Luca Coelho
2025-01-23 14:41 ` Gustavo Sousa
2025-01-30 9:33 ` Luca Coelho
2025-01-23 16:11 ` Vivekanandan, Balasubramani
2025-01-23 16:41 ` Gustavo Sousa
2025-01-30 8:54 ` Vivekanandan, Balasubramani
2025-01-27 9:47 ` Jani Nikula
2025-01-27 11:17 ` Gustavo Sousa
2025-01-27 11:59 ` Jani Nikula
2025-01-27 12:55 ` Gustavo Sousa
2025-01-17 22:06 ` [PATCH 3/4] drm/i915/dmc_wl: Add extra_ranges debugfs Gustavo Sousa
2025-01-22 10:19 ` Luca Coelho
2025-01-23 15:52 ` Gustavo Sousa [this message]
2025-01-30 9:18 ` Luca Coelho
2025-01-30 8:30 ` Vivekanandan, Balasubramani
2025-01-30 8:49 ` Vivekanandan, Balasubramani
2025-01-17 22:06 ` [PATCH 4/4] drm/i915/dmc_wl: Enable the debugfs only with enable_dmc_wl_debugfs=1 Gustavo Sousa
2025-01-22 10:24 ` Luca Coelho
2025-01-23 16:10 ` Gustavo Sousa
2025-01-30 9:28 ` Luca Coelho
2025-01-27 12:01 ` Jani Nikula
2025-01-27 12:02 ` Jani Nikula
2025-01-27 13:24 ` Gustavo Sousa
2025-01-27 13:35 ` Jani Nikula
2025-01-27 13:50 ` Gustavo Sousa
2025-01-27 14:40 ` Jani Nikula
2025-01-30 8:46 ` Vivekanandan, Balasubramani
2025-01-17 22:14 ` ✓ CI.Patch_applied: success for drm/i915/dmc_wl: Introduce debugfs interface Patchwork
2025-01-17 22:15 ` ✗ CI.checkpatch: warning " Patchwork
2025-01-17 22:16 ` ✓ CI.KUnit: success " Patchwork
2025-01-17 22:34 ` ✓ CI.Build: " Patchwork
2025-01-17 22:36 ` ✓ CI.Hooks: " Patchwork
2025-01-17 22:38 ` ✓ CI.checksparse: " Patchwork
2025-01-17 23:06 ` ✓ Xe.CI.BAT: " Patchwork
2025-01-18 13:06 ` ✗ Xe.CI.Full: failure " 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=173764754350.34727.7322210679796237077@intel.com \
--to=gustavo.sousa@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=luca@coelho.fi \
/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