Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
To: intel-gfx@lists.freedesktop.org, dri-devel@lists.freedesktop.org,
	amd-gfx@lists.freedesktop.org, jani.nikula@linux.intel.com,
	ville.syrjala@linux.intel.com, harry.wentland@amd.com,
	swati2.sharma@intel.com
Subject: [Intel-gfx] [V2 2/3] drm/i915/display/debug: Expose crtc current bpc via debugfs
Date: Mon, 11 Apr 2022 15:21:28 +0530	[thread overview]
Message-ID: <20220411095129.1652096-3-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20220411095129.1652096-1-bhanuprakash.modem@intel.com>

This new debugfs will expose the currently using bpc by crtc.
It is very useful for verifying whether we enter the correct
output color depth from IGT.

This patch will also add the connector's max supported bpc to
"i915_display_info" debugfs.

Example:
cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
Current: 8

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Uma Shankar <uma.shankar@intel.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 .../drm/i915/display/intel_display_debugfs.c  | 28 +++++++++++++++++++
 1 file changed, 28 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display_debugfs.c b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
index 452d773fd4e3..6c3954479047 100644
--- a/drivers/gpu/drm/i915/display/intel_display_debugfs.c
+++ b/drivers/gpu/drm/i915/display/intel_display_debugfs.c
@@ -590,6 +590,8 @@ static void intel_connector_info(struct seq_file *m,
 	seq_puts(m, "\tHDCP version: ");
 	intel_hdcp_info(m, intel_connector);
 
+	seq_printf(m, "\tmax bpc: %u\n", connector->display_info.bpc);
+
 	intel_panel_info(m, intel_connector);
 
 	seq_printf(m, "\tmodes:\n");
@@ -2202,6 +2204,29 @@ static const struct file_operations i915_dsc_bpp_fops = {
 	.write = i915_dsc_bpp_write
 };
 
+/*
+ * Returns the Current CRTC's bpc.
+ * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/i915_current_bpc
+ */
+static int i915_current_bpc_show(struct seq_file *m, void *data)
+{
+	struct intel_crtc *crtc = to_intel_crtc(m->private);
+	struct intel_crtc_state *crtc_state;
+	int ret;
+
+	ret = drm_modeset_lock_single_interruptible(&crtc->base.mutex);
+	if (ret)
+		return ret;
+
+	crtc_state = to_intel_crtc_state(crtc->base.state);
+	seq_printf(m, "Current: %u\n", crtc_state->pipe_bpp / 3);
+
+	drm_modeset_unlock(&crtc->base.mutex);
+
+	return ret;
+}
+DEFINE_SHOW_ATTRIBUTE(i915_current_bpc);
+
 /**
  * intel_connector_debugfs_add - add i915 specific connector debugfs files
  * @connector: pointer to a registered drm_connector
@@ -2272,4 +2297,7 @@ void intel_crtc_debugfs_add(struct drm_crtc *crtc)
 
 	crtc_updates_add(crtc);
 	intel_fbc_crtc_debugfs_add(to_intel_crtc(crtc));
+
+	debugfs_create_file("i915_current_bpc", 0444, crtc->debugfs_entry, crtc,
+			    &i915_current_bpc_fops);
 }
-- 
2.35.1


  parent reply	other threads:[~2022-04-11  9:53 UTC|newest]

Thread overview: 40+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-11  9:51 [Intel-gfx] [V2 0/3] Expose max and current bpc via debugfs Bhanuprakash Modem
2022-04-11  9:51 ` [Intel-gfx] [V2 1/3] drm/debug: Expose connector's max supported " Bhanuprakash Modem
2022-04-12  3:07   ` Murthy, Arun R
2022-04-12  4:03     ` Modem, Bhanuprakash
2022-04-29 14:27   ` Murthy, Arun R
2022-05-02 11:49     ` Jani Nikula
2022-05-02 18:51   ` Harry Wentland
2022-04-11  9:51 ` Bhanuprakash Modem [this message]
2022-04-12  3:10   ` [Intel-gfx] [V2 2/3] drm/i915/display/debug: Expose crtc current " Murthy, Arun R
2022-05-16  8:39     ` Jani Nikula
2022-04-11  9:51 ` [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm Bhanuprakash Modem
2022-04-29 14:32   ` Murthy, Arun R
2022-05-02 13:28     ` Modem, Bhanuprakash
2022-05-02 13:38       ` Harry Wentland
2022-05-02 14:27         ` Modem, Bhanuprakash
2022-05-02 14:29           ` Harry Wentland
2022-05-02 18:54             ` Harry Wentland
2022-05-16  8:39               ` Jani Nikula
2022-05-18  5:38                 ` Modem, Bhanuprakash
2022-05-02 18:51   ` Harry Wentland
2022-04-11 12:40 ` [Intel-gfx] ✗ Fi.CI.BAT: failure for Expose max and current bpc via debugfs Patchwork
2022-04-13 20:39 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Expose max and current bpc via debugfs (rev2) Patchwork
2022-04-13 22:22 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-06 10:54 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev3) Patchwork
2022-05-06 11:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-06 14:03 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-05-06 15:55 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev4) Patchwork
2022-05-06 16:05 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-06 18:35 ` [Intel-gfx] ✓ Fi.CI.IGT: " Patchwork
2022-05-08 16:57 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev5) Patchwork
2022-05-08 17:21 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-08 19:53 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-09  6:36 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev6) Patchwork
2022-05-09  6:58 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-05-09 17:37 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev7) Patchwork
2022-05-09 18:03 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2022-05-10  2:16 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-05-10 11:18 ` [Intel-gfx] [V2 0/3] Expose max and current bpc via debugfs Modem, Bhanuprakash
2022-05-17  8:33 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev8) Patchwork
2022-05-19 13:51 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Expose max and current bpc via debugfs (rev9) 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=20220411095129.1652096-3-bhanuprakash.modem@intel.com \
    --to=bhanuprakash.modem@intel.com \
    --cc=amd-gfx@lists.freedesktop.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=harry.wentland@amd.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=swati2.sharma@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox