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 1/3] drm/debug: Expose connector's max supported bpc via debugfs
Date: Mon, 11 Apr 2022 09:27:03 +0530	[thread overview]
Message-ID: <20220411035703.1595171-1-bhanuprakash.modem@intel.com> (raw)
In-Reply-To: <20220408065350.1485328-2-bhanuprakash.modem@intel.com>

It's useful to know the connector's max supported bpc for IGT
testing. Expose it via a debugfs file on the connector "output_bpc".

Example: cat /sys/kernel/debug/dri/0/DP-1/output_bpc

V2:
* Fix typo in comments (Harry)

Cc: Jani Nikula <jani.nikula@linux.intel.com>
Cc: Ville Syrjälä <ville.syrjala@linux.intel.com>
Cc: Harry Wentland <harry.wentland@amd.com>
Signed-off-by: Bhanuprakash Modem <bhanuprakash.modem@intel.com>
---
 drivers/gpu/drm/drm_debugfs.c | 21 +++++++++++++++++++++
 1 file changed, 21 insertions(+)

diff --git a/drivers/gpu/drm/drm_debugfs.c b/drivers/gpu/drm/drm_debugfs.c
index 7f1b82dbaebb..fb04b7a984de 100644
--- a/drivers/gpu/drm/drm_debugfs.c
+++ b/drivers/gpu/drm/drm_debugfs.c
@@ -395,6 +395,23 @@ static int vrr_range_show(struct seq_file *m, void *data)
 }
 DEFINE_SHOW_ATTRIBUTE(vrr_range);
 
+/*
+ * Returns Connector's max supported bpc through debugfs file.
+ * Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc
+ */
+static int output_bpc_show(struct seq_file *m, void *data)
+{
+	struct drm_connector *connector = m->private;
+
+	if (connector->status != connector_status_connected)
+		return -ENODEV;
+
+	seq_printf(m, "Maximum: %u\n", connector->display_info.bpc);
+
+	return 0;
+}
+DEFINE_SHOW_ATTRIBUTE(output_bpc);
+
 static const struct file_operations drm_edid_fops = {
 	.owner = THIS_MODULE,
 	.open = edid_open,
@@ -437,6 +454,10 @@ void drm_debugfs_connector_add(struct drm_connector *connector)
 	debugfs_create_file("vrr_range", S_IRUGO, root, connector,
 			    &vrr_range_fops);
 
+	/* max bpc */
+	debugfs_create_file("output_bpc", 0444, root, connector,
+			    &output_bpc_fops);
+
 	if (connector->funcs->debugfs_init)
 		connector->funcs->debugfs_init(connector, root);
 }
-- 
2.35.1


  parent reply	other threads:[~2022-04-11  3:59 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-08  6:53 [Intel-gfx] [PATCH 0/3] Expose max and current bpc via debugfs Bhanuprakash Modem
2022-04-08  6:53 ` [Intel-gfx] [PATCH 1/3] drm/debug: Expose connector's max supported " Bhanuprakash Modem
2022-04-08 15:02   ` Harry Wentland
2022-04-08 15:25     ` Modem, Bhanuprakash
2022-04-11  3:57   ` Bhanuprakash Modem [this message]
2022-04-08  6:53 ` [Intel-gfx] [PATCH 2/3] drm/i915/display/debug: Expose crtc current " Bhanuprakash Modem
2022-04-08  6:53 ` [Intel-gfx] [PATCH 3/3] drm/amd/display: Move connector debugfs to drm Bhanuprakash Modem
2022-04-08 12:56   ` kernel test robot
2022-04-08 15:03   ` Harry Wentland
2022-04-08 15:23     ` Modem, Bhanuprakash
2022-04-08 15:25       ` Harry Wentland
2022-04-08 12:54 ` [Intel-gfx] ✗ Fi.CI.SPARSE: warning for Expose max and current bpc via debugfs Patchwork
2022-04-08 13:27 ` [Intel-gfx] ✗ Fi.CI.BAT: failure " Patchwork
2022-04-11  4:46 ` [Intel-gfx] ✓ Fi.CI.BAT: success for Expose max and current bpc via debugfs (rev2) Patchwork
2022-04-11  6:02 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
2022-04-11  9:48 ` [Intel-gfx] [V2 0/3] Expose max and current bpc via debugfs Bhanuprakash Modem
  -- strict thread matches above, loose matches on Subject: below --
2022-04-11  9:51 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

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=20220411035703.1595171-1-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