aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/qxl/qxl_display.c
diff options
context:
space:
mode:
authorDave Airlie <airlied@redhat.com>2013-10-10 21:05:00 -0400
committerDave Airlie <airlied@redhat.com>2013-11-06 00:23:26 -0500
commit4695b03970df378dcb93fe3e7158381f1e980fa2 (patch)
tree90b10c6f4aeced65452b3a54867e5b8b328ad436 /drivers/gpu/drm/qxl/qxl_display.c
parent8f6599da8e772fa8de54cdf98e9e03cbaf3946da (diff)
qxl: add a connector property to denote hotplug should rescan modes.
So GNOME userspace has an issue with when it rescans for modes on hotplug events, if the monitor has no EDID it assumes that nothing has changed on EDID as with real hw we'd never have new modes without a new EDID, and they kind off rely on the behaviour now, however with virtual GPUs we would like to rescan the modes and get a new preferred mode on hotplug events to handle dynamic guest resizing (where you resize the host window and the guest resizes with it). This is a simple property we can make userspace watch for to trigger new behaviour based on it, and can be used to replaced EDID hacks in virtual drivers. Acked-by: Marc-André Lureau <marcandre.lureau@gmail.com> (on irc) Signed-off-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/qxl/qxl_display.c')
-rw-r--r--drivers/gpu/drm/qxl/qxl_display.c18
1 files changed, 18 insertions, 0 deletions
diff --git a/drivers/gpu/drm/qxl/qxl_display.c b/drivers/gpu/drm/qxl/qxl_display.c
index 61974cb9d205..5e827c29d194 100644
--- a/drivers/gpu/drm/qxl/qxl_display.c
+++ b/drivers/gpu/drm/qxl/qxl_display.c
@@ -848,8 +848,21 @@ static const struct drm_encoder_funcs qxl_enc_funcs = {
848 .destroy = qxl_enc_destroy, 848 .destroy = qxl_enc_destroy,
849}; 849};
850 850
851static int qxl_mode_create_hotplug_mode_update_property(struct qxl_device *qdev)
852{
853 if (qdev->hotplug_mode_update_property)
854 return 0;
855
856 qdev->hotplug_mode_update_property =
857 drm_property_create_range(qdev->ddev, DRM_MODE_PROP_IMMUTABLE,
858 "hotplug_mode_update", 0, 1);
859
860 return 0;
861}
862
851static int qdev_output_init(struct drm_device *dev, int num_output) 863static int qdev_output_init(struct drm_device *dev, int num_output)
852{ 864{
865 struct qxl_device *qdev = dev->dev_private;
853 struct qxl_output *qxl_output; 866 struct qxl_output *qxl_output;
854 struct drm_connector *connector; 867 struct drm_connector *connector;
855 struct drm_encoder *encoder; 868 struct drm_encoder *encoder;
@@ -876,6 +889,8 @@ static int qdev_output_init(struct drm_device *dev, int num_output)
876 drm_encoder_helper_add(encoder, &qxl_enc_helper_funcs); 889 drm_encoder_helper_add(encoder, &qxl_enc_helper_funcs);
877 drm_connector_helper_add(connector, &qxl_connector_helper_funcs); 890 drm_connector_helper_add(connector, &qxl_connector_helper_funcs);
878 891
892 drm_object_attach_property(&connector->base,
893 qdev->hotplug_mode_update_property, 0);
879 drm_sysfs_connector_add(connector); 894 drm_sysfs_connector_add(connector);
880 return 0; 895 return 0;
881} 896}
@@ -988,6 +1003,9 @@ int qxl_modeset_init(struct qxl_device *qdev)
988 qdev->ddev->mode_config.max_height = 8192; 1003 qdev->ddev->mode_config.max_height = 8192;
989 1004
990 qdev->ddev->mode_config.fb_base = qdev->vram_base; 1005 qdev->ddev->mode_config.fb_base = qdev->vram_base;
1006
1007 qxl_mode_create_hotplug_mode_update_property(qdev);
1008
991 for (i = 0 ; i < qxl_num_crtc; ++i) { 1009 for (i = 0 ; i < qxl_num_crtc; ++i) {
992 qdev_crtc_init(qdev->ddev, i); 1010 qdev_crtc_init(qdev->ddev, i);
993 qdev_output_init(qdev->ddev, i); 1011 qdev_output_init(qdev->ddev, i);