Changeset 67175 in vbox for trunk/src/VBox/Additions
- Timestamp:
- May 31, 2017 2:38:02 PM (8 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/HGSMIBase.h
r67169 r67175 34 34 #include <linux/genalloc.h> 35 35 36 typedef struct HGSMIGUESTCOMMANDCONTEXT { 37 struct gen_pool *guest_pool; 38 } HGSMIGUESTCOMMANDCONTEXT, *PHGSMIGUESTCOMMANDCONTEXT; 36 typedef struct gen_pool *PHGSMIGUESTCOMMANDCONTEXT; 39 37 40 38 void *hgsmi_buffer_alloc(struct gen_pool *guest_pool, size_t size, … … 48 46 */ 49 47 #define VBoxHGSMIBufferAlloc(ctx, size, ch, ch_info) \ 50 hgsmi_buffer_alloc( (ctx)->guest_pool, size, ch, ch_info)51 #define VBoxHGSMIBufferFree(ctx, buf) hgsmi_buffer_free( (ctx)->guest_pool, buf)52 #define VBoxHGSMIBufferSubmit(ctx, buf) hgsmi_buffer_submit( (ctx)->guest_pool, buf)48 hgsmi_buffer_alloc(ctx, size, ch, ch_info) 49 #define VBoxHGSMIBufferFree(ctx, buf) hgsmi_buffer_free(ctx, buf) 50 #define VBoxHGSMIBufferSubmit(ctx, buf) hgsmi_buffer_submit(ctx, buf) 53 51 54 52 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r66544 r67175 90 90 u8 __iomem *guest_heap; 91 91 u8 __iomem *vbva_buffers; 92 HGSMIGUESTCOMMANDCONTEXT submit_info;92 struct gen_pool *guest_pool; 93 93 struct VBVABUFFERCONTEXT *vbva_info; 94 94 bool any_pitch; -
trunk/src/VBox/Additions/linux/drm/vbox_irq.c
r66544 r67175 124 124 int rc; 125 125 126 rc = VBoxHGSMIGetModeHints( &vbox->submit_info, vbox->num_crtcs,126 rc = VBoxHGSMIGetModeHints(vbox->guest_pool, vbox->num_crtcs, 127 127 vbox->last_mode_hints); 128 128 if (RT_FAILURE(rc)) { … … 150 150 vbox_connector->mode_hint.disconnected = disconnected; 151 151 if (vbox_connector->vbox_crtc->disconnected != disconnected) { 152 VBoxHGSMIProcessDisplayInfo( &vbox->submit_info, crtc_id,152 VBoxHGSMIProcessDisplayInfo(vbox->guest_pool, crtc_id, 153 153 0, 0, 0, hints->cx * 4, hints->cx, 154 154 hints->cy, 0, flags); -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r67169 r67175 64 64 vbva = (struct VBVABUFFER *) ((u8 *)vbox->vbva_buffers 65 65 + i * VBVA_MIN_BUFFER_SIZE); 66 if (!VBoxVBVAEnable(&vbox->vbva_info[i], &vbox->submit_info, vbva, i)) {66 if (!VBoxVBVAEnable(&vbox->vbva_info[i], vbox->guest_pool, vbva, i)) { 67 67 /* very old host or driver error. */ 68 68 printk(KERN_ERR "vboxvideo: VBoxVBVAEnable failed - heap allocation error.\n"); … … 78 78 79 79 for (i = 0; i < vbox->num_crtcs; ++i) 80 VBoxVBVADisable(&vbox->vbva_info[i], &vbox->submit_info, i);80 VBoxVBVADisable(&vbox->vbva_info[i], vbox->guest_pool, i); 81 81 } 82 82 … … 88 88 if (vbox->initial_mode_queried) 89 89 caps |= VBVACAPS_VIDEO_MODE_HINTS; 90 VBoxHGSMISendCapsInfo( &vbox->submit_info, caps);90 VBoxHGSMISendCapsInfo(vbox->guest_pool, caps); 91 91 } 92 92 … … 124 124 cmd_hdr.h = (uint16_t)rects[i].y2 - rects[i].y1; 125 125 if (VBoxVBVABufferBeginUpdate(&vbox->vbva_info[crtc_id], 126 &vbox->submit_info))126 vbox->guest_pool)) 127 127 { 128 VBoxVBVAWrite(&vbox->vbva_info[crtc_id], &vbox->submit_info, &cmd_hdr,128 VBoxVBVAWrite(&vbox->vbva_info[crtc_id], vbox->guest_pool, &cmd_hdr, 129 129 sizeof(cmd_hdr)); 130 130 VBoxVBVABufferEndUpdate(&vbox->vbva_info[crtc_id]); … … 264 264 uint32_t have_hints, have_cursor; 265 265 266 return RT_SUCCESS(VBoxQueryConfHGSMI( &vbox->submit_info, VBOX_VBVA_CONF32_MODE_HINT_REPORTING, &have_hints))267 && RT_SUCCESS(VBoxQueryConfHGSMI( &vbox->submit_info, VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING, &have_cursor))266 return RT_SUCCESS(VBoxQueryConfHGSMI(vbox->guest_pool, VBOX_VBVA_CONF32_MODE_HINT_REPORTING, &have_hints)) 267 && RT_SUCCESS(VBoxQueryConfHGSMI(vbox->guest_pool, VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING, &have_cursor)) 268 268 && have_hints == VINF_SUCCESS 269 269 && have_cursor == VINF_SUCCESS; … … 287 287 288 288 /* Create guest-heap mem-pool use 2^4 = 16 byte chunks */ 289 vbox-> submit_info.guest_pool = gen_pool_create(4, -1);290 if (!vbox-> submit_info.guest_pool)289 vbox->guest_pool = gen_pool_create(4, -1); 290 if (!vbox->guest_pool) 291 291 return -ENOMEM; 292 292 293 ret = gen_pool_add_virt(vbox-> submit_info.guest_pool,293 ret = gen_pool_add_virt(vbox->guest_pool, 294 294 (unsigned long)vbox->guest_heap, 295 295 GUEST_HEAP_OFFSET(vbox), … … 301 301 vbox->available_vram_size = GUEST_HEAP_OFFSET(vbox); 302 302 /* Linux drm represents monitors as a 32-bit array. */ 303 vbox->num_crtcs = min(VBoxHGSMIGetMonitorCount( &vbox->submit_info),303 vbox->num_crtcs = min(VBoxHGSMIGetMonitorCount(vbox->guest_pool), 304 304 (uint32_t)VBOX_MAX_SCREENS); 305 305 if (!have_hgsmi_mode_hints(vbox)) … … 385 385 vbox_hw_fini(vbox); 386 386 vbox_mm_fini(vbox); 387 if (vbox-> submit_info.guest_pool)388 gen_pool_destroy(vbox-> submit_info.guest_pool);387 if (vbox->guest_pool) 388 gen_pool_destroy(vbox->guest_pool); 389 389 if (vbox->guest_heap) 390 390 pci_iounmap(dev->pdev, vbox->guest_heap); -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r66544 r67175 101 101 flags |= (crtc->enabled && !vbox_crtc->blanked ? 0 : VBVA_SCREEN_F_BLANK); 102 102 flags |= (vbox_crtc->disconnected ? VBVA_SCREEN_F_DISABLED : 0); 103 VBoxHGSMIProcessDisplayInfo( &vbox->submit_info, vbox_crtc->crtc_id,103 VBoxHGSMIProcessDisplayInfo(vbox->guest_pool, vbox_crtc->crtc_id, 104 104 x_offset, y_offset, 105 105 crtc->x * bpp / 8 + crtc->y * pitch, … … 122 122 * the first view be the managed memory plus the first command buffer, the 123 123 * second the same plus the second buffer and so on. */ 124 p = VBoxHGSMIBufferAlloc( &vbox->submit_info, sizeof(VBVAINFOVIEW), HGSMI_CH_VBVA,124 p = VBoxHGSMIBufferAlloc(vbox->guest_pool, sizeof(VBVAINFOVIEW), HGSMI_CH_VBVA, 125 125 VBVA_INFO_VIEW); 126 126 if (p) … … 132 132 + vbox_crtc->crtc_id * VBVA_MIN_BUFFER_SIZE; 133 133 pInfo->u32MaxScreenSize = vbox->available_vram_size - vbox_crtc->fb_offset; 134 VBoxHGSMIBufferSubmit( &vbox->submit_info, p);135 VBoxHGSMIBufferFree( &vbox->submit_info, p);134 VBoxHGSMIBufferSubmit(vbox->guest_pool, p); 135 VBoxHGSMIBufferFree(vbox->guest_pool, p); 136 136 } 137 137 else … … 297 297 if (!rc) 298 298 vbox_do_modeset(crtc, mode); 299 VBoxHGSMIUpdateInputMapping( &vbox->submit_info, 0, 0,299 VBoxHGSMIUpdateInputMapping(vbox->guest_pool, 0, 0, 300 300 vbox->input_mapping_width, 301 301 vbox->input_mapping_height); … … 536 536 * We need to report the flags location before reporting the IRQ 537 537 * capability. */ 538 VBoxHGSMIReportFlagsLocation( &vbox->submit_info, GUEST_HEAP_OFFSET(vbox) +538 VBoxHGSMIReportFlagsLocation(vbox->guest_pool, GUEST_HEAP_OFFSET(vbox) + 539 539 HOST_FLAGS_OFFSET); 540 540 if (vbox_connector->vbox_crtc->crtc_id == 0) … … 729 729 /* Re-set this regularly as in 5.0.20 and earlier the information was lost 730 730 * on save and restore. */ 731 VBoxHGSMIUpdateInputMapping( &vbox->submit_info, 0, 0,731 VBoxHGSMIUpdateInputMapping(vbox->guest_pool, 0, 0, 732 732 vbox->input_mapping_width, 733 733 vbox->input_mapping_height); … … 742 742 cursor_enabled = true; 743 743 if (!cursor_enabled) 744 VBoxHGSMIUpdatePointerShape( &vbox->submit_info, 0, 0, 0, 0, 0, NULL, 0);744 VBoxHGSMIUpdatePointerShape(vbox->guest_pool, 0, 0, 0, 0, 0, NULL, 0); 745 745 return 0; 746 746 } … … 749 749 || width == 0 || height == 0) 750 750 return -EINVAL; 751 rc = VBoxQueryConfHGSMI( &vbox->submit_info,751 rc = VBoxQueryConfHGSMI(vbox->guest_pool, 752 752 VBOX_VBVA_CONF32_CURSOR_CAPABILITIES, &caps); 753 753 ret = rc == VINF_SUCCESS ? 0 : rc == VERR_NO_MEMORY ? -ENOMEM : -EINVAL; … … 790 790 | VBOX_MOUSE_POINTER_ALPHA; 791 791 copy_cursor_image(src, dst, width, height, mask_size); 792 rc = VBoxHGSMIUpdatePointerShape( &vbox->submit_info, flags,792 rc = VBoxHGSMIUpdatePointerShape(vbox->guest_pool, flags, 793 793 vbox->cursor_hot_x, 794 794 vbox->cursor_hot_y, … … 835 835 if (x + crtc_x < 0 || y + crtc_y < 0 || vbox->cursor_data_size == 0) 836 836 return 0; 837 rc = VBoxHGSMICursorPosition( &vbox->submit_info, true, x + crtc_x,837 rc = VBoxHGSMICursorPosition(vbox->guest_pool, true, x + crtc_x, 838 838 y + crtc_y, &host_x, &host_y); 839 839 /* Work around a bug after save and restore in 5.0.20 and earlier. */ … … 850 850 vbox->cursor_hot_x = hot_x; 851 851 vbox->cursor_hot_y = hot_y; 852 rc = VBoxHGSMIUpdatePointerShape( &vbox->submit_info, flags, hot_x, hot_y,852 rc = VBoxHGSMIUpdatePointerShape(vbox->guest_pool, flags, hot_x, hot_y, 853 853 vbox->cursor_width, vbox->cursor_height, 854 854 vbox->cursor_data,
Note:
See TracChangeset
for help on using the changeset viewer.