rootless: Add additional debug logging to help triage XQuartz fb/rootless/damage crashes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
This commit is contained in:
parent
d1a9a50792
commit
07ed1a623a
|
@ -134,6 +134,23 @@ RootlessResolveColormap(ScreenPtr pScreen, int first_color,
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
unsigned long RootlessWID(WindowPtr pWindow) {
|
||||||
|
ScreenPtr pScreen = pWindow->drawable.pScreen;
|
||||||
|
WindowPtr top = TopLevelParent(pWindow);
|
||||||
|
RootlessWindowRec *winRec;
|
||||||
|
PixmapPtr curPixmap;
|
||||||
|
|
||||||
|
if (top == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
winRec = WINREC(top);
|
||||||
|
if (winRec == NULL) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
return (unsigned long)(uintptr_t)winRec->wid;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* RootlessStartDrawing
|
* RootlessStartDrawing
|
||||||
* Prepare a window for direct access to its backing buffer.
|
* Prepare a window for direct access to its backing buffer.
|
||||||
|
@ -148,11 +165,15 @@ RootlessStartDrawing(WindowPtr pWindow)
|
||||||
RootlessWindowRec *winRec;
|
RootlessWindowRec *winRec;
|
||||||
PixmapPtr curPixmap;
|
PixmapPtr curPixmap;
|
||||||
|
|
||||||
if (top == NULL)
|
if (top == NULL) {
|
||||||
|
RL_DEBUG_MSG("RootlessStartDrawing is a no-op because top == NULL.\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
winRec = WINREC(top);
|
winRec = WINREC(top);
|
||||||
if (winRec == NULL)
|
if (winRec == NULL) {
|
||||||
|
RL_DEBUG_MSG("RootlessStartDrawing is a no-op because winRec == NULL.\n");
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Make sure the window's top-level parent is prepared for drawing.
|
// Make sure the window's top-level parent is prepared for drawing.
|
||||||
if (!winRec->is_drawing) {
|
if (!winRec->is_drawing) {
|
||||||
|
@ -166,10 +187,23 @@ RootlessStartDrawing(WindowPtr pWindow)
|
||||||
top->drawable.depth,
|
top->drawable.depth,
|
||||||
top->drawable.bitsPerPixel,
|
top->drawable.bitsPerPixel,
|
||||||
winRec->bytesPerRow, winRec->pixelData);
|
winRec->bytesPerRow, winRec->pixelData);
|
||||||
|
|
||||||
|
RL_DEBUG_MSG("GetScratchPixmapHeader gave us %p %p (%d,%d %dx%d %d) for wid=%lu\n",
|
||||||
|
winRec->pixmap, winRec->pixmap->devPrivate.ptr, winRec->pixmap->drawable.x,
|
||||||
|
winRec->pixmap->drawable.y, winRec->pixmap->drawable.width, winRec->pixmap->drawable.height,
|
||||||
|
winRec->pixmap->drawable.bitsPerPixel, RootlessWID(pWindow));
|
||||||
|
|
||||||
SetPixmapBaseToScreen(winRec->pixmap,
|
SetPixmapBaseToScreen(winRec->pixmap,
|
||||||
top->drawable.x - bw, top->drawable.y - bw);
|
top->drawable.x - bw, top->drawable.y - bw);
|
||||||
|
|
||||||
|
RL_DEBUG_MSG("After SetPixmapBaseToScreen(%d %d %d): %p (%d,%d %dx%d %d) for wid=%lu\n",
|
||||||
|
top->drawable.x, top->drawable.y, bw, winRec->pixmap->devPrivate.ptr, winRec->pixmap->drawable.x,
|
||||||
|
winRec->pixmap->drawable.y, winRec->pixmap->drawable.width, winRec->pixmap->drawable.height,
|
||||||
|
winRec->pixmap->drawable.bitsPerPixel, RootlessWID(pWindow));
|
||||||
|
|
||||||
winRec->is_drawing = TRUE;
|
winRec->is_drawing = TRUE;
|
||||||
|
} else {
|
||||||
|
RL_DEBUG_MSG("Skipped call to xprStartDrawing (wid: %lu) because winRec->is_drawing says we already did.\n", RootlessWID(pWindow));
|
||||||
}
|
}
|
||||||
|
|
||||||
curPixmap = pScreen->GetWindowPixmap(pWindow);
|
curPixmap = pScreen->GetWindowPixmap(pWindow);
|
||||||
|
@ -181,6 +215,10 @@ RootlessStartDrawing(WindowPtr pWindow)
|
||||||
PixmapPtr oldPixmap =
|
PixmapPtr oldPixmap =
|
||||||
dixLookupPrivate(&pWindow->devPrivates,
|
dixLookupPrivate(&pWindow->devPrivates,
|
||||||
rootlessWindowOldPixmapPrivateKey);
|
rootlessWindowOldPixmapPrivateKey);
|
||||||
|
|
||||||
|
RL_DEBUG_MSG("curPixmap is %p %p for wid=%lu\n", curPixmap, curPixmap ? curPixmap->devPrivate.ptr : NULL, RootlessWID(pWindow));
|
||||||
|
RL_DEBUG_MSG("oldPixmap is %p %p for wid=%lu\n", oldPixmap, oldPixmap ? oldPixmap->devPrivate.ptr : NULL, RootlessWID(pWindow));
|
||||||
|
|
||||||
if (oldPixmap != NULL) {
|
if (oldPixmap != NULL) {
|
||||||
if (oldPixmap == curPixmap)
|
if (oldPixmap == curPixmap)
|
||||||
RL_DEBUG_MSG
|
RL_DEBUG_MSG
|
||||||
|
@ -277,7 +315,7 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
|
||||||
WindowPtr pTop;
|
WindowPtr pTop;
|
||||||
BoxPtr b1, b2;
|
BoxPtr b1, b2;
|
||||||
|
|
||||||
RL_DEBUG_MSG("Damaged win 0x%x ", pWindow);
|
RL_DEBUG_MSG("Damaged win %p\n", pWindow);
|
||||||
|
|
||||||
pTop = TopLevelParent(pWindow);
|
pTop = TopLevelParent(pWindow);
|
||||||
if (pTop == NULL)
|
if (pTop == NULL)
|
||||||
|
|
Loading…
Reference in New Issue