Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

staging/vboxvideo: Drop initial_mode_queried workaround

Drop the initial_mode_queried workaround for kms clients which do not
support hotplug, all kms clients should be able to deal with hotplug.

Suggested-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Acked-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190304164724.10210-2-hdegoede@redhat.com

+5 -56
-3
drivers/staging/vboxvideo/TODO
··· 1 1 TODO: 2 2 -Get a full review from the drm-maintainers on dri-devel done on this driver 3 - -Drop all the logic around initial_mode_queried, the master_set and 4 - master_drop callbacks and everything related to this. kms clients can handle 5 - hotplugs. 6 3 -Extend this TODO with the results of that review 7 4 8 5 Please send any patches to Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
-25
drivers/staging/vboxvideo/vbox_drv.c
··· 200 200 .read = drm_read, 201 201 }; 202 202 203 - static int vbox_master_set(struct drm_device *dev, 204 - struct drm_file *file_priv, bool from_open) 205 - { 206 - struct vbox_private *vbox = dev->dev_private; 207 - 208 - /* 209 - * We do not yet know whether the new owner can handle hotplug, so we 210 - * do not advertise dynamic modes on the first query and send a 211 - * tentative hotplug notification after that to see if they query again. 212 - */ 213 - vbox->initial_mode_queried = false; 214 - 215 - return 0; 216 - } 217 - 218 - static void vbox_master_drop(struct drm_device *dev, struct drm_file *file_priv) 219 - { 220 - struct vbox_private *vbox = dev->dev_private; 221 - 222 - /* See vbox_master_set() */ 223 - vbox->initial_mode_queried = false; 224 - } 225 - 226 203 static struct drm_driver driver = { 227 204 .driver_features = 228 205 DRIVER_MODESET | DRIVER_GEM | DRIVER_PRIME | DRIVER_ATOMIC, 229 206 230 207 .lastclose = drm_fb_helper_lastclose, 231 - .master_set = vbox_master_set, 232 - .master_drop = vbox_master_drop, 233 208 234 209 .fops = &vbox_fops, 235 210 .irq_handler = vbox_irq_handler,
-6
drivers/staging/vboxvideo/vbox_drv.h
··· 83 83 } ttm; 84 84 85 85 struct mutex hw_mutex; /* protects modeset and accel/vbva accesses */ 86 - /* 87 - * We decide whether or not user-space supports display hot-plug 88 - * depending on whether they react to a hot-plug event after the initial 89 - * mode query. 90 - */ 91 - bool initial_mode_queried; 92 86 struct work_struct hotplug_work; 93 87 u32 input_mapping_width; 94 88 u32 input_mapping_height;
+3 -3
drivers/staging/vboxvideo/vbox_main.c
··· 32 32 u32 caps = VBVACAPS_DISABLE_CURSOR_INTEGRATION | 33 33 VBVACAPS_IRQ | VBVACAPS_USE_VBVA_ONLY; 34 34 35 - if (vbox->initial_mode_queried) 36 - caps |= VBVACAPS_VIDEO_MODE_HINTS; 37 - 35 + /* The host only accepts VIDEO_MODE_HINTS if it is send separately. */ 36 + hgsmi_send_caps_info(vbox->guest_pool, caps); 37 + caps |= VBVACAPS_VIDEO_MODE_HINTS; 38 38 hgsmi_send_caps_info(vbox->guest_pool, caps); 39 39 } 40 40
+2 -19
drivers/staging/vboxvideo/vbox_mode.c
··· 736 736 737 737 vbox_connector = to_vbox_connector(connector); 738 738 vbox = connector->dev->dev_private; 739 - /* 740 - * Heuristic: we do not want to tell the host that we support dynamic 741 - * resizing unless we feel confident that the user space client using 742 - * the video driver can handle hot-plug events. So the first time modes 743 - * are queried after a "master" switch we tell the host that we do not, 744 - * and immediately after we send the client a hot-plug notification as 745 - * a test to see if they will respond and query again. 746 - * That is also the reason why capabilities are reported to the host at 747 - * this place in the code rather than elsewhere. 748 - * We need to report the flags location before reporting the IRQ 749 - * capability. 750 - */ 739 + 751 740 hgsmi_report_flags_location(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) + 752 741 HOST_FLAGS_OFFSET); 753 742 if (vbox_connector->vbox_crtc->crtc_id == 0) 754 743 vbox_report_caps(vbox); 755 - if (!vbox->initial_mode_queried) { 756 - if (vbox_connector->vbox_crtc->crtc_id == 0) { 757 - vbox->initial_mode_queried = true; 758 - vbox_report_hotplug(vbox); 759 - } 760 - return drm_add_modes_noedid(connector, 800, 600); 761 - } 744 + 762 745 num_modes = drm_add_modes_noedid(connector, 2560, 1600); 763 746 preferred_width = vbox_connector->mode_hint.width ? 764 747 vbox_connector->mode_hint.width : 1024;