All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support
       [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
@ 2020-07-27 20:51   ` Daniel Dadap
  2020-07-27 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type Patchwork
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Changes to allow vga-switcheroo to switch the mux while modesetting
clients remain active. There is existing support for switching the
mux without checking can_switch; however, this support also does not
reprobe after the mux switch is complete. This patch series adds a new
type of switch event which switches immediately while still calling
client driver callbacks, and updates the i915 DRM-KMS driver to reprobe
eDP outputs after switching the mux to an i915-driven GPU, and to avoid
using eDP links (which i915 always assumes to be connected) while the
mux is switched away.

Daniel Dadap (6):
  vga-switcheroo: add new "immediate" switch event type
  vga-switcheroo: Add a way to test for the active client
  vga-switcheroo: notify clients of pending/completed switch events
  i915: implement vga-switcheroo reprobe() callback
  i915: fail atomic commit when muxed away
  i915: bail out of eDP link training while mux-switched away

 drivers/gpu/drm/i915/display/intel_display.c  |   7 +
 .../drm/i915/display/intel_dp_link_training.c |   9 ++
 drivers/gpu/drm/i915/i915_switcheroo.c        |  27 +++-
 drivers/gpu/vga/vga_switcheroo.c              | 153 ++++++++++++++----
 include/linux/vga_switcheroo.h                |  20 +++
 5 files changed, 185 insertions(+), 31 deletions(-)

-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support
@ 2020-07-27 20:51   ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Changes to allow vga-switcheroo to switch the mux while modesetting
clients remain active. There is existing support for switching the
mux without checking can_switch; however, this support also does not
reprobe after the mux switch is complete. This patch series adds a new
type of switch event which switches immediately while still calling
client driver callbacks, and updates the i915 DRM-KMS driver to reprobe
eDP outputs after switching the mux to an i915-driven GPU, and to avoid
using eDP links (which i915 always assumes to be connected) while the
mux is switched away.

Daniel Dadap (6):
  vga-switcheroo: add new "immediate" switch event type
  vga-switcheroo: Add a way to test for the active client
  vga-switcheroo: notify clients of pending/completed switch events
  i915: implement vga-switcheroo reprobe() callback
  i915: fail atomic commit when muxed away
  i915: bail out of eDP link training while mux-switched away

 drivers/gpu/drm/i915/display/intel_display.c  |   7 +
 .../drm/i915/display/intel_dp_link_training.c |   9 ++
 drivers/gpu/drm/i915/i915_switcheroo.c        |  27 +++-
 drivers/gpu/vga/vga_switcheroo.c              | 153 ++++++++++++++----
 include/linux/vga_switcheroo.h                |  20 +++
 5 files changed, 185 insertions(+), 31 deletions(-)

-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [PATCH 1/6] vga-switcheroo: add new "immediate" switch event type
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

vga-switcheroo supports the following types of mux switch events:

* standard: checks the clients' can_switch() callbacks and switches
  the mux if the client drivers report that they are prepared for a
  switch. Also uses client and handler callbacks to manage power on
  the GPUs and reprobe display outputs.
* deferred: registers the intent to perform a mux switch and defers
  it until the client drivers no longer have any active modesetting
  clients. Performs the equivalent of a standard switch when clients
  are ready.
* mux-only: switches the mux immediately without testing can_switch
  first and without calling any of the client or handler callbacks
  for power management and reprobing.

In order to support additional use cases involving dynamic switching
of display muxes, add a new type of "immediate" switch event which
skips the can_switch test and power management hooks, but still calls
the reprobe hook. This switch event type uses 'I' as a prefix for its
commands, similar to the existing 'D' pefix for the deferred commands
and 'M' for the mux-only commands.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 86 +++++++++++++++++++++-----------
 1 file changed, 58 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 087304b1a5d7..cf3c7024dafa 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -631,16 +631,23 @@ EXPORT_SYMBOL(vga_switcheroo_unlock_ddc);
  * * DDIS: Delayed switch to the discrete graphics device.
  * * MIGD: Mux-only switch to the integrated graphics device.
  *   Does not remap console or change the power state of either gpu.
+ *   Does not call into any client-supplied callbacks, e.g. reprobe.
  *   If the integrated GPU is currently off, the screen will turn black.
  *   If it is on, the screen will show whatever happens to be in VRAM.
  *   Either way, the user has to blindly enter the command to switch back.
  * * MDIS: Mux-only switch to the discrete graphics device.
+ * * IIGD: Immediate switch to the integrated graphics device.
+ *   Does not test for active user space processes utilizing the device
+ *   files of the GPU or audio device. Does not change the power state of
+ *   either gpu. The console is remapped and client-provided callbacks
+ *   such as reprobe are called.
+ *  * IDIS: Immediate switch to the discrete graphics device.
  *
  * For GPUs whose power state is controlled by the driver's runtime pm,
  * the ON and OFF commands are a no-op (see next section).
  *
- * For muxless machines, the IGD/DIS, DIGD/DDIS and MIGD/MDIS commands
- * should not be used.
+ * For muxless machines, the IGD/DIS, DIGD/DDIS, MIGD/MDIS and IIGD/IDIS
+ * commands should not be used.
  */
 
 static int vga_switcheroo_show(struct seq_file *m, void *v)
@@ -704,7 +711,8 @@ static void set_audio_state(enum vga_switcheroo_client_id id,
 }
 
 /* stage one happens before delay */
-static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
+static int vga_switchto_stage1(struct vga_switcheroo_client *new_client,
+			       bool power_control)
 {
 	struct vga_switcheroo_client *active;
 
@@ -712,7 +720,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
 	if (!active)
 		return 0;
 
-	if (vga_switcheroo_pwr_state(new_client) == VGA_SWITCHEROO_OFF)
+	if (power_control &&
+	    vga_switcheroo_pwr_state(new_client) == VGA_SWITCHEROO_OFF)
 		vga_switchon(new_client);
 
 	vga_set_default_device(new_client->pdev);
@@ -720,7 +729,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
 }
 
 /* post delay */
-static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
+static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
+			       bool power_control)
 {
 	int ret;
 	struct vga_switcheroo_client *active;
@@ -747,7 +757,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
 
-	if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
+	if (power_control &&
+	    vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
 		vga_switchoff(active);
 
 	/* let HDA controller autoresume if GPU uses driver power control */
@@ -779,6 +790,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 	int ret;
 	bool delay = false, can_switch;
 	bool just_mux = false;
+	bool immediate_switch = false;
 	enum vga_switcheroo_client_id client_id = VGA_SWITCHEROO_UNKNOWN_ID;
 	struct vga_switcheroo_client *client = NULL;
 
@@ -822,30 +834,48 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		goto out;
 	}
 
-	/* request a delayed switch - test can we switch now */
-	if (strncmp(usercmd, "DIGD", 4) == 0) {
-		client_id = VGA_SWITCHEROO_IGD;
-		delay = true;
-	}
-
-	if (strncmp(usercmd, "DDIS", 4) == 0) {
-		client_id = VGA_SWITCHEROO_DIS;
-		delay = true;
-	}
 
+	/* normal switch request */
 	if (strncmp(usercmd, "IGD", 3) == 0)
 		client_id = VGA_SWITCHEROO_IGD;
 
 	if (strncmp(usercmd, "DIS", 3) == 0)
 		client_id = VGA_SWITCHEROO_DIS;
 
-	if (strncmp(usercmd, "MIGD", 4) == 0) {
-		just_mux = true;
-		client_id = VGA_SWITCHEROO_IGD;
-	}
-	if (strncmp(usercmd, "MDIS", 4) == 0) {
-		just_mux = true;
-		client_id = VGA_SWITCHEROO_DIS;
+	if (client_id == VGA_SWITCHEROO_UNKNOWN_ID) {
+		switch (usercmd[0]) {
+		case 'D':
+			/*
+			 * request a delayed switch -
+			 * test can we switch now
+			 */
+			delay = true;
+			break;
+		case 'I':
+			/*
+			 * switch immediately -
+			 * ignore can switch test;
+			 * communicate switch to clients
+			 */
+			immediate_switch = true;
+			break;
+		case 'M':
+			/*
+			 * switch immediately -
+			 * ignore can switch test;
+			 * do not communicate switch to clients
+			 */
+			just_mux = true;
+			break;
+		default:
+			goto out;
+		}
+
+		if (strncmp(usercmd + 1, "IGD", 3) == 0)
+			client_id = VGA_SWITCHEROO_IGD;
+
+		if (strncmp(usercmd + 1, "DIS", 3) == 0)
+			client_id = VGA_SWITCHEROO_DIS;
 	}
 
 	if (client_id == VGA_SWITCHEROO_UNKNOWN_ID)
@@ -867,17 +897,17 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		goto out;
 
 	/* okay we want a switch - test if devices are willing to switch */
-	can_switch = check_can_switch();
+	can_switch = immediate_switch || check_can_switch();
 
 	if (can_switch == false && delay == false)
 		goto out;
 
 	if (can_switch) {
-		ret = vga_switchto_stage1(client);
+		ret = vga_switchto_stage1(client, !immediate_switch);
 		if (ret)
 			pr_err("switching failed stage 1 %d\n", ret);
 
-		ret = vga_switchto_stage2(client);
+		ret = vga_switchto_stage2(client, !immediate_switch);
 		if (ret)
 			pr_err("switching failed stage 2 %d\n", ret);
 
@@ -886,7 +916,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		vgasr_priv.delayed_switch_active = true;
 		vgasr_priv.delayed_client_id = client_id;
 
-		ret = vga_switchto_stage1(client);
+		ret = vga_switchto_stage1(client, !immediate_switch);
 		if (ret)
 			pr_err("delayed switching stage 1 failed %d\n", ret);
 	}
@@ -951,7 +981,7 @@ int vga_switcheroo_process_delayed_switch(void)
 	if (!client || !check_can_switch())
 		goto err;
 
-	ret = vga_switchto_stage2(client);
+	ret = vga_switchto_stage2(client, true);
 	if (ret)
 		pr_err("delayed switching failed stage 2 %d\n", ret);
 
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 1/6] vga-switcheroo: add new "immediate" switch event type
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

vga-switcheroo supports the following types of mux switch events:

* standard: checks the clients' can_switch() callbacks and switches
  the mux if the client drivers report that they are prepared for a
  switch. Also uses client and handler callbacks to manage power on
  the GPUs and reprobe display outputs.
* deferred: registers the intent to perform a mux switch and defers
  it until the client drivers no longer have any active modesetting
  clients. Performs the equivalent of a standard switch when clients
  are ready.
* mux-only: switches the mux immediately without testing can_switch
  first and without calling any of the client or handler callbacks
  for power management and reprobing.

In order to support additional use cases involving dynamic switching
of display muxes, add a new type of "immediate" switch event which
skips the can_switch test and power management hooks, but still calls
the reprobe hook. This switch event type uses 'I' as a prefix for its
commands, similar to the existing 'D' pefix for the deferred commands
and 'M' for the mux-only commands.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 86 +++++++++++++++++++++-----------
 1 file changed, 58 insertions(+), 28 deletions(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index 087304b1a5d7..cf3c7024dafa 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -631,16 +631,23 @@ EXPORT_SYMBOL(vga_switcheroo_unlock_ddc);
  * * DDIS: Delayed switch to the discrete graphics device.
  * * MIGD: Mux-only switch to the integrated graphics device.
  *   Does not remap console or change the power state of either gpu.
+ *   Does not call into any client-supplied callbacks, e.g. reprobe.
  *   If the integrated GPU is currently off, the screen will turn black.
  *   If it is on, the screen will show whatever happens to be in VRAM.
  *   Either way, the user has to blindly enter the command to switch back.
  * * MDIS: Mux-only switch to the discrete graphics device.
+ * * IIGD: Immediate switch to the integrated graphics device.
+ *   Does not test for active user space processes utilizing the device
+ *   files of the GPU or audio device. Does not change the power state of
+ *   either gpu. The console is remapped and client-provided callbacks
+ *   such as reprobe are called.
+ *  * IDIS: Immediate switch to the discrete graphics device.
  *
  * For GPUs whose power state is controlled by the driver's runtime pm,
  * the ON and OFF commands are a no-op (see next section).
  *
- * For muxless machines, the IGD/DIS, DIGD/DDIS and MIGD/MDIS commands
- * should not be used.
+ * For muxless machines, the IGD/DIS, DIGD/DDIS, MIGD/MDIS and IIGD/IDIS
+ * commands should not be used.
  */
 
 static int vga_switcheroo_show(struct seq_file *m, void *v)
@@ -704,7 +711,8 @@ static void set_audio_state(enum vga_switcheroo_client_id id,
 }
 
 /* stage one happens before delay */
-static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
+static int vga_switchto_stage1(struct vga_switcheroo_client *new_client,
+			       bool power_control)
 {
 	struct vga_switcheroo_client *active;
 
@@ -712,7 +720,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
 	if (!active)
 		return 0;
 
-	if (vga_switcheroo_pwr_state(new_client) == VGA_SWITCHEROO_OFF)
+	if (power_control &&
+	    vga_switcheroo_pwr_state(new_client) == VGA_SWITCHEROO_OFF)
 		vga_switchon(new_client);
 
 	vga_set_default_device(new_client->pdev);
@@ -720,7 +729,8 @@ static int vga_switchto_stage1(struct vga_switcheroo_client *new_client)
 }
 
 /* post delay */
-static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
+static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
+			       bool power_control)
 {
 	int ret;
 	struct vga_switcheroo_client *active;
@@ -747,7 +757,8 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client)
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
 
-	if (vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
+	if (power_control &&
+	    vga_switcheroo_pwr_state(active) == VGA_SWITCHEROO_ON)
 		vga_switchoff(active);
 
 	/* let HDA controller autoresume if GPU uses driver power control */
@@ -779,6 +790,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 	int ret;
 	bool delay = false, can_switch;
 	bool just_mux = false;
+	bool immediate_switch = false;
 	enum vga_switcheroo_client_id client_id = VGA_SWITCHEROO_UNKNOWN_ID;
 	struct vga_switcheroo_client *client = NULL;
 
@@ -822,30 +834,48 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		goto out;
 	}
 
-	/* request a delayed switch - test can we switch now */
-	if (strncmp(usercmd, "DIGD", 4) == 0) {
-		client_id = VGA_SWITCHEROO_IGD;
-		delay = true;
-	}
-
-	if (strncmp(usercmd, "DDIS", 4) == 0) {
-		client_id = VGA_SWITCHEROO_DIS;
-		delay = true;
-	}
 
+	/* normal switch request */
 	if (strncmp(usercmd, "IGD", 3) == 0)
 		client_id = VGA_SWITCHEROO_IGD;
 
 	if (strncmp(usercmd, "DIS", 3) == 0)
 		client_id = VGA_SWITCHEROO_DIS;
 
-	if (strncmp(usercmd, "MIGD", 4) == 0) {
-		just_mux = true;
-		client_id = VGA_SWITCHEROO_IGD;
-	}
-	if (strncmp(usercmd, "MDIS", 4) == 0) {
-		just_mux = true;
-		client_id = VGA_SWITCHEROO_DIS;
+	if (client_id == VGA_SWITCHEROO_UNKNOWN_ID) {
+		switch (usercmd[0]) {
+		case 'D':
+			/*
+			 * request a delayed switch -
+			 * test can we switch now
+			 */
+			delay = true;
+			break;
+		case 'I':
+			/*
+			 * switch immediately -
+			 * ignore can switch test;
+			 * communicate switch to clients
+			 */
+			immediate_switch = true;
+			break;
+		case 'M':
+			/*
+			 * switch immediately -
+			 * ignore can switch test;
+			 * do not communicate switch to clients
+			 */
+			just_mux = true;
+			break;
+		default:
+			goto out;
+		}
+
+		if (strncmp(usercmd + 1, "IGD", 3) == 0)
+			client_id = VGA_SWITCHEROO_IGD;
+
+		if (strncmp(usercmd + 1, "DIS", 3) == 0)
+			client_id = VGA_SWITCHEROO_DIS;
 	}
 
 	if (client_id == VGA_SWITCHEROO_UNKNOWN_ID)
@@ -867,17 +897,17 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		goto out;
 
 	/* okay we want a switch - test if devices are willing to switch */
-	can_switch = check_can_switch();
+	can_switch = immediate_switch || check_can_switch();
 
 	if (can_switch == false && delay == false)
 		goto out;
 
 	if (can_switch) {
-		ret = vga_switchto_stage1(client);
+		ret = vga_switchto_stage1(client, !immediate_switch);
 		if (ret)
 			pr_err("switching failed stage 1 %d\n", ret);
 
-		ret = vga_switchto_stage2(client);
+		ret = vga_switchto_stage2(client, !immediate_switch);
 		if (ret)
 			pr_err("switching failed stage 2 %d\n", ret);
 
@@ -886,7 +916,7 @@ vga_switcheroo_debugfs_write(struct file *filp, const char __user *ubuf,
 		vgasr_priv.delayed_switch_active = true;
 		vgasr_priv.delayed_client_id = client_id;
 
-		ret = vga_switchto_stage1(client);
+		ret = vga_switchto_stage1(client, !immediate_switch);
 		if (ret)
 			pr_err("delayed switching stage 1 failed %d\n", ret);
 	}
@@ -951,7 +981,7 @@ int vga_switcheroo_process_delayed_switch(void)
 	if (!client || !check_can_switch())
 		goto err;
 
-	ret = vga_switchto_stage2(client);
+	ret = vga_switchto_stage2(client, true);
 	if (ret)
 		pr_err("delayed switching failed stage 2 %d\n", ret);
 
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 2/6] vga-switcheroo: Add a way to test for the active client
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

vga-switcheroo clients may wish to know whether they are currently
active, i.e., whether the mux is currently switched to the client
in question. Add an in-kernel API to test whether a vga-switcheroo
client, as identified by PCI device, is actively switched.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 38 +++++++++++++++++++++++++++++++-
 include/linux/vga_switcheroo.h   |  2 ++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index cf3c7024dafa..a4fc78c4bf4f 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -99,7 +99,13 @@
  * @id: client identifier. Determining the id requires the handler,
  *	so gpus are initially assigned VGA_SWITCHEROO_UNKNOWN_ID
  *	and later given their true id in vga_switcheroo_enable()
- * @active: whether the outputs are currently switched to this client
+ * @active: whether the client is currently active: this is unset for the
+ *	currently active client before preparing for a mux switch, and set
+ *	for the newly active client after completing all post-switch actions.
+ * @switched: whether the outputs are physically switched to the client:
+ *	this is unset for the currently switched client immediately before
+ *	switching the mux, and set for the newly switched client immediately
+ *	after switching the mux.
  * @driver_power_control: whether power state is controlled by the driver's
  *	runtime pm. If true, writing ON and OFF to the vga_switcheroo debugfs
  *	interface is a no-op so as not to interfere with runtime pm
@@ -117,6 +123,7 @@ struct vga_switcheroo_client {
 	const struct vga_switcheroo_client_ops *ops;
 	enum vga_switcheroo_client_id id;
 	bool active;
+	bool switched;
 	bool driver_power_control;
 	struct list_head list;
 	struct pci_dev *vga_dev;
@@ -306,6 +313,7 @@ static int register_client(struct pci_dev *pdev,
 	client->ops = ops;
 	client->id = id;
 	client->active = active;
+	client->switched = active;
 	client->driver_power_control = driver_power_control;
 	client->vga_dev = vga_dev;
 
@@ -748,11 +756,13 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
 	if (new_client->fb_info)
 		fbcon_remap_all(new_client->fb_info);
 
+	active->switched = false;
 	mutex_lock(&vgasr_priv.mux_hw_lock);
 	ret = vgasr_priv.handler->switchto(new_client->id);
 	mutex_unlock(&vgasr_priv.mux_hw_lock);
 	if (ret)
 		return ret;
+	new_client->switched = true;
 
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
@@ -1111,3 +1121,29 @@ void vga_switcheroo_fini_domain_pm_ops(struct device *dev)
 	dev_pm_domain_set(dev, NULL);
 }
 EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops);
+
+/**
+ * vga_switcheroo_is_client_active() - test if a device is the active client
+ * @pdev: vga client device
+ *
+ * Check whether the mux is switched to the switcheroo client associated with
+ * the given PCI device. Assumes that mux is always switched to the device in
+ * question when switcheroo is inactive, and that the mux is switched away if
+ * no matching client is registered.
+ */
+bool vga_switcheroo_is_client_active(struct pci_dev *pdev)
+{
+	if (vgasr_priv.active) {
+		struct vga_switcheroo_client *client;
+
+		client = find_client_from_pci(&vgasr_priv.clients, pdev);
+
+		if (client)
+			return client->switched;
+		else
+			return false;
+	} else {
+		return true;
+	}
+}
+EXPORT_SYMBOL(vga_switcheroo_is_client_active);
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index 7e6ac0114d55..63e6d6e5786e 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -173,6 +173,7 @@ enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev);
 
 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
 void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
+bool vga_switcheroo_is_client_active(struct pci_dev *pdev);
 #else
 
 static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
@@ -194,6 +195,7 @@ static inline enum vga_switcheroo_state vga_switcheroo_get_client_state(struct p
 
 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
 static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
+static inline bool vga_switcheroo_is_client_active(struct pci_dev *pdev) { return true; }
 
 #endif
 #endif /* _LINUX_VGA_SWITCHEROO_H_ */
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 2/6] vga-switcheroo: Add a way to test for the active client
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

vga-switcheroo clients may wish to know whether they are currently
active, i.e., whether the mux is currently switched to the client
in question. Add an in-kernel API to test whether a vga-switcheroo
client, as identified by PCI device, is actively switched.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 38 +++++++++++++++++++++++++++++++-
 include/linux/vga_switcheroo.h   |  2 ++
 2 files changed, 39 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index cf3c7024dafa..a4fc78c4bf4f 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -99,7 +99,13 @@
  * @id: client identifier. Determining the id requires the handler,
  *	so gpus are initially assigned VGA_SWITCHEROO_UNKNOWN_ID
  *	and later given their true id in vga_switcheroo_enable()
- * @active: whether the outputs are currently switched to this client
+ * @active: whether the client is currently active: this is unset for the
+ *	currently active client before preparing for a mux switch, and set
+ *	for the newly active client after completing all post-switch actions.
+ * @switched: whether the outputs are physically switched to the client:
+ *	this is unset for the currently switched client immediately before
+ *	switching the mux, and set for the newly switched client immediately
+ *	after switching the mux.
  * @driver_power_control: whether power state is controlled by the driver's
  *	runtime pm. If true, writing ON and OFF to the vga_switcheroo debugfs
  *	interface is a no-op so as not to interfere with runtime pm
@@ -117,6 +123,7 @@ struct vga_switcheroo_client {
 	const struct vga_switcheroo_client_ops *ops;
 	enum vga_switcheroo_client_id id;
 	bool active;
+	bool switched;
 	bool driver_power_control;
 	struct list_head list;
 	struct pci_dev *vga_dev;
@@ -306,6 +313,7 @@ static int register_client(struct pci_dev *pdev,
 	client->ops = ops;
 	client->id = id;
 	client->active = active;
+	client->switched = active;
 	client->driver_power_control = driver_power_control;
 	client->vga_dev = vga_dev;
 
@@ -748,11 +756,13 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
 	if (new_client->fb_info)
 		fbcon_remap_all(new_client->fb_info);
 
+	active->switched = false;
 	mutex_lock(&vgasr_priv.mux_hw_lock);
 	ret = vgasr_priv.handler->switchto(new_client->id);
 	mutex_unlock(&vgasr_priv.mux_hw_lock);
 	if (ret)
 		return ret;
+	new_client->switched = true;
 
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
@@ -1111,3 +1121,29 @@ void vga_switcheroo_fini_domain_pm_ops(struct device *dev)
 	dev_pm_domain_set(dev, NULL);
 }
 EXPORT_SYMBOL(vga_switcheroo_fini_domain_pm_ops);
+
+/**
+ * vga_switcheroo_is_client_active() - test if a device is the active client
+ * @pdev: vga client device
+ *
+ * Check whether the mux is switched to the switcheroo client associated with
+ * the given PCI device. Assumes that mux is always switched to the device in
+ * question when switcheroo is inactive, and that the mux is switched away if
+ * no matching client is registered.
+ */
+bool vga_switcheroo_is_client_active(struct pci_dev *pdev)
+{
+	if (vgasr_priv.active) {
+		struct vga_switcheroo_client *client;
+
+		client = find_client_from_pci(&vgasr_priv.clients, pdev);
+
+		if (client)
+			return client->switched;
+		else
+			return false;
+	} else {
+		return true;
+	}
+}
+EXPORT_SYMBOL(vga_switcheroo_is_client_active);
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index 7e6ac0114d55..63e6d6e5786e 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -173,6 +173,7 @@ enum vga_switcheroo_state vga_switcheroo_get_client_state(struct pci_dev *dev);
 
 int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain);
 void vga_switcheroo_fini_domain_pm_ops(struct device *dev);
+bool vga_switcheroo_is_client_active(struct pci_dev *pdev);
 #else
 
 static inline void vga_switcheroo_unregister_client(struct pci_dev *dev) {}
@@ -194,6 +195,7 @@ static inline enum vga_switcheroo_state vga_switcheroo_get_client_state(struct p
 
 static inline int vga_switcheroo_init_domain_pm_ops(struct device *dev, struct dev_pm_domain *domain) { return -EINVAL; }
 static inline void vga_switcheroo_fini_domain_pm_ops(struct device *dev) {}
+static inline bool vga_switcheroo_is_client_active(struct pci_dev *pdev) { return true; }
 
 #endif
 #endif /* _LINUX_VGA_SWITCHEROO_H_ */
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 3/6] vga-switcheroo: notify clients of pending/completed switch events
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Add a new vga-switcheroo client callback to allow clients to register
for receiving notifications when a mux switch is pending, completed,
or failed. This allows individual client drivers to prepare for or
respond to mux switches to and from the registered client device.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 29 ++++++++++++++++++++++++++++-
 include/linux/vga_switcheroo.h   | 18 ++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index a4fc78c4bf4f..6392dc92696b 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -756,14 +756,41 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
 	if (new_client->fb_info)
 		fbcon_remap_all(new_client->fb_info);
 
+	if (active->ops->notify)
+		active->ops->notify(active->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING);
+	if (new_client->ops->notify)
+		new_client->ops->notify(new_client->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING);
+
 	active->switched = false;
 	mutex_lock(&vgasr_priv.mux_hw_lock);
 	ret = vgasr_priv.handler->switchto(new_client->id);
 	mutex_unlock(&vgasr_priv.mux_hw_lock);
-	if (ret)
+	if (ret) {
+		if (active->ops->notify)
+			active->ops->notify(active->pdev,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED);
+		if (new_client->ops->notify)
+			new_client->ops->notify(new_client->pdev,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED);
 		return ret;
+	}
 	new_client->switched = true;
 
+	if (active->ops->notify)
+		active->ops->notify(active->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE);
+	if (new_client->ops->notify)
+		new_client->ops->notify(new_client->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE);
+
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
 
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index 63e6d6e5786e..2dc8ebc84fd4 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -90,6 +90,17 @@ enum vga_switcheroo_client_id {
 	VGA_SWITCHEROO_MAX_CLIENTS,
 };
 
+enum vga_switcheroo_notify_direction {
+	VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+};
+
+enum vga_switcheroo_notify_action {
+	VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED,
+};
+
 /**
  * struct vga_switcheroo_handler - handler callbacks
  * @init: initialize handler.
@@ -134,6 +145,10 @@ struct vga_switcheroo_handler {
  * 	Mandatory. The client should return false if a user space process
  * 	has one of its device files open
  * @gpu_bound: notify the client id to audio client when the GPU is bound.
+ * @notify: notify clients of pending and completed switches
+ *	Optional. This gets called for both active and inactive clients,
+ *	before a switch begins, and after a switch successfully completes
+ *	or fails.
  *
  * Client callbacks. A client can be either a GPU or an audio device on a GPU.
  * The @set_gpu_state and @can_switch methods are mandatory, @reprobe may be
@@ -145,6 +160,9 @@ struct vga_switcheroo_client_ops {
 	void (*reprobe)(struct pci_dev *dev);
 	bool (*can_switch)(struct pci_dev *dev);
 	void (*gpu_bound)(struct pci_dev *dev, enum vga_switcheroo_client_id);
+	void (*notify)(struct pci_dev *dev,
+		       enum vga_switcheroo_notify_direction,
+		       enum vga_switcheroo_notify_action);
 };
 
 #if defined(CONFIG_VGA_SWITCHEROO)
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 3/6] vga-switcheroo: notify clients of pending/completed switch events
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Add a new vga-switcheroo client callback to allow clients to register
for receiving notifications when a mux switch is pending, completed,
or failed. This allows individual client drivers to prepare for or
respond to mux switches to and from the registered client device.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/vga/vga_switcheroo.c | 29 ++++++++++++++++++++++++++++-
 include/linux/vga_switcheroo.h   | 18 ++++++++++++++++++
 2 files changed, 46 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/vga/vga_switcheroo.c b/drivers/gpu/vga/vga_switcheroo.c
index a4fc78c4bf4f..6392dc92696b 100644
--- a/drivers/gpu/vga/vga_switcheroo.c
+++ b/drivers/gpu/vga/vga_switcheroo.c
@@ -756,14 +756,41 @@ static int vga_switchto_stage2(struct vga_switcheroo_client *new_client,
 	if (new_client->fb_info)
 		fbcon_remap_all(new_client->fb_info);
 
+	if (active->ops->notify)
+		active->ops->notify(active->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING);
+	if (new_client->ops->notify)
+		new_client->ops->notify(new_client->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING);
+
 	active->switched = false;
 	mutex_lock(&vgasr_priv.mux_hw_lock);
 	ret = vgasr_priv.handler->switchto(new_client->id);
 	mutex_unlock(&vgasr_priv.mux_hw_lock);
-	if (ret)
+	if (ret) {
+		if (active->ops->notify)
+			active->ops->notify(active->pdev,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED);
+		if (new_client->ops->notify)
+			new_client->ops->notify(new_client->pdev,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+				VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED);
 		return ret;
+	}
 	new_client->switched = true;
 
+	if (active->ops->notify)
+		active->ops->notify(active->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE);
+	if (new_client->ops->notify)
+		new_client->ops->notify(new_client->pdev,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+			VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE);
+
 	if (new_client->ops->reprobe)
 		new_client->ops->reprobe(new_client->pdev);
 
diff --git a/include/linux/vga_switcheroo.h b/include/linux/vga_switcheroo.h
index 63e6d6e5786e..2dc8ebc84fd4 100644
--- a/include/linux/vga_switcheroo.h
+++ b/include/linux/vga_switcheroo.h
@@ -90,6 +90,17 @@ enum vga_switcheroo_client_id {
 	VGA_SWITCHEROO_MAX_CLIENTS,
 };
 
+enum vga_switcheroo_notify_direction {
+	VGA_SWITCHEROO_NOTIFY_SWITCH_TO,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_AWAY,
+};
+
+enum vga_switcheroo_notify_action {
+	VGA_SWITCHEROO_NOTIFY_SWITCH_PENDING,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_COMPLETE,
+	VGA_SWITCHEROO_NOTIFY_SWITCH_FAILED,
+};
+
 /**
  * struct vga_switcheroo_handler - handler callbacks
  * @init: initialize handler.
@@ -134,6 +145,10 @@ struct vga_switcheroo_handler {
  * 	Mandatory. The client should return false if a user space process
  * 	has one of its device files open
  * @gpu_bound: notify the client id to audio client when the GPU is bound.
+ * @notify: notify clients of pending and completed switches
+ *	Optional. This gets called for both active and inactive clients,
+ *	before a switch begins, and after a switch successfully completes
+ *	or fails.
  *
  * Client callbacks. A client can be either a GPU or an audio device on a GPU.
  * The @set_gpu_state and @can_switch methods are mandatory, @reprobe may be
@@ -145,6 +160,9 @@ struct vga_switcheroo_client_ops {
 	void (*reprobe)(struct pci_dev *dev);
 	bool (*can_switch)(struct pci_dev *dev);
 	void (*gpu_bound)(struct pci_dev *dev, enum vga_switcheroo_client_id);
+	void (*notify)(struct pci_dev *dev,
+		       enum vga_switcheroo_notify_direction,
+		       enum vga_switcheroo_notify_action);
 };
 
 #if defined(CONFIG_VGA_SWITCHEROO)
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 4/6] i915: implement vga-switcheroo reprobe() callback
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Add a vga-switcheroo callback for reprobing displays. Use this new
callback to retrain the link on all DP encoders after a mux switch.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/i915_switcheroo.c | 27 +++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_switcheroo.c b/drivers/gpu/drm/i915/i915_switcheroo.c
index ed69b5d4a375..fa388de03cf6 100644
--- a/drivers/gpu/drm/i915/i915_switcheroo.c
+++ b/drivers/gpu/drm/i915/i915_switcheroo.c
@@ -7,6 +7,8 @@
 
 #include "i915_drv.h"
 #include "i915_switcheroo.h"
+#include "display/intel_display_types.h"
+#include "display/intel_dp.h"
 
 static void i915_switcheroo_set_state(struct pci_dev *pdev,
 				      enum vga_switcheroo_state state)
@@ -46,9 +48,32 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
 	return i915 && atomic_read(&i915->drm.open_count) == 0;
 }
 
+static void i915_switcheroo_reprobe(struct pci_dev *pdev)
+{
+	struct drm_i915_private *i915 = pdev_to_i915(pdev);
+	struct intel_encoder *encoder;
+
+	for_each_intel_dp(&i915->drm, encoder) {
+		int ret = -EDEADLK;
+		struct drm_modeset_acquire_ctx ctx;
+
+		drm_modeset_acquire_init(&ctx, 0);
+
+		while (ret == -EDEADLK) {
+			ret = intel_dp_retrain_link(encoder, &ctx);
+
+			if (ret == -EDEADLK)
+				drm_modeset_backoff(&ctx);
+		}
+
+		drm_modeset_drop_locks(&ctx);
+		drm_modeset_acquire_fini(&ctx);
+	}
+}
+
 static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
 	.set_gpu_state = i915_switcheroo_set_state,
-	.reprobe = NULL,
+	.reprobe = i915_switcheroo_reprobe,
 	.can_switch = i915_switcheroo_can_switch,
 };
 
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 4/6] i915: implement vga-switcheroo reprobe() callback
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Add a vga-switcheroo callback for reprobing displays. Use this new
callback to retrain the link on all DP encoders after a mux switch.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/i915_switcheroo.c | 27 +++++++++++++++++++++++++-
 1 file changed, 26 insertions(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/i915/i915_switcheroo.c b/drivers/gpu/drm/i915/i915_switcheroo.c
index ed69b5d4a375..fa388de03cf6 100644
--- a/drivers/gpu/drm/i915/i915_switcheroo.c
+++ b/drivers/gpu/drm/i915/i915_switcheroo.c
@@ -7,6 +7,8 @@
 
 #include "i915_drv.h"
 #include "i915_switcheroo.h"
+#include "display/intel_display_types.h"
+#include "display/intel_dp.h"
 
 static void i915_switcheroo_set_state(struct pci_dev *pdev,
 				      enum vga_switcheroo_state state)
@@ -46,9 +48,32 @@ static bool i915_switcheroo_can_switch(struct pci_dev *pdev)
 	return i915 && atomic_read(&i915->drm.open_count) == 0;
 }
 
+static void i915_switcheroo_reprobe(struct pci_dev *pdev)
+{
+	struct drm_i915_private *i915 = pdev_to_i915(pdev);
+	struct intel_encoder *encoder;
+
+	for_each_intel_dp(&i915->drm, encoder) {
+		int ret = -EDEADLK;
+		struct drm_modeset_acquire_ctx ctx;
+
+		drm_modeset_acquire_init(&ctx, 0);
+
+		while (ret == -EDEADLK) {
+			ret = intel_dp_retrain_link(encoder, &ctx);
+
+			if (ret == -EDEADLK)
+				drm_modeset_backoff(&ctx);
+		}
+
+		drm_modeset_drop_locks(&ctx);
+		drm_modeset_acquire_fini(&ctx);
+	}
+}
+
 static const struct vga_switcheroo_client_ops i915_switcheroo_ops = {
 	.set_gpu_state = i915_switcheroo_set_state,
-	.reprobe = NULL,
+	.reprobe = i915_switcheroo_reprobe,
 	.can_switch = i915_switcheroo_can_switch,
 };
 
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 5/6] i915: fail atomic commit when muxed away
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Attempting to commit a modeset while mux-switched away can cause
problems due to DisplayPort links being unavailable while they are
physically disconnected. In order to avoid this, bail out of atomic
commit early if attempted while a display mux is switched away.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 346846609f45..4ad799e4b024 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/dma-resv.h>
 #include <linux/slab.h>
+#include <linux/vga_switcheroo.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
@@ -15736,6 +15737,12 @@ static int intel_atomic_commit(struct drm_device *dev,
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	int ret = 0;
 
+	if (!vga_switcheroo_is_client_active(to_pci_dev(dev->dev))) {
+		drm_dbg_atomic(&dev_priv->drm,
+			"Atomic commit attempted while muxed away.\n");
+		return -EINVAL;
+	}
+
 	state->wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
 
 	drm_atomic_state_get(&state->base);
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 5/6] i915: fail atomic commit when muxed away
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

Attempting to commit a modeset while mux-switched away can cause
problems due to DisplayPort links being unavailable while they are
physically disconnected. In order to avoid this, bail out of atomic
commit early if attempted while a display mux is switched away.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/display/intel_display.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_display.c b/drivers/gpu/drm/i915/display/intel_display.c
index 346846609f45..4ad799e4b024 100644
--- a/drivers/gpu/drm/i915/display/intel_display.c
+++ b/drivers/gpu/drm/i915/display/intel_display.c
@@ -31,6 +31,7 @@
 #include <linux/module.h>
 #include <linux/dma-resv.h>
 #include <linux/slab.h>
+#include <linux/vga_switcheroo.h>
 
 #include <drm/drm_atomic.h>
 #include <drm/drm_atomic_helper.h>
@@ -15736,6 +15737,12 @@ static int intel_atomic_commit(struct drm_device *dev,
 	struct drm_i915_private *dev_priv = to_i915(dev);
 	int ret = 0;
 
+	if (!vga_switcheroo_is_client_active(to_pci_dev(dev->dev))) {
+		drm_dbg_atomic(&dev_priv->drm,
+			"Atomic commit attempted while muxed away.\n");
+		return -EINVAL;
+	}
+
 	state->wakeref = intel_runtime_pm_get(&dev_priv->runtime_pm);
 
 	drm_atomic_state_get(&state->base);
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [PATCH 6/6] i915: bail out of eDP link training while mux-switched away
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 20:51     ` Daniel Dadap
  -1 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

It is not possible to train a Displayport link while the lanes are
physically disconnected by a display mux. In order to prevent problems
associated with attempting to train a disconnected link, abort eDP
link training if the i915 GPU is not an active vga-switcheroo client.
This short circuit is eDP-specific, as normal DP (e.g. for external
displays) should be able to detect that the link is not physically
connected, while eDP is usually assumed to be always connected.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a7defb37ab00..a1c61db8a228 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -24,6 +24,7 @@
 #include "intel_display_types.h"
 #include "intel_dp.h"
 #include "intel_dp_link_training.h"
+#include "linux/vga_switcheroo.h"
 
 static void
 intel_dp_dump_link_status(const u8 link_status[DP_LINK_STATUS_SIZE])
@@ -371,6 +372,14 @@ void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
 	struct intel_connector *intel_connector = intel_dp->attached_connector;
+	struct device *dev = dp_to_dig_port(intel_dp)->base.base.dev->dev;
+
+	if (intel_dp_is_edp(intel_dp) &&
+	    !vga_switcheroo_is_client_active(to_pci_dev(dev))) {
+		drm_dbg_kms(&dp_to_i915(intel_dp)->drm,
+			"eDP link training not allowed when muxed away.");
+		return;
+	}
 
 	if (!intel_dp_link_training_clock_recovery(intel_dp))
 		goto failure_handling;
-- 
2.18.4

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] [PATCH 6/6] i915: bail out of eDP link training while mux-switched away
@ 2020-07-27 20:51     ` Daniel Dadap
  0 siblings, 0 replies; 20+ messages in thread
From: Daniel Dadap @ 2020-07-27 20:51 UTC (permalink / raw)
  To: dri-devel, lukas, intel-gfx, jani.nikula, joonas.lahtinen, rodrigo.vivi
  Cc: Daniel Dadap

It is not possible to train a Displayport link while the lanes are
physically disconnected by a display mux. In order to prevent problems
associated with attempting to train a disconnected link, abort eDP
link training if the i915 GPU is not an active vga-switcheroo client.
This short circuit is eDP-specific, as normal DP (e.g. for external
displays) should be able to detect that the link is not physically
connected, while eDP is usually assumed to be always connected.

Signed-off-by: Daniel Dadap <ddadap@nvidia.com>
---
 drivers/gpu/drm/i915/display/intel_dp_link_training.c | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/drivers/gpu/drm/i915/display/intel_dp_link_training.c b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
index a7defb37ab00..a1c61db8a228 100644
--- a/drivers/gpu/drm/i915/display/intel_dp_link_training.c
+++ b/drivers/gpu/drm/i915/display/intel_dp_link_training.c
@@ -24,6 +24,7 @@
 #include "intel_display_types.h"
 #include "intel_dp.h"
 #include "intel_dp_link_training.h"
+#include "linux/vga_switcheroo.h"
 
 static void
 intel_dp_dump_link_status(const u8 link_status[DP_LINK_STATUS_SIZE])
@@ -371,6 +372,14 @@ void
 intel_dp_start_link_train(struct intel_dp *intel_dp)
 {
 	struct intel_connector *intel_connector = intel_dp->attached_connector;
+	struct device *dev = dp_to_dig_port(intel_dp)->base.base.dev->dev;
+
+	if (intel_dp_is_edp(intel_dp) &&
+	    !vga_switcheroo_is_client_active(to_pci_dev(dev))) {
+		drm_dbg_kms(&dp_to_i915(intel_dp)->drm,
+			"eDP link training not allowed when muxed away.");
+		return;
+	}
 
 	if (!intel_dp_link_training_clock_recovery(intel_dp))
 		goto failure_handling;
-- 
2.18.4

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 20+ messages in thread

* [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
       [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-27 22:05 ` Patchwork
  2020-07-27 22:06 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2020-07-27 22:05 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
URL   : https://patchwork.freedesktop.org/series/79940/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
c641759bc9fc vga-switcheroo: add new "immediate" switch event type
bfff6b1409e8 vga-switcheroo: Add a way to test for the active client
ff047b26770b vga-switcheroo: notify clients of pending/completed switch events
11d6a92ef9e8 i915: implement vga-switcheroo reprobe() callback
84cd1d3bc501 i915: fail atomic commit when muxed away
-:31: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#31: FILE: drivers/gpu/drm/i915/display/intel_display.c:15736:
+		drm_dbg_atomic(&dev_priv->drm,
+			"Atomic commit attempted while muxed away.\n");

total: 0 errors, 0 warnings, 1 checks, 19 lines checked
967055634357 i915: bail out of eDP link training while mux-switched away
-:37: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis
#37: FILE: drivers/gpu/drm/i915/display/intel_dp_link_training.c:400:
+		drm_dbg_kms(&dp_to_i915(intel_dp)->drm,
+			"eDP link training not allowed when muxed away.");

total: 0 errors, 0 warnings, 1 checks, 21 lines checked


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Intel-gfx] ✗ Fi.CI.SPARSE: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
       [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
  2020-07-27 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type Patchwork
@ 2020-07-27 22:06 ` Patchwork
  2020-07-27 22:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
  2020-07-28  0:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  4 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2020-07-27 22:06 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
URL   : https://patchwork.freedesktop.org/series/79940/
State : warning

== Summary ==

$ dim sparse --fast origin/drm-tip
Sparse version: v0.6.0
Fast mode used, each commit won't be checked separately.


_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Intel-gfx] ✓ Fi.CI.BAT: success for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
       [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
                   ` (2 preceding siblings ...)
  2020-07-27 22:06 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
@ 2020-07-27 22:36 ` Patchwork
  2020-07-28  0:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork
  4 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2020-07-27 22:36 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 7267 bytes --]

== Series Details ==

Series: series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
URL   : https://patchwork.freedesktop.org/series/79940/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_8799 -> Patchwork_18247
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/index.html

Known issues
------------

  Here are the changes found in Patchwork_18247 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_suspend@basic-s0:
    - fi-tgl-u2:          [PASS][1] -> [FAIL][2] ([i915#1888])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-u2/igt@gem_exec_suspend@basic-s0.html

  * igt@i915_module_load@reload:
    - fi-tgl-y:           [PASS][3] -> [DMESG-WARN][4] ([i915#1982])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-y/igt@i915_module_load@reload.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-y/igt@i915_module_load@reload.html

  * igt@i915_pm_rpm@module-reload:
    - fi-bsw-kefka:       [PASS][5] -> [DMESG-WARN][6] ([i915#1982]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-bsw-kefka/igt@i915_pm_rpm@module-reload.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-bsw-kefka/igt@i915_pm_rpm@module-reload.html

  * igt@i915_selftest@live@coherency:
    - fi-gdg-551:         [PASS][7] -> [DMESG-FAIL][8] ([i915#1748])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-gdg-551/igt@i915_selftest@live@coherency.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-gdg-551/igt@i915_selftest@live@coherency.html

  * igt@prime_self_import@basic-with_two_bos:
    - fi-tgl-y:           [PASS][9] -> [DMESG-WARN][10] ([i915#402]) +1 similar issue
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-y/igt@prime_self_import@basic-with_two_bos.html

  
#### Possible fixes ####

  * igt@gem_flink_basic@double-flink:
    - fi-tgl-y:           [DMESG-WARN][11] ([i915#402]) -> [PASS][12] +1 similar issue
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-y/igt@gem_flink_basic@double-flink.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-y/igt@gem_flink_basic@double-flink.html

  * igt@i915_module_load@reload:
    - {fi-tgl-dsi}:       [DMESG-WARN][13] ([i915#1982]) -> [PASS][14] +1 similar issue
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-dsi/igt@i915_module_load@reload.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-dsi/igt@i915_module_load@reload.html

  * igt@kms_chamelium@common-hpd-after-suspend:
    - fi-kbl-7500u:       [DMESG-WARN][15] ([i915#2203]) -> [PASS][16]
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-kbl-7500u/igt@kms_chamelium@common-hpd-after-suspend.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-kbl-7500u/igt@kms_chamelium@common-hpd-after-suspend.html

  * igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1:
    - fi-icl-u2:          [DMESG-WARN][17] ([i915#1982]) -> [PASS][18]
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-icl-u2/igt@kms_flip@basic-flip-vs-wf_vblank@c-edp1.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-tgl-u2:          [DMESG-WARN][19] ([i915#402]) -> [PASS][20]
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-tgl-u2/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-tgl-u2/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  
#### Warnings ####

  * igt@i915_pm_rpm@module-reload:
    - fi-kbl-x1275:       [SKIP][21] ([fdo#109271]) -> [DMESG-FAIL][22] ([i915#62] / [i915#95])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-kbl-x1275/igt@i915_pm_rpm@module-reload.html

  * igt@kms_force_connector_basic@force-edid:
    - fi-kbl-x1275:       [DMESG-WARN][23] ([i915#62] / [i915#92]) -> [DMESG-WARN][24] ([i915#62] / [i915#92] / [i915#95]) +4 similar issues
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-kbl-x1275/igt@kms_force_connector_basic@force-edid.html

  * igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence:
    - fi-kbl-x1275:       [DMESG-WARN][25] ([i915#62] / [i915#92] / [i915#95]) -> [DMESG-WARN][26] ([i915#62] / [i915#92]) +1 similar issue
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/fi-kbl-x1275/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/fi-kbl-x1275/igt@kms_pipe_crc_basic@read-crc-pipe-a-frame-sequence.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [i915#1748]: https://gitlab.freedesktop.org/drm/intel/issues/1748
  [i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2203]: https://gitlab.freedesktop.org/drm/intel/issues/2203
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#62]: https://gitlab.freedesktop.org/drm/intel/issues/62
  [i915#92]: https://gitlab.freedesktop.org/drm/intel/issues/92
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (46 -> 40)
------------------------------

  Missing    (6): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * Linux: CI_DRM_8799 -> Patchwork_18247

  CI-20190529: 20190529
  CI_DRM_8799: f8675332cfe857f95352e32cb329416941d90725 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5749: 2fef871e791ceab7841b899691c443167550173d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_18247: 9670556343570fb2d22b4ce9a5123b2237728a36 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

967055634357 i915: bail out of eDP link training while mux-switched away
84cd1d3bc501 i915: fail atomic commit when muxed away
11d6a92ef9e8 i915: implement vga-switcheroo reprobe() callback
ff047b26770b vga-switcheroo: notify clients of pending/completed switch events
bfff6b1409e8 vga-switcheroo: Add a way to test for the active client
c641759bc9fc vga-switcheroo: add new "immediate" switch event type

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/index.html

[-- Attachment #1.2: Type: text/html, Size: 9152 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

* [Intel-gfx] ✗ Fi.CI.IGT: failure for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
       [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
                   ` (3 preceding siblings ...)
  2020-07-27 22:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
@ 2020-07-28  0:45 ` Patchwork
  4 siblings, 0 replies; 20+ messages in thread
From: Patchwork @ 2020-07-28  0:45 UTC (permalink / raw)
  To: Daniel Dadap; +Cc: intel-gfx


[-- Attachment #1.1: Type: text/plain, Size: 16800 bytes --]

== Series Details ==

Series: series starting with [1/6] vga-switcheroo: add new "immediate" switch event type
URL   : https://patchwork.freedesktop.org/series/79940/
State : failure

== Summary ==

CI Bug Log - changes from CI_DRM_8799_full -> Patchwork_18247_full
====================================================

Summary
-------

  **FAILURE**

  Serious unknown changes coming with Patchwork_18247_full absolutely need to be
  verified manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in Patchwork_18247_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  

Possible new issues
-------------------

  Here are the unknown changes that may have been introduced in Patchwork_18247_full:

### IGT changes ###

#### Possible regressions ####

  * igt@gem_exec_balancer@bonded-early:
    - shard-tglb:         NOTRUN -> [FAIL][1]
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-tglb1/igt@gem_exec_balancer@bonded-early.html

  

### Piglit changes ###

#### Possible regressions ####

  * spec@glsl-1.50@execution@built-in-functions@gs-op-eq-bvec4-bvec4 (NEW):
    - pig-snb-2600:       NOTRUN -> [FAIL][2]
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/pig-snb-2600/spec@glsl-1.50@execution@built-in-functions@gs-op-eq-bvec4-bvec4.html

  
New tests
---------

  New tests have been introduced between CI_DRM_8799_full and Patchwork_18247_full:

### New Piglit tests (1) ###

  * spec@glsl-1.50@execution@built-in-functions@gs-op-eq-bvec4-bvec4:
    - Statuses : 1 fail(s)
    - Exec time: [0.09] s

  

Known issues
------------

  Here are the changes found in Patchwork_18247_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@preservation-s3@bcs0:
    - shard-kbl:          [PASS][3] -> [DMESG-WARN][4] ([i915#180]) +6 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-kbl4/igt@gem_ctx_isolation@preservation-s3@bcs0.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-kbl2/igt@gem_ctx_isolation@preservation-s3@bcs0.html

  * igt@gem_ctx_persistence@engines-mixed-process@rcs0:
    - shard-skl:          [PASS][5] -> [FAIL][6] ([i915#1528])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl9/igt@gem_ctx_persistence@engines-mixed-process@rcs0.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl6/igt@gem_ctx_persistence@engines-mixed-process@rcs0.html

  * igt@gem_exec_whisper@basic-forked:
    - shard-glk:          [PASS][7] -> [DMESG-WARN][8] ([i915#118] / [i915#95])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk7/igt@gem_exec_whisper@basic-forked.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk8/igt@gem_exec_whisper@basic-forked.html

  * igt@gem_huc_copy@huc-copy:
    - shard-tglb:         [PASS][9] -> [SKIP][10] ([i915#2190])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-tglb5/igt@gem_huc_copy@huc-copy.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-tglb6/igt@gem_huc_copy@huc-copy.html

  * igt@gem_userptr_blits@invalid-mmap-offset-unsync@wc:
    - shard-iclb:         [PASS][11] -> [INCOMPLETE][12] ([i915#2119])
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-iclb2/igt@gem_userptr_blits@invalid-mmap-offset-unsync@wc.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-iclb5/igt@gem_userptr_blits@invalid-mmap-offset-unsync@wc.html

  * igt@i915_selftest@live@gt_heartbeat:
    - shard-iclb:         [PASS][13] -> [DMESG-FAIL][14] ([i915#541])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-iclb4/igt@i915_selftest@live@gt_heartbeat.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-iclb4/igt@i915_selftest@live@gt_heartbeat.html

  * igt@kms_big_fb@y-tiled-16bpp-rotate-0:
    - shard-skl:          [PASS][15] -> [DMESG-WARN][16] ([i915#1982]) +13 similar issues
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl4/igt@kms_big_fb@y-tiled-16bpp-rotate-0.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl8/igt@kms_big_fb@y-tiled-16bpp-rotate-0.html

  * igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render:
    - shard-tglb:         [PASS][17] -> [DMESG-WARN][18] ([i915#1982]) +3 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-tglb3/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-tglb7/igt@kms_frontbuffer_tracking@psr-1p-offscren-pri-shrfb-draw-render.html

  * igt@kms_hdr@bpc-switch:
    - shard-skl:          [PASS][19] -> [FAIL][20] ([i915#1188])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl6/igt@kms_hdr@bpc-switch.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl3/igt@kms_hdr@bpc-switch.html

  * igt@kms_psr@psr2_primary_blt:
    - shard-iclb:         [PASS][21] -> [SKIP][22] ([fdo#109441])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-iclb2/igt@kms_psr@psr2_primary_blt.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-iclb5/igt@kms_psr@psr2_primary_blt.html

  * igt@kms_vblank@pipe-c-query-forked-hang:
    - shard-apl:          [PASS][23] -> [DMESG-WARN][24] ([i915#1635] / [i915#1982])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl1/igt@kms_vblank@pipe-c-query-forked-hang.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-apl1/igt@kms_vblank@pipe-c-query-forked-hang.html

  * igt@perf_pmu@semaphore-busy@rcs0:
    - shard-kbl:          [PASS][25] -> [FAIL][26] ([i915#1820])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-kbl2/igt@perf_pmu@semaphore-busy@rcs0.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-kbl1/igt@perf_pmu@semaphore-busy@rcs0.html

  
#### Possible fixes ####

  * igt@gem_exec_whisper@basic-contexts:
    - shard-glk:          [DMESG-WARN][27] ([i915#118] / [i915#95]) -> [PASS][28] +1 similar issue
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk8/igt@gem_exec_whisper@basic-contexts.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk3/igt@gem_exec_whisper@basic-contexts.html

  * igt@gen9_exec_parse@allowed-single:
    - shard-glk:          [DMESG-WARN][29] ([i915#1436] / [i915#716]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk5/igt@gen9_exec_parse@allowed-single.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk6/igt@gen9_exec_parse@allowed-single.html

  * igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing:
    - shard-tglb:         [DMESG-WARN][31] ([i915#402]) -> [PASS][32]
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-tglb1/igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-tglb8/igt@kms_atomic_transition@1x-modeset-transitions-nonblocking-fencing.html

  * igt@kms_big_fb@linear-64bpp-rotate-0:
    - shard-glk:          [DMESG-FAIL][33] ([i915#118] / [i915#95]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk8/igt@kms_big_fb@linear-64bpp-rotate-0.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk1/igt@kms_big_fb@linear-64bpp-rotate-0.html

  * igt@kms_color@pipe-c-ctm-0-25:
    - shard-skl:          [DMESG-WARN][35] ([i915#1982]) -> [PASS][36] +2 similar issues
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl6/igt@kms_color@pipe-c-ctm-0-25.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl3/igt@kms_color@pipe-c-ctm-0-25.html

  * igt@kms_cursor_edge_walk@pipe-c-64x64-top-edge:
    - shard-glk:          [DMESG-WARN][37] ([i915#1982]) -> [PASS][38] +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk9/igt@kms_cursor_edge_walk@pipe-c-64x64-top-edge.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk4/igt@kms_cursor_edge_walk@pipe-c-64x64-top-edge.html

  * igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic:
    - shard-glk:          [FAIL][39] ([i915#72]) -> [PASS][40]
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-glk9/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-glk4/igt@kms_cursor_legacy@2x-long-flip-vs-cursor-atomic.html

  * igt@kms_flip@flip-vs-suspend@a-dp1:
    - shard-kbl:          [DMESG-WARN][41] ([i915#180]) -> [PASS][42] +4 similar issues
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-kbl2/igt@kms_flip@flip-vs-suspend@a-dp1.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-kbl1/igt@kms_flip@flip-vs-suspend@a-dp1.html

  * igt@kms_flip_tiling@flip-changes-tiling-y:
    - shard-skl:          [FAIL][43] ([i915#699]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl1/igt@kms_flip_tiling@flip-changes-tiling-y.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl9/igt@kms_flip_tiling@flip-changes-tiling-y.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
    - shard-tglb:         [DMESG-WARN][45] ([i915#1982]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-tglb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-tglb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
    - shard-skl:          [FAIL][47] ([fdo#108145] / [i915#265]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl6/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl3/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html

  * igt@kms_setmode@basic:
    - shard-apl:          [FAIL][49] ([i915#1635] / [i915#31]) -> [PASS][50]
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl3/igt@kms_setmode@basic.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-apl4/igt@kms_setmode@basic.html

  * igt@perf_pmu@module-unload:
    - shard-apl:          [DMESG-WARN][51] ([i915#1635] / [i915#1982]) -> [PASS][52]
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl4/igt@perf_pmu@module-unload.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-apl2/igt@perf_pmu@module-unload.html

  
#### Warnings ####

  * igt@kms_content_protection@atomic-dpms:
    - shard-kbl:          [TIMEOUT][53] ([i915#1319] / [i915#2119]) -> [TIMEOUT][54] ([i915#1319] / [i915#1958] / [i915#2119])
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-kbl2/igt@kms_content_protection@atomic-dpms.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-kbl1/igt@kms_content_protection@atomic-dpms.html

  * igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes:
    - shard-kbl:          [DMESG-WARN][55] ([i915#180]) -> [INCOMPLETE][56] ([i915#155])
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-kbl7/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-kbl1/igt@kms_plane@plane-panning-bottom-right-suspend-pipe-b-planes.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [FAIL][57] ([fdo#108145] / [i915#265]) -> [DMESG-FAIL][58] ([fdo#108145] / [i915#1982]) +2 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-skl8/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [SKIP][59] ([fdo#109441]) -> [DMESG-WARN][60] ([i915#1982])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-iclb4/igt@kms_psr@psr2_cursor_render.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-iclb2/igt@kms_psr@psr2_cursor_render.html

  * igt@runner@aborted:
    - shard-apl:          ([FAIL][61], [FAIL][62], [FAIL][63], [FAIL][64], [FAIL][65], [FAIL][66], [FAIL][67], [FAIL][68], [FAIL][69], [FAIL][70], [FAIL][71], [FAIL][72], [FAIL][73]) ([i915#1610] / [i915#1635] / [i915#2110] / [i915#637]) -> [FAIL][74] ([i915#1635] / [i915#2110])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl6/igt@runner@aborted.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl7/igt@runner@aborted.html
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl3/igt@runner@aborted.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl1/igt@runner@aborted.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl4/igt@runner@aborted.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl6/igt@runner@aborted.html
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl2/igt@runner@aborted.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl4/igt@runner@aborted.html
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl3/igt@runner@aborted.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl6/igt@runner@aborted.html
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl8/igt@runner@aborted.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl7/igt@runner@aborted.html
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_8799/shard-apl2/igt@runner@aborted.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/shard-apl2/igt@runner@aborted.html

  
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [i915#118]: https://gitlab.freedesktop.org/drm/intel/issues/118
  [i915#1188]: https://gitlab.freedesktop.org/drm/intel/issues/1188
  [i915#1319]: https://gitlab.freedesktop.org/drm/intel/issues/1319
  [i915#1436]: https://gitlab.freedesktop.org/drm/intel/issues/1436
  [i915#1528]: https://gitlab.freedesktop.org/drm/intel/issues/1528
  [i915#155]: https://gitlab.freedesktop.org/drm/intel/issues/155
  [i915#1610]: https://gitlab.freedesktop.org/drm/intel/issues/1610
  [i915#1635]: https://gitlab.freedesktop.org/drm/intel/issues/1635
  [i915#180]: https://gitlab.freedesktop.org/drm/intel/issues/180
  [i915#1820]: https://gitlab.freedesktop.org/drm/intel/issues/1820
  [i915#1958]: https://gitlab.freedesktop.org/drm/intel/issues/1958
  [i915#1982]: https://gitlab.freedesktop.org/drm/intel/issues/1982
  [i915#2110]: https://gitlab.freedesktop.org/drm/intel/issues/2110
  [i915#2119]: https://gitlab.freedesktop.org/drm/intel/issues/2119
  [i915#2190]: https://gitlab.freedesktop.org/drm/intel/issues/2190
  [i915#265]: https://gitlab.freedesktop.org/drm/intel/issues/265
  [i915#31]: https://gitlab.freedesktop.org/drm/intel/issues/31
  [i915#402]: https://gitlab.freedesktop.org/drm/intel/issues/402
  [i915#541]: https://gitlab.freedesktop.org/drm/intel/issues/541
  [i915#637]: https://gitlab.freedesktop.org/drm/intel/issues/637
  [i915#699]: https://gitlab.freedesktop.org/drm/intel/issues/699
  [i915#716]: https://gitlab.freedesktop.org/drm/intel/issues/716
  [i915#72]: https://gitlab.freedesktop.org/drm/intel/issues/72
  [i915#95]: https://gitlab.freedesktop.org/drm/intel/issues/95


Participating hosts (12 -> 12)
------------------------------

  No changes in participating hosts


Build changes
-------------

  * Linux: CI_DRM_8799 -> Patchwork_18247

  CI-20190529: 20190529
  CI_DRM_8799: f8675332cfe857f95352e32cb329416941d90725 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5749: 2fef871e791ceab7841b899691c443167550173d @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_18247: 9670556343570fb2d22b4ce9a5123b2237728a36 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_18247/index.html

[-- Attachment #1.2: Type: text/html, Size: 20199 bytes --]

[-- Attachment #2: Type: text/plain, Size: 160 bytes --]

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support
  2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
@ 2020-07-28  9:32     ` daniel
  -1 siblings, 0 replies; 20+ messages in thread
From: daniel @ 2020-07-28  9:32 UTC (permalink / raw)
  Cc: intel-gfx, dri-devel, rodrigo.vivi

On Mon, Jul 27, 2020 at 03:51:06PM -0500, Daniel Dadap wrote:
> Changes to allow vga-switcheroo to switch the mux while modesetting
> clients remain active. There is existing support for switching the
> mux without checking can_switch; however, this support also does not
> reprobe after the mux switch is complete. This patch series adds a new
> type of switch event which switches immediately while still calling
> client driver callbacks, and updates the i915 DRM-KMS driver to reprobe
> eDP outputs after switching the mux to an i915-driven GPU, and to avoid
> using eDP links (which i915 always assumes to be connected) while the
> mux is switched away.

So before digging into the details I think the big issue we need to solve
first is locking. And current vga-switcheroo is already broken in that
regard (there's some fixme comments in drivers about it), but I never
cared because it was full device switch only, initiated by users.

But you now add vgaswitcheroo to modeset code, and runtime switching, I
don't think we can ignore locking here anymore. Also, it's classic abba
deadlock design: i915 modeset code calls your new functions in
vgaswitcheroo, and vgaswitcheroo calls into modeset code to shut down
stuff. This doesn't work (you get away with it by omitting locking in some
places, like the current code).

One totally nuts idea I've had is to protect vgaswitcheroo output state
with a drm_modeset_lock. That supports full graph locking, which means it
doesn't matter where we start: nouveau, i915, vgaswitcheroo. So could work
out neatly.

Problem: That still leaves the loop for the device switching, which is all
tangled up here, so either we make this completely separate, or we figure
out a plan how make this work for device switching too. And the additional
problem is that drm_modeset_lock is already a highly entrenched lock, I'm
not sure whether we can also support the device switching with that
approach: The device locking we'd need would need to be an outermost lock,
or at least fairly big, whereas drm_modeset_lock is kinda a level below.
Or I'm making a mess here (it is already one after all).

Also, where's the other side? I know the other side you care about is in
the nvidia blob driver, but that doesn't count for upstream. We need that
code in nouveau for review and merging.

Cheers, Daniel


> 
> Daniel Dadap (6):
>   vga-switcheroo: add new "immediate" switch event type
>   vga-switcheroo: Add a way to test for the active client
>   vga-switcheroo: notify clients of pending/completed switch events
>   i915: implement vga-switcheroo reprobe() callback
>   i915: fail atomic commit when muxed away
>   i915: bail out of eDP link training while mux-switched away
> 
>  drivers/gpu/drm/i915/display/intel_display.c  |   7 +
>  .../drm/i915/display/intel_dp_link_training.c |   9 ++
>  drivers/gpu/drm/i915/i915_switcheroo.c        |  27 +++-
>  drivers/gpu/vga/vga_switcheroo.c              | 153 ++++++++++++++----
>  include/linux/vga_switcheroo.h                |  20 +++
>  5 files changed, 185 insertions(+), 31 deletions(-)
> 
> -- 
> 2.18.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

^ permalink raw reply	[flat|nested] 20+ messages in thread

* Re: [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support
@ 2020-07-28  9:32     ` daniel
  0 siblings, 0 replies; 20+ messages in thread
From: daniel @ 2020-07-28  9:32 UTC (permalink / raw)
  Cc: intel-gfx, dri-devel

On Mon, Jul 27, 2020 at 03:51:06PM -0500, Daniel Dadap wrote:
> Changes to allow vga-switcheroo to switch the mux while modesetting
> clients remain active. There is existing support for switching the
> mux without checking can_switch; however, this support also does not
> reprobe after the mux switch is complete. This patch series adds a new
> type of switch event which switches immediately while still calling
> client driver callbacks, and updates the i915 DRM-KMS driver to reprobe
> eDP outputs after switching the mux to an i915-driven GPU, and to avoid
> using eDP links (which i915 always assumes to be connected) while the
> mux is switched away.

So before digging into the details I think the big issue we need to solve
first is locking. And current vga-switcheroo is already broken in that
regard (there's some fixme comments in drivers about it), but I never
cared because it was full device switch only, initiated by users.

But you now add vgaswitcheroo to modeset code, and runtime switching, I
don't think we can ignore locking here anymore. Also, it's classic abba
deadlock design: i915 modeset code calls your new functions in
vgaswitcheroo, and vgaswitcheroo calls into modeset code to shut down
stuff. This doesn't work (you get away with it by omitting locking in some
places, like the current code).

One totally nuts idea I've had is to protect vgaswitcheroo output state
with a drm_modeset_lock. That supports full graph locking, which means it
doesn't matter where we start: nouveau, i915, vgaswitcheroo. So could work
out neatly.

Problem: That still leaves the loop for the device switching, which is all
tangled up here, so either we make this completely separate, or we figure
out a plan how make this work for device switching too. And the additional
problem is that drm_modeset_lock is already a highly entrenched lock, I'm
not sure whether we can also support the device switching with that
approach: The device locking we'd need would need to be an outermost lock,
or at least fairly big, whereas drm_modeset_lock is kinda a level below.
Or I'm making a mess here (it is already one after all).

Also, where's the other side? I know the other side you care about is in
the nvidia blob driver, but that doesn't count for upstream. We need that
code in nouveau for review and merging.

Cheers, Daniel


> 
> Daniel Dadap (6):
>   vga-switcheroo: add new "immediate" switch event type
>   vga-switcheroo: Add a way to test for the active client
>   vga-switcheroo: notify clients of pending/completed switch events
>   i915: implement vga-switcheroo reprobe() callback
>   i915: fail atomic commit when muxed away
>   i915: bail out of eDP link training while mux-switched away
> 
>  drivers/gpu/drm/i915/display/intel_display.c  |   7 +
>  .../drm/i915/display/intel_dp_link_training.c |   9 ++
>  drivers/gpu/drm/i915/i915_switcheroo.c        |  27 +++-
>  drivers/gpu/vga/vga_switcheroo.c              | 153 ++++++++++++++----
>  include/linux/vga_switcheroo.h                |  20 +++
>  5 files changed, 185 insertions(+), 31 deletions(-)
> 
> -- 
> 2.18.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2020-07-28  9:32 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
     [not found] <ba78cd19-45ad-b17e-5174-256cc11f36c2%40nvidia.com>
2020-07-27 20:51 ` [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support Daniel Dadap
2020-07-27 20:51   ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 1/6] vga-switcheroo: add new "immediate" switch event type Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 2/6] vga-switcheroo: Add a way to test for the active client Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 3/6] vga-switcheroo: notify clients of pending/completed switch events Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 4/6] i915: implement vga-switcheroo reprobe() callback Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 5/6] i915: fail atomic commit when muxed away Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-27 20:51   ` [PATCH 6/6] i915: bail out of eDP link training while mux-switched away Daniel Dadap
2020-07-27 20:51     ` [Intel-gfx] " Daniel Dadap
2020-07-28  9:32   ` [Intel-gfx] [PATCH 0/6] vga-switcheroo: initial dynamic mux switch support daniel
2020-07-28  9:32     ` daniel
2020-07-27 22:05 ` [Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for series starting with [1/6] vga-switcheroo: add new "immediate" switch event type Patchwork
2020-07-27 22:06 ` [Intel-gfx] ✗ Fi.CI.SPARSE: " Patchwork
2020-07-27 22:36 ` [Intel-gfx] ✓ Fi.CI.BAT: success " Patchwork
2020-07-28  0:45 ` [Intel-gfx] ✗ Fi.CI.IGT: failure " Patchwork

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.