summaryrefslogtreecommitdiff
path: root/miext
diff options
context:
space:
mode:
authorJeremy Huddleston Sequoia <jeremyhu@apple.com>2022-12-14 23:45:13 -0800
committerJeremy Huddleston Sequoia <jeremyhu@apple.com>2022-12-21 01:22:36 -0800
commit07ed1a623a4b36cdb741a322008ba53d913dc765 (patch)
tree940e91e8b4943d4e4c8dfe926c20f7bf1681c28c /miext
parentd1a9a50792110683ae3f993eeeffeee79cf9cbce (diff)
downloadxserver-07ed1a623a4b36cdb741a322008ba53d913dc765.tar.gz
rootless: Add additional debug logging to help triage XQuartz fb/rootless/damage crashes
Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
Diffstat (limited to 'miext')
-rw-r--r--miext/rootless/rootlessCommon.c44
1 files changed, 41 insertions, 3 deletions
diff --git a/miext/rootless/rootlessCommon.c b/miext/rootless/rootlessCommon.c
index 504362790..44c2c3789 100644
--- a/miext/rootless/rootlessCommon.c
+++ b/miext/rootless/rootlessCommon.c
@@ -134,6 +134,23 @@ RootlessResolveColormap(ScreenPtr pScreen, int first_color,
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
* Prepare a window for direct access to its backing buffer.
@@ -148,11 +165,15 @@ RootlessStartDrawing(WindowPtr pWindow)
RootlessWindowRec *winRec;
PixmapPtr curPixmap;
- if (top == NULL)
+ if (top == NULL) {
+ RL_DEBUG_MSG("RootlessStartDrawing is a no-op because top == NULL.\n");
return;
+ }
winRec = WINREC(top);
- if (winRec == NULL)
+ if (winRec == NULL) {
+ RL_DEBUG_MSG("RootlessStartDrawing is a no-op because winRec == NULL.\n");
return;
+ }
// Make sure the window's top-level parent is prepared for drawing.
if (!winRec->is_drawing) {
@@ -166,10 +187,23 @@ RootlessStartDrawing(WindowPtr pWindow)
top->drawable.depth,
top->drawable.bitsPerPixel,
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,
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;
+ } 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);
@@ -181,6 +215,10 @@ RootlessStartDrawing(WindowPtr pWindow)
PixmapPtr oldPixmap =
dixLookupPrivate(&pWindow->devPrivates,
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 == curPixmap)
RL_DEBUG_MSG
@@ -277,7 +315,7 @@ RootlessDamageRegion(WindowPtr pWindow, RegionPtr pRegion)
WindowPtr pTop;
BoxPtr b1, b2;
- RL_DEBUG_MSG("Damaged win 0x%x ", pWindow);
+ RL_DEBUG_MSG("Damaged win %p\n", pWindow);
pTop = TopLevelParent(pWindow);
if (pTop == NULL)