Changeset 60085 in vbox for trunk/src/VBox
- Timestamp:
- Mar 17, 2016 7:06:05 PM (9 years ago)
- Location:
- trunk/src/VBox/Additions/linux/drm
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/linux/drm/vbox_drv.h
r60058 r60085 136 136 struct drm_connector base; 137 137 char name[32]; 138 unsigned crtc_id;138 struct vbox_crtc *vbox_crtc; 139 139 struct { 140 140 uint16_t width; … … 147 147 struct drm_crtc base; 148 148 bool blanked; 149 bool disconnected; 149 150 unsigned crtc_id; 150 151 uint32_t fb_offset; -
trunk/src/VBox/Additions/linux/drm/vbox_irq.c
r59956 r60085 89 89 struct vbox_connector *vbox_connector; 90 90 struct VBVAMODEHINT *hints; 91 uint16_t flags; 92 bool disconnected; 93 unsigned crtc_id; 91 94 int rc; 92 95 … … 101 104 list_for_each_entry(connector, &dev->mode_config.connector_list, head) { 102 105 vbox_connector = to_vbox_connector(connector); 103 hints = &vbox->last_mode_hints[vbox_connector-> crtc_id];106 hints = &vbox->last_mode_hints[vbox_connector->vbox_crtc->crtc_id]; 104 107 if (hints->magic == VBVAMODEHINT_MAGIC) { 105 108 LogFunc(("vboxvideo: %d: crtc_id=%u, mode %hdx%hd(enabled:%d),%hdx%hd\n", 106 __LINE__, (unsigned)vbox_connector-> crtc_id,109 __LINE__, (unsigned)vbox_connector->vbox_crtc->crtc_id, 107 110 (short)hints->cx, (short)hints->cy, (int)hints->fEnabled, 108 111 (short)hints->dx, (short)hints->dy)); 112 disconnected = !(hints->fEnabled); 113 crtc_id = vbox_connector->vbox_crtc->crtc_id; 114 flags = VBVA_SCREEN_F_ACTIVE 115 | (disconnected ? VBVA_SCREEN_F_DISABLED : VBVA_SCREEN_F_BLANK); 109 116 vbox_connector->mode_hint.width = hints->cx & 0x8fff; 110 117 vbox_connector->mode_hint.height = hints->cy & 0x8fff; 111 vbox_connector->mode_hint.disconnected = !(hints->fEnabled); 118 vbox_connector->mode_hint.disconnected = disconnected; 119 if (vbox_connector->vbox_crtc->disconnected != disconnected) { 120 VBoxHGSMIProcessDisplayInfo(&vbox->submit_info, crtc_id, 121 0, 0, 0, hints->cx * 4, hints->cx, 122 hints->cy, 0, flags); 123 vbox_connector->vbox_crtc->disconnected = disconnected; 124 } 112 125 #if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 19, 0) 113 126 if ((hints->dx < 0xffff) && (hints->dy < 0xffff)) { -
trunk/src/VBox/Additions/linux/drm/vbox_mode.c
r60058 r60085 92 92 crtc->x, crtc->y); */ 93 93 flags = VBVA_SCREEN_F_ACTIVE; 94 flags |= (crtc->enabled ? 0 : VBVA_SCREEN_F_DISABLED); 94 flags |= (crtc->enabled && !vbox_crtc->blanked ? 0 : VBVA_SCREEN_F_BLANK); 95 flags |= (vbox_crtc->disconnected ? VBVA_SCREEN_F_DISABLED : 0); 95 96 VBoxHGSMIProcessDisplayInfo(&vbox->submit_info, vbox_crtc->crtc_id, 96 97 crtc->x, crtc->y, … … 312 313 }; 313 314 314 static intvbox_crtc_init(struct drm_device *dev, unsigned i)315 { 316 struct vbox_crtc * crtc;317 318 LogFunc(("vboxvideo: %d\n", __LINE__)); 319 crtc = kzalloc(sizeof(struct vbox_crtc), GFP_KERNEL);320 if (! crtc)321 return -ENOMEM;322 crtc->crtc_id = i;323 324 drm_crtc_init(dev, & crtc->base, &vbox_crtc_funcs);325 drm_mode_crtc_set_gamma_size(& crtc->base, 256);326 drm_crtc_helper_add(& crtc->base, &vbox_crtc_helper_funcs);327 LogFunc(("vboxvideo: %d: crtc=%p\n", __LINE__, crtc));328 329 return 0;315 static struct vbox_crtc *vbox_crtc_init(struct drm_device *dev, unsigned i) 316 { 317 struct vbox_crtc *vbox_crtc; 318 319 LogFunc(("vboxvideo: %d\n", __LINE__)); 320 vbox_crtc = kzalloc(sizeof(struct vbox_crtc), GFP_KERNEL); 321 if (!vbox_crtc) 322 return NULL; 323 vbox_crtc->crtc_id = i; 324 325 drm_crtc_init(dev, &vbox_crtc->base, &vbox_crtc_funcs); 326 drm_mode_crtc_set_gamma_size(&vbox_crtc->base, 256); 327 drm_crtc_helper_add(&vbox_crtc->base, &vbox_crtc_helper_funcs); 328 LogFunc(("vboxvideo: %d: crtc=%p\n", __LINE__, vbox_crtc)); 329 330 return vbox_crtc; 330 331 } 331 332 … … 474 475 LogFunc(("vboxvideo: %d: connector=%p\n", __LINE__, connector)); 475 476 vbox_connector = to_vbox_connector(connector); 476 return !vbox_connector->mode_hint.disconnected; 477 return vbox_connector->mode_hint.disconnected ? 478 connector_status_disconnected : connector_status_connected; 477 479 } 478 480 … … 508 510 }; 509 511 510 static int vbox_connector_init(struct drm_device *dev, unsigned cScreen, 512 static int vbox_connector_init(struct drm_device *dev, 513 struct vbox_crtc *vbox_crtc, 511 514 struct drm_encoder *encoder) 512 515 { … … 521 524 522 525 connector = &vbox_connector->base; 523 vbox_connector-> crtc_id = cScreen;526 vbox_connector->vbox_crtc = vbox_crtc; 524 527 525 528 drm_connector_init(dev, connector, &vbox_connector_funcs, … … 553 556 struct vbox_private *vbox = dev->dev_private; 554 557 struct drm_encoder *encoder; 558 struct vbox_crtc *vbox_crtc; 555 559 unsigned i; 556 560 /* vbox_cursor_init(dev); */ … … 558 562 for (i = 0; i < vbox->num_crtcs; ++i) 559 563 { 560 vbox_crtc_init(dev, i); 564 vbox_crtc = vbox_crtc_init(dev, i); 565 if (!vbox_crtc) 566 return -ENOMEM; 561 567 encoder = vbox_encoder_init(dev, i); 562 if (encoder) 563 vbox_connector_init(dev, i, encoder); 568 if (!encoder) 569 return -ENOMEM; 570 vbox_connector_init(dev, vbox_crtc, encoder); 564 571 } 565 572 return 0;
Note:
See TracChangeset
for help on using the changeset viewer.