summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatt Dew <marcoz@osource.org>2012-11-01 22:17:59 -0600
committerMatt Dew <marcoz@osource.org>2012-11-01 22:17:59 -0600
commitb3d25d8d65e4a4864da232630758f125f8a1bfb4 (patch)
tree379d0dab427372b709c3f370fb86745a5ecbcd9c
parent5a612aa44d2fda44317a242c2d8a5fb2afde76c6 (diff)
parentb87edf1acca7e57139cd6bdf5838c2b4179352dc (diff)
Merge branch 'server-1.13-branch' of git://people.freedesktop.org/~airlied/xserver into server-1.13-branch
-rw-r--r--config/udev.c8
-rw-r--r--hw/xfree86/common/xf86Bus.c4
-rw-r--r--hw/xfree86/common/xf86platformBus.c6
-rw-r--r--hw/xfree86/dri2/dri2.c74
4 files changed, 58 insertions, 34 deletions
diff --git a/config/udev.c b/config/udev.c
index c2d00bbda..454838f4c 100644
--- a/config/udev.c
+++ b/config/udev.c
@@ -300,9 +300,15 @@ wakeup_handler(pointer data, int err, pointer read_mask)
return;
action = udev_device_get_action(udev_device);
if (action) {
- if (!strcmp(action, "add") || !strcmp(action, "change")) {
+ if (!strcmp(action, "add")) {
device_removed(udev_device);
device_added(udev_device);
+ } else if (!strcmp(action, "change")) {
+ /* ignore change for the drm devices */
+ if (strcmp(udev_device_get_subsystem(udev_device), "drm")) {
+ device_removed(udev_device);
+ device_added(udev_device);
+ }
}
else if (!strcmp(action, "remove"))
device_removed(udev_device);
diff --git a/hw/xfree86/common/xf86Bus.c b/hw/xfree86/common/xf86Bus.c
index 6de8409fc..4ffbf7e46 100644
--- a/hw/xfree86/common/xf86Bus.c
+++ b/hw/xfree86/common/xf86Bus.c
@@ -81,6 +81,8 @@ xf86CallDriverProbe(DriverPtr drv, Bool detect_only)
if (drv->platformProbe != NULL) {
foundScreen = xf86platformProbeDev(drv);
}
+ if (ServerIsNotSeat0())
+ return foundScreen;
#endif
#ifdef XSERVER_LIBPCIACCESS
@@ -214,6 +216,8 @@ xf86BusProbe(void)
{
#ifdef XSERVER_PLATFORM_BUS
xf86platformProbe();
+ if (ServerIsNotSeat0())
+ return;
#endif
#ifdef XSERVER_LIBPCIACCESS
xf86PciProbe();
diff --git a/hw/xfree86/common/xf86platformBus.c b/hw/xfree86/common/xf86platformBus.c
index 24b947326..0525e39bc 100644
--- a/hw/xfree86/common/xf86platformBus.c
+++ b/hw/xfree86/common/xf86platformBus.c
@@ -213,11 +213,12 @@ xf86platformProbe(void)
int i;
Bool pci = TRUE;
+ config_odev_probe(xf86PlatformDeviceProbe);
+
if (!xf86scanpci()) {
pci = FALSE;
}
- config_odev_probe(&xf86PlatformDeviceProbe);
for (i = 0; i < xf86_num_platform_devices; i++) {
char *busid = xf86_get_platform_attrib(i, ODEV_ATTRIB_BUSID);
@@ -358,6 +359,9 @@ xf86platformProbeDev(DriverPtr drvp)
break;
}
else {
+ /* for non-seat0 servers assume first device is the master */
+ if (ServerIsNotSeat0())
+ break;
if (xf86_platform_devices[j].pdev) {
if (xf86IsPrimaryPlatform(&xf86_platform_devices[j]))
break;
diff --git a/hw/xfree86/dri2/dri2.c b/hw/xfree86/dri2/dri2.c
index 23f589cdc..40963c3b0 100644
--- a/hw/xfree86/dri2/dri2.c
+++ b/hw/xfree86/dri2/dri2.c
@@ -766,6 +766,44 @@ static inline PixmapPtr GetDrawablePixmap(DrawablePtr drawable)
}
}
+/*
+ * A TraverseTree callback to invalidate all windows using the same
+ * pixmap
+ */
+static int
+DRI2InvalidateWalk(WindowPtr pWin, pointer data)
+{
+ if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
+ return WT_DONTWALKCHILDREN;
+ DRI2InvalidateDrawable(&pWin->drawable);
+ return WT_WALKCHILDREN;
+}
+
+static void
+DRI2InvalidateDrawableAll(DrawablePtr pDraw)
+{
+ if (pDraw->type == DRAWABLE_WINDOW) {
+ WindowPtr pWin = (WindowPtr) pDraw;
+ PixmapPtr pPixmap = pDraw->pScreen->GetWindowPixmap(pWin);
+
+ /*
+ * Find the top-most window using this pixmap
+ */
+ while (pWin->parent &&
+ pDraw->pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
+ pWin = pWin->parent;
+
+ /*
+ * Walk the sub-tree to invalidate all of the
+ * windows using the same pixmap
+ */
+ TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
+ DRI2InvalidateDrawable(&pPixmap->drawable);
+ }
+ else
+ DRI2InvalidateDrawable(pDraw);
+}
+
DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
{
DRI2DrawablePtr pPriv = DRI2GetDrawable(pDraw);
@@ -831,6 +869,8 @@ DrawablePtr DRI2UpdatePrime(DrawablePtr pDraw, DRI2BufferPtr pDest)
spix->screen_x = mpix->screen_x;
spix->screen_y = mpix->screen_y;
#endif
+
+ DRI2InvalidateDrawableAll(pDraw);
return &spix->drawable;
}
@@ -1048,18 +1088,7 @@ DRI2WaitSwap(ClientPtr client, DrawablePtr pDrawable)
return FALSE;
}
-/*
- * A TraverseTree callback to invalidate all windows using the same
- * pixmap
- */
-static int
-DRI2InvalidateWalk(WindowPtr pWin, pointer data)
-{
- if (pWin->drawable.pScreen->GetWindowPixmap(pWin) != data)
- return WT_DONTWALKCHILDREN;
- DRI2InvalidateDrawable(&pWin->drawable);
- return WT_WALKCHILDREN;
-}
+
int
DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
@@ -1162,26 +1191,7 @@ DRI2SwapBuffers(ClientPtr client, DrawablePtr pDraw, CARD64 target_msc,
*/
*swap_target = pPriv->swap_count + pPriv->swapsPending;
- if (pDraw->type == DRAWABLE_WINDOW) {
- WindowPtr pWin = (WindowPtr) pDraw;
- PixmapPtr pPixmap = pScreen->GetWindowPixmap(pWin);
-
- /*
- * Find the top-most window using this pixmap
- */
- while (pWin->parent &&
- pScreen->GetWindowPixmap(pWin->parent) == pPixmap)
- pWin = pWin->parent;
-
- /*
- * Walk the sub-tree to invalidate all of the
- * windows using the same pixmap
- */
- TraverseTree(pWin, DRI2InvalidateWalk, pPixmap);
- DRI2InvalidateDrawable(&pPixmap->drawable);
- }
- else
- DRI2InvalidateDrawable(pDraw);
+ DRI2InvalidateDrawableAll(pDraw);
return Success;
}