Changeset 59597 in vbox for trunk/src/VBox/Additions/linux/drm
- Timestamp:
- Feb 5, 2016 2:36:27 PM (9 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 7 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/Makefile.kmk
r59552 r59597 78 78 vbox_drv.c \ 79 79 vbox_fb.c \ 80 vbox_irq.c \ 80 81 vbox_main.c \ 81 82 vbox_mode.c \ -
trunk/src/VBox/Additions/linux/drm/Makefile.module.kms
r59558 r59597 25 25 26 26 MOD_OBJS = HGSMIBase.o HGSMICommon.o HGSMIMemAlloc.o heapoffset.o \ 27 Modesetting.o vbox_drv.o vbox_fb.o vbox_ main.o vbox_mode.o \28 vbox_ ttm.o VBVABase.o27 Modesetting.o vbox_drv.o vbox_fb.o vbox_irq.o vbox_main.o \ 28 vbox_mode.o vbox_ttm.o VBVABase.o 29 29 30 30 ifneq ($(wildcard $(KBUILD_EXTMOD)/vboxvideo),) -
trunk/src/VBox/Additions/linux/drm/files_vboxvideo_drv
r57943 r59597 61 61 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_drv.h=>vbox_drv.h \ 62 62 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_fb.c=>vbox_fb.c \ 63 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_irq.c=>vbox_irq.c \ 63 64 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_main.c=>vbox_main.c \ 64 65 ${PATH_ROOT}/src/VBox/Additions/linux/drm/vbox_mode.c=>vbox_mode.c \ -
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r59568 r59597 212 212 static struct drm_driver driver = 213 213 { 214 .driver_features = DRIVER_MODESET | DRIVER_GEM ,214 .driver_features = DRIVER_MODESET | DRIVER_GEM | DRIVER_HAVE_IRQ, 215 215 .dev_priv_size = 0, 216 216 … … 222 222 223 223 .fops = &vbox_fops, 224 .irq_handler = vbox_irq_handler, 224 225 .name = DRIVER_NAME, 225 226 .desc = DRIVER_DESC, -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r59568 r59597 91 91 struct drm_device *dev; 92 92 93 void__iomem *vram;93 uint8_t __iomem *vram; 94 94 HGSMIGUESTCOMMANDCONTEXT submit_info; 95 95 struct VBVABUFFERCONTEXT *vbva_info; … … 117 117 118 118 spinlock_t dev_lock; 119 bool isr_installed; 120 struct work_struct hotplug_work; 119 121 }; 120 122 … … 123 125 124 126 struct vbox_gem_object; 127 128 #ifndef VGA_PORT_HGSMI_HOST 129 # define VGA_PORT_HGSMI_HOST 0x3b0 130 # define VGA_PORT_HGSMI_GUEST 0x3d0 131 #endif 125 132 126 133 struct vbox_connector { … … 188 195 #endif 189 196 197 void vbox_enable_vbva(struct vbox_private *vbox, unsigned crtc_id); 198 void vbox_enable_caps(struct vbox_private *vbox); 199 190 200 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb, 191 201 struct drm_clip_rect *rects, … … 276 286 int vbox_bo_push_sysram(struct vbox_bo *bo); 277 287 int vbox_mmap(struct file *filp, struct vm_area_struct *vma); 278 #endif 288 289 /* vbox_irq.c */ 290 int vbox_irq_init(struct vbox_private *vbox); 291 void vbox_irq_fini(struct vbox_private *vbox); 292 irqreturn_t vbox_irq_handler(int irq, void *arg); 293 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r59573 r59597 66 66 } 67 67 68 void vbox_enable_vbva(struct vbox_private *vbox, unsigned crtc_id) 69 { 70 struct VBVABUFFER *pVBVA = vbox->vbva_info[crtc_id].pVBVA; 71 72 if (pVBVA == NULL) { 73 LogFunc(("vboxvideo: enabling VBVA.\n")); 74 pVBVA = (struct VBVABUFFER *) ( ((uint8_t *)vbox->vram) 75 + vbox->vram_size 76 + crtc_id * VBVA_MIN_BUFFER_SIZE); 77 if (!VBoxVBVAEnable(&vbox->vbva_info[crtc_id], &vbox->submit_info, pVBVA, crtc_id)) 78 AssertReleaseMsgFailed(("VBoxVBVAEnable failed - heap allocation error, very old host or driver error.\n")); 79 } 80 } 81 82 void vbox_enable_caps(struct vbox_private *vbox) 83 { 84 VBoxHGSMISendCapsInfo(&vbox->submit_info, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION | VBVACAPS_IRQ); 85 } 86 68 87 /** Send information about dirty rectangles to VBVA. If necessary we enable 69 88 * VBVA first, as this is normally disabled after a mode set in case a user 70 * takes over the console that is not aware of VBVA (i.e. the VESA BIOS). */ 89 * takes over the console that is not aware of VBVA (i.e. the VESA BIOS, and 90 * particularly the old X.Org VESA driver). */ 71 91 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb, 72 92 struct drm_clip_rect *rects, … … 79 99 LogFunc(("vboxvideo: %d: fb=%p, num_rects=%u, vbox=%p\n", __LINE__, fb, 80 100 num_rects, vbox)); 101 if (vbox->vbva_info[0].pVBVA == NULL) { 102 for (i = 0; i < vbox->num_crtcs; ++i) 103 vbox_enable_vbva(vbox, i); 104 /* Assume that if the user knows to send dirty rectangle information 105 * they can also handle hot-plug events. */ 106 vbox_enable_caps(vbox); 107 } 81 108 spin_lock_irqsave(&vbox->dev_lock, flags); 82 109 for (i = 0; i < num_rects; ++i) … … 86 113 { 87 114 unsigned crtc_id = to_vbox_crtc(crtc)->crtc_id; 88 struct VBVABUFFER *pVBVA = vbox->vbva_info[crtc_id].pVBVA;89 115 VBVACMDHDR cmdHdr; 90 116 91 if (!pVBVA)92 {93 LogFunc(("vboxvideo: enabling VBVA.\n"));94 pVBVA = (struct VBVABUFFER *) ( ((uint8_t *)vbox->vram)95 + vbox->vram_size96 + crtc_id * VBVA_MIN_BUFFER_SIZE);97 if (!VBoxVBVAEnable(&vbox->vbva_info[crtc_id], &vbox->submit_info, pVBVA, crtc_id))98 AssertReleaseMsgFailed(("VBoxVBVAEnable failed - heap allocation error, very old host or driver error.\n"));99 /* Assume that if the user knows to send dirty rectangle information100 * they can also handle hot-plug events. */101 VBoxHGSMISendCapsInfo(&vbox->submit_info, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION);102 }103 117 if ( CRTC_FB(crtc) != fb 104 118 || rects[i].x1 > crtc->x … … 346 360 dev->mode_config.max_height = VBE_DISPI_MAX_YRES; 347 361 362 ret = vbox_irq_init(vbox); 363 if (ret) 364 goto out_free; 365 348 366 ret = vbox_mode_init(dev); 349 367 if (ret) … … 370 388 371 389 LogFunc(("vboxvideo: %d\n", __LINE__)); 390 vbox_fbdev_fini(dev); 372 391 vbox_mode_fini(dev); 373 vbox_ fbdev_fini(dev);392 vbox_irq_fini(vbox); 374 393 drm_mode_config_cleanup(dev); 375 394 -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r59568 r59597 99 99 vbox_crtc->blanked ? 0 : cBPP, fFlags); 100 100 VBoxHGSMIReportFlagsLocation(&vbox->submit_info, vbox->host_flags_offset); 101 VBoxHGSMISendCapsInfo(&vbox->submit_info, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION);101 vbox_enable_caps(vbox); 102 102 LogFunc(("vboxvideo: %d\n", __LINE__)); 103 103 } … … 218 218 if (ret) 219 219 DRM_ERROR("failed to kmap fbcon\n"); 220 } 221 else { 222 unsigned i; 223 224 for (i = 0; i < vbox->num_crtcs; ++i) 225 vbox_enable_vbva(vbox, i); 220 226 } 221 227 vbox_bo_unreserve(bo);
Note:
See TracChangeset
for help on using the changeset viewer.