[PATCH xserver 23/24] Remove readmask from screen block/wakeup handler

Keith Packard keithp at keithp.com
Sun Sep 20 23:16:34 PDT 2015


With no users of the interface needing the readmask anymore, we can
remove it from the argument passed to these functions.

Signed-off-by: Keith Packard <keithp at keithp.com>
---
 composite/compalloc.c                   |  4 ++--
 dix/dixutils.c                          | 14 ++++++--------
 exa/exa.c                               | 10 ++++------
 glamor/glamor.c                         |  4 ++--
 hw/kdrive/src/kdrive.h                  |  6 ++----
 hw/kdrive/src/kinput.c                  |  4 ++--
 hw/xfree86/common/xf86VGAarbiter.c      | 10 ++++------
 hw/xfree86/common/xf86VGAarbiterPriv.h  |  6 ++----
 hw/xfree86/dri/dri.c                    | 12 ++++--------
 hw/xfree86/dri/dri.h                    |  7 ++-----
 hw/xfree86/drivers/modesetting/driver.c |  4 ++--
 hw/xfree86/modes/xf86Rotate.c           |  5 ++---
 include/scrnintstr.h                    | 11 +++++++----
 mi/misprite.c                           |  8 +++-----
 14 files changed, 44 insertions(+), 61 deletions(-)

diff --git a/composite/compalloc.c b/composite/compalloc.c
index 8daded0..e6a203f 100644
--- a/composite/compalloc.c
+++ b/composite/compalloc.c
@@ -55,13 +55,13 @@ compScreenUpdate(ScreenPtr pScreen)
 }
 
 static void
-compBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask)
+compBlockHandler(ScreenPtr pScreen, void *pTimeout)
 {
     CompScreenPtr cs = GetCompScreen(pScreen);
 
     pScreen->BlockHandler = cs->BlockHandler;
     compScreenUpdate(pScreen);
-    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout);
 
     /* Next damage will restore the block handler */
     cs->BlockHandler = NULL;
diff --git a/dix/dixutils.c b/dix/dixutils.c
index 205550e..6951b39 100644
--- a/dix/dixutils.c
+++ b/dix/dixutils.c
@@ -384,11 +384,11 @@ BlockHandler(void *pTimeout, void *pReadmask)
 
     ++inHandler;
     for (i = 0; i < screenInfo.numScreens; i++)
-        (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i],
-                                                pTimeout, pReadmask);
+        (*screenInfo.screens[i]->BlockHandler) (screenInfo.screens[i], timeout);
+
     for (i = 0; i < screenInfo.numGPUScreens; i++)
-        (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i],
-                                                   pTimeout, pReadmask);
+        (*screenInfo.gpuscreens[i]->BlockHandler) (screenInfo.gpuscreens[i], timeout);
+
     for (i = 0; i < numHandlers; i++)
         if (!handlers[i].deleted)
             (*handlers[i].BlockHandler) (handlers[i].blockData,
@@ -423,11 +423,9 @@ WakeupHandler(int result, void *pReadmask)
             (*handlers[i].WakeupHandler) (handlers[i].blockData,
                                           result, pReadmask);
     for (i = 0; i < screenInfo.numScreens; i++)
-        (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i],
-                                                 result, pReadmask);
+        (*screenInfo.screens[i]->WakeupHandler) (screenInfo.screens[i], result);
     for (i = 0; i < screenInfo.numGPUScreens; i++)
-        (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i],
-                                                    result, pReadmask);
+        (*screenInfo.gpuscreens[i]->WakeupHandler) (screenInfo.gpuscreens[i], result);
     if (handlerDeleted) {
         for (i = 0; i < numHandlers;)
             if (handlers[i].deleted) {
diff --git a/exa/exa.c b/exa/exa.c
index 51d36f3..7266b71 100644
--- a/exa/exa.c
+++ b/exa/exa.c
@@ -702,8 +702,7 @@ exaCreateScreenResources(ScreenPtr pScreen)
 }
 
 static void
-ExaBlockHandler(ScreenPtr pScreen, void *pTimeout,
-                void *pReadmask)
+ExaBlockHandler(ScreenPtr pScreen, void *pTimeout)
 {
     ExaScreenPriv(pScreen);
 
@@ -712,7 +711,7 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout,
         exaMoveInPixmap_mixed(pExaScr->deferred_mixed_pixmap);
 
     unwrap(pExaScr, pScreen, BlockHandler);
-    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout);
     wrap(pExaScr, pScreen, BlockHandler, ExaBlockHandler);
 
     /* The rest only applies to classic EXA */
@@ -732,13 +731,12 @@ ExaBlockHandler(ScreenPtr pScreen, void *pTimeout,
 }
 
 static void
-ExaWakeupHandler(ScreenPtr pScreen, unsigned long result,
-                 void *pReadmask)
+ExaWakeupHandler(ScreenPtr pScreen, int result)
 {
     ExaScreenPriv(pScreen);
 
     unwrap(pExaScr, pScreen, WakeupHandler);
-    (*pScreen->WakeupHandler) (pScreen, result, pReadmask);
+    (*pScreen->WakeupHandler) (pScreen, result);
     wrap(pExaScr, pScreen, WakeupHandler, ExaWakeupHandler);
 
     if (result == 0 && pExaScr->numOffscreenAvailable > 1) {
diff --git a/glamor/glamor.c b/glamor/glamor.c
index 8178785..2e9f3d7 100644
--- a/glamor/glamor.c
+++ b/glamor/glamor.c
@@ -232,12 +232,12 @@ glamor_block_handler(ScreenPtr screen)
 }
 
 static void
-_glamor_block_handler(ScreenPtr screen, void *timeout, void *readmask)
+_glamor_block_handler(ScreenPtr screen, void *timeout)
 {
     glamor_screen_private *glamor_priv = glamor_get_screen_private(screen);
 
     screen->BlockHandler = glamor_priv->saved_procs.block_handler;
-    screen->BlockHandler(screen, timeout, readmask);
+    screen->BlockHandler(screen, timeout);
     glamor_priv->saved_procs.block_handler = screen->BlockHandler;
     screen->BlockHandler = _glamor_block_handler;
 
diff --git a/hw/kdrive/src/kdrive.h b/hw/kdrive/src/kdrive.h
index e1d2b59..3c7f2cd 100644
--- a/hw/kdrive/src/kdrive.h
+++ b/hw/kdrive/src/kdrive.h
@@ -527,12 +527,10 @@ void
  KdScreenToPointerCoords(int *x, int *y);
 
 void
-
-KdBlockHandler(ScreenPtr pScreen, void *timeout, void *readmask);
+KdBlockHandler(ScreenPtr pScreen, void *timeout);
 
 void
-
-KdWakeupHandler(ScreenPtr pScreen, unsigned long result, void *readmask);
+KdWakeupHandler(ScreenPtr pScreen, int result);
 
 void
  KdDisableInput(void);
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index c5eda45..0f6377f 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -1951,7 +1951,7 @@ _KdEnqueuePointerEvent(KdPointerInfo * pi, int type, int x, int y, int z,
 }
 
 void
-KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask)
+KdBlockHandler(ScreenPtr pScreen, void *timeo)
 {
     KdPointerInfo *pi;
     int myTimeout = 0;
@@ -1977,7 +1977,7 @@ KdBlockHandler(ScreenPtr pScreen, void *timeo, void *readmask)
 }
 
 void
-KdWakeupHandler(ScreenPtr pScreen, unsigned long lresult, void *readmask)
+KdWakeupHandler(ScreenPtr pScreen, int result)
 {
     KdPointerInfo *pi;
 
diff --git a/hw/xfree86/common/xf86VGAarbiter.c b/hw/xfree86/common/xf86VGAarbiter.c
index 5cc2429..29a5f85 100644
--- a/hw/xfree86/common/xf86VGAarbiter.c
+++ b/hw/xfree86/common/xf86VGAarbiter.c
@@ -265,23 +265,21 @@ VGAarbiterCloseScreen(ScreenPtr pScreen)
 }
 
 static void
-VGAarbiterBlockHandler(ScreenPtr pScreen,
-                       void *pTimeout, void *pReadmask)
+VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout)
 {
     SCREEN_PROLOG(BlockHandler);
     VGAGet(pScreen);
-    pScreen->BlockHandler(pScreen, pTimeout, pReadmask);
+    pScreen->BlockHandler(pScreen, pTimeout);
     VGAPut();
     SCREEN_EPILOG(BlockHandler, VGAarbiterBlockHandler);
 }
 
 static void
-VGAarbiterWakeupHandler(ScreenPtr pScreen, unsigned long result,
-                        void *pReadmask)
+VGAarbiterWakeupHandler(ScreenPtr pScreen, int result)
 {
     SCREEN_PROLOG(WakeupHandler);
     VGAGet(pScreen);
-    pScreen->WakeupHandler(pScreen, result, pReadmask);
+    pScreen->WakeupHandler(pScreen, result);
     VGAPut();
     SCREEN_EPILOG(WakeupHandler, VGAarbiterWakeupHandler);
 }
diff --git a/hw/xfree86/common/xf86VGAarbiterPriv.h b/hw/xfree86/common/xf86VGAarbiterPriv.h
index b832c9a..09be10a 100644
--- a/hw/xfree86/common/xf86VGAarbiterPriv.h
+++ b/hw/xfree86/common/xf86VGAarbiterPriv.h
@@ -146,10 +146,8 @@ typedef struct _VGAarbiterGC {
 } VGAarbiterGCRec, *VGAarbiterGCPtr;
 
 /* Screen funcs */
-static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout,
-                                   void *pReadmask);
-static void VGAarbiterWakeupHandler(ScreenPtr pScreen,
-                                    unsigned long result, void *pReadmask);
+static void VGAarbiterBlockHandler(ScreenPtr pScreen, void *pTimeout);
+static void VGAarbiterWakeupHandler(ScreenPtr pScreen, int result);
 static Bool VGAarbiterCloseScreen(ScreenPtr pScreen);
 static void VGAarbiterGetImage(DrawablePtr pDrawable, int sx, int sy, int w,
                                int h, unsigned int format,
diff --git a/hw/xfree86/dri/dri.c b/hw/xfree86/dri/dri.c
index 875c9cc..11fbb16 100644
--- a/hw/xfree86/dri/dri.c
+++ b/hw/xfree86/dri/dri.c
@@ -1612,8 +1612,7 @@ DRIWakeupHandler(void *wakeupData, int result, void *pReadmask)
         DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
         if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.WakeupHandler)
-            (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen,
-                                                          result, pReadmask);
+            (*pDRIPriv->pDriverInfo->wrap.WakeupHandler) (pScreen, result);
     }
 }
 
@@ -1627,14 +1626,12 @@ DRIBlockHandler(void *blockData, OSTimePtr pTimeout, void *pReadmask)
         DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
         if (pDRIPriv && pDRIPriv->pDriverInfo->wrap.BlockHandler)
-            (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen,
-                                                         pTimeout, pReadmask);
+            (*pDRIPriv->pDriverInfo->wrap.BlockHandler) (pScreen, timeout);
     }
 }
 
 void
-DRIDoWakeupHandler(ScreenPtr pScreen,
-                   unsigned long result, void *pReadmask)
+DRIDoWakeupHandler(ScreenPtr pScreen, int result)
 {
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
@@ -1651,8 +1648,7 @@ DRIDoWakeupHandler(ScreenPtr pScreen,
 }
 
 void
-DRIDoBlockHandler(ScreenPtr pScreen,
-                  void *pTimeout, void *pReadmask)
+DRIDoBlockHandler(ScreenPtr pScreen, void *timeout)
 {
     DRIScreenPrivPtr pDRIPriv = DRI_SCREEN_PRIV(pScreen);
 
diff --git a/hw/xfree86/dri/dri.h b/hw/xfree86/dri/dri.h
index 1ce0970..d9793b3 100644
--- a/hw/xfree86/dri/dri.h
+++ b/hw/xfree86/dri/dri.h
@@ -269,12 +269,9 @@ extern _X_EXPORT void DRIWakeupHandler(void *wakeupData,
 extern _X_EXPORT void DRIBlockHandler(void *blockData,
                                       OSTimePtr pTimeout, void *pReadmask);
 
-extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen,
-                                         unsigned long result,
-                                         void *pReadmask);
+extern _X_EXPORT void DRIDoWakeupHandler(ScreenPtr pScreen, int result);
 
-extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen,
-                                        void *pTimeout, void *pReadmask);
+extern _X_EXPORT void DRIDoBlockHandler(ScreenPtr pScreen, void *timeout);
 
 extern _X_EXPORT void DRISwapContext(int drmFD, void *oldctx, void *newctx);
 
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index 80abcdf..13237b3 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -596,12 +596,12 @@ ms_dirty_update(ScreenPtr screen)
 }
 
 static void
-msBlockHandler(ScreenPtr pScreen, void *pTimeout, void *pReadmask)
+msBlockHandler(ScreenPtr pScreen, void *timeout)
 {
     modesettingPtr ms = modesettingPTR(xf86ScreenToScrn(pScreen));
 
     pScreen->BlockHandler = ms->BlockHandler;
-    pScreen->BlockHandler(pScreen, pTimeout, pReadmask);
+    pScreen->BlockHandler(pScreen, timeout);
     ms->BlockHandler = pScreen->BlockHandler;
     pScreen->BlockHandler = msBlockHandler;
     if (pScreen->isGPU && !ms->drmmode.reverse_prime_offload_mode)
diff --git a/hw/xfree86/modes/xf86Rotate.c b/hw/xfree86/modes/xf86Rotate.c
index 4aa8f8d..dbf3775 100644
--- a/hw/xfree86/modes/xf86Rotate.c
+++ b/hw/xfree86/modes/xf86Rotate.c
@@ -221,8 +221,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
 }
 
 static void
-xf86RotateBlockHandler(ScreenPtr pScreen,
-                       void *pTimeout, void *pReadmask)
+xf86RotateBlockHandler(ScreenPtr pScreen, void *pTimeout)
 {
     ScrnInfoPtr pScrn = xf86ScreenToScrn(pScreen);
     xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
@@ -235,7 +234,7 @@ xf86RotateBlockHandler(ScreenPtr pScreen,
 
     xf86RotateRedisplay(pScreen);
 
-    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, pTimeout);
 
     /* Re-wrap if we still need this hook */
     if (xf86_config->rotation_damage != NULL) {
diff --git a/include/scrnintstr.h b/include/scrnintstr.h
index 2e617c4..2c8bb9a 100644
--- a/include/scrnintstr.h
+++ b/include/scrnintstr.h
@@ -258,12 +258,15 @@ typedef void (*ResolveColorProcPtr) (unsigned short * /*pred */ ,
 typedef RegionPtr (*BitmapToRegionProcPtr) (PixmapPtr /*pPix */ );
 
 typedef void (*ScreenBlockHandlerProcPtr) (ScreenPtr pScreen,
-                                           void *pTimeout,
-                                           void *pReadmask);
+                                           void *timeout);
 
+/* result has three possible values:
+ * < 0 - error
+ * = 0 - timeout
+ * > 0 - activity
+ */
 typedef void (*ScreenWakeupHandlerProcPtr) (ScreenPtr pScreen,
-                                            unsigned long result,
-                                            void *pReadMask);
+                                            int result);
 
 typedef Bool (*CreateScreenResourcesProcPtr) (ScreenPtr /*pScreen */ );
 
diff --git a/mi/misprite.c b/mi/misprite.c
index 68a49be..e682b24 100644
--- a/mi/misprite.c
+++ b/mi/misprite.c
@@ -198,8 +198,7 @@ static void miSpriteSourceValidate(DrawablePtr pDrawable, int x, int y,
                                    unsigned int subWindowMode);
 static void miSpriteCopyWindow(WindowPtr pWindow,
                                DDXPointRec ptOldOrg, RegionPtr prgnSrc);
-static void miSpriteBlockHandler(ScreenPtr pScreen,
-                                 void *pTimeout, void *pReadMask);
+static void miSpriteBlockHandler(ScreenPtr pScreen, void *timeout);
 static void miSpriteInstallColormap(ColormapPtr pMap);
 static void miSpriteStoreColors(ColormapPtr pMap, int ndef, xColorItem * pdef);
 
@@ -512,8 +511,7 @@ miSpriteCopyWindow(WindowPtr pWindow, DDXPointRec ptOldOrg, RegionPtr prgnSrc)
 }
 
 static void
-miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout,
-                     void *pReadmask)
+miSpriteBlockHandler(ScreenPtr pScreen, void *timeout)
 {
     miSpriteScreenPtr pPriv = GetSpriteScreen(pScreen);
     DeviceIntPtr pDev;
@@ -545,7 +543,7 @@ miSpriteBlockHandler(ScreenPtr pScreen, void *pTimeout,
         }
     }
 
-    (*pScreen->BlockHandler) (pScreen, pTimeout, pReadmask);
+    (*pScreen->BlockHandler) (pScreen, timeout);
 
     if (WorkToDo)
         SCREEN_EPILOGUE(pPriv, pScreen, BlockHandler);
-- 
2.5.0



More information about the xorg-devel mailing list