All of lore.kernel.org
 help / color / mirror / Atom feed
From: Ville Syrjala <ville.syrjala@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Jani Nikula <jani.nikula@intel.com>
Subject: [Intel-gfx] [PATCH v3 4/4] drm/i915/fbc: Register per-crtc debugfs files
Date: Mon, 13 Dec 2021 17:14:35 +0200	[thread overview]
Message-ID: <20211213151435.9700-1-ville.syrjala@linux.intel.com> (raw)
In-Reply-To: <20211213134450.3082-5-ville.syrjala@linux.intel.com>

From: Ville Syrjälä <ville.syrjala@linux.intel.com>

Expose FBC debugfs files for each crtc. These may or may not point
to the same FBC instance depending on the platform.

We leave the old global debugfs files in place until
igt catches up to the new per-crtc approach.

v2: Take a trip via intel_crtc_debugfs_add() (Jani)

Cc: Jani Nikula <jani.nikula@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
---
 .../drm/i915/display/intel_display_debugfs.c  |  7 +++--
 drivers/gpu/drm/i915/display/intel_fbc.c      | 31 ++++++++++++-------
 drivers/gpu/drm/i915/display/intel_fbc.h      |  1 +
 3 files changed, 25 insertions(+), 14 deletions(-)

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 572445299b04..f4de004d470f 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -2402,6 +2402,9 @@ void intel_connector_debugfs_add(struct intel_connector *intel_connector)
  */
 void intel_crtc_debugfs_add(struct drm_crtc *crtc)
 {
-	if (crtc->debugfs_entry)
-		crtc_updates_add(crtc);
+	if (!crtc->debugfs_entry)
+		return;
+
+	crtc_updates_add(crtc);
+	intel_fbc_crtc_debugfs_add(to_intel_crtc(crtc));
 }
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.c b/drivers/gpu/drm/i915/display/intel_fbc.c
index 53c93387710c..987ea4c4b5d0 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.c
+++ b/drivers/gpu/drm/i915/display/intel_fbc.c
@@ -1798,25 +1798,32 @@ DEFINE_SIMPLE_ATTRIBUTE(intel_fbc_debugfs_false_color_fops,
 			intel_fbc_debugfs_false_color_set,
 			"%llu\n");
 
-static void intel_fbc_debugfs_add(struct intel_fbc *fbc)
+static void intel_fbc_debugfs_add(struct intel_fbc *fbc,
+				  struct dentry *parent)
 {
-	struct drm_i915_private *i915 = fbc->i915;
-	struct drm_minor *minor = i915->drm.primary;
-
-	debugfs_create_file("i915_fbc_status", 0444,
-			    minor->debugfs_root, fbc,
-			    &intel_fbc_debugfs_status_fops);
+	debugfs_create_file("i915_fbc_status", 0444, parent,
+			    fbc, &intel_fbc_debugfs_status_fops);
 
 	if (fbc->funcs->set_false_color)
-		debugfs_create_file("i915_fbc_false_color", 0644,
-				    minor->debugfs_root, fbc,
-				    &intel_fbc_debugfs_false_color_fops);
+		debugfs_create_file("i915_fbc_false_color", 0644, parent,
+				    fbc, &intel_fbc_debugfs_false_color_fops);
 }
 
+void intel_fbc_crtc_debugfs_add(struct intel_crtc *crtc)
+{
+	struct intel_plane *plane = to_intel_plane(crtc->base.primary);
+
+	if (plane->fbc)
+		intel_fbc_debugfs_add(plane->fbc, crtc->base.debugfs_entry);
+}
+
+/* FIXME: remove this once igt is on board with per-crtc stuff */
 void intel_fbc_debugfs_register(struct drm_i915_private *i915)
 {
-	struct intel_fbc *fbc = i915->fbc[INTEL_FBC_A];
+	struct drm_minor *minor = i915->drm.primary;
+	struct intel_fbc *fbc;
 
+	fbc = i915->fbc[INTEL_FBC_A];
 	if (fbc)
-		intel_fbc_debugfs_add(fbc);
+		intel_fbc_debugfs_add(fbc, minor->debugfs_root);
 }
diff --git a/drivers/gpu/drm/i915/display/intel_fbc.h b/drivers/gpu/drm/i915/display/intel_fbc.h
index 7b7631aec527..8c5a7339a27f 100644
--- a/drivers/gpu/drm/i915/display/intel_fbc.h
+++ b/drivers/gpu/drm/i915/display/intel_fbc.h
@@ -42,6 +42,7 @@ void intel_fbc_flush(struct drm_i915_private *dev_priv,
 void intel_fbc_add_plane(struct intel_fbc *fbc, struct intel_plane *plane);
 void intel_fbc_handle_fifo_underrun_irq(struct drm_i915_private *i915);
 void intel_fbc_reset_underrun(struct drm_i915_private *i915);
+void intel_fbc_crtc_debugfs_add(struct intel_crtc *crtc);
 void intel_fbc_debugfs_register(struct drm_i915_private *i915);
 
 #endif /* __INTEL_FBC_H__ */
-- 
2.32.0


  parent reply	other threads:[~2021-12-13 15:14 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-13 13:44 [Intel-gfx] [PATCH v2 0/4] drm/i915/fbc: More multi-FBC refactoring Ville Syrjala
2021-12-13 13:44 ` [Intel-gfx] [PATCH v2 1/4] drm/i915/fbc: Parametrize FBC register offsets Ville Syrjala
2021-12-13 19:54   ` Jani Nikula
2021-12-14 16:25     ` Ville Syrjälä
2021-12-14 17:27       ` Ville Syrjälä
2021-12-15  9:05         ` Sarvela, Tomi P
2021-12-15 13:25           ` Ville Syrjälä
2021-12-15 13:30             ` Sarvela, Tomi P
2021-12-15 14:11               ` Sarvela, Tomi P
2021-12-14 18:34       ` Jani Nikula
2021-12-14 18:46   ` [Intel-gfx] [PATCH v3 1/5] " Ville Syrjala
2021-12-13 13:44 ` [Intel-gfx] [PATCH v2 2/4] drm/i915/fbc: Loop through FBC instances in various places Ville Syrjala
2021-12-13 13:44 ` [Intel-gfx] [PATCH v2 3/4] drm/i915/fbc: Introduce device info fbc_mask Ville Syrjala
2021-12-13 13:44 ` [Intel-gfx] [PATCH v2 4/4] drm/i915/fbc: Register per-crtc debugfs files Ville Syrjala
2021-12-13 14:01   ` Jani Nikula
2021-12-13 15:04     ` Ville Syrjälä
2021-12-13 15:14   ` Ville Syrjala [this message]
2021-12-13 19:09     ` [Intel-gfx] [PATCH v3 " Jani Nikula
2021-12-14 18:44       ` Ville Syrjälä
2021-12-19  1:00     ` Nathan Chancellor
2021-12-21 16:05       ` Ville Syrjälä
2021-12-21 16:48         ` Nathan Chancellor
2021-12-13 18:19 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for drm/i915/fbc: More multi-FBC refactoring (rev3) Patchwork
2021-12-13 18:20 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2021-12-13 18:48 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2021-12-14  0:27 ` [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=20211213151435.9700-1-ville.syrjala@linux.intel.com \
    --to=ville.syrjala@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@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.