aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2017-03-01 05:12:33 -0500
committerGerd Hoffmann <kraxel@redhat.com>2017-03-07 01:09:16 -0500
commitc50fad8f62d1a6fe0083fa2c700e5e7bfc7dea0c (patch)
tree284d4309e251754099b16bd80b261f33d56cc050
parent9062155de0dfdc5cdfd38caf09d7f14b1833a2ca (diff)
qxl: read monitors config at boot
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
-rw-r--r--drivers/gpu/drm/qxl/qxl_display.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 2b99496d881a..cf99acec4c8e 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -81,6 +81,10 @@ static int qxl_display_copy_rom_client_monitors_config(struct qxl_device *qdev)
81 qdev->rom->client_monitors_config_crc); 81 qdev->rom->client_monitors_config_crc);
82 return MONITORS_CONFIG_BAD_CRC; 82 return MONITORS_CONFIG_BAD_CRC;
83 } 83 }
84 if (!num_monitors) {
85 DRM_DEBUG_KMS("no client monitors configured\n");
86 return status;
87 }
84 if (num_monitors > qdev->monitors_config->max_allowed) { 88 if (num_monitors > qdev->monitors_config->max_allowed) {
85 DRM_DEBUG_KMS("client monitors list will be truncated: %d < %d\n", 89 DRM_DEBUG_KMS("client monitors list will be truncated: %d < %d\n",
86 qdev->monitors_config->max_allowed, num_monitors); 90 qdev->monitors_config->max_allowed, num_monitors);
@@ -1192,6 +1196,7 @@ int qxl_modeset_init(struct qxl_device *qdev)
1192 qdev_output_init(&qdev->ddev, i); 1196 qdev_output_init(&qdev->ddev, i);
1193 } 1197 }
1194 1198
1199 qxl_display_read_client_monitors_config(qdev);
1195 qdev->mode_info.mode_config_initialized = true; 1200 qdev->mode_info.mode_config_initialized = true;
1196 1201
1197 drm_mode_config_reset(&qdev->ddev); 1202 drm_mode_config_reset(&qdev->ddev);