Changeset 59568 in vbox for trunk/src/VBox/Additions/linux/drm
- Timestamp:
- Feb 3, 2016 9:33:34 AM (9 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.c
r59526 r59568 232 232 .dumb_create = vbox_dumb_create, 233 233 .dumb_map_offset = vbox_dumb_mmap_offset, 234 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 234 235 .dumb_destroy = vbox_dumb_destroy, 236 #else 237 .dumb_destroy = drm_gem_dumb_destroy, 238 #endif 235 239 236 240 }; -
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r59526 r59568 88 88 struct vbox_fbdev; 89 89 90 struct vbox_private 91 { 90 struct vbox_private { 92 91 struct drm_device *dev; 93 92 94 93 void __iomem *vram; 95 HGSMIGUESTCOMMANDCONTEXT Ctx;96 struct VBVABUFFERCONTEXT * paVBVACtx;97 bool fAnyX;98 unsigned cCrtcs;94 HGSMIGUESTCOMMANDCONTEXT submit_info; 95 struct VBVABUFFERCONTEXT *vbva_info; 96 bool any_pitch; 97 unsigned num_crtcs; 99 98 bool vga2_clone; 100 99 /** Amount of available VRAM, including space used for buffers. */ … … 103 102 uint32_t vram_size; 104 103 /** Offset to the host flags in the VRAM. */ 105 uint32_t offHostFlags;104 uint32_t host_flags_offset; 106 105 /** Array of structures for receiving mode hints. */ 107 VBVAMODEHINT * paVBVAModeHints;106 VBVAMODEHINT *last_mode_hints; 108 107 109 108 struct vbox_fbdev *fbdev; … … 111 110 int fb_mtrr; 112 111 113 struct 114 { 112 struct { 115 113 struct drm_global_reference mem_global_ref; 116 114 struct ttm_bo_global_ref bo_global_ref; … … 126 124 struct vbox_gem_object; 127 125 128 struct vbox_connector 129 { 126 struct vbox_connector { 130 127 struct drm_connector base; 131 char szName[32];132 unsigned iCrtc;128 char name[32]; 129 unsigned crtc_id; 133 130 /** Device attribute for sysfs file used for receiving mode hints from user 134 131 * space. */ 135 struct device_attribute deviceAttribute; 136 struct 137 { 138 uint16_t cX; 139 uint16_t cY; 140 bool fDisconnected; 141 } modeHint; 142 }; 143 144 struct vbox_crtc 145 { 132 struct device_attribute sysfs_node; 133 struct { 134 uint16_t width; 135 uint16_t height; 136 bool disconnected; 137 } mode_hint; 138 }; 139 140 struct vbox_crtc { 146 141 struct drm_crtc base; 147 bool fBlanked;142 bool blanked; 148 143 unsigned crtc_id; 149 uint32_t offFB;144 uint32_t fb_offset; 150 145 struct drm_gem_object *cursor_bo; 151 146 uint64_t cursor_addr; … … 154 149 }; 155 150 156 struct vbox_encoder 157 { 151 struct vbox_encoder { 158 152 struct drm_encoder base; 159 153 }; 160 154 161 struct vbox_framebuffer 162 { 155 struct vbox_framebuffer { 163 156 struct drm_framebuffer base; 164 157 struct drm_gem_object *obj; 165 158 }; 166 159 167 struct vbox_fbdev 168 { 160 struct vbox_fbdev { 169 161 struct drm_fb_helper helper; 170 162 struct vbox_framebuffer afb; 171 struct list_head fbdev_list;172 163 void *sysram; 173 164 int size; … … 183 174 extern int vbox_mode_init(struct drm_device *dev); 184 175 extern void vbox_mode_fini(struct drm_device *dev); 185 extern void VBoxRefreshModes(struct drm_device *pDev);176 extern void vbox_refresh_modes(struct drm_device *dev); 186 177 187 178 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) … … 198 189 199 190 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb, 200 struct drm_clip_rect * pRects,201 unsigned cRects);191 struct drm_clip_rect *rects, 192 unsigned num_rects); 202 193 203 194 int vbox_framebuffer_init(struct drm_device *dev, … … 210 201 void vbox_fbdev_set_suspend(struct drm_device *dev, int state); 211 202 212 struct vbox_bo 213 { 203 struct vbox_bo { 214 204 struct ttm_buffer_object bo; 215 205 struct ttm_placement placement; … … 225 215 #define gem_to_vbox_bo(gobj) container_of((gobj), struct vbox_bo, gem) 226 216 227 static inline struct vbox_bo * vbox_bo(struct ttm_buffer_object *bo) 217 static inline struct vbox_bo * 218 vbox_bo(struct ttm_buffer_object *bo) 228 219 { 229 220 return container_of(bo, struct vbox_bo, bo); … … 236 227 struct drm_device *dev, 237 228 struct drm_mode_create_dumb *args); 229 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 238 230 extern int vbox_dumb_destroy(struct drm_file *file, 239 231 struct drm_device *dev, 240 232 uint32_t handle); 233 #endif 241 234 242 235 extern void vbox_gem_free_object(struct drm_gem_object *obj); … … 280 273 } 281 274 282 int vbox_bo_reserve(struct vbox_bo *bo, bool no_wait);283 void vbox_bo_unreserve(struct vbox_bo *bo);284 275 void vbox_ttm_placement(struct vbox_bo *bo, int domain); 285 276 int vbox_bo_push_sysram(struct vbox_bo *bo); 286 277 int vbox_mmap(struct file *filp, struct vm_area_struct *vma); 287 288 /* vbox post */ 289 void vbox_post_gpu(struct drm_device *dev); 290 #endif 278 #endif -
trunk/src/VBox/Additions/linux/drm/vbox_fb.c
r59526 r59568 80 80 { 81 81 struct vbox_fbdev *pVFBDev = pInfo->par; 82 struct drm_device * pDev;82 struct drm_device *dev; 83 83 struct vbox_private *pVBox; 84 84 unsigned i; 85 85 86 86 LogFunc(("vboxvideo: %d\n", __LINE__)); 87 pDev = pVFBDev->helper.dev;88 pVBox = pDev->dev_private;89 VBoxRefreshModes(pDev);90 for (i = 0; i < pVBox-> cCrtcs; ++i)91 VBoxVBVADisable(&pVBox-> paVBVACtx[i], &pVBox->Ctx, i);92 VBoxHGSMISendCapsInfo(&pVBox-> Ctx, 0);87 dev = pVFBDev->helper.dev; 88 pVBox = dev->dev_private; 89 vbox_refresh_modes(dev); 90 for (i = 0; i < pVBox->num_crtcs; ++i) 91 VBoxVBVADisable(&pVBox->vbva_info[i], &pVBox->submit_info, i); 92 VBoxHGSMISendCapsInfo(&pVBox->submit_info, 0); 93 93 return drm_fb_helper_set_par(pInfo); 94 94 } … … 427 427 drm_fb_helper_prepare(dev, &afbdev->helper, &vbox_fb_helper_funcs); 428 428 #endif 429 ret = drm_fb_helper_init(dev, &afbdev->helper, vbox-> cCrtcs, vbox->cCrtcs);429 ret = drm_fb_helper_init(dev, &afbdev->helper, vbox->num_crtcs, vbox->num_crtcs); 430 430 if (ret) 431 431 goto free; -
trunk/src/VBox/Additions/linux/drm/vbox_main.c
r59526 r59568 70 70 * takes over the console that is not aware of VBVA (i.e. the VESA BIOS). */ 71 71 void vbox_framebuffer_dirty_rectangles(struct drm_framebuffer *fb, 72 struct drm_clip_rect * pRects,73 unsigned cRects)72 struct drm_clip_rect *rects, 73 unsigned num_rects) 74 74 { 75 75 struct vbox_private *vbox = fb->dev->dev_private; … … 77 77 unsigned long flags; 78 78 79 LogFunc(("vboxvideo: %d: fb=%p, cRects=%u, vbox=%p\n", __LINE__, fb,80 cRects, vbox));79 LogFunc(("vboxvideo: %d: fb=%p, num_rects=%u, vbox=%p\n", __LINE__, fb, 80 num_rects, vbox)); 81 81 spin_lock_irqsave(&vbox->dev_lock, flags); 82 for (i = 0; i < cRects; ++i)82 for (i = 0; i < num_rects; ++i) 83 83 { 84 84 struct drm_crtc *crtc; 85 85 list_for_each_entry(crtc, &fb->dev->mode_config.crtc_list, head) 86 86 { 87 unsigned iCrtc= to_vbox_crtc(crtc)->crtc_id;88 struct VBVABUFFER *pVBVA = vbox-> paVBVACtx[iCrtc].pVBVA;87 unsigned crtc_id = to_vbox_crtc(crtc)->crtc_id; 88 struct VBVABUFFER *pVBVA = vbox->vbva_info[crtc_id].pVBVA; 89 89 VBVACMDHDR cmdHdr; 90 90 … … 94 94 pVBVA = (struct VBVABUFFER *) ( ((uint8_t *)vbox->vram) 95 95 + vbox->vram_size 96 + iCrtc* VBVA_MIN_BUFFER_SIZE);97 if (!VBoxVBVAEnable(&vbox-> paVBVACtx[iCrtc], &vbox->Ctx, pVBVA, iCrtc))96 + crtc_id * VBVA_MIN_BUFFER_SIZE); 97 if (!VBoxVBVAEnable(&vbox->vbva_info[crtc_id], &vbox->submit_info, pVBVA, crtc_id)) 98 98 AssertReleaseMsgFailed(("VBoxVBVAEnable failed - heap allocation error, very old host or driver error.\n")); 99 99 /* Assume that if the user knows to send dirty rectangle information 100 100 * they can also handle hot-plug events. */ 101 VBoxHGSMISendCapsInfo(&vbox-> Ctx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION);101 VBoxHGSMISendCapsInfo(&vbox->submit_info, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION); 102 102 } 103 103 if ( CRTC_FB(crtc) != fb 104 || pRects[i].x1 > crtc->x104 || rects[i].x1 > crtc->x 105 105 + crtc->hwmode.hdisplay 106 || pRects[i].y1 > crtc->y106 || rects[i].y1 > crtc->y 107 107 + crtc->hwmode.vdisplay 108 || pRects[i].x2 < crtc->x109 || pRects[i].y2 < crtc->y)108 || rects[i].x2 < crtc->x 109 || rects[i].y2 < crtc->y) 110 110 continue; 111 cmdHdr.x = (int16_t) pRects[i].x1;112 cmdHdr.y = (int16_t) pRects[i].y1;113 cmdHdr.w = (uint16_t) pRects[i].x2 - pRects[i].x1;114 cmdHdr.h = (uint16_t) pRects[i].y2 - pRects[i].y1;115 if (VBoxVBVABufferBeginUpdate(&vbox-> paVBVACtx[iCrtc],116 &vbox-> Ctx))111 cmdHdr.x = (int16_t)rects[i].x1; 112 cmdHdr.y = (int16_t)rects[i].y1; 113 cmdHdr.w = (uint16_t)rects[i].x2 - rects[i].x1; 114 cmdHdr.h = (uint16_t)rects[i].y2 - rects[i].y1; 115 if (VBoxVBVABufferBeginUpdate(&vbox->vbva_info[crtc_id], 116 &vbox->submit_info)) 117 117 { 118 VBoxVBVAWrite(&vbox-> paVBVACtx[iCrtc], &vbox->Ctx, &cmdHdr,118 VBoxVBVAWrite(&vbox->vbva_info[crtc_id], &vbox->submit_info, &cmdHdr, 119 119 sizeof(cmdHdr)); 120 VBoxVBVABufferEndUpdate(&vbox-> paVBVACtx[iCrtc]);120 VBoxVBVABufferEndUpdate(&vbox->vbva_info[crtc_id]); 121 121 } 122 122 } … … 129 129 struct drm_file *file_priv, 130 130 unsigned flags, unsigned color, 131 struct drm_clip_rect * pRects,132 unsigned cRects)131 struct drm_clip_rect *rects, 132 unsigned num_rects) 133 133 { 134 134 LogFunc(("vboxvideo: %d, flags=%u\n", __LINE__, flags)); 135 vbox_framebuffer_dirty_rectangles(fb, pRects, cRects);135 vbox_framebuffer_dirty_rectangles(fb, rects, num_rects); 136 136 return 0; 137 137 } … … 202 202 unsigned i; 203 203 204 if (pVBox-> paVBVACtx)204 if (pVBox->vbva_info) 205 205 { 206 for (i = 0; i < pVBox-> cCrtcs; ++i)207 VBoxVBVADisable(&pVBox-> paVBVACtx[i], &pVBox->Ctx, i);208 kfree(pVBox-> paVBVACtx);209 pVBox-> paVBVACtx= NULL;206 for (i = 0; i < pVBox->num_crtcs; ++i) 207 VBoxVBVADisable(&pVBox->vbva_info[i], &pVBox->submit_info, i); 208 kfree(pVBox->vbva_info); 209 pVBox->vbva_info = NULL; 210 210 } 211 211 } … … 215 215 unsigned i; 216 216 bool fRC = true; 217 LogFunc(("vboxvideo: %d: vbox=%p, vbox-> cCrtcs=%u, vbox->paVBVACtx=%p\n",218 __LINE__, vbox, (unsigned)vbox-> cCrtcs, vbox->paVBVACtx));219 if (!vbox-> paVBVACtx)217 LogFunc(("vboxvideo: %d: vbox=%p, vbox->num_crtcs=%u, vbox->vbva_info=%p\n", 218 __LINE__, vbox, (unsigned)vbox->num_crtcs, vbox->vbva_info)); 219 if (!vbox->vbva_info) 220 220 { 221 vbox-> paVBVACtx= kzalloc( sizeof(struct VBVABUFFERCONTEXT)222 * vbox-> cCrtcs,221 vbox->vbva_info = kzalloc( sizeof(struct VBVABUFFERCONTEXT) 222 * vbox->num_crtcs, 223 223 GFP_KERNEL); 224 if (!vbox-> paVBVACtx)224 if (!vbox->vbva_info) 225 225 return -ENOMEM; 226 226 } 227 227 /* Take a command buffer for each screen from the end of usable VRAM. */ 228 vbox->vram_size -= vbox-> cCrtcs * VBVA_MIN_BUFFER_SIZE;229 for (i = 0; i < vbox-> cCrtcs; ++i)230 VBoxVBVASetupBufferContext(&vbox-> paVBVACtx[i],228 vbox->vram_size -= vbox->num_crtcs * VBVA_MIN_BUFFER_SIZE; 229 for (i = 0; i < vbox->num_crtcs; ++i) 230 VBoxVBVASetupBufferContext(&vbox->vbva_info[i], 231 231 vbox->vram_size + i * VBVA_MIN_BUFFER_SIZE, 232 232 VBVA_MIN_BUFFER_SIZE); 233 LogFunc(("vboxvideo: %d: vbox-> paVBVACtx=%p, vbox->vram_size=%u\n",234 __LINE__, vbox-> paVBVACtx, (unsigned)vbox->vram_size));233 LogFunc(("vboxvideo: %d: vbox->vbva_info=%p, vbox->vram_size=%u\n", 234 __LINE__, vbox->vbva_info, (unsigned)vbox->vram_size)); 235 235 return 0; 236 236 } … … 263 263 264 264 /** Do we support the 4.3 plus mode hint reporting interface? */ 265 static bool haveHGSMI ModeHintAndCursorReportingInterface(struct vbox_private *pVBox)266 { 267 uint32_t f ModeHintReporting, fCursorReporting;268 269 return RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox-> Ctx, VBOX_VBVA_CONF32_MODE_HINT_REPORTING, &fModeHintReporting))270 && RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox-> Ctx, VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING, &fCursorReporting))271 && f ModeHintReporting == VINF_SUCCESS265 static bool haveHGSMImode_hintAndCursorReportingInterface(struct vbox_private *pVBox) 266 { 267 uint32_t fmode_hintReporting, fCursorReporting; 268 269 return RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->submit_info, VBOX_VBVA_CONF32_MODE_HINT_REPORTING, &fmode_hintReporting)) 270 && RT_SUCCESS(VBoxQueryConfHGSMI(&pVBox->submit_info, VBOX_VBVA_CONF32_GUEST_CURSOR_REPORTING, &fCursorReporting)) 271 && fmode_hintReporting == VINF_SUCCESS 272 272 && fCursorReporting == VINF_SUCCESS; 273 273 } … … 278 278 static int setupAcceleration(struct vbox_private *pVBox) 279 279 { 280 uint32_t offBase, offGuestHeap, cbGuestHeap, offHostFlags;280 uint32_t offBase, offGuestHeap, cbGuestHeap, host_flags_offset; 281 281 void *pvGuestHeap; 282 282 283 283 VBoxHGSMIGetBaseMappingInfo(pVBox->full_vram_size, &offBase, NULL, 284 &offGuestHeap, &cbGuestHeap, & offHostFlags);284 &offGuestHeap, &cbGuestHeap, &host_flags_offset); 285 285 pvGuestHeap = ((uint8_t *)pVBox->vram) + offBase + offGuestHeap; 286 pVBox-> offHostFlags = offBase + offHostFlags;287 if (RT_FAILURE(VBoxHGSMISetupGuestContext(&pVBox-> Ctx, pvGuestHeap,286 pVBox->host_flags_offset = offBase + host_flags_offset; 287 if (RT_FAILURE(VBoxHGSMISetupGuestContext(&pVBox->submit_info, pvGuestHeap, 288 288 cbGuestHeap, 289 289 offBase + offGuestHeap, … … 293 293 pVBox->vram_size = offBase; 294 294 /* Linux drm represents monitors as a 32-bit array. */ 295 pVBox-> cCrtcs = RT_MIN(VBoxHGSMIGetMonitorCount(&pVBox->Ctx), 32);296 if (!haveHGSMI ModeHintAndCursorReportingInterface(pVBox))295 pVBox->num_crtcs = RT_MIN(VBoxHGSMIGetMonitorCount(&pVBox->submit_info), 32); 296 if (!haveHGSMImode_hintAndCursorReportingInterface(pVBox)) 297 297 return -ENOTSUPP; 298 pVBox-> paVBVAModeHints = kzalloc(sizeof(VBVAMODEHINT) * pVBox->cCrtcs, GFP_KERNEL);299 if (!pVBox-> paVBVAModeHints)298 pVBox->last_mode_hints = kzalloc(sizeof(VBVAMODEHINT) * pVBox->num_crtcs, GFP_KERNEL); 299 if (!pVBox->last_mode_hints) 300 300 return -ENOMEM; 301 301 return vbox_vbva_init(pVBox); … … 326 326 } 327 327 vbox->full_vram_size = VBoxVideoGetVRAMSize(); 328 vbox-> fAnyX= VBoxVideoAnyWidthAllowed();328 vbox->any_pitch = VBoxVideoAnyWidthAllowed(); 329 329 DRM_INFO("VRAM %08x\n", vbox->full_vram_size); 330 330 … … 438 438 } 439 439 440 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 12, 0) 440 441 int vbox_dumb_destroy(struct drm_file *file, 441 442 struct drm_device *dev, … … 446 447 return drm_gem_handle_delete(file, handle); 447 448 } 449 #endif 448 450 449 451 static void vbox_bo_unref(struct vbox_bo **bo) -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r59526 r59568 72 72 struct vbox_private *vbox; 73 73 int width, height, cBPP, pitch; 74 unsigned iCrtc;74 unsigned crtc_id; 75 75 uint16_t fFlags; 76 76 … … 80 80 width = mode->hdisplay ? mode->hdisplay : 640; 81 81 height = mode->vdisplay ? mode->vdisplay : 480; 82 iCrtc= vbox_crtc->crtc_id;82 crtc_id = vbox_crtc->crtc_id; 83 83 cBPP = crtc->enabled ? CRTC_FB(crtc)->bits_per_pixel : 32; 84 84 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 3, 0) … … 93 93 fFlags = VBVA_SCREEN_F_ACTIVE; 94 94 fFlags |= (crtc->enabled ? 0 : VBVA_SCREEN_F_DISABLED); 95 VBoxHGSMIProcessDisplayInfo(&vbox-> Ctx, vbox_crtc->crtc_id,95 VBoxHGSMIProcessDisplayInfo(&vbox->submit_info, vbox_crtc->crtc_id, 96 96 crtc->x, crtc->y, 97 97 crtc->x * cBPP / 8 + crtc->y * pitch, 98 98 pitch, width, height, 99 vbox_crtc-> fBlanked ? 0 : cBPP, fFlags);100 VBoxHGSMIReportFlagsLocation(&vbox-> Ctx, vbox->offHostFlags);101 VBoxHGSMISendCapsInfo(&vbox-> Ctx, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION);99 vbox_crtc->blanked ? 0 : cBPP, fFlags); 100 VBoxHGSMIReportFlagsLocation(&vbox->submit_info, vbox->host_flags_offset); 101 VBoxHGSMISendCapsInfo(&vbox->submit_info, VBVACAPS_VIDEO_MODE_HINTS | VBVACAPS_DISABLE_CURSOR_INTEGRATION); 102 102 LogFunc(("vboxvideo: %d\n", __LINE__)); 103 103 } … … 118 118 * the first view be the managed memory plus the first command buffer, the 119 119 * second the same plus the second buffer and so on. */ 120 p = VBoxHGSMIBufferAlloc(&vbox-> Ctx, sizeof(VBVAINFOVIEW), HGSMI_CH_VBVA,120 p = VBoxHGSMIBufferAlloc(&vbox->submit_info, sizeof(VBVAINFOVIEW), HGSMI_CH_VBVA, 121 121 VBVA_INFO_VIEW); 122 122 if (p) … … 124 124 VBVAINFOVIEW *pInfo = (VBVAINFOVIEW *)p; 125 125 pInfo->u32ViewIndex = vbox_crtc->crtc_id; 126 pInfo->u32ViewOffset = vbox_crtc-> offFB;127 pInfo->u32ViewSize = vbox->vram_size - vbox_crtc-> offFB126 pInfo->u32ViewOffset = vbox_crtc->fb_offset; 127 pInfo->u32ViewSize = vbox->vram_size - vbox_crtc->fb_offset 128 128 + vbox_crtc->crtc_id * VBVA_MIN_BUFFER_SIZE; 129 pInfo->u32MaxScreenSize = vbox->vram_size - vbox_crtc-> offFB;130 VBoxHGSMIBufferSubmit(&vbox-> Ctx, p);131 VBoxHGSMIBufferFree(&vbox-> Ctx, p);129 pInfo->u32MaxScreenSize = vbox->vram_size - vbox_crtc->fb_offset; 130 VBoxHGSMIBufferSubmit(&vbox->submit_info, p); 131 VBoxHGSMIBufferFree(&vbox->submit_info, p); 132 132 } 133 133 else … … 152 152 switch (mode) { 153 153 case DRM_MODE_DPMS_ON: 154 vbox_crtc-> fBlanked = false;154 vbox_crtc->blanked = false; 155 155 break; 156 156 case DRM_MODE_DPMS_STANDBY: 157 157 case DRM_MODE_DPMS_SUSPEND: 158 158 case DRM_MODE_DPMS_OFF: 159 vbox_crtc-> fBlanked = true;159 vbox_crtc->blanked = true; 160 160 break; 161 161 } … … 222 222 223 223 /* vbox_set_start_address_crt1(crtc, (u32)gpu_addr); */ 224 vbox_crtc-> offFB= gpu_addr;224 vbox_crtc->fb_offset = gpu_addr; 225 225 226 226 LogFunc(("vboxvideo: %d: vbox_fb=%p, obj=%p, bo=%p, gpu_addr=%u\n", … … 413 413 LogFunc(("vboxvideo: %d: vbox_connector=%p\n", __LINE__, vbox_connector)); 414 414 pVBox = vbox_connector->base.dev->dev_private; 415 rc = VBoxHGSMIGetModeHints(&pVBox-> Ctx, pVBox->cCrtcs, pVBox->paVBVAModeHints);415 rc = VBoxHGSMIGetModeHints(&pVBox->submit_info, pVBox->num_crtcs, pVBox->last_mode_hints); 416 416 AssertMsgRCReturnVoid(rc, ("VBoxHGSMIGetModeHints failed, rc=%Rrc.\n", rc)); 417 if (pVBox-> paVBVAModeHints[vbox_connector->iCrtc].magic == VBVAMODEHINT_MAGIC)417 if (pVBox->last_mode_hints[vbox_connector->crtc_id].magic == VBVAMODEHINT_MAGIC) 418 418 { 419 vbox_connector->mode Hint.cX = pVBox->paVBVAModeHints[vbox_connector->iCrtc].cx & 0x8fff;420 vbox_connector->mode Hint.cY = pVBox->paVBVAModeHints[vbox_connector->iCrtc].cy & 0x8fff;421 vbox_connector->mode Hint.fDisconnected = !(pVBox->paVBVAModeHints[vbox_connector->iCrtc].fEnabled);422 LogFunc(("vboxvideo: %d: cX=%u, cY=%u, fDisconnected=%RTbool\n", __LINE__,423 (unsigned)vbox_connector->mode Hint.cX, (unsigned)vbox_connector->modeHint.cY,424 vbox_connector->mode Hint.fDisconnected));419 vbox_connector->mode_hint.width = pVBox->last_mode_hints[vbox_connector->crtc_id].cx & 0x8fff; 420 vbox_connector->mode_hint.height = pVBox->last_mode_hints[vbox_connector->crtc_id].cy & 0x8fff; 421 vbox_connector->mode_hint.disconnected = !(pVBox->last_mode_hints[vbox_connector->crtc_id].fEnabled); 422 LogFunc(("vboxvideo: %d: width=%u, height=%u, disconnected=%RTbool\n", __LINE__, 423 (unsigned)vbox_connector->mode_hint.width, (unsigned)vbox_connector->mode_hint.height, 424 vbox_connector->mode_hint.disconnected)); 425 425 } 426 426 } … … 431 431 struct drm_display_mode *pMode = NULL; 432 432 unsigned cModes = 0; 433 int cxPreferred, cyPreferred;433 int widthPreferred, heightPreferred; 434 434 435 435 LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector)); … … 437 437 vboxUpdateHints(vbox_connector); 438 438 cModes = drm_add_modes_noedid(connector, 2560, 1600); 439 cxPreferred = vbox_connector->modeHint.cX ? vbox_connector->modeHint.cX: 1024;440 cyPreferred = vbox_connector->modeHint.cY ? vbox_connector->modeHint.cY: 768;441 pMode = drm_cvt_mode(connector->dev, cxPreferred, cyPreferred, 60, false,439 widthPreferred = vbox_connector->mode_hint.width ? vbox_connector->mode_hint.width : 1024; 440 heightPreferred = vbox_connector->mode_hint.height ? vbox_connector->mode_hint.height : 768; 441 pMode = drm_cvt_mode(connector->dev, widthPreferred, heightPreferred, 60, false, 442 442 false, false); 443 443 if (pMode) … … 462 462 LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector)); 463 463 vbox_connector = to_vbox_connector(connector); 464 device_remove_file(connector->dev->dev, &vbox_connector-> deviceAttribute);464 device_remove_file(connector->dev->dev, &vbox_connector->sysfs_node); 465 465 #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 17, 0) 466 466 drm_sysfs_connector_remove(connector); … … 481 481 vbox_connector = to_vbox_connector(connector); 482 482 vboxUpdateHints(vbox_connector); 483 return !vbox_connector->mode Hint.fDisconnected;483 return !vbox_connector->mode_hint.disconnected; 484 484 } 485 485 … … 525 525 dev, pAttr, psz, (unsigned long long)cch)); 526 526 vbox_connector = container_of(pAttr, struct vbox_connector, 527 deviceAttribute);527 sysfs_node); 528 528 pVBox = vbox_connector->base.dev->dev_private; 529 529 drm_kms_helper_hotplug_event(vbox_connector->base.dev); … … 547 547 548 548 connector = &vbox_connector->base; 549 vbox_connector-> iCrtc= cScreen;549 vbox_connector->crtc_id = cScreen; 550 550 551 551 /* … … 553 553 * space. 554 554 */ 555 snprintf(vbox_connector-> szName, sizeof(vbox_connector->szName),555 snprintf(vbox_connector->name, sizeof(vbox_connector->name), 556 556 "vbox_screen_%u", cScreen); 557 vbox_connector-> deviceAttribute.attr.name = vbox_connector->szName;558 vbox_connector-> deviceAttribute.attr.mode = S_IWUSR;559 vbox_connector-> deviceAttribute.show = NULL;560 vbox_connector-> deviceAttribute.store = vbox_connector_write_sysfs;561 rc = device_create_file(dev->dev, &vbox_connector-> deviceAttribute);557 vbox_connector->sysfs_node.attr.name = vbox_connector->name; 558 vbox_connector->sysfs_node.attr.mode = S_IWUSR; 559 vbox_connector->sysfs_node.show = NULL; 560 vbox_connector->sysfs_node.store = vbox_connector_write_sysfs; 561 rc = device_create_file(dev->dev, &vbox_connector->sysfs_node); 562 562 if (rc < 0) 563 563 { … … 638 638 /* vbox_cursor_init(dev); */ 639 639 LogFunc(("vboxvideo: %d: dev=%p\n", __LINE__, dev)); 640 for (i = 0; i < pVBox-> cCrtcs; ++i)640 for (i = 0; i < pVBox->num_crtcs; ++i) 641 641 { 642 642 vbox_crtc_init(dev, i); … … 654 654 655 655 656 void VBoxRefreshModes(struct drm_device *dev)656 void vbox_refresh_modes(struct drm_device *dev) 657 657 { 658 658 struct vbox_private *vbox = dev->dev_private; … … 702 702 if (!handle) { 703 703 /* Hide cursor. */ 704 VBoxHGSMIUpdatePointerShape(&vbox-> Ctx, 0, 0, 0, 0, 0, NULL, 0);704 VBoxHGSMIUpdatePointerShape(&vbox->submit_info, 0, 0, 0, 0, 0, NULL, 0); 705 705 return 0; 706 706 } … … 733 733 | VBOX_MOUSE_POINTER_ALPHA; 734 734 copy_cursor_image(src, dst, width, height, cbMask); 735 rc = VBoxHGSMIUpdatePointerShape(&vbox-> Ctx, fFlags,735 rc = VBoxHGSMIUpdatePointerShape(&vbox->submit_info, fFlags, 736 736 hot_x, hot_y, width, 737 737 height, dst, cbData);
Note:
See TracChangeset
for help on using the changeset viewer.