aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--mesalib/src/mesa/main/macros.h2
-rw-r--r--xorg-server/config/udev.c8
-rw-r--r--xorg-server/dix/dispatch.c4
-rw-r--r--xorg-server/hw/xfree86/common/xf86Events.c11
-rw-r--r--xorg-server/hw/xfree86/modes/xf86Crtc.c2
-rw-r--r--xorg-server/include/hotplug.h2
6 files changed, 24 insertions, 5 deletions
diff --git a/mesalib/src/mesa/main/macros.h b/mesalib/src/mesa/main/macros.h
index fc6f2a28f..04d59d79c 100644
--- a/mesalib/src/mesa/main/macros.h
+++ b/mesalib/src/mesa/main/macros.h
@@ -711,7 +711,7 @@ DIFFERENT_SIGNS(GLfloat x, GLfloat y)
fi_type xfi, yfi;
xfi.f = x;
yfi.f = y;
- return (xfi.i ^ yfi.i) & (1u << 31);
+ return !!((xfi.i ^ yfi.i) & (1u << 31));
#else
/* Could just use (x*y<0) except for the flatshading requirements.
* Maybe there's a better way?
diff --git a/xorg-server/config/udev.c b/xorg-server/config/udev.c
index 03aca2854..c2d00bbda 100644
--- a/xorg-server/config/udev.c
+++ b/xorg-server/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
@@ -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) {
diff --git a/xorg-server/dix/dispatch.c b/xorg-server/dix/dispatch.c
index 3c6a591db..0ce10c2f7 100644
--- a/xorg-server/dix/dispatch.c
+++ b/xorg-server/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);
}
diff --git a/xorg-server/hw/xfree86/common/xf86Events.c b/xorg-server/hw/xfree86/common/xf86Events.c
index 47429ecfe..3ad34b543 100644
--- a/xorg-server/hw/xfree86/common/xf86Events.c
+++ b/xorg-server/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);
diff --git a/xorg-server/hw/xfree86/modes/xf86Crtc.c b/xorg-server/hw/xfree86/modes/xf86Crtc.c
index 1947c5be9..e3eaf5f4c 100644
--- a/xorg-server/hw/xfree86/modes/xf86Crtc.c
+++ b/xorg-server/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++) {
diff --git a/xorg-server/include/hotplug.h b/xorg-server/include/hotplug.h
index 96b078d48..2a95b4524 100644
--- a/xorg-server/include/hotplug.h
+++ b/xorg-server/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 */