diff mbox series

[v2,2/2] drm/i915/display: debugfs entry to control ignore long hpd flag

Message ID 20221010083447.139768-3-vinod.govindapillai@intel.com (mailing list archive)
State New, archived
Headers show
Series Provision to ignore long HPDs in CI systems | expand

Commit Message

Vinod Govindapillai Oct. 10, 2022, 8:34 a.m. UTC
Knob to control ignoring the long hpds. Set this to true will
start ignoring the long HPDs generated by the displays. Useful
for use cases like CI systems where we dont expect to disconnect
the panels.

v2: Address patch styling comments (Jani Nikula)

Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>
---
 drivers/gpu/drm/i915/display/intel_hotplug.c | 25 ++++++++++++++++++++
 1 file changed, 25 insertions(+)

Comments

Andrzej Hajda Oct. 10, 2022, 12:10 p.m. UTC | #1
On 10.10.2022 10:34, Vinod Govindapillai wrote:
> Knob to control ignoring the long hpds. Set this to true will
> start ignoring the long HPDs generated by the displays. Useful
> for use cases like CI systems where we dont expect to disconnect
> the panels.
> 
> v2: Address patch styling comments (Jani Nikula)
> 
> Signed-off-by: Vinod Govindapillai <vinod.govindapillai@intel.com>


Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>

Regards
Andrzej

> ---
>   drivers/gpu/drm/i915/display/intel_hotplug.c | 25 ++++++++++++++++++++
>   1 file changed, 25 insertions(+)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
> index 352a1b53b63e..45c67f0f1c9f 100644
> --- a/drivers/gpu/drm/i915/display/intel_hotplug.c
> +++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
> @@ -936,6 +936,29 @@ static const struct file_operations i915_hpd_short_storm_ctl_fops = {
>   	.write = i915_hpd_short_storm_ctl_write,
>   };
>   
> +static int i915_ignore_long_hpd_set(void *data, u64 val)
> +{
> +	struct drm_i915_private *i915 = data;
> +
> +	drm_dbg_kms(&i915->drm, "Ignoring long HPDs: %s\n", str_yes_no(val));
> +
> +	i915->display.hotplug.ignore_long_hpd = val;
> +
> +	return 0;
> +}
> +
> +static int i915_ignore_long_hpd_get(void *data, u64 *val)
> +{
> +	struct drm_i915_private *i915 = data;
> +
> +	*val = i915->display.hotplug.ignore_long_hpd;
> +
> +	return 0;
> +}
> +
> +DEFINE_SIMPLE_ATTRIBUTE(i915_ignore_long_hpd_fops, i915_ignore_long_hpd_get,
> +			i915_ignore_long_hpd_set, "%llu\n");
> +
>   void intel_hpd_debugfs_register(struct drm_i915_private *i915)
>   {
>   	struct drm_minor *minor = i915->drm.primary;
> @@ -944,4 +967,6 @@ void intel_hpd_debugfs_register(struct drm_i915_private *i915)
>   			    i915, &i915_hpd_storm_ctl_fops);
>   	debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root,
>   			    i915, &i915_hpd_short_storm_ctl_fops);
> +	debugfs_create_file("i915_ignore_long_hpd", 0644, minor->debugfs_root,
> +			    i915, &i915_ignore_long_hpd_fops);
>   }
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_hotplug.c b/drivers/gpu/drm/i915/display/intel_hotplug.c
index 352a1b53b63e..45c67f0f1c9f 100644
--- a/drivers/gpu/drm/i915/display/intel_hotplug.c
+++ b/drivers/gpu/drm/i915/display/intel_hotplug.c
@@ -936,6 +936,29 @@  static const struct file_operations i915_hpd_short_storm_ctl_fops = {
 	.write = i915_hpd_short_storm_ctl_write,
 };
 
+static int i915_ignore_long_hpd_set(void *data, u64 val)
+{
+	struct drm_i915_private *i915 = data;
+
+	drm_dbg_kms(&i915->drm, "Ignoring long HPDs: %s\n", str_yes_no(val));
+
+	i915->display.hotplug.ignore_long_hpd = val;
+
+	return 0;
+}
+
+static int i915_ignore_long_hpd_get(void *data, u64 *val)
+{
+	struct drm_i915_private *i915 = data;
+
+	*val = i915->display.hotplug.ignore_long_hpd;
+
+	return 0;
+}
+
+DEFINE_SIMPLE_ATTRIBUTE(i915_ignore_long_hpd_fops, i915_ignore_long_hpd_get,
+			i915_ignore_long_hpd_set, "%llu\n");
+
 void intel_hpd_debugfs_register(struct drm_i915_private *i915)
 {
 	struct drm_minor *minor = i915->drm.primary;
@@ -944,4 +967,6 @@  void intel_hpd_debugfs_register(struct drm_i915_private *i915)
 			    i915, &i915_hpd_storm_ctl_fops);
 	debugfs_create_file("i915_hpd_short_storm_ctl", 0644, minor->debugfs_root,
 			    i915, &i915_hpd_short_storm_ctl_fops);
+	debugfs_create_file("i915_ignore_long_hpd", 0644, minor->debugfs_root,
+			    i915, &i915_ignore_long_hpd_fops);
 }