Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Jani Nikula <jani.nikula@intel.com>
To: Lucas De Marchi <lucas.demarchi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Subject: Re: [Intel-gfx] [PATCH 5/8] drm/i915/dmc: don't register DMC debugfs file if there's no DMC
Date: Fri, 18 Mar 2022 11:22:40 +0200	[thread overview]
Message-ID: <8735jfmx7j.fsf@intel.com> (raw)
In-Reply-To: <20220317195514.ktzq6m62s7xtxhk3@ldmartin-desk2>

On Thu, 17 Mar 2022, Lucas De Marchi <lucas.demarchi@intel.com> wrote:
> On Thu, Mar 17, 2022 at 08:36:17PM +0200, Jani Nikula wrote:
>>Register the DMC debugfs file only on platforms that support
>>DMC. There's no point in having a no-op debugfs file.
>
> It seems this would not change much the behavior (fail on open vs fail
> on read). But the code in igt is suspicious:
>
>
> 	bool igt_pm_dmc_loaded(int debugfs)
> 	{
> 		char buf[15];
> 		int len;
>
> 		len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1);
> 		if (len < 0)
> 			return true; /* no CSR support, no DMC requirement */
>
>  From a quick inspection of igt_sysfs_read() it seems it would just
> return 0 if there's nothing to be read. And it would return < 0 on
> failure to open the file.
>
> These would be the affected tests:
>
> tests/i915/i915_pm_rpm.c:
> tests/i915/i915_pm_lpsp.c:
> tests/i915/i915_pm_dc.c:
> 	igt_require(igt_pm_dmc_loaded(data.debugfs_fd));

Ok, I think I'll just drop this patch for now, don't have the time to go
down that rabbit hole...

Thanks,
Jani.

>
>
> Lucas De Marchi
>
>>
>>Signed-off-by: Jani Nikula <jani.nikula@intel.com>
>>---
>> drivers/gpu/drm/i915/display/intel_dmc.c | 6 +++---
>> 1 file changed, 3 insertions(+), 3 deletions(-)
>>
>>diff --git a/drivers/gpu/drm/i915/display/intel_dmc.c b/drivers/gpu/drm/i915/display/intel_dmc.c
>>index 5de13f978e57..8dfa2aa9f8bd 100644
>>--- a/drivers/gpu/drm/i915/display/intel_dmc.c
>>+++ b/drivers/gpu/drm/i915/display/intel_dmc.c
>>@@ -818,9 +818,6 @@ static int intel_dmc_debugfs_status_show(struct seq_file *m, void *unused)
>> 	struct intel_dmc *dmc;
>> 	i915_reg_t dc5_reg, dc6_reg = INVALID_MMIO_REG;
>>
>>-	if (!HAS_DMC(i915))
>>-		return -ENODEV;
>>-
>> 	dmc = &i915->dmc;
>>
>> 	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
>>@@ -890,6 +887,9 @@ void intel_dmc_debugfs_register(struct drm_i915_private *i915)
>> {
>> 	struct drm_minor *minor = i915->drm.primary;
>>
>>+	if (!HAS_DMC(i915))
>>+		return;
>>+
>> 	debugfs_create_file("i915_dmc_info", 0444, minor->debugfs_root,
>> 			    i915, &intel_dmc_debugfs_status_fops);
>> }
>>-- 
>>2.30.2
>>

-- 
Jani Nikula, Intel Open Source Graphics Center

  reply	other threads:[~2022-03-18  9:22 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-17 18:36 [Intel-gfx] [PATCH 0/8] drm/i915/dmc: cleanups Jani Nikula
2022-03-17 18:36 ` [Intel-gfx] [PATCH 1/8] drm/i915/dmc: simplify intel_dmc_load_program() conditions Jani Nikula
2022-03-17 19:35   ` Lucas De Marchi
2022-03-17 18:36 ` [Intel-gfx] [PATCH 2/8] drm/i915/dmc: move assert_dmc_loaded() to intel_dmc.c Jani Nikula
2022-03-17 19:36   ` Lucas De Marchi
2022-03-18  9:19     ` Jani Nikula
2022-03-18 14:49       ` Lucas De Marchi
2022-03-17 18:36 ` [Intel-gfx] [PATCH 3/8] drm/i915/dmc: move dmc debugfs " Jani Nikula
2022-03-17 19:41   ` Lucas De Marchi
2022-03-17 18:36 ` [Intel-gfx] [PATCH 4/8] drm/i915/dmc: fix i915_reg_t usage Jani Nikula
2022-03-17 19:43   ` Lucas De Marchi
2022-03-18  9:21     ` Jani Nikula
2022-03-17 18:36 ` [Intel-gfx] [PATCH 5/8] drm/i915/dmc: don't register DMC debugfs file if there's no DMC Jani Nikula
2022-03-17 19:55   ` Lucas De Marchi
2022-03-18  9:22     ` Jani Nikula [this message]
2022-03-17 18:36 ` [Intel-gfx] [PATCH 6/8] drm/i915/dmc: abstract GPU error state dump Jani Nikula
2022-03-17 19:56   ` Lucas De Marchi
2022-03-17 18:36 ` [Intel-gfx] [PATCH 7/8] drm/i915/dmc: hide DMC version macros Jani Nikula
2022-03-17 19:57   ` Lucas De Marchi
2022-03-17 18:36 ` [Intel-gfx] [PATCH 8/8] drm/i915/dmc: split out dmc registers to a separate file Jani Nikula
2022-03-17 19:59   ` Lucas De Marchi
2022-03-17 20:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/dmc: cleanups Patchwork
2022-03-17 20:37 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2022-03-17 21:16 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-03-18  1:15 ` [Intel-gfx] ✗ Fi.CI.IGT: 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=8735jfmx7j.fsf@intel.com \
    --to=jani.nikula@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lucas.demarchi@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