Changeset 28264 in vbox for trunk/src/VBox
- Timestamp:
- Apr 13, 2010 4:01:51 PM (15 years ago)
- Location:
- trunk/src/VBox
- Files:
-
- 8 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.cpp
r27286 r28264 115 115 } 116 116 117 BOOLEAN vboxLikesVideoMode(uint32_t width, uint32_t height, uint32_t bpp)117 BOOLEAN vboxLikesVideoMode(uint32_t display, uint32_t width, uint32_t height, uint32_t bpp) 118 118 { 119 119 BOOLEAN bRC = FALSE; 120 120 121 VMMDevVideoModeSupportedRequest *req= NULL;122 123 int rc = VbglGRAlloc((VMMDevRequestHeader**)&req , sizeof(VMMDevVideoModeSupportedRequest), VMMDevReq_VideoModeSupported);121 VMMDevVideoModeSupportedRequest2 *req2 = NULL; 122 123 int rc = VbglGRAlloc((VMMDevRequestHeader**)&req2, sizeof(VMMDevVideoModeSupportedRequest2), VMMDevReq_VideoModeSupported2); 124 124 if (RT_FAILURE(rc)) 125 125 { … … 132 132 else 133 133 { 134 req->width = width; 135 req->height = height; 136 req->bpp = bpp; 137 rc = VbglGRPerform(&req->header); 138 if (RT_SUCCESS(rc)) 139 { 140 bRC = req->fSupported; 134 req2->display = display; 135 req2->width = width; 136 req2->height = height; 137 req2->bpp = bpp; 138 rc = VbglGRPerform(&req2->header); 139 if (RT_SUCCESS(rc) && RT_SUCCESS(req2->header.rc)) 140 { 141 bRC = req2->fSupported; 141 142 } 142 143 else 143 144 { 144 dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR querying video mode supported status from VMMDev." 145 "rc = %Rrc\n", rc)); 146 } 147 VbglGRFree(&req->header); 145 /* Retry using old inteface. */ 146 AssertCompile(sizeof(VMMDevVideoModeSupportedRequest2) >= sizeof(VMMDevVideoModeSupportedRequest)); 147 VMMDevVideoModeSupportedRequest *req = (VMMDevVideoModeSupportedRequest *)req2; 148 req->header.size = sizeof(VMMDevVideoModeSupportedRequest); 149 req->header.version = VMMDEV_REQUEST_HEADER_VERSION; 150 req->header.requestType = VMMDevReq_VideoModeSupported; 151 req->header.rc = VERR_GENERAL_FAILURE; 152 req->header.reserved1 = 0; 153 req->header.reserved2 = 0; 154 req->width = width; 155 req->height = height; 156 req->bpp = bpp; 157 158 rc = VbglGRPerform(&req->header); 159 if (RT_SUCCESS(rc) && RT_SUCCESS(req->header.rc)) 160 { 161 bRC = req->fSupported; 162 } 163 else 164 { 165 dprintf(("VBoxVideo::vboxLikesVideoMode: ERROR querying video mode supported status from VMMDev." 166 "rc = %Rrc\n", rc)); 167 } 168 } 169 VbglGRFree(&req2->header); 148 170 } 149 171 -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/Helper.h
r27205 r28264 36 36 { 37 37 BOOLEAN vboxQueryDisplayRequest(uint32_t *xres, uint32_t *yres, uint32_t *bpp, uint32_t *pDisplayId); 38 BOOLEAN vboxLikesVideoMode(uint32_t width, uint32_t height, uint32_t bpp);38 BOOLEAN vboxLikesVideoMode(uint32_t display, uint32_t width, uint32_t height, uint32_t bpp); 39 39 ULONG vboxGetHeightReduction(); 40 40 BOOLEAN vboxQueryPointerPos(uint16_t *pointerXPos, uint16_t *pointerYPos); -
trunk/src/VBox/Additions/WINNT/Graphics/Miniport/VBoxVideo.cpp
r28228 r28264 483 483 484 484 /* does the host like that mode? */ 485 if (!vboxLikesVideoMode( resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 8))485 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 8)) 486 486 { 487 487 ++matrixIndex; … … 545 545 546 546 /* does the host like that mode? */ 547 if (!vboxLikesVideoMode( resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 16))547 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 16)) 548 548 { 549 549 ++matrixIndex; … … 605 605 606 606 /* does the host like that mode? */ 607 if (!vboxLikesVideoMode( resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 24))607 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 24)) 608 608 { 609 609 ++matrixIndex; … … 665 665 666 666 /* does the host like that mode? */ 667 if (!vboxLikesVideoMode( resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 32))667 if (!vboxLikesVideoMode(DeviceExtension->iDevice, resolutionMatrix[matrixIndex].xRes, resolutionMatrix[matrixIndex].yRes - yOffset, 32)) 668 668 { 669 669 ++matrixIndex; … … 749 749 750 750 /* third test: does the host like the video mode? */ 751 if (!vboxLikesVideoMode( xres, yres, bpp))751 if (!vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp)) 752 752 break; 753 753 … … 981 981 982 982 /* does the host like that mode? */ 983 if (vboxLikesVideoMode( xres, yres, bpp))983 if (vboxLikesVideoMode(DeviceExtension->iDevice, xres, yres, bpp)) 984 984 { 985 985 /* we must have a valid video mode by now and it must fit within the VRAM */ -
trunk/src/VBox/Devices/VMMDev/VMMDev.cpp
r28099 r28264 1023 1023 /* forward the call */ 1024 1024 pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv, 1025 0, /* primary screen. */ 1025 1026 videoModeSupportedRequest->width, 1026 1027 videoModeSupportedRequest->height, 1027 1028 videoModeSupportedRequest->bpp, 1028 1029 &videoModeSupportedRequest->fSupported); 1030 } 1031 break; 1032 } 1033 1034 /* 1035 * Query whether the given video mode is supported for a specific display 1036 */ 1037 case VMMDevReq_VideoModeSupported2: 1038 { 1039 if (pRequestHeader->size != sizeof(VMMDevVideoModeSupportedRequest2)) 1040 { 1041 AssertMsgFailed(("VMMDev video mode supported request 2 structure has invalid size!\n")); 1042 pRequestHeader->rc = VERR_INVALID_PARAMETER; 1043 } 1044 else 1045 { 1046 VMMDevVideoModeSupportedRequest2 *videoModeSupportedRequest2 = (VMMDevVideoModeSupportedRequest2*)pRequestHeader; 1047 /* forward the call */ 1048 pRequestHeader->rc = pThis->pDrv->pfnVideoModeSupported(pThis->pDrv, 1049 videoModeSupportedRequest2->display, 1050 videoModeSupportedRequest2->width, 1051 videoModeSupportedRequest2->height, 1052 videoModeSupportedRequest2->bpp, 1053 &videoModeSupportedRequest2->fSupported); 1029 1054 } 1030 1055 break; -
trunk/src/VBox/Frontends/VBoxBFE/VMMDev.h
r27315 r28264 55 55 uint32_t width, uint32_t height, 56 56 void *pShape); 57 static DECLCALLBACK(int) VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,57 static DECLCALLBACK(int) VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height, 58 58 uint32_t bpp, bool *fSupported); 59 59 static DECLCALLBACK(int) GetHeightReduction(PPDMIVMMDEVCONNECTOR pInterface, uint32_t *heightReduction); -
trunk/src/VBox/Frontends/VBoxBFE/VMMDevInterface.cpp
r27315 r28264 217 217 } 218 218 219 DECLCALLBACK(int) VMMDev::VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,219 DECLCALLBACK(int) VMMDev::VideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height, 220 220 uint32_t bpp, bool *fSupported) 221 221 { -
trunk/src/VBox/Main/DisplayImpl.cpp
r28256 r28264 2099 2099 2100 2100 AutoWriteLock alock(this COMMA_LOCKVAL_SRC_POS); 2101 2102 if (aScreenId != 0 && aScreenId >= mcMonitors) 2103 return E_INVALIDARG; 2101 2104 2102 2105 /* @todo this should be actually done on EMT. */ -
trunk/src/VBox/Main/VMMDevInterface.cpp
r28051 r28264 319 319 } 320 320 321 DECLCALLBACK(int) vmmdevVideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t width, uint32_t height,321 DECLCALLBACK(int) vmmdevVideoModeSupported(PPDMIVMMDEVCONNECTOR pInterface, uint32_t display, uint32_t width, uint32_t height, 322 322 uint32_t bpp, bool *fSupported) 323 323 { … … 326 326 if (!fSupported) 327 327 return VERR_INVALID_PARAMETER; 328 IFramebuffer *framebuffer = pDrv->pVMMDev->getParent()->getDisplay()->getFramebuffer(); 329 if (framebuffer) 328 #ifdef DEBUG_sunlover 329 Log(("vmmdevVideoModeSupported: [%d]: %dx%dx%d\n", display, width, height, bpp)); 330 #endif 331 IFramebuffer *framebuffer = NULL; 332 LONG xOrigin = 0; 333 LONG yOrigin = 0; 334 HRESULT hrc = pDrv->pVMMDev->getParent()->getDisplay()->GetFramebuffer(display, &framebuffer, &xOrigin, &yOrigin); 335 if (SUCCEEDED(hrc) && framebuffer) 336 { 330 337 framebuffer->VideoModeSupported(width, height, bpp, (BOOL*)fSupported); 338 framebuffer->Release(); 339 } 331 340 else 341 { 342 #ifdef DEBUG_sunlover 343 Log(("vmmdevVideoModeSupported: hrc %x, framebuffer %p!!!\n", hrc, framebuffer)); 344 #endif 332 345 *fSupported = true; 346 } 333 347 return VINF_SUCCESS; 334 348 }
Note:
See TracChangeset
for help on using the changeset viewer.