aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
committermarha <marha@users.sourceforge.net>2014-06-08 15:05:49 +0200
commit71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec (patch)
treeea689cdd51f395980ddc37dc33781635976f3a16
parentaec798fb4dc72d616732d0fa711faffaa8cd7590 (diff)
parent2acb86c9b086bdb9a3897db0b93820652e07cb59 (diff)
downloadvcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.gz
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.tar.bz2
vcxsrv-71cc8d9b7dc729934a29445cbd6d1f7a6d9ecbec.zip
Merge remote-tracking branch 'origin/released'
Conflicts: apps/xwininfo/xwininfo.c xorg-server/hw/xwin/glx/indirect.c
-rw-r--r--apps/xwininfo/autogen.sh5
-rw-r--r--apps/xwininfo/configure.ac3
-rw-r--r--apps/xwininfo/dsimple.h2
-rw-r--r--apps/xwininfo/man/xwininfo.man8
-rwxr-xr-x[-rw-r--r--]apps/xwininfo/xwininfo.c8
-rw-r--r--fontconfig/src/fccache.c24
-rw-r--r--fontconfig/src/fcdir.c30
-rw-r--r--fontconfig/src/fcint.h7
-rw-r--r--libX11/modules/im/ximcp/imCallbk.c6
-rw-r--r--libX11/modules/im/ximcp/imDefIc.c7
-rw-r--r--libX11/modules/im/ximcp/imDefIm.c6
-rw-r--r--libX11/modules/im/ximcp/imDefLkup.c13
-rw-r--r--libX11/modules/im/ximcp/imInt.c9
-rw-r--r--libX11/modules/im/ximcp/imLcIm.c102
-rw-r--r--libX11/modules/im/ximcp/imRmAttr.c24
-rw-r--r--libX11/modules/im/ximcp/imThaiIc.c18
-rw-r--r--libX11/modules/lc/def/lcDefConv.c3
-rw-r--r--libX11/modules/lc/gen/lcGenConv.c53
-rw-r--r--libX11/modules/om/generic/omGeneric.c43
-rw-r--r--libX11/src/FetchName.c4
-rw-r--r--libX11/src/Font.c22
-rw-r--r--libX11/src/FontInfo.c4
-rw-r--r--libX11/src/FontNames.c4
-rw-r--r--libX11/src/GetFPath.c4
-rw-r--r--libX11/src/GetHints.c16
-rw-r--r--libX11/src/GetNrmHint.c2
-rw-r--r--libX11/src/GetRGBCMap.c8
-rw-r--r--libX11/src/GetStCmap.c2
-rw-r--r--libX11/src/GetWMCMapW.c2
-rw-r--r--libX11/src/ImUtil.c4
-rw-r--r--libX11/src/InitExt.c2
-rw-r--r--libX11/src/KeyBind.c9
-rw-r--r--libX11/src/ListExt.c4
-rw-r--r--libX11/src/ModMap.c5
-rw-r--r--libX11/src/OpenDis.c34
-rw-r--r--libX11/src/PutImage.c11
-rw-r--r--libX11/src/RdBitF.c2
-rw-r--r--libX11/src/ScrResStr.c3
-rw-r--r--libX11/src/StBytes.c2
-rw-r--r--libX11/src/XlibInt.c12
-rw-r--r--libX11/src/xkb/XKBNames.c9
-rw-r--r--libX11/src/xlibi18n/lcUTF8.c4
-rw-r--r--libXdmcp/autogen.sh4
-rw-r--r--libXdmcp/configure.ac1
-rw-r--r--libXft/NEWS8
-rw-r--r--libXft/configure.ac2
-rw-r--r--mesalib/configure.ac44
-rw-r--r--mesalib/docs/GL3.txt8
-rw-r--r--mesalib/docs/index.html14
-rw-r--r--mesalib/docs/llvmpipe.html52
-rw-r--r--mesalib/docs/relnotes.html2
-rw-r--r--mesalib/docs/relnotes/10.2.1.html61
-rw-r--r--mesalib/docs/relnotes/10.2.html6
-rw-r--r--mesalib/docs/relnotes/10.3.html1
-rw-r--r--mesalib/scons/crossmingw.py17
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug.c32
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_debug.h9
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_math.h2
-rw-r--r--mesalib/src/gallium/auxiliary/util/u_video.h4
-rw-r--r--mesalib/src/glsl/Makefile.am1
-rw-r--r--mesalib/src/glsl/SConscript2
-rw-r--r--mesalib/src/glsl/ast.h11
-rw-r--r--mesalib/src/glsl/ast_function.cpp6
-rw-r--r--mesalib/src/glsl/ast_to_hir.cpp114
-rw-r--r--mesalib/src/glsl/glsl_lexer.ll3
-rw-r--r--mesalib/src/glsl/glsl_parser.yy69
-rw-r--r--mesalib/src/glsl/glsl_parser_extras.cpp5
-rw-r--r--mesalib/src/glsl/glsl_types.cpp22
-rw-r--r--mesalib/src/glsl/glsl_types.h3
-rw-r--r--mesalib/src/glsl/ir.cpp65
-rw-r--r--mesalib/src/glsl/ir.h230
-rw-r--r--mesalib/src/glsl/ir_function.cpp199
-rw-r--r--mesalib/src/glsl/ir_validate.cpp2
-rw-r--r--mesalib/src/glsl/loop_analysis.cpp6
-rw-r--r--mesalib/src/loader/loader.c172
-rwxr-xr-xmesalib/src/mapi/glapi/gen/gl_API.xml3
-rw-r--r--mesalib/src/mapi/glapi/glapi_dispatch.c57
-rw-r--r--mesalib/src/mesa/drivers/common/meta_blit.c3
-rw-r--r--mesalib/src/mesa/main/get.c16
-rw-r--r--mesalib/src/mesa/main/get_hash_generator.py2
-rw-r--r--mesalib/src/mesa/main/get_hash_params.py4
-rw-r--r--mesalib/src/mesa/main/hash.c10
-rw-r--r--mesalib/src/mesa/main/performance_monitor.c5
-rw-r--r--mesalib/src/mesa/program/prog_hash_table.c8
-rw-r--r--mesalib/src/mesa/state_tracker/st_atom_texture.c11
-rw-r--r--mkfontscale/autogen.sh5
-rw-r--r--mkfontscale/configure.ac1
-rw-r--r--xorg-server/Xi/exevents.c4
-rw-r--r--xorg-server/config/10-quirks.conf16
-rw-r--r--xorg-server/configure.ac8
-rw-r--r--xorg-server/dix/devices.c7
-rw-r--r--xorg-server/dix/events.c2
-rw-r--r--xorg-server/fb/fbscreen.c2
-rw-r--r--xorg-server/hw/xfree86/common/compiler.h5
-rw-r--r--xorg-server/hw/xfree86/common/xf86Config.c2
-rw-r--r--xorg-server/hw/xfree86/loader/loadmod.c6
-rw-r--r--xorg-server/hw/xfree86/os-support/linux/lnx_video.c3
-rw-r--r--xorg-server/hw/xfree86/xorgconf.cpp2
-rw-r--r--xorg-server/hw/xquartz/bundle/Info.plist.cpp4
-rw-r--r--xorg-server/hw/xquartz/darwin.c16
-rw-r--r--xorg-server/hw/xquartz/xpr/xprScreen.c16
-rwxr-xr-x[-rw-r--r--]xorg-server/hw/xwin/glx/indirect.c11
-rw-r--r--xorg-server/include/misc.h18
-rwxr-xr-xxorg-server/include/servermd.h14
-rw-r--r--xorg-server/include/xwin-config.h.in3
-rw-r--r--xorg-server/man/Xserver.man5
-rw-r--r--xorg-server/mi/mieq.c4
-rw-r--r--xorg-server/os/log.c65
-rw-r--r--xorg-server/present/present.c126
-rw-r--r--xorg-server/present/present_priv.h1
-rw-r--r--xorg-server/test/input.c14
-rw-r--r--xorg-server/xfixes/cursor.c2
112 files changed, 1454 insertions, 744 deletions
diff --git a/apps/xwininfo/autogen.sh b/apps/xwininfo/autogen.sh
index e81f98910..fc34bd55c 100644
--- a/apps/xwininfo/autogen.sh
+++ b/apps/xwininfo/autogen.sh
@@ -9,5 +9,6 @@ cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
-$srcdir/configure --enable-maintainer-mode "$@"
-
+if test -z "$NOCONFIGURE"; then
+ $srcdir/configure "$@"
+fi
diff --git a/apps/xwininfo/configure.ac b/apps/xwininfo/configure.ac
index b28dd894a..3149a5fe6 100644
--- a/apps/xwininfo/configure.ac
+++ b/apps/xwininfo/configure.ac
@@ -31,7 +31,6 @@ AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
AM_ICONV
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
@@ -67,7 +66,7 @@ PKG_CHECK_MODULES(XWININFO, [xcb >= 1.6] xcb-shape ${xcb_icccm_pc})
# Even when using xcb, xproto is still required for Xfuncproto.h
# and libX11 headers for cursorfont.h
-PKG_CHECK_MODULES(XLIB, x11 [xproto >= 7.0.17])
+PKG_CHECK_MODULES(XLIB, x11 [xproto >= 7.0.25])
XWININFO_CFLAGS="${XWININFO_CFLAGS} ${XLIB_CFLAGS}"
XWININFO_LIBS="${XWININFO_LIBS} ${LIBICONV}"
diff --git a/apps/xwininfo/dsimple.h b/apps/xwininfo/dsimple.h
index d0dd71ae9..7dacdee92 100644
--- a/apps/xwininfo/dsimple.h
+++ b/apps/xwininfo/dsimple.h
@@ -55,7 +55,7 @@ void Setup_Display_And_Screen (const char *displayname,
xcb_window_t Select_Window (xcb_connection_t *, const xcb_screen_t *, int);
xcb_window_t Window_With_Name (xcb_connection_t *, xcb_window_t, const char *);
-void Fatal_Error (const char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1, 2);
+void Fatal_Error (const char *, ...) _X_NORETURN _X_ATTRIBUTE_PRINTF(1, 2) _X_COLD;
void Print_X_Error (xcb_connection_t *, xcb_generic_error_t *);
diff --git a/apps/xwininfo/man/xwininfo.man b/apps/xwininfo/man/xwininfo.man
index 6da713943..66418c6dd 100644
--- a/apps/xwininfo/man/xwininfo.man
+++ b/apps/xwininfo/man/xwininfo.man
@@ -32,7 +32,7 @@ xwininfo \- window information utility for X
[\-children] [\-tree] [\-stats] [\-bits] [\-events] [\-size] [\-wm] [\-shape]
[\-frame] [\-all]
[\-english] [\-metric]
-[\-display \fIdisplay\fP]
+[\-display \fIdisplay\fP] [\-version]
.SH DESCRIPTION
.PP
.I Xwininfo
@@ -154,6 +154,12 @@ This option is a quick way to ask for all information possible.
.TP 8
.B \-display \fIdisplay\fP
This option allows you to specify the server to connect to; see \fIX(__miscmansuffix__)\fP.
+PP
+.TP 8
+.B \-version
+This option indicates that
+.I xwininfo
+should print its version information and exit.
.SH EXAMPLE
.PP
The following is a sample summary taken with no options specified:
diff --git a/apps/xwininfo/xwininfo.c b/apps/xwininfo/xwininfo.c
index 59e09aff8..cda2e2f9d 100644..100755
--- a/apps/xwininfo/xwininfo.c
+++ b/apps/xwininfo/xwininfo.c
@@ -281,7 +281,7 @@ static size_t strlcat (char *dst, const char *src, size_t dstsize)
/*
* Report the syntax for calling xwininfo:
*/
-_X_NORETURN
+_X_NORETURN _X_COLD
static void
usage (void)
{
@@ -289,6 +289,7 @@ usage (void)
"usage: %s [-options ...]\n\n"
"where options include:\n"
" -help print this message\n"
+ " -version print version message\n"
" -display host:dpy X server to contact\n"
" -root use the root window\n"
" -id windowid use the window with the specified id\n"
@@ -546,7 +547,12 @@ main (int argc, char **argv)
if (!strcmp(argv[i], "-pause")) {
pauseatend = 1;
continue;
+ if (!strcmp(argv[i], "-version")) {
+ puts(PACKAGE_STRING);
+ exit(0);
}
+ fprintf (stderr, "%s: unrecognized argument %s\n\n",
+ program_name, argv[i]);
usage ();
}
diff --git a/fontconfig/src/fccache.c b/fontconfig/src/fccache.c
index 5173e0be2..085bd72e3 100644
--- a/fontconfig/src/fccache.c
+++ b/fontconfig/src/fccache.c
@@ -545,6 +545,26 @@ FcCacheTimeValid (FcCache *cache, struct stat *dir_stat)
return cache->checksum == (int) dir_stat->st_mtime;
}
+static FcBool
+FcCacheDirsValid (FcCache *cache)
+{
+ FcStrSet *dirs = FcStrSetCreate ();
+ FcBool ret = FcFalse;
+
+ if (!dirs)
+ goto bail;
+ if (!FcDirScanOnly (dirs, FcCacheDir (cache)))
+ goto bail1;
+ ret = cache->dirs_count == dirs->num;
+ if (FcDebug () & FC_DBG_CACHE)
+ printf ("%s: cache: %d, fs: %d\n", FcCacheDir (cache), cache->dirs_count, dirs->num);
+
+bail1:
+ FcStrSetDestroy (dirs);
+bail:
+ return ret;
+}
+
/*
* Map a cache file into memory
*/
@@ -559,7 +579,8 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
cache = FcCacheFindByStat (fd_stat);
if (cache)
{
- if (FcCacheTimeValid (cache, dir_stat))
+ if (FcCacheTimeValid (cache, dir_stat) &&
+ FcCacheDirsValid (cache))
return cache;
FcDirCacheUnload (cache);
cache = NULL;
@@ -611,6 +632,7 @@ FcDirCacheMapFd (int fd, struct stat *fd_stat, struct stat *dir_stat)
cache->version < FC_CACHE_CONTENT_VERSION ||
cache->size != (intptr_t) fd_stat->st_size ||
!FcCacheTimeValid (cache, dir_stat) ||
+ !FcCacheDirsValid (cache) ||
!FcCacheInsert (cache, fd_stat))
{
if (allocated)
diff --git a/fontconfig/src/fcdir.c b/fontconfig/src/fcdir.c
index 3bcd0b867..49259c1f2 100644
--- a/fontconfig/src/fcdir.c
+++ b/fontconfig/src/fcdir.c
@@ -164,7 +164,8 @@ FcDirScanConfig (FcFontSet *set,
FcBlanks *blanks,
const FcChar8 *dir,
FcBool force, /* XXX unused */
- FcConfig *config)
+ FcConfig *config,
+ FcBool scanOnly)
{
DIR *d;
struct dirent *e;
@@ -180,7 +181,7 @@ FcDirScanConfig (FcFontSet *set,
if (!set && !dirs)
return FcTrue;
- if (!blanks)
+ if (!blanks && !scanOnly)
blanks = FcConfigGetBlanks (config);
/* freed below */
@@ -233,7 +234,17 @@ FcDirScanConfig (FcFontSet *set,
* Scan file files to build font patterns
*/
for (i = 0; i < files->num; i++)
- FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
+ {
+ if (scanOnly)
+ {
+ if (FcFileIsDir (files->strs[i]))
+ FcStrSetAdd (dirs, files->strs[i]);
+ }
+ else
+ {
+ FcFileScanConfig (set, dirs, blanks, files->strs[i], config);
+ }
+ }
bail2:
FcStrSetDestroy (files);
@@ -257,7 +268,14 @@ FcDirScan (FcFontSet *set,
if (cache || !force)
return FcFalse;
- return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent ());
+ return FcDirScanConfig (set, dirs, blanks, dir, force, FcConfigGetCurrent (), FcFalse);
+}
+
+FcBool
+FcDirScanOnly (FcStrSet *dirs,
+ const FcChar8 *dir)
+{
+ return FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, NULL, FcTrue);
}
/*
@@ -288,7 +306,7 @@ FcDirCacheScan (const FcChar8 *dir, FcConfig *config)
/*
* Scan the dir
*/
- if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config))
+ if (!FcDirScanConfig (set, dirs, NULL, dir, FcTrue, config, FcFalse))
goto bail2;
/*
@@ -330,7 +348,7 @@ FcDirCacheRescan (const FcChar8 *dir, FcConfig *config)
/*
* Scan the dir
*/
- if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config))
+ if (!FcDirScanConfig (NULL, dirs, NULL, dir, FcTrue, config, FcFalse))
goto bail1;
/*
* Rebuild the cache object
diff --git a/fontconfig/src/fcint.h b/fontconfig/src/fcint.h
index 3d41b0cb2..a1b147f1d 100644
--- a/fontconfig/src/fcint.h
+++ b/fontconfig/src/fcint.h
@@ -849,7 +849,12 @@ FcDirScanConfig (FcFontSet *set,
FcBlanks *blanks,
const FcChar8 *dir,
FcBool force,
- FcConfig *config);
+ FcConfig *config,
+ FcBool scanOnly);
+
+FcPrivate FcBool
+FcDirScanOnly (FcStrSet *dirs,
+ const FcChar8 *dir);
/* fcfont.c */
FcPrivate int
diff --git a/libX11/modules/im/ximcp/imCallbk.c b/libX11/modules/im/ximcp/imCallbk.c
index 07921f8a1..4e091d8ef 100644
--- a/libX11/modules/im/ximcp/imCallbk.c
+++ b/libX11/modules/im/ximcp/imCallbk.c
@@ -553,10 +553,8 @@ static void
_free_memory_for_text(XIMText* text)
{
if (text) {
- if (text->string.multi_byte)
- Xfree(text->string.multi_byte);
- if (text->feedback)
- Xfree(text->feedback);
+ Xfree(text->string.multi_byte);
+ Xfree(text->feedback);
Xfree(text);
}
}
diff --git a/libX11/modules/im/ximcp/imDefIc.c b/libX11/modules/im/ximcp/imDefIc.c
index 9610a0f11..143bd5942 100644
--- a/libX11/modules/im/ximcp/imDefIc.c
+++ b/libX11/modules/im/ximcp/imDefIc.c
@@ -1595,10 +1595,9 @@ _XimProtoCreateIC(
ErrorOnCreatingIC:
_XimUnregisterFilter(ic);
- if (ic->private.proto.ic_resources)
- Xfree(ic->private.proto.ic_resources);
- if (ic->private.proto.ic_inner_resources)
- Xfree(ic->private.proto.ic_inner_resources);
+
+ Xfree(ic->private.proto.ic_resources);
+ Xfree(ic->private.proto.ic_inner_resources);
Xfree(ic);
return (XIC)NULL;
}
diff --git a/libX11/modules/im/ximcp/imDefIm.c b/libX11/modules/im/ximcp/imDefIm.c
index 9168135e1..9e877c0b4 100644
--- a/libX11/modules/im/ximcp/imDefIm.c
+++ b/libX11/modules/im/ximcp/imDefIm.c
@@ -1775,10 +1775,8 @@ _XimEncodingNegotiation(
detail_ptr, detail_len)))
goto free_preply;
- if (name_ptr)
- Xfree(name_ptr);
- if (detail_ptr)
- Xfree(detail_ptr);
+ Xfree(name_ptr);
+ Xfree(detail_ptr);
if(reply != preply)
Xfree(preply);
diff --git a/libX11/modules/im/ximcp/imDefLkup.c b/libX11/modules/im/ximcp/imDefLkup.c
index e88123493..dea7f66d5 100644
--- a/libX11/modules/im/ximcp/imDefLkup.c
+++ b/libX11/modules/im/ximcp/imDefLkup.c
@@ -599,10 +599,9 @@ _XimUnregCommitInfo(
if (!(info = ic->private.proto.commit_info))
return;
- if (info->string)
- Xfree(info->string);
- if (info->keysym)
- Xfree(info->keysym);
+
+ Xfree(info->string);
+ Xfree(info->keysym);
ic->private.proto.commit_info = info->next;
Xfree(info);
return;
@@ -696,10 +695,8 @@ _XimCommitRecv(
}
if (!(_XimRegCommitInfo(ic, string, string_len, keysym, keysym_len))) {
- if (string)
- Xfree(string);
- if (keysym)
- Xfree(keysym);
+ Xfree(string);
+ Xfree(keysym);
_XimError(im, ic, XIM_BadAlloc, (INT16)0, (CARD16)0, (char *)NULL);
return False;
}
diff --git a/libX11/modules/im/ximcp/imInt.c b/libX11/modules/im/ximcp/imInt.c
index aceb5fdf7..5c95e8156 100644
--- a/libX11/modules/im/ximcp/imInt.c
+++ b/libX11/modules/im/ximcp/imInt.c
@@ -240,14 +240,11 @@ Error4 :
Xfree(im);
return NULL;
Error3 :
- if(im->core.im_name)
- Xfree(im->core.im_name);
+ Xfree(im->core.im_name);
Error2:
- if(im->core.res_class)
- Xfree(im->core.res_class);
+ Xfree(im->core.res_class);
Error1:
- if(im->core.res_name)
- Xfree(im->core.res_name);
+ Xfree(im->core.res_name);
Xfree(im);
return NULL;
}
diff --git a/libX11/modules/im/ximcp/imLcIm.c b/libX11/modules/im/ximcp/imLcIm.c
index 3ab2dfc16..f3678868c 100644
--- a/libX11/modules/im/ximcp/imLcIm.c
+++ b/libX11/modules/im/ximcp/imLcIm.c
@@ -131,13 +131,14 @@ XimFreeDefaultTree(
}
#endif
Xfree (b->tree);
- if (b->mb) Xfree (b->mb);
- if (b->wc) Xfree (b->wc);
- if (b->utf8) Xfree (b->utf8);
b->tree = NULL;
+ Xfree (b->mb);
b->mb = NULL;
+ Xfree (b->wc);
b->wc = NULL;
+ Xfree (b->utf8);
b->utf8 = NULL;
+
b->treeused = b->treesize = 0;
b->mbused = b->mbsize = 0;
b->wcused = b->wcsize = 0;
@@ -151,38 +152,30 @@ _XimLocalIMFree(
XimFreeDefaultTree(&im->private.local.base);
im->private.local.top = 0;
- if(im->core.im_resources) {
- Xfree(im->core.im_resources);
- im->core.im_resources = NULL;
- }
- if(im->core.ic_resources) {
- Xfree(im->core.ic_resources);
- im->core.ic_resources = NULL;
- }
- if(im->core.im_values_list) {
- Xfree(im->core.im_values_list);
- im->core.im_values_list = NULL;
- }
- if(im->core.ic_values_list) {
- Xfree(im->core.ic_values_list);
- im->core.ic_values_list = NULL;
- }
- if(im->core.styles) {
- Xfree(im->core.styles);
- im->core.styles = NULL;
- }
- if(im->core.res_name) {
- Xfree(im->core.res_name);
- im->core.res_name = NULL;
- }
- if(im->core.res_class) {
- Xfree(im->core.res_class);
- im->core.res_class = NULL;
- }
- if(im->core.im_name) {
- Xfree(im->core.im_name);
- im->core.im_name = NULL;
- }
+ Xfree(im->core.im_resources);
+ im->core.im_resources = NULL;
+
+ Xfree(im->core.ic_resources);
+ im->core.ic_resources = NULL;
+
+ Xfree(im->core.im_values_list);
+ im->core.im_values_list = NULL;
+
+ Xfree(im->core.ic_values_list);
+ im->core.ic_values_list = NULL;
+
+ Xfree(im->core.styles);
+ im->core.styles = NULL;
+
+ Xfree(im->core.res_name);
+ im->core.res_name = NULL;
+
+ Xfree(im->core.res_class);
+ im->core.res_class = NULL;
+
+ Xfree(im->core.im_name);
+ im->core.im_name = NULL;
+
if (im->private.local.ctom_conv) {
_XlcCloseConverter(im->private.local.ctom_conv);
im->private.local.ctom_conv = NULL;
@@ -576,19 +569,15 @@ _XimCreateDefaultTree(
encoding, 0, 1, &cachename, &size);
if (cachefd != -1) {
if (_XimLoadCache (cachefd, intname, encoding, size, im)) {
- if (tmpcachedir)
- Xfree (tmpcachedir);
- if (tmpname)
- Xfree (tmpname);
- if (cachename)
- Xfree (cachename);
+ Xfree (tmpcachedir);
+ Xfree (tmpname);
+ Xfree (cachename);
close (cachefd);
return;
}
close (cachefd);
}
- if (cachename)
- Xfree (cachename);
+ Xfree (cachename);
cachename = NULL;
}
@@ -603,12 +592,9 @@ _XimCreateDefaultTree(
euid, 0, &cachename, &size);
if (cachefd != -1) {
if (_XimLoadCache (cachefd, intname, encoding, size, im)) {
- if (tmpcachedir)
- Xfree (tmpcachedir);
- if (tmpname)
- Xfree (tmpname);
- if (cachename)
- Xfree (cachename);
+ Xfree (tmpcachedir);
+ Xfree (tmpname);
+ Xfree (cachename);
close (cachefd);
return;
}
@@ -618,12 +604,9 @@ _XimCreateDefaultTree(
#endif
if (! (fp = _XFopenFile (name, "r"))) {
- if (tmpcachedir)
- Xfree (tmpcachedir);
- if (tmpname)
- Xfree (tmpname);
- if (cachename)
- Xfree (cachename);
+ Xfree (tmpcachedir);
+ Xfree (tmpname);
+ Xfree (cachename);
return;
}
_XimParseStringFile(fp, im);
@@ -636,12 +619,9 @@ _XimCreateDefaultTree(
}
#endif
- if (tmpcachedir)
- Xfree (tmpcachedir);
- if (tmpname)
- Xfree (tmpname);
- if (cachename)
- Xfree (cachename);
+ Xfree (tmpcachedir);
+ Xfree (tmpname);
+ Xfree (cachename);
}
static XIMMethodsRec Xim_im_local_methods = {
diff --git a/libX11/modules/im/ximcp/imRmAttr.c b/libX11/modules/im/ximcp/imRmAttr.c
index ad5290ee5..9d4e46258 100644
--- a/libX11/modules/im/ximcp/imRmAttr.c
+++ b/libX11/modules/im/ximcp/imRmAttr.c
@@ -972,8 +972,7 @@ _XimEncodePreeditValue(
if (!p->value)
return False;
- if (ic->private.proto.preedit_font)
- Xfree(ic->private.proto.preedit_font);
+ Xfree(ic->private.proto.preedit_font);
list_ret = XFontsOfFontSet((XFontSet)p->value,
&struct_list, &name_list);
@@ -1024,8 +1023,7 @@ _XimEncodeStatusValue(
if (!p->value)
return False;
- if (ic->private.proto.status_font)
- Xfree(ic->private.proto.status_font);
+ Xfree(ic->private.proto.status_font);
list_ret = XFontsOfFontSet((XFontSet)p->value,
&struct_list, &name_list);
@@ -1243,8 +1241,7 @@ _XimEncodeSavedStatusValue(
if (!value)
return False;
- if (ic->private.proto.status_font)
- Xfree(ic->private.proto.status_font);
+ Xfree(ic->private.proto.status_font);
list_ret = XFontsOfFontSet((XFontSet)value,
&struct_list, &name_list);
@@ -1460,10 +1457,9 @@ _XimGetAttributeID(
}
_XIMCompileResourceList(res, n);
- if (im->core.im_resources)
- Xfree(im->core.im_resources);
- if (im->core.im_values_list)
- Xfree(im->core.im_values_list);
+ Xfree(im->core.im_resources);
+ Xfree(im->core.im_values_list);
+
im->core.im_resources = res;
im->core.im_num_resources = n;
im->core.im_values_list = values_list;
@@ -1506,10 +1502,10 @@ _XimGetAttributeID(
}
_XIMCompileResourceList(res, n);
- if (im->core.ic_resources)
- Xfree(im->core.ic_resources);
- if (im->core.ic_values_list)
- Xfree(im->core.ic_values_list);
+
+ Xfree(im->core.ic_resources);
+ Xfree(im->core.ic_values_list);
+
im->core.ic_resources = res;
im->core.ic_num_resources = n;
im->core.ic_values_list = values_list;
diff --git a/libX11/modules/im/ximcp/imThaiIc.c b/libX11/modules/im/ximcp/imThaiIc.c
index 90da143f6..313734072 100644
--- a/libX11/modules/im/ximcp/imThaiIc.c
+++ b/libX11/modules/im/ximcp/imThaiIc.c
@@ -65,18 +65,20 @@ _XimThaiDestroyIC(
if(((Xim)ic->core.im)->private.local.current_ic == (XIC)ic) {
_XimThaiUnSetFocus(xic);
}
- if(ic->private.local.ic_resources) {
- Xfree(ic->private.local.ic_resources);
- ic->private.local.ic_resources = NULL;
- }
- if (b->tree) Xfree (b->tree);
- if (b->mb) Xfree (b->mb);
- if (b->wc) Xfree (b->wc);
- if (b->utf8) Xfree (b->utf8);
+ Xfree(ic->private.local.ic_resources);
+ ic->private.local.ic_resources = NULL;
+
+ Xfree (b->tree);
b->tree = NULL;
+
+ Xfree (b->mb);
b->mb = NULL;
+
+ Xfree (b->wc);
b->wc = NULL;
+
+ Xfree (b->utf8);
b->utf8 = NULL;
return;
}
diff --git a/libX11/modules/lc/def/lcDefConv.c b/libX11/modules/lc/def/lcDefConv.c
index 3cd5c22c9..e1f02289b 100644
--- a/libX11/modules/lc/def/lcDefConv.c
+++ b/libX11/modules/lc/def/lcDefConv.c
@@ -563,9 +563,8 @@ static void
close_converter(
XlcConv conv)
{
- if (conv->state)
- Xfree(conv->state);
+ Xfree(conv->state);
Xfree(conv);
}
diff --git a/libX11/modules/lc/gen/lcGenConv.c b/libX11/modules/lc/gen/lcGenConv.c
index 1f7c301f5..eede76807 100644
--- a/libX11/modules/lc/gen/lcGenConv.c
+++ b/libX11/modules/lc/gen/lcGenConv.c
@@ -753,7 +753,7 @@ mbstowcs_org(
CodeSet codeset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -764,6 +764,8 @@ mbstowcs_org(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -1223,8 +1225,7 @@ stdc_wcstocts(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1252,7 +1253,7 @@ ctstowcs(
CodeSet codeset = NULL;
XlcCharSet charset_tmp;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -1262,6 +1263,7 @@ ctstowcs(
_XlcResetConverter(conv);
return( 0 );
}
+ inbufptr = *from;
while (*from_left && *to_left) {
@@ -1437,7 +1439,7 @@ cstowcs(
CodeSet codeset = NULL;
XlcCharSet charset, charset_tmp;
- const char *inbufptr = *from;
+ const char *inbufptr;
wchar_t *outbufptr = (wchar_t *) *to;
int from_size = *from_left;
@@ -1445,6 +1447,8 @@ cstowcs(
return( 0 );
}
+ inbufptr = *from;
+
charset = (XlcCharSet) args[0];
while (*from_left && *to_left) {
@@ -1543,8 +1547,7 @@ stdc_ctstowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1579,8 +1582,7 @@ stdc_cstowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1615,8 +1617,7 @@ mbstocts(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -1643,7 +1644,7 @@ mbstostr(
CodeSet codeset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
char *outbufptr = *to;
int from_size = *from_left;
@@ -1654,6 +1655,8 @@ mbstostr(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -1758,7 +1761,7 @@ mbtocs(
CodeSet codeset = NULL;
XlcCharSet charset = NULL;
- const char *inbufptr = *from;
+ const char *inbufptr;
char *outbufptr = *to;
int from_size = *from_left;
@@ -1769,6 +1772,8 @@ mbtocs(
return( 0 );
}
+ inbufptr = *from;
+
while (*from_left && *to_left) {
ch = *inbufptr++;
@@ -2062,8 +2067,7 @@ stdc_wcstostr(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2337,8 +2341,7 @@ ctstombs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2373,8 +2376,7 @@ cstombs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2582,8 +2584,7 @@ stdc_strtowcs(
goto ret;
ret:
- if (buf)
- Xfree(buf);
+ Xfree(buf);
return (unconv_num1 + unconv_num2);
}
@@ -2596,14 +2597,8 @@ static void
close_converter(
XlcConv conv)
{
- if (conv->state) {
- Xfree(conv->state);
- }
-
- if (conv->methods) {
- Xfree(conv->methods);
- }
-
+ Xfree(conv->state);
+ Xfree(conv->methods);
Xfree(conv);
}
diff --git a/libX11/modules/om/generic/omGeneric.c b/libX11/modules/om/generic/omGeneric.c
index d9dc18bb3..d6f499a97 100644
--- a/libX11/modules/om/generic/omGeneric.c
+++ b/libX11/modules/om/generic/omGeneric.c
@@ -197,16 +197,12 @@ init_fontset(
return True;
err:
- if(font_set->font_data)
- Xfree(font_set->font_data);
- if(font_set->substitute)
- Xfree(font_set->substitute);
- if(font_set->vmap)
- Xfree(font_set->vmap);
- if(font_set->vrotate)
- Xfree(font_set->vrotate);
- if(font_set)
- Xfree(font_set);
+
+ Xfree(font_set->font_data);
+ Xfree(font_set->substitute);
+ Xfree(font_set->vmap);
+ Xfree(font_set->vrotate);
+ Xfree(font_set);
gen->font_set = (FontSet) NULL;
gen->font_set_num = 0;
return False;
@@ -505,8 +501,8 @@ init_core_part(
return True;
err:
- if (font_name_list)
- Xfree(font_name_list);
+
+ Xfree(font_name_list);
Xfree(font_struct_list);
return False;
@@ -1487,24 +1483,15 @@ destroy_oc(
*/
/* For VW/UDC end */
- if (oc->core.base_name_list)
- Xfree(oc->core.base_name_list);
-
- if (oc->core.font_info.font_name_list)
- XFreeStringList(oc->core.font_info.font_name_list);
-
- if (oc->core.font_info.font_struct_list) {
- Xfree(oc->core.font_info.font_struct_list);
- }
-
- if (oc->core.missing_list.charset_list)
- XFreeStringList(oc->core.missing_list.charset_list);
+ Xfree(oc->core.base_name_list);
+ XFreeStringList(oc->core.font_info.font_name_list);
+ Xfree(oc->core.font_info.font_struct_list);
+ XFreeStringList(oc->core.missing_list.charset_list);
#ifdef notdef
- if (oc->core.res_name)
- Xfree(oc->core.res_name);
- if (oc->core.res_class)
- Xfree(oc->core.res_class);
+
+ Xfree(oc->core.res_name);
+ Xfree(oc->core.res_class);
#endif
Xfree(oc);
diff --git a/libX11/src/FetchName.c b/libX11/src/FetchName.c
index 8605a6dfc..160eb5bd6 100644
--- a/libX11/src/FetchName.c
+++ b/libX11/src/FetchName.c
@@ -58,7 +58,7 @@ Status XFetchName (
*name = (char *)data;
return(1);
}
- if (data) Xfree (data);
+ Xfree (data);
*name = NULL;
return(0);
}
@@ -89,7 +89,7 @@ Status XGetIconName (
*icon_name = (char*)data;
return(1);
}
- if (data) Xfree (data);
+ Xfree (data);
*icon_name = NULL;
return(0);
}
diff --git a/libX11/src/Font.c b/libX11/src/Font.c
index 6fadd5877..650bc6f69 100644
--- a/libX11/src/Font.c
+++ b/libX11/src/Font.c
@@ -170,8 +170,8 @@ XFreeFont(
#endif
}
_XFreeExtData(fs->ext_data);
- if (fs->properties)
- Xfree (fs->properties);
+
+ Xfree (fs->properties);
Xfree (fs);
return 1;
}
@@ -271,7 +271,7 @@ _XQueryFont (
}
}
if (! fs->per_char) {
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
_XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL;
@@ -524,14 +524,14 @@ _XF86BigfontQueryFont (
+ (reply.nCharInfos+1)/2 * 2 * sizeof(CARD16);
pUniqCI = Xmalloc (nbytes);
if (!pUniqCI) {
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
_XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL;
}
if (! (fs->per_char = Xmalloc (reply.nCharInfos * sizeof(XCharStruct)))) {
Xfree(pUniqCI);
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
_XEatDataWords(dpy, reply_left);
return (XFontStruct *)NULL;
@@ -542,7 +542,7 @@ _XF86BigfontQueryFont (
if (pIndex2UniqIndex[i] >= reply.nUniqCharInfos) {
fprintf(stderr, "_XF86BigfontQueryFont: server returned wrong data\n");
Xfree(pUniqCI);
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
return (XFontStruct *)NULL;
}
@@ -558,7 +558,7 @@ _XF86BigfontQueryFont (
pData = Xmalloc(sizeof(XExtData));
if (!pData) {
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
return (XFontStruct *)NULL;
}
@@ -578,7 +578,7 @@ _XF86BigfontQueryFont (
if (extcodes->serverCapabilities & CAP_VerifiedLocal)
fprintf(stderr, "_XF86BigfontQueryFont: could not attach shm segment\n");
Xfree(pData);
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
/* Stop requesting shared memory transport from now on. */
extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm;
@@ -593,7 +593,7 @@ _XF86BigfontQueryFont (
&& *(CARD32 *)(addr + reply.shmsegoffset + reply.nCharInfos * sizeof(XCharStruct)) == extcodes->serverSignature)) {
shmdt(addr);
Xfree(pData);
- if (fs->properties) Xfree(fs->properties);
+ Xfree(fs->properties);
Xfree(fs);
/* Stop requesting shared memory transport from now on. */
extcodes->serverCapabilities &= ~ XF86Bigfont_CAP_LocalShm;
@@ -697,8 +697,8 @@ int _XF86LoadQueryLocaleFont(
#endif
}
_XFreeExtData(fs->ext_data);
- if (fs->properties)
- Xfree (fs->properties);
+
+ Xfree (fs->properties);
*fidp = fs->fid;
Xfree (fs);
} else {
diff --git a/libX11/src/FontInfo.c b/libX11/src/FontInfo.c
index 763aafb3d..a2d12c2ec 100644
--- a/libX11/src/FontInfo.c
+++ b/libX11/src/FontInfo.c
@@ -179,8 +179,8 @@ XFontStruct **info) /* RETURN */
Xfree(flist[j]);
if (finfo[j].properties) Xfree(finfo[j].properties);
}
- if (flist) Xfree(flist);
- if (finfo) Xfree(finfo);
+ Xfree(flist);
+ Xfree(finfo);
clearwire:
/* Clear the wire. */
diff --git a/libX11/src/FontNames.c b/libX11/src/FontNames.c
index c50de2eeb..6fc6b1272 100644
--- a/libX11/src/FontNames.c
+++ b/libX11/src/FontNames.c
@@ -73,8 +73,8 @@ int *actualCount) /* RETURN */
}
if ((! flist) || (! ch)) {
- if (flist) Xfree(flist);
- if (ch) Xfree(ch);
+ Xfree(flist);
+ Xfree(ch);
_XEatDataWords(dpy, rep.length);
*actualCount = 0;
UnlockDisplay(dpy);
diff --git a/libX11/src/GetFPath.c b/libX11/src/GetFPath.c
index 76ff7327b..62ba01436 100644
--- a/libX11/src/GetFPath.c
+++ b/libX11/src/GetFPath.c
@@ -57,8 +57,8 @@ char **XGetFontPath(
}
if ((! flist) || (! ch)) {
- if (flist) Xfree(flist);
- if (ch) Xfree(ch);
+ Xfree(flist);
+ Xfree(ch);
_XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
diff --git a/libX11/src/GetHints.c b/libX11/src/GetHints.c
index 5cca0bc93..513b4b090 100644
--- a/libX11/src/GetHints.c
+++ b/libX11/src/GetHints.c
@@ -75,7 +75,7 @@ Status XGetSizeHints (
if ((actual_type != XA_WM_SIZE_HINTS) ||
(nitems < OldNumPropSizeElements) || (actual_format != 32)) {
- if (prop != NULL) Xfree (prop);
+ Xfree (prop);
return(0);
}
hints->flags = (prop->flags & (USPosition|USSize|PAllHints));
@@ -124,7 +124,7 @@ XWMHints *XGetWMHints (
if ((actual_type != XA_WM_HINTS) ||
(nitems < (NumPropWMHintsElements - 1)) || (actual_format != 32)) {
- if (prop != NULL) Xfree (prop);
+ Xfree (prop);
return(NULL);
}
/* static copies not allowed in library, due to reentrancy constraint*/
@@ -196,7 +196,7 @@ Status XGetIconSizes (
(nitems < NumPropIconSizeElements) ||
(nitems % NumPropIconSizeElements != 0) ||
(actual_format != 32)) {
- if (prop != NULL) Xfree (prop);
+ Xfree (prop);
return(0);
}
@@ -204,7 +204,7 @@ Status XGetIconSizes (
nitems /= NumPropIconSizeElements;
if (! (hp = hints = Xcalloc (nitems, sizeof(XIconSize)))) {
- if (prop) Xfree (prop);
+ Xfree (prop);
return 0;
}
@@ -239,7 +239,7 @@ Status XGetCommand (
if (!XGetTextProperty (dpy, w, &tp, XA_WM_COMMAND)) return 0;
if (tp.encoding != XA_STRING || tp.format != 8) {
- if (tp.value) Xfree (tp.value);
+ Xfree (tp.value);
return 0;
}
@@ -254,7 +254,7 @@ Status XGetCommand (
* create a string list and return if successful
*/
if (!XTextPropertyToStringList (&tp, &argv, &argc)) {
- if (tp.value) Xfree (tp.value);
+ Xfree (tp.value);
return (0);
}
@@ -291,7 +291,7 @@ XGetTransientForHint(
return (1);
}
*propWindow = None;
- if (data) Xfree( (char *) data);
+ Xfree( (char *) data);
return(0);
}
@@ -333,6 +333,6 @@ XGetClassHint(
Xfree( (char *) data);
return(1);
}
- if (data) Xfree( (char *) data);
+ Xfree( (char *) data);
return(0);
}
diff --git a/libX11/src/GetNrmHint.c b/libX11/src/GetNrmHint.c
index 5e4143b28..97f04b23b 100644
--- a/libX11/src/GetNrmHint.c
+++ b/libX11/src/GetNrmHint.c
@@ -83,7 +83,7 @@ Status XGetWMSizeHints (
if ((actual_type != XA_WM_SIZE_HINTS) ||
(nitems < OldNumPropSizeElements) || (actual_format != 32)) {
- if (prop != NULL) Xfree (prop);
+ Xfree (prop);
return False;
}
diff --git a/libX11/src/GetRGBCMap.c b/libX11/src/GetRGBCMap.c
index d8a1b3f05..5d570ad3a 100644
--- a/libX11/src/GetRGBCMap.c
+++ b/libX11/src/GetRGBCMap.c
@@ -63,7 +63,7 @@ Status XGetRGBColormaps (
/* if wrong type or format, or too small for us, then punt */
if ((actual_type != XA_RGB_COLOR_MAP) || (actual_format != 32) ||
(nitems < OldNumPropStandardColormapElements)) {
- if (data) Xfree (data);
+ Xfree (data);
return False;
}
@@ -78,7 +78,7 @@ Status XGetRGBColormaps (
Screen *sp = _XScreenOfWindow (dpy, w);
if (!sp) {
- if (data) Xfree (data);
+ Xfree (data);
return False;
}
def_visual = sp->root_visual->visualid;
@@ -90,7 +90,7 @@ Status XGetRGBColormaps (
ncmaps = (nitems / NumPropStandardColormapElements);
if ((((unsigned long) ncmaps) * NumPropStandardColormapElements) !=
nitems) {
- if (data) Xfree (data);
+ Xfree (data);
return False;
}
}
@@ -101,7 +101,7 @@ Status XGetRGBColormaps (
*/
cmaps = Xmalloc (ncmaps * sizeof (XStandardColormap));
if (!cmaps) {
- if (data) Xfree (data);
+ Xfree (data);
return False;
}
diff --git a/libX11/src/GetStCmap.c b/libX11/src/GetStCmap.c
index ac5b0fa88..1cb1e0f01 100644
--- a/libX11/src/GetStCmap.c
+++ b/libX11/src/GetStCmap.c
@@ -81,7 +81,7 @@ Status XGetStandardColormap (
int i;
if (!sp) {
- if (stdcmaps) Xfree (stdcmaps);
+ Xfree (stdcmaps);
return False;
}
vid = sp->root_visual->visualid;
diff --git a/libX11/src/GetWMCMapW.c b/libX11/src/GetWMCMapW.c
index 27f1e232c..d3ef1fea0 100644
--- a/libX11/src/GetWMCMapW.c
+++ b/libX11/src/GetWMCMapW.c
@@ -77,7 +77,7 @@ Status XGetWMColormapWindows (
return False;
if (actual_type != XA_WINDOW || actual_format != 32) {
- if (data) Xfree (data);
+ Xfree (data);
return False;
}
diff --git a/libX11/src/ImUtil.c b/libX11/src/ImUtil.c
index 4fc060cb8..0d996e8ec 100644
--- a/libX11/src/ImUtil.c
+++ b/libX11/src/ImUtil.c
@@ -434,8 +434,8 @@ Status XInitImage (XImage *image)
static int _XDestroyImage (XImage *ximage)
{
- if (ximage->data != NULL) Xfree(ximage->data);
- if (ximage->obdata != NULL) Xfree(ximage->obdata);
+ Xfree(ximage->data);
+ Xfree(ximage->obdata);
Xfree(ximage);
return 1;
}
diff --git a/libX11/src/InitExt.c b/libX11/src/InitExt.c
index 1d58e879f..1ad183bdf 100644
--- a/libX11/src/InitExt.c
+++ b/libX11/src/InitExt.c
@@ -52,7 +52,7 @@ XExtCodes *XInitExtension (
LockDisplay (dpy);
if (! (ext = Xcalloc (1, sizeof (_XExtension))) ||
! (ext->name = strdup(name))) {
- if (ext) Xfree(ext);
+ Xfree(ext);
UnlockDisplay(dpy);
return (XExtCodes *) NULL;
}
diff --git a/libX11/src/KeyBind.c b/libX11/src/KeyBind.c
index f64f116b8..d7c78b37e 100644
--- a/libX11/src/KeyBind.c
+++ b/libX11/src/KeyBind.c
@@ -271,12 +271,13 @@ _XKeyInitialize(
if (! keysyms) return 0;
LockDisplay(dpy);
- if (dpy->keysyms)
- Xfree (dpy->keysyms);
+
+ Xfree (dpy->keysyms);
dpy->keysyms = keysyms;
dpy->keysyms_per_keycode = per;
if (dpy->modifiermap)
ResetModMap(dpy);
+
UnlockDisplay(dpy);
}
if (!dpy->modifiermap)
@@ -929,8 +930,8 @@ XRebindKeysym (
((! (p->string = Xmalloc(nbytes))) && (nbytes > 0)) ||
((! (p->modifiers = Xmalloc(nb))) && (nb > 0))) {
if (p) {
- if (p->string) Xfree(p->string);
- if (p->modifiers) Xfree(p->modifiers);
+ Xfree(p->string);
+ Xfree(p->modifiers);
Xfree(p);
}
UnlockDisplay(dpy);
diff --git a/libX11/src/ListExt.c b/libX11/src/ListExt.c
index f40924df7..431ae6784 100644
--- a/libX11/src/ListExt.c
+++ b/libX11/src/ListExt.c
@@ -62,8 +62,8 @@ char **XListExtensions(
}
if ((!list) || (!ch)) {
- if (list) Xfree(list);
- if (ch) Xfree(ch);
+ Xfree(list);
+ Xfree(ch);
_XEatDataWords(dpy, rep.length);
UnlockDisplay(dpy);
SyncHandle();
diff --git a/libX11/src/ModMap.c b/libX11/src/ModMap.c
index 78d635bf5..a809aa291 100644
--- a/libX11/src/ModMap.c
+++ b/libX11/src/ModMap.c
@@ -50,7 +50,7 @@ XGetModifierMapping(register Display *dpy)
} else
res = NULL;
if ((! res) || (! res->modifiermap)) {
- if (res) Xfree(res);
+ Xfree(res);
res = (XModifierKeymap *) NULL;
_XEatDataWords(dpy, rep.length);
} else {
@@ -114,8 +114,7 @@ int
XFreeModifiermap(XModifierKeymap *map)
{
if (map) {
- if (map->modifiermap)
- Xfree(map->modifiermap);
+ Xfree(map->modifiermap);
Xfree(map);
}
return 1;
diff --git a/libX11/src/OpenDis.c b/libX11/src/OpenDis.c
index 607b5a077..35d9a58dc 100644
--- a/libX11/src/OpenDis.c
+++ b/libX11/src/OpenDis.c
@@ -591,8 +591,7 @@ void _XFreeDisplayStructure(Display *dpy)
while (dpy->ext_procs) {
_XExtension *ext = dpy->ext_procs;
dpy->ext_procs = ext->next;
- if (ext->name)
- Xfree (ext->name);
+ Xfree (ext->name);
Xfree (ext);
}
if (dpy->im_filters)
@@ -657,23 +656,17 @@ void _XFreeDisplayStructure(Display *dpy)
}
free(dpy->display_name);
- if (dpy->vendor)
- Xfree (dpy->vendor);
-
- if (dpy->buffer)
- Xfree (dpy->buffer);
- if (dpy->keysyms)
- Xfree (dpy->keysyms);
- if (dpy->xdefaults)
- Xfree (dpy->xdefaults);
- if (dpy->error_vec)
- Xfree (dpy->error_vec);
+
+ Xfree (dpy->vendor);
+ Xfree (dpy->buffer);
+ Xfree (dpy->keysyms);
+ Xfree (dpy->xdefaults);
+ Xfree (dpy->error_vec);
_XFreeExtData (dpy->ext_data);
- if (dpy->free_funcs)
- Xfree (dpy->free_funcs);
- if (dpy->scratch_buffer)
- Xfree (dpy->scratch_buffer);
+
+ Xfree (dpy->free_funcs);
+ Xfree (dpy->scratch_buffer);
FreeDisplayLock(dpy);
if (dpy->qfree) {
@@ -688,8 +681,7 @@ void _XFreeDisplayStructure(Display *dpy)
while (dpy->im_fd_info) {
struct _XConnectionInfo *conni = dpy->im_fd_info;
dpy->im_fd_info = conni->next;
- if (conni->watch_data)
- Xfree (conni->watch_data);
+ Xfree (conni->watch_data);
Xfree (conni);
}
if (dpy->conn_watchers) {
@@ -697,8 +689,8 @@ void _XFreeDisplayStructure(Display *dpy)
dpy->conn_watchers = watcher->next;
Xfree (watcher);
}
- if (dpy->filedes)
- Xfree (dpy->filedes);
+
+ Xfree (dpy->filedes);
_XFreeX11XCBStructure(dpy);
diff --git a/libX11/src/PutImage.c b/libX11/src/PutImage.c
index e6ac9a23f..de085bcde 100644
--- a/libX11/src/PutImage.c
+++ b/libX11/src/PutImage.c
@@ -740,8 +740,7 @@ SendXYImage(
bytes_per_src, bytes_per_line,
bytes_per_dest, req->height, half_order);
- if (extra)
- Xfree(extra);
+ Xfree(extra);
if (buf == dpy->bufptr)
dpy->bufptr += length;
@@ -793,8 +792,7 @@ SendZImage(
((req_xoffset == 0) ||
((req_yoffset + req->height) < (unsigned)image->height))) {
Data(dpy, (char *)src, length);
- if (shifted_src)
- Xfree(shifted_src);
+ Xfree(shifted_src);
return;
}
@@ -804,7 +802,7 @@ SendZImage(
else
if ((dest = (unsigned char *)
_XAllocScratch(dpy, length)) == NULL) {
- if (shifted_src) Xfree(shifted_src);
+ Xfree(shifted_src);
UnGetReq(PutImage);
return;
}
@@ -831,8 +829,7 @@ SendZImage(
else
_XSend(dpy, (char *)dest, length);
- if (shifted_src)
- Xfree(shifted_src);
+ Xfree(shifted_src);
}
static void
diff --git a/libX11/src/RdBitF.c b/libX11/src/RdBitF.c
index 7f6750d64..ec5db45ee 100644
--- a/libX11/src/RdBitF.c
+++ b/libX11/src/RdBitF.c
@@ -138,7 +138,7 @@ XReadBitmapFileData (
/* error cleanup and return macro */
#define RETURN(code) \
-{ if (bits) Xfree (bits); fclose (fstream); return code; }
+{ Xfree (bits); fclose (fstream); return code; }
while (fgets(line, MAX_SIZE, fstream)) {
if (strlen(line) == MAX_SIZE-1)
diff --git a/libX11/src/ScrResStr.c b/libX11/src/ScrResStr.c
index 0601c8644..4a5491a32 100644
--- a/libX11/src/ScrResStr.c
+++ b/libX11/src/ScrResStr.c
@@ -48,8 +48,7 @@ char *XScreenResourceString(Screen *screen)
(unsigned char **) &val) == Success) {
if ((actual_type == XA_STRING) && (actual_format == 8))
return val;
- if (val)
- Xfree(val);
+ Xfree(val);
}
return (char *)NULL;
}
diff --git a/libX11/src/StBytes.c b/libX11/src/StBytes.c
index ec6c2e295..d8fca17c2 100644
--- a/libX11/src/StBytes.c
+++ b/libX11/src/StBytes.c
@@ -74,7 +74,7 @@ char *XFetchBuffer (
*nbytes = nitems;
return((char *)data);
}
- if ((char *) data != NULL) Xfree (data);
+ Xfree (data);
return(NULL);
}
diff --git a/libX11/src/XlibInt.c b/libX11/src/XlibInt.c
index 15f94aa0a..3cd5ec4e9 100644
--- a/libX11/src/XlibInt.c
+++ b/libX11/src/XlibInt.c
@@ -418,8 +418,7 @@ _XUnregisterInternalConnection(
watch=watch->next, wd++) {
(*watch->fn) (dpy, watch->client_data, fd, False, wd);
}
- if (info_list->watch_data)
- Xfree (info_list->watch_data);
+ Xfree (info_list->watch_data);
Xfree (info_list);
break;
}
@@ -1502,8 +1501,9 @@ char *_XAllocScratch(
unsigned long nbytes)
{
if (nbytes > dpy->scratch_length) {
- if (dpy->scratch_buffer) Xfree (dpy->scratch_buffer);
- if ((dpy->scratch_buffer = Xmalloc(nbytes)))
+ Xfree (dpy->scratch_buffer);
+ dpy->scratch_buffer = Xmalloc(nbytes);
+ if (dpy->scratch_buffer)
dpy->scratch_length = nbytes;
else dpy->scratch_length = 0;
}
@@ -1531,8 +1531,8 @@ void _XFreeTemp(
char *buf,
unsigned long nbytes)
{
- if (dpy->scratch_buffer)
- Xfree(dpy->scratch_buffer);
+
+ Xfree(dpy->scratch_buffer);
dpy->scratch_buffer = buf;
dpy->scratch_length = nbytes;
}
diff --git a/libX11/src/xkb/XKBNames.c b/libX11/src/xkb/XKBNames.c
index 3f2fd39d7..5a3fb6f8d 100644
--- a/libX11/src/xkb/XKBNames.c
+++ b/libX11/src/xkb/XKBNames.c
@@ -778,9 +778,14 @@ XkbNoteNameChanges(XkbNameChangesPtr old,
{
int first, last, old_last, new_last;
- wanted &= new->changed;
- if ((old == NULL) || (new == NULL) || (wanted == 0))
+ if ((old == NULL) || (new == NULL))
return;
+
+ wanted &= new->changed;
+
+ if (wanted == 0)
+ return;
+
if (wanted & XkbKeyTypeNamesMask) {
if (old->changed & XkbKeyTypeNamesMask) {
new_last = (new->first_type + new->num_types - 1);
diff --git a/libX11/src/xlibi18n/lcUTF8.c b/libX11/src/xlibi18n/lcUTF8.c
index 930edcb18..045903a72 100644
--- a/libX11/src/xlibi18n/lcUTF8.c
+++ b/libX11/src/xlibi18n/lcUTF8.c
@@ -1016,7 +1016,7 @@ ucstocs1(
XPointer *args,
int num_args)
{
- ucs4_t const *src = (ucs4_t const *) *from;
+ ucs4_t const *src;
unsigned char *dst = (unsigned char *) *to;
int unconv_num = 0;
Utf8Conv *preferred_charsets = (Utf8Conv *) conv->state;
@@ -1028,6 +1028,8 @@ ucstocs1(
if (from == NULL || *from == NULL)
return 0;
+ src = (ucs4_t const *) *from;
+
count = charset_wctocs_exactly(preferred_charsets, &chosen_charset,
&chosen_side, conv, dst, *src, *to_left);
if (count < 1) {
diff --git a/libXdmcp/autogen.sh b/libXdmcp/autogen.sh
index 904cd6746..fc34bd55c 100644
--- a/libXdmcp/autogen.sh
+++ b/libXdmcp/autogen.sh
@@ -9,4 +9,6 @@ cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
-$srcdir/configure --enable-maintainer-mode "$@"
+if test -z "$NOCONFIGURE"; then
+ $srcdir/configure "$@"
+fi
diff --git a/libXdmcp/configure.ac b/libXdmcp/configure.ac
index 4e85650e7..cf6b30921 100644
--- a/libXdmcp/configure.ac
+++ b/libXdmcp/configure.ac
@@ -29,7 +29,6 @@ AC_CONFIG_HEADERS([config.h])
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
# Initialize libtool
AC_LIBTOOL_WIN32_DLL
diff --git a/libXft/NEWS b/libXft/NEWS
index b547c7835..2a08f90e1 100644
--- a/libXft/NEWS
+++ b/libXft/NEWS
@@ -7,6 +7,14 @@ Xft version 2.1 was the first stand alone release of Xft, a library that
connects X applications with the FreeType font rasterization library. Xft
uses fontconfig to locate fonts so it has no configuration files.
+Version 2.3.2
+
+Build fix for freetype 2.5.1, man page fix for XftDrawString8 & XftDrawRect.
+
+Version 2.3.1
+
+Fix regression that broke bold fonts in 2.3.0, remove dead code.
+
Version 2.3.0
Subpixel LCD text rendering improvements
diff --git a/libXft/configure.ac b/libXft/configure.ac
index 013d9a64b..840710d53 100644
--- a/libXft/configure.ac
+++ b/libXft/configure.ac
@@ -27,7 +27,7 @@ AC_PREREQ([2.60])
# version. This version number will be substituted into Xft.h
# Please bump the minor library number at each release as well.
#
-AC_INIT([libXft], [2.3.1],
+AC_INIT([libXft], [2.3.2],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], [libXft])
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_HEADERS([config.h])
diff --git a/mesalib/configure.ac b/mesalib/configure.ac
index bee85a131..a12f27ac2 100644
--- a/mesalib/configure.ac
+++ b/mesalib/configure.ac
@@ -552,7 +552,13 @@ dnl See if posix_memalign is available
AC_CHECK_FUNC([posix_memalign], [DEFINES="$DEFINES -DHAVE_POSIX_MEMALIGN"])
dnl Check for pthreads
-AX_PTHREAD
+case "$host_os" in
+mingw*)
+ ;;
+*)
+ AX_PTHREAD
+ ;;
+esac
dnl AX_PTHREADS leaves PTHREAD_LIBS empty for gcc and sets PTHREAD_CFLAGS
dnl to -pthread, which causes problems if we need -lpthread to appear in
dnl pkgconfig files.
@@ -870,14 +876,21 @@ fi
case "$host_os" in
linux*)
- need_libudev=yes ;;
+ need_pci_id=yes ;;
*)
- need_libudev=no ;;
+ need_pci_id=no ;;
esac
PKG_CHECK_MODULES([LIBUDEV], [libudev >= $LIBUDEV_REQUIRED],
have_libudev=yes, have_libudev=no)
+AC_ARG_ENABLE([sysfs],
+ [AS_HELP_STRING([--enable-sysfs],
+ [enable /sys PCI identification @<:@default=disabled@:>@])],
+ [have_sysfs="$enableval"],
+ [have_sysfs=no]
+)
+
if test "x$enable_dri" = xyes; then
if test "$enable_static" = yes; then
AC_MSG_ERROR([Cannot use static libraries for DRI drivers])
@@ -973,8 +986,15 @@ xyesno)
;;
esac
+have_pci_id=no
if test "$have_libudev" = yes; then
DEFINES="$DEFINES -DHAVE_LIBUDEV"
+ have_pci_id=yes
+fi
+
+if test "$have_sysfs" = yes; then
+ DEFINES="$DEFINES -DHAVE_SYSFS"
+ have_pci_id=yes
fi
# This is outside the case (above) so that it is invoked even for non-GLX
@@ -1076,8 +1096,8 @@ if test "x$enable_dri" = xyes; then
DEFINES="$DEFINES -DHAVE_DRI3"
fi
- if test "x$have_libudev" != xyes; then
- AC_MSG_ERROR([libudev-dev required for building DRI])
+ if test "x$have_pci_id" != xyes; then
+ AC_MSG_ERROR([libudev-dev or sysfs required for building DRI])
fi
case "$host_cpu" in
@@ -1252,8 +1272,8 @@ if test "x$enable_gbm" = xauto; then
esac
fi
if test "x$enable_gbm" = xyes; then
- if test "x$need_libudev$have_libudev" = xyesno; then
- AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED])
+ if test "x$need_pci_id$have_pci_id" = xyesno; then
+ AC_MSG_ERROR([gbm requires udev >= $LIBUDEV_REQUIRED or sysfs])
fi
if test "x$enable_dri" = xyes; then
@@ -1271,7 +1291,7 @@ if test "x$enable_gbm" = xyes; then
fi
fi
AM_CONDITIONAL(HAVE_GBM, test "x$enable_gbm" = xyes)
-if test "x$need_libudev" = xyes; then
+if test "x$need_pci_id$have_libudev" = xyesyes; then
GBM_PC_REQ_PRIV="libudev >= $LIBUDEV_REQUIRED"
else
GBM_PC_REQ_PRIV=""
@@ -1560,9 +1580,9 @@ for plat in $egl_platforms; do
;;
esac
- case "$plat$need_libudev$have_libudev" in
+ case "$plat$need_pci_id$have_pci_id" in
waylandyesno|drmyesno)
- AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED]) ;;
+ AC_MSG_ERROR([cannot build $plat platform without udev >= $LIBUDEV_REQUIRED or sysfs]) ;;
esac
done
@@ -1843,8 +1863,8 @@ gallium_require_llvm() {
gallium_require_drm_loader() {
if test "x$enable_gallium_loader" = xyes; then
- if test "x$need_libudev$have_libudev" = xyesno; then
- AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED])
+ if test "x$need_pci_id$have_pci_id" = xyesno; then
+ AC_MSG_ERROR([Gallium drm loader requires libudev >= $LIBUDEV_REQUIRED or sysfs])
fi
if test "x$have_libdrm" != xyes; then
AC_MSG_ERROR([Gallium drm loader requires libdrm >= $LIBDRM_REQUIRED])
diff --git a/mesalib/docs/GL3.txt b/mesalib/docs/GL3.txt
index c360f2cb7..d26c8124d 100644
--- a/mesalib/docs/GL3.txt
+++ b/mesalib/docs/GL3.txt
@@ -101,10 +101,10 @@ GL 4.0:
GL_ARB_draw_buffers_blend DONE (i965, nv50, nvc0, r600, radeonsi, softpipe)
GL_ARB_draw_indirect DONE (i965)
GL_ARB_gpu_shader5 started
- - 'precise' qualifier not started
+ - 'precise' qualifier DONE
- Dynamically uniform sampler array indices not started
- Dynamically uniform UBO array indices not started
- - Implicit signed -> unsigned conversions not started
+ - Implicit signed -> unsigned conversions DONE
- Fused multiply-add DONE
- Packing/bitfield/conversion functions DONE
- Enhanced textureGather DONE
@@ -112,9 +112,9 @@ GL 4.0:
- Geometry shader multiple streams not started
- Enhanced per-sample shading DONE
- Interpolation functions started
- - New overload resolution rules not started
+ - New overload resolution rules DONE
GL_ARB_gpu_shader_fp64 not started
- GL_ARB_sample_shading DONE (i965, nv50, nvc0)
+ GL_ARB_sample_shading DONE (i965, nv50, nvc0, radeonsi)
GL_ARB_shader_subroutine not started
GL_ARB_tessellation_shader not started
GL_ARB_texture_buffer_object_rgb32 DONE (i965, nvc0, r600, radeonsi, softpipe)
diff --git a/mesalib/docs/index.html b/mesalib/docs/index.html
index 28a70467d..2e78343de 100644
--- a/mesalib/docs/index.html
+++ b/mesalib/docs/index.html
@@ -16,6 +16,20 @@
<h1>News</h1>
+<h2>June 6, 2014</h2>
+<p>
+<a href="relnotes/10.2.1.html">Mesa 10.2.1</a> is released. This release
+only fixes a build error in the radeonsi driver that was introduced between
+10.2-rc5 and the 10.2 final release.
+</p>
+
+<h2>June 6, 2014</h2>
+<p>
+<a href="relnotes/10.2.html">Mesa 10.2</a> is released. This is a new
+development release. See the release notes for more information about
+the release.
+</p>
+
<h2>May 20, 2014</h2>
<p>
<a href="relnotes/10.1.4.html">Mesa 10.1.4</a> is released.
diff --git a/mesalib/docs/llvmpipe.html b/mesalib/docs/llvmpipe.html
index 74f0c67d8..291527be8 100644
--- a/mesalib/docs/llvmpipe.html
+++ b/mesalib/docs/llvmpipe.html
@@ -43,11 +43,7 @@ It's the fastest software rasterizer for Mesa.
</p>
</li>
<li>
- <p>LLVM: version 2.9 recommended; 2.6 or later required.</p>
- <p><b>NOTE</b>: LLVM 2.8 and earlier will not work on systems that support the
- Intel AVX extensions (e.g. Sandybridge). LLVM's code generator will
- fail when trying to emit AVX instructions. This was fixed in LLVM 2.9.
- </p>
+ <p>LLVM: version 3.4 recommended; 3.1 or later required.</p>
<p>
For Linux, on a recent Debian based distribution do:
</p>
@@ -101,13 +97,15 @@ but the rest of these instructions assume that scons is used.
For Windows the procedure is similar except the target:
<pre>
- scons build=debug libgl-gdi
+ scons platform=windows build=debug libgl-gdi
</pre>
<h1>Using</h1>
-On Linux, building will create a drop-in alternative for libGL.so into
+<h2>Linux</h2>
+
+<p>On Linux, building will create a drop-in alternative for libGL.so into</p>
<pre>
build/foo/gallium/targets/libgl-xlib/libGL.so
@@ -117,15 +115,45 @@ or
lib/gallium/libGL.so
</pre>
-To use it set the LD_LIBRARY_PATH environment variable accordingly.
+<p>To use it set the LD_LIBRARY_PATH environment variable accordingly.</p>
+
+<p>For performance evaluation pass build=release to scons, and use the corresponding
+lib directory without the "-debug" suffix.</p>
+
-For performance evaluation pass debug=no to scons, and use the corresponding
-lib directory without the "-debug" suffix.
+<h2>Windows</h2>
-On Windows, building will create a drop-in alternative for opengl32.dll. To use
-it put it in the same directory as the application. It can also be used by
+<p>
+On Windows, building will create
+<code>build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll</code>
+which is a drop-in alternative for system's <code>opengl32.dll</code>. To use
+it put it in the same directory as your application. It can also be used by
replacing the native ICD driver, but it's quite an advanced usage, so if you
need to ask, don't even try it.
+</p>
+
+<p>
+There is however an easy way to replace the OpenGL software renderer that comes
+with Microsoft Windows 7 (or later) with llvmpipe (that is, on systems without
+any OpenGL drivers):
+</p>
+
+<ul>
+ <li><p>copy build/windows-x86-debug/gallium/targets/libgl-gdi/opengl32.dll to C:\Windows\SysWOW64\mesadrv.dll</p></li>
+ <li><p>load this registry settings:</p>
+ <pre>REGEDIT4
+
+; http://technet.microsoft.com/en-us/library/cc749368.aspx
+; http://www.msfn.org/board/topic/143241-portable-windows-7-build-from-winpe-30/page-5#entry942596
+[HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Windows NT\CurrentVersion\OpenGLDrivers\MSOGL]
+"DLL"="mesadrv.dll"
+"DriverVersion"=dword:00000001
+"Flags"=dword:00000001
+"Version"=dword:00000002
+</pre>
+ </li>
+ <li>Ditto for 64 bits drivers if you need them.</li>
+</ul>
<h1>Profiling</h1>
diff --git a/mesalib/docs/relnotes.html b/mesalib/docs/relnotes.html
index 7437e9b5b..60d007326 100644
--- a/mesalib/docs/relnotes.html
+++ b/mesalib/docs/relnotes.html
@@ -21,6 +21,8 @@ The release notes summarize what's new or changed in each Mesa release.
</p>
<ul>
+<li><a href="relnotes/10.2.1.html">10.2.1 release notes</a>
+<li><a href="relnotes/10.2.html">10.2 release notes</a>
<li><a href="relnotes/10.1.4.html">10.1.4 release notes</a>
<li><a href="relnotes/10.1.3.html">10.1.3 release notes</a>
<li><a href="relnotes/10.1.2.html">10.1.2 release notes</a>
diff --git a/mesalib/docs/relnotes/10.2.1.html b/mesalib/docs/relnotes/10.2.1.html
new file mode 100644
index 000000000..81c2acc02
--- /dev/null
+++ b/mesalib/docs/relnotes/10.2.1.html
@@ -0,0 +1,61 @@
+<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
+<html lang="en">
+<head>
+ <meta http-equiv="content-type" content="text/html; charset=utf-8">
+ <title>Mesa Release Notes</title>
+ <link rel="stylesheet" type="text/css" href="../mesa.css">
+</head>
+<body>
+
+<div class="header">
+ <h1>The Mesa 3D Graphics Library</h1>
+</div>
+
+<iframe src="../contents.html"></iframe>
+<div class="content">
+
+<h1>Mesa 10.2.1 Release Notes / June 6, 2014</h1>
+
+<p>
+Mesa 10.2.1 is a bug fix release which fixes bugs found since the 10.1 release.
+</p>
+<p>
+Mesa 10.2.1 implements the OpenGL 3.3 API, but the version reported by
+glGetString(GL_VERSION) or glGetIntegerv(GL_MAJOR_VERSION) /
+glGetIntegerv(GL_MINOR_VERSION) depends on the particular driver being used.
+Some drivers don't support all the features required in OpenGL 3.3. OpenGL
+3.3 is <strong>only</strong> available if requested at context creation
+because compatibility contexts are not supported.
+</p>
+
+
+<h2>MD5 checksums</h2>
+<pre>
+96f892dae2d0bb14ac9c2113f586c909 MesaLib-10.2.1.tar.gz
+093f9b5d077e5f6061dcd7b01b7aa51a MesaLib-10.2.1.tar.bz2
+6ab76c1608e5deed1eb8b54c62d7a48a MesaLib-10.2.1.zip
+</pre>
+
+
+<h2>New features</h2>
+<p>None</p>
+
+<h2>Bug fixes</h2>
+
+<p>
+Mesa 10.2 had a build problem in the radeonsi driver due to an error resolving
+conflicts in a patch cherry-pick from master. The build error is fixed.
+</p>
+
+<h2>Changes</h2>
+
+<p>Ian Romanick (3):</p>
+<ul>
+ <li>docs: Add MD5 checksum, etc. for 10.1 release</li>
+ <li>radeonsi: Fix build error introduced in 5ab9a9c</li>
+ <li>Bump version to 10.2.1</li>
+</ul>
+
+</div>
+</body>
+</html>
diff --git a/mesalib/docs/relnotes/10.2.html b/mesalib/docs/relnotes/10.2.html
index af44ca107..f17bfcc28 100644
--- a/mesalib/docs/relnotes/10.2.html
+++ b/mesalib/docs/relnotes/10.2.html
@@ -14,7 +14,7 @@
<iframe src="../contents.html"></iframe>
<div class="content">
-<h1>Mesa 10.2 Release Notes / TBD</h1>
+<h1>Mesa 10.2 Release Notes / June 6, 2014</h1>
<p>
Mesa 10.2 is a new development release.
@@ -33,7 +33,9 @@ because compatibility contexts are not supported.
<h2>MD5 checksums</h2>
<pre>
-TBD.
+c87bfb6dd5cbcf1fdef42e5ccd972581 MesaLib-10.2.0.tar.gz
+7aaba90bd7169a94ae2fe83febdec963 MesaLib-10.2.0.tar.bz2
+58b203aca15dadc25ab4d1126db1052b MesaLib-10.2.0.zip
</pre>
diff --git a/mesalib/docs/relnotes/10.3.html b/mesalib/docs/relnotes/10.3.html
index 6bb9e7989..0c8114bf2 100644
--- a/mesalib/docs/relnotes/10.3.html
+++ b/mesalib/docs/relnotes/10.3.html
@@ -44,6 +44,7 @@ Note: some of the new features are only available with certain drivers.
</p>
<ul>
+<li>GL_ARB_sample_shading on radeonsi</li>
<li>GL_ARB_stencil_texturing on nv50, nvc0, r600, and radeonsi</li>
<li>GL_ARB_texture_cube_map_array on radeonsi</li>
</ul>
diff --git a/mesalib/scons/crossmingw.py b/mesalib/scons/crossmingw.py
index 1287e0ec8..34129450a 100644
--- a/mesalib/scons/crossmingw.py
+++ b/mesalib/scons/crossmingw.py
@@ -41,26 +41,13 @@ import SCons.Builder
import SCons.Tool
import SCons.Util
-# This is what we search for to find mingw:
+# These are the mingw toolchain prefixes we search for:
+# (We only search for the mingw-w64 toolchain, and not the mingw.org one.)
prefixes32 = SCons.Util.Split("""
- mingw32-
- mingw32msvc-
- i386-mingw32-
- i486-mingw32-
- i586-mingw32-
- i686-mingw32-
- i386-mingw32msvc-
- i486-mingw32msvc-
- i586-mingw32msvc-
- i686-mingw32msvc-
- i686-pc-mingw32-
i686-w64-mingw32-
""")
prefixes64 = SCons.Util.Split("""
x86_64-w64-mingw32-
- amd64-mingw32-
- amd64-mingw32msvc-
- amd64-pc-mingw32-
""")
def find(env):
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.c b/mesalib/src/gallium/auxiliary/util/u_debug.c
index dc840e856..d79f31ea9 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug.c
+++ b/mesalib/src/gallium/auxiliary/util/u_debug.c
@@ -46,6 +46,12 @@
#include <limits.h> /* CHAR_BIT */
#include <ctype.h> /* isalnum */
+#ifdef _WIN32
+#include <windows.h>
+#include <stdlib.h>
+#endif
+
+
void _debug_vprintf(const char *format, va_list ap)
{
static char buf[4096] = {'\0'};
@@ -64,6 +70,32 @@ void _debug_vprintf(const char *format, va_list ap)
}
+void
+debug_disable_error_message_boxes(void)
+{
+#ifdef _WIN32
+ /* When Windows' error message boxes are disabled for this process (as is
+ * typically the case when running tests in an automated fashion) we disable
+ * CRT message boxes too.
+ */
+ UINT uMode = SetErrorMode(0);
+ SetErrorMode(uMode);
+ if (uMode & SEM_FAILCRITICALERRORS) {
+ /* Disable assertion failure message box.
+ * http://msdn.microsoft.com/en-us/library/sas1dkb2.aspx
+ */
+ _set_error_mode(_OUT_TO_STDERR);
+#ifdef _MSC_VER
+ /* Disable abort message box.
+ * http://msdn.microsoft.com/en-us/library/e631wekh.aspx
+ */
+ _set_abort_behavior(0, _WRITE_ABORT_MSG | _CALL_REPORTFAULT);
+#endif
+ }
+#endif /* _WIN32 */
+}
+
+
#ifdef DEBUG
void debug_print_blob( const char *name,
const void *blob,
diff --git a/mesalib/src/gallium/auxiliary/util/u_debug.h b/mesalib/src/gallium/auxiliary/util/u_debug.h
index 9c414211b..badd5e296 100644
--- a/mesalib/src/gallium/auxiliary/util/u_debug.h
+++ b/mesalib/src/gallium/auxiliary/util/u_debug.h
@@ -139,6 +139,15 @@ void debug_print_format(const char *msg, unsigned fmt );
/**
+ * Disable interactive error message boxes.
+ *
+ * Should be called as soon as possible for effectiveness.
+ */
+void
+debug_disable_error_message_boxes(void);
+
+
+/**
* Hard-coded breakpoint.
*/
#ifdef DEBUG
diff --git a/mesalib/src/gallium/auxiliary/util/u_math.h b/mesalib/src/gallium/auxiliary/util/u_math.h
index 2ade64af4..b9ed197d7 100644
--- a/mesalib/src/gallium/auxiliary/util/u_math.h
+++ b/mesalib/src/gallium/auxiliary/util/u_math.h
@@ -579,7 +579,7 @@ static INLINE unsigned util_last_bit(unsigned u)
*/
static INLINE unsigned util_last_bit_signed(int i)
{
-#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407)
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 407) && !defined(__INTEL_COMPILER)
return 31 - __builtin_clrsb(i);
#else
if (i >= 0)
diff --git a/mesalib/src/gallium/auxiliary/util/u_video.h b/mesalib/src/gallium/auxiliary/util/u_video.h
index da65a5861..d1ca7362b 100644
--- a/mesalib/src/gallium/auxiliary/util/u_video.h
+++ b/mesalib/src/gallium/auxiliary/util/u_video.h
@@ -60,7 +60,11 @@ u_reduce_video_profile(enum pipe_video_profile profile)
case PIPE_VIDEO_PROFILE_MPEG4_AVC_BASELINE:
case PIPE_VIDEO_PROFILE_MPEG4_AVC_MAIN:
+ case PIPE_VIDEO_PROFILE_MPEG4_AVC_EXTENDED:
case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH:
+ case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH10:
+ case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH422:
+ case PIPE_VIDEO_PROFILE_MPEG4_AVC_HIGH444:
return PIPE_VIDEO_FORMAT_MPEG4_AVC;
default:
diff --git a/mesalib/src/glsl/Makefile.am b/mesalib/src/glsl/Makefile.am
index fd0e837d1..00261fd0d 100644
--- a/mesalib/src/glsl/Makefile.am
+++ b/mesalib/src/glsl/Makefile.am
@@ -114,6 +114,7 @@ libglcpp_la_SOURCES = \
glcpp_glcpp_SOURCES = \
glcpp/glcpp.c \
+ tests/common.c \
$(top_srcdir)/src/mesa/program/prog_hash_table.c
glcpp_glcpp_LDADD = \
libglcpp.la \
diff --git a/mesalib/src/glsl/SConscript b/mesalib/src/glsl/SConscript
index fe9d50732..dc354775a 100644
--- a/mesalib/src/glsl/SConscript
+++ b/mesalib/src/glsl/SConscript
@@ -106,6 +106,6 @@ env.Alias('glsl_compiler', glsl_compiler)
glcpp = env.Program(
target = 'glcpp/glcpp',
- source = ['glcpp/glcpp.c'] + mesa_objs,
+ source = ['glcpp/glcpp.c', 'tests/common.c'] + mesa_objs,
)
env.Alias('glcpp', glcpp)
diff --git a/mesalib/src/glsl/ast.h b/mesalib/src/glsl/ast.h
index a59ebcb9f..fc80e780e 100644
--- a/mesalib/src/glsl/ast.h
+++ b/mesalib/src/glsl/ast.h
@@ -428,6 +428,7 @@ struct ast_type_qualifier {
union {
struct {
unsigned invariant:1;
+ unsigned precise:1;
unsigned constant:1;
unsigned attribute:1;
unsigned varying:1;
@@ -749,13 +750,11 @@ public:
exec_list declarations;
/**
- * Special flag for vertex shader "invariant" declarations.
- *
- * Vertex shaders can contain "invariant" variable redeclarations that do
- * not include a type. For example, "invariant gl_Position;". This flag
- * is used to note these cases when no type is specified.
+ * Flags for redeclarations. In these cases, no type is specified, to
+ * `type` is allowed to be NULL. In all other cases, this would be an error.
*/
- int invariant;
+ int invariant; /** < `invariant` redeclaration */
+ int precise; /** < `precise` redeclaration */
};
diff --git a/mesalib/src/glsl/ast_function.cpp b/mesalib/src/glsl/ast_function.cpp
index 4b8447067..8e91a1e67 100644
--- a/mesalib/src/glsl/ast_function.cpp
+++ b/mesalib/src/glsl/ast_function.cpp
@@ -701,7 +701,7 @@ process_vec_mat_constructor(exec_list *instructions,
glsl_type::get_instance(GLSL_TYPE_FLOAT,
ir->type->vector_elements,
ir->type->matrix_columns);
- if (result->type->can_implicitly_convert_to(desired_type)) {
+ if (result->type->can_implicitly_convert_to(desired_type, state)) {
/* Even though convert_component() implements the constructor
* conversion rules (not the implicit conversion rules), its safe
* to use it here because we already checked that the implicit
@@ -830,7 +830,7 @@ process_array_constructor(exec_list *instructions,
glsl_type::get_instance(GLSL_TYPE_FLOAT,
ir->type->vector_elements,
ir->type->matrix_columns);
- if (result->type->can_implicitly_convert_to(desired_type)) {
+ if (result->type->can_implicitly_convert_to(desired_type, state)) {
/* Even though convert_component() implements the constructor
* conversion rules (not the implicit conversion rules), its safe
* to use it here because we already checked that the implicit
@@ -1560,7 +1560,7 @@ ast_function_expression::hir(exec_list *instructions,
foreach_list (n, &this->expressions) {
ast_node *ast = exec_node_data(ast_node, n, link);
- ir_rvalue *result = ast->hir(instructions, state)->as_rvalue();
+ ir_rvalue *result = ast->hir(instructions, state);
/* From page 50 (page 56 of the PDF) of the GLSL 1.50 spec:
*
diff --git a/mesalib/src/glsl/ast_to_hir.cpp b/mesalib/src/glsl/ast_to_hir.cpp
index f230a70a3..d1c77f1ec 100644
--- a/mesalib/src/glsl/ast_to_hir.cpp
+++ b/mesalib/src/glsl/ast_to_hir.cpp
@@ -164,6 +164,31 @@ _mesa_ast_to_hir(exec_list *instructions, struct _mesa_glsl_parse_state *state)
}
+static ir_expression_operation
+get_conversion_operation(const glsl_type *to, const glsl_type *from,
+ struct _mesa_glsl_parse_state *state)
+{
+ switch (to->base_type) {
+ case GLSL_TYPE_FLOAT:
+ switch (from->base_type) {
+ case GLSL_TYPE_INT: return ir_unop_i2f;
+ case GLSL_TYPE_UINT: return ir_unop_u2f;
+ default: return (ir_expression_operation)0;
+ }
+
+ case GLSL_TYPE_UINT:
+ if (!state->is_version(400, 0) && !state->ARB_gpu_shader5_enable)
+ return (ir_expression_operation)0;
+ switch (from->base_type) {
+ case GLSL_TYPE_INT: return ir_unop_i2u;
+ default: return (ir_expression_operation)0;
+ }
+
+ default: return (ir_expression_operation)0;
+ }
+}
+
+
/**
* If a conversion is available, convert one operand to a different type
*
@@ -185,9 +210,7 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
if (to->base_type == from->type->base_type)
return true;
- /* This conversion was added in GLSL 1.20. If the compilation mode is
- * GLSL 1.10, the conversion is skipped.
- */
+ /* Prior to GLSL 1.20, there are no implicit conversions */
if (!state->is_version(120, 0))
return false;
@@ -195,36 +218,25 @@ apply_implicit_conversion(const glsl_type *to, ir_rvalue * &from,
*
* "There are no implicit array or structure conversions. For
* example, an array of int cannot be implicitly converted to an
- * array of float. There are no implicit conversions between
- * signed and unsigned integers."
- */
- /* FINISHME: The above comment is partially a lie. There is int/uint
- * FINISHME: conversion for immediate constants.
+ * array of float.
*/
- if (!to->is_float() || !from->type->is_numeric())
+ if (!to->is_numeric() || !from->type->is_numeric())
return false;
- /* Convert to a floating point type with the same number of components
- * as the original type - i.e. int to float, not int to vec4.
+ /* We don't actually want the specific type `to`, we want a type
+ * with the same base type as `to`, but the same vector width as
+ * `from`.
*/
- to = glsl_type::get_instance(GLSL_TYPE_FLOAT, from->type->vector_elements,
- from->type->matrix_columns);
+ to = glsl_type::get_instance(to->base_type, from->type->vector_elements,
+ from->type->matrix_columns);
- switch (from->type->base_type) {
- case GLSL_TYPE_INT:
- from = new(ctx) ir_expression(ir_unop_i2f, to, from, NULL);
- break;
- case GLSL_TYPE_UINT:
- from = new(ctx) ir_expression(ir_unop_u2f, to, from, NULL);
- break;
- case GLSL_TYPE_BOOL:
- from = new(ctx) ir_expression(ir_unop_b2f, to, from, NULL);
- break;
- default:
- assert(0);
+ ir_expression_operation op = get_conversion_operation(to, from->type, state);
+ if (op) {
+ from = new(ctx) ir_expression(op, to, from, NULL);
+ return true;
+ } else {
+ return false;
}
-
- return true;
}
@@ -2393,6 +2405,17 @@ apply_type_qualifier_to_variable(const struct ast_type_qualifier *qual,
}
}
+ if (qual->flags.q.precise) {
+ if (var->data.used) {
+ _mesa_glsl_error(loc, state,
+ "variable `%s' may not be redeclared "
+ "`precise' after being used",
+ var->name);
+ } else {
+ var->data.precise = 1;
+ }
+ }
+
if (qual->flags.q.constant || qual->flags.q.attribute
|| qual->flags.q.uniform
|| (qual->flags.q.varying && (state->stage == MESA_SHADER_FRAGMENT)))
@@ -3163,8 +3186,45 @@ ast_declarator_list::hir(exec_list *instructions,
return NULL;
}
+ if (this->precise) {
+ assert(this->type == NULL);
+
+ foreach_list_typed (ast_declaration, decl, link, &this->declarations) {
+ assert(decl->array_specifier == NULL);
+ assert(decl->initializer == NULL);
+
+ ir_variable *const earlier =
+ state->symbols->get_variable(decl->identifier);
+ if (earlier == NULL) {
+ _mesa_glsl_error(& loc, state,
+ "undeclared variable `%s' cannot be marked "
+ "precise", decl->identifier);
+ } else if (state->current_function != NULL &&
+ !state->symbols->name_declared_this_scope(decl->identifier)) {
+ /* Note: we have to check if we're in a function, since
+ * builtins are treated as having come from another scope.
+ */
+ _mesa_glsl_error(& loc, state,
+ "variable `%s' from an outer scope may not be "
+ "redeclared `precise' in this scope",
+ earlier->name);
+ } else if (earlier->data.used) {
+ _mesa_glsl_error(& loc, state,
+ "variable `%s' may not be redeclared "
+ "`precise' after being used",
+ earlier->name);
+ } else {
+ earlier->data.precise = true;
+ }
+ }
+
+ /* Precise redeclarations do not have r-values either. */
+ return NULL;
+ }
+
assert(this->type != NULL);
assert(!this->invariant);
+ assert(!this->precise);
/* The type specifier may contain a structure definition. Process that
* before any of the variable declarations.
diff --git a/mesalib/src/glsl/glsl_lexer.ll b/mesalib/src/glsl/glsl_lexer.ll
index 760235127..6c3f9b692 100644
--- a/mesalib/src/glsl/glsl_lexer.ll
+++ b/mesalib/src/glsl/glsl_lexer.ll
@@ -338,6 +338,9 @@ samplerExternalOES {
return IDENTIFIER;
}
+ /* keywords available with ARB_gpu_shader5 */
+precise KEYWORD_WITH_ALT(400, 0, 400, 0, yyextra->ARB_gpu_shader5_enable, PRECISE);
+
/* keywords available with ARB_shader_image_load_store */
image1D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE1D);
image2D KEYWORD_WITH_ALT(130, 300, 420, 0, yyextra->ARB_shader_image_load_store_enable, IMAGE2D);
diff --git a/mesalib/src/glsl/glsl_parser.yy b/mesalib/src/glsl/glsl_parser.yy
index b71b240de..b69802ddb 100644
--- a/mesalib/src/glsl/glsl_parser.yy
+++ b/mesalib/src/glsl/glsl_parser.yy
@@ -129,7 +129,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
%token ATTRIBUTE CONST_TOK BOOL_TOK FLOAT_TOK INT_TOK UINT_TOK
%token BREAK CONTINUE DO ELSE FOR IF DISCARD RETURN SWITCH CASE DEFAULT
%token BVEC2 BVEC3 BVEC4 IVEC2 IVEC3 IVEC4 UVEC2 UVEC3 UVEC4 VEC2 VEC3 VEC4
-%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING
+%token CENTROID IN_TOK OUT_TOK INOUT_TOK UNIFORM VARYING SAMPLE
%token NOPERSPECTIVE FLAT SMOOTH
%token MAT2X2 MAT2X3 MAT2X4
%token MAT3X2 MAT3X3 MAT3X4
@@ -167,7 +167,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
%token AND_OP OR_OP XOR_OP MUL_ASSIGN DIV_ASSIGN ADD_ASSIGN
%token MOD_ASSIGN LEFT_ASSIGN RIGHT_ASSIGN AND_ASSIGN XOR_ASSIGN OR_ASSIGN
%token SUB_ASSIGN
-%token INVARIANT
+%token INVARIANT PRECISE
%token LOWP MEDIUMP HIGHP SUPERP PRECISION
%token VERSION_TOK EXTENSION LINE COLON EOL INTERFACE OUTPUT
@@ -184,7 +184,7 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
%token HVEC2 HVEC3 HVEC4 DVEC2 DVEC3 DVEC4 FVEC2 FVEC3 FVEC4
%token SAMPLER3DRECT
%token SIZEOF CAST NAMESPACE USING
-%token RESOURCE PATCH SAMPLE
+%token RESOURCE PATCH
%token SUBROUTINE
%token ERROR_TOK
@@ -932,14 +932,22 @@ parameter_qualifier:
$$ = $2;
$$.flags.q.constant = 1;
}
+ | PRECISE parameter_qualifier
+ {
+ if ($2.flags.q.precise)
+ _mesa_glsl_error(&@1, state, "duplicate precise qualifier");
+
+ $$ = $2;
+ $$.flags.q.precise = 1;
+ }
| parameter_direction_qualifier parameter_qualifier
{
if (($1.flags.q.in || $1.flags.q.out) && ($2.flags.q.in || $2.flags.q.out))
_mesa_glsl_error(&@1, state, "duplicate in/out/inout qualifier");
if (!state->ARB_shading_language_420pack_enable && $2.flags.q.constant)
- _mesa_glsl_error(&@1, state, "const must be specified before "
- "in/out/inout");
+ _mesa_glsl_error(&@1, state, "in/out/inout must come after const "
+ "or precise");
$$ = $1;
$$.merge_qualifier(&@1, state, $2);
@@ -1072,7 +1080,7 @@ single_declaration:
$$->set_location_range(@1, @2);
$$->declarations.push_tail(&decl->link);
}
- | INVARIANT variable_identifier // Vertex only.
+ | INVARIANT variable_identifier
{
void *ctx = state;
ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
@@ -1084,6 +1092,18 @@ single_declaration:
$$->declarations.push_tail(&decl->link);
}
+ | PRECISE variable_identifier
+ {
+ void *ctx = state;
+ ast_declaration *decl = new(ctx) ast_declaration($2, NULL, NULL);
+ decl->set_location(@2);
+
+ $$ = new(ctx) ast_declarator_list(NULL);
+ $$->set_location_range(@1, @2);
+ $$->precise = true;
+
+ $$->declarations.push_tail(&decl->link);
+ }
;
fully_specified_type:
@@ -1499,6 +1519,11 @@ type_qualifier:
memset(& $$, 0, sizeof($$));
$$.flags.q.invariant = 1;
}
+ | PRECISE
+ {
+ memset(& $$, 0, sizeof($$));
+ $$.flags.q.precise = 1;
+ }
| auxiliary_storage_qualifier
| storage_qualifier
| interpolation_qualifier
@@ -1519,8 +1544,16 @@ type_qualifier:
* Each qualifier's rule ensures that the accumulated qualifiers on the right
* side don't contain any that must appear on the left hand side.
* For example, when processing a storage qualifier, we check that there are
- * no auxiliary, interpolation, layout, or invariant qualifiers to the right.
+ * no auxiliary, interpolation, layout, invariant, or precise qualifiers to the right.
*/
+ | PRECISE type_qualifier
+ {
+ if ($2.flags.q.precise)
+ _mesa_glsl_error(&@1, state, "duplicate \"precise\" qualifier");
+
+ $$ = $2;
+ $$.flags.q.precise = 1;
+ }
| INVARIANT type_qualifier
{
if ($2.flags.q.invariant)
@@ -1531,6 +1564,10 @@ type_qualifier:
"\"invariant\" cannot be used with layout(...)");
}
+ if (!state->ARB_shading_language_420pack_enable && $2.flags.q.precise)
+ _mesa_glsl_error(&@1, state,
+ "\"invariant\" must come after \"precise\"");
+
$$ = $2;
$$.flags.q.invariant = 1;
}
@@ -1554,9 +1591,10 @@ type_qualifier:
"with layout(...)");
}
- if (!state->ARB_shading_language_420pack_enable && $2.flags.q.invariant) {
+ if (!state->ARB_shading_language_420pack_enable &&
+ ($2.flags.q.precise || $2.flags.q.invariant)) {
_mesa_glsl_error(&@1, state, "interpolation qualifiers must come "
- "after \"invariant\"");
+ "after \"precise\" or \"invariant\"");
}
$$ = $1;
@@ -1577,6 +1615,10 @@ type_qualifier:
_mesa_glsl_error(&@1, state, "layout(...) cannot be used with "
"the \"invariant\" qualifier");
+ if ($2.flags.q.precise)
+ _mesa_glsl_error(&@1, state, "layout(...) cannot be used with "
+ "the \"precise\" qualifier");
+
if ($2.has_interpolation()) {
_mesa_glsl_error(&@1, state, "layout(...) cannot be used with "
"interpolation qualifiers");
@@ -1593,7 +1635,8 @@ type_qualifier:
}
if (!state->ARB_shading_language_420pack_enable &&
- ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout())) {
+ ($2.flags.q.precise || $2.flags.q.invariant ||
+ $2.has_interpolation() || $2.has_layout())) {
_mesa_glsl_error(&@1, state, "auxiliary storage qualifiers must come "
"just before storage qualifiers");
}
@@ -1610,10 +1653,10 @@ type_qualifier:
_mesa_glsl_error(&@1, state, "duplicate storage qualifier");
if (!state->ARB_shading_language_420pack_enable &&
- ($2.flags.q.invariant || $2.has_interpolation() || $2.has_layout() ||
- $2.has_auxiliary_storage())) {
+ ($2.flags.q.precise || $2.flags.q.invariant || $2.has_interpolation() ||
+ $2.has_layout() || $2.has_auxiliary_storage())) {
_mesa_glsl_error(&@1, state, "storage qualifiers must come after "
- "invariant, interpolation, layout and auxiliary "
+ "precise, invariant, interpolation, layout and auxiliary "
"storage qualifiers");
}
diff --git a/mesalib/src/glsl/glsl_parser_extras.cpp b/mesalib/src/glsl/glsl_parser_extras.cpp
index d3339e779..f3c5bd049 100644
--- a/mesalib/src/glsl/glsl_parser_extras.cpp
+++ b/mesalib/src/glsl/glsl_parser_extras.cpp
@@ -1098,8 +1098,10 @@ ast_declarator_list::print(void) const
if (type)
type->print();
- else
+ else if (invariant)
printf("invariant ");
+ else
+ printf("precise ");
foreach_list_const (ptr, & this->declarations) {
if (ptr != this->declarations.get_head())
@@ -1117,6 +1119,7 @@ ast_declarator_list::ast_declarator_list(ast_fully_specified_type *type)
{
this->type = type;
this->invariant = false;
+ this->precise = false;
}
void
diff --git a/mesalib/src/glsl/glsl_types.cpp b/mesalib/src/glsl/glsl_types.cpp
index 849a79af4..e77146cdf 100644
--- a/mesalib/src/glsl/glsl_types.cpp
+++ b/mesalib/src/glsl/glsl_types.cpp
@@ -678,7 +678,8 @@ glsl_type::component_slots() const
}
bool
-glsl_type::can_implicitly_convert_to(const glsl_type *desired) const
+glsl_type::can_implicitly_convert_to(const glsl_type *desired,
+ _mesa_glsl_parse_state *state) const
{
if (this == desired)
return true;
@@ -687,10 +688,23 @@ glsl_type::can_implicitly_convert_to(const glsl_type *desired) const
if (this->matrix_columns > 1 || desired->matrix_columns > 1)
return false;
+ /* Vector size must match. */
+ if (this->vector_elements != desired->vector_elements)
+ return false;
+
/* int and uint can be converted to float. */
- return desired->is_float()
- && this->is_integer()
- && this->vector_elements == desired->vector_elements;
+ if (desired->is_float() && this->is_integer())
+ return true;
+
+ /* With GLSL 4.0 / ARB_gpu_shader5, int can be converted to uint.
+ * Note that state may be NULL here, when resolving function calls in the
+ * linker. By this time, all the state-dependent checks have already
+ * happened though, so allow anything that's allowed in any shader version. */
+ if ((!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) &&
+ desired->base_type == GLSL_TYPE_UINT && this->base_type == GLSL_TYPE_INT)
+ return true;
+
+ return false;
}
unsigned
diff --git a/mesalib/src/glsl/glsl_types.h b/mesalib/src/glsl/glsl_types.h
index dca5492ac..35a4e6acc 100644
--- a/mesalib/src/glsl/glsl_types.h
+++ b/mesalib/src/glsl/glsl_types.h
@@ -314,7 +314,8 @@ struct glsl_type {
* integers.
* \endverbatim
*/
- bool can_implicitly_convert_to(const glsl_type *desired) const;
+ bool can_implicitly_convert_to(const glsl_type *desired,
+ _mesa_glsl_parse_state *state) const;
/**
* Query whether or not a type is a scalar (non-vector and non-matrix).
diff --git a/mesalib/src/glsl/ir.cpp b/mesalib/src/glsl/ir.cpp
index dec49bd64..2f4a0bec8 100644
--- a/mesalib/src/glsl/ir.cpp
+++ b/mesalib/src/glsl/ir.cpp
@@ -26,7 +26,8 @@
#include "ir_visitor.h"
#include "glsl_types.h"
-ir_rvalue::ir_rvalue()
+ir_rvalue::ir_rvalue(enum ir_node_type t)
+ : ir_instruction(t)
{
this->type = glsl_type::error_type;
}
@@ -153,8 +154,8 @@ ir_assignment::whole_variable_written()
ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
ir_rvalue *condition, unsigned write_mask)
+ : ir_instruction(ir_type_assignment)
{
- this->ir_type = ir_type_assignment;
this->condition = condition;
this->rhs = rhs;
this->lhs = lhs;
@@ -173,8 +174,8 @@ ir_assignment::ir_assignment(ir_dereference *lhs, ir_rvalue *rhs,
ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_rvalue *condition)
+ : ir_instruction(ir_type_assignment)
{
- this->ir_type = ir_type_assignment;
this->condition = condition;
this->rhs = rhs;
@@ -198,8 +199,8 @@ ir_assignment::ir_assignment(ir_rvalue *lhs, ir_rvalue *rhs,
ir_expression::ir_expression(int op, const struct glsl_type *type,
ir_rvalue *op0, ir_rvalue *op1,
ir_rvalue *op2, ir_rvalue *op3)
+ : ir_rvalue(ir_type_expression)
{
- this->ir_type = ir_type_expression;
this->type = type;
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
@@ -215,9 +216,8 @@ ir_expression::ir_expression(int op, const struct glsl_type *type,
}
ir_expression::ir_expression(int op, ir_rvalue *op0)
+ : ir_rvalue(ir_type_expression)
{
- this->ir_type = ir_type_expression;
-
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = NULL;
@@ -324,9 +324,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0)
}
ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
+ : ir_rvalue(ir_type_expression)
{
- this->ir_type = ir_type_expression;
-
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = op1;
@@ -420,9 +419,8 @@ ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1)
ir_expression::ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1,
ir_rvalue *op2)
+ : ir_rvalue(ir_type_expression)
{
- this->ir_type = ir_type_expression;
-
this->operation = ir_expression_operation(op);
this->operands[0] = op0;
this->operands[1] = op1;
@@ -610,25 +608,25 @@ ir_expression::get_operator(const char *str)
}
ir_constant::ir_constant()
+ : ir_rvalue(ir_type_constant)
{
- this->ir_type = ir_type_constant;
}
ir_constant::ir_constant(const struct glsl_type *type,
const ir_constant_data *data)
+ : ir_rvalue(ir_type_constant)
{
assert((type->base_type >= GLSL_TYPE_UINT)
&& (type->base_type <= GLSL_TYPE_BOOL));
- this->ir_type = ir_type_constant;
this->type = type;
memcpy(& this->value, data, sizeof(this->value));
}
ir_constant::ir_constant(float f, unsigned vector_elements)
+ : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
- this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_FLOAT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.f[i] = f;
@@ -639,9 +637,9 @@ ir_constant::ir_constant(float f, unsigned vector_elements)
}
ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
+ : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
- this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_UINT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.u[i] = u;
@@ -652,9 +650,9 @@ ir_constant::ir_constant(unsigned int u, unsigned vector_elements)
}
ir_constant::ir_constant(int integer, unsigned vector_elements)
+ : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
- this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_INT, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.i[i] = integer;
@@ -665,9 +663,9 @@ ir_constant::ir_constant(int integer, unsigned vector_elements)
}
ir_constant::ir_constant(bool b, unsigned vector_elements)
+ : ir_rvalue(ir_type_constant)
{
assert(vector_elements <= 4);
- this->ir_type = ir_type_constant;
this->type = glsl_type::get_instance(GLSL_TYPE_BOOL, vector_elements, 1);
for (unsigned i = 0; i < vector_elements; i++) {
this->value.b[i] = b;
@@ -678,8 +676,8 @@ ir_constant::ir_constant(bool b, unsigned vector_elements)
}
ir_constant::ir_constant(const ir_constant *c, unsigned i)
+ : ir_rvalue(ir_type_constant)
{
- this->ir_type = ir_type_constant;
this->type = c->type->get_base_type();
switch (this->type->base_type) {
@@ -692,8 +690,8 @@ ir_constant::ir_constant(const ir_constant *c, unsigned i)
}
ir_constant::ir_constant(const struct glsl_type *type, exec_list *value_list)
+ : ir_rvalue(ir_type_constant)
{
- this->ir_type = ir_type_constant;
this->type = type;
assert(type->is_scalar() || type->is_vector() || type->is_matrix()
@@ -1233,16 +1231,16 @@ ir_constant::is_uint16_constant() const
}
ir_loop::ir_loop()
+ : ir_instruction(ir_type_loop)
{
- this->ir_type = ir_type_loop;
}
ir_dereference_variable::ir_dereference_variable(ir_variable *var)
+ : ir_dereference(ir_type_dereference_variable)
{
assert(var != NULL);
- this->ir_type = ir_type_dereference_variable;
this->var = var;
this->type = var->type;
}
@@ -1250,8 +1248,8 @@ ir_dereference_variable::ir_dereference_variable(ir_variable *var)
ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_rvalue *array_index)
+ : ir_dereference(ir_type_dereference_array)
{
- this->ir_type = ir_type_dereference_array;
this->array_index = array_index;
this->set_array(value);
}
@@ -1259,10 +1257,10 @@ ir_dereference_array::ir_dereference_array(ir_rvalue *value,
ir_dereference_array::ir_dereference_array(ir_variable *var,
ir_rvalue *array_index)
+ : ir_dereference(ir_type_dereference_array)
{
void *ctx = ralloc_parent(var);
- this->ir_type = ir_type_dereference_array;
this->array_index = array_index;
this->set_array(new(ctx) ir_dereference_variable(var));
}
@@ -1289,10 +1287,10 @@ ir_dereference_array::set_array(ir_rvalue *value)
ir_dereference_record::ir_dereference_record(ir_rvalue *value,
const char *field)
+ : ir_dereference(ir_type_dereference_record)
{
assert(value != NULL);
- this->ir_type = ir_type_dereference_record;
this->record = value;
this->field = ralloc_strdup(this, field);
this->type = this->record->type->field_type(field);
@@ -1301,10 +1299,10 @@ ir_dereference_record::ir_dereference_record(ir_rvalue *value,
ir_dereference_record::ir_dereference_record(ir_variable *var,
const char *field)
+ : ir_dereference(ir_type_dereference_record)
{
void *ctx = ralloc_parent(var);
- this->ir_type = ir_type_dereference_record;
this->record = new(ctx) ir_dereference_variable(var);
this->field = ralloc_strdup(this, field);
this->type = this->record->type->field_type(field);
@@ -1421,24 +1419,22 @@ ir_swizzle::init_mask(const unsigned *comp, unsigned count)
ir_swizzle::ir_swizzle(ir_rvalue *val, unsigned x, unsigned y, unsigned z,
unsigned w, unsigned count)
- : val(val)
+ : ir_rvalue(ir_type_swizzle), val(val)
{
const unsigned components[4] = { x, y, z, w };
- this->ir_type = ir_type_swizzle;
this->init_mask(components, count);
}
ir_swizzle::ir_swizzle(ir_rvalue *val, const unsigned *comp,
unsigned count)
- : val(val)
+ : ir_rvalue(ir_type_swizzle), val(val)
{
- this->ir_type = ir_type_swizzle;
this->init_mask(comp, count);
}
ir_swizzle::ir_swizzle(ir_rvalue *val, ir_swizzle_mask mask)
+ : ir_rvalue(ir_type_swizzle)
{
- this->ir_type = ir_type_swizzle;
this->val = val;
this->mask = mask;
this->type = glsl_type::get_instance(val->type->base_type,
@@ -1537,9 +1533,8 @@ ir_swizzle::variable_referenced() const
ir_variable::ir_variable(const struct glsl_type *type, const char *name,
ir_variable_mode mode)
- : max_ifc_array_access(NULL)
+ : ir_instruction(ir_type_variable), max_ifc_array_access(NULL)
{
- this->ir_type = ir_type_variable;
this->type = type;
this->name = ralloc_strdup(this, name);
this->data.explicit_location = false;
@@ -1613,10 +1608,10 @@ ir_variable::determine_interpolation_mode(bool flat_shade)
ir_function_signature::ir_function_signature(const glsl_type *return_type,
builtin_available_predicate b)
- : return_type(return_type), is_defined(false), is_intrinsic(false),
+ : ir_instruction(ir_type_function_signature),
+ return_type(return_type), is_defined(false), is_intrinsic(false),
builtin_avail(b), _function(NULL)
{
- this->ir_type = ir_type_function_signature;
this->origin = NULL;
}
@@ -1699,8 +1694,8 @@ ir_function_signature::replace_parameters(exec_list *new_params)
ir_function::ir_function(const char *name)
+ : ir_instruction(ir_type_function)
{
- this->ir_type = ir_type_function;
this->name = ralloc_strdup(this, name);
}
@@ -1720,7 +1715,7 @@ ir_function::has_user_signature()
ir_rvalue *
ir_rvalue::error_value(void *mem_ctx)
{
- ir_rvalue *v = new(mem_ctx) ir_rvalue;
+ ir_rvalue *v = new(mem_ctx) ir_rvalue(ir_type_unset);
v->type = glsl_type::error_type;
return v;
diff --git a/mesalib/src/glsl/ir.h b/mesalib/src/glsl/ir.h
index 80609829e..b4e52d3d0 100644
--- a/mesalib/src/glsl/ir.h
+++ b/mesalib/src/glsl/ir.h
@@ -59,31 +59,27 @@
* types, this allows writing very straightforward, readable code.
*/
enum ir_node_type {
- /**
- * Zero is unused so that the IR validator can detect cases where
- * \c ir_instruction::ir_type has not been initialized.
- */
- ir_type_unset,
- ir_type_variable,
- ir_type_assignment,
- ir_type_call,
- ir_type_constant,
ir_type_dereference_array,
ir_type_dereference_record,
ir_type_dereference_variable,
- ir_type_discard,
+ ir_type_constant,
ir_type_expression,
+ ir_type_swizzle,
+ ir_type_texture,
+ ir_type_variable,
+ ir_type_assignment,
+ ir_type_call,
ir_type_function,
ir_type_function_signature,
ir_type_if,
ir_type_loop,
ir_type_loop_jump,
ir_type_return,
- ir_type_swizzle,
- ir_type_texture,
+ ir_type_discard,
ir_type_emit_vertex,
ir_type_end_primitive,
- ir_type_max /**< maximum ir_type enum number, for validation */
+ ir_type_max, /**< maximum ir_type enum number, for validation */
+ ir_type_unset = ir_type_max
};
@@ -121,24 +117,58 @@ public:
* Additional downcast functions will be added as needed.
*/
/*@{*/
- virtual class ir_variable * as_variable() { return NULL; }
- virtual class ir_function * as_function() { return NULL; }
- virtual class ir_dereference * as_dereference() { return NULL; }
- virtual class ir_dereference_array * as_dereference_array() { return NULL; }
- virtual class ir_dereference_variable *as_dereference_variable() { return NULL; }
- virtual class ir_dereference_record *as_dereference_record() { return NULL; }
- virtual class ir_expression * as_expression() { return NULL; }
- virtual class ir_rvalue * as_rvalue() { return NULL; }
- virtual class ir_loop * as_loop() { return NULL; }
- virtual class ir_assignment * as_assignment() { return NULL; }
- virtual class ir_call * as_call() { return NULL; }
- virtual class ir_return * as_return() { return NULL; }
- virtual class ir_if * as_if() { return NULL; }
- virtual class ir_swizzle * as_swizzle() { return NULL; }
- virtual class ir_texture * as_texture() { return NULL; }
- virtual class ir_constant * as_constant() { return NULL; }
- virtual class ir_discard * as_discard() { return NULL; }
- virtual class ir_jump * as_jump() { return NULL; }
+ class ir_rvalue *as_rvalue()
+ {
+ if (ir_type == ir_type_dereference_array ||
+ ir_type == ir_type_dereference_record ||
+ ir_type == ir_type_dereference_variable ||
+ ir_type == ir_type_constant ||
+ ir_type == ir_type_expression ||
+ ir_type == ir_type_swizzle ||
+ ir_type == ir_type_texture)
+ return (class ir_rvalue *) this;
+ return NULL;
+ }
+
+ class ir_dereference *as_dereference()
+ {
+ if (ir_type == ir_type_dereference_array ||
+ ir_type == ir_type_dereference_record ||
+ ir_type == ir_type_dereference_variable)
+ return (class ir_dereference *) this;
+ return NULL;
+ }
+
+ class ir_jump *as_jump()
+ {
+ if (ir_type == ir_type_loop_jump ||
+ ir_type == ir_type_return ||
+ ir_type == ir_type_discard)
+ return (class ir_jump *) this;
+ return NULL;
+ }
+
+ #define AS_CHILD(TYPE) \
+ class ir_##TYPE * as_##TYPE() \
+ { \
+ return ir_type == ir_type_##TYPE ? (ir_##TYPE *) this : NULL; \
+ }
+ AS_CHILD(variable)
+ AS_CHILD(function)
+ AS_CHILD(dereference_array)
+ AS_CHILD(dereference_variable)
+ AS_CHILD(dereference_record)
+ AS_CHILD(expression)
+ AS_CHILD(loop)
+ AS_CHILD(assignment)
+ AS_CHILD(call)
+ AS_CHILD(return)
+ AS_CHILD(if)
+ AS_CHILD(swizzle)
+ AS_CHILD(texture)
+ AS_CHILD(constant)
+ AS_CHILD(discard)
+ #undef AS_CHILD
/*@}*/
/**
@@ -152,9 +182,15 @@ public:
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
protected:
+ ir_instruction(enum ir_node_type t)
+ : ir_type(t)
+ {
+ }
+
+private:
ir_instruction()
{
- ir_type = ir_type_unset;
+ assert(!"Should not get here.");
}
};
@@ -177,11 +213,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_rvalue * as_rvalue()
- {
- return this;
- }
-
ir_rvalue *as_rvalue_to_saturate();
virtual bool is_lvalue() const
@@ -281,7 +312,7 @@ public:
static ir_rvalue *error_value(void *mem_ctx);
protected:
- ir_rvalue();
+ ir_rvalue(enum ir_node_type t);
};
@@ -382,11 +413,6 @@ public:
virtual ir_variable *clone(void *mem_ctx, struct hash_table *ht) const;
- virtual ir_variable *as_variable()
- {
- return this;
- }
-
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -535,6 +561,7 @@ public:
unsigned centroid:1;
unsigned sample:1;
unsigned invariant:1;
+ unsigned precise:1;
/**
* Has this variable been used for reading or writing?
@@ -917,11 +944,6 @@ public:
virtual ir_function *clone(void *mem_ctx, struct hash_table *ht) const;
- virtual ir_function *as_function()
- {
- return this;
- }
-
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -984,18 +1006,12 @@ inline const char *ir_function_signature::function_name() const
class ir_if : public ir_instruction {
public:
ir_if(ir_rvalue *condition)
- : condition(condition)
+ : ir_instruction(ir_type_if), condition(condition)
{
- ir_type = ir_type_if;
}
virtual ir_if *clone(void *mem_ctx, struct hash_table *ht) const;
- virtual ir_if *as_if()
- {
- return this;
- }
-
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -1027,11 +1043,6 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
- virtual ir_loop *as_loop()
- {
- return this;
- }
-
/** List of ir_instruction that make up the body of the loop. */
exec_list body_instructions;
};
@@ -1062,11 +1073,6 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
- virtual ir_assignment * as_assignment()
- {
- return this;
- }
-
/**
* Get a whole variable written by an assignment
*
@@ -1430,11 +1436,6 @@ public:
*/
ir_expression(int op, ir_rvalue *op0, ir_rvalue *op1, ir_rvalue *op2);
- virtual ir_expression *as_expression()
- {
- return this;
- }
-
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
virtual ir_expression *clone(void *mem_ctx, struct hash_table *ht) const;
@@ -1514,9 +1515,8 @@ public:
ir_call(ir_function_signature *callee,
ir_dereference_variable *return_deref,
exec_list *actual_parameters)
- : return_deref(return_deref), callee(callee)
+ : ir_instruction(ir_type_call), return_deref(return_deref), callee(callee)
{
- ir_type = ir_type_call;
assert(callee->return_type != NULL);
actual_parameters->move_nodes_to(& this->actual_parameters);
this->use_builtin = callee->is_builtin();
@@ -1526,11 +1526,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_call *as_call()
- {
- return this;
- }
-
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -1579,39 +1574,26 @@ public:
/*@{*/
class ir_jump : public ir_instruction {
protected:
- ir_jump()
+ ir_jump(enum ir_node_type t)
+ : ir_instruction(t)
{
- ir_type = ir_type_unset;
- }
-
-public:
- virtual ir_jump *as_jump()
- {
- return this;
}
};
class ir_return : public ir_jump {
public:
ir_return()
- : value(NULL)
+ : ir_jump(ir_type_return), value(NULL)
{
- this->ir_type = ir_type_return;
}
ir_return(ir_rvalue *value)
- : value(value)
+ : ir_jump(ir_type_return), value(value)
{
- this->ir_type = ir_type_return;
}
virtual ir_return *clone(void *mem_ctx, struct hash_table *) const;
- virtual ir_return *as_return()
- {
- return this;
- }
-
ir_rvalue *get_value() const
{
return value;
@@ -1644,8 +1626,8 @@ public:
};
ir_loop_jump(jump_mode mode)
+ : ir_jump(ir_type_loop_jump)
{
- this->ir_type = ir_type_loop_jump;
this->mode = mode;
}
@@ -1678,14 +1660,14 @@ public:
class ir_discard : public ir_jump {
public:
ir_discard()
+ : ir_jump(ir_type_discard)
{
- this->ir_type = ir_type_discard;
this->condition = NULL;
}
ir_discard(ir_rvalue *cond)
+ : ir_jump(ir_type_discard)
{
- this->ir_type = ir_type_discard;
this->condition = cond;
}
@@ -1698,11 +1680,6 @@ public:
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
- virtual ir_discard *as_discard()
- {
- return this;
- }
-
ir_rvalue *condition;
};
/*@}*/
@@ -1752,10 +1729,10 @@ enum ir_texture_opcode {
class ir_texture : public ir_rvalue {
public:
ir_texture(enum ir_texture_opcode op)
- : op(op), sampler(NULL), coordinate(NULL), projector(NULL),
+ : ir_rvalue(ir_type_texture),
+ op(op), sampler(NULL), coordinate(NULL), projector(NULL),
shadow_comparitor(NULL), offset(NULL)
{
- this->ir_type = ir_type_texture;
memset(&lod_info, 0, sizeof(lod_info));
}
@@ -1768,11 +1745,6 @@ public:
v->visit(this);
}
- virtual ir_texture *as_texture()
- {
- return this;
- }
-
virtual ir_visitor_status accept(ir_hierarchical_visitor *);
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
@@ -1864,11 +1836,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_swizzle *as_swizzle()
- {
- return this;
- }
-
/**
* Construct an ir_swizzle from the textual representation. Can fail.
*/
@@ -1910,17 +1877,18 @@ class ir_dereference : public ir_rvalue {
public:
virtual ir_dereference *clone(void *mem_ctx, struct hash_table *) const = 0;
- virtual ir_dereference *as_dereference()
- {
- return this;
- }
-
bool is_lvalue() const;
/**
* Get the variable that is ultimately referenced by an r-value
*/
virtual ir_variable *variable_referenced() const = 0;
+
+protected:
+ ir_dereference(enum ir_node_type t)
+ : ir_rvalue(t)
+ {
+ }
};
@@ -1933,11 +1901,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_dereference_variable *as_dereference_variable()
- {
- return this;
- }
-
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
/**
@@ -1984,11 +1947,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_dereference_array *as_dereference_array()
- {
- return this;
- }
-
virtual bool equals(ir_instruction *ir, enum ir_node_type ignore = ir_type_unset);
/**
@@ -2025,11 +1983,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_dereference_record *as_dereference_record()
- {
- return this;
- }
-
/**
* Get the variable that is ultimately referenced by an r-value
*/
@@ -2095,11 +2048,6 @@ public:
virtual ir_constant *constant_expression_value(struct hash_table *variable_context = NULL);
- virtual ir_constant *as_constant()
- {
- return this;
- }
-
virtual void accept(ir_visitor *v)
{
v->visit(this);
@@ -2207,8 +2155,8 @@ private:
class ir_emit_vertex : public ir_instruction {
public:
ir_emit_vertex()
+ : ir_instruction(ir_type_emit_vertex)
{
- ir_type = ir_type_emit_vertex;
}
virtual void accept(ir_visitor *v)
@@ -2231,8 +2179,8 @@ public:
class ir_end_primitive : public ir_instruction {
public:
ir_end_primitive()
+ : ir_instruction(ir_type_end_primitive)
{
- ir_type = ir_type_end_primitive;
}
virtual void accept(ir_visitor *v)
diff --git a/mesalib/src/glsl/ir_function.cpp b/mesalib/src/glsl/ir_function.cpp
index 40cf5894a..deec1dfe8 100644
--- a/mesalib/src/glsl/ir_function.cpp
+++ b/mesalib/src/glsl/ir_function.cpp
@@ -23,6 +23,7 @@
#include "glsl_types.h"
#include "ir.h"
+#include "glsl_parser_extras.h"
typedef enum {
PARAMETER_LIST_NO_MATCH,
@@ -38,7 +39,8 @@ typedef enum {
* \see matching_signature()
*/
static parameter_list_match_t
-parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
+parameter_lists_match(_mesa_glsl_parse_state *state,
+ const exec_list *list_a, const exec_list *list_b)
{
const exec_node *node_a = list_a->head;
const exec_node *node_b = list_b->head;
@@ -79,12 +81,12 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
case ir_var_const_in:
case ir_var_function_in:
- if (!actual->type->can_implicitly_convert_to(param->type))
+ if (!actual->type->can_implicitly_convert_to(param->type, state))
return PARAMETER_LIST_NO_MATCH;
break;
case ir_var_function_out:
- if (!param->type->can_implicitly_convert_to(actual->type))
+ if (!param->type->can_implicitly_convert_to(actual->type, state))
return PARAMETER_LIST_NO_MATCH;
break;
@@ -115,6 +117,168 @@ parameter_lists_match(const exec_list *list_a, const exec_list *list_b)
}
+/* Classes of parameter match, sorted (mostly) best matches first.
+ * See is_better_parameter_match() below for the exceptions.
+ * */
+typedef enum {
+ PARAMETER_EXACT_MATCH,
+ PARAMETER_FLOAT_TO_DOUBLE,
+ PARAMETER_INT_TO_FLOAT,
+ PARAMETER_INT_TO_DOUBLE,
+ PARAMETER_OTHER_CONVERSION,
+} parameter_match_t;
+
+
+static parameter_match_t
+get_parameter_match_type(const ir_variable *param,
+ const ir_rvalue *actual)
+{
+ const glsl_type *from_type;
+ const glsl_type *to_type;
+
+ if (param->data.mode == ir_var_function_out) {
+ from_type = param->type;
+ to_type = actual->type;
+ } else {
+ from_type = actual->type;
+ to_type = param->type;
+ }
+
+ if (from_type == to_type)
+ return PARAMETER_EXACT_MATCH;
+
+ /* XXX: When ARB_gpu_shader_fp64 support is added, check for float->double,
+ * and int/uint->double conversions
+ */
+
+ if (to_type->base_type == GLSL_TYPE_FLOAT)
+ return PARAMETER_INT_TO_FLOAT;
+
+ /* int -> uint and any other oddball conversions */
+ return PARAMETER_OTHER_CONVERSION;
+}
+
+
+static bool
+is_better_parameter_match(parameter_match_t a_match,
+ parameter_match_t b_match)
+{
+ /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec):
+ *
+ * 1. An exact match is better than a match involving any implicit
+ * conversion.
+ *
+ * 2. A match involving an implicit conversion from float to double
+ * is better than match involving any other implicit conversion.
+ *
+ * [XXX: Not in GLSL 4.0: Only in ARB_gpu_shader5:
+ * 3. A match involving an implicit conversion from either int or uint
+ * to float is better than a match involving an implicit conversion
+ * from either int or uint to double.]
+ *
+ * If none of the rules above apply to a particular pair of conversions,
+ * neither conversion is considered better than the other.
+ *
+ * --
+ *
+ * Notably, the int->uint conversion is *not* considered to be better
+ * or worse than int/uint->float or int/uint->double.
+ */
+
+ if (a_match >= PARAMETER_INT_TO_FLOAT && b_match == PARAMETER_OTHER_CONVERSION)
+ return false;
+
+ return a_match < b_match;
+}
+
+
+static bool
+is_best_inexact_overload(const exec_list *actual_parameters,
+ ir_function_signature **matches,
+ int num_matches,
+ ir_function_signature *sig)
+{
+ /* From section 6.1 of the GLSL 4.00 spec (and the ARB_gpu_shader5 spec):
+ *
+ * "A function definition A is considered a better
+ * match than function definition B if:
+ *
+ * * for at least one function argument, the conversion for that argument
+ * in A is better than the corresponding conversion in B; and
+ *
+ * * there is no function argument for which the conversion in B is better
+ * than the corresponding conversion in A.
+ *
+ * If a single function definition is considered a better match than every
+ * other matching function definition, it will be used. Otherwise, a
+ * semantic error occurs and the shader will fail to compile."
+ */
+ for (ir_function_signature **other = matches;
+ other < matches + num_matches; other++) {
+ if (*other == sig)
+ continue;
+
+ const exec_node *node_a = sig->parameters.head;
+ const exec_node *node_b = (*other)->parameters.head;
+ const exec_node *node_p = actual_parameters->head;
+
+ bool better_for_some_parameter = false;
+
+ for (/* empty */
+ ; !node_a->is_tail_sentinel()
+ ; node_a = node_a->next,
+ node_b = node_b->next,
+ node_p = node_p->next) {
+ parameter_match_t a_match = get_parameter_match_type(
+ (const ir_variable *)node_a,
+ (const ir_rvalue *)node_p);
+ parameter_match_t b_match = get_parameter_match_type(
+ (const ir_variable *)node_b,
+ (const ir_rvalue *)node_p);
+
+ if (is_better_parameter_match(a_match, b_match))
+ better_for_some_parameter = true;
+
+ if (is_better_parameter_match(b_match, a_match))
+ return false; /* B is better for this parameter */
+ }
+
+ if (!better_for_some_parameter)
+ return false; /* A must be better than B for some parameter */
+
+ }
+
+ return true;
+}
+
+
+static ir_function_signature *
+choose_best_inexact_overload(_mesa_glsl_parse_state *state,
+ const exec_list *actual_parameters,
+ ir_function_signature **matches,
+ int num_matches)
+{
+ if (num_matches == 0)
+ return NULL;
+
+ if (num_matches == 1)
+ return *matches;
+
+ /* Without GLSL 4.0 / ARB_gpu_shader5, there is no overload resolution
+ * among multiple inexact matches. Note that state may be NULL here if
+ * called from the linker; in that case we assume everything supported in
+ * any GLSL version is available. */
+ if (!state || state->is_version(400, 0) || state->ARB_gpu_shader5_enable) {
+ for (ir_function_signature **sig = matches; sig < matches + num_matches; sig++) {
+ if (is_best_inexact_overload(actual_parameters, matches, num_matches, *sig))
+ return *sig;
+ }
+ }
+
+ return NULL; /* no best candidate */
+}
+
+
ir_function_signature *
ir_function::matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_parameters)
@@ -126,10 +290,11 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
ir_function_signature *
ir_function::matching_signature(_mesa_glsl_parse_state *state,
const exec_list *actual_parameters,
- bool *is_exact)
+ bool *is_exact)
{
+ ir_function_signature **inexact_matches = NULL;
ir_function_signature *match = NULL;
- bool multiple_inexact_matches = false;
+ int num_inexact_matches = 0;
/* From page 42 (page 49 of the PDF) of the GLSL 1.20 spec:
*
@@ -148,16 +313,19 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
if (sig->is_builtin() && !sig->is_builtin_available(state))
continue;
- switch (parameter_lists_match(& sig->parameters, actual_parameters)) {
+ switch (parameter_lists_match(state, & sig->parameters, actual_parameters)) {
case PARAMETER_LIST_EXACT_MATCH:
- *is_exact = true;
- return sig;
+ *is_exact = true;
+ free(inexact_matches);
+ return sig;
case PARAMETER_LIST_INEXACT_MATCH:
- if (match == NULL)
- match = sig;
- else
- multiple_inexact_matches = true;
- continue;
+ inexact_matches = (ir_function_signature **)
+ realloc(inexact_matches,
+ sizeof(*inexact_matches) *
+ (num_inexact_matches + 1));
+ assert(inexact_matches);
+ inexact_matches[num_inexact_matches++] = sig;
+ continue;
case PARAMETER_LIST_NO_MATCH:
continue;
default:
@@ -175,9 +343,10 @@ ir_function::matching_signature(_mesa_glsl_parse_state *state,
*/
*is_exact = false;
- if (multiple_inexact_matches)
- return NULL;
+ match = choose_best_inexact_overload(state, actual_parameters,
+ inexact_matches, num_inexact_matches);
+ free(inexact_matches);
return match;
}
diff --git a/mesalib/src/glsl/ir_validate.cpp b/mesalib/src/glsl/ir_validate.cpp
index 71defc815..17a74ea55 100644
--- a/mesalib/src/glsl/ir_validate.cpp
+++ b/mesalib/src/glsl/ir_validate.cpp
@@ -795,7 +795,7 @@ check_node_type(ir_instruction *ir, void *data)
{
(void) data;
- if (ir->ir_type <= ir_type_unset || ir->ir_type >= ir_type_max) {
+ if (ir->ir_type >= ir_type_max) {
printf("Instruction node with unset type\n");
ir->print(); printf("\n");
}
diff --git a/mesalib/src/glsl/loop_analysis.cpp b/mesalib/src/glsl/loop_analysis.cpp
index d6a9ac775..78ac30044 100644
--- a/mesalib/src/glsl/loop_analysis.cpp
+++ b/mesalib/src/glsl/loop_analysis.cpp
@@ -589,8 +589,10 @@ get_basic_induction_increment(ir_assignment *ir, hash_table *var_hash)
loop_variable *lv =
(loop_variable *) hash_table_find(var_hash, inc_var);
- if (!lv->is_loop_constant())
- inc = NULL;
+ if (lv == NULL || !lv->is_loop_constant()) {
+ assert(lv != NULL);
+ inc = NULL;
+ }
} else
inc = NULL;
}
diff --git a/mesalib/src/loader/loader.c b/mesalib/src/loader/loader.c
index 666d0158a..0f262653b 100644
--- a/mesalib/src/loader/loader.c
+++ b/mesalib/src/loader/loader.c
@@ -71,6 +71,10 @@
#include <assert.h>
#include <dlfcn.h>
#endif
+#ifdef HAVE_SYSFS
+#include <sys/stat.h>
+#include <sys/types.h>
+#endif
#include "loader.h"
#ifndef __NOT_HAVE_DRM_H
@@ -113,8 +117,8 @@ udev_dlopen_handle(void)
udev_handle = dlopen("libudev.so.0", RTLD_LOCAL | RTLD_LAZY);
if (!udev_handle) {
- log_(_LOADER_FATAL, "Couldn't dlopen libudev.so.1 or libudev.so.0, "
- "driver detection may be broken.\n");
+ log_(_LOADER_WARNING, "Couldn't dlopen libudev.so.1 or "
+ "libudev.so.0, driver detection may be broken.\n");
}
}
}
@@ -122,16 +126,19 @@ udev_dlopen_handle(void)
return udev_handle;
}
+static int dlsym_failed = 0;
+
static void *
-asserted_dlsym(void *dlopen_handle, const char *name)
+checked_dlsym(void *dlopen_handle, const char *name)
{
void *result = dlsym(dlopen_handle, name);
- assert(result);
+ if (!result)
+ dlsym_failed = 1;
return result;
}
#define UDEV_SYMBOL(ret, name, args) \
- ret (*name) args = asserted_dlsym(udev_dlopen_handle(), #name);
+ ret (*name) args = checked_dlsym(udev_dlopen_handle(), #name);
static inline struct udev_device *
@@ -142,6 +149,9 @@ udev_device_new_from_fd(struct udev *udev, int fd)
UDEV_SYMBOL(struct udev_device *, udev_device_new_from_devnum,
(struct udev *udev, char type, dev_t devnum));
+ if (dlsym_failed)
+ return NULL;
+
if (fstat(fd, &buf) < 0) {
log_(_LOADER_WARNING, "MESA-LOADER: failed to stat fd %d\n", fd);
return NULL;
@@ -157,8 +167,8 @@ udev_device_new_from_fd(struct udev *udev, int fd)
return device;
}
-int
-loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
+static int
+libudev_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
struct udev *udev = NULL;
struct udev_device *device = NULL, *parent;
@@ -174,6 +184,9 @@ loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
*chip_id = -1;
+ if (dlsym_failed)
+ return 0;
+
udev = udev_new();
device = udev_device_new_from_fd(udev, fd);
if (!device)
@@ -201,16 +214,76 @@ out:
return (*chip_id >= 0);
}
+#endif
+
+#if defined(HAVE_SYSFS)
+static int
+dev_node_from_fd(int fd, unsigned int *maj, unsigned int *min)
+{
+ struct stat buf;
+
+ if (fstat(fd, &buf) < 0) {
+ log_(_LOADER_WARNING, "MESA-LOADER: failed to stat fd %d\n", fd);
+ return -1;
+ }
+
+ if (!S_ISCHR(buf.st_mode)) {
+ log_(_LOADER_WARNING, "MESA-LOADER: fd %d not a character device\n", fd);
+ return -1;
+ }
+
+ *maj = major(buf.st_rdev);
+ *min = minor(buf.st_rdev);
+
+ return 0;
+}
+
+static int
+sysfs_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
+{
+ unsigned int maj, min;
+ FILE *f;
+ char buf[0x40];
+
+ if (dev_node_from_fd(fd, &maj, &min) < 0) {
+ *chip_id = -1;
+ return 0;
+ }
-#elif !defined(__NOT_HAVE_DRM_H)
+ snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/vendor", maj, min);
+ if (!(f = fopen(buf, "r"))) {
+ *chip_id = -1;
+ return 0;
+ }
+ if (fscanf(f, "%x", vendor_id) != 1) {
+ *chip_id = -1;
+ fclose(f);
+ return 0;
+ }
+ fclose(f);
+ snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/device/device", maj, min);
+ if (!(f = fopen(buf, "r"))) {
+ *chip_id = -1;
+ return 0;
+ }
+ if (fscanf(f, "%x", chip_id) != 1) {
+ *chip_id = -1;
+ fclose(f);
+ return 0;
+ }
+ fclose(f);
+ return 1;
+}
+#endif
+#if !defined(__NOT_HAVE_DRM_H)
/* for i915 */
#include <i915_drm.h>
/* for radeon */
#include <radeon_drm.h>
-int
-loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
+static int
+drm_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
drmVersionPtr version;
@@ -272,23 +345,33 @@ loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
return (*chip_id >= 0);
}
+#endif
-#else
int
loader_get_pci_id_for_fd(int fd, int *vendor_id, int *chip_id)
{
+#if HAVE_LIBUDEV
+ if (libudev_get_pci_id_for_fd(fd, vendor_id, chip_id))
+ return 1;
+#endif
+#if HAVE_SYSFS
+ if (sysfs_get_pci_id_for_fd(fd, vendor_id, chip_id))
+ return 1;
+#endif
+#if !defined(__NOT_HAVE_DRM_H)
+ if (drm_get_pci_id_for_fd(fd, vendor_id, chip_id))
+ return 1;
+#endif
return 0;
}
-#endif
-
-char *
-loader_get_device_name_for_fd(int fd)
+#ifdef HAVE_LIBUDEV
+static char *
+libudev_get_device_name_for_fd(int fd)
{
char *device_name = NULL;
-#ifdef HAVE_LIBUDEV
struct udev *udev;
struct udev_device *device;
const char *const_device_name;
@@ -312,9 +395,66 @@ loader_get_device_name_for_fd(int fd)
out:
udev_device_unref(device);
udev_unref(udev);
+ return device_name;
+}
#endif
+
+
+#if HAVE_SYSFS
+static char *
+sysfs_get_device_name_for_fd(int fd)
+{
+ char *device_name = NULL;
+ unsigned int maj, min;
+ FILE *f;
+ char buf[0x40];
+ static const char match[9] = "\0DEVNAME=";
+ int expected = 1;
+
+ if (dev_node_from_fd(fd, &maj, &min) < 0)
+ return NULL;
+
+ snprintf(buf, sizeof(buf), "/sys/dev/char/%d:%d/uevent", maj, min);
+ if (!(f = fopen(buf, "r")))
+ return NULL;
+
+ while (expected < sizeof(match)) {
+ int c = getc(f);
+
+ if (c == EOF) {
+ fclose(f);
+ return NULL;
+ } else if (c == match[expected] )
+ expected++;
+ else
+ expected = 0;
+ }
+
+ strcpy(buf, "/dev/");
+ if (fgets(buf + 5, sizeof(buf) - 5, f))
+ device_name = strdup(buf);
+
+ fclose(f);
return device_name;
}
+#endif
+
+
+char *
+loader_get_device_name_for_fd(int fd)
+{
+ char *result = NULL;
+
+#if HAVE_LIBUDEV
+ if ((result = libudev_get_device_name_for_fd(fd)))
+ return result;
+#endif
+#if HAVE_SYSFS
+ if ((result = sysfs_get_device_name_for_fd(fd)))
+ return result;
+#endif
+ return result;
+}
char *
loader_get_driver_for_fd(int fd, unsigned driver_types)
diff --git a/mesalib/src/mapi/glapi/gen/gl_API.xml b/mesalib/src/mapi/glapi/gen/gl_API.xml
index 4e430fda5..58aed8e6f 100755
--- a/mesalib/src/mapi/glapi/gen/gl_API.xml
+++ b/mesalib/src/mapi/glapi/gen/gl_API.xml
@@ -8314,6 +8314,9 @@
<xi:include href="ARB_invalidate_subdata.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
+<!-- ARB extension #133 is ARB_multi_draw_indirect, defined in the same
+ file as ARB_draw_indirect -->
+
<!-- ARB extensions #134...#138 -->
<xi:include href="ARB_texture_buffer_range.xml" xmlns:xi="http://www.w3.org/2001/XInclude"/>
diff --git a/mesalib/src/mapi/glapi/glapi_dispatch.c b/mesalib/src/mapi/glapi/glapi_dispatch.c
index b4c8c7773..d2dd9654a 100644
--- a/mesalib/src/mapi/glapi/glapi_dispatch.c
+++ b/mesalib/src/mapi/glapi/glapi_dispatch.c
@@ -87,6 +87,63 @@
/* those link to libglapi.a should provide the entry points */
#define _GLAPI_SKIP_PROTO_ENTRY_POINTS
#endif
+
+/* These prototypes are necessary because GLES1 library builds will create
+ * dispatch functions for them. We can't directly include GLES/gl.h because
+ * it would conflict the previously-included GL/gl.h. Since GLES1 ABI is not
+ * expected to every add more functions, the path of least resistance is to
+ * just duplicate the prototypes for the functions that aren't already in
+ * desktop OpenGL.
+ */
+#include <GLES/glplatform.h>
+
+GL_API void GL_APIENTRY glClearDepthf (GLclampf depth);
+GL_API void GL_APIENTRY glClipPlanef (GLenum plane, const GLfloat *equation);
+GL_API void GL_APIENTRY glFrustumf (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+GL_API void GL_APIENTRY glGetClipPlanef (GLenum pname, GLfloat eqn[4]);
+GL_API void GL_APIENTRY glOrthof (GLfloat left, GLfloat right, GLfloat bottom, GLfloat top, GLfloat zNear, GLfloat zFar);
+
+GL_API void GL_APIENTRY glAlphaFuncx (GLenum func, GLclampx ref);
+GL_API void GL_APIENTRY glClearColorx (GLclampx red, GLclampx green, GLclampx blue, GLclampx alpha);
+GL_API void GL_APIENTRY glClearDepthx (GLclampx depth);
+GL_API void GL_APIENTRY glClipPlanex (GLenum plane, const GLfixed *equation);
+GL_API void GL_APIENTRY glColor4x (GLfixed red, GLfixed green, GLfixed blue, GLfixed alpha);
+GL_API void GL_APIENTRY glDepthRangex (GLclampx zNear, GLclampx zFar);
+GL_API void GL_APIENTRY glFogx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glFogxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glFrustumx (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glGetClipPlanex (GLenum pname, GLfixed eqn[4]);
+GL_API void GL_APIENTRY glGetFixedv (GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetLightxv (GLenum light, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetMaterialxv (GLenum face, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexEnvxv (GLenum env, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glGetTexParameterxv (GLenum target, GLenum pname, GLfixed *params);
+GL_API void GL_APIENTRY glLightModelx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightModelxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLightx (GLenum light, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glLightxv (GLenum light, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glLineWidthx (GLfixed width);
+GL_API void GL_APIENTRY glLoadMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMaterialx (GLenum face, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glMaterialxv (GLenum face, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glMultMatrixx (const GLfixed *m);
+GL_API void GL_APIENTRY glMultiTexCoord4x (GLenum target, GLfixed s, GLfixed t, GLfixed r, GLfixed q);
+GL_API void GL_APIENTRY glNormal3x (GLfixed nx, GLfixed ny, GLfixed nz);
+GL_API void GL_APIENTRY glOrthox (GLfixed left, GLfixed right, GLfixed bottom, GLfixed top, GLfixed zNear, GLfixed zFar);
+GL_API void GL_APIENTRY glPointParameterx (GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glPointParameterxv (GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glPointSizex (GLfixed size);
+GL_API void GL_APIENTRY glPolygonOffsetx (GLfixed factor, GLfixed units);
+GL_API void GL_APIENTRY glRotatex (GLfixed angle, GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glSampleCoveragex (GLclampx value, GLboolean invert);
+GL_API void GL_APIENTRY glScalex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glTexEnvx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexEnvxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTexParameterx (GLenum target, GLenum pname, GLfixed param);
+GL_API void GL_APIENTRY glTexParameterxv (GLenum target, GLenum pname, const GLfixed *params);
+GL_API void GL_APIENTRY glTranslatex (GLfixed x, GLfixed y, GLfixed z);
+GL_API void GL_APIENTRY glPointSizePointerOES (GLenum type, GLsizei stride, const GLvoid *pointer);
+
#include "glapi/glapitemp.h"
#endif /* USE_X86_ASM */
diff --git a/mesalib/src/mesa/drivers/common/meta_blit.c b/mesalib/src/mesa/drivers/common/meta_blit.c
index 5929619f3..f26ef93c1 100644
--- a/mesalib/src/mesa/drivers/common/meta_blit.c
+++ b/mesalib/src/mesa/drivers/common/meta_blit.c
@@ -430,6 +430,9 @@ blitframebuffer_texture(struct gl_context *ctx,
srcLevel = 0;
target = meta_temp_texture->Target;
texObj = _mesa_lookup_texture(ctx, meta_temp_texture->TexObj);
+ if (texObj == NULL) {
+ return false;
+ }
_mesa_meta_setup_copypix_texture(ctx, meta_temp_texture,
srcX0, srcY0,
diff --git a/mesalib/src/mesa/main/get.c b/mesalib/src/mesa/main/get.c
index 80a5839b5..9b56edb74 100644
--- a/mesalib/src/mesa/main/get.c
+++ b/mesalib/src/mesa/main/get.c
@@ -847,6 +847,16 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
v->value_int = ctx->Array.VAO->IndexBufferObj->Name;
break;
+ /* ARB_vertex_array_bgra */
+ case GL_COLOR_ARRAY_SIZE:
+ array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR0];
+ v->value_int = array->Format == GL_BGRA ? GL_BGRA : array->Size;
+ break;
+ case GL_SECONDARY_COLOR_ARRAY_SIZE:
+ array = &ctx->Array.VAO->VertexAttrib[VERT_ATTRIB_COLOR1];
+ v->value_int = array->Format == GL_BGRA ? GL_BGRA : array->Size;
+ break;
+
/* ARB_copy_buffer */
case GL_COPY_READ_BUFFER:
v->value_int = ctx->CopyReadBuffer->Name;
@@ -995,7 +1005,11 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu
break;
/* GL_ARB_shader_atomic_counters */
case GL_ATOMIC_COUNTER_BUFFER_BINDING:
- v->value_int = ctx->AtomicBuffer->Name;
+ if (ctx->AtomicBuffer) {
+ v->value_int = ctx->AtomicBuffer->Name;
+ } else {
+ v->value_int = 0;
+ }
break;
/* GL_ARB_draw_indirect */
case GL_DRAW_INDIRECT_BUFFER_BINDING:
diff --git a/mesalib/src/mesa/main/get_hash_generator.py b/mesalib/src/mesa/main/get_hash_generator.py
index 96bc49587..b200d1973 100644
--- a/mesalib/src/mesa/main/get_hash_generator.py
+++ b/mesalib/src/mesa/main/get_hash_generator.py
@@ -52,7 +52,7 @@ def print_header():
(prime_factor, prime_step)
def print_params(params):
- print "static struct value_desc values[] = {"
+ print "static const struct value_desc values[] = {"
for p in params:
print " { %s, %s }," % (p[0], p[1])
diff --git a/mesalib/src/mesa/main/get_hash_params.py b/mesalib/src/mesa/main/get_hash_params.py
index d40fa0778..c7a6e02af 100644
--- a/mesalib/src/mesa/main/get_hash_params.py
+++ b/mesalib/src/mesa/main/get_hash_params.py
@@ -199,7 +199,7 @@ descriptor=[
[ "NORMAL_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_NORMAL].Type), NO_EXTRA" ],
[ "NORMAL_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_NORMAL].Stride), NO_EXTRA" ],
[ "COLOR_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR0].Enabled), NO_EXTRA" ],
- [ "COLOR_ARRAY_SIZE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Size), NO_EXTRA" ],
+ [ "COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
[ "COLOR_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR0].Type), NO_EXTRA" ],
[ "COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR0].Stride), NO_EXTRA" ],
[ "TEXTURE_COORD_ARRAY", "LOC_CUSTOM, TYPE_BOOLEAN, offsetof(struct gl_client_array, Enabled), NO_EXTRA" ],
@@ -552,7 +552,7 @@ descriptor=[
[ "SECONDARY_COLOR_ARRAY", "ARRAY_BOOL(VertexAttrib[VERT_ATTRIB_COLOR1].Enabled), NO_EXTRA" ],
[ "SECONDARY_COLOR_ARRAY_TYPE", "ARRAY_ENUM(VertexAttrib[VERT_ATTRIB_COLOR1].Type), NO_EXTRA" ],
[ "SECONDARY_COLOR_ARRAY_STRIDE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Stride), NO_EXTRA" ],
- [ "SECONDARY_COLOR_ARRAY_SIZE", "ARRAY_INT(VertexAttrib[VERT_ATTRIB_COLOR1].Size), NO_EXTRA" ],
+ [ "SECONDARY_COLOR_ARRAY_SIZE", "LOC_CUSTOM, TYPE_INT, 0, NO_EXTRA" ],
# GL_EXT_fog_coord
[ "CURRENT_FOG_COORDINATE", "CONTEXT_FLOAT(Current.Attrib[VERT_ATTRIB_FOG][0]), extra_flush_current" ],
diff --git a/mesalib/src/mesa/main/hash.c b/mesalib/src/mesa/main/hash.c
index 23018e9da..674c29d65 100644
--- a/mesalib/src/mesa/main/hash.c
+++ b/mesalib/src/mesa/main/hash.c
@@ -115,10 +115,20 @@ _mesa_NewHashTable(void)
if (table) {
table->ht = _mesa_hash_table_create(NULL, uint_key_compare);
+ if (table->ht == NULL) {
+ free(table);
+ _mesa_error_no_memory(__func__);
+ return NULL;
+ }
+
_mesa_hash_table_set_deleted_key(table->ht, uint_key(DELETED_KEY_VALUE));
mtx_init(&table->Mutex, mtx_plain);
mtx_init(&table->WalkMutex, mtx_plain);
}
+ else {
+ _mesa_error_no_memory(__func__);
+ }
+
return table;
}
diff --git a/mesalib/src/mesa/main/performance_monitor.c b/mesalib/src/mesa/main/performance_monitor.c
index 21b9423e0..9d1a6b4d8 100644
--- a/mesalib/src/mesa/main/performance_monitor.c
+++ b/mesalib/src/mesa/main/performance_monitor.c
@@ -1036,6 +1036,11 @@ _mesa_CreatePerfQueryINTEL(GLuint queryId, GLuint *queryHandle)
}
m = new_performance_monitor(ctx, first);
+ if (m == NULL) {
+ _mesa_error_no_memory(__func__);
+ return;
+ }
+
_mesa_HashInsert(ctx->PerfMonitor.Monitors, first, m);
*queryHandle = first;
diff --git a/mesalib/src/mesa/program/prog_hash_table.c b/mesalib/src/mesa/program/prog_hash_table.c
index f45ed46af..2445d8434 100644
--- a/mesalib/src/mesa/program/prog_hash_table.c
+++ b/mesalib/src/mesa/program/prog_hash_table.c
@@ -142,6 +142,10 @@ hash_table_insert(struct hash_table *ht, void *data, const void *key)
struct hash_node *node;
node = calloc(1, sizeof(*node));
+ if (node == NULL) {
+ _mesa_error_no_memory(__func__);
+ return;
+ }
node->data = data;
node->key = key;
@@ -167,6 +171,10 @@ hash_table_replace(struct hash_table *ht, void *data, const void *key)
}
hn = calloc(1, sizeof(*hn));
+ if (hn == NULL) {
+ _mesa_error_no_memory(__func__);
+ return false;
+ }
hn->data = data;
hn->key = key;
diff --git a/mesalib/src/mesa/state_tracker/st_atom_texture.c b/mesalib/src/mesa/state_tracker/st_atom_texture.c
index 928a4ffd2..e2d26ee24 100644
--- a/mesalib/src/mesa/state_tracker/st_atom_texture.c
+++ b/mesalib/src/mesa/state_tracker/st_atom_texture.c
@@ -358,7 +358,7 @@ update_textures(struct st_context *st,
{
const GLuint old_max = *num_textures;
GLbitfield samplers_used = prog->SamplersUsed;
- GLuint unit, new_count;
+ GLuint unit;
if (samplers_used == 0x0 && old_max == 0)
return;
@@ -387,16 +387,9 @@ update_textures(struct st_context *st,
pipe_sampler_view_reference(&(sampler_views[unit]), sampler_view);
}
- /* Ex: if old_max = 3 and *num_textures = 1, we need to pass an
- * array of views={X, NULL, NULL} to unref the old texture views
- * at positions [1] and [2].
- */
- new_count = MAX2(*num_textures, old_max);
- assert(new_count <= max_units);
-
cso_set_sampler_views(st->cso_context,
shader_stage,
- new_count,
+ *num_textures,
sampler_views);
}
diff --git a/mkfontscale/autogen.sh b/mkfontscale/autogen.sh
index e81f98910..fc34bd55c 100644
--- a/mkfontscale/autogen.sh
+++ b/mkfontscale/autogen.sh
@@ -9,5 +9,6 @@ cd $srcdir
autoreconf -v --install || exit 1
cd $ORIGDIR || exit $?
-$srcdir/configure --enable-maintainer-mode "$@"
-
+if test -z "$NOCONFIGURE"; then
+ $srcdir/configure "$@"
+fi
diff --git a/mkfontscale/configure.ac b/mkfontscale/configure.ac
index cc13259ab..0bc9e7a87 100644
--- a/mkfontscale/configure.ac
+++ b/mkfontscale/configure.ac
@@ -31,7 +31,6 @@ AC_USE_SYSTEM_EXTENSIONS
# Initialize Automake
AM_INIT_AUTOMAKE([foreign dist-bzip2])
-AM_MAINTAINER_MODE
# Require X.Org macros 1.8 or later for MAN_SUBSTS set by XORG_MANPAGE_SECTIONS
m4_ifndef([XORG_MACROS_VERSION],
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c
index 5b50fd58e..551db92b4 100644
--- a/xorg-server/Xi/exevents.c
+++ b/xorg-server/Xi/exevents.c
@@ -663,6 +663,8 @@ void
DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
DeviceChangedEvent *dce)
{
+ OsBlockSIGIO();
+
/* generic feedback classes, not tied to pointer and/or keyboard */
DeepCopyFeedbackClasses(from, to);
@@ -670,6 +672,8 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to,
DeepCopyKeyboardClasses(from, to);
if ((dce->flags & DEVCHANGE_POINTER_EVENT))
DeepCopyPointerClasses(from, to);
+
+ OsReleaseSIGIO();
}
/**
diff --git a/xorg-server/config/10-quirks.conf b/xorg-server/config/10-quirks.conf
index c9b823ceb..47907d82d 100644
--- a/xorg-server/config/10-quirks.conf
+++ b/xorg-server/config/10-quirks.conf
@@ -19,22 +19,6 @@ Section "InputClass"
Option "IgnoreRelativeAxes" "off"
EndSection
-# https://bugzilla.redhat.com/show_bug.cgi?id=612140
-# please make Evoluent VerticalMouse 3 work out of the box
-# Button mapping on this mouse is quirky
-Section "InputClass"
- Identifier "Evoluent VerticalMouse 3"
- MatchProduct "Evoluent VerticalMouse 3"
- # Sets following configuration:
- # top button: left
- # middle button: middle
- # bottom button: right
- # wheel click: middle
- # thumb button: 8 (back)
- Option "ButtonMapping" "1 2 2 4 5 6 7 3 8"
-EndSection
-
-
# https://bugs.freedesktop.org/show_bug.cgi?id=55867
# Bug 55867 - Doesn't know how to tag XI_TRACKBALL
Section "InputClass"
diff --git a/xorg-server/configure.ac b/xorg-server/configure.ac
index e5387bffd..0a6e77255 100644
--- a/xorg-server/configure.ac
+++ b/xorg-server/configure.ac
@@ -26,9 +26,9 @@ dnl
dnl Process this file with autoconf to create configure.
AC_PREREQ(2.60)
-AC_INIT([xorg-server], 1.15.99.902, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
-RELEASE_DATE="2014-04-08"
-RELEASE_NAME="Glacier Blue"
+AC_INIT([xorg-server], 1.15.99.903, [https://bugs.freedesktop.org/enter_bug.cgi?product=xorg], xorg-server)
+RELEASE_DATE="2014-06-04"
+RELEASE_NAME="Strawberry Shortcake"
AC_CONFIG_SRCDIR([Makefile.am])
AC_CONFIG_MACRO_DIR([m4])
AM_INIT_AUTOMAKE([foreign dist-bzip2])
@@ -2442,7 +2442,7 @@ AM_CONDITIONAL(XFAKESERVER, [test "x$KDRIVE" = xyes && test "x$XFAKE" = xyes])
dnl Xwayland DDX
-PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
+PKG_CHECK_MODULES(XWAYLANDMODULES, [wayland-client >= 1.3.0 libdrm epoxy], [have_xwayland=yes], [have_xwayland=no])
AC_MSG_CHECKING([whether to build Xwayland DDX])
if test "x$XWAYLAND" = xauto; then
XWAYLAND="$have_xwayland"
diff --git a/xorg-server/dix/devices.c b/xorg-server/dix/devices.c
index 106d2dfc7..468b5a199 100644
--- a/xorg-server/dix/devices.c
+++ b/xorg-server/dix/devices.c
@@ -947,8 +947,9 @@ CloseDevice(DeviceIntPtr dev)
if (dev->inited)
(void) (*dev->deviceProc) (dev, DEVICE_CLOSE);
- /* free sprite memory */
- if (IsMaster(dev) && dev->spriteInfo->sprite)
+ FreeSprite(dev);
+
+ if (IsMaster(dev))
screen->DeviceCursorCleanup(dev, screen);
/* free acceleration info */
@@ -969,8 +970,6 @@ CloseDevice(DeviceIntPtr dev)
free(classes);
}
- FreeSprite(dev);
-
/* a client may have the device set as client pointer */
for (j = 0; j < currentMaxClients; j++) {
if (clients[j] && clients[j]->clientPtr == dev) {
diff --git a/xorg-server/dix/events.c b/xorg-server/dix/events.c
index d606e727c..e3f5e2372 100644
--- a/xorg-server/dix/events.c
+++ b/xorg-server/dix/events.c
@@ -3241,7 +3241,7 @@ InitializeSprite(DeviceIntPtr pDev, WindowPtr pWin)
pCursor = RefCursor(pCursor);
if (pSprite->current)
FreeCursor(pSprite->current, None);
- pSprite->current = RefCursor(pCursor);
+ pSprite->current = pCursor;
if (pScreen) {
(*pScreen->RealizeCursor) (pDev, pScreen, pSprite->current);
diff --git a/xorg-server/fb/fbscreen.c b/xorg-server/fb/fbscreen.c
index b2b973974..1f9108945 100644
--- a/xorg-server/fb/fbscreen.c
+++ b/xorg-server/fb/fbscreen.c
@@ -37,7 +37,7 @@ fbCloseScreen(ScreenPtr pScreen)
free(depths[d].vids);
free(depths);
free(pScreen->visuals);
- free(pScreen->devPrivate);
+ FreePixmap((PixmapPtr)pScreen->devPrivate);
return TRUE;
}
diff --git a/xorg-server/hw/xfree86/common/compiler.h b/xorg-server/hw/xfree86/common/compiler.h
index 15e1ca234..a44afacde 100644
--- a/xorg-server/hw/xfree86/common/compiler.h
+++ b/xorg-server/hw/xfree86/common/compiler.h
@@ -1352,7 +1352,10 @@ stl_u(unsigned long val, unsigned int *p)
#else /* ix86 */
#if !defined(__SUNPRO_C)
-#if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__)
+#if !defined(FAKEIT) && !defined(__mc68000__) && !defined(__arm__) && \
+ !defined(__sh__) && !defined(__hppa__) && !defined(__s390__) && \
+ !defined(__m32r__) && !defined(__aarch64__) && !defined(__arc__) && \
+ !defined(__xtensa__)
#ifdef GCCUSESGAS
/*
diff --git a/xorg-server/hw/xfree86/common/xf86Config.c b/xorg-server/hw/xfree86/common/xf86Config.c
index 2adef44c3..481674de2 100644
--- a/xorg-server/hw/xfree86/common/xf86Config.c
+++ b/xorg-server/hw/xfree86/common/xf86Config.c
@@ -519,7 +519,7 @@ xf86InputDriverlistFromConfig(void)
static void
fixup_video_driver_list(const char **drivers)
{
- static const char *fallback[4] = { "fbdev", "vesa", "wsfb", NULL };
+ static const char *fallback[5] = { "modesetting", "fbdev", "vesa", "wsfb", NULL };
const char **end, **drv;
const char *x;
int i;
diff --git a/xorg-server/hw/xfree86/loader/loadmod.c b/xorg-server/hw/xfree86/loader/loadmod.c
index 092bf5735..e1f649a74 100644
--- a/xorg-server/hw/xfree86/loader/loadmod.c
+++ b/xorg-server/hw/xfree86/loader/loadmod.c
@@ -838,6 +838,12 @@ static const char *compiled_in_modules[] = {
"extmod",
"dri",
"dri2",
+#if DRI3
+ "dri3",
+#endif
+#if PRESENT
+ "present",
+#endif
NULL
};
diff --git a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
index 40765fccf..652f963a2 100644
--- a/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
+++ b/xorg-server/hw/xfree86/os-support/linux/lnx_video.c
@@ -60,7 +60,8 @@ static Bool ExtendedEnabled = FALSE;
!defined(__nds32__) && \
!defined(__arm__) && \
!defined(__aarch64__) && \
- !defined(__arc__)
+ !defined(__arc__) && \
+ !defined(__xtensa__)
/*
* Due to conflicts with "compiler.h", don't rely on <sys/io.h> to declare
diff --git a/xorg-server/hw/xfree86/xorgconf.cpp b/xorg-server/hw/xfree86/xorgconf.cpp
index cd6d4a983..a903438b6 100644
--- a/xorg-server/hw/xfree86/xorgconf.cpp
+++ b/xorg-server/hw/xfree86/xorgconf.cpp
@@ -97,7 +97,7 @@ Section "ServerFlags"
# Uncomment this to disable the <Ctrl><Alt><BS> server abort sequence
# This allows clients to receive this key event.
-# Option "DontZap" "false"
+# Option "DontZap" "true"
# Uncomment this to disable the <Ctrl><Alt><KP_+>/<KP_-> mode switching
# sequences. This allows clients to receive these key events.
diff --git a/xorg-server/hw/xquartz/bundle/Info.plist.cpp b/xorg-server/hw/xquartz/bundle/Info.plist.cpp
index 5fbb0ad55..a0d9050ac 100644
--- a/xorg-server/hw/xquartz/bundle/Info.plist.cpp
+++ b/xorg-server/hw/xquartz/bundle/Info.plist.cpp
@@ -19,9 +19,9 @@
<key>CFBundlePackageType</key>
<string>APPL</string>
<key>CFBundleShortVersionString</key>
- <string>2.7.6</string>
+ <string>2.7.7</string>
<key>CFBundleVersion</key>
- <string>2.7.6</string>
+ <string>2.7.7</string>
<key>CFBundleSignature</key>
<string>x11a</string>
<key>CSResourcesFileMapped</key>
diff --git a/xorg-server/hw/xquartz/darwin.c b/xorg-server/hw/xquartz/darwin.c
index e0983d6ef..29c6438a0 100644
--- a/xorg-server/hw/xquartz/darwin.c
+++ b/xorg-server/hw/xquartz/darwin.c
@@ -704,22 +704,6 @@ OsVendorInit(void)
free(lf);
DarwinPrintBanner();
-#ifdef ENABLE_DEBUG_LOG
- {
- char *home_dir = NULL, *log_file_path = NULL;
- home_dir = getenv("HOME");
- if (home_dir) asprintf(&log_file_path, "%s/%s", home_dir,
- DEBUG_LOG_NAME);
- if (log_file_path) {
- if (!access(log_file_path, F_OK)) {
- debug_log_fp = fopen(log_file_path, "a");
- if (debug_log_fp) ErrorF("Debug logging enabled to %s\n",
- log_file_path);
- }
- free(log_file_path);
- }
- }
-#endif
}
}
diff --git a/xorg-server/hw/xquartz/xpr/xprScreen.c b/xorg-server/hw/xquartz/xpr/xprScreen.c
index e37601995..7aa1ae1df 100644
--- a/xorg-server/hw/xquartz/xpr/xprScreen.c
+++ b/xorg-server/hw/xquartz/xpr/xprScreen.c
@@ -54,6 +54,11 @@
#include "damage.h"
#endif
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+// From NSApplication.h
+extern const double NSAppKitVersionNumber;
+#endif
+
/* 10.4's deferred update makes X slower.. have to live with the tearing
* for now.. */
#define XP_NO_DEFERRED_UPDATES 8
@@ -164,9 +169,14 @@ displayScreenBounds(CGDirectDisplayID id)
(int)frame.size.width, (int)frame.size.height,
(int)frame.origin.x, (int)frame.origin.y);
- /* Remove menubar to help standard X11 window managers. */
- if (XQuartzIsRootless &&
- frame.origin.x == 0 && frame.origin.y == 0) {
+ /* Remove menubar to help standard X11 window managers.
+ * On Mavericks and later, the menu bar is on all displays.
+ */
+ if (XQuartzIsRootless
+#if MAC_OS_X_VERSION_MIN_REQUIRED < 1090
+ && (NSAppKitVersionNumber >= 1265 || (frame.origin.x == 0 && frame.origin.y == 0))
+#endif
+ ) {
frame.origin.y += aquaMenuBarHeight;
frame.size.height -= aquaMenuBarHeight;
}
diff --git a/xorg-server/hw/xwin/glx/indirect.c b/xorg-server/hw/xwin/glx/indirect.c
index f4a9250c4..b12fa7d68 100644..100755
--- a/xorg-server/hw/xwin/glx/indirect.c
+++ b/xorg-server/hw/xwin/glx/indirect.c
@@ -1046,17 +1046,6 @@ glxWinDrawableDestroy(__GLXdrawable * base)
{
__GLXWinDrawable *glxPriv = (__GLXWinDrawable *) base;
- if (glxPriv->drawContext &&
- (lastGLContext == &((glxPriv->drawContext)->base))) {
- // if this context is current and has unflushed commands, say we have flushed them
- // (don't actually flush them, the window is going away anyhow, and an implict flush occurs
- // on the next context change)
- // (GLX core considers it an error when we try to select a new current context if the old one
- // has unflushed commands, but the window has disappeared..)
- ((__GLXcontext *)lastGLContext)->hasUnflushedCommands = FALSE;
- lastGLContext = NULL;
- }
-
if (glxPriv->hPbuffer)
if (!wglDestroyPbufferARBWrapper(glxPriv->hPbuffer)) {
ErrorF("wglDestroyPbufferARB failed: %s\n", glxWinErrorMessage());
diff --git a/xorg-server/include/misc.h b/xorg-server/include/misc.h
index 19e71035c..594017a26 100644
--- a/xorg-server/include/misc.h
+++ b/xorg-server/include/misc.h
@@ -269,15 +269,19 @@ extern void FormatDouble(double dbl, char *string);
* or a value greater than 0
*/
static inline int
-version_compare(uint16_t a_major, uint16_t a_minor,
- uint16_t b_major, uint16_t b_minor)
+version_compare(uint32_t a_major, uint32_t a_minor,
+ uint32_t b_major, uint32_t b_minor)
{
- int a, b;
+ if (a_major > b_major)
+ return 1;
+ if (a_major < b_major)
+ return -1;
+ if (a_minor > b_minor)
+ return 1;
+ if (a_minor < b_minor)
+ return -1;
- a = a_major << 16 | a_minor;
- b = b_major << 16 | b_minor;
-
- return (a - b);
+ return 0;
}
/* some macros to help swap requests, replies, and events */
diff --git a/xorg-server/include/servermd.h b/xorg-server/include/servermd.h
index 61beaf2ea..b785e931d 100755
--- a/xorg-server/include/servermd.h
+++ b/xorg-server/include/servermd.h
@@ -319,6 +319,20 @@ SOFTWARE.
#endif /* ARC */
+#ifdef __xtensa__
+
+#ifdef __XTENSA_EL__
+#define IMAGE_BYTE_ORDER LSBFirst
+#define BITMAP_BIT_ORDER LSBFirst
+#endif
+#ifdef __XTENSA_EB__
+#define IMAGE_BYTE_ORDER MSBFirst
+#define BITMAP_BIT_ORDER MSBFirst
+#endif
+#define GLYPHPADBYTES 4
+
+#endif /* __xtensa__ */
+
/* size of buffer to use with GetImage, measured in bytes. There's obviously
* a trade-off between the amount of heap used and the number of times the
* ddx routine has to be called.
diff --git a/xorg-server/include/xwin-config.h.in b/xorg-server/include/xwin-config.h.in
index a5e6b17b3..176c01980 100644
--- a/xorg-server/include/xwin-config.h.in
+++ b/xorg-server/include/xwin-config.h.in
@@ -26,5 +26,8 @@
/* Vendor web address for support */
#undef __VENDORDWEBSUPPORT__
+/* Default log location */
+#undef DEFAULT_LOGDIR
+
/* Whether we should re-locate the root to where the executable lives */
#undef RELOCATE_PROJECTROOT
diff --git a/xorg-server/man/Xserver.man b/xorg-server/man/Xserver.man
index b103551fa..7a74e8541 100644
--- a/xorg-server/man/Xserver.man
+++ b/xorg-server/man/Xserver.man
@@ -223,9 +223,8 @@ turns on auto-repeat.
.B -retro
starts the stipple with the classic stipple and cursor visible. The default
is to start with a black root window, and to suppress display of the cursor
-until the first time an application calls XDefineCursor(). For the Xorg
-server, this also sets the default for the DontZap option to FALSE. For
-kdrive servers, this implies -zap.
+until the first time an application calls XDefineCursor(). For kdrive
+servers, this implies -zap.
.TP 8
.B \-s \fIminutes\fP
sets screen-saver timeout time in minutes.
diff --git a/xorg-server/mi/mieq.c b/xorg-server/mi/mieq.c
index dbd5a47ac..ebe03ab44 100644
--- a/xorg-server/mi/mieq.c
+++ b/xorg-server/mi/mieq.c
@@ -515,6 +515,10 @@ mieqProcessDeviceEvent(DeviceIntPtr dev, InternalEvent *event, ScreenPtr screen)
verify_internal_event(event);
+ /* refuse events from disabled devices */
+ if (!dev->enabled)
+ return;
+
/* Custom event handler */
handler = miEventQueue.handlers[event->any.type];
diff --git a/xorg-server/os/log.c b/xorg-server/os/log.c
index d63cae882..34d1185b8 100644
--- a/xorg-server/os/log.c
+++ b/xorg-server/os/log.c
@@ -348,7 +348,7 @@ out:
* which directives you use.
*/
static int
-pnprintf(char *string, size_t size, const char *f, va_list args)
+vpnprintf(char *string, int size_in, const char *f, va_list args)
{
int f_idx = 0;
int s_idx = 0;
@@ -359,6 +359,7 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
int i;
uint64_t ui;
int64_t si;
+ size_t size = size_in;
for (; f_idx < f_len && s_idx < size - 1; f_idx++) {
int length_modifier = 0;
@@ -490,6 +491,19 @@ pnprintf(char *string, size_t size, const char *f, va_list args)
return s_idx;
}
+static int
+pnprintf(char *string, int size, const char *f, ...)
+{
+ int rc;
+ va_list args;
+
+ va_start(args, f);
+ rc = vpnprintf(string, size, f, args);
+ va_end(args);
+
+ return rc;
+}
+
/* This function does the actual log message writes. It must be signal safe.
* When attempting to call non-signal-safe functions, guard them with a check
* of the inSignalContext global variable. */
@@ -603,7 +617,6 @@ LogMessageTypeVerbString(MessageType type, int verb)
void
LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
{
- static unsigned int warned;
const char *type_str;
char buf[1024];
const size_t size = sizeof(buf);
@@ -611,17 +624,8 @@ LogVMessageVerb(MessageType type, int verb, const char *format, va_list args)
size_t len = 0;
if (inSignalContext) {
- if (warned < 3) {
- BUG_WARN_MSG(inSignalContext,
- "Warning: attempting to log data in a signal unsafe "
- "manner while in signal context.\nPlease update to check "
- "inSignalContext and/or use LogMessageVerbSigSafe() or "
- "ErrorFSigSafe().\nThe offending log format message is:\n"
- "%s\n", format);
- warned++;
- if (warned == 3)
- LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
- }
+ LogVMessageVerbSigSafe(type, verb, format, args);
+ return;
}
type_str = LogMessageTypeVerbString(type, verb);
@@ -693,7 +697,7 @@ LogVMessageVerbSigSafe(MessageType type, int verb, const char *format, va_list a
LogSWrite(verb, " ", 1, FALSE);
}
- len = pnprintf(buf, sizeof(buf), format, args);
+ len = vpnprintf(buf, sizeof(buf), format, args);
/* Force '\n' at end of truncated line */
if (sizeof(buf) - len == 1)
@@ -707,40 +711,37 @@ void
LogVHdrMessageVerb(MessageType type, int verb, const char *msg_format,
va_list msg_args, const char *hdr_format, va_list hdr_args)
{
- static unsigned int warned;
const char *type_str;
char buf[1024];
const size_t size = sizeof(buf);
Bool newline;
size_t len = 0;
-
- if (inSignalContext) {
- if (warned < 3) {
- BUG_WARN_MSG(inSignalContext,
- "Warning: attempting to log data in a signal unsafe "
- "manner while in signal context.\nPlease update to check "
- "inSignalContext and/or use LogMessageVerbSigSafe().\nThe "
- "offending header and log message formats are:\n%s %s\n",
- hdr_format, msg_format);
- warned++;
- if (warned == 3)
- LogMessageVerbSigSafe(X_WARNING, -1, "Warned %u times about sigsafe logging. Will be quiet now.\n", warned);
- }
- }
+ int (*vprintf_func)(char *, int, const char* _X_RESTRICT_KYWD f, va_list args)
+ _X_ATTRIBUTE_PRINTF(3, 0);
+ int (*printf_func)(char *, int, const char* _X_RESTRICT_KYWD f, ...)
+ _X_ATTRIBUTE_PRINTF(3, 4);
type_str = LogMessageTypeVerbString(type, verb);
if (!type_str)
return;
+ if (inSignalContext) {
+ vprintf_func = vpnprintf;
+ printf_func = pnprintf;
+ } else {
+ vprintf_func = Xvscnprintf;
+ printf_func = Xscnprintf;
+ }
+
/* if type_str is not "", prepend it and ' ', to message */
if (type_str[0] != '\0')
- len += Xscnprintf(&buf[len], size - len, "%s ", type_str);
+ len += printf_func(&buf[len], size - len, "%s ", type_str);
if (hdr_format && size - len > 1)
- len += Xvscnprintf(&buf[len], size - len, hdr_format, hdr_args);
+ len += vprintf_func(&buf[len], size - len, hdr_format, hdr_args);
if (msg_format && size - len > 1)
- len += Xvscnprintf(&buf[len], size - len, msg_format, msg_args);
+ len += vprintf_func(&buf[len], size - len, msg_format, msg_args);
/* Force '\n' at end of truncated line */
if (size - len == 1)
diff --git a/xorg-server/present/present.c b/xorg-server/present/present.c
index 1bb459592..fb511eb53 100644
--- a/xorg-server/present/present.c
+++ b/xorg-server/present/present.c
@@ -42,6 +42,9 @@ static struct xorg_list present_flip_queue;
#define DebugPresent(x)
#endif
+static void
+present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
+
/*
* Copies the update region from a pixmap to the target drawable
*/
@@ -78,6 +81,20 @@ present_copy_region(DrawablePtr drawable,
FreeScratchGC(gc);
}
+static inline PixmapPtr
+present_flip_pending_pixmap(ScreenPtr screen)
+{
+ present_screen_priv_ptr screen_priv = present_screen_priv(screen);
+
+ if (!screen_priv)
+ return NULL;
+
+ if (!screen_priv->flip_pending)
+ return NULL;
+
+ return screen_priv->flip_pending->pixmap;
+}
+
static Bool
present_check_flip(RRCrtcPtr crtc,
WindowPtr window,
@@ -88,6 +105,7 @@ present_check_flip(RRCrtcPtr crtc,
int16_t y_off)
{
ScreenPtr screen = window->drawable.pScreen;
+ PixmapPtr window_pixmap;
WindowPtr root = screen->root;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -104,19 +122,11 @@ present_check_flip(RRCrtcPtr crtc,
if (!screen_priv->info->flip)
return FALSE;
- /* Can't pend a flip while unflipping */
- if (screen_priv->unflip_event_id) {
- return FALSE;
- }
-
- /* Can't have two pending flips at the same time */
- if (screen_priv->flip_pending) {
- return FALSE;
- }
-
/* Make sure the window hasn't been redirected with Composite */
- if (screen->GetWindowPixmap(window) != screen->GetScreenPixmap(screen) &&
- screen->GetWindowPixmap(window) != screen_priv->flip_pixmap)
+ window_pixmap = screen->GetWindowPixmap(window);
+ if (window_pixmap != screen->GetScreenPixmap(screen) &&
+ window_pixmap != screen_priv->flip_pixmap &&
+ window_pixmap != present_flip_pending_pixmap(screen))
return FALSE;
/* Check for full-screen window */
@@ -147,6 +157,7 @@ present_check_flip(RRCrtcPtr crtc,
/* Ask the driver for permission */
if (screen_priv->info->check_flip) {
if (!(*screen_priv->info->check_flip) (crtc, window, pixmap, sync_flip)) {
+ DebugPresent(("\td %08lx -> %08lx\n", window->drawable.id, pixmap ? pixmap->drawable.id : 0));
return FALSE;
}
}
@@ -188,8 +199,10 @@ present_pixmap_idle(PixmapPtr pixmap, WindowPtr window, CARD32 serial, struct pr
{
if (present_fence)
present_fence_set_triggered(present_fence);
- if (window)
+ if (window) {
+ DebugPresent(("\ti %08lx\n", pixmap ? pixmap->drawable.id : 0));
present_send_idle_notify(window, serial, pixmap, present_fence);
+ }
}
RRCrtcPtr
@@ -227,9 +240,8 @@ present_query_capabilities(RRCrtcPtr crtc)
}
static int
-present_get_ust_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc)
+present_get_ust_msc(ScreenPtr screen, RRCrtcPtr crtc, uint64_t *ust, uint64_t *msc)
{
- ScreenPtr screen = window->drawable.pScreen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
if (crtc == NULL)
@@ -283,7 +295,7 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
* we'll just use whatever previous MSC we'd seen from this CRTC
*/
- if (present_get_ust_msc(window, window_priv->crtc, &old_ust, &old_msc) != Success)
+ if (present_get_ust_msc(window->drawable.pScreen, window_priv->crtc, &old_ust, &old_msc) != Success)
old_msc = window_priv->msc;
window_priv->msc_offset += new_msc - old_msc;
@@ -293,6 +305,34 @@ present_window_to_crtc_msc(WindowPtr window, RRCrtcPtr crtc, uint64_t window_msc
return window_msc + window_priv->msc_offset;
}
+/*
+ * When the wait fence or previous flip is completed, it's time
+ * to re-try the request
+ */
+static void
+present_re_execute(present_vblank_ptr vblank)
+{
+ uint64_t ust = 0, crtc_msc = 0;
+
+ if (vblank->crtc)
+ (void) present_get_ust_msc(vblank->screen, vblank->crtc, &ust, &crtc_msc);
+
+ present_execute(vblank, ust, crtc_msc);
+}
+
+static void
+present_flip_try_ready(ScreenPtr screen)
+{
+ present_vblank_ptr vblank, tmp;
+
+ xorg_list_for_each_entry_safe(vblank, tmp, &present_exec_queue, event_queue) {
+ if (vblank->flip_ready) {
+ present_re_execute(vblank);
+ return;
+ }
+ }
+}
+
static void
present_flip_idle(ScreenPtr screen)
{
@@ -369,16 +409,14 @@ present_unflip(ScreenPtr screen)
}
static void
-present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc);
-
-static void
present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
{
ScreenPtr screen = vblank->screen;
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
- DebugPresent(("\tn %p %8lld: %08lx -> %08lx\n", vblank, vblank->target_msc,
- vblank->pixmap ? vblank->pixmap->drawable.id : 0,
+ DebugPresent(("\tn %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, vblank->target_msc,
+ vblank->pixmap ? vblank->pixmap->drawable.id : 0,
vblank->window->drawable.id));
assert (vblank == screen_priv->flip_pending);
@@ -404,6 +442,8 @@ present_flip_notify(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
present_vblank_notify(vblank, PresentCompleteKindPixmap, PresentCompleteModeFlip, ust, crtc_msc);
present_vblank_destroy(vblank);
+
+ present_flip_try_ready(screen);
}
void
@@ -436,6 +476,7 @@ present_event_notify(uint64_t event_id, uint64_t ust, uint64_t msc)
DebugPresent(("\tun %lld\n", event_id));
screen_priv->unflip_event_id = 0;
present_flip_idle(screen);
+ present_flip_try_ready(screen);
return;
}
}
@@ -498,15 +539,7 @@ static void
present_wait_fence_triggered(void *param)
{
present_vblank_ptr vblank = param;
- WindowPtr window = vblank->window;
- uint64_t ust = 0, crtc_msc = 0;
-
- if (window) {
- present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE);
- if (window_priv)
- (void) present_get_ust_msc(window, window_priv->crtc, &ust, &crtc_msc);
- }
- present_execute(vblank, ust, crtc_msc);
+ present_re_execute(vblank);
}
/*
@@ -534,14 +567,27 @@ present_execute(present_vblank_ptr vblank, uint64_t ust, uint64_t crtc_msc)
}
}
+ if (vblank->flip && vblank->pixmap && vblank->window) {
+ if (screen_priv->flip_pending || screen_priv->unflip_event_id) {
+ DebugPresent(("\tr %lld %p (pending %p unflip %lld)\n",
+ vblank->event_id, vblank,
+ screen_priv->flip_pending, screen_priv->unflip_event_id));
+ vblank->flip_ready = TRUE;
+ return;
+ }
+ }
+
xorg_list_del(&vblank->event_queue);
vblank->queued = FALSE;
if (vblank->pixmap && vblank->window) {
- if (vblank->flip && screen_priv->flip_pending == NULL && !screen_priv->unflip_event_id) {
+ if (vblank->flip) {
+
+ DebugPresent(("\tf %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, crtc_msc,
+ vblank->pixmap->drawable.id, vblank->window->drawable.id));
- DebugPresent(("\tf %p %8lld: %08lx -> %08lx\n", vblank, crtc_msc, vblank->pixmap->drawable.id, vblank->window->drawable.id));
/* Prepare to flip by placing it in the flip queue and
* and sticking it into the flip_pending field
*/
@@ -644,7 +690,7 @@ present_pixmap(WindowPtr window,
uint64_t target_msc;
uint64_t crtc_msc;
int ret;
- present_vblank_ptr vblank;
+ present_vblank_ptr vblank, tmp;
ScreenPtr screen = window->drawable.pScreen;
present_window_priv_ptr window_priv = present_get_window_priv(window, TRUE);
present_screen_priv_ptr screen_priv = present_screen_priv(screen);
@@ -664,7 +710,7 @@ present_pixmap(WindowPtr window,
target_crtc = present_get_crtc(window);
}
- present_get_ust_msc(window, target_crtc, &ust, &crtc_msc);
+ present_get_ust_msc(screen, target_crtc, &ust, &crtc_msc);
target_msc = present_window_to_crtc_msc(window, target_crtc, window_msc, crtc_msc);
@@ -698,7 +744,7 @@ present_pixmap(WindowPtr window,
*/
if (!update) {
- xorg_list_for_each_entry(vblank, &window_priv->vblank, window_list) {
+ xorg_list_for_each_entry_safe(vblank, tmp, &window_priv->vblank, window_list) {
if (!vblank->pixmap)
continue;
@@ -706,11 +752,11 @@ present_pixmap(WindowPtr window,
if (!vblank->queued)
continue;
- if (vblank->crtc != target_crtc || vblank->target_msc != target_msc)
+ if (vblank->crtc != target_crtc || vblank->target_msc > target_msc)
continue;
DebugPresent(("\tx %lld %p %8lld: %08lx -> %08lx (crtc %p)\n",
- vblank->event_id, vblank, target_msc,
+ vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap->drawable.id, vblank->window->drawable.id,
vblank->crtc));
@@ -720,6 +766,9 @@ present_pixmap(WindowPtr window,
vblank->pixmap = NULL;
vblank->idle_fence = NULL;
+ vblank->flip = FALSE;
+ if (vblank->flip_ready)
+ present_re_execute(vblank);
}
}
@@ -875,7 +924,8 @@ present_vblank_destroy(present_vblank_ptr vblank)
/* Remove vblank from window and screen lists */
xorg_list_del(&vblank->window_list);
- DebugPresent(("\td %p %8lld: %08lx -> %08lx\n", vblank, vblank->target_msc,
+ DebugPresent(("\td %lld %p %8lld: %08lx -> %08lx\n",
+ vblank->event_id, vblank, vblank->target_msc,
vblank->pixmap ? vblank->pixmap->drawable.id : 0,
vblank->window->drawable.id));
diff --git a/xorg-server/present/present_priv.h b/xorg-server/present/present_priv.h
index 8d3e0079c..d8569a2b6 100644
--- a/xorg-server/present/present_priv.h
+++ b/xorg-server/present/present_priv.h
@@ -71,6 +71,7 @@ struct present_vblank {
int num_notifies;
Bool queued; /* on present_exec_queue */
Bool flip; /* planning on using flip */
+ Bool flip_ready; /* wants to flip, but waiting for previous flip or unflip */
Bool sync_flip; /* do flip synchronous to vblank */
Bool abort_flip; /* aborting this flip */
};
diff --git a/xorg-server/test/input.c b/xorg-server/test/input.c
index 9b5db8991..a4615c9c9 100644
--- a/xorg-server/test/input.c
+++ b/xorg-server/test/input.c
@@ -1712,6 +1712,18 @@ mieq_test_event_handler(int screenNum, InternalEvent *ie, DeviceIntPtr dev)
static void
_mieq_test_generate_events(uint32_t start, uint32_t count)
{
+ static DeviceIntRec dev;
+ static SpriteInfoRec spriteInfo;
+ static SpriteRec sprite;
+
+ memset(&dev, 0, sizeof(dev));
+ memset(&spriteInfo, 0, sizeof(spriteInfo));
+ memset(&sprite, 0, sizeof(sprite));
+ dev.spriteInfo = &spriteInfo;
+ spriteInfo.sprite = &sprite;
+
+ dev.enabled = 1;
+
count += start;
while (start < count) {
RawDeviceEvent e = { 0 };
@@ -1721,7 +1733,7 @@ _mieq_test_generate_events(uint32_t start, uint32_t count)
e.time = GetTimeInMillis();
e.flags = start;
- mieqEnqueue(NULL, (InternalEvent *) &e);
+ mieqEnqueue(&dev, (InternalEvent *) &e);
start++;
}
diff --git a/xorg-server/xfixes/cursor.c b/xorg-server/xfixes/cursor.c
index 0db6b4ab1..bc8ad8096 100644
--- a/xorg-server/xfixes/cursor.c
+++ b/xorg-server/xfixes/cursor.c
@@ -1057,6 +1057,8 @@ XFixesCursorInit(void)
if (party_like_its_1989)
CursorVisible = EnableCursor;
+ else
+ CursorVisible = FALSE;
if (!dixRegisterPrivateKey(&CursorScreenPrivateKeyRec, PRIVATE_SCREEN, 0))
return FALSE;