|
| 1 | +diff --git a/dix/dispatch.c b/dix/dispatch.c |
| 2 | +index a33bfaa..9aaec28 100644 |
| 3 | +--- a/dix/dispatch.c |
| 4 | ++++ b/dix/dispatch.c |
| 5 | +@@ -3819,6 +3819,12 @@ static int indexForScanlinePad[65] = { |
| 6 | + 3 /* 64 bits per scanline pad unit */ |
| 7 | + }; |
| 8 | + |
| 9 | ++static Bool |
| 10 | ++DefaultCloseScreen(ScreenPtr screen) |
| 11 | ++{ |
| 12 | ++ return TRUE; |
| 13 | ++} |
| 14 | ++ |
| 15 | + /* |
| 16 | + grow the array of screenRecs if necessary. |
| 17 | + call the device-supplied initialization procedure |
| 18 | +@@ -3878,6 +3884,9 @@ static int init_screen(ScreenPtr pScreen, int i, Bool gpu) |
| 19 | + PixmapWidthPaddingInfo[depth].notPower2 = 0; |
| 20 | + } |
| 21 | + } |
| 22 | ++ |
| 23 | ++ pScreen->CloseScreen = DefaultCloseScreen; |
| 24 | ++ |
| 25 | + return 0; |
| 26 | + } |
| 27 | + |
| 28 | +diff --git a/fb/fb.h b/fb/fb.h |
| 29 | +index 8ab050d..404bca3 100644 |
| 30 | +--- a/fb/fb.h |
| 31 | ++++ b/fb/fb.h |
| 32 | +@@ -410,6 +410,7 @@ typedef struct { |
| 33 | + #endif |
| 34 | + DevPrivateKeyRec gcPrivateKeyRec; |
| 35 | + DevPrivateKeyRec winPrivateKeyRec; |
| 36 | ++ CloseScreenProcPtr CloseScreen; |
| 37 | + } FbScreenPrivRec, *FbScreenPrivPtr; |
| 38 | + |
| 39 | + #define fbGetScreenPrivate(pScreen) ((FbScreenPrivPtr) \ |
| 40 | +diff --git a/fb/fbscreen.c b/fb/fbscreen.c |
| 41 | +index 4ab807a..831d998 100644 |
| 42 | +--- a/fb/fbscreen.c |
| 43 | ++++ b/fb/fbscreen.c |
| 44 | +@@ -29,6 +29,7 @@ |
| 45 | + Bool |
| 46 | + fbCloseScreen(ScreenPtr pScreen) |
| 47 | + { |
| 48 | ++ FbScreenPrivPtr screen_priv = fbGetScreenPrivate(pScreen); |
| 49 | + int d; |
| 50 | + DepthPtr depths = pScreen->allowedDepths; |
| 51 | + |
| 52 | +@@ -37,9 +38,11 @@ fbCloseScreen(ScreenPtr pScreen) |
| 53 | + free(depths[d].vids); |
| 54 | + free(depths); |
| 55 | + free(pScreen->visuals); |
| 56 | +- if (pScreen->devPrivate) |
| 57 | +- FreePixmap((PixmapPtr)pScreen->devPrivate); |
| 58 | +- return TRUE; |
| 59 | ++ |
| 60 | ++ |
| 61 | ++ pScreen->CloseScreen = screen_priv->CloseScreen; |
| 62 | ++ |
| 63 | ++ return pScreen->CloseScreen(pScreen); |
| 64 | + } |
| 65 | + |
| 66 | + Bool |
| 67 | +@@ -144,6 +147,7 @@ fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, |
| 68 | + int dpix, int dpiy, int width, int bpp) |
| 69 | + #endif |
| 70 | + { |
| 71 | ++ FbScreenPrivPtr screen_priv; |
| 72 | + VisualPtr visuals; |
| 73 | + DepthPtr depths; |
| 74 | + int nvisuals; |
| 75 | +@@ -178,7 +182,11 @@ fbFinishScreenInit(ScreenPtr pScreen, void *pbits, int xsize, int ysize, |
| 76 | + defaultVisual, nvisuals, visuals)) |
| 77 | + return FALSE; |
| 78 | + /* overwrite miCloseScreen with our own */ |
| 79 | ++ |
| 80 | ++ screen_priv = fbGetScreenPrivate(pScreen); |
| 81 | ++ screen_priv->CloseScreen = pScreen->CloseScreen; |
| 82 | + pScreen->CloseScreen = fbCloseScreen; |
| 83 | ++ |
| 84 | + return TRUE; |
| 85 | + } |
| 86 | + |
| 87 | +diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c |
| 88 | +index d9f23f3..0a47363 100644 |
| 89 | +--- a/hw/vfb/InitOutput.c |
| 90 | ++++ b/hw/vfb/InitOutput.c |
| 91 | +@@ -738,13 +738,6 @@ vfbCloseScreen(ScreenPtr pScreen) |
| 92 | + |
| 93 | + pScreen->CloseScreen = pvfb->closeScreen; |
| 94 | + |
| 95 | +- /* |
| 96 | +- * fb overwrites miCloseScreen, so do this here |
| 97 | +- */ |
| 98 | +- if (pScreen->devPrivate) |
| 99 | +- (*pScreen->DestroyPixmap) (pScreen->devPrivate); |
| 100 | +- pScreen->devPrivate = NULL; |
| 101 | +- |
| 102 | + return pScreen->CloseScreen(pScreen); |
| 103 | + } |
| 104 | + |
| 105 | +diff --git a/mi/miscrinit.c b/mi/miscrinit.c |
| 106 | +index 264622d..907e46a 100644 |
| 107 | +--- a/mi/miscrinit.c |
| 108 | ++++ b/mi/miscrinit.c |
| 109 | +@@ -242,10 +242,10 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */ |
| 110 | + pScreen->numVisuals = numVisuals; |
| 111 | + pScreen->visuals = visuals; |
| 112 | + if (width) { |
| 113 | ++ pScreen->CloseScreen = miCloseScreen; |
| 114 | + #ifdef MITSHM |
| 115 | + ShmRegisterFbFuncs(pScreen); |
| 116 | + #endif |
| 117 | +- pScreen->CloseScreen = miCloseScreen; |
| 118 | + } |
| 119 | + /* else CloseScreen */ |
| 120 | + /* QueryBestSize, SaveScreen, GetImage, GetSpans */ |
0 commit comments