qxl: read monitors config at boot
authorGerd Hoffmann <kraxel@redhat.com>
Wed, 1 Mar 2017 10:12:33 +0000 (11:12 +0100)
committerGerd Hoffmann <kraxel@redhat.com>
Tue, 7 Mar 2017 06:09:16 +0000 (07:09 +0100)
Try to read the client monitors config at driver load time, even without
explicit notification.  So in case that info was filled before the driver
loaded and we've missed the notifications because of that the settings
will still be used.

With that place we now have to take care to properly handle a empty client
monitors config, so we don't trip over an uninitialized client monitors
config.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Reviewed-by: Gabriel Krisman Bertazi <krisman@collabora.co.uk>
Link: http://patchwork.freedesktop.org/patch/msgid/1488363154-6889-4-git-send-email-kraxel@redhat.com
drivers/gpu/drm/qxl/qxl_display.c

index 2b99496d881ae1d032f3cb69f0349caf0ee8fcd6..cf99acec4c8ef28a3580ec0792db42e810f6a10e 100644 (file)
@@ -81,6 +81,10 @@ static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev)
                           qdev->rom->client_monitors_config_crc);
                return MONITORS_CONFIG_BAD_CRC;
        }
+       if (!num_monitors) {
+               DRM_DEBUG_KMS("no client monitors configured\n");
+               return status;
+       }
        if (num_monitors > qdev->monitors_config->max_allowed) {
                DRM_DEBUG_KMS("client monitors list will be truncated: %d < %d\n",
                              qdev->monitors_config->max_allowed, num_monitors);
@@ -1192,6 +1196,7 @@ int qxl_modeset_init(struct qxl_device *qdev)
                qdev_output_init(&qdev->ddev, i);
        }
 
+       qxl_display_read_client_monitors_config(qdev);
        qdev->mode_info.mode_config_initialized = true;
 
        drm_mode_config_reset(&qdev->ddev);