Skip to contentSkip to conversation

i915: allow forcing SST on DisplayPort connectors

PATCH In review Nathan Schulte 5 participants 11 messages Mar 10, 2016 – Mar 16, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

This adds a module parameter to the i915 DRM driver: force_dp_sst. This parameter allows forcing the use of single-stream transport (SST) for DisplayPort connections (thus effectively disabling multi-stream transport, MST). This is immediately useful as a debugging feature, but is also useful in real-world cases.

In my case, I'm simply looking to free up a CRTC when I use an MST-capable DisplayPort splitter (which doesn't allow the user a choice of SST or MST mode, defaulting to MST ("passive") splitting on MST capable hardware). This allows, in my case with Intel Haswell graphics chipset, the ability to drive up to six individual monitors. Of course the only bounds here are the bandwidth and protocol limitations of DP and the limits of the specific splitting hardware in use, so real-world use-cases are abound.

Ultimately, I was hoping to add support for configuring this (forcing SST/disabling MST) on a per-connector basis via e.g. sysfs. I'm told I'm the only user that's asking for user-space control of the DisplayPort topology, but I feel that this request is only going to become more popular as users become more aware of the power that DisplayPort provides via protocol (MST). At this point, the maintenance costs are probably not worth the trouble, which is understandable.

That said, I'm hopeful these changes will allow emulating such a feature: by changing the module-wide preference prior to establishing a connection on a connector. It's possible this won't play out in practice, due to my unfamiliarity with the code stack/arch. (state), but also due to error handling/recovery logic which I haven't accounted for. That is, the check in intel_dp_probe_mst might be too late, or need sibling logic elsewhere, or extra state tracking, to properly handle recovery on a per-connector/connection basis.

It's possible that I've even missed some error handling/recovery logic/assumption that makes this unstable for even module-wide support. As such, this parameter is marked unsafe (auto-tainting).

--
Nathan Schulte

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#1 lore raw

PATCH 1/2 add module param "force_dp_sst"

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "force_dp_sst", which is disabled by default. Enabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

---
 drivers/gpu/drm/i915/i915_drv.h    | 1 +
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index b0847b9..515e335 100644
@@ -2701,6 +2701,7 @@ struct i915_params {
 	int guc_log_level;
 	int use_mmio_flip;
 	int mmio_debug;
+	bool force_dp_sst;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
 	int edp_vswing;
drivers/gpu/drm/i915/i915_params.c +5 -0
index 835d609..cc2aaf3 100644
@@ -51,6 +51,7 @@ struct i915_params i915 __read_mostly = {
 	.disable_vtd_wa = 0,
 	.use_mmio_flip = 0,
 	.mmio_debug = 0,
+	.force_dp_sst = false,
 	.verbose_state_checks = 1,
 	.nuclear_pageflip = 0,
 	.edp_vswing = 0,
@@ -181,6 +182,10 @@ MODULE_PARM_DESC(mmio_debug,
 	"Enable the MMIO debug code for the first N failures (default: off). "
 	"This may negatively affect performance.");
 
+module_param_named_unsafe(force_dp_sst, i915.force_dp_sst, bool, 0600);
+MODULE_PARM_DESC(force_dp_sst,
+	"Force single-stream transport (SST; disable MST) for new DisplayPort sinks (default: false). ");
+
 module_param_named(verbose_state_checks, i915.verbose_state_checks, bool, 0600);
 MODULE_PARM_DESC(verbose_state_checks,
 	"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 1d8de43..4c4725e 100644
@@ -3969,6 +3969,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (i915.force_dp_sst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
maintainer
#2 lore raw

Re: [PATCH 1/2] [i915] add module param "force_dp_sst"

Quoted 5 lines · Nathan Schulte

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "force_dp_sst", which is disabled by default. Enabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

I'm not (yet) convinced we want this, but no matter what my quick drive-by bikeshed is that the parameter should follow the "enable feature" style, i.e. enable_mst or enable_dp_mst, defaulting to true.

BR,
Jani.

Quoted 54 lines
---
 drivers/gpu/drm/i915/i915_drv.h    | 1 +
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_drv.h +1 -0
index b0847b9..515e335 100644
@@ -2701,6 +2701,7 @@ struct i915_params {
 	int guc_log_level;
 	int use_mmio_flip;
 	int mmio_debug;
+	bool force_dp_sst;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
 	int edp_vswing;
drivers/gpu/drm/i915/i915_params.c +5 -0
index 835d609..cc2aaf3 100644
@@ -51,6 +51,7 @@ struct i915_params i915 __read_mostly = {
 	.disable_vtd_wa = 0,
 	.use_mmio_flip = 0,
 	.mmio_debug = 0,
+	.force_dp_sst = false,
 	.verbose_state_checks = 1,
 	.nuclear_pageflip = 0,
 	.edp_vswing = 0,
@@ -181,6 +182,10 @@ MODULE_PARM_DESC(mmio_debug,
 	"Enable the MMIO debug code for the first N failures (default: off). "
 	"This may negatively affect performance.");
 
+module_param_named_unsafe(force_dp_sst, i915.force_dp_sst, bool, 0600);
+MODULE_PARM_DESC(force_dp_sst,
+	"Force single-stream transport (SST; disable MST) for new DisplayPort sinks (default: false). ");
+
 module_param_named(verbose_state_checks, i915.verbose_state_checks, bool, 0600);
 MODULE_PARM_DESC(verbose_state_checks,
 	"Enable verbose logs (ie. WARN_ON()) in case of unexpected hw state conditions.");
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 1d8de43..4c4725e 100644
@@ -3969,6 +3969,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (i915.force_dp_sst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
Signature · 5 lines
Jani Nikula, Intel Open Source Technology Center
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#3 lore raw

PATCH 2/2 move bools to end of i915_params struct

In reply to Nathan Schulte

to avoid creating holes, as per existing comment

---
 drivers/gpu/drm/i915/i915_drv.h | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/i915/i915_drv.h +5 -5
index 515e335..4b84373 100644
@@ -2689,6 +2689,10 @@ struct i915_params {
 	int enable_ips;
 	int invert_brightness;
 	int enable_cmd_parser;
+	int guc_log_level;
+	int use_mmio_flip;
+	int mmio_debug;
+	int edp_vswing;
 	/* leave bools at the end to not create holes */
 	bool enable_hangcheck;
 	bool fastboot;
@@ -2698,13 +2702,9 @@ struct i915_params {
 	bool disable_display;
 	bool disable_vtd_wa;
 	bool enable_guc_submission;
-	int guc_log_level;
-	int use_mmio_flip;
-	int mmio_debug;
-	bool force_dp_sst;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
-	int edp_vswing;
+	bool force_dp_sst;
 };
 extern struct i915_params i915 __read_mostly;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#4 lore raw

✗ Fi.CI.BAT: failure for series starting with [1/2,i915] add module param "force_dp_sst"

In reply to Nathan Schulte
== Series Details ==

== Series Details ==

Series: series starting with [1/2,i915] add module param "force_dp_sst"
URL : https://patchwork.freedesktop.org/series/4332/
State : failure

== Summary ==

Series 4332v1 Series without cover letter

2016-03-10T23:22:05.996999 http://patchwork.freedesktop.org/api/1.0/series/4332/revisions/1/mbox/

Applying: add module param "force_dp_sst"
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_drv.h
M drivers/gpu/drm/i915/i915_params.c
M drivers/gpu/drm/i915/intel_dp.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_dp.c
Auto-merging drivers/gpu/drm/i915/i915_params.c Auto-merging drivers/gpu/drm/i915/i915_drv.h
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_drv.h Patch failed at 0001 add module param "force_dp_sst"

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

maintainer
#5 lore raw

Re: ✗ Fi.CI.BAT: failure for series starting with [1/2,i915] add module param "force_dp_sst"

Hi,

The series seems to be against rather old source tree.

Please do rebase all patches against drm-intel-nightly prior to submitting.

Regards, Joonas

Quoted 26 lines · Patchwork

== Series Details ==

Series: series starting with [1/2,i915] add module param "force_dp_sst" URL   : https://patchwork.freedesktop.org/series/4332/
State : failure

== Summary ==

Series 4332v1 Series without cover letter

2016-03-10T23:22:05.996999 http://patchwork.freedesktop.org/api/1.0/series/4332/revisions/1/mbox/

Applying: add module param "force_dp_sst"
Using index info to reconstruct a base tree...
M drivers/gpu/drm/i915/i915_drv.h
M drivers/gpu/drm/i915/i915_params.c
M drivers/gpu/drm/i915/intel_dp.c
Falling back to patching base and 3-way merge... Auto-merging drivers/gpu/drm/i915/intel_dp.c
Auto-merging drivers/gpu/drm/i915/i915_params.c Auto-merging drivers/gpu/drm/i915/i915_drv.h
CONFLICT (content): Merge conflict in drivers/gpu/drm/i915/i915_drv.h Patch failed at 0001 add module param "force_dp_sst"

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Signature · 8 lines
Joonas Lahtinen
Open Source Technology Center
Intel Corporation

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#7 lore raw

PATCH 1/1 add module param "enable_dp_mst"

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "enable_dp_mst", which is enabled by default. Disabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

---
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_params.c +5 -0
index 278c9c4..97691f1 100644
@@ -56,6 +56,7 @@ struct i915_params i915 __read_mostly = {
 	.edp_vswing = 0,
 	.enable_guc_submission = false,
 	.guc_log_level = -1,
+	.enable_dp_mst = true,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -201,3 +202,7 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)")
 module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
 	"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
+
+module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
+MODULE_PARM_DESC(enable_dp_mst,
+	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
drivers/gpu/drm/i915/i915_params.h +1 -0
index bd5026b..87153b0 100644
@@ -59,6 +59,7 @@ struct i915_params {
 	bool enable_guc_submission;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
+	bool enable_dp_mst;
 };
 
 extern struct i915_params i915 __read_mostly;
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 0e326e7..ba2d024 100644
@@ -3882,6 +3882,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (!i915.enable_dp_mst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#8 lore raw

Re: [PATCH] [i915] add module param "enable_dp_mst"

Quoted 5 lines · Nathan Schulte

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "enable_dp_mst", which is enabled by default. Disabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

Patch itself looks good, but you're missing the s-o-b line per Documentation/SubmittingPatches, "developers certificate of origin". I need that before I can apply it.
-Daniel

Quoted 59 lines
---
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_params.c +5 -0
index 278c9c4..97691f1 100644
@@ -56,6 +56,7 @@ struct i915_params i915 __read_mostly = {
 	.edp_vswing = 0,
 	.enable_guc_submission = false,
 	.guc_log_level = -1,
+	.enable_dp_mst = true,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -201,3 +202,7 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)")
 module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
 	"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
+
+module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
+MODULE_PARM_DESC(enable_dp_mst,
+	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
drivers/gpu/drm/i915/i915_params.h +1 -0
index bd5026b..87153b0 100644
@@ -59,6 +59,7 @@ struct i915_params {
 	bool enable_guc_submission;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
+	bool enable_dp_mst;
 };
 
 extern struct i915_params i915 __read_mostly;
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 0e326e7..ba2d024 100644
@@ -3882,6 +3882,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (!i915.enable_dp_mst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#9 lore raw

PATCH v3 1/1 drm/i915: add module param "enable_dp_mst"

In reply to Nathan Schulte

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "enable_dp_mst", which is enabled by default. Disabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

v2: rename parameter to conform to style
v3: add signoff

---
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_params.c +5 -0
index 278c9c4..97691f1 100644
@@ -56,6 +56,7 @@ struct i915_params i915 __read_mostly = {
 	.edp_vswing = 0,
 	.enable_guc_submission = false,
 	.guc_log_level = -1,
+	.enable_dp_mst = true,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -201,3 +202,7 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)")
 module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
 	"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
+
+module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
+MODULE_PARM_DESC(enable_dp_mst,
+	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
drivers/gpu/drm/i915/i915_params.h +1 -0
index bd5026b..87153b0 100644
@@ -59,6 +59,7 @@ struct i915_params {
 	bool enable_guc_submission;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
+	bool enable_dp_mst;
 };
 
 extern struct i915_params i915 __read_mostly;
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 0e326e7..ba2d024 100644
@@ -3882,6 +3882,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (!i915.enable_dp_mst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#10 lore raw

Re: [PATCH v3] drm/i915: add module param "enable_dp_mst"

Quoted 10 lines · Nathan Schulte

Adds an (unsafe; auto-kernel-tainting) boolean module parameter to the i915 drm driver: "enable_dp_mst", which is enabled by default. Disabling the parameter forces newly connected DisplayPort sinks to report as not supporting multi-stream transport (MST), thus "forcing" the use of single-stream transport (SST).

v2: rename parameter to conform to style
v3: add signoff

Queued for -next, thanks for the patch.
-Daniel

Quoted 59 lines
---
 drivers/gpu/drm/i915/i915_params.c | 5 +++++
 drivers/gpu/drm/i915/i915_params.h | 1 +
 drivers/gpu/drm/i915/intel_dp.c    | 3 +++
 3 files changed, 9 insertions(+)
drivers/gpu/drm/i915/i915_params.c +5 -0
index 278c9c4..97691f1 100644
@@ -56,6 +56,7 @@ struct i915_params i915 __read_mostly = {
 	.edp_vswing = 0,
 	.enable_guc_submission = false,
 	.guc_log_level = -1,
+	.enable_dp_mst = true,
 };
 
 module_param_named(modeset, i915.modeset, int, 0400);
@@ -201,3 +202,7 @@ MODULE_PARM_DESC(enable_guc_submission, "Enable GuC submission (default:false)")
 module_param_named(guc_log_level, i915.guc_log_level, int, 0400);
 MODULE_PARM_DESC(guc_log_level,
 	"GuC firmware logging level (-1:disabled (default), 0-3:enabled)");
+
+module_param_named_unsafe(enable_dp_mst, i915.enable_dp_mst, bool, 0600);
+MODULE_PARM_DESC(enable_dp_mst,
+	"Enable multi-stream transport (MST) for new DisplayPort sinks. (default: true)");
drivers/gpu/drm/i915/i915_params.h +1 -0
index bd5026b..87153b0 100644
@@ -59,6 +59,7 @@ struct i915_params {
 	bool enable_guc_submission;
 	bool verbose_state_checks;
 	bool nuclear_pageflip;
+	bool enable_dp_mst;
 };
 
 extern struct i915_params i915 __read_mostly;
drivers/gpu/drm/i915/intel_dp.c +3 -0
index 0e326e7..ba2d024 100644
@@ -3882,6 +3882,9 @@ intel_dp_probe_mst(struct intel_dp *intel_dp)
 {
 	u8 buf[1];
 
+	if (!i915.enable_dp_mst)
+		return false;
+
 	if (!intel_dp->can_mst)
 		return false;
 
Signature · 6 lines
2.7.0

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 7 lines
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx