@@ -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);
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(+)