|
@@ -1337,6 +1337,19 @@ static void __vmw_svga_disable(struct vmw_private *dev_priv)
|
|
|
*/
|
|
|
void vmw_svga_disable(struct vmw_private *dev_priv)
|
|
|
{
|
|
|
+ /*
|
|
|
+ * Disabling SVGA will turn off device modesetting capabilities, so
|
|
|
+ * notify KMS about that so that it doesn't cache atomic state that
|
|
|
+ * isn't valid anymore, for example crtcs turned on.
|
|
|
+ * Strictly we'd want to do this under the SVGA lock (or an SVGA mutex),
|
|
|
+ * but vmw_kms_lost_device() takes the reservation sem and thus we'll
|
|
|
+ * end up with lock order reversal. Thus, a master may actually perform
|
|
|
+ * a new modeset just after we call vmw_kms_lost_device() and race with
|
|
|
+ * vmw_svga_disable(), but that should at worst cause atomic KMS state
|
|
|
+ * to be inconsistent with the device, causing modesetting problems.
|
|
|
+ *
|
|
|
+ */
|
|
|
+ vmw_kms_lost_device(dev_priv->dev);
|
|
|
ttm_write_lock(&dev_priv->reservation_sem, false);
|
|
|
spin_lock(&dev_priv->svga_lock);
|
|
|
if (dev_priv->bdev.man[TTM_PL_VRAM].use_type) {
|