This series will expose the Connector's max supported bpc via connector debugfs and Crtc's current bpc via crtc debugfs. Also move the existing vendor specific "output_bpc" logic to drm.
Test-with: 20220411094147.1650859-2-bhanuprakash.modem@intel.com
Bhanuprakash Modem (3): drm/debug: Expose connector's max supported bpc via debugfs drm/i915/display/debug: Expose crtc current bpc via debugfs drm/amd/display: Move connector debugfs to drm
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 -- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 38 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.h | 2 - drivers/gpu/drm/drm_debugfs.c | 21 ++++++++++ .../drm/i915/display/intel_display_debugfs.c | 28 ++++++++++++++ 5 files changed, 62 insertions(+), 31 deletions(-)
-- 2.35.1
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); }
+static int output_bpc_show(struct seq_file *m, void *data) {
Would it be better to have this function name as drm_output_bpc_show()
Thanks and Regards, Arun R Murthy --------------------
On Tue-12-04-2022 08:37 am, Murthy, Arun R wrote:
+static int output_bpc_show(struct seq_file *m, void *data) {
Would it be better to have this function name as drm_output_bpc_show()
As we are using DEFINE_SHOW_ATTRIBUTE() to define file_operations, this function name must be <debugfs name>_show(). Otherwise, either we need to define new file_operations to use the suggested name or rename the debugfs name to "drm_output_bpc"
Also, to align/maintain uniform with other debugfs, I think it's ok to use output_bpc_show().
- Bhanu
Thanks and Regards, Arun R Murthy
+static int output_bpc_show(struct seq_file *m, void *data) {
Can we have a meaningful name instead of 'm' ? Upon changing this parameter name, you can have my Reviewed-By: Arun R Murthy arun.r.murthy@intel.com
Thanks and Regards, Arun R Murthy --------------------
On Fri, 29 Apr 2022, "Murthy, Arun R" arun.r.murthy@intel.com wrote:
+static int output_bpc_show(struct seq_file *m, void *data) {
Can we have a meaningful name instead of 'm' ? Upon changing this parameter name, you can have my Reviewed-By: Arun R Murthy arun.r.murthy@intel.com
Please keep 'm'. It's by far the most common name for struct seq_file * in the kernel:
$ git grep -o "struct seq_file *[a-zA-Z0-9_]+" | sed 's/^.*:struct seq_file *//' | sort | uniq -c | sort -rn | head -5 2212 m 1219 seq 1126 s 135 sf 121 file
BR, Jani.
On 2022-04-11 05:51, Bhanuprakash Modem wrote:
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
Reviewed-by: Harry Wentland harry.wentland@amd.com
Harry
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);
}
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); }
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Subject: [Intel-gfx] [V2 2/3] drm/i915/display/debug: Expose crtc current bpc via debugfs
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
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks and Regards, Arun R Murthy -------------------
On Tue, 12 Apr 2022, "Murthy, Arun R" arun.r.murthy@intel.com wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Subject: [Intel-gfx] [V2 2/3] drm/i915/display/debug: Expose crtc current bpc via debugfs
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
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Acked-by: Jani Nikula jani.nikula@intel.com
for merging this via drm-misc-next.
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com --- .../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 -- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 38 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.h | 2 - 3 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 73423b805b54..f89651c71ec7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6615,14 +6615,12 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc) return &state->base; }
-#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY static int amdgpu_dm_crtc_late_register(struct drm_crtc *crtc) { crtc_debugfs_init(crtc);
return 0; } -#endif
static inline int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable) { @@ -6720,9 +6718,7 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .enable_vblank = dm_enable_vblank, .disable_vblank = dm_disable_vblank, .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp, -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) .late_register = amdgpu_dm_crtc_late_register, -#endif };
static enum drm_connector_status diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index da17ece1a2c5..3ee26083920b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -873,28 +873,18 @@ static int psr_capability_show(struct seq_file *m, void *data) }
/* - * Returns the current and maximum output bpc for the connector. - * Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc + * Returns the current bpc for the crtc. + * Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_bpc */ -static int output_bpc_show(struct seq_file *m, void *data) +static int amdgpu_current_bpc_show(struct seq_file *m, void *data) { - struct drm_connector *connector = m->private; - struct drm_device *dev = connector->dev; - struct drm_crtc *crtc = NULL; + struct drm_crtc *crtc = m->private; + struct drm_device *dev = crtc->dev; struct dm_crtc_state *dm_crtc_state = NULL; int res = -ENODEV; unsigned int bpc;
mutex_lock(&dev->mode_config.mutex); - drm_modeset_lock(&dev->mode_config.connection_mutex, NULL); - - if (connector->state == NULL) - goto unlock; - - crtc = connector->state->crtc; - if (crtc == NULL) - goto unlock; - drm_modeset_lock(&crtc->mutex, NULL); if (crtc->state == NULL) goto unlock; @@ -924,18 +914,15 @@ static int output_bpc_show(struct seq_file *m, void *data) }
seq_printf(m, "Current: %u\n", bpc); - seq_printf(m, "Maximum: %u\n", connector->display_info.bpc); res = 0;
unlock: - if (crtc) - drm_modeset_unlock(&crtc->mutex); - - drm_modeset_unlock(&dev->mode_config.connection_mutex); + drm_modeset_unlock(&crtc->mutex); mutex_unlock(&dev->mode_config.mutex);
return res; } +DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc);
/* * Example usage: @@ -2541,7 +2528,6 @@ static int target_backlight_show(struct seq_file *m, void *unused) DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support); DEFINE_SHOW_ATTRIBUTE(dmub_fw_state); DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer); -DEFINE_SHOW_ATTRIBUTE(output_bpc); DEFINE_SHOW_ATTRIBUTE(dp_lttpr_status); #ifdef CONFIG_DRM_AMD_DC_HDCP DEFINE_SHOW_ATTRIBUTE(hdcp_sink_capability); @@ -2788,7 +2774,6 @@ static const struct { const struct file_operations *fops; } connector_debugfs_entries[] = { {"force_yuv420_output", &force_yuv420_output_fops}, - {"output_bpc", &output_bpc_fops}, {"trigger_hotplug", &trigger_hotplug_debugfs_fops}, {"internal_display", &internal_display_fops} }; @@ -3172,9 +3157,10 @@ static int crc_win_update_get(void *data, u64 *val)
DEFINE_DEBUGFS_ATTRIBUTE(crc_win_update_fops, crc_win_update_get, crc_win_update_set, "%llu\n"); - +#endif void crtc_debugfs_init(struct drm_crtc *crtc) { +#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY struct dentry *dir = debugfs_lookup("crc", crtc->debugfs_entry);
if (!dir) @@ -3190,9 +3176,11 @@ void crtc_debugfs_init(struct drm_crtc *crtc) &crc_win_y_end_fops); debugfs_create_file_unsafe("crc_win_update", 0644, dir, crtc, &crc_win_update_fops); - -} #endif + debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry, + crtc, &amdgpu_current_bpc_fops); +} + /* * Writes DTN log state to the user supplied buffer. * Example usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h index 3366cb644053..071200473c27 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h @@ -31,8 +31,6 @@
void connector_debugfs_init(struct amdgpu_dm_connector *connector); void dtn_debugfs_init(struct amdgpu_device *adev); -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) void crtc_debugfs_init(struct drm_crtc *crtc); -#endif
#endif
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks and Regards, Arun R Murthy --------------------
On Fri-29-04-2022 08:02 pm, Murthy, Arun R wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks Arun,
@Harry/@Rodrigo, If this change sounds good to you, can you please help to push it?
- Bhanu
Thanks and Regards, Arun R Murthy
On 2022-05-02 09:28, Modem, Bhanuprakash wrote:
On Fri-29-04-2022 08:02 pm, Murthy, Arun R wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks Arun,
@Harry/@Rodrigo, If this change sounds good to you, can you please help to push it?
This changes the output_bpc debugfs behavior on amdgpu and breaks the amd_max_bpc IGT test. I don't think we should merge this as-is.
This patch also seems dependent on patch 1 of the series. Shouldn't they be merged together (please don't merge them as-is, though)?
Harry
- Bhanu
Thanks and Regards, Arun R Murthy
On Mon-02-05-2022 07:08 pm, Harry Wentland wrote:
On 2022-05-02 09:28, Modem, Bhanuprakash wrote:
On Fri-29-04-2022 08:02 pm, Murthy, Arun R wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks Arun,
@Harry/@Rodrigo, If this change sounds good to you, can you please help to push it?
This changes the output_bpc debugfs behavior on amdgpu and breaks the amd_max_bpc IGT test. I don't think we should merge this as-is.
Yeah, I have floated the IGT changes to support this series: https://patchwork.freedesktop.org/series/102387/
With this IGT change, we can merge this series as-is. I would like to request you to review IGT patches too.
This patch also seems dependent on patch 1 of the series. Shouldn't they be merged together (please don't merge them as-is, though)?
Yes, as other patches in this series are already reviewed, I think we need to plan to merge all patches in this series together (If above IGT & this patch looks good to you).
- Bhanu
Harry
- Bhanu
Thanks and Regards, Arun R Murthy
On 2022-05-02 10:27, Modem, Bhanuprakash wrote:
On Mon-02-05-2022 07:08 pm, Harry Wentland wrote:
On 2022-05-02 09:28, Modem, Bhanuprakash wrote:
On Fri-29-04-2022 08:02 pm, Murthy, Arun R wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks Arun,
@Harry/@Rodrigo, If this change sounds good to you, can you please help to push it?
This changes the output_bpc debugfs behavior on amdgpu and breaks the amd_max_bpc IGT test. I don't think we should merge this as-is.
Yeah, I have floated the IGT changes to support this series: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork....
With this IGT change, we can merge this series as-is. I would like to request you to review IGT patches too.
This patch also seems dependent on patch 1 of the series. Shouldn't they be merged together (please don't merge them as-is, though)?
Yes, as other patches in this series are already reviewed, I think we need to plan to merge all patches in this series together (If above IGT & this patch looks good to you).
Thanks for the context again and apologies I haven't had the time to have a closer look so far. I'll go over these and the IGT patches today and get back to you.
Harry
- Bhanu
Harry
- Bhanu
Thanks and Regards, Arun R Murthy
On 2022-05-02 10:29, Harry Wentland wrote:
On 2022-05-02 10:27, Modem, Bhanuprakash wrote:
On Mon-02-05-2022 07:08 pm, Harry Wentland wrote:
On 2022-05-02 09:28, Modem, Bhanuprakash wrote:
On Fri-29-04-2022 08:02 pm, Murthy, Arun R wrote:
-----Original Message----- From: Intel-gfx intel-gfx-bounces@lists.freedesktop.org On Behalf Of Bhanuprakash Modem Sent: Monday, April 11, 2022 3:21 PM 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; Sharma, Swati2 swati2.sharma@intel.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Subject: [Intel-gfx] [V2 3/3] drm/amd/display: Move connector debugfs to drm
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Arun R Murthy arun.r.murthy@intel.com
Thanks Arun,
@Harry/@Rodrigo, If this change sounds good to you, can you please help to push it?
This changes the output_bpc debugfs behavior on amdgpu and breaks the amd_max_bpc IGT test. I don't think we should merge this as-is.
Yeah, I have floated the IGT changes to support this series: https://nam11.safelinks.protection.outlook.com/?url=https%3A%2F%2Fpatchwork....
With this IGT change, we can merge this series as-is. I would like to request you to review IGT patches too.
This patch also seems dependent on patch 1 of the series. Shouldn't they be merged together (please don't merge them as-is, though)?
Yes, as other patches in this series are already reviewed, I think we need to plan to merge all patches in this series together (If above IGT & this patch looks good to you).
Thanks for the context again and apologies I haven't had the time to have a closer look so far. I'll go over these and the IGT patches today and get back to you.
Both the kernel and IGT series look good to me.
I recommend you merge the entire kernel set as one into drm-next. We can pull it into amd-staging-drm-next so as not to break our CI once the IGT patches land.
Harry
Harry
- Bhanu
Harry
- Bhanu
Thanks and Regards, Arun R Murthy
On Mon, 02 May 2022, Harry Wentland harry.wentland@amd.com wrote:
Both the kernel and IGT series look good to me.
I recommend you merge the entire kernel set as one into drm-next. We can pull it into amd-staging-drm-next so as not to break our CI once the IGT patches land.
Can we read that as an ack to merge via drm-misc-next? :)
BR, Jani.
On Mon-16-05-2022 02:09 pm, Jani Nikula wrote:
On Mon, 02 May 2022, Harry Wentland harry.wentland@amd.com wrote:
Both the kernel and IGT series look good to me.
I recommend you merge the entire kernel set as one into drm-next. We can pull it into amd-staging-drm-next so as not to break our CI once the IGT patches land.
@Harry
Can we have your Ack-by to merge this series via drm-misc-next? IGT patches are already landed. :-)
- Bhanu
Can we read that as an ack to merge via drm-misc-next? :)
BR, Jani.
On 5/18/22 01:38, Modem, Bhanuprakash wrote:
On Mon-16-05-2022 02:09 pm, Jani Nikula wrote:
On Mon, 02 May 2022, Harry Wentland harry.wentland@amd.com wrote:
Both the kernel and IGT series look good to me.
I recommend you merge the entire kernel set as one into drm-next. We can pull it into amd-staging-drm-next so as not to break our CI once the IGT patches land.
@Harry
Can we have your Ack-by to merge this series via drm-misc-next? IGT patches are already landed. :-)
Sure. :)
Acked-by: Harry Wentland harry.wentland@amd.com
Harry
- Bhanu
Can we read that as an ack to merge via drm-misc-next? :)
BR, Jani.
On 2022-04-11 05:51, Bhanuprakash Modem wrote:
As drm_connector already have the display_info, instead of creating "output_bpc" debugfs in vendor specific driver, move the logic to the drm layer.
This patch will also move "Current" bpc to the crtc debugfs from connector debugfs, since we are getting this info from crtc_state.
Cc: Harry Wentland harry.wentland@amd.com Cc: Rodrigo Siqueira Rodrigo.Siqueira@amd.com Signed-off-by: Bhanuprakash Modem bhanuprakash.modem@intel.com Reported-by: kernel test robot lkp@intel.com
Reviewed-by: Harry Wentland harry.wentland@amd.com
Harry
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 -- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 38 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.h | 2 - 3 files changed, 13 insertions(+), 31 deletions(-)
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c index 73423b805b54..f89651c71ec7 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c @@ -6615,14 +6615,12 @@ dm_crtc_duplicate_state(struct drm_crtc *crtc) return &state->base; }
-#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY static int amdgpu_dm_crtc_late_register(struct drm_crtc *crtc) { crtc_debugfs_init(crtc);
return 0; } -#endif
static inline int dm_set_vupdate_irq(struct drm_crtc *crtc, bool enable) { @@ -6720,9 +6718,7 @@ static const struct drm_crtc_funcs amdgpu_dm_crtc_funcs = { .enable_vblank = dm_enable_vblank, .disable_vblank = dm_disable_vblank, .get_vblank_timestamp = drm_crtc_vblank_helper_get_vblank_timestamp, -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) .late_register = amdgpu_dm_crtc_late_register, -#endif };
static enum drm_connector_status diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c index da17ece1a2c5..3ee26083920b 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.c @@ -873,28 +873,18 @@ static int psr_capability_show(struct seq_file *m, void *data) }
/*
- Returns the current and maximum output bpc for the connector.
- Example usage: cat /sys/kernel/debug/dri/0/DP-1/output_bpc
- Returns the current bpc for the crtc.
*/
- Example usage: cat /sys/kernel/debug/dri/0/crtc-0/amdgpu_current_bpc
-static int output_bpc_show(struct seq_file *m, void *data) +static int amdgpu_current_bpc_show(struct seq_file *m, void *data) {
- struct drm_connector *connector = m->private;
- struct drm_device *dev = connector->dev;
- struct drm_crtc *crtc = NULL;
struct drm_crtc *crtc = m->private;
struct drm_device *dev = crtc->dev; struct dm_crtc_state *dm_crtc_state = NULL; int res = -ENODEV; unsigned int bpc;
mutex_lock(&dev->mode_config.mutex);
- drm_modeset_lock(&dev->mode_config.connection_mutex, NULL);
- if (connector->state == NULL)
goto unlock;
- crtc = connector->state->crtc;
- if (crtc == NULL)
goto unlock;
- drm_modeset_lock(&crtc->mutex, NULL); if (crtc->state == NULL) goto unlock;
@@ -924,18 +914,15 @@ static int output_bpc_show(struct seq_file *m, void *data) }
seq_printf(m, "Current: %u\n", bpc);
- seq_printf(m, "Maximum: %u\n", connector->display_info.bpc); res = 0;
unlock:
- if (crtc)
drm_modeset_unlock(&crtc->mutex);
- drm_modeset_unlock(&dev->mode_config.connection_mutex);
drm_modeset_unlock(&crtc->mutex); mutex_unlock(&dev->mode_config.mutex);
return res;
} +DEFINE_SHOW_ATTRIBUTE(amdgpu_current_bpc);
/*
- Example usage:
@@ -2541,7 +2528,6 @@ static int target_backlight_show(struct seq_file *m, void *unused) DEFINE_SHOW_ATTRIBUTE(dp_dsc_fec_support); DEFINE_SHOW_ATTRIBUTE(dmub_fw_state); DEFINE_SHOW_ATTRIBUTE(dmub_tracebuffer); -DEFINE_SHOW_ATTRIBUTE(output_bpc); DEFINE_SHOW_ATTRIBUTE(dp_lttpr_status); #ifdef CONFIG_DRM_AMD_DC_HDCP DEFINE_SHOW_ATTRIBUTE(hdcp_sink_capability); @@ -2788,7 +2774,6 @@ static const struct { const struct file_operations *fops; } connector_debugfs_entries[] = { {"force_yuv420_output", &force_yuv420_output_fops},
{"trigger_hotplug", &trigger_hotplug_debugfs_fops}, {"internal_display", &internal_display_fops}{"output_bpc", &output_bpc_fops},
}; @@ -3172,9 +3157,10 @@ static int crc_win_update_get(void *data, u64 *val)
DEFINE_DEBUGFS_ATTRIBUTE(crc_win_update_fops, crc_win_update_get, crc_win_update_set, "%llu\n");
+#endif void crtc_debugfs_init(struct drm_crtc *crtc) { +#ifdef CONFIG_DRM_AMD_SECURE_DISPLAY struct dentry *dir = debugfs_lookup("crc", crtc->debugfs_entry);
if (!dir) @@ -3190,9 +3176,11 @@ void crtc_debugfs_init(struct drm_crtc *crtc) &crc_win_y_end_fops); debugfs_create_file_unsafe("crc_win_update", 0644, dir, crtc, &crc_win_update_fops);
-} #endif
- debugfs_create_file("amdgpu_current_bpc", 0644, crtc->debugfs_entry,
crtc, &amdgpu_current_bpc_fops);
+}
/*
- Writes DTN log state to the user supplied buffer.
- Example usage: cat /sys/kernel/debug/dri/0/amdgpu_dm_dtn_log
diff --git a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h index 3366cb644053..071200473c27 100644 --- a/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h +++ b/drivers/gpu/drm/amd/display/amdgpu_dm/amdgpu_dm_debugfs.h @@ -31,8 +31,6 @@
void connector_debugfs_init(struct amdgpu_dm_connector *connector); void dtn_debugfs_init(struct amdgpu_device *adev); -#if defined(CONFIG_DRM_AMD_SECURE_DISPLAY) void crtc_debugfs_init(struct drm_crtc *crtc); -#endif
#endif
Hi Jani,
Can you please help to push this series to drm-next? CI result: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_102502v7/index.html?
I'll merge IGT changes [1] first, so that we won't break the CI.
[1]: https://patchwork.freedesktop.org/series/102387/
- Bhanu
On Mon-11-04-2022 03:21 pm, Bhanuprakash Modem wrote:
This series will expose the Connector's max supported bpc via connector debugfs and Crtc's current bpc via crtc debugfs. Also move the existing vendor specific "output_bpc" logic to drm.
Test-with: 20220411094147.1650859-2-bhanuprakash.modem@intel.com
Bhanuprakash Modem (3): drm/debug: Expose connector's max supported bpc via debugfs drm/i915/display/debug: Expose crtc current bpc via debugfs drm/amd/display: Move connector debugfs to drm
.../gpu/drm/amd/display/amdgpu_dm/amdgpu_dm.c | 4 -- .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.c | 38 +++++++------------ .../amd/display/amdgpu_dm/amdgpu_dm_debugfs.h | 2 - drivers/gpu/drm/drm_debugfs.c | 21 ++++++++++ .../drm/i915/display/intel_display_debugfs.c | 28 ++++++++++++++ 5 files changed, 62 insertions(+), 31 deletions(-)
-- 2.35.1
dri-devel@lists.freedesktop.org