xserver: Branch 'master' - 5 commits

Keith Packard keithp at kemper.freedesktop.org
Tue Sep 4 11:48:47 PDT 2012


 config/udev.c                  |    8 ++++++--
 dix/dispatch.c                 |    4 ++++
 hw/xfree86/common/xf86Events.c |   11 +++++++++++
 hw/xfree86/modes/xf86Crtc.c    |    2 --
 include/hotplug.h              |    2 ++
 5 files changed, 23 insertions(+), 4 deletions(-)

New commits:
commit 0db936a5b7125d9b73633733cb34e5e4b72f01e8
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Sep 3 15:09:36 2012 +1000

    xf86: call enter/leave VT for gpu screens as well
    
    Otherwise we can't do fast user switch properly for multiple GPUs.
    
    Reviewed-by: Alex Deucher <alexander.deucher at amd.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/common/xf86Events.c b/hw/xfree86/common/xf86Events.c
index 47429ec..3ad34b5 100644
--- a/hw/xfree86/common/xf86Events.c
+++ b/hw/xfree86/common/xf86Events.c
@@ -460,6 +460,8 @@ xf86VTSwitch(void)
         OsBlockSIGIO();
         for (i = 0; i < xf86NumScreens; i++)
             xf86Screens[i]->LeaveVT(xf86Screens[i]);
+        for (i = 0; i < xf86NumGPUScreens; i++)
+            xf86GPUScreens[i]->LeaveVT(xf86GPUScreens[i]);
 
         xf86AccessLeave();      /* We need this here, otherwise */
 
@@ -474,6 +476,10 @@ xf86VTSwitch(void)
                 if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
                     FatalError("EnterVT failed for screen %d\n", i);
             }
+            for (i = 0; i < xf86NumGPUScreens; i++) {
+                if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i]))
+                    FatalError("EnterVT failed for gpu screen %d\n", i);
+            }
             if (!(dispatchException & DE_TERMINATE)) {
                 for (i = 0; i < xf86NumScreens; i++) {
                     if (xf86Screens[i]->EnableDisableFBAccess)
@@ -530,6 +536,11 @@ xf86VTSwitch(void)
             if (!xf86Screens[i]->EnterVT(xf86Screens[i]))
                 FatalError("EnterVT failed for screen %d\n", i);
         }
+        for (i = 0; i < xf86NumGPUScreens; i++) {
+            xf86GPUScreens[i]->vtSema = TRUE;
+            if (!xf86GPUScreens[i]->EnterVT(xf86GPUScreens[i]))
+                FatalError("EnterVT failed for gpu screen %d\n", i);
+        }
         for (i = 0; i < xf86NumScreens; i++) {
             if (xf86Screens[i]->EnableDisableFBAccess)
                 (*xf86Screens[i]->EnableDisableFBAccess) (xf86Screens[i], TRUE);
commit 18deac48db0d2387242461025904eb28a0f71fac
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Aug 27 15:17:21 2012 +1000

    config/udev: respect seat for hotplugged video devices.
    
    This respects the seat tag for hotplugged video devices at X start.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/config/udev.c b/config/udev.c
index 5a8f481..c2d00bb 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -454,6 +454,10 @@ config_udev_odev_probe(config_odev_probe_proc_ptr probe_callback)
 
     udev_enumerate_add_match_subsystem(enumerate, "drm");
     udev_enumerate_add_match_sysname(enumerate, "card[0-9]*");
+#ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
+    if (ServerIsNotSeat0())
+        udev_enumerate_add_match_tag(enumerate, SeatId);
+#endif
     udev_enumerate_scan_devices(enumerate);
     devices = udev_enumerate_get_list_entry(enumerate);
     udev_list_entry_foreach(device, devices) {
commit ec740cffeba59216f4293fba829097654cde3b11
Author: Dave Airlie <airlied at redhat.com>
Date:   Mon Aug 27 15:15:19 2012 +1000

    config/udev: add wrapper around check if server is not seat 0
    
    this is a simple clean-up that is useful to stop further propogation
    of this construct.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/config/udev.c b/config/udev.c
index 03aca28..5a8f481 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -339,7 +339,7 @@ config_udev_pre_init(void)
 #endif
 
 #ifdef HAVE_UDEV_MONITOR_FILTER_ADD_MATCH_TAG
-    if (SeatId && strcmp(SeatId, "seat0"))
+    if (ServerIsNotSeat0())
         udev_monitor_filter_add_match_tag(udev_monitor, SeatId);
 #endif
     if (udev_monitor_enable_receiving(udev_monitor)) {
@@ -368,7 +368,7 @@ config_udev_init(void)
 #endif
 
 #ifdef HAVE_UDEV_ENUMERATE_ADD_MATCH_TAG
-    if (SeatId && strcmp(SeatId, "seat0"))
+    if (ServerIsNotSeat0())
         udev_enumerate_add_match_tag(enumerate, SeatId);
 #endif
 
diff --git a/include/hotplug.h b/include/hotplug.h
index 96b078d..2a95b45 100644
--- a/include/hotplug.h
+++ b/include/hotplug.h
@@ -69,4 +69,6 @@ void config_odev_probe(config_odev_probe_proc_ptr probe_callback);
 void NewGPUDeviceRequest(struct OdevAttributes *attribs);
 void DeleteGPUDeviceRequest(struct OdevAttributes *attribs);
 #endif
+
+#define ServerIsNotSeat0() (SeatId && strcmp(SeatId, "seat0"))
 #endif                          /* HOTPLUG_H */
commit 49ec57d5094be0dd2b67435ac7bb04ead780f36d
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Aug 24 13:23:01 2012 +1000

    dix: free default colormap before screen deletion
    
    If we don't free this here, it gets freed later in the resource
    cleanups, however it then looks up up pmap->pScreen, which we
    freed already in this function. So free the default colormap
    when we should.
    
    This fixes a bug after a couple of hotplug cycles when you try
    to exit the X server and it crashes.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/dix/dispatch.c b/dix/dispatch.c
index 3c6a591..0ce10c2 100644
--- a/dix/dispatch.c
+++ b/dix/dispatch.c
@@ -3904,6 +3904,10 @@ RemoveGPUScreen(ScreenPtr pScreen)
     }
     screenInfo.numGPUScreens--;
 
+    /* this gets freed later in the resource list, but without
+     * the screen existing it causes crashes - so remove it here */
+    if (pScreen->defColormap)
+        FreeResource(pScreen->defColormap, RT_COLORMAP);
     free(pScreen);
 
 }
commit 20f601a0fbc01a4f8ab85e54ee45f78f7817cdb5
Author: Dave Airlie <airlied at redhat.com>
Date:   Fri Aug 24 12:56:18 2012 +1000

    xf86/crtc: don't free config->name
    
    This is set by pre_init not screen init, so if we free it here
    and then recycle the server, we lose all the providers.
    
    I think we need to wrap FreeScreen here to do this properly,
    will investigate for 1.14 most likely, safer to just leak this
    on server exit for now.
    
    Reviewed-by: Keith Packard <keithp at keithp.com>
    Signed-off-by: Dave Airlie <airlied at redhat.com>

diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 1947c5b..e3eaf5f 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -728,8 +728,6 @@ xf86CrtcCloseScreen(ScreenPtr screen)
 
     xf86RandR12CloseScreen(screen);
 
-    free(config->name);
-
     screen->CloseScreen(screen);
 
     for (o = 0; o < config->num_output; o++) {


More information about the xorg-commit mailing list