All of lore.kernel.org
 help / color / mirror / Atom feed
From: Luca Coelho <luciano.coelho@intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: intel-xe@lists.freedesktop.org, uma.shankar@intel.com,
	ville.syrjala@linux.intel.com, jani.nikula@intel.com
Subject: [PATCH v3 3/4] drm/i915/display: add module parameter to enable DMC wakelock
Date: Mon, 18 Mar 2024 15:37:56 +0200	[thread overview]
Message-ID: <20240318133757.1479189-4-luciano.coelho@intel.com> (raw)
In-Reply-To: <20240318133757.1479189-1-luciano.coelho@intel.com>

This feature should be disabled by default until properly tested and
mature.  Add a module parameter to enable the feature for testing,
while keeping it disabled by default for now.

Signed-off-by: Luca Coelho <luciano.coelho@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_params.c |  5 +++++
 drivers/gpu/drm/i915/display/intel_display_params.h |  1 +
 drivers/gpu/drm/i915/display/intel_dmc_wl.c         | 12 ++++++++----
 3 files changed, 14 insertions(+), 4 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_params.c b/drivers/gpu/drm/i915/display/intel_display_params.c
index 11e03cfb774d..f40b223cc8a1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.c
+++ b/drivers/gpu/drm/i915/display/intel_display_params.c
@@ -116,6 +116,11 @@ intel_display_param_named_unsafe(enable_psr2_sel_fetch, bool, 0400,
 	"(0=disabled, 1=enabled) "
 	"Default: 1");
 
+intel_display_param_named_unsafe(enable_dmc_wl, bool, 0400,
+	"Enable DMC wakelock "
+	"(0=disabled, 1=enabled) "
+	"Default: 0");
+
 __maybe_unused
 static void _param_print_bool(struct drm_printer *p, const char *driver_name,
 			      const char *name, bool val)
diff --git a/drivers/gpu/drm/i915/display/intel_display_params.h b/drivers/gpu/drm/i915/display/intel_display_params.h
index 6206cc51df04..bf8dbbdb20a1 100644
--- a/drivers/gpu/drm/i915/display/intel_display_params.h
+++ b/drivers/gpu/drm/i915/display/intel_display_params.h
@@ -46,6 +46,7 @@ struct drm_i915_private;
 	param(int, enable_psr, -1, 0600) \
 	param(bool, psr_safest_params, false, 0400) \
 	param(bool, enable_psr2_sel_fetch, true, 0400) \
+	param(bool, enable_dmc_wl, false, 0400) \
 
 #define MEMBER(T, member, ...) T member;
 struct intel_display_params {
diff --git a/drivers/gpu/drm/i915/display/intel_dmc_wl.c b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
index 7c991e22c616..84d054bcb2c1 100644
--- a/drivers/gpu/drm/i915/display/intel_dmc_wl.c
+++ b/drivers/gpu/drm/i915/display/intel_dmc_wl.c
@@ -120,7 +120,8 @@ void intel_dmc_wl_enable(struct drm_i915_private *i915)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
-	if (DISPLAY_VER(i915) < 20)
+	if (!i915->display.params.enable_dmc_wl ||
+	    DISPLAY_VER(i915) < 20)
 		return;
 
 	spin_lock_irqsave(&wl->lock, flags);
@@ -146,7 +147,8 @@ void intel_dmc_wl_disable(struct drm_i915_private *i915)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
-	if (DISPLAY_VER(i915) < 20)
+	if (!i915->display.params.enable_dmc_wl ||
+	    DISPLAY_VER(i915) < 20)
 		return;
 
 	flush_delayed_work(&wl->work);
@@ -177,7 +179,8 @@ void intel_dmc_wl_get(struct drm_i915_private *i915, i915_reg_t reg)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
-	if (DISPLAY_VER(i915) < 20)
+	if (!i915->display.params.enable_dmc_wl ||
+	    DISPLAY_VER(i915) < 20)
 		return;
 
 	if (!intel_dmc_wl_check_range(reg.reg))
@@ -212,7 +215,8 @@ void intel_dmc_wl_put(struct drm_i915_private *i915, i915_reg_t reg)
 	struct intel_dmc_wl *wl = &i915->display.wl;
 	unsigned long flags;
 
-	if (DISPLAY_VER(i915) < 20)
+	if (!i915->display.params.enable_dmc_wl ||
+	    DISPLAY_VER(i915) < 20)
 		return;
 
 	if (!intel_dmc_wl_check_range(reg.reg))
-- 
2.39.2


  parent reply	other threads:[~2024-03-18 13:38 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-18 13:37 [PATCH v3 0/4] drm/i915/display: DMC wakelock implementation Luca Coelho
2024-03-18 13:37 ` [PATCH v3 1/4] drm/i915/display: add support for DMC wakelocks Luca Coelho
2024-03-21  7:43   ` Shankar, Uma
2024-03-28 11:09     ` Luca Coelho
2024-03-18 13:37 ` [PATCH v3 2/4] drm/i915/display: don't allow DMC wakelock on older hardware Luca Coelho
2024-03-21  8:02   ` Shankar, Uma
2024-04-04  9:30     ` Luca Coelho
2024-03-18 13:37 ` Luca Coelho [this message]
2024-03-21  8:08   ` [PATCH v3 3/4] drm/i915/display: add module parameter to enable DMC wakelock Shankar, Uma
2024-04-04  9:59     ` Luca Coelho
2024-03-18 13:37 ` [PATCH v3 4/4] drm/i915/display: tie DMC wakelock to DC5/6 state transitions Luca Coelho
2024-03-21  8:22   ` Shankar, Uma
2024-04-04 10:03     ` Luca Coelho
2024-03-18 20:26 ` ✓ CI.Patch_applied: success for drm/i915/display: DMC wakelock implementation (rev4) Patchwork
2024-03-18 20:26 ` ✗ CI.checkpatch: warning " Patchwork
2024-03-18 20:27 ` ✓ CI.KUnit: success " Patchwork
2024-03-18 20:38 ` ✓ CI.Build: " Patchwork
2024-03-18 20:40 ` ✓ CI.Hooks: " Patchwork
2024-03-18 20:42 ` ✗ CI.checksparse: warning " Patchwork
2024-03-18 21:03 ` ✓ CI.BAT: success " Patchwork
2024-03-18 21:36 ` ✗ Fi.CI.CHECKPATCH: warning for drm/i915/display: DMC wakelock implementation (rev2) Patchwork
2024-03-18 21:36 ` ✗ Fi.CI.SPARSE: " Patchwork
2024-03-18 21:55 ` ✗ Fi.CI.BAT: failure " Patchwork
2024-03-19 11:28   ` Luca Coelho

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=20240318133757.1479189-4-luciano.coelho@intel.com \
    --to=luciano.coelho@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=intel-xe@lists.freedesktop.org \
    --cc=jani.nikula@intel.com \
    --cc=uma.shankar@intel.com \
    --cc=ville.syrjala@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.