Changeset 69080 in vbox for trunk/src/VBox/Additions/x11
- Timestamp:
- Oct 13, 2017 3:40:38 PM (7 years ago)
- Location:
- trunk/src/VBox/Additions/x11/vboxvideo
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/VBox/Additions/x11/vboxvideo/getmode.c
r69079 r69080 212 212 return; 213 213 rc = VBoxHGSMIGetModeHints(&pVBox->guestCtx, pVBox->cScreens, pVBox->paVBVAModeHints); 214 VBVXASSERT(rc == VINF_SUCCESS, ("VBoxHGSMIGetModeHints failed, rc=%d.\n", rc));214 AssertMsg(rc == VINF_SUCCESS, ("VBoxHGSMIGetModeHints failed, rc=%d.\n", rc)); 215 215 for (i = 0; i < pVBox->cScreens; ++i) 216 216 if (pVBox->paVBVAModeHints[i].magic == VBVAMODEHINT_MAGIC) … … 229 229 } 230 230 rc = VBoxQueryConfHGSMI(&pVBox->guestCtx, VBOX_VBVA_CONF32_CURSOR_CAPABILITIES, &fCursorCapabilities); 231 VBVXASSERT(rc == VINF_SUCCESS, ("Getting VBOX_VBVA_CONF32_CURSOR_CAPABILITIES failed, rc=%d.\n", rc));231 AssertMsg(rc == VINF_SUCCESS, ("Getting VBOX_VBVA_CONF32_CURSOR_CAPABILITIES failed, rc=%d.\n", rc)); 232 232 compareAndMaybeSetUseHardwareCursor(pVBox, fCursorCapabilities, &fChanged, true); 233 233 if (pfNeedUpdate != NULL && fChanged) … … 253 253 while (rc > 0 || (rc == -1 && errno == EINTR)); 254 254 /* Why do they return EAGAIN instead of zero bytes read like everyone else does? */ 255 VBVXASSERT(rc != -1 || errno == EAGAIN, ("Reading ACPI input event failed.\n"));255 AssertMsg(rc != -1 || errno == EAGAIN, ("Reading ACPI input event failed.\n")); 256 256 } 257 257 -
trunk/src/VBox/Additions/x11/vboxvideo/pointer.c
r69079 r69080 139 139 140 140 rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, 0, 0, 0, 0, 0, NULL, 0); 141 VBVXASSERT(rc == VINF_SUCCESS, ("Could not hide the virtual mouse pointer, VBox error %d.\n", rc));141 AssertMsg(rc == VINF_SUCCESS, ("Could not hide the virtual mouse pointer, VBox error %d.\n", rc)); 142 142 } 143 143 … … 152 152 rc = VBoxHGSMIUpdatePointerShape(&pVBox->guestCtx, VBOX_MOUSE_POINTER_VISIBLE, 153 153 0, 0, 0, 0, NULL, 0); 154 VBVXASSERT(rc == VINF_SUCCESS, ("Could not unhide the virtual mouse pointer.\n"));154 AssertMsg(rc == VINF_SUCCESS, ("Could not unhide the virtual mouse pointer.\n")); 155 155 } 156 156 … … 171 171 pImage->cHotX, pImage->cHotY, pImage->cWidth, pImage->cHeight, 172 172 pImage->pPixels, pImage->cbLength); 173 VBVXASSERT(rc == VINF_SUCCESS, ("Unable to set the virtual mouse pointer image.\n"));173 AssertMsg(rc == VINF_SUCCESS, ("Unable to set the virtual mouse pointer image.\n")); 174 174 } 175 175 -
trunk/src/VBox/Additions/x11/vboxvideo/setmode.c
r69065 r69080 69 69 70 70 /* Assume 32BPP - this is just a sanity test. */ 71 VBVXASSERT( cbOldSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL71 AssertMsg( cbOldSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL 72 72 && cbNewSize / 4 <= VBOX_VIDEO_MAX_VIRTUAL * VBOX_VIDEO_MAX_VIRTUAL, 73 73 ("cbOldSize=%llu cbNewSize=%llu, max=%u.\n", (unsigned long long)cbOldSize, (unsigned long long)cbNewSize, … … 97 97 cDisplay, cWidth, cHeight, x, y, fEnabled, fConnected, pFrameBuffer->x0, pFrameBuffer->y0, pFrameBuffer->cWidth, 98 98 pFrameBuffer->cHeight, pFrameBuffer->cBPP); 99 VBVXASSERT(cWidth != 0 && cHeight != 0, ("cWidth = 0 or cHeight = 0\n"));99 AssertMsg(cWidth != 0 && cHeight != 0, ("cWidth = 0 or cHeight = 0\n")); 100 100 offStart = (y * pFrameBuffer->cWidth + x) * pFrameBuffer->cBPP / 8; 101 101 if (cDisplay == 0 && fEnabled) -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.c
r69079 r69080 245 245 246 246 TRACE_LOG("width=%d, height=%d\n", width, height); 247 VBVXASSERT(width >= 0 && height >= 0, ("Invalid negative width (%d) or height (%d)\n", width, height));247 AssertMsg(width >= 0 && height >= 0, ("Invalid negative width (%d) or height (%d)\n", width, height)); 248 248 if (pScreen == NULL) /* Not yet initialised. */ 249 249 return TRUE; 250 250 pPixmap = pScreen->GetScreenPixmap(pScreen); 251 VBVXASSERT(pPixmap != NULL, ("Failed to get the screen pixmap.\n"));251 AssertMsg(pPixmap != NULL, ("Failed to get the screen pixmap.\n")); 252 252 TRACE_LOG("pPixmap=%p adjustedWidth=%d height=%d pScrn->depth=%d pScrn->bitsPerPixel=%d cbLine=%d pVBox->base=%p pPixmap->drawable.width=%d pPixmap->drawable.height=%d\n", 253 253 (void *)pPixmap, adjustedWidth, height, pScrn->depth, … … 343 343 * See the work-around in ScreenInit. */ 344 344 xf86RandR12GetOriginalVirtualSize(pScrn, &originalX, &originalY); 345 VBVXASSERT(originalX == VBOX_VIDEO_MAX_VIRTUAL && originalY == VBOX_VIDEO_MAX_VIRTUAL, ("OriginalSize=%dx%d",345 AssertMsg(originalX == VBOX_VIDEO_MAX_VIRTUAL && originalY == VBOX_VIDEO_MAX_VIRTUAL, ("OriginalSize=%dx%d", 346 346 originalX, originalY)); 347 347 for (i = cFirst; i < cLast; ++i) -
trunk/src/VBox/Additions/x11/vboxvideo/vboxvideo.h
r69079 r69080 79 79 80 80 #endif /* !DEBUG */ 81 82 /* Not just for debug builds. If something is wrong we want to know at once. */83 #define VBVXASSERT(expr, out) \84 if (!(expr)) \85 { \86 xf86ErrorF("\nAssertion failed!\n\n"); \87 xf86ErrorF("%s\n", #expr); \88 xf86ErrorF("at %s (%s:%d)\n", __func__, __FILE__, __LINE__); \89 xf86ErrorF out; \90 FatalError("Assertion"); \91 }92 81 93 82 #define VBOX_VERSION VBOX_VERSION_MAJOR * 10000 \ -
trunk/src/VBox/Additions/x11/vboxvideo/vbva.c
r69079 r69080 135 135 rc = VBoxHGSMISetupGuestContext(&pVBox->guestCtx, pvGuestHeapMemory, cbGuestHeapMemory, 136 136 offVRAMBaseMapping + offGuestHeapMemory, &g_hgsmiEnv); 137 VBVXASSERT(RT_SUCCESS(rc), ("Failed to set up the guest-to-host message buffer heap, rc=%d\n", rc));137 AssertMsg(RT_SUCCESS(rc), ("Failed to set up the guest-to-host message buffer heap, rc=%d\n", rc)); 138 138 pVBox->cbView = offVRAMBaseMapping; 139 139 } … … 180 180 rc = VBoxHGSMISendViewInfo(&pVBox->guestCtx, pVBox->cScreens, 181 181 vboxFillViewInfo, (void *)pVBox); 182 VBVXASSERT(RT_SUCCESS(rc), ("Failed to send the view information to the host, rc=%d\n", rc));182 AssertMsg(RT_SUCCESS(rc), ("Failed to send the view information to the host, rc=%d\n", rc)); 183 183 return TRUE; 184 184 } … … 229 229 rc = FALSE; 230 230 } 231 VBVXASSERT(rc, ("Failed to enable screen update reporting for at least one virtual monitor.\n"));231 AssertMsg(rc, ("Failed to enable screen update reporting for at least one virtual monitor.\n")); 232 232 pVBox->fHaveHGSMIModeHints = haveHGSMIModeHintAndCursorReportingInterface(pVBox); 233 233 pVBox->fHostHasScreenBlankingFlag = hostHasScreenBlankingFlag(pVBox);
Note:
See TracChangeset
for help on using the changeset viewer.