All of lore.kernel.org
 help / color / mirror / Atom feed
From: Matt Roper <matthew.d.roper@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [Intel-gfx] [RFC v3] drm/i915/tgl: Suppress DC5/DC6 around DSB usage
Date: Mon, 27 Jan 2020 12:50:57 -0800	[thread overview]
Message-ID: <20200127205057.831198-1-matthew.d.roper@intel.com> (raw)
In-Reply-To: <20200124225922.644673-1-matthew.d.roper@intel.com>

There are reports of unexpected DSB busy/timeout happening after IGT
tests finish running that apparently go away when the DMC firmware isn't
loaded.  The bspec doesn't say anything specific about DSB needing us to
exit DC5/DC6, but let's try adding DSB usage to the "DC off" list and
see if that changes the behavior.

v2: Include intel_wakeref.h from intel_dsb.h to ensure the header stays
    self-contained.  (CI)

v3: Move intel_display_power_get() call earlier to cover cases where
    dsb->refcount is already non-zero and we return early.  Also don't
    drop the wakeref at the end of the 'get' routine; wait until the
    'put' for that, even in error conditions.  (Swati)

Cc: Swati Sharma <swati2.sharma@intel.com>
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Reviewed-by(v1): José Roberto de Souza <jose.souza@intel.com>
---
 drivers/gpu/drm/i915/display/intel_display_power.c |  3 +++
 drivers/gpu/drm/i915/display/intel_display_power.h |  1 +
 drivers/gpu/drm/i915/display/intel_dsb.c           | 10 ++++------
 drivers/gpu/drm/i915/display/intel_dsb.h           |  2 ++
 4 files changed, 10 insertions(+), 6 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_power.c b/drivers/gpu/drm/i915/display/intel_display_power.c
index 761be9fcaf10..99e6afda2db9 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.c
+++ b/drivers/gpu/drm/i915/display/intel_display_power.c
@@ -150,6 +150,8 @@ intel_display_power_domain_str(enum intel_display_power_domain domain)
 		return "GT_IRQ";
 	case POWER_DOMAIN_DPLL_DC_OFF:
 		return "DPLL_DC_OFF";
+	case POWER_DOMAIN_DSB:
+		return "DSB";
 	default:
 		MISSING_CASE(domain);
 		return "?";
@@ -2679,6 +2681,7 @@ void intel_display_power_put(struct drm_i915_private *dev_priv,
 	BIT_ULL(POWER_DOMAIN_AUX_A) |			\
 	BIT_ULL(POWER_DOMAIN_AUX_B) |			\
 	BIT_ULL(POWER_DOMAIN_AUX_C) |			\
+	BIT_ULL(POWER_DOMAIN_DSB) |			\
 	BIT_ULL(POWER_DOMAIN_INIT))
 
 #define TGL_DDI_IO_D_TC1_POWER_DOMAINS (	\
diff --git a/drivers/gpu/drm/i915/display/intel_display_power.h b/drivers/gpu/drm/i915/display/intel_display_power.h
index 2608a65af7fa..5e8136c65e02 100644
--- a/drivers/gpu/drm/i915/display/intel_display_power.h
+++ b/drivers/gpu/drm/i915/display/intel_display_power.h
@@ -77,6 +77,7 @@ enum intel_display_power_domain {
 	POWER_DOMAIN_GT_IRQ,
 	POWER_DOMAIN_DPLL_DC_OFF,
 	POWER_DOMAIN_INIT,
+	POWER_DOMAIN_DSB,
 
 	POWER_DOMAIN_NUM,
 };
diff --git a/drivers/gpu/drm/i915/display/intel_dsb.c b/drivers/gpu/drm/i915/display/intel_dsb.c
index ada006a690df..b47c31fa2551 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.c
+++ b/drivers/gpu/drm/i915/display/intel_dsb.c
@@ -103,16 +103,15 @@ intel_dsb_get(struct intel_crtc *crtc)
 	struct drm_i915_gem_object *obj;
 	struct i915_vma *vma;
 	u32 *buf;
-	intel_wakeref_t wakeref;
 
 	if (!HAS_DSB(i915))
 		return dsb;
 
+	dsb->wakeref = intel_display_power_get(i915, POWER_DOMAIN_DSB);
+
 	if (dsb->refcount++ != 0)
 		return dsb;
 
-	wakeref = intel_runtime_pm_get(&i915->runtime_pm);
-
 	obj = i915_gem_object_create_internal(i915, DSB_BUF_SIZE);
 	if (IS_ERR(obj)) {
 		DRM_ERROR("Gem object creation failed\n");
@@ -143,9 +142,6 @@ intel_dsb_get(struct intel_crtc *crtc)
 	 * corresponding intel_dsb_put(): the important error message will
 	 * already be logged above.
 	 */
-
-	intel_runtime_pm_put(&i915->runtime_pm, wakeref);
-
 	return dsb;
 }
 
@@ -174,6 +170,8 @@ void intel_dsb_put(struct intel_dsb *dsb)
 		dsb->free_pos = 0;
 		dsb->ins_start_offset = 0;
 	}
+
+	intel_display_power_put(i915, POWER_DOMAIN_DSB, dsb->wakeref);
 }
 
 /**
diff --git a/drivers/gpu/drm/i915/display/intel_dsb.h b/drivers/gpu/drm/i915/display/intel_dsb.h
index 395ef9ce558e..ffb5afa935b7 100644
--- a/drivers/gpu/drm/i915/display/intel_dsb.h
+++ b/drivers/gpu/drm/i915/display/intel_dsb.h
@@ -9,6 +9,7 @@
 #include <linux/types.h>
 
 #include "i915_reg.h"
+#include "intel_wakeref.h"
 
 struct intel_crtc;
 struct i915_vma;
@@ -26,6 +27,7 @@ struct intel_dsb {
 	enum dsb_id id;
 	u32 *cmd_buf;
 	struct i915_vma *vma;
+	intel_wakeref_t wakeref;
 
 	/*
 	 * free_pos will point the first free entry position
-- 
2.23.0

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2020-01-27 20:51 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-24 19:53 [Intel-gfx] [RFC] drm/i915/tgl: Suppress DC5/DC6 around DSB usage Matt Roper
2020-01-24 20:46 ` Souza, Jose
2020-01-24 22:47 ` [Intel-gfx] ✗ Fi.CI.BUILD: failure for " Patchwork
2020-01-24 22:59 ` [Intel-gfx] [RFC v2] " Matt Roper
2020-01-27 20:50   ` Matt Roper [this message]
2020-01-28 22:12     ` [Intel-gfx] [RFC v3] " Matt Roper
2020-01-25  0:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/tgl: Suppress DC5/DC6 around DSB usage (rev2) Patchwork
2020-01-27 14:30 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2020-01-28  2:22 ` [Intel-gfx] ✓ Fi.CI.BAT: success for drm/i915/tgl: Suppress DC5/DC6 around DSB usage (rev3) Patchwork
2020-01-29  1:02 ` [Intel-gfx] ✓ Fi.CI.IGT: " 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=20200127205057.831198-1-matthew.d.roper@intel.com \
    --to=matthew.d.roper@intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.