儲存庫 vbox 的更動 34911
- 時間撮記:
- 2010-12-9 下午05:14:56 (14 年 以前)
- 位置:
- trunk/src/VBox/Additions/x11/vboxvideo
- 檔案:
-
- 修改 3 筆資料
圖例:
- 未更動
- 新增
- 刪除
-
trunk/src/VBox/Additions/x11/vboxvideo/undefined_13
r34747 r34911 12 12 GlxSetVisualConfigs 13 13 LoaderRefSymLists 14 MakeAtom 14 15 PixmapWidthPaddingInfo 16 RRConfigureOutputProperty 15 17 ShadowFBInit2 16 18 VBEExtendedInit … … 120 122 strcmp 121 123 strcpy 124 strncpy 122 125 strlen 123 126 strncmp -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r34872 r34911 81 81 # include "xf86Crtc.h" 82 82 # include "xf86Modes.h" 83 # include <X11/Xatom.h> 83 84 #endif 84 85 … … 427 428 vbox_output_get_modes (xf86OutputPtr output) 428 429 { 429 bool rc;430 430 unsigned i; 431 431 DisplayModePtr pModes = NULL; … … 436 436 if (vbox_device_available(pVBox)) 437 437 { 438 Bool rc = FALSE; 438 439 uint32_t x, y, bpp, iScreen; 439 rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &iScreen); 440 /* @todo - check the display number once we support multiple displays. */ 440 iScreen = (uintptr_t)output->driver_private; 441 if ( pVBox->aPreferredSize[iScreen].cx 442 && pVBox->aPreferredSize[iScreen].cy) 443 { 444 x = pVBox->aPreferredSize[iScreen].cx; 445 y = pVBox->aPreferredSize[iScreen].cy; 446 rc = TRUE; 447 } 448 else 449 rc = vboxGetDisplayChangeRequest(pScrn, &x, &y, &bpp, &iScreen); 441 450 /* If we don't find a display request, see if we have a saved hint 442 451 * from a previous session. */ … … 460 469 461 470 #ifdef RANDR_12_INTERFACE 462 /* We don't yet have mutable properties, whatever they are. */ 471 static Atom 472 vboxAtomVBoxMode(void) 473 { 474 static Atom rc = 0; 475 if (!rc) 476 rc = MakeAtom("VBOX_MODE", sizeof("VBOX_MODE") - 1, TRUE); 477 return rc; 478 } 479 480 /** We use this for receiving information from clients for the purpose of 481 * dynamic resizing, and later possibly other things too. 482 */ 463 483 static Bool 464 484 vbox_output_set_property(xf86OutputPtr output, Atom property, 465 485 RRPropertyValuePtr value) 466 { (void) output; (void) property; (void) value; return FALSE; } 486 { 487 ScrnInfoPtr pScrn = output->scrn; 488 VBOXPtr pVBox = VBOXGetRec(pScrn); 489 TRACE_LOG("property=%d, value->type=%d, value->format=%d, value->size=%ld\n", 490 (int)property, (int)value->type, value->format, value->size); 491 if (property == vboxAtomVBoxMode()) 492 { 493 uint32_t cDisplay = (uintptr_t)output->driver_private; 494 char sz[256] = { 0 }; 495 int w, h; 496 497 if ( value->type != XA_STRING 498 || (unsigned) value->size > (sizeof(sz) - 1)) 499 return FALSE; 500 strncpy(sz, value->data, value->size); 501 if (sscanf(sz, "%dx%d", &w, &h) != 2) 502 return FALSE; 503 pVBox->aPreferredSize[cDisplay].cx = w; 504 pVBox->aPreferredSize[cDisplay].cy = h; 505 return TRUE; 506 } 507 return FALSE; 508 } 467 509 #endif 468 510 … … 1034 1076 pVBox->paOutputs[i]->possible_crtcs = 1 << i; 1035 1077 pVBox->paOutputs[i]->possible_clones = 0; 1078 pVBox->paOutputs[i]->driver_private = (void *)(uintptr_t)i; 1036 1079 TRACE_LOG("Created crtc (%p) and output %s (%p)\n", 1037 1080 (void *)pVBox->paCrtcs[i], szOutput, … … 1054 1097 if (!xf86CrtcScreenInit(pScreen)) { 1055 1098 return FALSE; 1099 } 1100 1101 /* Create our VBOX_MODE display properties. */ 1102 { 1103 uint32_t i; 1104 1105 for (i = 0; i < pVBox->cScreens; ++i) 1106 { 1107 char csz[] = "0x0"; 1108 RRChangeOutputProperty(pVBox->paOutputs[i]->randr_output, 1109 vboxAtomVBoxMode(), XA_STRING, 8, 1110 PropModeReplace, sizeof(csz), csz, TRUE, 1111 FALSE); 1112 1113 } 1056 1114 } 1057 1115 … … 1234 1292 unsigned i; 1235 1293 for (i = 0; i < pVBox->cScreens; ++i) 1236 if ( pVBox->aScreenLocation[i].x + pVBox->aScreenLocation[i].cx1237 < pScrn->virtualX1238 && pVBox->aScreenLocation[i].y + pVBox->aScreenLocation[i].cy1239 < pScrn->virtualY)1294 if ( pVBox->aScreenLocation[i].x + pVBox->aScreenLocation[i].cx 1295 <= pScrn->virtualX 1296 && pVBox->aScreenLocation[i].y + pVBox->aScreenLocation[i].cy 1297 <= pScrn->virtualY) 1240 1298 return i; 1241 1299 return 0; /* This will probably look bad if it can happen. */ -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r34763 r34911 223 223 /** Context information about the VBVA buffers for each screen */ 224 224 struct VBVABUFFERCONTEXT aVbvaCtx[VBOX_VIDEO_MAX_SCREENS]; 225 /** The current preferred resolution for the screen */ 226 RTRECTSIZE aPreferredSize[VBOX_VIDEO_MAX_SCREENS]; 225 227 /** HGSMI guest heap context */ 226 228 HGSMIGUESTCOMMANDCONTEXT guestCtx; 227 Bool fAnyX; /* Unrestricted horizontal resolution flag. */ 229 /** Unrestricted horizontal resolution flag. */ 230 Bool fAnyX; 228 231 #ifdef VBOX_DRI 229 232 Bool useDRI;
注意:
瀏覽 TracChangeset
來幫助您使用更動檢視器