Update to X server 1.20.6. Tested by naddy@

This commit is contained in:
matthieu 2019-12-12 06:05:17 +00:00
parent 529ec772d8
commit 9a532c5475
57 changed files with 2339 additions and 977 deletions

File diff suppressed because it is too large Load Diff

View File

@ -1105,6 +1105,10 @@ PanoramiXCopyArea(ClientPtr client)
DixGetAttrAccess);
if (rc != Success)
return rc;
drawables[j]->pScreen->SourceValidate(drawables[j], 0, 0,
drawables[j]->width,
drawables[j]->height,
IncludeInferiors);
}
pitch = PixmapBytePad(width, drawables[0]->depth);
@ -2007,6 +2011,12 @@ PanoramiXGetImage(ClientPtr client)
if (rc != Success)
return rc;
}
FOR_NSCREENS_FORWARD(i) {
drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
drawables[i]->width,
drawables[i]->height,
IncludeInferiors);
}
xgi = (xGetImageReply) {
.type = X_Reply,

View File

@ -35,6 +35,9 @@ in this Software without prior written authorization from The Open Group.
#include <sys/types.h>
#include <sys/ipc.h>
#include <sys/shm.h>
#ifdef HAVE_MEMFD_CREATE
#include <sys/mman.h>
#endif
#include <unistd.h>
#include <sys/stat.h>
#include <fcntl.h>
@ -652,6 +655,9 @@ ProcShmGetImage(ClientPtr client)
visual = wVisual(((WindowPtr) pDraw));
if (pDraw->type == DRAWABLE_WINDOW)
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
pDraw->pScreen->SourceValidate(pDraw, stuff->x, stuff->y,
stuff->width, stuff->height,
IncludeInferiors);
}
else {
if (stuff->x < 0 ||
@ -860,6 +866,12 @@ ProcPanoramiXShmGetImage(ClientPtr client)
return rc;
}
}
FOR_NSCREENS_FORWARD(i) {
drawables[i]->pScreen->SourceValidate(drawables[i], 0, 0,
drawables[i]->width,
drawables[i]->height,
IncludeInferiors);
}
xgi = (xShmGetImageReply) {
.type = X_Reply,
@ -1194,36 +1206,55 @@ ProcShmAttachFd(ClientPtr client)
static int
shm_tmpfile(void)
{
#ifdef SHMDIR
int fd;
char template[] = SHMDIR "/shmfd-XXXXXX";
const char *shmdirs[] = {
"/run/shm",
"/var/tmp",
"/tmp",
};
int fd;
#ifdef HAVE_MEMFD_CREATE
fd = memfd_create("xorg", MFD_CLOEXEC|MFD_ALLOW_SEALING);
if (fd != -1) {
fcntl(fd, F_ADD_SEALS, F_SEAL_SHRINK);
DebugF ("Using memfd_create\n");
return fd;
}
#endif
#ifdef O_TMPFILE
fd = open(SHMDIR, O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
if (fd >= 0) {
DebugF ("Using O_TMPFILE\n");
return fd;
}
ErrorF ("Not using O_TMPFILE\n");
for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
fd = open(shmdirs[i], O_TMPFILE|O_RDWR|O_CLOEXEC|O_EXCL, 0666);
if (fd >= 0) {
DebugF ("Using O_TMPFILE\n");
return fd;
}
}
ErrorF ("Not using O_TMPFILE\n");
#endif
for (int i = 0; i < ARRAY_SIZE(shmdirs); i++) {
char template[PATH_MAX];
snprintf(template, ARRAY_SIZE(template), "%s/shmfd-XXXXXXXXXX", shmdirs[i]);
#ifdef HAVE_MKOSTEMP
fd = mkostemp(template, O_CLOEXEC);
fd = mkostemp(template, O_CLOEXEC);
#else
fd = mkstemp(template);
fd = mkstemp(template);
#endif
if (fd < 0)
return -1;
unlink(template);
if (fd < 0)
continue;
unlink(template);
#ifndef HAVE_MKOSTEMP
int flags = fcntl(fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
(void) fcntl(fd, F_SETFD, &flags);
}
#endif
return fd;
#else
return -1;
int flags = fcntl(fd, F_GETFD);
if (flags != -1) {
flags |= FD_CLOEXEC;
(void) fcntl(fd, F_SETFD, &flags);
}
#endif
return fd;
}
return -1;
}
static int

View File

@ -125,8 +125,7 @@ ClientSleepUntil(ClientPtr client,
static void
ClientAwaken(ClientPtr client, void *closure)
{
if (!client->clientGone)
AttendClient(client);
AttendClient(client);
}
static int

View File

@ -881,18 +881,21 @@ SyncChangeAlarmAttributes(ClientPtr client, SyncAlarm * pAlarm, Mask mask,
return Success;
}
static SyncObject *
SyncObject *
SyncCreate(ClientPtr client, XID id, unsigned char type)
{
SyncObject *pSync;
RESTYPE resType;
switch (type) {
case SYNC_COUNTER:
pSync = malloc(sizeof(SyncCounter));
resType = RTCounter;
break;
case SYNC_FENCE:
pSync = (SyncObject *) dixAllocateObjectWithPrivates(SyncFence,
PRIVATE_SYNC_FENCE);
resType = RTFence;
break;
default:
return NULL;
@ -901,6 +904,11 @@ SyncCreate(ClientPtr client, XID id, unsigned char type)
if (!pSync)
return NULL;
pSync->initialized = FALSE;
if (!AddResource(id, resType, (void *) pSync))
return NULL;
pSync->client = client;
pSync->id = id;
pSync->pTriglist = NULL;
@ -923,13 +931,10 @@ SyncCreateFenceFromFD(ClientPtr client, DrawablePtr pDraw, XID id, int fd, BOOL
status = miSyncInitFenceFromFD(pDraw, pFence, fd, initially_triggered);
if (status != Success) {
dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
FreeResource(pFence->sync.id, RT_NONE);
return status;
}
if (!AddResource(id, RTFence, (void *) pFence))
return BadAlloc;
return Success;
#else
return BadImplementation;
@ -957,8 +962,7 @@ SyncCreateCounter(ClientPtr client, XSyncCounter id, int64_t initialvalue)
pCounter->value = initialvalue;
pCounter->pSysCounterInfo = NULL;
if (!AddResource(id, RTCounter, (void *) pCounter))
return NULL;
pCounter->sync.initialized = TRUE;
return pCounter;
}
@ -1137,21 +1141,26 @@ static int
FreeCounter(void *env, XID id)
{
SyncCounter *pCounter = (SyncCounter *) env;
SyncTriggerList *ptl, *pnext;
pCounter->sync.beingDestroyed = TRUE;
/* tell all the counter's triggers that the counter has been destroyed */
for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
pnext = ptl->next;
free(ptl); /* destroy the trigger list as we go */
}
if (IsSystemCounter(pCounter)) {
xorg_list_del(&pCounter->pSysCounterInfo->entry);
free(pCounter->pSysCounterInfo->name);
free(pCounter->pSysCounterInfo->private);
free(pCounter->pSysCounterInfo);
if (pCounter->sync.initialized) {
SyncTriggerList *ptl, *pnext;
/* tell all the counter's triggers that counter has been destroyed */
for (ptl = pCounter->sync.pTriglist; ptl; ptl = pnext) {
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
pnext = ptl->next;
free(ptl); /* destroy the trigger list as we go */
}
if (IsSystemCounter(pCounter)) {
xorg_list_del(&pCounter->pSysCounterInfo->entry);
free(pCounter->pSysCounterInfo->name);
free(pCounter->pSysCounterInfo->private);
free(pCounter->pSysCounterInfo);
}
}
free(pCounter);
return Success;
}
@ -1889,9 +1898,6 @@ ProcSyncCreateFence(ClientPtr client)
miSyncInitFence(pDraw->pScreen, pFence, stuff->initially_triggered);
if (!AddResource(stuff->fid, RTFence, (void *) pFence))
return BadAlloc;
return Success;
}

View File

@ -29,6 +29,9 @@
extern _X_EXPORT int
SyncVerifyFence(SyncFence ** ppFence, XID fid, ClientPtr client, Mask mode);
extern _X_EXPORT SyncObject*
SyncCreate(ClientPtr client, XID id, unsigned char type);
#define VERIFY_SYNC_FENCE(pFence, fid, client, mode) \
do { \
int rc; \

View File

@ -1293,14 +1293,21 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
int rc;
InputClients *iclients = NULL;
*mask = NULL;
*grab = NULL;
if (listener->type == LISTENER_GRAB ||
listener->type == LISTENER_POINTER_GRAB) {
*grab = listener->grab;
BUG_RETURN_VAL(!*grab, FALSE);
}
else if (ti->emulate_pointer && dev->deviceGrab.grab &&
!dev->deviceGrab.fromPassiveGrab) {
/* There may be an active pointer grab on the device */
*grab = dev->deviceGrab.grab;
}
if (*grab) {
*client = rClient(*grab);
*win = (*grab)->window;
*mask = (*grab)->xi2mask;
@ -1357,8 +1364,6 @@ RetrieveTouchDeliveryData(DeviceIntPtr dev, TouchPointInfoPtr ti,
/* if owner selected, oclients is NULL */
*client = oclients ? rClient(oclients) : wClient(*win);
}
*grab = NULL;
}
return TRUE;
@ -1498,16 +1503,6 @@ DeliverEmulatedMotionEvent(DeviceIntPtr dev, TouchPointInfoPtr ti,
&mask))
return;
/* There may be a pointer grab on the device */
if (!grab) {
grab = dev->deviceGrab.grab;
if (grab) {
win = grab->window;
mask = grab->xi2mask;
client = rClient(grab);
}
}
DeliverTouchEmulatedEvent(dev, ti, (InternalEvent*)&motion, &ti->listeners[0], client,
win, grab, mask);
}

92
xserver/configure vendored
View File

@ -1,6 +1,6 @@
#! /bin/sh
# Guess values for system-dependent variables and create Makefiles.
# Generated by GNU Autoconf 2.69 for xorg-server 1.20.5.
# Generated by GNU Autoconf 2.69 for xorg-server 1.20.6.
#
# Report bugs to <https://gitlab.freedesktop.org/xorg/xserver/issues>.
#
@ -651,8 +651,8 @@ MAKEFLAGS=
# Identity of this package.
PACKAGE_NAME='xorg-server'
PACKAGE_TARNAME='xorg-server'
PACKAGE_VERSION='1.20.5'
PACKAGE_STRING='xorg-server 1.20.5'
PACKAGE_VERSION='1.20.6'
PACKAGE_STRING='xorg-server 1.20.6'
PACKAGE_BUGREPORT='https://gitlab.freedesktop.org/xorg/xserver/issues'
PACKAGE_URL=''
@ -1397,7 +1397,6 @@ enable_local_transport
enable_secure_rpc
enable_input_thread
with_systemd_daemon
with_shared_memory_dir
enable_xtrans_send_fds
with_xkb_bin_directory
with_sha1
@ -2046,7 +2045,7 @@ if test "$ac_init_help" = "long"; then
# Omit some internal or obsolete options to make the list less imposing.
# This message is too long to be a string in the A/UX 3.1 sh.
cat <<_ACEOF
\`configure' configures xorg-server 1.20.5 to adapt to many kinds of systems.
\`configure' configures xorg-server 1.20.6 to adapt to many kinds of systems.
Usage: $0 [OPTION]... [VAR=VALUE]...
@ -2116,7 +2115,7 @@ fi
if test -n "$ac_init_help"; then
case $ac_init_help in
short | recursive ) echo "Configuration of xorg-server 1.20.5:";;
short | recursive ) echo "Configuration of xorg-server 1.20.6:";;
esac
cat <<\_ACEOF
@ -2311,10 +2310,10 @@ Optional Packages:
org.x)
--with-bundle-version=VERSION
Version to use for X11.app's CFBundleVersion
(default: 1.20.5)
(default: 1.20.6)
--with-bundle-version-string=VERSION
Version to use for X11.app's
CFBundleShortVersionString (default: 1.20.5)
CFBundleShortVersionString (default: 1.20.6)
--with-sparkle-feed-url=URL
URL for the Sparkle feed (default:
https://www.xquartz.org/releases/sparkle/release.xml)
@ -2322,10 +2321,6 @@ Optional Packages:
Path to Khronos OpenGL registry database files
(default: auto)
--with-systemd-daemon support systemd socket activation (default: auto)
--with-shared-memory-dir=PATH
Path to directory in a world-writable temporary
directory for anonymous shared memory (default:
auto)
--with-xkb-bin-directory=DIR
Directory containing xkbcomp program (default: auto)
--with-sha1=libc|libmd|libnettle|libgcrypt|libcrypto|libsha1|CommonCrypto|CryptoAPI
@ -2573,7 +2568,7 @@ fi
test -n "$ac_init_help" && exit $ac_status
if $ac_init_version; then
cat <<\_ACEOF
xorg-server configure 1.20.5
xorg-server configure 1.20.6
generated by GNU Autoconf 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
@ -3282,7 +3277,7 @@ cat >config.log <<_ACEOF
This file contains any messages produced by compilers while
running configure, to aid debugging if configure makes a mistake.
It was created by xorg-server $as_me 1.20.5, which was
It was created by xorg-server $as_me 1.20.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
$ $0 $@
@ -3630,8 +3625,8 @@ ac_link='$CC -o conftest$ac_exeext $CFLAGS $CPPFLAGS $LDFLAGS conftest.$ac_ext $
ac_compiler_gnu=$ac_cv_c_compiler_gnu
RELEASE_DATE="2019-05-30"
RELEASE_NAME="Red Lentil Dal"
RELEASE_DATE="2019-11-22"
RELEASE_NAME="Enchiladas de Queso"
am__api_version='1.12'
@ -4110,7 +4105,7 @@ fi
# Define the identity of the package.
PACKAGE='xorg-server'
VERSION='1.20.5'
VERSION='1.20.6'
cat >>confdefs.h <<_ACEOF
@ -21936,7 +21931,7 @@ fi
for ac_func in backtrace geteuid getuid issetugid getresuid \
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
walkcontext setitimer poll epoll_create1 mkostemp
walkcontext setitimer poll epoll_create1 mkostemp memfd_create isastream
do :
as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
@ -23039,7 +23034,7 @@ _ACEOF
if test "${with_bundle_version+set}" = set; then :
withval=$with_bundle_version; BUNDLE_VERSION="${withval}"
else
BUNDLE_VERSION="1.20.5"
BUNDLE_VERSION="1.20.6"
fi
@ -24130,7 +24125,7 @@ LIBDRI="dri >= 7.8.0"
LIBDRM="libdrm >= 2.4.89"
LIBEGL="egl"
LIBGBM="gbm >= 10.2.0"
LIBGL="gl >= 7.1.0"
LIBGL="gl >= 1.2"
LIBXEXT="xext >= 1.0.99.4"
LIBXFONT="xfont2 >= 2.0.0"
LIBXI="xi >= 1.2.99.1"
@ -25855,7 +25850,7 @@ case "$DRI2,$HAVE_DRI2PROTO" in
$as_echo "#define DRI2 1" >>confdefs.h
DRI2=yes
LIBGL="gl >= 9.2.0"
LIBGL="gl >= 1.2"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
;;
esac
@ -25868,55 +25863,6 @@ else
fi
# Check whether --with-shared-memory-dir was given.
if test "${with_shared_memory_dir+set}" = set; then :
withval=$with_shared_memory_dir;
else
with_shared_memory_dir=yes
fi
shmdirs="/run/shm /var/tmp /tmp"
case x"$with_shared_memory_dir" in
xyes)
for dir in $shmdirs; do
case x"$with_shared_memory_dir" in
xyes)
echo Checking temp dir "$dir"
if test -d "$dir"; then
with_shared_memory_dir="$dir"
fi
;;
esac
done
;;
x/*)
;;
xno)
;;
*)
as_fn_error $? "Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir" "$LINENO" 5
;;
esac
case x"$with_shared_memory_dir" in
xyes)
as_fn_error $? "No directory found for shared memory temp files." "$LINENO" 5
;;
xno)
;;
*)
cat >>confdefs.h <<_ACEOF
#define SHMDIR "$with_shared_memory_dir"
_ACEOF
;;
esac
# Check whether --enable-xtrans-send-fds was given.
if test "${enable_xtrans_send_fds+set}" = set; then :
enableval=$enable_xtrans_send_fds; XTRANS_SEND_FDS=$enableval
@ -26223,7 +26169,7 @@ else
fi
if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes || test "x$XORG" = xyes; then
if test "x$DRM" = xyes; then
$as_echo "#define WITH_LIBDRM 1" >>confdefs.h
@ -33004,7 +32950,7 @@ cat >>$CONFIG_STATUS <<\_ACEOF || ac_write_fail=1
# report actual input values of CONFIG_FILES etc. instead of their
# values after options handling.
ac_log="
This file was extended by xorg-server $as_me 1.20.5, which was
This file was extended by xorg-server $as_me 1.20.6, which was
generated by GNU Autoconf 2.69. Invocation command line was
CONFIG_FILES = $CONFIG_FILES
@ -33070,7 +33016,7 @@ _ACEOF
cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
ac_cs_config="`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`"
ac_cs_version="\\
xorg-server config.status 1.20.5
xorg-server config.status 1.20.6
configured by $0, generated by GNU Autoconf 2.69,
with options \\"\$ac_cs_config\\"

View File

@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
AC_INIT([xorg-server], 1.20.5, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
RELEASE_DATE="2019-05-30"
RELEASE_NAME="Red Lentil Dal"
AC_INIT([xorg-server], 1.20.6, [https://gitlab.freedesktop.org/xorg/xserver/issues], xorg-server)
RELEASE_DATE="2019-11-22"
RELEASE_NAME="Enchiladas de Queso"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@ -159,7 +159,7 @@ dnl Checks for library functions.
AC_CHECK_FUNCS([backtrace geteuid getuid issetugid getresuid \
getdtablesize getifaddrs getpeereid getpeerucred getprogname getzoneid \
mmap posix_fallocate seteuid shmctl64 strncasecmp vasprintf vsnprintf \
walkcontext setitimer poll epoll_create1 mkostemp])
walkcontext setitimer poll epoll_create1 mkostemp memfd_create isastream])
AC_CONFIG_LIBOBJ_DIR([os])
AC_REPLACE_FUNCS([reallocarray strcasecmp strcasestr strlcat strlcpy strndup\
timingsafe_memcmp])
@ -802,7 +802,7 @@ LIBDRI="dri >= 7.8.0"
LIBDRM="libdrm >= 2.4.89"
LIBEGL="egl"
LIBGBM="gbm >= 10.2.0"
LIBGL="gl >= 7.1.0"
LIBGL="gl >= 1.2"
LIBXEXT="xext >= 1.0.99.4"
LIBXFONT="xfont2 >= 2.0.0"
LIBXI="xi >= 1.2.99.1"
@ -1157,55 +1157,12 @@ case "$DRI2,$HAVE_DRI2PROTO" in
yes,yes | auto,yes)
AC_DEFINE(DRI2, 1, [Build DRI2 extension])
DRI2=yes
LIBGL="gl >= 9.2.0"
LIBGL="gl >= 1.2"
SDK_REQUIRED_MODULES="$SDK_REQUIRED_MODULES $DRI2PROTO"
;;
esac
AM_CONDITIONAL(DRI2, test "x$DRI2" = xyes)
dnl
dnl Locate a suitable tmp file system for creating shared memeory files
dnl
AC_ARG_WITH(shared-memory-dir, AS_HELP_STRING([--with-shared-memory-dir=PATH], [Path to directory in a world-writable temporary directory for anonymous shared memory (default: auto)]),
[],
[with_shared_memory_dir=yes])
shmdirs="/run/shm /var/tmp /tmp"
case x"$with_shared_memory_dir" in
xyes)
for dir in $shmdirs; do
case x"$with_shared_memory_dir" in
xyes)
echo Checking temp dir "$dir"
if test -d "$dir"; then
with_shared_memory_dir="$dir"
fi
;;
esac
done
;;
x/*)
;;
xno)
;;
*)
AC_MSG_ERROR([Invalid directory specified for --with-shared-memory-dir: $with_shared_memory_dir])
;;
esac
case x"$with_shared_memory_dir" in
xyes)
AC_MSG_ERROR([No directory found for shared memory temp files.])
;;
xno)
;;
*)
AC_DEFINE_UNQUOTED(SHMDIR, ["$with_shared_memory_dir"], [Directory for shared memory temp files])
;;
esac
AC_ARG_ENABLE(xtrans-send-fds, AS_HELP_STRING([--disable-xtrans-send-fds], [Use Xtrans support for fd passing (default: auto)]), [XTRANS_SEND_FDS=$enableval], [XTRANS_SEND_FDS=auto])
case "x$XTRANS_SEND_FDS" in
@ -1322,7 +1279,7 @@ esac
AM_CONDITIONAL(DRI3, test "x$DRI3" = xyes)
if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes; then
if test "x$DRI" = xyes || test "x$DRI2" = xyes || test "x$DRI3" = xyes || test "x$CONFIG_UDEV_KMS" = xyes || test "x$XORG" = xyes; then
if test "x$DRM" = xyes; then
AC_DEFINE(WITH_LIBDRM, 1, [Building with libdrm support])
PKG_CHECK_MODULES([LIBDRM], $LIBDRM)

View File

@ -2196,8 +2196,11 @@ DoGetImage(ClientPtr client, int format, Drawable drawable,
return BadAlloc;
WriteReplyToClient(client, sizeof(xGetImageReply), &xgi);
if (pDraw->type == DRAWABLE_WINDOW)
if (pDraw->type == DRAWABLE_WINDOW) {
pVisibleRegion = &((WindowPtr) pDraw)->borderClip;
pDraw->pScreen->SourceValidate(pDraw, x, y, width, height,
IncludeInferiors);
}
if (linesPerBuf == 0) {
/* nothing to do */

View File

@ -662,14 +662,7 @@ ClientWakeup(ClientPtr client)
if (q->client == client) {
*prev = q->next;
free(q);
if (client->clientGone)
/* Oops -- new zombie cleanup code ensures this only
* happens from inside CloseDownClient; don't want to
* recurse here...
*/
/* CloseDownClient(client) */ ;
else
AttendClient(client);
AttendClient(client);
break;
}
prev = &q->next;

View File

@ -597,6 +597,8 @@ XineramaConfineCursorToWindow(DeviceIntPtr pDev,
int x, y, off_x, off_y, i;
assert(!noPanoramiXExtension);
if (!XineramaSetWindowPntrs(pDev, pWin))
return;

View File

@ -32,6 +32,7 @@ from The Open Group.
#include <X11/X.h>
#include "scrnintstr.h"
#include "mi.h"
#include "misc.h"
#include "os.h"
#include "windowstr.h"
@ -395,7 +396,7 @@ Bool PixmapSyncDirtyHelper(PixmapDirtyUpdatePtr dirty)
* leaves the software cursor in place
*/
SourceValidate = pScreen->SourceValidate;
pScreen->SourceValidate = NULL;
pScreen->SourceValidate = miSourceValidate;
RegionTranslate(&pixregion, dirty->x, dirty->y);
RegionIntersect(&pixregion, &pixregion, region);

View File

@ -2930,8 +2930,8 @@ The sample server implementation is in Xserver/fb/fbscreen.c.</para>
unsigned int subWindowMode;
</programlisting></blockquote>
SourceValidate should be called by CopyArea/CopyPlane primitives when
the SourceValidate function pointer in the screen is non-null. If you know that
SourceValidate should be called by any primitive that reads from pDrawable.
If you know that
you will never need SourceValidate, you can avoid this check. Currently,
SourceValidate is used by the mi software cursor code to remove the cursor
from the screen when the source rectangle overlaps the cursor position.

View File

@ -355,8 +355,8 @@ glamor_make_pixmap_exportable(PixmapPtr pixmap, Bool modifiers_ok)
return TRUE;
}
struct gbm_bo *
glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
static struct gbm_bo *
glamor_gbm_bo_from_pixmap_internal(ScreenPtr screen, PixmapPtr pixmap)
{
struct glamor_egl_screen_private *glamor_egl =
glamor_egl_get_screen_private(xf86ScreenToScrn(screen));
@ -370,6 +370,15 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
pixmap_priv->image, 0);
}
struct gbm_bo *
glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapPtr pixmap)
{
if (!glamor_make_pixmap_exportable(pixmap, TRUE))
return NULL;
return glamor_gbm_bo_from_pixmap_internal(screen, pixmap);
}
int
glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
uint32_t *strides, uint32_t *offsets,
@ -385,7 +394,7 @@ glamor_egl_fds_from_pixmap(ScreenPtr screen, PixmapPtr pixmap, int *fds,
if (!glamor_make_pixmap_exportable(pixmap, TRUE))
return 0;
bo = glamor_gbm_bo_from_pixmap(screen, pixmap);
bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap);
if (!bo)
return 0;
@ -423,7 +432,7 @@ glamor_egl_fd_from_pixmap(ScreenPtr screen, PixmapPtr pixmap,
if (!glamor_make_pixmap_exportable(pixmap, FALSE))
return -1;
bo = glamor_gbm_bo_from_pixmap(screen, pixmap);
bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap);
if (!bo)
return -1;
@ -452,7 +461,7 @@ glamor_egl_fd_name_from_pixmap(ScreenPtr screen,
if (!glamor_make_pixmap_exportable(pixmap, FALSE))
goto failure;
bo = glamor_gbm_bo_from_pixmap(screen, pixmap);
bo = glamor_gbm_bo_from_pixmap_internal(screen, pixmap);
if (!bo)
goto failure;

View File

@ -28,6 +28,7 @@
#define GLAMOR_EGL_H
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <epoxy/gl.h>
#include <epoxy/egl.h>
#include <glamor_egl_ext.h>

View File

@ -40,6 +40,7 @@
#include <epoxy/gl.h>
#ifdef GLAMOR_HAS_GBM
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <epoxy/egl.h>
#endif

View File

@ -574,10 +574,8 @@ xorgGlxMakeCurrent(ClientPtr client, GLXContextTag tag, XID drawId, XID readId,
/* Look up old context. If we have one, it must be in a usable state. */
if (tag != 0) {
prevglxc = glxServer.getContextTagPrivate(client, tag);
if (!prevglxc)
return __glXError(GLXBadContextTag);
if (prevglxc->renderMode != GL_RENDER) {
if (prevglxc && prevglxc->renderMode != GL_RENDER) {
/* Oops. Not in render mode render. */
client->errorValue = prevglxc->id;
return __glXError(GLXBadContextState);

View File

@ -324,6 +324,7 @@ swrastGetImage(__DRIdrawable * draw,
ScreenPtr pScreen = pDraw->pScreen;
__GLXcontext *cx = lastGLContext;
pScreen->SourceValidate(pDraw, x, y, w, h, IncludeInferiors);
pScreen->GetImage(pDraw, x, y, w, h, ZPixmap, ~0L, data);
if (cx != lastGLContext) {
lastGLContext = cx;

View File

@ -468,15 +468,24 @@ void GlxDispatchReset(void)
int GlxDispatchRequest(ClientPtr client)
{
REQUEST(xReq);
int result;
if (GlxExtensionEntry->base == 0)
return BadRequest;
GlxSetRequestClient(client);
if (stuff->data < OPCODE_ARRAY_LEN) {
if (dispatchFuncs[stuff->data] == NULL) {
// Try to find a dispatch stub.
dispatchFuncs[stuff->data] = GetVendorDispatchFunc(stuff->data, 0);
}
return dispatchFuncs[stuff->data](client);
result = dispatchFuncs[stuff->data](client);
} else {
return dispatch_GLXSingle(client);
result = dispatch_GLXSingle(client);
}
GlxSetRequestClient(NULL);
return result;
}

View File

@ -139,8 +139,17 @@ GlxGetClientData(ClientPtr client)
{
GlxClientPriv *cl = xglvGetClientPrivate(client);
if (cl == NULL) {
cl = calloc(1, sizeof(GlxClientPriv));
cl = calloc(1, sizeof(GlxClientPriv)
+ screenInfo.numScreens * sizeof(GlxServerVendor *));
if (cl != NULL) {
int i;
cl->vendors = (GlxServerVendor **) (cl + 1);
for (i=0; i<screenInfo.numScreens; i++)
{
cl->vendors[i] = GlxGetVendorForScreen(NULL, screenInfo.screens[i]);
}
xglvSetClientPrivate(client, cl);
}
}
@ -295,8 +304,8 @@ GlxFreeServerImports(GlxServerImports *imports)
}
_X_EXPORT const GlxServerExports glxServer = {
.majorVersion = 0,
.minorVersion = 0,
.majorVersion = GLXSERVER_VENDOR_ABI_MAJOR_VERSION,
.minorVersion = GLXSERVER_VENDOR_ABI_MINOR_VERSION,
.extensionInitCallback = &vndInitCallbackListPtr,
@ -315,6 +324,7 @@ _X_EXPORT const GlxServerExports glxServer = {
.getContextTagPrivate = GlxGetContextTagPrivate,
.getVendorForScreen = GlxGetVendorForScreen,
.forwardRequest = GlxForwardRequest,
.setClientScreenVendor = GlxSetClientScreenVendor,
};
const GlxServerExports *

View File

@ -57,6 +57,11 @@ typedef struct GlxContextTagInfoRec {
typedef struct GlxClientPrivRec {
GlxContextTagInfo *contextTags;
unsigned int contextTagCount;
/**
* The vendor handles for each screen.
*/
GlxServerVendor **vendors;
} GlxClientPriv;
extern int GlxErrorBase;
@ -90,11 +95,19 @@ Bool GlxAddXIDMap(XID id, GlxServerVendor *vendor);
GlxServerVendor * GlxGetXIDMap(XID id);
void GlxRemoveXIDMap(XID id);
/**
* Records the client that sent the current request. This is needed in
* GlxGetXIDMap to know which client's (screen -> vendor) mapping to use for a
* regular X window.
*/
void GlxSetRequestClient(ClientPtr client);
GlxContextTagInfo *GlxAllocContextTag(ClientPtr client, GlxServerVendor *vendor);
GlxContextTagInfo *GlxLookupContextTag(ClientPtr client, GLXContextTag tag);
void GlxFreeContextTag(GlxContextTagInfo *tagInfo);
Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor);
Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
GlxScreenPriv *GlxGetScreen(ScreenPtr pScreen);
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen);

View File

@ -33,6 +33,13 @@
#include "vndservervendor.h"
static ClientPtr requestClient = NULL;
void GlxSetRequestClient(ClientPtr client)
{
requestClient = client;
}
static GlxServerVendor *LookupXIDMapResource(XID id)
{
void *ptr = NULL;
@ -59,10 +66,7 @@ GlxServerVendor *GlxGetXIDMap(XID id)
DixGetAttrAccess);
if (rv == Success && ptr != NULL) {
DrawablePtr draw = (DrawablePtr) ptr;
GlxScreenPriv *screenPriv = GlxGetScreen(draw->pScreen);
if (screenPriv != NULL) {
vendor = screenPriv->vendor;
}
vendor = GlxGetVendorForScreen(requestClient, draw->pScreen);
}
}
return vendor;
@ -185,12 +189,44 @@ Bool GlxSetScreenVendor(ScreenPtr screen, GlxServerVendor *vendor)
return TRUE;
}
Bool GlxSetClientScreenVendor(ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor)
{
GlxClientPriv *cl;
if (screen == NULL || screen->isGPU) {
return FALSE;
}
cl = GlxGetClientData(client);
if (cl == NULL) {
return FALSE;
}
if (vendor != NULL) {
cl->vendors[screen->myNum] = vendor;
} else {
cl->vendors[screen->myNum] = GlxGetVendorForScreen(NULL, screen);
}
return TRUE;
}
GlxServerVendor *GlxGetVendorForScreen(ClientPtr client, ScreenPtr screen)
{
GlxScreenPriv *priv = GlxGetScreen(screen);
if (priv != NULL) {
return priv->vendor;
// Note that the client won't be sending GPU screen numbers, so we don't
// need per-client mappings for them.
if (client != NULL && !screen->isGPU) {
GlxClientPriv *cl = GlxGetClientData(client);
if (cl != NULL) {
return cl->vendors[screen->myNum];
} else {
return NULL;
}
} else {
return NULL;
GlxScreenPriv *priv = GlxGetScreen(screen);
if (priv != NULL) {
return priv->vendor;
} else {
return NULL;
}
}
}

View File

@ -758,36 +758,6 @@ inl(unsigned short port)
return xf86ReadMmio32Le((void *) ioBase, port);
}
#elif defined(__arm__) && defined(__linux__)
/* for Linux on ARM, we use the LIBC inx/outx routines */
/* note that the appropriate setup via "ioperm" needs to be done */
/* *before* any inx/outx is done. */
#include <sys/io.h>
static __inline__ void
xf_outb(unsigned short port, unsigned char val)
{
outb(val, port);
}
static __inline__ void
xf_outw(unsigned short port, unsigned short val)
{
outw(val, port);
}
static __inline__ void
xf_outl(unsigned short port, unsigned int val)
{
outl(val, port);
}
#define outb xf_outb
#define outw xf_outw
#define outl xf_outl
#elif defined(__nds32__)
/*

View File

@ -686,36 +686,6 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
if (!dixRegisterPrivateKey(&xf86ScreenKeyRec, PRIVATE_SCREEN, 0))
FatalError("Cannot register DDX private keys");
for (i = 0; i < xf86NumGPUScreens; i++) {
ScrnInfoPtr pScrn = xf86GPUScreens[i];
xf86VGAarbiterLock(pScrn);
/*
* Almost everything uses these defaults, and many of those that
* don't, will wrap them.
*/
pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
#ifdef XFreeXDGA
pScrn->SetDGAMode = xf86SetDGAMode;
#endif
pScrn->DPMSSet = NULL;
pScrn->LoadPalette = NULL;
pScrn->SetOverscan = NULL;
pScrn->DriverFunc = NULL;
pScrn->pScreen = NULL;
scr_index = AddGPUScreen(xf86ScreenInit, argc, argv);
xf86VGAarbiterUnlock(pScrn);
if (scr_index == i) {
dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates,
xf86ScreenKey, xf86GPUScreens[i]);
pScrn->pScreen = screenInfo.gpuscreens[scr_index];
/* The driver should set this, but make sure it is set anyway */
pScrn->vtSema = TRUE;
} else {
FatalError("AddScreen/ScreenInit failed for gpu driver %d %d\n", i, scr_index);
}
}
for (i = 0; i < xf86NumScreens; i++) {
xf86VGAarbiterLock(xf86Screens[i]);
/*
@ -771,6 +741,36 @@ InitOutput(ScreenInfo * pScreenInfo, int argc, char **argv)
xf86EnsureRANDR(xf86Screens[i]->pScreen);
}
for (i = 0; i < xf86NumGPUScreens; i++) {
ScrnInfoPtr pScrn = xf86GPUScreens[i];
xf86VGAarbiterLock(pScrn);
/*
* Almost everything uses these defaults, and many of those that
* don't, will wrap them.
*/
pScrn->EnableDisableFBAccess = xf86EnableDisableFBAccess;
#ifdef XFreeXDGA
pScrn->SetDGAMode = xf86SetDGAMode;
#endif
pScrn->DPMSSet = NULL;
pScrn->LoadPalette = NULL;
pScrn->SetOverscan = NULL;
pScrn->DriverFunc = NULL;
pScrn->pScreen = NULL;
scr_index = AddGPUScreen(xf86ScreenInit, argc, argv);
xf86VGAarbiterUnlock(pScrn);
if (scr_index == i) {
dixSetPrivate(&screenInfo.gpuscreens[scr_index]->devPrivates,
xf86ScreenKey, xf86GPUScreens[i]);
pScrn->pScreen = screenInfo.gpuscreens[scr_index];
/* The driver should set this, but make sure it is set anyway */
pScrn->vtSema = TRUE;
} else {
FatalError("AddScreen/ScreenInit failed for gpu driver %d %d\n", i, scr_index);
}
}
for (i = 0; i < xf86NumGPUScreens; i++)
AttachUnboundGPU(xf86Screens[0]->pScreen, xf86GPUScreens[i]->pScreen);

View File

@ -24,6 +24,8 @@
# _ladir passes a dummy rpath to libtool so the thing will actually link
# TODO: -nostdlib/-Bstatic/-lgcc platform magic, not installing the .a, etc.
include $(top_srcdir)/manpages.am
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS)
AM_CPPFLAGS = \
@ -62,9 +64,3 @@ driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = modesetting.man
CLEANFILES = $(driverman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@

View File

@ -77,9 +77,9 @@ PRE_UNINSTALL = :
POST_UNINSTALL = :
build_triplet = @build@
host_triplet = @host@
subdir = hw/xfree86/drivers/modesetting
DIST_COMMON = $(srcdir)/Makefile.am $(srcdir)/Makefile.in \
$(top_srcdir)/depcomp
$(top_srcdir)/depcomp $(top_srcdir)/manpages.am
subdir = hw/xfree86/drivers/modesetting
ACLOCAL_M4 = $(top_srcdir)/aclocal.m4
am__aclocal_m4_deps = $(top_srcdir)/m4/ac_define_dir.m4 \
$(top_srcdir)/m4/ax_pthread.m4 $(top_srcdir)/m4/libtool.m4 \
@ -127,7 +127,8 @@ am__uninstall_files_from_dir = { \
$(am__cd) "$$dir" && rm -f $$files; }; \
}
am__installdirs = "$(DESTDIR)$(modesetting_drv_ladir)" \
"$(DESTDIR)$(drivermandir)"
"$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" \
"$(DESTDIR)$(filemandir)"
LTLIBRARIES = $(modesetting_drv_la_LTLIBRARIES)
am__DEPENDENCIES_1 =
modesetting_drv_la_DEPENDENCIES = $(am__DEPENDENCIES_1)
@ -183,7 +184,7 @@ am__can_run_installinfo = \
n|no|NO) false;; \
*) (install-info --version) >/dev/null 2>&1;; \
esac
DATA = $(driverman_DATA)
DATA = $(appman_DATA) $(driverman_DATA) $(fileman_DATA)
ETAGS = etags
CTAGS = ctags
DISTFILES = $(DIST_COMMON) $(DIST_SOURCES) $(TEXINFOS) $(EXTRA_DIST)
@ -327,7 +328,38 @@ MAINT = @MAINT@
MAIN_LIB = @MAIN_LIB@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MAN_SUBSTS = @MAN_SUBSTS@
# xorg-macros.m4 has these bracketed by double underscores, but meson
# wants ats.
# Add server specific man pages string substitution from XORG_MANPAGE_SECTIONS
# 's|/,|/, |g' will add a space to help font path formatting
MAN_SUBSTS = @MAN_SUBSTS@ -e 's|@vendorversion@|"$(PACKAGE_STRING)" \
"$(XORG_MAN_PAGE)"|' -e 's|@xorgversion@|"$(PACKAGE_STRING)" \
"$(XORG_MAN_PAGE)"|' -e 's|@xservername@|Xorg|g' -e \
's|@xconfigfile@|xorg.conf|g' -e 's|@projectroot@|$(prefix)|g' \
-e 's|@apploaddir@|$(appdefaultdir)|g' -e \
's|@appmansuffix@|$(APP_MAN_SUFFIX)|g' -e \
's|@drivermansuffix@|$(DRIVER_MAN_SUFFIX)|g' -e \
's|@adminmansuffix@|$(ADMIN_MAN_SUFFIX)|g' -e \
's|@libmansuffix@|$(LIB_MAN_SUFFIX)|g' -e \
's|@miscmansuffix@|$(MISC_MAN_SUFFIX)|g' -e \
's|@filemansuffix@|$(FILE_MAN_SUFFIX)|g' -e \
's|[@]logdir[@]|$(logdir)|g' -e 's|[@]datadir[@]|$(datadir)|g' \
-e 's|[@]mandir[@]|$(mandir)|g' -e \
's|[@]sysconfdir[@]|$(sysconfdir)|g' -e \
's|[@]xconfigdir[@]|$(XCONFIGDIR)|g' -e \
's|[@]xkbdir[@]|$(XKB_BASE_DIRECTORY)|g' -e \
's|[@]XKB_DFLT_RULES[@]|$(XKB_DFLT_RULES)|g' -e \
's|[@]XKB_DFLT_MODEL[@]|$(XKB_DFLT_MODEL)|g' -e \
's|[@]XKB_DFLT_LAYOUT[@]|$(XKB_DFLT_LAYOUT)|g' -e \
's|[@]XKB_DFLT_VARIANT[@]|$(XKB_DFLT_VARIANT)|g' -e \
's|[@]XKB_DFLT_OPTIONS[@]|$(XKB_DFLT_OPTIONS)|g' -e \
's|[@]bundle_id_prefix[@]|$(BUNDLE_ID_PREFIX)|g' -e \
's|[@]modulepath[@]|$(DEFAULT_MODULE_PATH)|g' -e \
's|[@]suid_wrapper_dir[@]|$(SUID_WRAPPER_DIR)|g' -e \
's|[@]default_font_path[@]|$(COMPILEDDEFAULTFONTPATH)|g' -e \
'\|$(COMPILEDDEFAULTFONTPATH)| s|/,|/, |g'
MISC_MAN_DIR = @MISC_MAN_DIR@
MISC_MAN_SUFFIX = @MISC_MAN_SUFFIX@
MKDIR_P = @MKDIR_P@
@ -545,6 +577,17 @@ target_alias = @target_alias@
top_build_prefix = @top_build_prefix@
top_builddir = @top_builddir@
top_srcdir = @top_srcdir@
appmandir = $(APP_MAN_DIR)
#appman_PRE = list of application man page files set by calling Makefile.am
appman_DATA = $(appman_PRE:man=$(APP_MAN_SUFFIX))
drivermandir = $(DRIVER_MAN_DIR)
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
filemandir = $(FILE_MAN_DIR)
#fileman_PRE = list of file man page files set by calling Makefile.am
fileman_DATA = $(fileman_PRE:man=$(FILE_MAN_SUFFIX))
EXTRA_DIST = modesetting.man
CLEANFILES = $(driverman_DATA)
SUFFIXES = .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man
AM_CFLAGS = $(DIX_CFLAGS) $(XORG_CFLAGS) $(LIBDRM_CFLAGS) $(UDEV_CFLAGS) $(CWARNFLAGS)
AM_CPPFLAGS = \
$(XORG_INCS) \
@ -574,19 +617,12 @@ modesetting_drv_la_SOURCES = \
pageflip.c \
$(NULL)
drivermandir = $(DRIVER_MAN_DIR)
driverman_PRE = modesetting.man
driverman_DATA = $(driverman_PRE:man=@DRIVER_MAN_SUFFIX@)
EXTRA_DIST = modesetting.man
CLEANFILES = $(driverman_DATA)
# String replacements in MAN_SUBSTS now come from xorg-macros.m4 via configure
SUFFIXES = .$(DRIVER_MAN_SUFFIX) .man
all: all-am
.SUFFIXES:
.SUFFIXES: .$(DRIVER_MAN_SUFFIX) .man .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(am__configure_deps)
.SUFFIXES: .$(APP_MAN_SUFFIX) .$(DRIVER_MAN_SUFFIX) .$(FILE_MAN_SUFFIX) .man .c .lo .o .obj
$(srcdir)/Makefile.in: @MAINTAINER_MODE_TRUE@ $(srcdir)/Makefile.am $(top_srcdir)/manpages.am $(am__configure_deps)
@for dep in $?; do \
case '$(am__configure_deps)' in \
*$$dep*) \
@ -607,6 +643,7 @@ Makefile: $(srcdir)/Makefile.in $(top_builddir)/config.status
echo ' cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe)'; \
cd $(top_builddir) && $(SHELL) ./config.status $(subdir)/$@ $(am__depfiles_maybe);; \
esac;
$(top_srcdir)/manpages.am:
$(top_builddir)/config.status: $(top_srcdir)/configure $(CONFIG_STATUS_DEPENDENCIES)
cd $(top_builddir) && $(MAKE) $(AM_MAKEFLAGS) am--refresh
@ -693,6 +730,27 @@ mostlyclean-libtool:
clean-libtool:
-rm -rf .libs _libs
install-appmanDATA: $(appman_DATA)
@$(NORMAL_INSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(appmandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(appmandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(appmandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(appmandir)" || exit $$?; \
done
uninstall-appmanDATA:
@$(NORMAL_UNINSTALL)
@list='$(appman_DATA)'; test -n "$(appmandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(appmandir)'; $(am__uninstall_files_from_dir)
install-drivermanDATA: $(driverman_DATA)
@$(NORMAL_INSTALL)
@list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \
@ -714,6 +772,27 @@ uninstall-drivermanDATA:
@list='$(driverman_DATA)'; test -n "$(drivermandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(drivermandir)'; $(am__uninstall_files_from_dir)
install-filemanDATA: $(fileman_DATA)
@$(NORMAL_INSTALL)
@list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \
if test -n "$$list"; then \
echo " $(MKDIR_P) '$(DESTDIR)$(filemandir)'"; \
$(MKDIR_P) "$(DESTDIR)$(filemandir)" || exit 1; \
fi; \
for p in $$list; do \
if test -f "$$p"; then d=; else d="$(srcdir)/"; fi; \
echo "$$d$$p"; \
done | $(am__base_list) | \
while read files; do \
echo " $(INSTALL_DATA) $$files '$(DESTDIR)$(filemandir)'"; \
$(INSTALL_DATA) $$files "$(DESTDIR)$(filemandir)" || exit $$?; \
done
uninstall-filemanDATA:
@$(NORMAL_UNINSTALL)
@list='$(fileman_DATA)'; test -n "$(filemandir)" || list=; \
files=`for p in $$list; do echo $$p; done | sed -e 's|^.*/||'`; \
dir='$(DESTDIR)$(filemandir)'; $(am__uninstall_files_from_dir)
ID: $(HEADERS) $(SOURCES) $(LISP) $(TAGS_FILES)
list='$(SOURCES) $(HEADERS) $(LISP) $(TAGS_FILES)'; \
@ -815,7 +894,7 @@ check-am: all-am
check: check-am
all-am: Makefile $(LTLIBRARIES) $(DATA)
installdirs:
for dir in "$(DESTDIR)$(modesetting_drv_ladir)" "$(DESTDIR)$(drivermandir)"; do \
for dir in "$(DESTDIR)$(modesetting_drv_ladir)" "$(DESTDIR)$(appmandir)" "$(DESTDIR)$(drivermandir)" "$(DESTDIR)$(filemandir)"; do \
test -z "$$dir" || $(MKDIR_P) "$$dir"; \
done
install: install-am
@ -872,8 +951,8 @@ info: info-am
info-am:
install-data-am: install-drivermanDATA \
install-modesetting_drv_laLTLIBRARIES
install-data-am: install-appmanDATA install-drivermanDATA \
install-filemanDATA install-modesetting_drv_laLTLIBRARIES
install-dvi: install-dvi-am
@ -919,8 +998,8 @@ ps: ps-am
ps-am:
uninstall-am: uninstall-drivermanDATA \
uninstall-modesetting_drv_laLTLIBRARIES
uninstall-am: uninstall-appmanDATA uninstall-drivermanDATA \
uninstall-filemanDATA uninstall-modesetting_drv_laLTLIBRARIES
.MAKE: install-am install-strip
@ -928,21 +1007,27 @@ uninstall-am: uninstall-drivermanDATA \
clean-libtool clean-modesetting_drv_laLTLIBRARIES cscopelist \
ctags distclean distclean-compile distclean-generic \
distclean-libtool distclean-tags distdir dvi dvi-am html \
html-am info info-am install install-am install-data \
install-data-am install-drivermanDATA install-dvi \
install-dvi-am install-exec install-exec-am install-html \
install-html-am install-info install-info-am install-man \
html-am info info-am install install-am install-appmanDATA \
install-data install-data-am install-drivermanDATA install-dvi \
install-dvi-am install-exec install-exec-am \
install-filemanDATA install-html install-html-am install-info \
install-info-am install-man \
install-modesetting_drv_laLTLIBRARIES install-pdf \
install-pdf-am install-ps install-ps-am install-strip \
installcheck installcheck-am installdirs maintainer-clean \
maintainer-clean-generic mostlyclean mostlyclean-compile \
mostlyclean-generic mostlyclean-libtool pdf pdf-am ps ps-am \
tags uninstall uninstall-am uninstall-drivermanDATA \
tags uninstall uninstall-am uninstall-appmanDATA \
uninstall-drivermanDATA uninstall-filemanDATA \
uninstall-modesetting_drv_laLTLIBRARIES
.man.$(APP_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
.man.$(DRIVER_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
.man.$(FILE_MAN_SUFFIX):
$(AM_V_GEN)$(SED) $(MAN_SUBSTS) < $< > $@
# Tell versions [3.59,3.63) of GNU make to not export all variables.
# Otherwise a system limit (for SysV at least) may be exceeded.

View File

@ -147,6 +147,7 @@ void ms_drm_abort_seq(ScrnInfoPtr scrn, uint32_t seq);
Bool ms_crtc_on(xf86CrtcPtr crtc);
xf86CrtcPtr ms_dri2_crtc_covering_drawable(DrawablePtr pDraw);
RRCrtcPtr ms_randr_crtc_covering_drawable(DrawablePtr pDraw);
int ms_get_crtc_ust_msc(xf86CrtcPtr crtc, CARD64 *ust, CARD64 *msc);

View File

@ -59,8 +59,7 @@ struct ms_present_vblank_event {
static RRCrtcPtr
ms_present_get_crtc(WindowPtr window)
{
xf86CrtcPtr xf86_crtc = ms_dri2_crtc_covering_drawable(&window->drawable);
return xf86_crtc ? xf86_crtc->randr_crtc : NULL;
return ms_randr_crtc_covering_drawable(&window->drawable);
}
static int

View File

@ -77,6 +77,28 @@ static void ms_crtc_box(xf86CrtcPtr crtc, BoxPtr crtc_box)
crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
}
static void ms_randr_crtc_box(RRCrtcPtr crtc, BoxPtr crtc_box)
{
if (crtc->mode) {
crtc_box->x1 = crtc->x;
crtc_box->y1 = crtc->y;
switch (crtc->rotation) {
case RR_Rotate_0:
case RR_Rotate_180:
default:
crtc_box->x2 = crtc->x + crtc->mode->mode.width;
crtc_box->y2 = crtc->y + crtc->mode->mode.height;
break;
case RR_Rotate_90:
case RR_Rotate_270:
crtc_box->x2 = crtc->x + crtc->mode->mode.height;
crtc_box->y2 = crtc->y + crtc->mode->mode.width;
break;
}
} else
crtc_box->x1 = crtc_box->x2 = crtc_box->y1 = crtc_box->y2 = 0;
}
static int ms_box_area(BoxPtr box)
{
return (int)(box->x2 - box->x1) * (int)(box->y2 - box->y1);
@ -90,13 +112,46 @@ ms_crtc_on(xf86CrtcPtr crtc)
return crtc->enabled && drmmode_crtc->dpms_mode == DPMSModeOn;
}
/*
* Return the first output which is connected to an active CRTC on this screen.
*
* RRFirstOutput() will return an output from a slave screen if it is primary,
* which is not the behavior that ms_covering_crtc() wants.
*/
static RROutputPtr ms_first_output(ScreenPtr pScreen)
{
rrScrPriv(pScreen);
RROutputPtr output;
int i, j;
if (!pScrPriv)
return NULL;
if (pScrPriv->primaryOutput && pScrPriv->primaryOutput->crtc &&
(pScrPriv->primaryOutput->pScreen == pScreen)) {
return pScrPriv->primaryOutput;
}
for (i = 0; i < pScrPriv->numCrtcs; i++) {
RRCrtcPtr crtc = pScrPriv->crtcs[i];
for (j = 0; j < pScrPriv->numOutputs; j++) {
output = pScrPriv->outputs[j];
if (output->crtc == crtc)
return output;
}
}
return NULL;
}
/*
* Return the crtc covering 'box'. If two crtcs cover a portion of
* 'box', then prefer the crtc with greater coverage.
*/
static xf86CrtcPtr
ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
ms_covering_xf86_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
xf86CrtcConfigPtr xf86_config = XF86_CRTC_CONFIG_PTR(scrn);
@ -108,6 +163,10 @@ ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
best_crtc = NULL;
best_coverage = 0;
if (!xf86_config)
return NULL;
for (c = 0; c < xf86_config->num_crtc; c++) {
crtc = xf86_config->crtc[c];
@ -135,7 +194,7 @@ ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
ScreenPtr slave;
if (dixPrivateKeyRegistered(rrPrivKey))
primary_output = RRFirstOutput(scrn->pScreen);
primary_output = ms_first_output(scrn->pScreen);
if (!primary_output || !primary_output->crtc)
return NULL;
@ -147,7 +206,74 @@ ms_covering_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
if (!slave->is_output_slave)
continue;
if (ms_covering_crtc(slave, box, FALSE)) {
if (ms_covering_xf86_crtc(slave, box, FALSE)) {
/* The drawable is on a slave output, return primary crtc */
return crtc;
}
}
}
return best_crtc;
}
static RRCrtcPtr
ms_covering_randr_crtc(ScreenPtr pScreen, BoxPtr box, Bool screen_is_ms)
{
ScrnInfoPtr scrn = xf86ScreenToScrn(pScreen);
rrScrPrivPtr pScrPriv = rrGetScrPriv(pScreen);
RRCrtcPtr crtc, best_crtc;
int coverage, best_coverage;
int c;
BoxRec crtc_box, cover_box;
Bool crtc_on;
best_crtc = NULL;
best_coverage = 0;
if (!pScrPriv)
return NULL;
for (c = 0; c < pScrPriv->numCrtcs; c++) {
crtc = pScrPriv->crtcs[c];
if (screen_is_ms) {
crtc_on = ms_crtc_on((xf86CrtcPtr) crtc->devPrivate);
} else {
crtc_on = !!crtc->mode;
}
/* If the CRTC is off, treat it as not covering */
if (!crtc_on)
continue;
ms_randr_crtc_box(crtc, &crtc_box);
ms_box_intersect(&cover_box, &crtc_box, box);
coverage = ms_box_area(&cover_box);
if (coverage > best_coverage) {
best_crtc = crtc;
best_coverage = coverage;
}
}
/* Fallback to primary crtc for drawable's on slave outputs */
if (best_crtc == NULL && !pScreen->isGPU) {
RROutputPtr primary_output = NULL;
ScreenPtr slave;
if (dixPrivateKeyRegistered(rrPrivKey))
primary_output = ms_first_output(scrn->pScreen);
if (!primary_output || !primary_output->crtc)
return NULL;
crtc = primary_output->crtc;
if (!ms_crtc_on((xf86CrtcPtr) crtc->devPrivate))
return NULL;
xorg_list_for_each_entry(slave, &pScreen->slave_list, slave_head) {
if (!slave->is_output_slave)
continue;
if (ms_covering_randr_crtc(slave, box, FALSE)) {
/* The drawable is on a slave output, return primary crtc */
return crtc;
}
@ -168,7 +294,21 @@ ms_dri2_crtc_covering_drawable(DrawablePtr pDraw)
box.x2 = box.x1 + pDraw->width;
box.y2 = box.y1 + pDraw->height;
return ms_covering_crtc(pScreen, &box, TRUE);
return ms_covering_xf86_crtc(pScreen, &box, TRUE);
}
RRCrtcPtr
ms_randr_crtc_covering_drawable(DrawablePtr pDraw)
{
ScreenPtr pScreen = pDraw->pScreen;
BoxRec box;
box.x1 = pDraw->x;
box.y1 = pDraw->y;
box.x2 = box.x1 + pDraw->width;
box.y2 = box.y1 + pDraw->height;
return ms_covering_randr_crtc(pScreen, &box, TRUE);
}
static Bool

View File

@ -2227,6 +2227,7 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease)
{
int c;
int o;
ScrnInfoPtr scrn = xf86ScreenToScrn(lease->screen);
RRLeaseTerminated(lease);
/*
@ -2257,6 +2258,10 @@ xf86CrtcLeaseTerminated(RRLeasePtr lease)
xf86CrtcCheckReset(crtc);
}
}
/* Power off if necessary */
xf86DisableUnusedFunctions(scrn);
RRLeaseFree(lease);
}

View File

@ -28,7 +28,7 @@
#include <stddef.h>
#include <string.h>
#include <stdio.h>
#include "mi.h"
#include "xf86.h"
#include "xf86DDC.h"
#include "windowstr.h"
@ -191,7 +191,7 @@ xf86RotateRedisplay(ScreenPtr pScreen)
* leaves the software cursor in place
*/
SourceValidate = pScreen->SourceValidate;
pScreen->SourceValidate = NULL;
pScreen->SourceValidate = miSourceValidate;
for (c = 0; c < xf86_config->num_crtc; c++) {
xf86CrtcPtr crtc = xf86_config->crtc[c];

View File

@ -208,7 +208,8 @@ xf86InstallSIGIOHandler(int fd, void (*f) (int, void *), void *closure)
}
}
#endif
#ifdef I_SETSIG /* System V Streams - used on Solaris for input devices */
#if defined(I_SETSIG) && defined(HAVE_ISASTREAM)
/* System V Streams - used on Solaris for input devices */
if (!installed && isastream(fd)) {
if (ioctl(fd, I_SETSIG, S_INPUT | S_ERROR | S_HANGUP) == -1) {
xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG): %s\n",
@ -279,7 +280,7 @@ xf86RemoveSIGIOHandler(int fd)
#ifdef O_ASYNC
fcntl(fd, F_SETFL, fcntl(fd, F_GETFL) & ~O_ASYNC);
#endif
#ifdef I_SETSIG
#if defined(I_SETSIG) && defined(HAVE_ISASTREAM)
if (isastream(fd)) {
if (ioctl(fd, I_SETSIG, 0) == -1) {
xf86Msg(X_WARNING, "fcntl(%d, I_SETSIG, 0): %s\n",

View File

@ -263,7 +263,6 @@ xnestOpenScreen(ScreenPtr pScreen, int argc, char *argv[])
pScreen->SaveScreen = xnestSaveScreen;
pScreen->GetImage = xnestGetImage;
pScreen->GetSpans = xnestGetSpans;
pScreen->SourceValidate = NULL;
/* Window Procedures */

View File

@ -188,6 +188,8 @@ xwl_tablet_tool_set_cursor(struct xwl_tablet_tool *xwl_tablet_tool)
zwp_tablet_tool_v2_set_cursor(xwl_tablet_tool->tool,
xwl_tablet_tool->proximity_in_serial,
NULL, 0, 0);
clear_cursor_frame_callback(xwl_cursor);
xwl_cursor->needs_update = FALSE;
return;
}

View File

@ -33,6 +33,7 @@
#include "wayland-eglstream-controller-client-protocol.h"
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <glamor_egl.h>
#include <glamor.h>
#include <glamor_transform.h>

View File

@ -36,6 +36,7 @@
#include <drm_fourcc.h>
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <gbm.h>
#include <glamor_egl.h>
@ -169,6 +170,8 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo,
xwl_screen->egl_context,
EGL_NATIVE_PIXMAP_KHR,
xwl_pixmap->bo, NULL);
if (xwl_pixmap->image == EGL_NO_IMAGE_KHR)
goto error;
glGenTextures(1, &xwl_pixmap->texture);
glBindTexture(GL_TEXTURE_2D, xwl_pixmap->texture);
@ -176,14 +179,31 @@ xwl_glamor_gbm_create_pixmap_for_bo(ScreenPtr screen, struct gbm_bo *bo,
glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, GL_NEAREST);
glEGLImageTargetTexture2DOES(GL_TEXTURE_2D, xwl_pixmap->image);
if (eglGetError() != EGL_SUCCESS)
goto error;
glBindTexture(GL_TEXTURE_2D, 0);
glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture);
/* `set_pixmap_texture()` may fail silently if the FBO creation failed,
* so we check again the texture to be sure it worked.
*/
if (!glamor_get_pixmap_texture(pixmap))
goto error;
glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM);
xwl_pixmap_set_private(pixmap, xwl_pixmap);
glamor_set_pixmap_texture(pixmap, xwl_pixmap->texture);
glamor_set_pixmap_type(pixmap, GLAMOR_TEXTURE_DRM);
return pixmap;
error:
if (xwl_pixmap->image != EGL_NO_IMAGE_KHR)
eglDestroyImageKHR(xwl_screen->egl_display, xwl_pixmap->image);
if (pixmap)
glamor_destroy_pixmap(pixmap);
free(xwl_pixmap);
return NULL;
}
static PixmapPtr
@ -194,6 +214,7 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
struct xwl_screen *xwl_screen = xwl_screen_get(screen);
struct xwl_gbm_private *xwl_gbm = xwl_gbm_get(xwl_screen);
struct gbm_bo *bo;
PixmapPtr pixmap = NULL;
if (width > 0 && height > 0 && depth >= 15 &&
(hint == 0 ||
@ -218,11 +239,18 @@ xwl_glamor_gbm_create_pixmap(ScreenPtr screen,
GBM_BO_USE_SCANOUT | GBM_BO_USE_RENDERING);
}
if (bo)
return xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth);
if (bo) {
pixmap = xwl_glamor_gbm_create_pixmap_for_bo(screen, bo, depth);
if (!pixmap)
gbm_bo_destroy(bo);
}
}
return glamor_create_pixmap(screen, width, height, depth, hint);
if (!pixmap)
pixmap = glamor_create_pixmap(screen, width, height, depth, hint);
return pixmap;
}
static Bool

View File

@ -26,6 +26,7 @@
#include "xwayland.h"
#define MESA_EGL_NO_X11_HEADERS
#define EGL_NO_X11
#include <glamor_egl.h>
#include <glamor.h>

View File

@ -2667,6 +2667,7 @@ xwl_pointer_warp_emulator_maybe_lock(struct xwl_pointer_warp_emulator *warp_emul
*/
if (pointer_grab &&
!pointer_grab->ownerEvents &&
sprite &&
XYToWindow(sprite, x, y) != xwl_seat->focus_window->window)
return;

View File

@ -171,6 +171,40 @@ approximate_mmpd(struct xwl_screen *xwl_screen)
return 25.4 / DEFAULT_DPI;
}
static int
xwl_set_pixmap_visit_window(WindowPtr window, void *data)
{
ScreenPtr screen = window->drawable.pScreen;
if (screen->GetWindowPixmap(window) == data) {
screen->SetWindowPixmap(window, screen->GetScreenPixmap(screen));
return WT_WALKCHILDREN;
}
return WT_DONTWALKCHILDREN;
}
static void
update_backing_pixmaps(struct xwl_screen *xwl_screen, int width, int height)
{
ScreenPtr pScreen = xwl_screen->screen;
WindowPtr pRoot = pScreen->root;
PixmapPtr old_pixmap, new_pixmap;
old_pixmap = pScreen->GetScreenPixmap(pScreen);
new_pixmap = pScreen->CreatePixmap(pScreen, width, height,
pScreen->rootDepth,
CREATE_PIXMAP_USAGE_BACKING_PIXMAP);
pScreen->SetScreenPixmap(new_pixmap);
if (old_pixmap) {
TraverseTree(pRoot, xwl_set_pixmap_visit_window, old_pixmap);
pScreen->DestroyPixmap(old_pixmap);
}
pScreen->ResizeWindow(pRoot, 0, 0, width, height, NULL);
}
static void
update_screen_size(struct xwl_output *xwl_output, int width, int height)
{
@ -180,6 +214,9 @@ update_screen_size(struct xwl_output *xwl_output, int width, int height)
if (xwl_screen->root_clip_mode == ROOT_CLIP_FULL)
SetRootClip(xwl_screen->screen, ROOT_CLIP_NONE);
if (!xwl_screen->rootless && xwl_screen->screen->root)
update_backing_pixmaps (xwl_screen, width, height);
xwl_screen->width = width;
xwl_screen->height = height;
xwl_screen->screen->width = width;
@ -439,7 +476,7 @@ xwl_screen_init_output(struct xwl_screen *xwl_screen)
if (!RRScreenInit(xwl_screen->screen))
return FALSE;
RRScreenSetSizeRange(xwl_screen->screen, 320, 200, 8192, 8192);
RRScreenSetSizeRange(xwl_screen->screen, 16, 16, 32767, 32767);
rp = rrGetScrPriv(xwl_screen->screen);
rp->rrGetInfo = xwl_randr_get_info;

View File

@ -125,6 +125,7 @@ ddxProcessArgument(int argc, char *argv[], int i)
static DevPrivateKeyRec xwl_window_private_key;
static DevPrivateKeyRec xwl_screen_private_key;
static DevPrivateKeyRec xwl_pixmap_private_key;
static DevPrivateKeyRec xwl_damage_private_key;
static struct xwl_window *
xwl_window_get(WindowPtr window)
@ -367,8 +368,14 @@ xwl_cursor_confined_to(DeviceIntPtr device,
static void
damage_report(DamagePtr pDamage, RegionPtr pRegion, void *data)
{
struct xwl_window *xwl_window = data;
struct xwl_screen *xwl_screen = xwl_window->xwl_screen;
WindowPtr window = data;
struct xwl_window *xwl_window = xwl_window_get(window);
struct xwl_screen *xwl_screen;
if (!xwl_window)
return;
xwl_screen = xwl_window->xwl_screen;
#ifdef GLAMOR_HAS_GBM
if (xwl_window->present_flipped) {
@ -390,6 +397,47 @@ damage_destroy(DamagePtr pDamage, void *data)
{
}
static Bool
register_damage(WindowPtr window)
{
DamagePtr damage;
damage = DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty,
FALSE, window->drawable.pScreen, window);
if (damage == NULL) {
ErrorF("Failed creating damage\n");
return FALSE;
}
DamageRegister(&window->drawable, damage);
DamageSetReportAfterOp(damage, TRUE);
dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, damage);
return TRUE;
}
static void
unregister_damage(WindowPtr window)
{
DamagePtr damage;
damage = dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key);
if (!damage)
return;
DamageUnregister(damage);
DamageDestroy(damage);
dixSetPrivate(&window->devPrivates, &xwl_damage_private_key, NULL);
}
static DamagePtr
window_get_damage(WindowPtr window)
{
return dixLookupPrivate(&window->devPrivates, &xwl_damage_private_key);
}
static void
shell_surface_ping(void *data,
struct wl_shell_surface *shell_surface, uint32_t serial)
@ -470,36 +518,25 @@ send_surface_id_event(struct xwl_window *xwl_window)
}
static Bool
xwl_realize_window(WindowPtr window)
ensure_surface_for_window(WindowPtr window)
{
ScreenPtr screen = window->drawable.pScreen;
struct xwl_screen *xwl_screen;
struct xwl_window *xwl_window;
struct wl_region *region;
Bool ret;
if (xwl_window_get(window))
return TRUE;
xwl_screen = xwl_screen_get(screen);
screen->RealizeWindow = xwl_screen->RealizeWindow;
ret = (*screen->RealizeWindow) (window);
xwl_screen->RealizeWindow = screen->RealizeWindow;
screen->RealizeWindow = xwl_realize_window;
if (xwl_screen->rootless && !window->parent) {
BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height };
RegionReset(&window->winSize, &box);
RegionNull(&window->clipList);
RegionNull(&window->borderClip);
}
if (xwl_screen->rootless) {
if (window->redirectDraw != RedirectDrawManual)
return ret;
return TRUE;
}
else {
if (window->parent)
return ret;
return TRUE;
}
xwl_window = calloc(1, sizeof *xwl_window);
@ -545,25 +582,14 @@ xwl_realize_window(WindowPtr window)
wl_surface_set_user_data(xwl_window->surface, xwl_window);
xwl_window->damage =
DamageCreate(damage_report, damage_destroy, DamageReportNonEmpty,
FALSE, screen, xwl_window);
if (xwl_window->damage == NULL) {
ErrorF("Failed creating damage\n");
goto err_surf;
}
compRedirectWindow(serverClient, window, CompositeRedirectManual);
DamageRegister(&window->drawable, xwl_window->damage);
DamageSetReportAfterOp(xwl_window->damage, TRUE);
dixSetPrivate(&window->devPrivates, &xwl_window_private_key, xwl_window);
xorg_list_init(&xwl_window->link_damage);
xwl_window_init_allow_commits(xwl_window);
return ret;
return TRUE;
err_surf:
if (xwl_window->shell_surface)
@ -574,6 +600,42 @@ err:
return FALSE;
}
static Bool
xwl_realize_window(WindowPtr window)
{
ScreenPtr screen = window->drawable.pScreen;
struct xwl_screen *xwl_screen;
Bool ret;
xwl_screen = xwl_screen_get(screen);
screen->RealizeWindow = xwl_screen->RealizeWindow;
ret = (*screen->RealizeWindow) (window);
xwl_screen->RealizeWindow = screen->RealizeWindow;
screen->RealizeWindow = xwl_realize_window;
if (!ret)
return FALSE;
if (xwl_screen->rootless && !window->parent) {
BoxRec box = { 0, 0, xwl_screen->width, xwl_screen->height };
RegionReset(&window->winSize, &box);
RegionNull(&window->clipList);
RegionNull(&window->borderClip);
}
if (xwl_screen->rootless ?
(window->drawable.class == InputOutput &&
window->parent == window->drawable.pScreen->root) :
!window->parent) {
if (!register_damage(window))
return FALSE;
}
return ensure_surface_for_window(window);
}
static Bool
xwl_unrealize_window(WindowPtr window)
{
@ -620,8 +682,8 @@ xwl_unrealize_window(WindowPtr window)
wl_surface_destroy(xwl_window->surface);
xorg_list_del(&xwl_window->link_damage);
DamageUnregister(xwl_window->damage);
DamageDestroy(xwl_window->damage);
unregister_damage(window);
if (xwl_window->frame_callback)
wl_callback_destroy(xwl_window->frame_callback);
@ -637,6 +699,26 @@ xwl_save_screen(ScreenPtr pScreen, int on)
return TRUE;
}
static void
xwl_set_window_pixmap(WindowPtr window,
PixmapPtr pixmap)
{
ScreenPtr screen = window->drawable.pScreen;
struct xwl_screen *xwl_screen;
xwl_screen = xwl_screen_get(screen);
screen->SetWindowPixmap = xwl_screen->SetWindowPixmap;
(*screen->SetWindowPixmap) (window, pixmap);
xwl_screen->SetWindowPixmap = screen->SetWindowPixmap;
screen->SetWindowPixmap = xwl_set_window_pixmap;
if (!RegionNotEmpty(&window->winSize))
return;
ensure_surface_for_window(window);
}
static void
frame_callback(void *data,
struct wl_callback *callback,
@ -689,7 +771,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
assert(!xwl_window->frame_callback);
region = DamageRegion(xwl_window->damage);
region = DamageRegion(window_get_damage(xwl_window->window));
pixmap = (*xwl_screen->screen->GetWindowPixmap) (xwl_window->window);
#ifdef XWL_HAS_GLAMOR
@ -726,7 +808,7 @@ xwl_window_post_damage(struct xwl_window *xwl_window)
wl_callback_add_listener(xwl_window->frame_callback, &frame_listener, xwl_window);
wl_surface_commit(xwl_window->surface);
DamageEmpty(xwl_window->damage);
DamageEmpty(window_get_damage(xwl_window->window));
xorg_list_del(&xwl_window->link_damage);
}
@ -962,6 +1044,8 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
return FALSE;
if (!dixRegisterPrivateKey(&xwl_pixmap_private_key, PRIVATE_PIXMAP, 0))
return FALSE;
if (!dixRegisterPrivateKey(&xwl_damage_private_key, PRIVATE_WINDOW, 0))
return FALSE;
dixSetPrivate(&pScreen->devPrivates, &xwl_screen_private_key, xwl_screen);
xwl_screen->screen = pScreen;
@ -1121,6 +1205,11 @@ xwl_screen_init(ScreenPtr pScreen, int argc, char **argv)
xwl_screen->CloseScreen = pScreen->CloseScreen;
pScreen->CloseScreen = xwl_close_screen;
if (xwl_screen->rootless) {
xwl_screen->SetWindowPixmap = pScreen->SetWindowPixmap;
pScreen->SetWindowPixmap = xwl_set_window_pixmap;
}
pScreen->CursorWarpedTo = xwl_cursor_warped_to;
pScreen->CursorConfinedTo = xwl_cursor_confined_to;

View File

@ -133,6 +133,7 @@ struct xwl_screen {
UnrealizeWindowProcPtr UnrealizeWindow;
DestroyWindowProcPtr DestroyWindow;
XYToWindowProcPtr XYToWindow;
SetWindowPixmapProcPtr SetWindowPixmap;
struct xorg_list output_list;
struct xorg_list seat_list;
@ -178,7 +179,6 @@ struct xwl_window {
struct wl_surface *surface;
struct wl_shell_surface *shell_surface;
WindowPtr window;
DamagePtr damage;
struct xorg_list link_damage;
struct wl_callback *frame_callback;
Bool allow_commits;

View File

@ -134,6 +134,9 @@
/* Define to 1 if you have the <linux/fb.h> header file. */
#undef HAVE_LINUX_FB_H
/* Define to 1 if you have the `memfd_create' function. */
#undef HAVE_MEMFD_CREATE
/* Define to 1 if you have the `mkostemp' function. */
#undef HAVE_MKOSTEMP
@ -467,9 +470,6 @@
/* Wrap SIGBUS to catch MIT-SHM faults */
#undef BUSFAULT
/* Directory for shared memory temp files */
#undef SHMDIR
/* Don't let Xdefs.h define 'pointer' */
#define _XTYPEDEF_POINTER 1
@ -524,4 +524,7 @@
/* Have epoll_create1() */
#undef HAVE_EPOLL_CREATE1
/* Have isastream */
#undef HAVE_ISASTREAM
#endif /* _DIX_CONFIG_H_ */

View File

@ -218,6 +218,9 @@
/* Define to 1 if you have the <inttypes.h> header file. */
#undef HAVE_INTTYPES_H
/* Define to 1 if you have the `isastream' function. */
#undef HAVE_ISASTREAM
/* Define to 1 if you have the `issetugid' function. */
#undef HAVE_ISSETUGID
@ -254,6 +257,9 @@
/* Define to 1 if you have the <linux/fb.h> header file. */
#undef HAVE_LINUX_FB_H
/* Define to 1 if you have the `memfd_create' function. */
#undef HAVE_MEMFD_CREATE
/* Define to 1 if you have the <memory.h> header file. */
#undef HAVE_MEMORY_H
@ -553,9 +559,6 @@
/* Support SHAPE extension */
#undef SHAPE
/* Directory for shared memory temp files */
#undef SHMDIR
/* The size of `unsigned long', as computed by sizeof. */
#undef SIZEOF_UNSIGNED_LONG

View File

@ -75,7 +75,7 @@
* will still work.
*/
#define GLXSERVER_VENDOR_ABI_MAJOR_VERSION 0
#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 0
#define GLXSERVER_VENDOR_ABI_MINOR_VERSION 1
#if defined(__cplusplus)
extern "C" {
@ -236,6 +236,17 @@ typedef struct GlxServerExportsRec {
* \param client The client.
*/
int (* forwardRequest) (GlxServerVendor *vendor, ClientPtr client);
/**
* Sets the vendor library to use for a screen for a specific client.
*
* This function changes which vendor should handle GLX requests for a
* screen. Unlike \c setScreenVendor, this function can be called at any
* time, and only applies to requests from a single client.
*
* This function is available in GLXVND version 0.1 or later.
*/
Bool (* setClientScreenVendor) (ClientPtr client, ScreenPtr screen, GlxServerVendor *vendor);
} GlxServerExports;
extern _X_EXPORT const GlxServerExports glxServer;

View File

@ -360,6 +360,10 @@ extern _X_EXPORT void miPushPixels(GCPtr /*pGC */ ,
/* miscrinit.c */
extern _X_EXPORT void
miSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int subWindowMode);
extern _X_EXPORT Bool miModifyPixmapHeader(PixmapPtr pPixmap,
int width,
int height,

View File

@ -124,6 +124,12 @@ miCloseScreen(ScreenPtr pScreen)
return ((*pScreen->DestroyPixmap) ((PixmapPtr) pScreen->devPrivate));
}
void
miSourceValidate(DrawablePtr pDrawable, int x, int y, int w, int h,
unsigned int subWindowMode)
{
}
/* 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
@ -243,7 +249,7 @@ miScreenInit(ScreenPtr pScreen, void *pbits, /* pointer to screen bits */
}
/* else CloseScreen */
/* QueryBestSize, SaveScreen, GetImage, GetSpans */
pScreen->SourceValidate = (SourceValidateProcPtr) 0;
pScreen->SourceValidate = miSourceValidate;
/* CreateWindow, DestroyWindow, PositionWindow, ChangeWindowAttributes */
/* RealizeWindow, UnrealizeWindow */
pScreen->ValidateTree = miValidateTree;

View File

@ -101,24 +101,29 @@ miSyncInitFence(ScreenPtr pScreen, SyncFence * pFence, Bool initially_triggered)
pFence->funcs = miSyncFenceFuncs;
pScreenPriv->funcs.CreateFence(pScreen, pFence, initially_triggered);
pFence->sync.initialized = TRUE;
}
void
miSyncDestroyFence(SyncFence * pFence)
{
ScreenPtr pScreen = pFence->pScreen;
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
SyncTriggerList *ptl, *pNext;
pFence->sync.beingDestroyed = TRUE;
/* tell all the fence's triggers that the counter has been destroyed */
for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
pNext = ptl->next;
free(ptl); /* destroy the trigger list as we go */
}
pScreenPriv->funcs.DestroyFence(pScreen, pFence);
if (pFence->sync.initialized) {
ScreenPtr pScreen = pFence->pScreen;
SyncScreenPrivPtr pScreenPriv = SYNC_SCREEN_PRIV(pScreen);
SyncTriggerList *ptl, *pNext;
/* tell all the fence's triggers that the counter has been destroyed */
for (ptl = pFence->sync.pTriglist; ptl; ptl = pNext) {
(*ptl->pTrigger->CounterDestroyed) (ptl->pTrigger);
pNext = ptl->next;
free(ptl); /* destroy the trigger list as we go */
}
pScreenPriv->funcs.DestroyFence(pScreen, pFence);
}
dixFreeObjectWithPrivates(pFence, PRIVATE_SYNC_FENCE);
}

View File

@ -28,6 +28,7 @@
#ifndef _MISYNC_H_
#define _MISYNC_H_
typedef struct _SyncObject SyncObject;
typedef struct _SyncFence SyncFence;
typedef struct _SyncTrigger SyncTrigger;

View File

@ -38,13 +38,14 @@
#define SYNC_COUNTER 0
#define SYNC_FENCE 1
typedef struct _SyncObject {
struct _SyncObject {
ClientPtr client; /* Owning client. 0 for system counters */
struct _SyncTriggerList *pTriglist; /* list of triggers */
XID id; /* resource ID */
unsigned char type; /* SYNC_* */
unsigned char initialized; /* FALSE if created but not initialized */
Bool beingDestroyed; /* in process of going away */
} SyncObject;
};
typedef struct _SyncCounter {
SyncObject sync; /* Common sync object data */

View File

@ -942,6 +942,14 @@ AttendClient(ClientPtr client)
{
OsCommPtr oc = (OsCommPtr) client->osPrivate;
if (client->clientGone) {
/*
* client is gone, so any pending requests will be dropped and its
* ignore count doesn't matter.
*/
return;
}
client->ignoreCount--;
if (client->ignoreCount)
return;

View File

@ -78,7 +78,7 @@ present_check_flip(RRCrtcPtr crtc,
PresentFlipReason *reason)
{
ScreenPtr screen = window->drawable.pScreen;
PixmapPtr screen_pixmap, window_pixmap;
PixmapPtr window_pixmap;
WindowPtr root = screen->root;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@ -99,9 +99,8 @@ present_check_flip(RRCrtcPtr crtc,
return FALSE;
/* Make sure the window hasn't been redirected with Composite */
screen_pixmap = screen->GetScreenPixmap(screen);
window_pixmap = screen->GetWindowPixmap(window);
if (window_pixmap != screen_pixmap &&
if (window_pixmap != screen->GetScreenPixmap(screen) &&
window_pixmap != screen_priv->flip_pixmap &&
window_pixmap != present_flip_pending_pixmap(screen))
return FALSE;
@ -127,8 +126,7 @@ present_check_flip(RRCrtcPtr crtc,
window->drawable.x != pixmap->screen_x || window->drawable.y != pixmap->screen_y ||
#endif
window->drawable.width != pixmap->drawable.width ||
window->drawable.height != pixmap->drawable.height ||
pixmap->devKind != screen_pixmap->devKind) {
window->drawable.height != pixmap->drawable.height) {
return FALSE;
}

View File

@ -649,8 +649,6 @@ present_wnmd_abort_vblank(ScreenPtr screen, WindowPtr window, RRCrtcPtr crtc, ui
present_window_priv_ptr window_priv = present_window_priv(window);
present_vblank_ptr vblank;
assert(crtc);
(*screen_priv->wnmd_info->abort_vblank) (window, crtc, event_id, msc);
xorg_list_for_each_entry(vblank, &window_priv->exec_queue, event_queue) {

View File

@ -401,17 +401,22 @@ RRCrtcDetachScanoutPixmap(RRCrtcPtr crtc)
if (crtc->scanout_pixmap_back) {
pScrPriv->rrDisableSharedPixmapFlipping(crtc);
master->StopFlippingPixmapTracking(mrootdraw,
crtc->scanout_pixmap,
crtc->scanout_pixmap_back);
if (mrootdraw) {
master->StopFlippingPixmapTracking(mrootdraw,
crtc->scanout_pixmap,
crtc->scanout_pixmap_back);
}
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap_back);
crtc->scanout_pixmap_back = NULL;
}
else {
pScrPriv->rrCrtcSetScanoutPixmap(crtc, NULL);
master->StopPixmapTracking(mrootdraw,
crtc->scanout_pixmap);
if (mrootdraw) {
master->StopPixmapTracking(mrootdraw,
crtc->scanout_pixmap);
}
}
rrDestroySharedPixmap(crtc, crtc->scanout_pixmap);

View File

@ -2362,9 +2362,9 @@ RecordDisableContext(RecordContextPtr pContext)
if (!pContext->pRecordingClient->clientGone) {
RecordAProtocolElement(pContext, NULL, XRecordEndOfData, NULL, 0, 0, 0);
RecordFlushReplyBuffer(pContext, NULL, 0, NULL, 0);
/* Re-enable request processing on this connection. */
AttendClient(pContext->pRecordingClient);
}
/* Re-enable request processing on this connection. */
AttendClient(pContext->pRecordingClient);
for (pRCAP = pContext->pListOfRCAP; pRCAP; pRCAP = pRCAP->pNextRCAP) {
RecordUninstallHooks(pRCAP, 0);

View File

@ -1492,6 +1492,11 @@ ProcRenderCreateCursor(ClientPtr client)
return BadAlloc;
}
/* what kind of maniac creates a cursor from a window picture though */
if (pSrc->pDrawable->type == DRAWABLE_WINDOW)
pScreen->SourceValidate(pSrc->pDrawable, 0, 0, width, height,
IncludeInferiors);
if (pSrc->format == PICT_a8r8g8b8) {
(*pScreen->GetImage) (pSrc->pDrawable,
0, 0, width, height, ZPixmap,

View File

@ -2110,6 +2110,9 @@ SetKeySyms(ClientPtr client,
}
}
}
if (XkbKeyHasActions(xkb, i + req->firstKeySym))
XkbResizeKeyActions(xkb, i + req->firstKeySym,
XkbNumGroups(wire->groupInfo) * wire->width);
oldMap->kt_index[0] = wire->ktIndex[0];
oldMap->kt_index[1] = wire->ktIndex[1];
oldMap->kt_index[2] = wire->ktIndex[2];
@ -2383,6 +2386,9 @@ _XkbSetMapChecks(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req,
XkbSymMapPtr map;
int i;
if (!dev->key)
return 0;
xkbi = dev->key->xkbInfo;
xkb = xkbi->desc;
@ -2495,6 +2501,9 @@ _XkbSetMap(ClientPtr client, DeviceIntPtr dev, xkbSetMapReq * req, char *values)
XkbSrvInfoPtr xkbi;
XkbDescPtr xkb;
if (!dev->key)
return Success;
xkbi = dev->key->xkbInfo;
xkb = xkbi->desc;