drm/vmwgfx: Don't send drm sysfs hotplug events on initial master set
authorThomas Hellstrom <thellstrom@vmware.com>
Tue, 7 May 2019 09:07:53 +0000 (11:07 +0200)
committerThomas Hellstrom <thellstrom@vmware.com>
Tue, 21 May 2019 08:22:40 +0000 (10:22 +0200)
This may confuse user-space clients like plymouth that opens a drm
file descriptor as a result of a hotplug event and then generates a
new event...

Cc: <stable@vger.kernel.org>
Fixes: 5ea1734827bb ("drm/vmwgfx: Send a hotplug event at master_set")
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
drivers/gpu/drm/vmwgfx/vmwgfx_drv.c

index bf6c3500d363db7a99983a85833d9f05d46502e5..4ff11a0077e17c98c484f3af6640a4155d2d024b 100644 (file)
@@ -1239,7 +1239,13 @@ static int vmw_master_set(struct drm_device *dev,
        }
 
        dev_priv->active_master = vmaster;
-       drm_sysfs_hotplug_event(dev);
+
+       /*
+        * Inform a new master that the layout may have changed while
+        * it was gone.
+        */
+       if (!from_open)
+               drm_sysfs_hotplug_event(dev);
 
        return 0;
 }