Changeset 52677 in vbox
- Timestamp:
- Sep 10, 2014 2:41:57 PM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r52646 r52677 492 492 } 493 493 494 #ifdef RANDR_12_INTERFACE495 static Atom496 vboxAtomVBoxMode(void)497 {498 return MakeAtom("VBOX_MODE", sizeof("VBOX_MODE") - 1, TRUE);499 }500 501 static Atom502 vboxAtomEDID(void)503 {504 return MakeAtom("EDID", sizeof("EDID") - 1, TRUE);505 }506 507 /** We use this for receiving information from clients for the purpose of508 * dynamic resizing, and later possibly other things too.509 */510 static Bool511 vbox_output_set_property(xf86OutputPtr output, Atom property,512 RRPropertyValuePtr value)513 {514 ScrnInfoPtr pScrn = output->scrn;515 VBOXPtr pVBox = VBOXGetRec(pScrn);516 TRACE_LOG("property=%d, value->type=%d, value->format=%d, value->size=%d\n",517 (int)property, (int)value->type, (int)value->format, (int)value->size);518 if (property == vboxAtomVBoxMode())519 {520 uint32_t cDisplay = (uintptr_t)output->driver_private;521 int w, h;522 523 if ( value->type != XA_INTEGER524 || value->format != 32525 || value->size != 1)526 return FALSE;527 w = (*(uint32_t *)value->data) >> 16;528 h = (*(uint32_t *)value->data) & 0xffff;529 TRACE_LOG("screen=%u, property value=%dx%d\n", cDisplay, w, h);530 pVBox->pScreens[cDisplay].aPreferredSize.cx = w;531 pVBox->pScreens[cDisplay].aPreferredSize.cy = h;532 return TRUE;533 }534 if (property == vboxAtomEDID())535 return TRUE;536 return FALSE;537 }538 #endif539 540 494 static const xf86OutputFuncsRec VBOXOutputFuncs = { 541 495 .create_resources = vbox_output_stub, … … 551 505 .get_modes = vbox_output_get_modes, 552 506 #ifdef RANDR_12_INTERFACE 553 .set_property = vbox_output_set_property,507 .set_property = NULL, 554 508 #endif 555 509 .destroy = vbox_output_stub … … 1134 1088 } 1135 1089 1136 /* Create our VBOX_MODE display properties. */1137 {1138 uint32_t i;1139 1140 for (i = 0; i < pVBox->cScreens; ++i)1141 {1142 INT32 value = 0;1143 RRChangeOutputProperty(pVBox->pScreens[i].paOutputs->randr_output,1144 vboxAtomVBoxMode(), XA_INTEGER, 32,1145 PropModeReplace, 1, &value, TRUE,1146 FALSE);1147 1148 }1149 }1150 1151 1090 if (!xf86SetDesiredModes(pScrn)) { 1152 1091 return FALSE;
Note:
See TracChangeset
for help on using the changeset viewer.