diff mbox series

[v2] drm/i915/dp: Fix the PSR debugfs entries wrt. MST connectors

Message ID 20240103152609.2434100-1-imre.deak@intel.com (mailing list archive)
State New, archived
Headers show
Series [v2] drm/i915/dp: Fix the PSR debugfs entries wrt. MST connectors | expand

Commit Message

Imre Deak Jan. 3, 2024, 3:26 p.m. UTC
MST connectors don't have a static attached encoder, as their encoder
can change depending on the pipe they use; so the encoder for an MST
connector can't be retrieved using intel_dp_attached_encoder() (which
may return NULL for MST). Most of the PSR debugfs entries depend on a
static connector -> encoder mapping which is only true for eDP and SST
DP connectors and not for MST. These debugfs entries were enabled for
MST connectors as well recently to provide PR information for them, but
handling MST connectors needs more changes.

Fix this by not adding for now the PSR entries on MST connectors. To
make things more uniform add the entries for SST connectors on all
platforms, not just on platforms supporting DP2.0.

v2:
- Keep adding the entries for SST connectors. (Jouni)
- Add a TODO: comment for MST support.

Fixes: ef75c25e8fed ("drm/i915/panelreplay: Debugfs support for panel replay")
Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9850
Cc: Animesh Manna <animesh.manna@intel.com>
Cc: Jouni Högander <jouni.hogander@intel.com>
Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/gpu/drm/i915/display/intel_psr.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

Comments

Hogander, Jouni Jan. 4, 2024, 7:15 a.m. UTC | #1
On Wed, 2024-01-03 at 17:26 +0200, Imre Deak wrote:
> MST connectors don't have a static attached encoder, as their encoder
> can change depending on the pipe they use; so the encoder for an MST
> connector can't be retrieved using intel_dp_attached_encoder() (which
> may return NULL for MST). Most of the PSR debugfs entries depend on a
> static connector -> encoder mapping which is only true for eDP and
> SST
> DP connectors and not for MST. These debugfs entries were enabled for
> MST connectors as well recently to provide PR information for them,
> but
> handling MST connectors needs more changes.
> 
> Fix this by not adding for now the PSR entries on MST connectors. To
> make things more uniform add the entries for SST connectors on all
> platforms, not just on platforms supporting DP2.0.
> 
> v2:
> - Keep adding the entries for SST connectors. (Jouni)
> - Add a TODO: comment for MST support.

Reviewed-by: Jouni Högander <jouni.hogander@intel.com>

> 
> Fixes: ef75c25e8fed ("drm/i915/panelreplay: Debugfs support for panel
> replay")
> Closes: https://gitlab.freedesktop.org/drm/intel/-/issues/9850
> Cc: Animesh Manna <animesh.manna@intel.com>
> Cc: Jouni Högander <jouni.hogander@intel.com>
> Signed-off-by: Imre Deak <imre.deak@intel.com>
> ---
>  drivers/gpu/drm/i915/display/intel_psr.c | 10 +++++-----
>  1 file changed, 5 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/gpu/drm/i915/display/intel_psr.c
> b/drivers/gpu/drm/i915/display/intel_psr.c
> index 494d08817d71e..54120b45958b0 100644
> --- a/drivers/gpu/drm/i915/display/intel_psr.c
> +++ b/drivers/gpu/drm/i915/display/intel_psr.c
> @@ -3310,11 +3310,11 @@ void intel_psr_connector_debugfs_add(struct
> intel_connector *connector)
>         struct drm_i915_private *i915 = to_i915(connector->base.dev);
>         struct dentry *root = connector->base.debugfs_entry;
>  
> -       if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP)
> {
> -               if (!(HAS_DP20(i915) &&
> -                     connector->base.connector_type ==
> DRM_MODE_CONNECTOR_DisplayPort))
> -                       return;
> -       }
> +       /* TODO: Add support for MST connectors as well. */
> +       if ((connector->base.connector_type != DRM_MODE_CONNECTOR_eDP
> &&
> +            connector->base.connector_type !=
> DRM_MODE_CONNECTOR_DisplayPort) ||
> +           connector->mst_port)
> +               return;
>  
>         debugfs_create_file("i915_psr_sink_status", 0444, root,
>                             connector, &i915_psr_sink_status_fops);
diff mbox series

Patch

diff --git a/drivers/gpu/drm/i915/display/intel_psr.c b/drivers/gpu/drm/i915/display/intel_psr.c
index 494d08817d71e..54120b45958b0 100644
--- a/drivers/gpu/drm/i915/display/intel_psr.c
+++ b/drivers/gpu/drm/i915/display/intel_psr.c
@@ -3310,11 +3310,11 @@  void intel_psr_connector_debugfs_add(struct intel_connector *connector)
 	struct drm_i915_private *i915 = to_i915(connector->base.dev);
 	struct dentry *root = connector->base.debugfs_entry;
 
-	if (connector->base.connector_type != DRM_MODE_CONNECTOR_eDP) {
-		if (!(HAS_DP20(i915) &&
-		      connector->base.connector_type == DRM_MODE_CONNECTOR_DisplayPort))
-			return;
-	}
+	/* TODO: Add support for MST connectors as well. */
+	if ((connector->base.connector_type != DRM_MODE_CONNECTOR_eDP &&
+	     connector->base.connector_type != DRM_MODE_CONNECTOR_DisplayPort) ||
+	    connector->mst_port)
+		return;
 
 	debugfs_create_file("i915_psr_sink_status", 0444, root,
 			    connector, &i915_psr_sink_status_fops);