xserver: Branch 'master' - 3 commits

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Fri Sep 28 20:27:26 UTC 2018


 dix/inpututils.c                    |   14 ++-----
 doc/Xserver-spec.xml                |   23 ++----------
 hw/dmx/dmxinit.c                    |   18 ++-------
 hw/dmx/dmxinput.c                   |    9 ----
 hw/dmx/doc/dmx.xml                  |   10 -----
 hw/kdrive/src/kdrive.c              |    8 ----
 hw/kdrive/src/kinput.c              |    6 ---
 hw/vfb/InitInput.c                  |    6 ---
 hw/vfb/InitOutput.c                 |   14 -------
 hw/xfree86/common/xf86Configure.c   |    4 +-
 hw/xfree86/common/xf86Events.c      |    6 ---
 hw/xfree86/common/xf86Init.c        |   65 ++++++++++++------------------------
 hw/xfree86/os-support/xf86_OSproc.h |    2 -
 hw/xnest/Init.c                     |   12 ------
 hw/xnest/Keyboard.c                 |    6 ---
 hw/xquartz/darwin.c                 |   31 -----------------
 hw/xquartz/quartzKeyboard.c         |   11 ------
 hw/xwayland/xwayland-input.c        |    6 ---
 hw/xwayland/xwayland.c              |   14 -------
 hw/xwin/InitInput.c                 |   15 --------
 hw/xwin/InitOutput.c                |   10 -----
 hw/xwin/winscrinit.c                |   21 -----------
 include/input.h                     |    3 -
 include/os.h                        |    2 -
 mi/miscrinit.c                      |   10 ++++-
 os/log.c                            |    2 -
 26 files changed, 51 insertions(+), 277 deletions(-)

New commits:
commit 03b2125005b1c8d4eb62a4173a74458bbe72807b
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Aug 7 15:40:13 2018 -0400

    dix: Remove LegalModifier()
    
    This hasn't done anything besides return TRUE in a long long time.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/dix/inpututils.c b/dix/inpututils.c
index c51c83547..a36d88503 100644
--- a/dix/inpututils.c
+++ b/dix/inpututils.c
@@ -124,10 +124,10 @@ ApplyPointerMapping(DeviceIntPtr dev, CARD8 *map, int len, ClientPtr client)
     return Success;
 }
 
-/* Check if a modifier map change is okay with the device.
- * Returns -1 for BadValue, as it collides with MappingBusy; this particular
- * caveat can be removed with LegalModifier, as we have no other reason to
- * set MappingFailed.  Sigh. */
+/* Check if a modifier map change is okay with the device. Negative return
+ * values mean BadValue, positive values mean Mapping{Busy,Failed}, 0 is
+ * Success / MappingSuccess.
+ */
 static int
 check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap)
 {
@@ -153,12 +153,6 @@ check_modmap_change(ClientPtr client, DeviceIntPtr dev, KeyCode *modmap)
             return -1;
         }
 
-        /* Make sure the mapping is okay with the DDX. */
-        if (!LegalModifier(i, dev)) {
-            client->errorValue = i;
-            return MappingFailed;
-        }
-
         /* None of the new modifiers may be down while we change the
          * map. */
         if (key_is_down(dev, i, KEY_POSTED | KEY_PROCESSED)) {
diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index a022484ba..c89ec527c 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -1782,18 +1782,6 @@ maintains the client's changes to it.
 The X protocol defines standard names to indicate the symbol(s)
 printed on each keycap. (See X11/keysym.h)
 </para>
-<para>
-Legal modifier keys must generate both up and down transitions.  When
-a client tries to change a modifier key (for instance, to make "A" the
-"Control" key), DIX calls the following routine, which should return
-TRUE if the key can be used as a modifier on the given device:
-<blockquote><programlisting>
-
-	Bool LegalModifier(key, pDev)
-	    unsigned int key;
-	    DevicePtr pDev;
-</programlisting></blockquote>
-</para>
 </section>
 </section>
 <section>
@@ -4998,7 +4986,6 @@ mi and fb implementations.</para>
 <row><entry><function>InstallColormap</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
 <row><entry><function>Intersect</function></entry><entry><literal>mi</literal></entry><entry><para>Screen</para></entry></row>
 <row><entry><function>Inverse</function></entry><entry><literal>mi</literal></entry><entry><para>Screen</para></entry></row>
-<row><entry><function>LegalModifier</function></entry><entry><literal>hd</literal></entry><entry><para></para></entry></row>
 <row><entry><function>LineHelper</function></entry><entry><literal>mi</literal></entry><entry><para>GC op</para></entry></row>
 <row><entry><function>ListInstalledColormaps</function></entry><entry><literal>ddx</literal></entry><entry><para>Screen</para></entry></row>
 <row><entry><function>LookupKeyboardDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
diff --git a/hw/dmx/dmxinput.c b/hw/dmx/dmxinput.c
index d201034c6..c099cf18d 100644
--- a/hw/dmx/dmxinput.c
+++ b/hw/dmx/dmxinput.c
@@ -50,15 +50,6 @@
 #include "input.h"
 #include "mi.h"
 
-/** Returns TRUE if the key is a valid modifier.  For PC-class
- * keyboards, all keys can be used as modifiers, so return TRUE
- * always. */
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 /** Called from dix/main.c on each server generation to initialize
  * inputs.  All the work is done in dmxInputInit.  \see
  * dmxInputInit() */
diff --git a/hw/dmx/doc/dmx.xml b/hw/dmx/doc/dmx.xml
index f10cf79dc..1ee748440 100644
--- a/hw/dmx/doc/dmx.xml
+++ b/hw/dmx/doc/dmx.xml
@@ -1077,16 +1077,6 @@ for the device when it was registered/initialized.
 
 </sect3>
 
-<sect3>
-<title>LegalModifier()</title>
-<!-- dmx/dmxinput.c - currently returns TRUE -->
-<para>LegalModifier() is a required DDX function that can be used to
-restrict which keys may be modifier keys.  This seems to be present for
-historical reasons, so this function should simply return TRUE
-unconditionally.
-</para>
-
-</sect3>
 </sect2>
 
 <sect2>
diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c
index 8ab8c24c8..185a9a359 100644
--- a/hw/kdrive/src/kinput.c
+++ b/hw/kdrive/src/kinput.c
@@ -354,12 +354,6 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff)
     return BadImplementation;
 }
 
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 static void
 KdRingBell(KdKeyboardInfo * ki, int volume, int pitch, int duration)
 {
diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c
index 52cde72f0..2c272fad5 100644
--- a/hw/vfb/InitInput.c
+++ b/hw/vfb/InitInput.c
@@ -43,12 +43,6 @@ from The Open Group.
 #include "exevents.h"
 #include "extinit.h"
 
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 void
 ProcessInputEvents(void)
 {
diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 80676c669..4b939000c 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -105,12 +105,6 @@ typedef struct x_IHRec {
 
 static IHPtr InputHandlers = NULL;
 
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 /*
  * TimeSinceLastInputEvent --
  *      Function used for screensaver purposes by the os module. Returns the
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index 85deabab4..c7af77e9b 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -217,12 +217,6 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
     return Success;
 }
 
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 void
 xnestUpdateModifierState(unsigned int state)
 {
diff --git a/hw/xquartz/quartzKeyboard.c b/hw/xquartz/quartzKeyboard.c
index 755fe0990..6d76845ad 100644
--- a/hw/xquartz/quartzKeyboard.c
+++ b/hw/xquartz/quartzKeyboard.c
@@ -726,17 +726,6 @@ DarwinModifierStringToNXMask(const char *str, int separatelr)
     return 0;
 }
 
-/*
- * LegalModifier
- *      This allows the ddx layer to prevent some keys from being remapped
- *      as modifier keys.
- */
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return 1;
-}
-
 #if !defined(__LP64__) || MAC_OS_X_VERSION_MIN_REQUIRED < 1050
 static inline UniChar
 macroman2ucs(unsigned char c)
diff --git a/hw/xwayland/xwayland-input.c b/hw/xwayland/xwayland-input.c
index 7f08b36e2..15fc989bd 100644
--- a/hw/xwayland/xwayland-input.c
+++ b/hw/xwayland/xwayland-input.c
@@ -2490,12 +2490,6 @@ static const struct wl_registry_listener input_listener = {
     global_remove,
 };
 
-Bool
-LegalModifier(unsigned int key, DeviceIntPtr pDev)
-{
-    return TRUE;
-}
-
 void
 ProcessInputEvents(void)
 {
diff --git a/hw/xwin/InitInput.c b/hw/xwin/InitInput.c
index f121d055e..04cd514ab 100644
--- a/hw/xwin/InitInput.c
+++ b/hw/xwin/InitInput.c
@@ -46,21 +46,6 @@ int winProcEstablishConnection(ClientPtr /* client */ );
 DeviceIntPtr g_pwinPointer;
 DeviceIntPtr g_pwinKeyboard;
 
-/* Called from dix/devices.c */
-/*
- * All of our keys generate up and down transition notifications,
- * so all of our keys can be used as modifiers.
- *
- * An example of a modifier is mapping the A key to the Control key.
- * A has to be a legal modifier.  I think.
- */
-
-Bool
-LegalModifier(unsigned int uiKey, DeviceIntPtr pDevice)
-{
-    return TRUE;
-}
-
 /* Called from dix/dispatch.c */
 /*
  * Run through the Windows message queue(s) one more time.
diff --git a/include/input.h b/include/input.h
index 6c9e45df6..b658e9989 100644
--- a/include/input.h
+++ b/include/input.h
@@ -415,9 +415,6 @@ extern void ProcessPointerEvent(InternalEvent * /* ev */ ,
 extern void ProcessKeyboardEvent(InternalEvent * /*ev */ ,
                                  DeviceIntPtr /*keybd */ );
 
-extern Bool LegalModifier(unsigned int /*key */ ,
-                          DeviceIntPtr /*pDev */ );
-
 extern _X_EXPORT void ProcessInputEvents(void);
 
 extern _X_EXPORT void InitInput(int /*argc */ ,
commit a23eba2a91024d27da45e5aee1f4215f7ec2ae82
Author: Adam Jackson <ajax at redhat.com>
Date:   Mon Nov 20 14:28:13 2017 -0500

    dix: Merge AbortDDX into ddxGiveUp
    
    These are so close to identical that most DDXes implement one in terms
    of the other. All the relevant cases can be distinguished by the error
    code, so merge the functions together to make things simpler.
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/doc/Xserver-spec.xml b/doc/Xserver-spec.xml
index 3dde65178..a022484ba 100644
--- a/doc/Xserver-spec.xml
+++ b/doc/Xserver-spec.xml
@@ -1316,7 +1316,7 @@ should be terminated with a newline.
 </para>
 <para>
 After printing the message arguments, FatalError() must be implemented
-such that the server will call AbortDDX() to give the ddx layer
+such that the server will call ddxGiveUp(EXIT_ERR_ABORT) to give the ddx layer
 a chance to reset the hardware, and then
 terminate the server; it must not return.
 </para>
@@ -4653,15 +4653,14 @@ An Example implementation is miPushPixels() in Xserver/mi/mipushpxl.c.</para>
   <title>Shutdown Procedures</title>
 <para>
 <blockquote><programlisting>
-	void AbortDDX(enum ExitCode error)
 	void ddxGiveUp(enum ExitCode error)
 </programlisting></blockquote>
 Some hardware may require special work to be done before the server
 exits so that it is not left in an intermediate state.  As explained
-in the OS layer, FatalError() will call AbortDDX() just before
+in the OS layer, FatalError() will call ddxGiveUp() just before
 terminating the server.  In addition, ddxGiveUp() will be called just
-before terminating the server on a "clean" death.  What AbortDDX() and
-ddxGiveUP do is left unspecified, only that stubs must exist in the
+before terminating the server on a "clean" death.  What
+ddxGiveUp does is left unspecified, only that it must exist in the
 ddx layer.  It is up to local implementors as to what they should
 accomplish before termination.</para>
 <section>
@@ -4923,7 +4922,6 @@ mi and fb implementations.</para>
 	    </thead>
 	    <tbody>
 <row><entry><function>ALLOCATE_LOCAL</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
-<row><entry><function>AbortDDX</function></entry><entry><literal>hd</literal></entry><entry><para></para></entry></row>
 <row><entry><function>AddCallback</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
 <row><entry><function>AddEnabledDevice</function></entry><entry><literal>os</literal></entry><entry><para></para></entry></row>
 <row><entry><function>AddInputDevice</function></entry><entry><literal>dix</literal></entry><entry><para></para></entry></row>
diff --git a/hw/dmx/dmxinit.c b/hw/dmx/dmxinit.c
index 07154d648..4fef30273 100644
--- a/hw/dmx/dmxinit.c
+++ b/hw/dmx/dmxinit.c
@@ -805,11 +805,12 @@ dmxSetDefaultFontPath(const char *fp)
     defaultFontPath = dmxFontPath;
 }
 
-/** This function is called in Xserver/os/utils.c from \a AbortServer().
- * We must ensure that backend and console state is restored in the
- * event the server shutdown wasn't clean. */
+/** This function is called in Xserver/dix/main.c from \a main() when
+ * dispatchException & DE_TERMINATE (which is the only way to exit the
+ * main loop without an interruption), and from AbortServer on
+ * abnormal exit. */
 void
-AbortDDX(enum ExitCode error)
+ddxGiveUp(enum ExitCode error)
 {
     int i;
 
@@ -829,15 +830,6 @@ ddxBeforeReset(void)
 }
 #endif
 
-/** This function is called in Xserver/dix/main.c from \a main() when
- * dispatchException & DE_TERMINATE (which is the only way to exit the
- * main loop without an interruption. */
-void
-ddxGiveUp(enum ExitCode error)
-{
-    AbortDDX(error);
-}
-
 /** This function is called in Xserver/os/osinit.c from \a OsInit(). */
 void
 OsVendorInit(void)
diff --git a/hw/kdrive/src/kdrive.c b/hw/kdrive/src/kdrive.c
index 6e8168323..77114dc46 100644
--- a/hw/kdrive/src/kdrive.c
+++ b/hw/kdrive/src/kdrive.c
@@ -164,15 +164,9 @@ KdEnableScreen(ScreenPtr pScreen)
 }
 
 void
-AbortDDX(enum ExitCode error)
-{
-    KdDisableScreens();
-}
-
-void
 ddxGiveUp(enum ExitCode error)
 {
-    AbortDDX(error);
+    KdDisableScreens();
 }
 
 static Bool kdDumbDriver;
diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index df4d2701b..070cede35 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -201,12 +201,6 @@ ddxGiveUp(enum ExitCode error)
     }
 }
 
-void
-AbortDDX(enum ExitCode error)
-{
-    ddxGiveUp(error);
-}
-
 #ifdef __APPLE__
 void
 DarwinHandleGUI(int argc, char *argv[])
diff --git a/hw/xfree86/common/xf86Configure.c b/hw/xfree86/common/xf86Configure.c
index 44e759166..4347f6d2f 100644
--- a/hw/xfree86/common/xf86Configure.c
+++ b/hw/xfree86/common/xf86Configure.c
@@ -822,7 +822,7 @@ DoConfigure(void)
 
  bail:
     OsCleanup(TRUE);
-    AbortDDX(EXIT_ERR_CONFIGURE);
+    ddxGiveUp(EXIT_ERR_CONFIGURE);
     fflush(stderr);
     exit(0);
 }
@@ -875,7 +875,7 @@ DoShowOptions(void)
     }
  bail:
     OsCleanup(TRUE);
-    AbortDDX(EXIT_ERR_DRIVERS);
+    ddxGiveUp(EXIT_ERR_DRIVERS);
     fflush(stderr);
     exit(0);
 }
diff --git a/hw/xfree86/common/xf86Init.c b/hw/xfree86/common/xf86Init.c
index ef8d4faf6..6c25eda73 100644
--- a/hw/xfree86/common/xf86Init.c
+++ b/hw/xfree86/common/xf86Init.c
@@ -809,6 +809,29 @@ ddxGiveUp(enum ExitCode error)
 {
     int i;
 
+    if (error == EXIT_ERR_ABORT) {
+        input_lock();
+
+        /* try to restore the original video state */
+#ifdef DPMSExtension            /* Turn screens back on */
+        if (DPMSPowerLevel != DPMSModeOn)
+            DPMSSet(serverClient, DPMSModeOn);
+#endif
+        if (xf86Screens) {
+            for (i = 0; i < xf86NumScreens; i++)
+                if (xf86Screens[i]->vtSema) {
+                    /*
+                     * if we are aborting before ScreenInit() has finished we
+                     * might not have been wrapped yet. Therefore enable screen
+                     * explicitly.
+                     */
+                    xf86VGAarbiterLock(xf86Screens[i]);
+                    (xf86Screens[i]->LeaveVT) (xf86Screens[i]);
+                    xf86VGAarbiterUnlock(xf86Screens[i]);
+                }
+        }
+    }
+
     xf86VGAarbiterFini();
 
     if (xf86OSPMClose)
@@ -832,48 +855,6 @@ ddxGiveUp(enum ExitCode error)
     xf86CloseLog(error);
 }
 
-/*
- * AbortDDX --
- *      DDX - specific abort routine.  Called by AbortServer(). The attempt is
- *      made to restore all original setting of the displays. Also all devices
- *      are closed.
- */
-
-void
-AbortDDX(enum ExitCode error)
-{
-    int i;
-
-    input_lock();
-
-    /*
-     * try to restore the original video state
-     */
-#ifdef DPMSExtension            /* Turn screens back on */
-    if (DPMSPowerLevel != DPMSModeOn)
-        DPMSSet(serverClient, DPMSModeOn);
-#endif
-    if (xf86Screens) {
-        for (i = 0; i < xf86NumScreens; i++)
-            if (xf86Screens[i]->vtSema) {
-                /*
-                 * if we are aborting before ScreenInit() has finished
-                 * we might not have been wrapped yet. Therefore enable
-                 * screen explicitely.
-                 */
-                xf86VGAarbiterLock(xf86Screens[i]);
-                (xf86Screens[i]->LeaveVT) (xf86Screens[i]);
-                xf86VGAarbiterUnlock(xf86Screens[i]);
-            }
-    }
-
-    /*
-     * This is needed for an abnormal server exit, since the normal exit stuff
-     * MUST also be performed (i.e. the vt must be left in a defined state)
-     */
-    ddxGiveUp(error);
-}
-
 void
 OsVendorFatalError(const char *f, va_list args)
 {
diff --git a/hw/xfree86/os-support/xf86_OSproc.h b/hw/xfree86/os-support/xf86_OSproc.h
index 99ca90249..42ef16aba 100644
--- a/hw/xfree86/os-support/xf86_OSproc.h
+++ b/hw/xfree86/os-support/xf86_OSproc.h
@@ -90,7 +90,7 @@
 #ifndef NO_OSLIB_PROTOTYPES
 /*
  * This is to prevent re-entrancy to FatalError() when aborting.
- * Anything that can be called as a result of AbortDDX() should use this
+ * Anything that can be called as a result of ddxGiveUp() should use this
  * instead of FatalError().
  */
 
diff --git a/hw/xnest/Init.c b/hw/xnest/Init.c
index b45685216..8edf03372 100644
--- a/hw/xnest/Init.c
+++ b/hw/xnest/Init.c
@@ -126,23 +126,13 @@ CloseInput(void)
     mieqFini();
 }
 
-/*
- * DDX - specific abort routine.  Called by AbortServer().
- */
 void
-AbortDDX(enum ExitCode error)
+ddxGiveUp(enum ExitCode error)
 {
     xnestDoFullGeneration = True;
     xnestCloseDisplay();
 }
 
-/* Called by GiveUp(). */
-void
-ddxGiveUp(enum ExitCode error)
-{
-    AbortDDX(error);
-}
-
 #ifdef __APPLE__
 void
 DarwinHandleGUI(int argc, char *argv[])
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index d8027c9b6..6a143369e 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -826,17 +826,3 @@ ddxGiveUp(enum ExitCode error)
 {
     LogClose(error);
 }
-
-/*
- * AbortDDX --
- *      DDX - specific abort routine.  Called by AbortServer(). The attempt is
- *      made to restore all original setting of the displays. Also all devices
- *      are closed.
- */
-_X_NORETURN
-void
-AbortDDX(enum ExitCode error)
-{
-    ErrorF("   AbortDDX\n");
-    OsAbort();
-}
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 4b27ee627..605c9f56b 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -49,12 +49,6 @@ ddxGiveUp(enum ExitCode error)
 }
 
 void
-AbortDDX(enum ExitCode error)
-{
-    ddxGiveUp(error);
-}
-
-void
 OsVendorInit(void)
 {
     if (serverGeneration == 1)
diff --git a/hw/xwin/InitOutput.c b/hw/xwin/InitOutput.c
index 9560c5684..98385a8c4 100644
--- a/hw/xwin/InitOutput.c
+++ b/hw/xwin/InitOutput.c
@@ -240,16 +240,6 @@ ddxGiveUp(enum ExitCode error)
     winDebug("ddxGiveUp - End\n");
 }
 
-/* See Porting Layer Definition - p. 57 */
-void
-AbortDDX(enum ExitCode error)
-{
-#if CYGDEBUG
-    winDebug("AbortDDX\n");
-#endif
-    ddxGiveUp(error);
-}
-
 #ifdef __CYGWIN__
 /* hasmntopt is currently not implemented for cygwin */
 static const char *
diff --git a/include/os.h b/include/os.h
index 947f3c2af..6d209cd21 100644
--- a/include/os.h
+++ b/include/os.h
@@ -551,8 +551,6 @@ enum ExitCode {
 };
 
 extern _X_EXPORT void
-AbortDDX(enum ExitCode error);
-extern _X_EXPORT void
 ddxGiveUp(enum ExitCode error);
 extern _X_EXPORT int
 TimeSinceLastInputEvent(void);
diff --git a/os/log.c b/os/log.c
index a3b28ccb4..8576955fc 100644
--- a/os/log.c
+++ b/os/log.c
@@ -871,7 +871,7 @@ AbortServer(void)
     CloseWellKnownConnections();
     OsCleanup(TRUE);
     AbortDevices();
-    AbortDDX(EXIT_ERR_ABORT);
+    ddxGiveUp(EXIT_ERR_ABORT);
     fflush(stderr);
     if (CoreDump)
         OsAbort();
commit d78ac2f15913bf6f00e06986cc7db0ade9ebd806
Author: Adam Jackson <ajax at redhat.com>
Date:   Tue Aug 7 15:16:16 2018 -0400

    mi: Factor out miSaveScreen
    
    Reviewed-by: Eric Anholt <eric at anholt.net>
    Signed-off-by: Adam Jackson <ajax at redhat.com>

diff --git a/hw/vfb/InitOutput.c b/hw/vfb/InitOutput.c
index 407f2afcd..df4d2701b 100644
--- a/hw/vfb/InitOutput.c
+++ b/hw/vfb/InitOutput.c
@@ -461,12 +461,6 @@ vfbStoreColors(ColormapPtr pmap, int ndef, xColorItem * pdefs)
     }
 }
 
-static Bool
-vfbSaveScreen(ScreenPtr pScreen, int on)
-{
-    return TRUE;
-}
-
 #ifdef HAVE_MMAP
 
 /* this flushes any changes to the screens out to the mmapped file */
@@ -935,8 +929,6 @@ vfbScreenInit(ScreenPtr pScreen, int argc, char **argv)
        return FALSE;
 
     pScreen->InstallColormap = vfbInstallColormap;
-
-    pScreen->SaveScreen = vfbSaveScreen;
     pScreen->StoreColors = vfbStoreColors;
 
     miDCInitialize(pScreen, &vfbPointerCursorFuncs);
diff --git a/hw/xquartz/darwin.c b/hw/xquartz/darwin.c
index c701eb6ac..d8027c9b6 100644
--- a/hw/xquartz/darwin.c
+++ b/hw/xquartz/darwin.c
@@ -172,20 +172,6 @@ DarwinPrintBanner(void)
 }
 
 /*
- * DarwinSaveScreen
- *  X screensaver support. Not implemented.
- */
-static Bool
-DarwinSaveScreen(ScreenPtr pScreen, int on)
-{
-    // FIXME
-    if (on == SCREEN_SAVER_FORCER) {}
-    else if (on == SCREEN_SAVER_ON) {}
-    else {}
-    return TRUE;
-}
-
-/*
  * DarwinScreenInit
  *  This is a callback from dix during AddScreen() from InitOutput().
  *  Initialize the screen and communicate information about it back to dix.
@@ -271,9 +257,6 @@ DarwinScreenInit(ScreenPtr pScreen, int argc, char **argv)
     ShmRegisterFbFuncs(pScreen);
 #endif
 
-    // this must be initialized (why doesn't X have a default?)
-    pScreen->SaveScreen = DarwinSaveScreen;
-
     // finish mode dependent screen setup including cursor support
     if (!QuartzSetupScreen(pScreen->myNum, pScreen)) {
         return FALSE;
diff --git a/hw/xwayland/xwayland.c b/hw/xwayland/xwayland.c
index 96b4db18c..4b27ee627 100644
--- a/hw/xwayland/xwayland.c
+++ b/hw/xwayland/xwayland.c
@@ -614,12 +614,6 @@ xwl_unrealize_window(WindowPtr window)
     return ret;
 }
 
-static Bool
-xwl_save_screen(ScreenPtr pScreen, int on)
-{
-    return TRUE;
-}
-
 static void
 frame_callback(void *data,
                struct wl_callback *callback,
@@ -1066,8 +1060,6 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
     SetNotifyFd(xwl_screen->wayland_fd, socket_handler, X_NOTIFY_READ, xwl_screen);
     RegisterBlockAndWakeupHandlers(block_handler, wakeup_handler, xwl_screen);
 
-    pScreen->SaveScreen = xwl_save_screen;
-
     pScreen->blackPixel = 0;
     pScreen->whitePixel = 1;
 
diff --git a/hw/xwin/winscrinit.c b/hw/xwin/winscrinit.c
index a44e21fbd..c44df565f 100644
--- a/hw/xwin/winscrinit.c
+++ b/hw/xwin/winscrinit.c
@@ -64,17 +64,6 @@ static RootlessFrameProcsRec winMWExtWMProcs = {
 #endif
 
 /*
- * Prototypes
- */
-
-/*
- * Local functions
- */
-
-static Bool
- winSaveScreen(ScreenPtr pScreen, int on);
-
-/*
  * Determine what type of screen we are initializing
  * and call the appropriate procedure to intiailize
  * that type of screen.
@@ -327,9 +316,6 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
         pScreen->whitePixel = 1;
     }
 
-    /* Place our save screen function */
-    pScreen->SaveScreen = winSaveScreen;
-
     /* Finish fb initialization */
     if (!fbFinishScreenInit(pScreen,
                             pScreenInfo->pfb,
@@ -552,10 +538,3 @@ winFinishScreenInitFB(int i, ScreenPtr pScreen, int argc, char **argv)
 
     return TRUE;
 }
-
-/* See Porting Layer Definition - p. 33 */
-static Bool
-winSaveScreen(ScreenPtr pScreen, int on)
-{
-    return TRUE;
-}
diff --git a/mi/miscrinit.c b/mi/miscrinit.c
index 9c6af0dc7..f38298266 100644
--- a/mi/miscrinit.c
+++ b/mi/miscrinit.c
@@ -124,6 +124,12 @@ miCloseScreen(ScreenPtr pScreen)
     return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
 }
 
+static Bool
+miSaveScreen(ScreenPtr pScreen, int on)
+{
+    return TRUE;
+}
+
 /* With the introduction of pixmap privates, the "screen pixmap" can no
  * longer be created in miScreenInit, since all the modules that could
  * possibly ask for pixmap private space have not been initialized at
@@ -242,7 +248,9 @@ miScreenInit(ScreenPtr pScreen, void *pbits,  /* pointer to screen bits */
         pScreen->CloseScreen = miCloseScreen;
     }
     /* else CloseScreen */
-    /* QueryBestSize, SaveScreen, GetImage, GetSpans */
+    /* QueryBestSize */
+    pScreen->SaveScreen = miSaveScreen;
+    /* GetImage, GetSpans */
     pScreen->SourceValidate = (SourceValidateProcPtr) 0;
     /* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
     /* RealizeWindow, UnrealizeWindow */


More information about the xorg-commit mailing list