- Timestamp:
- Oct 2, 2018 2:01:09 PM (7 years ago)
- svn:sync-xref-src-repo-rev:
- 125454
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r71947 r74581 227 227 228 228 mutex_lock(&vbox->hw_mutex); 229 /* 230 * Disable VBVA when someone releases master in case the next person 231 * tries tries to do VESA. 232 */ 233 /** @todo work out if anyone is likely to and whether it will work. */ 234 /* 235 * Update: we also disable it because if the new master does not do 236 * dirty rectangle reporting (e.g. old versions of Plymouth) then at 237 * least the first screen will still be updated. We enable it as soon 238 * as we receive a dirty rectangle report. 239 */ 240 vbox_disable_accel(vbox); 229 /* Start the refresh timer in case the user does not provide dirty 230 * rectangles. */ 231 vbox->need_refresh_timer = true; 232 schedule_delayed_work(&vbox->refresh_work, VBOX_REFRESH_PERIOD); 241 233 mutex_unlock(&vbox->hw_mutex); 242 234 … … 257 249 258 250 mutex_lock(&vbox->hw_mutex); 259 vbox _disable_accel(vbox);251 vbox->need_refresh_timer = false; 260 252 mutex_unlock(&vbox->hw_mutex); 261 253 } -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r72638 r74581 124 124 #define HOST_FLAGS_OFFSET GUEST_HEAP_USABLE_SIZE 125 125 126 /** How frequently we refresh if the guest is not providing dirty rectangles. */ 127 #define VBOX_REFRESH_PERIOD (HZ / 2) 128 126 129 struct vbox_fbdev; 127 130 … … 161 164 */ 162 165 bool initial_mode_queried; 166 /** 167 * Do we know that the current user can send us dirty rectangle information? 168 * If not, do periodic refreshes until we do know. 169 */ 170 bool need_refresh_timer; 171 /** 172 * As long as the user is not sending us dirty rectangle information, 173 * refresh the whole screen at regular intervals. 174 */ 175 struct delayed_work refresh_work; 163 176 struct work_struct hotplug_work; 164 177 u32 input_mapping_width; -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r71947 r74581 109 109 unsigned int i; 110 110 111 /* The user can send rectangles, we do not need the timer. */ 112 vbox->need_refresh_timer = false; 111 113 mutex_lock(&vbox->hw_mutex); 112 114 list_for_each_entry(crtc, &fb->dev->mode_config.crtc_list, head) { 113 115 if (CRTC_FB(crtc) == fb) { 114 vbox_enable_accel(vbox);115 116 for (i = 0; i < num_rects; ++i) { 116 117 VBVACMDHDR cmd_hdr; … … 297 298 298 299 /** 300 * Our refresh timer call-back. Only used for guests without dirty rectangle 301 * support. 302 */ 303 static void vbox_refresh_timer(struct work_struct *work) 304 { 305 struct vbox_private *vbox = container_of(work, struct vbox_private, 306 refresh_work.work); 307 bool have_unblanked = false; 308 struct drm_crtc *crtci; 309 310 if (!vbox->need_refresh_timer) 311 return; 312 list_for_each_entry(crtci, &vbox->dev->mode_config.crtc_list, head) { 313 struct vbox_crtc *vbox_crtc = to_vbox_crtc(crtci); 314 if (crtci->enabled && !vbox_crtc->blanked) 315 have_unblanked = true; 316 } 317 if (!have_unblanked) 318 return; 319 /* This forces a full refresh. */ 320 vbox_enable_accel(vbox); 321 /* Schedule the next timer iteration. */ 322 schedule_delayed_work(&vbox->refresh_work, VBOX_REFRESH_PERIOD); 323 } 324 325 /** 299 326 * Set up our heaps and data exchange buffers in VRAM before handing the rest 300 327 * to the memory manager. … … 342 369 return -ENOMEM; 343 370 344 return vbox_accel_init(vbox); 371 ret = vbox_accel_init(vbox); 372 if (ret) 373 return ret; 374 /* Set up the refresh timer for users which do not send dirty rectangles. */ 375 INIT_DELAYED_WORK(&vbox->refresh_work, vbox_refresh_timer); 376 return 0; 345 377 } 346 378 347 379 static void vbox_hw_fini(struct vbox_private *vbox) 348 380 { 381 vbox->need_refresh_timer = false; 382 cancel_delayed_work(&vbox->refresh_work); 349 383 vbox_accel_fini(vbox); 350 384 kfree(vbox->last_mode_hints); -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r74401 r74581 160 160 case DRM_MODE_DPMS_ON: 161 161 vbox_crtc->blanked = false; 162 /* Restart the refresh timer if necessary. */ 163 schedule_delayed_work(&vbox->refresh_work, VBOX_REFRESH_PERIOD); 162 164 break; 163 165 case DRM_MODE_DPMS_STANDBY: … … 568 570 return drm_add_modes_noedid(connector, 800, 600); 569 571 } 572 /* Also assume that a client which supports hot-plugging also knows 573 * how to update the screen in a way we can use, the only known 574 * relevent client which cannot is Plymouth in Ubuntu 14.04. */ 575 vbox->need_refresh_timer = false; 570 576 num_modes = drm_add_modes_noedid(connector, 2560, 1600); 571 577 preferred_width = vbox_connector->mode_hint.width ?
Note:
See TracChangeset
for help on using the changeset viewer.