]> git.karo-electronics.de Git - linux-beck.git/commitdiff
drm/qxl: fix disabling extra monitors from client
authorMarc-André Lureau <marcandre.lureau@gmail.com>
Fri, 18 Oct 2013 14:11:33 +0000 (16:11 +0200)
committerDave Airlie <airlied@redhat.com>
Wed, 23 Oct 2013 13:21:48 +0000 (14:21 +0100)
To disable a monitor, a Spice client sends a monitor config with the
monitor resolution to 0x0.

However, before qxl_crtc_disable() is reached after the hotplug event,
it can happen that another monitor is reconfigured, and
qxl_send_monitors_config() is called with the old config, which will
re-enable the monitor on the client.

Reset config if monitor is found disconnected, during
drm_helper_hpd_irq_event().

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
drivers/gpu/drm/qxl/qxl_display.c

index 4f28060a4151cd5e145ec3d1ded70c72a81e592a..61974cb9d20515ce5f45e0c1262e5cc54de95343 100644 (file)
@@ -803,7 +803,10 @@ static enum drm_connector_status qxl_conn_detect(
                     qdev->client_monitors_config->count > output->index &&
                     qxl_head_enabled(&qdev->client_monitors_config->heads[output->index]));
 
-       DRM_DEBUG("\n");
+       DRM_DEBUG("#%d connected: %d\n", output->index, connected);
+       if (!connected)
+               qxl_monitors_config_set(qdev, output->index, 0, 0, 0, 0, 0);
+
        return connected ? connector_status_connected
                         : connector_status_disconnected;
 }