Changeset 62557 in vbox for trunk/src/VBox/Additions/linux/drm
- Timestamp:
- Jul 26, 2016 10:23:12 AM (8 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r62527 r62557 217 217 { 218 218 struct vbox_private *vbox = dev->dev_private; 219 /* We do not yet know whether the new owner can handle hotplug, so we 220 * do not advertise dynamic modes on the first query and send a 221 * tentative hotplug notification after that to see if they query again. */ 219 222 vbox->initial_mode_queried = false; 220 vbox_disable_accel(vbox);221 223 return 0; 222 224 } … … 228 230 struct vbox_private *vbox = dev->dev_private; 229 231 vbox->initial_mode_queried = false; 232 mutex_lock(&vbox->hw_mutex); 233 /* Disable VBVA when someone releases master in case the next person tries 234 * to do VESA. */ 235 /** @todo work out if anyone is likely to and whether it will even work. */ 230 236 vbox_disable_accel(vbox); 237 mutex_unlock(&vbox->hw_mutex); 231 238 } 232 239 -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r62550 r62557 111 111 { 112 112 struct vbox_private *vbox = fb->dev->dev_private; 113 struct drm_crtc *crtc; 113 114 unsigned i; 114 115 115 116 LogFunc(("vboxvideo: %d: fb=%p, num_rects=%u, vbox=%p\n", __LINE__, fb, 116 117 num_rects, vbox)); 117 vbox_enable_accel(vbox);118 118 mutex_lock(&vbox->hw_mutex); 119 for (i = 0; i < num_rects; ++i) 120 { 121 struct drm_crtc *crtc; 122 list_for_each_entry(crtc, &fb->dev->mode_config.crtc_list, head) 123 { 124 unsigned crtc_id = to_vbox_crtc(crtc)->crtc_id; 125 VBVACMDHDR cmd_hdr; 126 127 if ( CRTC_FB(crtc) != fb 128 || rects[i].x1 > crtc->x 129 + crtc->hwmode.hdisplay 130 || rects[i].y1 > crtc->y 131 + crtc->hwmode.vdisplay 132 || rects[i].x2 < crtc->x 133 || rects[i].y2 < crtc->y) 134 continue; 135 cmd_hdr.x = (int16_t)rects[i].x1; 136 cmd_hdr.y = (int16_t)rects[i].y1; 137 cmd_hdr.w = (uint16_t)rects[i].x2 - rects[i].x1; 138 cmd_hdr.h = (uint16_t)rects[i].y2 - rects[i].y1; 139 if (VBoxVBVABufferBeginUpdate(&vbox->vbva_info[crtc_id], 140 &vbox->submit_info)) 119 list_for_each_entry(crtc, &fb->dev->mode_config.crtc_list, head) { 120 if (CRTC_FB(crtc) == fb) { 121 vbox_enable_accel(vbox); 122 for (i = 0; i < num_rects; ++i) 141 123 { 142 VBoxVBVAWrite(&vbox->vbva_info[crtc_id], &vbox->submit_info, &cmd_hdr, 143 sizeof(cmd_hdr)); 144 VBoxVBVABufferEndUpdate(&vbox->vbva_info[crtc_id]); 124 unsigned crtc_id = to_vbox_crtc(crtc)->crtc_id; 125 VBVACMDHDR cmd_hdr; 126 127 if ( rects[i].x1 > crtc->x 128 + crtc->hwmode.hdisplay 129 || rects[i].y1 > crtc->y 130 + crtc->hwmode.vdisplay 131 || rects[i].x2 < crtc->x 132 || rects[i].y2 < crtc->y) 133 continue; 134 cmd_hdr.x = (int16_t)rects[i].x1; 135 cmd_hdr.y = (int16_t)rects[i].y1; 136 cmd_hdr.w = (uint16_t)rects[i].x2 - rects[i].x1; 137 cmd_hdr.h = (uint16_t)rects[i].y2 - rects[i].y1; 138 if (VBoxVBVABufferBeginUpdate(&vbox->vbva_info[crtc_id], 139 &vbox->submit_info)) 140 { 141 VBoxVBVAWrite(&vbox->vbva_info[crtc_id], &vbox->submit_info, &cmd_hdr, 142 sizeof(cmd_hdr)); 143 VBoxVBVABufferEndUpdate(&vbox->vbva_info[crtc_id]); 144 } 145 145 } 146 146 } -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r62550 r62557 260 260 vbox_crtc_mode_set_base(crtc, x, y, old_fb); 261 261 mutex_lock(&vbox->hw_mutex); 262 /* Disable VBVA when someone sets a new mode until they send us dirty 263 * rectangles, which proves that they can. A single screen can work 264 * without VBVA. */ 265 vbox_disable_accel(vbox); 262 266 rc = vbox_set_view(crtc); 263 267 if (!rc)
Note:
See TracChangeset
for help on using the changeset viewer.