aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2012-05-29 08:45:04 +0200
committermarha <marha@users.sourceforge.net>2012-05-29 08:45:04 +0200
commitce592e25d6303a8f4a8aa0e2918e0f72a35bf175 (patch)
tree845b108f004259a6e4f72ade3dd5e0521ab3952b
parenteef864d36de97903007f04fad9fa43afe297745b (diff)
downloadvcxsrv-ce592e25d6303a8f4a8aa0e2918e0f72a35bf175.tar.gz
vcxsrv-ce592e25d6303a8f4a8aa0e2918e0f72a35bf175.tar.bz2
vcxsrv-ce592e25d6303a8f4a8aa0e2918e0f72a35bf175.zip
fontconfig libX11 mesa pixman xserver git update 29 May 2012
-rw-r--r--fontconfig/src/Makefile.am1
-rw-r--r--fontconfig/src/fcatomic.c10
-rw-r--r--fontconfig/src/fccache.c152
-rw-r--r--fontconfig/src/fcdir.c2
-rw-r--r--fontconfig/src/fcint.h26
-rw-r--r--fontconfig/src/fcstat.c308
-rw-r--r--libX11/configure.ac2
-rw-r--r--libX11/nls/en_US.UTF-8/Compose.pre40
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug.c6
-rw-r--r--pixman/configure.ac4
-rw-r--r--pixman/pixman/loongson-mmintrin.h21
-rw-r--r--pixman/pixman/pixman-fast-path.c44
-rw-r--r--pixman/pixman/pixman-mmx.c296
-rw-r--r--pixman/test/composite.c19
-rw-r--r--pixman/test/lowlevel-blt-bench.c1
-rw-r--r--pixman/test/scaling-crash-test.c7
-rw-r--r--xorg-server/Xext/hashtable.c4
-rw-r--r--xorg-server/Xi/stubs.c1
-rw-r--r--xorg-server/hw/vfb/InitOutput.c7
-rw-r--r--xorg-server/hw/xfree86/common/xf86Xinput.c94
20 files changed, 802 insertions, 243 deletions
diff --git a/fontconfig/src/Makefile.am b/fontconfig/src/Makefile.am
index 0bd0e3ded..65ec1e3bb 100644
--- a/fontconfig/src/Makefile.am
+++ b/fontconfig/src/Makefile.am
@@ -119,6 +119,7 @@ libfontconfig_la_SOURCES = \
fcname.c \
fcpat.c \
fcserialize.c \
+ fcstat.c \
fcstr.c \
fcxml.c \
ftglue.h \
diff --git a/fontconfig/src/fcatomic.c b/fontconfig/src/fcatomic.c
index 33c1cc628..4f6ab01f4 100644
--- a/fontconfig/src/fcatomic.c
+++ b/fontconfig/src/fcatomic.c
@@ -130,6 +130,13 @@ FcAtomicLock (FcAtomic *atomic)
return FcFalse;
}
ret = link ((char *) atomic->tmp, (char *) atomic->lck);
+ if (ret < 0 && errno == EPERM)
+ {
+ /* the filesystem where atomic->lck points to may not supports
+ * the hard link. so better try to fallback
+ */
+ ret = mkdir ((char *) atomic->lck, 0600);
+ }
(void) unlink ((char *) atomic->tmp);
#else
ret = mkdir ((char *) atomic->lck, 0600);
@@ -195,7 +202,8 @@ void
FcAtomicUnlock (FcAtomic *atomic)
{
#ifdef HAVE_LINK
- unlink ((char *) atomic->lck);
+ if (unlink ((char *) atomic->lck) == -1)
+ rmdir ((char *) atomic->lck);
#else
rmdir ((char *) atomic->lck);
#endif
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c
index 882dd3eb5..9e582b911 100644
--- a/fontconfig/src/fccache.c
+++ b/fontconfig/src/fccache.c
@@ -37,21 +37,6 @@
# include <unistd.h>
# include <sys/mman.h>
#endif
-#ifdef HAVE_SYS_VFS_H
-#include <sys/vfs.h>
-#endif
-#ifdef HAVE_SYS_STATFS_H
-#include <sys/statfs.h>
-#endif
-#ifdef HAVE_SYS_PARAM_H
-#include <sys/param.h>
-#endif
-#ifdef HAVE_SYS_MOUNT_H
-#include <sys/mount.h>
-#endif
-#ifdef HAVE_MNTENT_H
-#include <mntent.h>
-#endif
#ifndef O_BINARY
#define O_BINARY 0
@@ -71,98 +56,9 @@ static void MD5Transform(FcChar32 buf[4], FcChar32 in[16]);
#define CACHEBASE_LEN (1 + 32 + 1 + sizeof (FC_ARCHITECTURE) + sizeof (FC_CACHE_SUFFIX))
-#ifdef _WIN32
-
-#include <windows.h>
-
-#ifdef __GNUC__
-typedef long long INT64;
-#define EPOCH_OFFSET 11644473600ll
-#else
-#define EPOCH_OFFSET 11644473600i64
-typedef __int64 INT64;
-#endif
-
-/* Workaround for problems in the stat() in the Microsoft C library:
- *
- * 1) stat() uses FindFirstFile() to get the file
- * attributes. Unfortunately this API doesn't return correct values
- * for modification time of a directory until some time after a file
- * or subdirectory has been added to the directory. (This causes
- * run-test.sh to fail, for instance.) GetFileAttributesEx() is
- * better, it returns the updated timestamp right away.
- *
- * 2) stat() does some strange things related to backward
- * compatibility with the local time timestamps on FAT volumes and
- * daylight saving time. This causes problems after the switches
- * to/from daylight saving time. See
- * http://bugzilla.gnome.org/show_bug.cgi?id=154968 , especially
- * comment #30, and http://www.codeproject.com/datetime/dstbugs.asp .
- * We don't need any of that, FAT and Win9x are as good as dead. So
- * just use the UTC timestamps from NTFS, converted to the Unix epoch.
- */
-
-int
-FcStat (const FcChar8 *file, struct stat *statb)
-{
- WIN32_FILE_ATTRIBUTE_DATA wfad;
- char full_path_name[MAX_PATH];
- char *basename;
- DWORD rc;
-
- if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad))
- return -1;
-
- statb->st_dev = 0;
-
- /* Calculate a pseudo inode number as a hash of the full path name.
- * Call GetLongPathName() to get the spelling of the path name as it
- * is on disk.
- */
- rc = GetFullPathName (file, sizeof (full_path_name), full_path_name, &basename);
- if (rc == 0 || rc > sizeof (full_path_name))
- return -1;
-
- rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
- statb->st_ino = FcStringHash (full_path_name);
-
- statb->st_mode = _S_IREAD | _S_IWRITE;
- statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
-
- if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
- statb->st_mode |= _S_IFDIR;
- else
- statb->st_mode |= _S_IFREG;
-
- statb->st_nlink = 1;
- statb->st_uid = statb->st_gid = 0;
- statb->st_rdev = 0;
-
- if (wfad.nFileSizeHigh > 0)
- return -1;
- statb->st_size = wfad.nFileSizeLow;
-
- statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
- statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
- statb->st_ctime = statb->st_mtime;
-
- return 0;
-}
-
-#else
-
-int
-FcStat (const FcChar8 *file, struct stat *statb)
-{
- return stat ((char *) file, statb);
-}
-
-#endif
-
static FcBool
FcCacheIsMmapSafe (int fd)
{
- FcBool retval = FcTrue;
static FcBool is_initialized = FcFalse;
static FcBool is_env_available = FcFalse;
static FcBool use_mmap = FcFalse;
@@ -181,40 +77,8 @@ FcCacheIsMmapSafe (int fd)
}
if (is_env_available)
return use_mmap;
-#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
- struct statvfs buf;
-
- if (fstatvfs (fd, &buf) == 0)
- {
- const char *p;
-#if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
- p = buf.f_basetype;
-#elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
- p = buf.f_fstypename;
-#endif
-
- if (strcmp (p, "nfs") == 0)
- retval = FcFalse;
- }
-#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
- struct statfs buf;
-
- if (fstatfs (fd, &buf) == 0)
- {
-# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
- if (!(buf.f_flags & MNT_LOCAL))
-# elif defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
- if (strcmp (buf.f_fstypename, "nfs") == 0)
-# elif defined(__linux__)
- if (buf.f_type == 0x6969) /* nfs */
-# else
-# error "BUG: No way to figure out with fstatfs()"
-# endif
- retval = FcFalse;
- }
-#endif
- return retval;
+ return FcIsFsMmapSafe (fd);
}
static const char bin2hex[] = { '0', '1', '2', '3',
@@ -317,7 +181,7 @@ FcDirCacheProcess (FcConfig *config, const FcChar8 *dir,
struct stat file_stat, dir_stat;
FcBool ret = FcFalse;
- if (FcStat (dir, &dir_stat) < 0)
+ if (FcStatChecksum (dir, &dir_stat) < 0)
return FcFalse;
FcDirCacheBasename (dir, cache_base);
@@ -644,14 +508,14 @@ FcCacheTimeValid (FcCache *cache, struct stat *dir_stat)
if (!dir_stat)
{
- if (FcStat (FcCacheDir (cache), &dir_static) < 0)
+ if (FcStatChecksum (FcCacheDir (cache), &dir_static) < 0)
return FcFalse;
dir_stat = &dir_static;
}
if (FcDebug () & FC_DBG_CACHE)
- printf ("FcCacheTimeValid dir \"%s\" cache time %d dir time %d\n",
- FcCacheDir (cache), cache->mtime, (int) dir_stat->st_mtime);
- return cache->mtime == (int) dir_stat->st_mtime;
+ printf ("FcCacheTimeValid dir \"%s\" cache checksum %d dir checksum %d\n",
+ FcCacheDir (cache), cache->checksum, (int) dir_stat->st_mtime);
+ return cache->checksum == (int) dir_stat->st_mtime;
}
/*
@@ -815,7 +679,7 @@ FcDirCacheValidateHelper (int fd, struct stat *fd_stat, struct stat *dir_stat, v
ret = FcFalse;
else if (fd_stat->st_size != c.size)
ret = FcFalse;
- else if (c.mtime != (int) dir_stat->st_mtime)
+ else if (c.checksum != (int) dir_stat->st_mtime)
ret = FcFalse;
return ret;
}
@@ -890,7 +754,7 @@ FcDirCacheBuild (FcFontSet *set, const FcChar8 *dir, struct stat *dir_stat, FcSt
cache->magic = FC_CACHE_MAGIC_ALLOC;
cache->version = FC_CACHE_CONTENT_VERSION;
cache->size = serialize->size;
- cache->mtime = (int) dir_stat->st_mtime;
+ cache->checksum = (int) dir_stat->st_mtime;
/*
* Serialize directory name
diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c
index 4399afc4a..2b476e8b9 100644
--- a/fontconfig/src/fcdir.c
+++ b/fontconfig/src/fcdir.c
@@ -245,7 +245,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
if (FcDebug () & FC_DBG_FONTSET)
printf ("cache scan dir %s\n", dir);
- if (FcStat (dir, &dir_stat) < 0)
+ if (FcStatChecksum (dir, &dir_stat) < 0)
goto bail;
set = FcFontSetCreate();
diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h
index ad9db8aa4..3d06fc6eb 100644
--- a/fontconfig/src/fcint.h
+++ b/fontconfig/src/fcint.h
@@ -358,7 +358,7 @@ struct _FcCache {
intptr_t dirs; /* offset to subdirs */
int dirs_count; /* number of subdir strings */
intptr_t set; /* offset to font set */
- int mtime; /* low bits of directory mtime */
+ int checksum; /* checksum of directory state */
};
#undef FcCacheDir
@@ -539,6 +539,13 @@ struct _FcRange {
FcChar32 end;
};
+typedef struct _FcStatFS FcStatFS;
+
+struct _FcStatFS {
+ FcBool is_remote_fs;
+ FcBool is_mtime_broken;
+};
+
/* fcblanks.c */
/* fccache.c */
@@ -567,9 +574,6 @@ FcCacheFini (void);
FcPrivate void
FcDirCacheReference (FcCache *cache, int nref);
-FcPrivate int
-FcStat (const FcChar8 *file, struct stat *statb);
-
/* fccfg.c */
FcPrivate FcChar8 *
@@ -1020,6 +1024,20 @@ extern FcPrivate const FcMatrix FcIdentityMatrix;
FcPrivate void
FcMatrixFree (FcMatrix *mat);
+/* fcstat.c */
+
+FcPrivate int
+FcStat (const FcChar8 *file, struct stat *statb);
+
+FcPrivate int
+FcStatChecksum (const FcChar8 *file, struct stat *statb);
+
+FcPrivate FcBool
+FcIsFsMmapSafe (int fd);
+
+FcPrivate FcBool
+FcIsFsMtimeBroken (const FcChar8 *dir);
+
/* fcstr.c */
FcPrivate void
FcStrSetSort (FcStrSet * set);
diff --git a/fontconfig/src/fcstat.c b/fontconfig/src/fcstat.c
new file mode 100644
index 000000000..c2d9fe9ee
--- /dev/null
+++ b/fontconfig/src/fcstat.c
@@ -0,0 +1,308 @@
+/*
+ * Copyright © 2000 Keith Packard
+ * Copyright © 2005 Patrick Lam
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of the author(s) not be used in
+ * advertising or publicity pertaining to distribution of the software without
+ * specific, written prior permission. The authors make no
+ * representations about the suitability of this software for any purpose. It
+ * is provided "as is" without express or implied warranty.
+ *
+ * THE AUTHOR(S) DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE,
+ * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO
+ * EVENT SHALL THE AUTHOR(S) BE LIABLE FOR ANY SPECIAL, INDIRECT OR
+ * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE,
+ * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
+ * PERFORMANCE OF THIS SOFTWARE.
+ */
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+#include "fcint.h"
+#include "fcarch.h"
+#include <dirent.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
+#ifdef HAVE_SYS_VFS_H
+#include <sys/vfs.h>
+#endif
+#ifdef HAVE_SYS_STATFS_H
+#include <sys/statfs.h>
+#endif
+#ifdef HAVE_SYS_PARAM_H
+#include <sys/param.h>
+#endif
+#ifdef HAVE_SYS_MOUNT_H
+#include <sys/mount.h>
+#endif
+
+#ifdef _WIN32
+
+#include <windows.h>
+
+#ifdef __GNUC__
+typedef long long INT64;
+#define EPOCH_OFFSET 11644473600ll
+#else
+#define EPOCH_OFFSET 11644473600i64
+typedef __int64 INT64;
+#endif
+
+/* Workaround for problems in the stat() in the Microsoft C library:
+ *
+ * 1) stat() uses FindFirstFile() to get the file
+ * attributes. Unfortunately this API doesn't return correct values
+ * for modification time of a directory until some time after a file
+ * or subdirectory has been added to the directory. (This causes
+ * run-test.sh to fail, for instance.) GetFileAttributesEx() is
+ * better, it returns the updated timestamp right away.
+ *
+ * 2) stat() does some strange things related to backward
+ * compatibility with the local time timestamps on FAT volumes and
+ * daylight saving time. This causes problems after the switches
+ * to/from daylight saving time. See
+ * http://bugzilla.gnome.org/show_bug.cgi?id=154968 , especially
+ * comment #30, and http://www.codeproject.com/datetime/dstbugs.asp .
+ * We don't need any of that, FAT and Win9x are as good as dead. So
+ * just use the UTC timestamps from NTFS, converted to the Unix epoch.
+ */
+
+int
+FcStat (const FcChar8 *file, struct stat *statb)
+{
+ WIN32_FILE_ATTRIBUTE_DATA wfad;
+ char full_path_name[MAX_PATH];
+ char *basename;
+ DWORD rc;
+
+ if (!GetFileAttributesEx (file, GetFileExInfoStandard, &wfad))
+ return -1;
+
+ statb->st_dev = 0;
+
+ /* Calculate a pseudo inode number as a hash of the full path name.
+ * Call GetLongPathName() to get the spelling of the path name as it
+ * is on disk.
+ */
+ rc = GetFullPathName (file, sizeof (full_path_name), full_path_name, &basename);
+ if (rc == 0 || rc > sizeof (full_path_name))
+ return -1;
+
+ rc = GetLongPathName (full_path_name, full_path_name, sizeof (full_path_name));
+ statb->st_ino = FcStringHash (full_path_name);
+
+ statb->st_mode = _S_IREAD | _S_IWRITE;
+ statb->st_mode |= (statb->st_mode >> 3) | (statb->st_mode >> 6);
+
+ if (wfad.dwFileAttributes & FILE_ATTRIBUTE_DIRECTORY)
+ statb->st_mode |= _S_IFDIR;
+ else
+ statb->st_mode |= _S_IFREG;
+
+ statb->st_nlink = 1;
+ statb->st_uid = statb->st_gid = 0;
+ statb->st_rdev = 0;
+
+ if (wfad.nFileSizeHigh > 0)
+ return -1;
+ statb->st_size = wfad.nFileSizeLow;
+
+ statb->st_atime = (*(INT64 *)&wfad.ftLastAccessTime)/10000000 - EPOCH_OFFSET;
+ statb->st_mtime = (*(INT64 *)&wfad.ftLastWriteTime)/10000000 - EPOCH_OFFSET;
+ statb->st_ctime = statb->st_mtime;
+
+ return 0;
+}
+
+#else
+
+int
+FcStat (const FcChar8 *file, struct stat *statb)
+{
+ return stat ((char *) file, statb);
+}
+
+#endif
+
+/* Adler-32 checksum implementation */
+struct Adler32 {
+ int a;
+ int b;
+};
+
+static void
+Adler32Init (struct Adler32 *ctx)
+{
+ ctx->a = 1;
+ ctx->b = 0;
+}
+
+static void
+Adler32Update (struct Adler32 *ctx, const char *data, int data_len)
+{
+ while (data_len--)
+ {
+ ctx->a = (ctx->a + *data++) % 65521;
+ ctx->b = (ctx->b + ctx->a) % 65521;
+ }
+}
+
+static int
+Adler32Finish (struct Adler32 *ctx)
+{
+ return ctx->a + (ctx->b << 16);
+}
+
+/* dirent.d_type can be relied upon on FAT filesystem */
+static FcBool
+FcDirChecksumScandirFilter(const struct dirent *entry)
+{
+ return entry->d_type != DT_DIR;
+}
+
+static int
+FcDirChecksumScandirSorter(const struct dirent **lhs, const struct dirent **rhs)
+{
+ return strcmp((*lhs)->d_name, (*rhs)->d_name);
+}
+
+static int
+FcDirChecksum (const FcChar8 *dir, time_t *checksum)
+{
+ struct Adler32 ctx;
+ struct dirent **files;
+ int n;
+
+ Adler32Init (&ctx);
+
+ n = scandir ((const char *)dir, &files,
+ &FcDirChecksumScandirFilter,
+ &FcDirChecksumScandirSorter);
+ if (n == -1)
+ return -1;
+
+ while (n--)
+ {
+ Adler32Update (&ctx, files[n]->d_name, strlen(files[n]->d_name) + 1);
+ Adler32Update (&ctx, (char *)&files[n]->d_type, sizeof(files[n]->d_type));
+ free(files[n]);
+ }
+ free(files);
+
+ *checksum = Adler32Finish (&ctx);
+ return 0;
+}
+
+int
+FcStatChecksum (const FcChar8 *file, struct stat *statb)
+{
+ if (FcStat (file, statb) == -1)
+ return -1;
+
+ if (FcIsFsMtimeBroken (file))
+ {
+ if (FcDirChecksum (file, &statb->st_mtime) == -1)
+ return -1;
+ }
+
+ return 0;
+}
+
+static int
+FcFStatFs (int fd, FcStatFS *statb)
+{
+ const char *p = NULL;
+ int ret;
+ FcBool flag = FcFalse;
+
+ memset (statb, 0, sizeof (FcStatFS));
+
+#if defined(HAVE_FSTATVFS) && (defined(HAVE_STRUCT_STATVFS_F_BASETYPE) || defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME))
+ struct statvfs buf;
+
+ if ((ret = fstatvfs (fd, &buf)) == 0)
+ {
+# if defined(HAVE_STRUCT_STATVFS_F_BASETYPE)
+ p = buf.f_basetype;
+# elif defined(HAVE_STRUCT_STATVFS_F_FSTYPENAME)
+ p = buf.f_fstypename;
+# endif
+ }
+#elif defined(HAVE_FSTATFS) && (defined(HAVE_STRUCT_STATFS_F_FLAGS) || defined(HAVE_STRUCT_STATFS_F_FSTYPENAME) || defined(__linux__))
+ struct statfs buf;
+
+ if ((ret = fstatfs (fd, &buf)) == 0)
+ {
+# if defined(HAVE_STRUCT_STATFS_F_FLAGS) && defined(MNT_LOCAL)
+ statb->is_remote_fs = !(buf.f_flags & MNT_LOCAL);
+ flag = FcTrue;
+# endif
+# if defined(HAVE_STRUCT_STATFS_F_FSTYPENAME)
+ p = buf.f_fstypename;
+# elif defined(__linux__)
+ switch (buf.f_type)
+ {
+ case 0x6969: /* nfs */
+ statb->is_remote_fs = FcTrue;
+ break;
+ case 0x4d44: /* fat */
+ statb->is_mtime_broken = FcTrue;
+ break;
+ default:
+ break;
+ }
+
+ return ret;
+# else
+# error "BUG: No way to figure out with fstatfs()"
+# endif
+ }
+#endif
+ if (p)
+ {
+ if (!flag && strcmp (p, "nfs") == 0)
+ statb->is_remote_fs = FcTrue;
+ if (strcmp (p, "msdosfs") == 0 ||
+ strcmp (p, "pcfs") == 0)
+ statb->is_mtime_broken = FcTrue;
+ }
+
+ return ret;
+}
+
+FcBool
+FcIsFsMmapSafe (int fd)
+{
+ FcStatFS statb;
+
+ if (FcFStatFs (fd, &statb) < 0)
+ return FcTrue;
+
+ return !statb.is_remote_fs;
+}
+
+FcBool
+FcIsFsMtimeBroken (const FcChar8 *dir)
+{
+ int fd = open ((const char *) dir, O_RDONLY);
+
+ if (fd != -1)
+ {
+ FcStatFS statb;
+ int ret = FcFStatFs (fd, &statb);
+
+ close (fd);
+ if (ret < 0)
+ return FcFalse;
+
+ return statb.is_mtime_broken;
+ }
+
+ return FcFalse;
+}
diff --git a/libX11/configure.ac b/libX11/configure.ac
index af0f34e78..feb2e3841 100644
--- a/libX11/configure.ac
+++ b/libX11/configure.ac
@@ -1,7 +1,7 @@
# Initialize Autoconf
AC_PREREQ([2.60])
-AC_INIT([libX11], [1.4.99.901],
+AC_INIT([libX11], [1.4.99.902],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libX11])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([src/config.h include/X11/XlibConf.h])
diff --git a/libX11/nls/en_US.UTF-8/Compose.pre b/libX11/nls/en_US.UTF-8/Compose.pre
index 39154bddb..bf6599af0 100644
--- a/libX11/nls/en_US.UTF-8/Compose.pre
+++ b/libX11/nls/en_US.UTF-8/Compose.pre
@@ -532,22 +532,12 @@ XCOMM Part 3
<dead_circumflex> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
<Multi_key> <asciicircum> <KP_2> : "²" twosuperior # SUPERSCRIPT TWO
<Multi_key> <2> <asciicircum> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <2> <S> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <S> <2> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <2> <s> : "²" twosuperior # SUPERSCRIPT TWO
-<Multi_key> <s> <2> : "²" twosuperior # SUPERSCRIPT TWO
<dead_circumflex> <3> : "³" threesuperior # SUPERSCRIPT THREE
<Multi_key> <asciicircum> <3> : "³" threesuperior # SUPERSCRIPT THREE
<dead_circumflex> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
<Multi_key> <asciicircum> <KP_3> : "³" threesuperior # SUPERSCRIPT THREE
<Multi_key> <3> <asciicircum> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <3> <S> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <S> <3> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <3> <s> : "³" threesuperior # SUPERSCRIPT THREE
-<Multi_key> <s> <3> : "³" threesuperior # SUPERSCRIPT THREE
<Multi_key> <m> <u> : "µ" mu # MICRO SIGN
-<Multi_key> <slash> <U> : "µ" mu # MICRO SIGN
-<Multi_key> <U> <slash> : "µ" mu # MICRO SIGN
<Multi_key> <slash> <u> : "µ" mu # MICRO SIGN
<Multi_key> <u> <slash> : "µ" mu # MICRO SIGN
<dead_circumflex> <1> : "¹" onesuperior # SUPERSCRIPT ONE
@@ -555,10 +545,6 @@ XCOMM Part 3
<dead_circumflex> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
<Multi_key> <asciicircum> <KP_1> : "¹" onesuperior # SUPERSCRIPT ONE
<Multi_key> <1> <asciicircum> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <1> <S> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <S> <1> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <1> <s> : "¹" onesuperior # SUPERSCRIPT ONE
-<Multi_key> <s> <1> : "¹" onesuperior # SUPERSCRIPT ONE
<dead_circumflex> <Multi_key> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
<Multi_key> <asciicircum> <underscore> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
<dead_circumflex> <Multi_key> <underbar> <o> : "º" masculine # MASCULINE ORDINAL INDICATOR
@@ -581,8 +567,6 @@ XCOMM Part 3
<Multi_key> <A> <asciicircum> : "Â" Acircumflex # LATIN CAPITAL LETTER A WITH CIRCUMFLEX
<dead_tilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
<Multi_key> <asciitilde> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
-<Multi_key> <minus> <A> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
-<Multi_key> <A> <minus> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
<Multi_key> <A> <asciitilde> : "Ã" Atilde # LATIN CAPITAL LETTER A WITH TILDE
<dead_diaeresis> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
<Multi_key> <quotedbl> <A> : "Ä" Adiaeresis # LATIN CAPITAL LETTER A WITH DIAERESIS
@@ -638,8 +622,6 @@ XCOMM Part 3
<dead_tilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
<Multi_key> <asciitilde> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
<Multi_key> <N> <asciitilde> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
-<Multi_key> <minus> <N> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
-<Multi_key> <N> <minus> : "Ñ" Ntilde # LATIN CAPITAL LETTER N WITH TILDE
<dead_grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
<Multi_key> <grave> <O> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
<Multi_key> <O> <grave> : "Ò" Ograve # LATIN CAPITAL LETTER O WITH GRAVE
@@ -647,6 +629,7 @@ XCOMM Part 3
<Multi_key> <acute> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
<Multi_key> <O> <acute> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
<Multi_key> <apostrophe> <O> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
+<Multi_key> <O> <apostrophe> : "Ó" Oacute # LATIN CAPITAL LETTER O WITH ACUTE
<dead_circumflex> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
<Multi_key> <asciicircum> <O> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
<Multi_key> <O> <asciicircum> : "Ô" Ocircumflex # LATIN CAPITAL LETTER O WITH CIRCUMFLEX
@@ -655,8 +638,6 @@ XCOMM Part 3
<dead_tilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
<Multi_key> <asciitilde> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
<Multi_key> <O> <asciitilde> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
-<Multi_key> <minus> <O> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
-<Multi_key> <O> <minus> : "Õ" Otilde # LATIN CAPITAL LETTER O WITH TILDE
<dead_diaeresis> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
<Multi_key> <quotedbl> <O> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
<Multi_key> <O> <quotedbl> : "Ö" Odiaeresis # LATIN CAPITAL LETTER O WITH DIAERESIS
@@ -707,8 +688,6 @@ XCOMM Part 3
<dead_tilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
<Multi_key> <asciitilde> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
<Multi_key> <a> <asciitilde> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-<Multi_key> <minus> <a> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
-<Multi_key> <a> <minus> : "ã" atilde # LATIN SMALL LETTER A WITH TILDE
<dead_diaeresis> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
<Multi_key> <quotedbl> <a> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
<Multi_key> <a> <quotedbl> : "ä" adiaeresis # LATIN SMALL LETTER A WITH DIAERESIS
@@ -763,8 +742,6 @@ XCOMM Part 3
<dead_tilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
<Multi_key> <asciitilde> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
<Multi_key> <n> <asciitilde> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
-<Multi_key> <minus> <n> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
-<Multi_key> <n> <minus> : "ñ" ntilde # LATIN SMALL LETTER N WITH TILDE
<dead_grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
<Multi_key> <grave> <o> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
<Multi_key> <o> <grave> : "ò" ograve # LATIN SMALL LETTER O WITH GRAVE
@@ -772,6 +749,7 @@ XCOMM Part 3
<Multi_key> <acute> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
<Multi_key> <o> <acute> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
<Multi_key> <apostrophe> <o> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
+<Multi_key> <o> <apostrophe> : "ó" oacute # LATIN SMALL LETTER O WITH ACUTE
<dead_circumflex> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
<Multi_key> <asciicircum> <o> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
<Multi_key> <o> <asciicircum> : "ô" ocircumflex # LATIN SMALL LETTER O WITH CIRCUMFLEX
@@ -780,8 +758,6 @@ XCOMM Part 3
<dead_tilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
<Multi_key> <asciitilde> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
<Multi_key> <o> <asciitilde> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
-<Multi_key> <minus> <o> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
-<Multi_key> <o> <minus> : "õ" otilde # LATIN SMALL LETTER O WITH TILDE
<dead_diaeresis> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
<Multi_key> <o> <diaeresis> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
<Multi_key> <diaeresis> <o> : "ö" odiaeresis # LATIN SMALL LETTER O WITH DIAERESIS
@@ -825,9 +801,15 @@ XCOMM Part 3
<dead_macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
<Multi_key> <macron> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
<Multi_key> <underscore> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <A> <underscore> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <minus> <A> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <A> <minus> : "Ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
<dead_macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
<Multi_key> <macron> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
<Multi_key> <underscore> <a> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
+<Multi_key> <a> <underscore> : "ā" U0101 # LATIN SMALL LETTER A WITH MACRON
+<Multi_key> <minus> <a> : "ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
+<Multi_key> <a> <minus> : "ā" U0100 # LATIN CAPITAL LETTER A WITH MACRON
<dead_breve> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
<Multi_key> <U> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
<Multi_key> <b> <A> : "Ă" U0102 # LATIN CAPITAL LETTER A WITH BREVE
@@ -1082,10 +1064,14 @@ XCOMM Part 3
<Multi_key> <macron> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
<Multi_key> <underscore> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
<Multi_key> <O> <underscore> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
+<Multi_key> <minus> <O> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
+<Multi_key> <O> <minus> : "Ō" U014C # LATIN CAPITAL LETTER O WITH MACRON
<dead_macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
<Multi_key> <macron> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
<Multi_key> <underscore> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
<Multi_key> <o> <underscore> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
+<Multi_key> <minus> <o> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
+<Multi_key> <o> <minus> : "ō" U014D # LATIN SMALL LETTER O WITH MACRON
<dead_breve> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
<Multi_key> <U> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
<Multi_key> <b> <O> : "Ŏ" U014E # LATIN CAPITAL LETTER O WITH BREVE
@@ -1458,7 +1444,6 @@ XCOMM Part 3
<dead_acute> <Multi_key> <o> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <acute> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <apostrophe> <dead_abovering> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <o> <apostrophe> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <asterisk> <apostrophe> <A> : "Ǻ" U01FA # LATIN CAPITAL LETTER A WITH RING ABOVE AND ACUTE
<dead_acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <acute> <aring> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
@@ -1467,7 +1452,6 @@ XCOMM Part 3
<dead_acute> <Multi_key> <o> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <acute> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <apostrophe> <dead_abovering> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
-<Multi_key> <o> <apostrophe> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
<Multi_key> <asterisk> <apostrophe> <a> : "ǻ" U01FB # LATIN SMALL LETTER A WITH RING ABOVE AND ACUTE
<dead_acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
<Multi_key> <acute> <AE> : "Ǽ" U01FC # LATIN CAPITAL LETTER AE WITH ACUTE
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.c b/mesalib/src/gallium/auxiliary/util/u_debug.c
index df1d8e68c..0a350cae7 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug.c
+++ b/mesalib/src/gallium/auxiliary/util/u_debug.c
@@ -48,9 +48,9 @@
void _debug_vprintf(const char *format, va_list ap)
{
+ static char buf[4096] = {'\0'};
#if defined(PIPE_OS_WINDOWS) || defined(PIPE_SUBSYSTEM_EMBEDDED)
/* We buffer until we find a newline. */
- static char buf[4096] = {'\0'};
size_t len = strlen(buf);
int ret = util_vsnprintf(buf + len, sizeof(buf) - len, format, ap);
if(ret > (int)(sizeof(buf) - len - 1) || util_strchr(buf + len, '\n')) {
@@ -58,8 +58,8 @@ void _debug_vprintf(const char *format, va_list ap)
buf[0] = '\0';
}
#else
- /* Just print as-is to stderr */
- vfprintf(stderr, format, ap);
+ util_vsnprintf(buf, sizeof(buf), format, ap);
+ os_log_message(buf);
#endif
}
diff --git a/pixman/configure.ac b/pixman/configure.ac
index 027a1680e..5c60b13c9 100644
--- a/pixman/configure.ac
+++ b/pixman/configure.ac
@@ -53,8 +53,8 @@ AC_PREREQ([2.57])
#
m4_define([pixman_major], 0)
-m4_define([pixman_minor], 25)
-m4_define([pixman_micro], 7)
+m4_define([pixman_minor], 27)
+m4_define([pixman_micro], 1)
m4_define([pixman_version],[pixman_major.pixman_minor.pixman_micro])
diff --git a/pixman/pixman/loongson-mmintrin.h b/pixman/pixman/loongson-mmintrin.h
index 8295ba01c..1a114fe0f 100644
--- a/pixman/pixman/loongson-mmintrin.h
+++ b/pixman/pixman/loongson-mmintrin.h
@@ -77,6 +77,17 @@ _mm_and_si64 (__m64 __m1, __m64 __m2)
return ret;
}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_cmpeq_pi32 (__m64 __m1, __m64 __m2)
+{
+ __m64 ret;
+ asm("pcmpeqw %0, %1, %2\n\t"
+ : "=f" (ret)
+ : "f" (__m1), "f" (__m2)
+ );
+ return ret;
+}
+
extern __inline void __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_empty (void)
{
@@ -150,6 +161,16 @@ _mm_shuffle_pi16 (__m64 __m, int64_t __n)
}
extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
+_mm_slli_pi16 (__m64 __m, int64_t __count)
+{
+ __m64 ret;
+ asm("psllh %0, %1, %2\n\t"
+ : "=f" (ret)
+ : "f" (__m), "f" (*(__m64 *)&__count)
+ );
+ return ret;
+}
+extern __inline __m64 __attribute__((__gnu_inline__, __always_inline__, __artificial__))
_mm_slli_si64 (__m64 __m, int64_t __count)
{
__m64 ret;
diff --git a/pixman/pixman/pixman-fast-path.c b/pixman/pixman/pixman-fast-path.c
index 0a134eda3..e79b06970 100644
--- a/pixman/pixman/pixman-fast-path.c
+++ b/pixman/pixman/pixman-fast-path.c
@@ -810,6 +810,48 @@ fast_composite_add_8_8 (pixman_implementation_t *imp,
}
static void
+fast_composite_add_0565_0565 (pixman_implementation_t *imp,
+ pixman_composite_info_t *info)
+{
+ PIXMAN_COMPOSITE_ARGS (info);
+ uint16_t *dst_line, *dst;
+ uint32_t d;
+ uint16_t *src_line, *src;
+ uint32_t s;
+ int dst_stride, src_stride;
+ int32_t w;
+
+ PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint16_t, src_stride, src_line, 1);
+ PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
+
+ while (height--)
+ {
+ dst = dst_line;
+ dst_line += dst_stride;
+ src = src_line;
+ src_line += src_stride;
+ w = width;
+
+ while (w--)
+ {
+ s = *src++;
+ if (s)
+ {
+ d = *dst;
+ s = CONVERT_0565_TO_8888 (s);
+ if (d)
+ {
+ d = CONVERT_0565_TO_8888 (d);
+ UN8x4_ADD_UN8x4 (s, d);
+ }
+ *dst = CONVERT_8888_TO_0565 (s);
+ }
+ dst++;
+ }
+ }
+}
+
+static void
fast_composite_add_8888_8888 (pixman_implementation_t *imp,
pixman_composite_info_t *info)
{
@@ -1836,6 +1878,8 @@ static const pixman_fast_path_t c_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, a8b8g8r8, fast_composite_over_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, x8b8g8r8, fast_composite_over_8888_8888),
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, fast_composite_over_8888_0565),
+ PIXMAN_STD_FAST_PATH (ADD, r5g6b5, null, r5g6b5, fast_composite_add_0565_0565),
+ PIXMAN_STD_FAST_PATH (ADD, b5g6r5, null, b5g6r5, fast_composite_add_0565_0565),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, fast_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, fast_composite_add_8888_8888),
PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, fast_composite_add_8_8),
diff --git a/pixman/pixman/pixman-mmx.c b/pixman/pixman/pixman-mmx.c
index 01a2bc93b..6e292c6b2 100644
--- a/pixman/pixman/pixman-mmx.c
+++ b/pixman/pixman/pixman-mmx.c
@@ -185,6 +185,9 @@ typedef struct
mmxdatafield mmx_565_b;
mmxdatafield mmx_packed_565_rb;
mmxdatafield mmx_packed_565_g;
+ mmxdatafield mmx_expand_565_g;
+ mmxdatafield mmx_expand_565_b;
+ mmxdatafield mmx_expand_565_r;
#ifndef USE_LOONGSON_MMI
mmxdatafield mmx_mask_0;
mmxdatafield mmx_mask_1;
@@ -216,6 +219,9 @@ static const mmx_data_t c =
MMXDATA_INIT (.mmx_565_b, 0x00000000000000f8),
MMXDATA_INIT (.mmx_packed_565_rb, 0x00f800f800f800f8),
MMXDATA_INIT (.mmx_packed_565_g, 0x0000fc000000fc00),
+ MMXDATA_INIT (.mmx_expand_565_g, 0x07e007e007e007e0),
+ MMXDATA_INIT (.mmx_expand_565_b, 0x001f001f001f001f),
+ MMXDATA_INIT (.mmx_expand_565_r, 0xf800f800f800f800),
#ifndef USE_LOONGSON_MMI
MMXDATA_INIT (.mmx_mask_0, 0xffffffffffff0000),
MMXDATA_INIT (.mmx_mask_1, 0xffffffff0000ffff),
@@ -518,6 +524,36 @@ expand565 (__m64 pixel, int pos)
return _mm_srli_pi16 (pixel, 8);
}
+/* Expand 4 16 bit pixels in an mmx register into two mmx registers of
+ *
+ * AARRGGBBRRGGBB
+ */
+static force_inline void
+expand_4xpacked565 (__m64 vin, __m64 *vout0, __m64 *vout1, int full_alpha)
+{
+ __m64 t0, t1, alpha = _mm_setzero_si64 ();;
+ __m64 r = _mm_and_si64 (vin, MC (expand_565_r));
+ __m64 g = _mm_and_si64 (vin, MC (expand_565_g));
+ __m64 b = _mm_and_si64 (vin, MC (expand_565_b));
+ if (full_alpha)
+ alpha = _mm_cmpeq_pi32 (alpha, alpha);
+
+ /* Replicate high bits into empty low bits. */
+ r = _mm_or_si64 (_mm_srli_pi16 (r, 8), _mm_srli_pi16 (r, 13));
+ g = _mm_or_si64 (_mm_srli_pi16 (g, 3), _mm_srli_pi16 (g, 9));
+ b = _mm_or_si64 (_mm_slli_pi16 (b, 3), _mm_srli_pi16 (b, 2));
+
+ r = _mm_packs_pu16 (r, _mm_setzero_si64 ()); /* 00 00 00 00 R3 R2 R1 R0 */
+ g = _mm_packs_pu16 (g, _mm_setzero_si64 ()); /* 00 00 00 00 G3 G2 G1 G0 */
+ b = _mm_packs_pu16 (b, _mm_setzero_si64 ()); /* 00 00 00 00 B3 B2 B1 B0 */
+
+ t1 = _mm_unpacklo_pi8 (r, alpha); /* A3 R3 A2 R2 A1 R1 A0 R0 */
+ t0 = _mm_unpacklo_pi8 (b, g); /* G3 B3 G2 B2 G1 B1 G0 B0 */
+
+ *vout0 = _mm_unpacklo_pi16 (t0, t1); /* A1 R1 G1 B1 A0 R0 G0 B0 */
+ *vout1 = _mm_unpackhi_pi16 (t0, t1); /* A3 R3 G3 B3 A2 R2 G2 B2 */
+}
+
static force_inline __m64
expand8888 (__m64 in, int pos)
{
@@ -533,6 +569,17 @@ expandx888 (__m64 in, int pos)
return _mm_or_si64 (expand8888 (in, pos), MC (full_alpha));
}
+static force_inline void
+expand_4x565 (__m64 vin, __m64 *vout0, __m64 *vout1, __m64 *vout2, __m64 *vout3, int full_alpha)
+{
+ __m64 v0, v1;
+ expand_4xpacked565 (vin, &v0, &v1, full_alpha);
+ *vout0 = expand8888 (v0, 0);
+ *vout1 = expand8888 (v0, 1);
+ *vout2 = expand8888 (v1, 0);
+ *vout3 = expand8888 (v1, 1);
+}
+
static force_inline __m64
pack_565 (__m64 pixel, __m64 target, int pos)
{
@@ -598,14 +645,14 @@ pack_4xpacked565 (__m64 a, __m64 b)
#endif
}
+#ifndef _MSC_VER
+
static force_inline __m64
pack_4x565 (__m64 v0, __m64 v1, __m64 v2, __m64 v3)
{
return pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3));
}
-#ifndef _MSC_VER
-
static force_inline __m64
pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
{
@@ -617,6 +664,11 @@ pix_add_mul (__m64 x, __m64 a, __m64 y, __m64 b)
#else
+/* MSVC only handles a "pass by register" of up to three SSE intrinsics */
+
+#define pack_4x565(v0, v1, v2, v3) \
+ pack_4xpacked565 (pack8888 (v0, v1), pack8888 (v2, v3))
+
#define pix_add_mul(x, a, y, b) \
( x = pix_multiply (x, a), \
y = pix_multiply (y, b), \
@@ -1403,11 +1455,14 @@ mmx_composite_over_n_0565 (pixman_implementation_t *imp,
while (w >= 4)
{
__m64 vdest = *(__m64 *)dst;
+ __m64 v0, v1, v2, v3;
+
+ expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
- __m64 v0 = over (vsrc, vsrca, expand565 (vdest, 0));
- __m64 v1 = over (vsrc, vsrca, expand565 (vdest, 1));
- __m64 v2 = over (vsrc, vsrca, expand565 (vdest, 2));
- __m64 v3 = over (vsrc, vsrca, expand565 (vdest, 3));
+ v0 = over (vsrc, vsrca, v0);
+ v1 = over (vsrc, vsrca, v1);
+ v2 = over (vsrc, vsrca, v2);
+ v3 = over (vsrc, vsrca, v3);
*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
@@ -1823,16 +1878,19 @@ mmx_composite_over_8888_0565 (pixman_implementation_t *imp,
while (w >= 4)
{
__m64 vdest = *(__m64 *)dst;
+ __m64 v0, v1, v2, v3;
+
+ expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
__m64 vsrc0 = load8888 ((src + 0));
__m64 vsrc1 = load8888 ((src + 1));
__m64 vsrc2 = load8888 ((src + 2));
__m64 vsrc3 = load8888 ((src + 3));
- __m64 v0 = over (vsrc0, expand_alpha (vsrc0), expand565 (vdest, 0));
- __m64 v1 = over (vsrc1, expand_alpha (vsrc1), expand565 (vdest, 1));
- __m64 v2 = over (vsrc2, expand_alpha (vsrc2), expand565 (vdest, 2));
- __m64 v3 = over (vsrc3, expand_alpha (vsrc3), expand565 (vdest, 3));
+ v0 = over (vsrc0, expand_alpha (vsrc0), v0);
+ v1 = over (vsrc1, expand_alpha (vsrc1), v1);
+ v2 = over (vsrc2, expand_alpha (vsrc2), v2);
+ v3 = over (vsrc3, expand_alpha (vsrc3), v3);
*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
@@ -2174,6 +2232,8 @@ mmx_composite_src_x888_0565 (pixman_implementation_t *imp,
w--;
}
}
+
+ _mm_empty ();
}
static void
@@ -2370,19 +2430,21 @@ mmx_composite_over_n_8_0565 (pixman_implementation_t *imp,
else if (m0 | m1 | m2 | m3)
{
__m64 vdest = *(__m64 *)dst;
+ __m64 v0, v1, v2, v3;
+
+ expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
__m64 vm0 = to_m64 (m0);
- __m64 v0 = in_over (vsrc, vsrca, expand_alpha_rev (vm0),
- expand565 (vdest, 0));
+ v0 = in_over (vsrc, vsrca, expand_alpha_rev (vm0), v0);
+
__m64 vm1 = to_m64 (m1);
- __m64 v1 = in_over (vsrc, vsrca, expand_alpha_rev (vm1),
- expand565 (vdest, 1));
+ v1 = in_over (vsrc, vsrca, expand_alpha_rev (vm1), v1);
+
__m64 vm2 = to_m64 (m2);
- __m64 v2 = in_over (vsrc, vsrca, expand_alpha_rev (vm2),
- expand565 (vdest, 2));
+ v2 = in_over (vsrc, vsrca, expand_alpha_rev (vm2), v2);
+
__m64 vm3 = to_m64 (m3);
- __m64 v3 = in_over (vsrc, vsrca, expand_alpha_rev (vm3),
- expand565 (vdest, 3));
+ v3 = in_over (vsrc, vsrca, expand_alpha_rev (vm3), v3);
*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);;
}
@@ -2491,11 +2553,19 @@ mmx_composite_over_pixbuf_0565 (pixman_implementation_t *imp,
else if (s0 | s1 | s2 | s3)
{
__m64 vdest = *(__m64 *)dst;
+ __m64 v0, v1, v2, v3;
+
+ __m64 vsrc0 = load8888 (&s0);
+ __m64 vsrc1 = load8888 (&s1);
+ __m64 vsrc2 = load8888 (&s2);
+ __m64 vsrc3 = load8888 (&s3);
- __m64 v0 = over_rev_non_pre (load8888 (&s0), expand565 (vdest, 0));
- __m64 v1 = over_rev_non_pre (load8888 (&s1), expand565 (vdest, 1));
- __m64 v2 = over_rev_non_pre (load8888 (&s2), expand565 (vdest, 2));
- __m64 v3 = over_rev_non_pre (load8888 (&s3), expand565 (vdest, 3));
+ expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
+
+ v0 = over_rev_non_pre (vsrc0, v0);
+ v1 = over_rev_non_pre (vsrc1, v1);
+ v2 = over_rev_non_pre (vsrc2, v2);
+ v3 = over_rev_non_pre (vsrc3, v3);
*(__m64 *)dst = pack_4x565 (v0, v1, v2, v3);
}
@@ -2671,11 +2741,14 @@ mmx_composite_over_n_8888_0565_ca (pixman_implementation_t *imp,
if ((m0 | m1 | m2 | m3))
{
__m64 vdest = *(__m64 *)q;
+ __m64 v0, v1, v2, v3;
+
+ expand_4x565 (vdest, &v0, &v1, &v2, &v3, 0);
- __m64 v0 = in_over (vsrc, vsrca, load8888 (&m0), expand565 (vdest, 0));
- __m64 v1 = in_over (vsrc, vsrca, load8888 (&m1), expand565 (vdest, 1));
- __m64 v2 = in_over (vsrc, vsrca, load8888 (&m2), expand565 (vdest, 2));
- __m64 v3 = in_over (vsrc, vsrca, load8888 (&m3), expand565 (vdest, 3));
+ v0 = in_over (vsrc, vsrca, load8888 (&m0), v0);
+ v1 = in_over (vsrc, vsrca, load8888 (&m1), v1);
+ v2 = in_over (vsrc, vsrca, load8888 (&m2), v2);
+ v3 = in_over (vsrc, vsrca, load8888 (&m3), v3);
*(__m64 *)q = pack_4x565 (v0, v1, v2, v3);
}
@@ -3006,6 +3079,90 @@ mmx_composite_add_8_8 (pixman_implementation_t *imp,
}
static void
+mmx_composite_add_0565_0565 (pixman_implementation_t *imp,
+ pixman_composite_info_t *info)
+{
+ PIXMAN_COMPOSITE_ARGS (info);
+ uint16_t *dst_line, *dst;
+ uint32_t d;
+ uint16_t *src_line, *src;
+ uint32_t s;
+ int dst_stride, src_stride;
+ int32_t w;
+
+ CHECKPOINT ();
+
+ PIXMAN_IMAGE_GET_LINE (src_image, src_x, src_y, uint16_t, src_stride, src_line, 1);
+ PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint16_t, dst_stride, dst_line, 1);
+
+ while (height--)
+ {
+ dst = dst_line;
+ dst_line += dst_stride;
+ src = src_line;
+ src_line += src_stride;
+ w = width;
+
+ while (w && (unsigned long)dst & 7)
+ {
+ s = *src++;
+ if (s)
+ {
+ d = *dst;
+ s = CONVERT_0565_TO_8888 (s);
+ if (d)
+ {
+ d = CONVERT_0565_TO_8888 (d);
+ UN8x4_ADD_UN8x4 (s, d);
+ }
+ *dst = CONVERT_8888_TO_0565 (s);
+ }
+ dst++;
+ w--;
+ }
+
+ while (w >= 4)
+ {
+ __m64 vdest = *(__m64 *)dst;
+ __m64 vsrc = ldq_u ((__m64 *)src);
+ __m64 vd0, vd1;
+ __m64 vs0, vs1;
+
+ expand_4xpacked565 (vdest, &vd0, &vd1, 0);
+ expand_4xpacked565 (vsrc, &vs0, &vs1, 0);
+
+ vd0 = _mm_adds_pu8 (vd0, vs0);
+ vd1 = _mm_adds_pu8 (vd1, vs1);
+
+ *(__m64 *)dst = pack_4xpacked565 (vd0, vd1);
+
+ dst += 4;
+ src += 4;
+ w -= 4;
+ }
+
+ while (w--)
+ {
+ s = *src++;
+ if (s)
+ {
+ d = *dst;
+ s = CONVERT_0565_TO_8888 (s);
+ if (d)
+ {
+ d = CONVERT_0565_TO_8888 (d);
+ UN8x4_ADD_UN8x4 (s, d);
+ }
+ *dst = CONVERT_8888_TO_0565 (s);
+ }
+ dst++;
+ }
+ }
+
+ _mm_empty ();
+}
+
+static void
mmx_composite_add_8888_8888 (pixman_implementation_t *imp,
pixman_composite_info_t *info)
{
@@ -3280,6 +3437,75 @@ mmx_composite_over_x888_8_8888 (pixman_implementation_t *imp,
_mm_empty ();
}
+static void
+mmx_composite_over_reverse_n_8888 (pixman_implementation_t *imp,
+ pixman_composite_info_t *info)
+{
+ PIXMAN_COMPOSITE_ARGS (info);
+ uint32_t src;
+ uint32_t *dst_line, *dst;
+ int32_t w;
+ int dst_stride;
+ __m64 vsrc;
+
+ CHECKPOINT ();
+
+ src = _pixman_image_get_solid (imp, src_image, dest_image->bits.format);
+
+ if (src == 0)
+ return;
+
+ PIXMAN_IMAGE_GET_LINE (dest_image, dest_x, dest_y, uint32_t, dst_stride, dst_line, 1);
+
+ vsrc = load8888 (&src);
+
+ while (height--)
+ {
+ dst = dst_line;
+ dst_line += dst_stride;
+ w = width;
+
+ CHECKPOINT ();
+
+ while (w && (unsigned long)dst & 7)
+ {
+ __m64 vdest = load8888 (dst);
+
+ store8888 (dst, over (vdest, expand_alpha (vdest), vsrc));
+
+ w--;
+ dst++;
+ }
+
+ while (w >= 2)
+ {
+ __m64 vdest = *(__m64 *)dst;
+ __m64 dest0 = expand8888 (vdest, 0);
+ __m64 dest1 = expand8888 (vdest, 1);
+
+
+ dest0 = over (dest0, expand_alpha (dest0), vsrc);
+ dest1 = over (dest1, expand_alpha (dest1), vsrc);
+
+ *(__m64 *)dst = pack8888 (dest0, dest1);
+
+ dst += 2;
+ w -= 2;
+ }
+
+ CHECKPOINT ();
+
+ if (w)
+ {
+ __m64 vdest = load8888 (dst);
+
+ store8888 (dst, over (vdest, expand_alpha (vdest), vsrc));
+ }
+ }
+
+ _mm_empty ();
+}
+
static uint32_t *
mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
{
@@ -3318,6 +3544,7 @@ mmx_fetch_x8r8g8b8 (pixman_iter_t *iter, const uint32_t *mask)
w--;
}
+ _mm_empty ();
return iter->buffer;
}
@@ -3341,14 +3568,12 @@ mmx_fetch_r5g6b5 (pixman_iter_t *iter, const uint32_t *mask)
while (w >= 4)
{
__m64 vsrc = ldq_u ((__m64 *)src);
+ __m64 mm0, mm1;
- __m64 mm0 = expand565 (vsrc, 0);
- __m64 mm1 = expand565 (vsrc, 1);
- __m64 mm2 = expand565 (vsrc, 2);
- __m64 mm3 = expand565 (vsrc, 3);
+ expand_4xpacked565 (vsrc, &mm0, &mm1, 1);
- *(__m64 *)(dst + 0) = _mm_or_si64 (pack8888 (mm0, mm1), MC (ff000000));
- *(__m64 *)(dst + 2) = _mm_or_si64 (pack8888 (mm2, mm3), MC (ff000000));
+ *(__m64 *)(dst + 0) = mm0;
+ *(__m64 *)(dst + 2) = mm1;
dst += 4;
src += 4;
@@ -3363,6 +3588,7 @@ mmx_fetch_r5g6b5 (pixman_iter_t *iter, const uint32_t *mask)
w--;
}
+ _mm_empty ();
return iter->buffer;
}
@@ -3408,6 +3634,7 @@ mmx_fetch_a8 (pixman_iter_t *iter, const uint32_t *mask)
w--;
}
+ _mm_empty ();
return iter->buffer;
}
@@ -3510,6 +3737,11 @@ static const pixman_fast_path_t mmx_fast_paths[] =
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, x8b8g8r8, mmx_composite_over_8888_8888 ),
PIXMAN_STD_FAST_PATH (OVER, a8b8g8r8, null, b5g6r5, mmx_composite_over_8888_0565 ),
+ PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8r8g8b8, mmx_composite_over_reverse_n_8888),
+ PIXMAN_STD_FAST_PATH (OVER_REVERSE, solid, null, a8b8g8r8, mmx_composite_over_reverse_n_8888),
+
+ PIXMAN_STD_FAST_PATH (ADD, r5g6b5, null, r5g6b5, mmx_composite_add_0565_0565 ),
+ PIXMAN_STD_FAST_PATH (ADD, b5g6r5, null, b5g6r5, mmx_composite_add_0565_0565 ),
PIXMAN_STD_FAST_PATH (ADD, a8r8g8b8, null, a8r8g8b8, mmx_composite_add_8888_8888 ),
PIXMAN_STD_FAST_PATH (ADD, a8b8g8r8, null, a8b8g8r8, mmx_composite_add_8888_8888 ),
PIXMAN_STD_FAST_PATH (ADD, a8, null, a8, mmx_composite_add_8_8 ),
diff --git a/pixman/test/composite.c b/pixman/test/composite.c
index 48bde9c7d..94b482551 100644
--- a/pixman/test/composite.c
+++ b/pixman/test/composite.c
@@ -525,15 +525,16 @@ composite_test (image_t *dst,
int testno)
{
pixman_color_t fill;
- pixman_rectangle16_t rect;
color_t expected, tdst, tsrc, tmsk;
pixel_checker_t checker;
+ pixman_image_t *solid;
/* Initialize dst */
compute_pixman_color (dst->color, &fill);
- rect.x = rect.y = 0;
- rect.width = rect.height = dst->size;
- pixman_image_fill_rectangles (PIXMAN_OP_SRC, dst->image, &fill, 1, &rect);
+ solid = pixman_image_create_solid_fill (&fill);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, dst->image,
+ 0, 0, 0, 0, 0, 0, dst->size, dst->size);
+ pixman_image_unref (solid);
if (mask)
{
@@ -644,16 +645,16 @@ image_init (image_t *info,
if (info->size)
{
- pixman_rectangle16_t rect;
+ pixman_image_t *solid;
info->image = pixman_image_create_bits (info->format->format,
info->size, info->size,
NULL, 0);
- rect.x = rect.y = 0;
- rect.width = rect.height = info->size;
- pixman_image_fill_rectangles (PIXMAN_OP_SRC, info->image, &fill,
- 1, &rect);
+ solid = pixman_image_create_solid_fill (&fill);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, info->image,
+ 0, 0, 0, 0, 0, 0, info->size, info->size);
+ pixman_image_unref (solid);
if (sizes[size] & REPEAT)
{
diff --git a/pixman/test/lowlevel-blt-bench.c b/pixman/test/lowlevel-blt-bench.c
index 8a39a4615..b44b9f819 100644
--- a/pixman/test/lowlevel-blt-bench.c
+++ b/pixman/test/lowlevel-blt-bench.c
@@ -661,6 +661,7 @@ tests_tbl[] =
{ "outrev_n_8888_1555_ca", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_a1r5g5b5 },
{ "outrev_n_8888_x888_ca", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_x8r8g8b8 },
{ "outrev_n_8888_8888_ca", PIXMAN_a8r8g8b8, 1, PIXMAN_OP_OUT_REV, PIXMAN_a8r8g8b8, 2, PIXMAN_a8r8g8b8 },
+ { "over_reverse_n_8888", PIXMAN_a8r8g8b8, 0, PIXMAN_OP_OVER_REVERSE, PIXMAN_null, 0, PIXMAN_a8r8g8b8 },
};
int
diff --git a/pixman/test/scaling-crash-test.c b/pixman/test/scaling-crash-test.c
index ed57ae024..0dac892b5 100644
--- a/pixman/test/scaling-crash-test.c
+++ b/pixman/test/scaling-crash-test.c
@@ -32,8 +32,8 @@ run_test (int32_t dst_width,
pixman_transform_t transform;
uint32_t * srcbuf;
uint32_t * dstbuf;
- pixman_box32_t box = { 0, 0, src_width, src_height };
pixman_color_t color_cc = { 0xcccc, 0xcccc, 0xcccc, 0xcccc };
+ pixman_image_t * solid;
int result;
int i;
@@ -62,7 +62,10 @@ run_test (int32_t dst_width,
PIXMAN_a8r8g8b8, src_width, src_height,
srcbuf + (src_width + 10) * 5 + 5, (src_width + 10) * 4);
- pixman_image_fill_boxes (PIXMAN_OP_SRC, src_img, &color_cc, 1, &box);
+ solid = pixman_image_create_solid_fill (&color_cc);
+ pixman_image_composite32 (PIXMAN_OP_SRC, solid, NULL, src_img,
+ 0, 0, 0, 0, 0, 0, src_width, src_height);
+ pixman_image_unref (solid);
dst_img = pixman_image_create_bits (
PIXMAN_a8r8g8b8, dst_width, dst_height, dstbuf, dst_width * 4);
diff --git a/xorg-server/Xext/hashtable.c b/xorg-server/Xext/hashtable.c
index 2adf92e56..9d9ef8949 100644
--- a/xorg-server/Xext/hashtable.c
+++ b/xorg-server/Xext/hashtable.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_DIX_CONFIG_H
+#include <dix-config.h>
+#endif
+
#include <stdlib.h>
#include "misc.h"
#include "hashtable.h"
diff --git a/xorg-server/Xi/stubs.c b/xorg-server/Xi/stubs.c
index 8baa5a09b..39bee7c27 100644
--- a/xorg-server/Xi/stubs.c
+++ b/xorg-server/Xi/stubs.c
@@ -141,4 +141,5 @@ NewInputDeviceRequest(InputOption *options, InputAttributes * attrs,
void
DeleteInputDeviceRequest(DeviceIntPtr dev)
{
+ RemoveDevice(dev, TRUE);
}
diff --git a/xorg-server/hw/vfb/InitOutput.c b/xorg-server/hw/vfb/InitOutput.c
index e2cd96cdc..16edf4307 100644
--- a/xorg-server/hw/vfb/InitOutput.c
+++ b/xorg-server/hw/vfb/InitOutput.c
@@ -774,6 +774,13 @@ vfbCloseScreen(int index, ScreenPtr pScreen)
for (i = 0; i < screenInfo.numScreens; i++)
SetInstalledColormap(screenInfo.screens[i], NULL);
+ /*
+ * fb overwrites miCloseScreen, so do this here
+ */
+ if (pScreen->devPrivate)
+ (*pScreen->DestroyPixmap) (pScreen->devPrivate);
+ pScreen->devPrivate = NULL;
+
return pScreen->CloseScreen(index, pScreen);
}
diff --git a/xorg-server/hw/xfree86/common/xf86Xinput.c b/xorg-server/hw/xfree86/common/xf86Xinput.c
index 77b800000..bee407bf9 100644
--- a/xorg-server/hw/xfree86/common/xf86Xinput.c
+++ b/xorg-server/hw/xfree86/common/xf86Xinput.c
@@ -1059,26 +1059,24 @@ xf86PostMotionEventP(DeviceIntPtr device,
xf86PostMotionEventM(device, is_absolute, &mask);
}
-void
-xf86PostMotionEventM(DeviceIntPtr device,
- int is_absolute, const ValuatorMask *mask)
+static int
+xf86CheckMotionEvent4DGA(DeviceIntPtr device, int is_absolute,
+ const ValuatorMask *mask)
{
- int flags = 0;
-
- if (valuator_mask_num_valuators(mask) > 0) {
- if (is_absolute)
- flags = POINTER_ABSOLUTE;
- else
- flags = POINTER_RELATIVE | POINTER_ACCELERATE;
- }
+ int stolen = 0;
#if XFreeXDGA
+ ScreenPtr scr = NULL;
+ int idx, i;
+
/* The evdev driver may not always send all axes across. */
- if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1))
- if (miPointerGetScreen(device)) {
- int index = miPointerGetScreen(device)->myNum;
+ if (valuator_mask_isset(mask, 0) || valuator_mask_isset(mask, 1)) {
+ scr = miPointerGetScreen(device);
+ if (scr) {
int dx = 0, dy = 0;
+ idx = scr->myNum;
+
if (valuator_mask_isset(mask, 0)) {
dx = valuator_mask_get(mask, 0);
if (is_absolute)
@@ -1091,11 +1089,75 @@ xf86PostMotionEventM(DeviceIntPtr device,
dy -= device->last.valuators[1];
}
- if (DGAStealMotionEvent(device, index, dx, dy))
- return;
+ if (DGAStealMotionEvent(device, idx, dx, dy))
+ stolen = 1;
+ }
+ }
+
+ for (i = 2; i < valuator_mask_size(mask); i++) {
+ AxisInfoPtr ax;
+ double incr;
+ int val, button;
+
+ if (i >= device->valuator->numAxes)
+ break;
+
+ if (!valuator_mask_isset(mask, i))
+ continue;
+
+ ax = &device->valuator->axes[i];
+
+ if (ax->scroll.type == SCROLL_TYPE_NONE)
+ continue;
+
+ if (!scr) {
+ scr = miPointerGetScreen(device);
+ if (!scr)
+ break;
+ idx = scr->myNum;
+ }
+
+ incr = ax->scroll.increment;
+ val = valuator_mask_get(mask, i);
+
+ if (ax->scroll.type == SCROLL_TYPE_VERTICAL) {
+ if (incr * val < 0)
+ button = 4; /* up */
+ else
+ button = 5; /* down */
+ } else { /* SCROLL_TYPE_HORIZONTAL */
+ if (incr * val < 0)
+ button = 6; /* left */
+ else
+ button = 7; /* right */
}
+
+ if (DGAStealButtonEvent(device, idx, button, 1) &&
+ DGAStealButtonEvent(device, idx, button, 0))
+ stolen = 1;
+ }
+
#endif
+ return stolen;
+}
+
+void
+xf86PostMotionEventM(DeviceIntPtr device,
+ int is_absolute, const ValuatorMask *mask)
+{
+ int flags = 0;
+
+ if (xf86CheckMotionEvent4DGA(device, is_absolute, mask))
+ return;
+
+ if (valuator_mask_num_valuators(mask) > 0) {
+ if (is_absolute)
+ flags = POINTER_ABSOLUTE;
+ else
+ flags = POINTER_RELATIVE | POINTER_ACCELERATE;
+ }
+
QueuePointerEvents(device, MotionNotify, 0, flags, mask);
}