summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSøren Sandmann Pedersen <sandmann@redhat.com>2007-08-21 14:26:34 -0400
committerSøren Sandmann Pedersen <sandmann@redhat.com>2007-08-21 14:26:34 -0400
commitb6a7c0112c42a3287e53647c38b2c0c5bf8fefa0 (patch)
treecbbb113925b92f92e310827ebbc4e2d2d582d4f7
parent53941c8e68014619d3ded7f8bc0f07d9a38bb9b1 (diff)
parent6ef4ecd82670c37a354243166750d76a97959c8b (diff)
Merge branch 'master' of ssh+git://sandmann@git.freedesktop.org/git/xorg/xserver
-rw-r--r--config/x11-input.fdi2
-rw-r--r--configure.ac1
-rw-r--r--exa/exa_unaccel.c24
-rw-r--r--hw/xfree86/common/xf86Config.c12
-rw-r--r--hw/xfree86/common/xf86Config.h11
-rw-r--r--hw/xfree86/loader/xf86sym.c1
-rw-r--r--hw/xfree86/modes/xf86Crtc.c118
-rw-r--r--hw/xfree86/modes/xf86Crtc.h19
-rw-r--r--hw/xfree86/modes/xf86Cursors.c11
-rw-r--r--hw/xfree86/modes/xf86RandR12.c4
-rw-r--r--hw/xfree86/os-support/bsd/bsd_mouse.c12
-rw-r--r--hw/xfree86/os-support/linux/Makefile.am2
-rw-r--r--hw/xfree86/os-support/linux/lnx_video.c2
-rw-r--r--include/dix-config.h.in3
-rw-r--r--os/Makefile.am6
-rw-r--r--os/rpcauth.c16
16 files changed, 201 insertions, 43 deletions
diff --git a/config/x11-input.fdi b/config/x11-input.fdi
index 7f516ca7a..c390706fb 100644
--- a/config/x11-input.fdi
+++ b/config/x11-input.fdi
@@ -16,7 +16,7 @@
<!-- If we're using Linux, we use evdev by default (falling back to
keyboard otherwise). -->
<merge key="input.x11_driver" type="string">keyboard</merge>
- <merge key="input.xkb.model" type="string">keyboard</merge>
+ <merge key="input.xkb.model" type="string">pc105</merge>
<match key="/org/freedesktop/Hal/devices/computer:system.kernel.name"
string="Linux">
<merge key="input.x11_driver" type="string">evdev</merge>
diff --git a/configure.ac b/configure.ac
index ad6ae4bfa..fae439cb9 100644
--- a/configure.ac
+++ b/configure.ac
@@ -597,6 +597,7 @@ XTRANS_CONNECTION_FLAGS
# Secure RPC detection macro from xtrans.m4
XTRANS_SECURE_RPC_FLAGS
+AM_CONDITIONAL(SECURE_RPC, [test "x$SECURE_RPC" = xyes])
AM_CONDITIONAL(INT10_VM86, [test "x$INT10" = xvm86])
AM_CONDITIONAL(INT10_X86EMU, [test "x$INT10" = xx86emu])
diff --git a/exa/exa_unaccel.c b/exa/exa_unaccel.c
index b67ea6389..a94648b47 100644
--- a/exa/exa_unaccel.c
+++ b/exa/exa_unaccel.c
@@ -382,19 +382,19 @@ exaGetPixmapFirstPixel (PixmapPtr pPixmap)
ExaMigrationRec pixmaps[1];
ExaPixmapPriv (pPixmap);
+ fb = pExaPixmap->sys_ptr;
+
/* Try to avoid framebuffer readbacks */
- if (exaPixmapIsOffscreen(pPixmap)) {
- if (!miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box)) {
- fb = pExaPixmap->sys_ptr;
- } else {
- need_finish = TRUE;
- fb = pPixmap->devPrivate.ptr;
- pixmaps[0].as_dst = FALSE;
- pixmaps[0].as_src = TRUE;
- pixmaps[0].pPix = pPixmap;
- exaDoMigration (pixmaps, 1, FALSE);
- exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
- }
+ if (exaPixmapIsOffscreen(pPixmap) &&
+ miPointInRegion(DamageRegion(pExaPixmap->pDamage), 0, 0, &box))
+ {
+ need_finish = TRUE;
+ pixmaps[0].as_dst = FALSE;
+ pixmaps[0].as_src = TRUE;
+ pixmaps[0].pPix = pPixmap;
+ exaDoMigration (pixmaps, 1, FALSE);
+ exaPrepareAccess(&pPixmap->drawable, EXA_PREPARE_SRC);
+ fb = pPixmap->devPrivate.ptr;
}
switch (pPixmap->drawable.bitsPerPixel) {
diff --git a/hw/xfree86/common/xf86Config.c b/hw/xfree86/common/xf86Config.c
index 3c29497e3..47737154e 100644
--- a/hw/xfree86/common/xf86Config.c
+++ b/hw/xfree86/common/xf86Config.c
@@ -114,6 +114,18 @@ extern DeviceAssocRec mouse_assoc;
static char *fontPath = NULL;
+static ModuleDefault ModuleDefaults[] = {
+ {.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "glx", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "freetype", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "type1", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "record", .toLoad = TRUE, .load_opt=NULL},
+ {.name = "dri", .toLoad = TRUE, .load_opt=NULL},
+ {.name = NULL, .toLoad = FALSE, .load_opt=NULL}
+};
+
+
/* Forward declarations */
static Bool configScreen(confScreenPtr screenp, XF86ConfScreenPtr conf_screen,
int scrnum, MessageType from);
diff --git a/hw/xfree86/common/xf86Config.h b/hw/xfree86/common/xf86Config.h
index 7fc161d49..b8b5fd42a 100644
--- a/hw/xfree86/common/xf86Config.h
+++ b/hw/xfree86/common/xf86Config.h
@@ -54,17 +54,6 @@ typedef struct _ModuleDefault {
XF86OptionPtr load_opt;
} ModuleDefault;
-static ModuleDefault ModuleDefaults[] = {
- {.name = "extmod", .toLoad = TRUE, .load_opt=NULL},
- {.name = "dbe", .toLoad = TRUE, .load_opt=NULL},
- {.name = "glx", .toLoad = TRUE, .load_opt=NULL},
- {.name = "freetype", .toLoad = TRUE, .load_opt=NULL},
- {.name = "type1", .toLoad = TRUE, .load_opt=NULL},
- {.name = "record", .toLoad = TRUE, .load_opt=NULL},
- {.name = "dri", .toLoad = TRUE, .load_opt=NULL},
- {.name = NULL, .toLoad = FALSE, .load_opt=NULL}
-};
-
/*
* prototypes
*/
diff --git a/hw/xfree86/loader/xf86sym.c b/hw/xfree86/loader/xf86sym.c
index 8a2768d80..185eb800b 100644
--- a/hw/xfree86/loader/xf86sym.c
+++ b/hw/xfree86/loader/xf86sym.c
@@ -1203,6 +1203,7 @@ _X_HIDDEN void *xfree86LookupTab[] = {
SYMFUNC(xf86_show_cursors)
SYMFUNC(xf86_hide_cursors)
SYMFUNC(xf86_cursors_fini)
+ SYMFUNC(xf86_crtc_clip_video_helper)
SYMFUNC(xf86DoEDID_DDC1)
SYMFUNC(xf86DoEDID_DDC2)
diff --git a/hw/xfree86/modes/xf86Crtc.c b/hw/xfree86/modes/xf86Crtc.c
index 170c92176..08306bcd7 100644
--- a/hw/xfree86/modes/xf86Crtc.c
+++ b/hw/xfree86/modes/xf86Crtc.c
@@ -45,6 +45,8 @@
#include "picturestr.h"
#endif
+#include "xf86xv.h"
+
/*
* Initialize xf86CrtcConfig structure
*/
@@ -2144,3 +2146,119 @@ xf86ConnectorGetName(xf86ConnectorType connector)
{
return _xf86ConnectorNames[connector];
}
+
+static void
+x86_crtc_box_intersect(BoxPtr dest, BoxPtr a, BoxPtr b)
+{
+ dest->x1 = a->x1 > b->x1 ? a->x1 : b->x1;
+ dest->x2 = a->x2 < b->x2 ? a->x2 : b->x2;
+ dest->y1 = a->y1 > b->y1 ? a->y1 : b->y1;
+ dest->y2 = a->y2 < b->y2 ? a->y2 : b->y2;
+
+ if (dest->x1 >= dest->x2 || dest->y1 >= dest->y2)
+ dest->x1 = dest->x2 = dest->y1 = dest->y2 = 0;
+}
+
+static void
+x86_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
+{
+ if (crtc->enabled) {
+ crtc_box->x1 = crtc->x;
+ crtc_box->x2 = crtc->x + xf86ModeWidth(&crtc->mode, crtc->rotation);
+ crtc_box->y1 = crtc->y;
+ crtc_box->y2 = crtc->y + xf86ModeHeight(&crtc->mode, crtc->rotation);
+ } else
+ crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
+}
+
+static int
+xf86_crtc_box_area(BoxPtr box)
+{
+ return (int) (box->x2 - box->x1) * (int) (box->y2 - box->y1);
+}
+
+/*
+ * Return the crtc covering 'box'. If two crtcs cover a portion of
+ * 'box', then prefer 'desired'. If 'desired' is NULL, then prefer the crtc
+ * with greater coverage
+ */
+
+static xf86CrtcPtr
+xf86_covering_crtc(ScrnInfoPtr pScrn,
+ BoxPtr box,
+ xf86CrtcPtr desired,
+ BoxPtr crtc_box_ret)
+{
+ xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(pScrn);
+ xf86CrtcPtr crtc, best_crtc;
+ int coverage, best_coverage;
+ int c;
+ BoxRec crtc_box, cover_box;
+
+ best_crtc = NULL;
+ best_coverage = 0;
+ crtc_box_ret->x1 = 0;
+ crtc_box_ret->x2 = 0;
+ crtc_box_ret->y1 = 0;
+ crtc_box_ret->y2 = 0;
+ for (c = 0; c < xf86_config->num_crtc; c++) {
+ crtc = xf86_config->crtc[c];
+ x86_crtc_box(crtc, &crtc_box);
+ x86_crtc_box_intersect(&cover_box, &crtc_box, box);
+ coverage = xf86_crtc_box_area(&cover_box);
+ if (coverage && crtc == desired) {
+ *crtc_box_ret = crtc_box;
+ return crtc;
+ } else if (coverage > best_coverage) {
+ *crtc_box_ret = crtc_box;
+ best_crtc = crtc;
+ best_coverage = coverage;
+ }
+ }
+ return best_crtc;
+}
+
+/*
+ * For overlay video, compute the relevant CRTC and
+ * clip video to that
+ */
+
+Bool
+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+ xf86CrtcPtr *crtc_ret,
+ xf86CrtcPtr desired_crtc,
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height)
+{
+ Bool ret;
+ RegionRec crtc_region_local;
+ RegionPtr crtc_region = reg;
+
+ if (crtc_ret) {
+ BoxRec crtc_box;
+ xf86CrtcPtr crtc = xf86_covering_crtc(pScrn, dst,
+ desired_crtc,
+ &crtc_box);
+
+ if (crtc) {
+ REGION_INIT (pScreen, &crtc_region_local, &crtc_box, 1);
+ crtc_region = &crtc_region_local;
+ REGION_INTERSECT (pScreen, crtc_region, crtc_region, reg);
+ }
+ *crtc_ret = crtc;
+ }
+
+ ret = xf86XVClipVideoHelper(dst, xa, xb, ya, yb,
+ crtc_region, width, height);
+
+ if (crtc_region != reg)
+ REGION_UNINIT (pScreen, &crtc_region_local);
+
+ return ret;
+}
diff --git a/hw/xfree86/modes/xf86Crtc.h b/hw/xfree86/modes/xf86Crtc.h
index a4e8ea388..9693e12bb 100644
--- a/hw/xfree86/modes/xf86Crtc.h
+++ b/hw/xfree86/modes/xf86Crtc.h
@@ -765,5 +765,24 @@ xf86_hide_cursors (ScrnInfoPtr scrn);
*/
void
xf86_cursors_fini (ScreenPtr screen);
+
+/*
+ * For overlay video, compute the relevant CRTC and
+ * clip video to that.
+ * wraps xf86XVClipVideoHelper()
+ */
+
+Bool
+xf86_crtc_clip_video_helper(ScrnInfoPtr pScrn,
+ xf86CrtcPtr *crtc_ret,
+ xf86CrtcPtr desired_crtc,
+ BoxPtr dst,
+ INT32 *xa,
+ INT32 *xb,
+ INT32 *ya,
+ INT32 *yb,
+ RegionPtr reg,
+ INT32 width,
+ INT32 height);
#endif /* _XF86CRTC_H_ */
diff --git a/hw/xfree86/modes/xf86Cursors.c b/hw/xfree86/modes/xf86Cursors.c
index 396bf3091..92b90a9d4 100644
--- a/hw/xfree86/modes/xf86Cursors.c
+++ b/hw/xfree86/modes/xf86Cursors.c
@@ -447,7 +447,10 @@ xf86_use_hw_cursor (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ if (xf86_config->cursor)
+ FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;
+ ++cursor->refcnt;
if (cursor->bits->width > cursor_info->MaxWidth ||
cursor->bits->height> cursor_info->MaxHeight)
@@ -463,7 +466,10 @@ xf86_use_hw_cursor_argb (ScreenPtr screen, CursorPtr cursor)
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
xf86CursorInfoPtr cursor_info = xf86_config->cursor_info;
+ if (xf86_config->cursor)
+ FreeCursor (xf86_config->cursor, None);
xf86_config->cursor = cursor;
+ ++cursor->refcnt;
/* Make sure ARGB support is available */
if ((cursor_info->Flags & HARDWARE_CURSOR_ARGB) == 0)
@@ -632,4 +638,9 @@ xf86_cursors_fini (ScreenPtr screen)
xfree (xf86_config->cursor_image);
xf86_config->cursor_image = NULL;
}
+ if (xf86_config->cursor)
+ {
+ FreeCursor (xf86_config->cursor, None);
+ xf86_config->cursor = NULL;
+ }
}
diff --git a/hw/xfree86/modes/xf86RandR12.c b/hw/xfree86/modes/xf86RandR12.c
index 9d74e5377..ae0a2cebf 100644
--- a/hw/xfree86/modes/xf86RandR12.c
+++ b/hw/xfree86/modes/xf86RandR12.c
@@ -345,7 +345,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
randrp->virtualX = pScrn->virtualX;
randrp->virtualY = pScrn->virtualY;
}
- if (pRoot)
+ if (pRoot && pScrn->vtSema)
(*pScrn->EnableDisableFBAccess) (pScreen->myNum, FALSE);
/* Let the driver update virtualX and virtualY */
@@ -363,7 +363,7 @@ xf86RandR12ScreenSetSize (ScreenPtr pScreen,
xf86SetViewport (pScreen, 0, 0);
finish:
- if (pRoot)
+ if (pRoot && pScrn->vtSema)
(*pScrn->EnableDisableFBAccess) (pScreen->myNum, TRUE);
#if RANDR_12_INTERFACE
if (WindowTable[pScreen->myNum] && ret)
diff --git a/hw/xfree86/os-support/bsd/bsd_mouse.c b/hw/xfree86/os-support/bsd/bsd_mouse.c
index 21fe1ff18..ca2c1bbd5 100644
--- a/hw/xfree86/os-support/bsd/bsd_mouse.c
+++ b/hw/xfree86/os-support/bsd/bsd_mouse.c
@@ -83,7 +83,7 @@ static const char *mouseDevs[] = {
DEFAULT_PS2_DEV,
NULL
};
-#elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
/* Only wsmouse mices are autoconfigured for now on OpenBSD */
#define DEFAULT_WSMOUSE_DEV "/dev/wsmouse"
#define DEFAULT_WSMOUSE0_DEV "/dev/wsmouse0"
@@ -154,7 +154,7 @@ DefaultProtocol(void)
{
#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__DragonFly__)
return "Auto";
-#elif defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+#elif (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
return "WSMouse";
#else
return NULL;
@@ -340,7 +340,7 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
}
#endif
-#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+#if (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
/* Only support wsmouse configuration for now */
static const char *
@@ -381,7 +381,7 @@ FindDevice(InputInfoPtr pInfo, const char *protocol, int flags)
}
return *pdev;
}
-#endif /* __OpenBSD__ && WSCONS_SUPPORT */
+#endif /* __OpenBSD__ || __NetBSD__ && WSCONS_SUPPORT */
#ifdef WSCONS_SUPPORT
#define NUMEVENTS 64
@@ -779,11 +779,11 @@ xf86OSMouseInit(int flags)
p->SetBMRes = SetSysMouseRes;
p->SetMiscRes = SetSysMouseRes;
#endif
-#if defined(__OpenBSD__) && defined(WSCONS_SUPPORT)
+#if (defined(__OpenBSD__) || defined(__NetBSD__)) && defined(WSCONS_SUPPORT)
p->SetupAuto = SetupAuto;
p->SetMiscRes = SetMouseRes;
#endif
-#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__)
+#if defined(__FreeBSD__) || defined(__FreeBSD_kernel__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__NetBSD__)
p->FindDevice = FindDevice;
#endif
p->PreInit = bsdMousePreInit;
diff --git a/hw/xfree86/os-support/linux/Makefile.am b/hw/xfree86/os-support/linux/Makefile.am
index 10f24400f..5bb252be3 100644
--- a/hw/xfree86/os-support/linux/Makefile.am
+++ b/hw/xfree86/os-support/linux/Makefile.am
@@ -11,7 +11,7 @@ PLATFORM_PCI_SUPPORT = \
$(srcdir)/lnx_axp.c \
$(srcdir)/../shared/xf86Axp.c
-liblinuxev56_la_CFLAGS = -mcpu=ev56
+liblinuxev56_la_CFLAGS = $(AM_CFLAGS) -mcpu=ev56
liblinuxev56_la_SOURCES = lnx_ev56.c
endif
diff --git a/hw/xfree86/os-support/linux/lnx_video.c b/hw/xfree86/os-support/linux/lnx_video.c
index b3494a78e..ad2b66f74 100644
--- a/hw/xfree86/os-support/linux/lnx_video.c
+++ b/hw/xfree86/os-support/linux/lnx_video.c
@@ -411,7 +411,7 @@ xf86OSInitVidMem(VidMemInfoPtr pVidMem)
# ifndef JENSEN_SUPPORT
FatalError("Jensen is not supported any more\n"
"If you are intereseted in fixing Jensen support\n"
- "please contact xfree86@xfree86.org\n");
+ "please contact xorg@lists.freedesktop.org\n");
# else
xf86Msg(X_INFO,"Machine type is Jensen\n");
pVidMem->mapMem = mapVidMemJensen;
diff --git a/include/dix-config.h.in b/include/dix-config.h.in
index ad97605a5..69fab5e53 100644
--- a/include/dix-config.h.in
+++ b/include/dix-config.h.in
@@ -282,6 +282,9 @@
/* Support MIT-SCREEN-SAVER extension */
#undef SCREENSAVER
+/* Support Secure RPC ("SUN-DES-1") authentication for X11 clients */
+#undef SECURE_RPC
+
/* Use a lock to prevent multiple servers on a display */
#undef SERVER_LOCK
diff --git a/os/Makefile.am b/os/Makefile.am
index 53b2d7f0c..d2a989782 100644
--- a/os/Makefile.am
+++ b/os/Makefile.am
@@ -3,9 +3,9 @@ noinst_LTLIBRARIES = libos.la libcwrapper.la
AM_CFLAGS = $(DIX_CFLAGS)
# FIXME: Add support for these in configure.ac
-SECURERPC_SRCS = rpcauth.c
INTERNALMALLOC_SRCS = xalloc.c
+SECURERPC_SRCS = rpcauth.c
XCSECURITY_SRCS = secauth.c
XDMCP_SRCS = xdmcp.c
STRLCAT_SRCS = strlcat.c strlcpy.c
@@ -28,6 +28,10 @@ libos_la_SOURCES = \
xprintf.c \
$(XORG_SRCS)
+if SECURE_RPC
+libos_la_SOURCES += $(SECURERPC_SRCS)
+endif
+
if XCSECURITY
libos_la_SOURCES += $(XCSECURITY_SRCS)
endif
diff --git a/os/rpcauth.c b/os/rpcauth.c
index 603844aee..3451ac18b 100644
--- a/os/rpcauth.c
+++ b/os/rpcauth.c
@@ -39,7 +39,7 @@ from The Open Group.
#ifdef SECURE_RPC
#include <X11/X.h>
-#include "Xauth.h"
+#include <X11/Xauth.h>
#include "misc.h"
#include "os.h"
#include "dixstruct.h"
@@ -135,7 +135,7 @@ CheckNetName (
static char rpc_error[MAXNETNAMELEN+50];
-XID
+_X_HIDDEN XID
SecureRPCCheck (unsigned short data_length, char *data,
ClientPtr client, char **reason)
{
@@ -159,14 +159,14 @@ SecureRPCCheck (unsigned short data_length, char *data,
return (XID) ~0L;
}
-void
+_X_HIDDEN void
SecureRPCInit (void)
{
if (rpc_id == ~0L)
AddAuthorization (9, "SUN-DES-1", 0, (char *) 0);
}
-int
+_X_HIDDEN int
SecureRPCAdd (unsigned short data_length, char *data, XID id)
{
if (data_length)
@@ -175,26 +175,26 @@ SecureRPCAdd (unsigned short data_length, char *data, XID id)
return 1;
}
-int
+_X_HIDDEN int
SecureRPCReset (void)
{
rpc_id = (XID) ~0L;
return 1;
}
-XID
+_X_HIDDEN XID
SecureRPCToID (unsigned short data_length, char *data)
{
return rpc_id;
}
-int
+_X_HIDDEN int
SecureRPCFromID (XID id, unsigned short *data_lenp, char **datap)
{
return 0;
}
-int
+_X_HIDDEN int
SecureRPCRemove (unsigned short data_length, char *data)
{
return 0;