Changeset 35616 in vbox for trunk/src/VBox/Additions/x11/vboxvideo
- Timestamp:
- Jan 18, 2011 2:52:52 PM (14 years ago)
- svn:sync-xref-src-repo-rev:
- 69513
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r35398 r35616 279 279 static void 280 280 vbox_crtc_dpms(xf86CrtcPtr crtc, int mode) 281 { (void) crtc; (void) mode; } 281 { 282 VBOXPtr pVBox = VBOXGetRec(crtc->scrn); 283 unsigned cDisplay = (uintptr_t)crtc->driver_private; 284 TRACE_LOG("cDisplay=%u, mode=%i\n", cDisplay, mode); 285 pVBox->afDisabled[cDisplay] = (mode != DPMSModeOn); 286 if ( pVBox->aScreenLocation[cDisplay].cx 287 && pVBox->aScreenLocation[cDisplay].cy) 288 VBOXSetMode(crtc->scrn, cDisplay, 289 pVBox->aScreenLocation[cDisplay].cx, 290 pVBox->aScreenLocation[cDisplay].cy, 291 pVBox->aScreenLocation[cDisplay].x, 292 pVBox->aScreenLocation[cDisplay].y); 293 } 282 294 283 295 static Bool … … 300 312 (void) mode; 301 313 VBOXPtr pVBox = VBOXGetRec(crtc->scrn); 314 unsigned cDisplay = (uintptr_t)crtc->driver_private; 302 315 303 316 TRACE_LOG("name=%s, HDisplay=%d, VDisplay=%d, x=%d, y=%d\n", adjusted_mode->name, 304 317 adjusted_mode->HDisplay, adjusted_mode->VDisplay, x, y); 305 VBOXSetMode(crtc->scrn, (uintptr_t)crtc->driver_private, 306 adjusted_mode->HDisplay, adjusted_mode->VDisplay, x, y); 318 pVBox->afDisabled[cDisplay] = false; 319 VBOXSetMode(crtc->scrn, cDisplay, adjusted_mode->HDisplay, 320 adjusted_mode->VDisplay, x, y); 307 321 /* Don't remember any modes set while we are seamless, as they are 308 322 * just temporary. */ … … 1132 1146 pVBox->CloseScreen = pScreen->CloseScreen; 1133 1147 pScreen->CloseScreen = VBOXCloseScreen; 1148 #ifdef VBOXVIDEO_13 1149 pScreen->SaveScreen = xf86SaveScreen; 1150 #else 1134 1151 pScreen->SaveScreen = VBOXSaveScreen; 1135 1152 #endif 1153 1154 #ifdef VBOXVIDEO_13 1155 xf86DPMSInit(pScreen, xf86DPMSSet, 0); 1156 #else 1136 1157 /* We probably do want to support power management - even if we just use 1137 1158 a dummy function. */ 1138 1159 xf86DPMSInit(pScreen, VBOXDisplayPowerManagementSet, 0); 1160 #endif 1139 1161 1140 1162 /* Report any unused options (only for the first generation) */ … … 1164 1186 cbOldFB = pVBox->cbLine * pScrn->virtualX; 1165 1187 cbNewFB = vboxLineLength(pScrn, cNewX) * cNewY; 1166 if (cbOldFB > pVBox->cbFBMax)1188 if (cbOldFB > (uint64_t)pVBox->cbFBMax) 1167 1189 cbOldFB = 0; 1168 if (cbNewFB > pVBox->cbFBMax)1190 if (cbNewFB > (uint64_t)pVBox->cbFBMax) 1169 1191 cbNewFB = 0; 1170 1192 memset(pVBox->base, 0, max(cbOldFB, cbNewFB)); … … 1298 1320 { 1299 1321 VBOXPtr pVBox = VBOXGetRec(pScrn); 1300 Bool rc = TRUE, fActive = TRUE;1322 Bool rc = TRUE, fActive = !pVBox->afDisabled[cDisplay]; 1301 1323 uint32_t offStart, cwReal = cWidth; 1302 1324 … … 1320 1342 else 1321 1343 cwReal = RT_MIN((int) cWidth, pScrn->displayWidth - x); 1344 TRACE_LOG("pVBox->afDisabled[cDisplay]=%d, fActive=%d\n", 1345 (int)pVBox->afDisabled[cDisplay], (int)fActive); 1322 1346 /* Don't fiddle with the hardware if we are switched 1323 1347 * to a virtual terminal. */ -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r35398 r35616 212 212 * sending dirty rectangle information to the right one. */ 213 213 RTRECT2 aScreenLocation[VBOX_VIDEO_MAX_SCREENS]; 214 /** Has this screen been disabled by the guest? */ 215 Bool afDisabled[VBOX_VIDEO_MAX_SCREENS]; 214 216 #ifdef VBOXVIDEO_13 215 217 /** The virtual crtcs */
Note:
See TracChangeset
for help on using the changeset viewer.