diff --git a/.gitignore b/.gitignore index 85fc5ab..8c14c86 100644 --- a/.gitignore +++ b/.gitignore @@ -50,3 +50,4 @@ mesa-20100720.tar.bz2 /MesaLib-9.1.tar.bz2 /MesaLib-9.1.1.tar.bz2 /mesa-20130508.tar.xz +/mesa-20130514.tar.xz diff --git a/0001-st-mesa-handle-texture_from_pixmap-and-other-surface.patch b/0001-st-mesa-handle-texture_from_pixmap-and-other-surface.patch new file mode 100644 index 0000000..837f366 --- /dev/null +++ b/0001-st-mesa-handle-texture_from_pixmap-and-other-surface.patch @@ -0,0 +1,224 @@ +From 430343da5988f53ee6eedffb55ab38fa7cf64fd5 Mon Sep 17 00:00:00 2001 +From: =?UTF-8?q?Marek=20Ol=C5=A1=C3=A1k?= +Date: Fri, 10 May 2013 03:42:23 +0200 +Subject: [PATCH] st/mesa: handle texture_from_pixmap and other surface-based + textures correctly + +There were 2 issues with it: +1) The texture format which should be used for texturing was only set + in gl_texture_image::TexFormat, which wasn't used for sampler views. +2) Textures are sometimes reallocated under some circumstances + in st_finalize_texture, which is unacceptable if the texture comes + from a window system. + +The issues are resolved as follows: +1) If surface_based is true (texture_from_pixmap, etc.), store the format + in a new variable st_texture_object::surface_format. +2) Don't reallocate a surface-based texture in st_finalize_texture. + +Also don't use st_ChooseTextureFormat is st_context_teximage, because +the format is dictated by the caller. + +This fixes the glx-tfp piglit test. +--- + src/mesa/state_tracker/st_atom_texture.c | 3 ++- + src/mesa/state_tracker/st_cb_eglimage.c | 1 + + src/mesa/state_tracker/st_cb_texture.c | 7 ++++++- + src/mesa/state_tracker/st_format.c | 35 -------------------------------- + src/mesa/state_tracker/st_format.h | 4 ---- + src/mesa/state_tracker/st_manager.c | 25 +++++------------------ + src/mesa/state_tracker/st_texture.h | 10 +++++++-- + 7 files changed, 22 insertions(+), 63 deletions(-) + +diff --git a/src/mesa/state_tracker/st_atom_texture.c b/src/mesa/state_tracker/st_atom_texture.c +index 8d1250f..d79e04c 100644 +--- a/src/mesa/state_tracker/st_atom_texture.c ++++ b/src/mesa/state_tracker/st_atom_texture.c +@@ -239,7 +239,8 @@ update_single_texture(struct st_context *st, + st_mesa_format_to_pipe_format(stObj->base._BufferObjectFormat); + } + else { +- view_format = stObj->pt->format; ++ view_format = ++ stObj->surface_based ? stObj->surface_format : stObj->pt->format; + + /* If sRGB decoding is off, use the linear format */ + if (samp->sRGBDecode == GL_SKIP_DECODE_EXT) { +diff --git a/src/mesa/state_tracker/st_cb_eglimage.c b/src/mesa/state_tracker/st_cb_eglimage.c +index b162870..a396b9e 100644 +--- a/src/mesa/state_tracker/st_cb_eglimage.c ++++ b/src/mesa/state_tracker/st_cb_eglimage.c +@@ -131,6 +131,7 @@ st_bind_surface(struct gl_context *ctx, GLenum target, + stObj->width0 = ps->width; + stObj->height0 = ps->height; + stObj->depth0 = 1; ++ stObj->surface_format = ps->format; + + _mesa_dirty_texobj(ctx, texObj, GL_TRUE); + } +diff --git a/src/mesa/state_tracker/st_cb_texture.c b/src/mesa/state_tracker/st_cb_texture.c +index 123ed2b..56dbe85 100644 +--- a/src/mesa/state_tracker/st_cb_texture.c ++++ b/src/mesa/state_tracker/st_cb_texture.c +@@ -1540,6 +1540,11 @@ st_finalize_texture(struct gl_context *ctx, + pipe_sampler_view_release(st->pipe, &stObj->sampler_view); + } + ++ /* If this texture comes from a window system, there is nothing else to do. */ ++ if (stObj->surface_based) { ++ return GL_TRUE; ++ } ++ + /* Find gallium format for the Mesa texture */ + firstImageFormat = st_mesa_format_to_pipe_format(firstImage->base.TexFormat); + +@@ -1567,7 +1572,7 @@ st_finalize_texture(struct gl_context *ctx, + */ + if (stObj->pt) { + if (stObj->pt->target != gl_target_to_pipe(stObj->base.Target) || +- !st_sampler_compat_formats(stObj->pt->format, firstImageFormat) || ++ stObj->pt->format != firstImageFormat || + stObj->pt->last_level < stObj->lastLevel || + stObj->pt->width0 != ptWidth || + stObj->pt->height0 != ptHeight || +diff --git a/src/mesa/state_tracker/st_format.c b/src/mesa/state_tracker/st_format.c +index c9c6163..56f3a4a 100644 +--- a/src/mesa/state_tracker/st_format.c ++++ b/src/mesa/state_tracker/st_format.c +@@ -1800,41 +1800,6 @@ st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, + } + + +-GLboolean +-st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2) +-{ +- if (format1 == format2) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_B8G8R8A8_UNORM && +- format2 == PIPE_FORMAT_B8G8R8X8_UNORM) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_B8G8R8X8_UNORM && +- format2 == PIPE_FORMAT_B8G8R8A8_UNORM) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_A8B8G8R8_UNORM && +- format2 == PIPE_FORMAT_X8B8G8R8_UNORM) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_X8B8G8R8_UNORM && +- format2 == PIPE_FORMAT_A8B8G8R8_UNORM) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_A8R8G8B8_UNORM && +- format2 == PIPE_FORMAT_X8R8G8B8_UNORM) +- return GL_TRUE; +- +- if (format1 == PIPE_FORMAT_X8R8G8B8_UNORM && +- format2 == PIPE_FORMAT_A8R8G8B8_UNORM) +- return GL_TRUE; +- +- return GL_FALSE; +-} +- +- +- + /** + * This is used for translating texture border color and the clear + * color. For example, the clear color is interpreted according to +diff --git a/src/mesa/state_tracker/st_format.h b/src/mesa/state_tracker/st_format.h +index 0a1c18d..6e97dcb 100644 +--- a/src/mesa/state_tracker/st_format.h ++++ b/src/mesa/state_tracker/st_format.h +@@ -70,10 +70,6 @@ size_t + st_QuerySamplesForFormat(struct gl_context *ctx, GLenum target, + GLenum internalFormat, int samples[16]); + +-/* can we use a sampler view to translate these formats +- only used to make TFP so far */ +-extern GLboolean +-st_sampler_compat_formats(enum pipe_format format1, enum pipe_format format2); + + + extern void +diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c +index 5561af6..9e537f3 100644 +--- a/src/mesa/state_tracker/st_manager.c ++++ b/src/mesa/state_tracker/st_manager.c +@@ -467,7 +467,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags, + static boolean + st_context_teximage(struct st_context_iface *stctxi, + enum st_texture_type tex_type, +- int level, enum pipe_format internal_format, ++ int level, enum pipe_format pipe_format, + struct pipe_resource *tex, boolean mipmap) + { + struct st_context *st = (struct st_context *) stctxi; +@@ -511,29 +511,13 @@ st_context_teximage(struct st_context_iface *stctxi, + texImage = _mesa_get_tex_image(ctx, texObj, target, level); + stImage = st_texture_image(texImage); + if (tex) { +- gl_format texFormat; +- +- /* +- * XXX When internal_format and tex->format differ, st_finalize_texture +- * needs to allocate a new texture with internal_format and copy the +- * texture here into the new one. It will result in surface_copy being +- * called on surfaces whose formats differ. +- * +- * To avoid that, internal_format is (wrongly) ignored here. A sane fix +- * is to use a sampler view. +- */ +- if (!st_sampler_compat_formats(tex->format, internal_format)) +- internal_format = tex->format; +- +- if (util_format_get_component_bits(internal_format, +- UTIL_FORMAT_COLORSPACE_RGB, 3) > 0) ++ gl_format texFormat = st_pipe_format_to_mesa_format(pipe_format); ++ ++ if (util_format_has_alpha(tex->format)) + internalFormat = GL_RGBA; + else + internalFormat = GL_RGB; + +- texFormat = st_ChooseTextureFormat(ctx, target, internalFormat, +- GL_BGRA, GL_UNSIGNED_BYTE); +- + _mesa_init_teximage_fields(ctx, texImage, + tex->width0, tex->height0, 1, 0, + internalFormat, texFormat); +@@ -562,6 +546,7 @@ st_context_teximage(struct st_context_iface *stctxi, + stObj->width0 = width; + stObj->height0 = height; + stObj->depth0 = depth; ++ stObj->surface_format = pipe_format; + + _mesa_dirty_texobj(ctx, texObj, GL_TRUE); + _mesa_unlock_texture(ctx, texObj); +diff --git a/src/mesa/state_tracker/st_texture.h b/src/mesa/state_tracker/st_texture.h +index da899c9..c15aeae 100644 +--- a/src/mesa/state_tracker/st_texture.h ++++ b/src/mesa/state_tracker/st_texture.h +@@ -87,10 +87,16 @@ struct st_texture_object + */ + struct pipe_sampler_view *sampler_view; + +- /* True if there is/was a surface bound to this texture object. It helps +- * track whether the texture object is surface based or not. ++ /* True if this texture comes from the window system. Such a texture ++ * cannot be reallocated and the format can only be changed with a sampler ++ * view or a surface. + */ + GLboolean surface_based; ++ ++ /* If surface_based is true, this format should be used for all sampler ++ * views and surfaces instead of pt->format. ++ */ ++ enum pipe_format surface_format; + }; + + +-- +1.8.2.1 + diff --git a/i965-hack-hiz-snb-fix.patch b/i965-hack-hiz-snb-fix.patch deleted file mode 100644 index bec102b..0000000 --- a/i965-hack-hiz-snb-fix.patch +++ /dev/null @@ -1,63 +0,0 @@ -diff -up Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.c.marcheu Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.c ---- Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.c.marcheu 2013-02-20 10:26:22.000000000 +1000 -+++ Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.c 2013-03-19 10:44:12.761921622 +1000 -@@ -329,6 +329,7 @@ brwCreateContext(int api, - brw->urb.max_gs_entries = 256; - } - brw->urb.gen6_gs_previously_active = false; -+ brw->urb.prims_since_last_flush = 0; - } else if (intel->gen == 5) { - brw->urb.size = 1024; - brw->max_vs_threads = 72; -diff -up Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.h.marcheu Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.h ---- Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.h.marcheu 2013-02-23 11:45:52.000000000 +1000 -+++ Mesa-9.1/src/mesa/drivers/dri/i965/brw_context.h 2013-03-19 10:44:12.762921630 +1000 -@@ -864,6 +864,7 @@ struct brw_context - * URB space for the GS. - */ - bool gen6_gs_previously_active; -+ int prims_since_last_flush; - } urb; - - -diff -up Mesa-9.1/src/mesa/drivers/dri/i965/brw_draw.c.marcheu Mesa-9.1/src/mesa/drivers/dri/i965/brw_draw.c ---- Mesa-9.1/src/mesa/drivers/dri/i965/brw_draw.c.marcheu 2013-02-20 10:26:22.000000000 +1000 -+++ Mesa-9.1/src/mesa/drivers/dri/i965/brw_draw.c 2013-03-19 10:44:12.763921639 +1000 -@@ -294,10 +294,14 @@ static void brw_merge_inputs( struct brw - * Resolve the depth buffer's HiZ buffer and resolve the depth buffer of each - * enabled depth texture. - * -+ * We don't resolve the depth buffer's HiZ if no primitives have been drawn -+ * since the last flush. This avoids a case where we lockup the GPU on boot -+ * when this is the first thing we do. -+ * - * (In the future, this will also perform MSAA resolves). - */ - static void --brw_predraw_resolve_buffers(struct brw_context *brw) -+brw_predraw_resolve_buffers(struct brw_context *brw, int nr_prims) - { - struct gl_context *ctx = &brw->intel.ctx; - struct intel_context *intel = &brw->intel; -@@ -306,9 +310,11 @@ brw_predraw_resolve_buffers(struct brw_c - - /* Resolve the depth buffer's HiZ buffer. */ - depth_irb = intel_get_renderbuffer(ctx->DrawBuffer, BUFFER_DEPTH); -- if (depth_irb) -+ if (depth_irb && brw->urb.prims_since_last_flush > 0 ) - intel_renderbuffer_resolve_hiz(intel, depth_irb); - -+ brw->urb.prims_since_last_flush = nr_prims; -+ - /* Resolve depth buffer of each enabled depth texture. */ - for (int i = 0; i < BRW_MAX_TEX_UNIT; i++) { - if (!ctx->Texture.Unit[i]._ReallyEnabled) -@@ -445,7 +451,7 @@ static bool brw_try_draw_prims( struct g - * and finalizing textures but before setting up any hardware state for - * this draw call. - */ -- brw_predraw_resolve_buffers(brw); -+ brw_predraw_resolve_buffers(brw, nr_prims); - - /* Bind all inputs, derive varying and size information: - */ diff --git a/make-git-snapshot.sh b/make-git-snapshot.sh index a4beb3f..083365b 100755 --- a/make-git-snapshot.sh +++ b/make-git-snapshot.sh @@ -5,6 +5,12 @@ # to make a snapshot of the given tag/branch. Defaults to HEAD. # Point env var REF to a local mesa repo to reduce clone time. +if [ -e /usr/bin/pxz ]; then + XZ=/usr/bin/pxz +else + XZ=/usr/bin/xz +fi + DIRNAME=mesa-$( date +%Y%m%d ) echo REF ${REF:+--reference $REF} @@ -17,6 +23,6 @@ git clone --depth 1 ${REF:+--reference $REF} \ git://git.freedesktop.org/git/mesa/mesa $DIRNAME GIT_DIR=$DIRNAME/.git git archive --format=tar --prefix=$DIRNAME/ ${1:-HEAD} \ - | xz > $DIRNAME.tar.xz + | $XZ > $DIRNAME.tar.xz # rm -rf $DIRNAME diff --git a/mesa-9.1.1-53-g3cff41c.patch b/mesa-9.1.1-53-g3cff41c.patch deleted file mode 100644 index d6b302a..0000000 --- a/mesa-9.1.1-53-g3cff41c.patch +++ /dev/null @@ -1,2242 +0,0 @@ -diff --git a/configure.ac b/configure.ac -index 4a98996..1c9d606 100644 ---- a/configure.ac -+++ b/configure.ac -@@ -452,6 +452,9 @@ if test "x$enable_asm" = xyes; then - linux* | *freebsd* | dragonfly* | *netbsd*) - test "x$enable_64bit" = xyes && asm_arch=x86_64 || asm_arch=x86 - ;; -+ gnu*) -+ asm_arch=x86 -+ ;; - esac - ;; - x86_64) -@@ -826,20 +829,6 @@ if test "x$enable_dri" = xyes; then - fi - fi - --dnl Find out if X is available. --PKG_CHECK_MODULES([X11], [x11], [no_x=no], [no_x=yes]) -- --dnl Try to tell the user that the --x-* options are only used when --dnl pkg-config is not available. This must be right after AC_PATH_XTRA. --m4_divert_once([HELP_BEGIN], --[These options are only used when the X libraries cannot be found by the --pkg-config utility.]) -- --dnl We need X for xlib and dri, so bomb now if it's not found --if test "x$enable_glx" = xyes -a "x$no_x" = xyes; then -- AC_MSG_ERROR([X11 development libraries needed for GLX]) --fi -- - dnl Direct rendering or just indirect rendering - case "$host_os" in - gnu*) -diff --git a/docs/relnotes-9.1.1.html b/docs/relnotes-9.1.1.html -index 8921c8f..a73c974 100644 ---- a/docs/relnotes-9.1.1.html -+++ b/docs/relnotes-9.1.1.html -@@ -30,6 +30,9 @@ because GL_ARB_compatibility is not supported. - -

MD5 checksums

-
-+6508d9882d8dce7106717f365632700c  MesaLib-9.1.1.tar.gz
-+6ea2bdc3b7ecfb4257b39814b4182580  MesaLib-9.1.1.tar.bz2
-+3434c0eb47849a08c53cd32833d10d13  MesaLib-9.1.1.zip
- 
- -

New features

-diff --git a/include/c99_compat.h b/include/c99_compat.h -new file mode 100644 -index 0000000..3a9f502 ---- /dev/null -+++ b/include/c99_compat.h -@@ -0,0 +1,147 @@ -+/************************************************************************** -+ * -+ * Copyright 2007-2013 VMware, Inc. -+ * All Rights Reserved. -+ * -+ * Permission is hereby granted, free of charge, to any person obtaining a -+ * copy of this software and associated documentation files (the -+ * "Software"), to deal in the Software without restriction, including -+ * without limitation the rights to use, copy, modify, merge, publish, -+ * distribute, sub license, and/or sell copies of the Software, and to -+ * permit persons to whom the Software is furnished to do so, subject to -+ * the following conditions: -+ * -+ * The above copyright notice and this permission notice (including the -+ * next paragraph) shall be included in all copies or substantial portions -+ * of the Software. -+ * -+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS -+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF -+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. -+ * IN NO EVENT SHALL VMWARE AND/OR ITS SUPPLIERS BE LIABLE FOR -+ * ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, -+ * TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE -+ * SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. -+ * -+ **************************************************************************/ -+ -+#ifndef _C99_COMPAT_H_ -+#define _C99_COMPAT_H_ -+ -+ -+/* -+ * MSVC hacks. -+ */ -+#if defined(_MSC_VER) -+ /* -+ * Visual Studio 2012 will complain if we define the `inline` keyword, but -+ * actually it only supports the keyword on C++. -+ * -+ * We could skip this check by defining _ALLOW_KEYWORD_MACROS, but there is -+ * probably value in checking this for other keywords. So simply include -+ * the checking before we define it below. -+ */ -+# if _MSC_VER >= 1700 -+# include -+# endif -+ -+ /* -+ * XXX: MSVC has a `__restrict` keyword, but it also has a -+ * `__declspec(restrict)` modifier, so it is impossible to define a -+ * `restrict` macro without interfering with the latter. Furthermore the -+ * MSVC standard library uses __declspec(restrict) under the _CRTRESTRICT -+ * macro. For now resolve this issue by redefining _CRTRESTRICT, but going -+ * forward we should probably should stop using restrict, especially -+ * considering that our code does not obbey strict aliasing rules any way. -+ */ -+# include -+# undef _CRTRESTRICT -+# define _CRTRESTRICT -+#endif -+ -+ -+/* -+ * C99 inline keyword -+ */ -+#ifndef inline -+# ifdef __cplusplus -+ /* C++ supports inline keyword */ -+# elif defined(__GNUC__) -+# define inline __inline__ -+# elif defined(_MSC_VER) -+# define inline __inline -+# elif defined(__ICL) -+# define inline __inline -+# elif defined(__INTEL_COMPILER) -+ /* Intel compiler supports inline keyword */ -+# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) -+# define inline __inline -+# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -+ /* C99 supports inline keyword */ -+# elif (__STDC_VERSION__ >= 199901L) -+ /* C99 supports inline keyword */ -+# else -+# define inline -+# endif -+#endif -+ -+ -+/* -+ * C99 restrict keyword -+ * -+ * See also: -+ * - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html -+ */ -+#ifndef restrict -+# if (__STDC_VERSION__ >= 199901L) -+ /* C99 */ -+# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -+ /* C99 */ -+# elif defined(__GNUC__) -+# define restrict __restrict__ -+# elif defined(_MSC_VER) -+# define restrict __restrict -+# else -+# define restrict /* */ -+# endif -+#endif -+ -+ -+/* -+ * C99 __func__ macro -+ */ -+#ifndef __func__ -+# if (__STDC_VERSION__ >= 199901L) -+ /* C99 */ -+# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -+ /* C99 */ -+# elif defined(__GNUC__) -+# if __GNUC__ >= 2 -+# define __func__ __FUNCTION__ -+# else -+# define __func__ "" -+# endif -+# elif defined(_MSC_VER) -+# if _MSC_VER >= 1300 -+# define __func__ __FUNCTION__ -+# else -+# define __func__ "" -+# endif -+# else -+# define __func__ "" -+# endif -+#endif -+ -+ -+/* Simple test case for debugging */ -+#if 0 -+static inline const char * -+test_c99_compat_h(const void * restrict a, -+ const void * restrict b) -+{ -+ return __func__; -+} -+#endif -+ -+ -+#endif /* _C99_COMPAT_H_ */ -diff --git a/src/egl/main/eglcompiler.h b/src/egl/main/eglcompiler.h -index 9823693..2499172 100644 ---- a/src/egl/main/eglcompiler.h -+++ b/src/egl/main/eglcompiler.h -@@ -31,6 +31,9 @@ - #define EGLCOMPILER_INCLUDED - - -+#include "c99_compat.h" /* inline, __func__, etc. */ -+ -+ - /** - * Get standard integer types - */ -@@ -62,30 +65,7 @@ - #endif - - --/** -- * Function inlining -- */ --#ifndef inline --# ifdef __cplusplus -- /* C++ supports inline keyword */ --# elif defined(__GNUC__) --# define inline __inline__ --# elif defined(_MSC_VER) --# define inline __inline --# elif defined(__ICL) --# define inline __inline --# elif defined(__INTEL_COMPILER) -- /* Intel compiler supports inline keyword */ --# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) --# define inline __inline --# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -- /* C99 supports inline keyword */ --# elif (__STDC_VERSION__ >= 199901L) -- /* C99 supports inline keyword */ --# else --# define inline --# endif --#endif -+/* XXX: Use standard `inline` keyword instead */ - #ifndef INLINE - # define INLINE inline - #endif -@@ -104,21 +84,9 @@ - # endif - #endif - --/** -- * The __FUNCTION__ gcc variable is generally only used for debugging. -- * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. -- * Don't define it if using a newer Windows compiler. -- */ -+/* XXX: Use standard `__func__` instead */ - #ifndef __FUNCTION__ --# if (!defined __GNUC__) && (!defined __xlC__) && \ -- (!defined(_MSC_VER) || _MSC_VER < 1300) --# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ -- (defined(__SUNPRO_C) && defined(__C99FEATURES__)) --# define __FUNCTION__ __func__ --# else --# define __FUNCTION__ "" --# endif --# endif -+# define __FUNCTION__ __func__ - #endif - - #endif /* EGLCOMPILER_INCLUDED */ -diff --git a/src/gallium/auxiliary/Makefile.am b/src/gallium/auxiliary/Makefile.am -index a4eee47..f14279b 100644 ---- a/src/gallium/auxiliary/Makefile.am -+++ b/src/gallium/auxiliary/Makefile.am -@@ -7,7 +7,10 @@ noinst_LTLIBRARIES = libgallium.la - - AM_CFLAGS = \ - -I$(top_srcdir)/src/gallium/auxiliary/util \ -- $(GALLIUM_CFLAGS) -+ $(GALLIUM_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) -+ -+AM_CXXFLAGS = $(VISIBILITY_CXXFLAGS) - - libgallium_la_SOURCES = \ - $(C_SOURCES) \ -@@ -18,7 +21,7 @@ if HAVE_MESA_LLVM - AM_CFLAGS += \ - $(LLVM_CFLAGS) - --AM_CXXFLAGS = \ -+AM_CXXFLAGS += \ - $(GALLIUM_CFLAGS) \ - $(LLVM_CXXFLAGS) - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h -index 4898849..5fb4a11 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h -+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi.h -@@ -240,6 +240,7 @@ struct lp_exec_mask { - struct lp_build_context *bld; - - boolean has_mask; -+ boolean ret_in_main; - - LLVMTypeRef int_vec_type; - -diff --git a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c -index 0621fb4..413a918 100644 ---- a/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c -+++ b/src/gallium/auxiliary/gallivm/lp_bld_tgsi_soa.c -@@ -73,6 +73,7 @@ static void lp_exec_mask_init(struct lp_exec_mask *mask, struct lp_build_context - - mask->bld = bld; - mask->has_mask = FALSE; -+ mask->ret_in_main = FALSE; - mask->cond_stack_size = 0; - mask->loop_stack_size = 0; - mask->call_stack_size = 0; -@@ -108,7 +109,7 @@ static void lp_exec_mask_update(struct lp_exec_mask *mask) - } else - mask->exec_mask = mask->cond_mask; - -- if (mask->call_stack_size) { -+ if (mask->call_stack_size || mask->ret_in_main) { - mask->exec_mask = LLVMBuildAnd(builder, - mask->exec_mask, - mask->ret_mask, -@@ -117,7 +118,8 @@ static void lp_exec_mask_update(struct lp_exec_mask *mask) - - mask->has_mask = (mask->cond_stack_size > 0 || - mask->loop_stack_size > 0 || -- mask->call_stack_size > 0); -+ mask->call_stack_size > 0 || -+ mask->ret_in_main); - } - - static void lp_exec_mask_cond_push(struct lp_exec_mask *mask, -@@ -348,11 +350,23 @@ static void lp_exec_mask_ret(struct lp_exec_mask *mask, int *pc) - LLVMBuilderRef builder = mask->bld->gallivm->builder; - LLVMValueRef exec_mask; - -- if (mask->call_stack_size == 0) { -+ if (mask->cond_stack_size == 0 && -+ mask->loop_stack_size == 0 && -+ mask->call_stack_size == 0) { - /* returning from main() */ - *pc = -1; - return; - } -+ -+ if (mask->call_stack_size == 0) { -+ /* -+ * This requires special handling since we need to ensure -+ * we don't drop the mask even if we have no call stack -+ * (e.g. after a ret in a if clause after the endif) -+ */ -+ mask->ret_in_main = TRUE; -+ } -+ - exec_mask = LLVMBuildNot(builder, - mask->exec_mask, - "ret"); -diff --git a/src/gallium/auxiliary/tgsi/tgsi_text.c b/src/gallium/auxiliary/tgsi/tgsi_text.c -index 1267e79..dc3a5fb 100644 ---- a/src/gallium/auxiliary/tgsi/tgsi_text.c -+++ b/src/gallium/auxiliary/tgsi/tgsi_text.c -@@ -1569,7 +1569,7 @@ tgsi_text_translate( - struct tgsi_token *tokens, - uint num_tokens ) - { -- struct translate_ctx ctx; -+ struct translate_ctx ctx = {0}; - - ctx.text = text; - ctx.cur = text; -diff --git a/src/gallium/drivers/Makefile.am b/src/gallium/drivers/Makefile.am -index 25d9533..3477fee 100644 ---- a/src/gallium/drivers/Makefile.am -+++ b/src/gallium/drivers/Makefile.am -@@ -1,6 +1,7 @@ - AUTOMAKE_OPTIONS = subdir-objects - - AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/gallium/include \ - -I$(top_srcdir)/src/gallium/auxiliary \ - -I$(top_srcdir)/src/gallium/drivers \ -diff --git a/src/gallium/drivers/llvmpipe/lp_scene.c b/src/gallium/drivers/llvmpipe/lp_scene.c -index 328c0f7..e145391 100644 ---- a/src/gallium/drivers/llvmpipe/lp_scene.c -+++ b/src/gallium/drivers/llvmpipe/lp_scene.c -@@ -64,6 +64,28 @@ lp_scene_create( struct pipe_context *pipe ) - - pipe_mutex_init(scene->mutex); - -+#ifdef DEBUG -+ /* Do some scene limit sanity checks here */ -+ { -+ size_t maxBins = TILES_X * TILES_Y; -+ size_t maxCommandBytes = sizeof(struct cmd_block) * maxBins; -+ size_t maxCommandPlusData = maxCommandBytes + DATA_BLOCK_SIZE; -+ /* We'll need at least one command block per bin. Make sure that's -+ * less than the max allowed scene size. -+ */ -+ assert(maxCommandBytes < LP_SCENE_MAX_SIZE); -+ /* We'll also need space for at least one other data block */ -+ assert(maxCommandPlusData <= LP_SCENE_MAX_SIZE); -+ -+ /* Ideally, the size of a cmd_block object will be a power of two -+ * in order to avoid wasting space when we allocation them from -+ * data blocks (which are power of two also). -+ */ -+ assert(sizeof(struct cmd_block) == -+ util_next_power_of_two(sizeof(struct cmd_block))); -+ } -+#endif -+ - return scene; - } - -diff --git a/src/gallium/drivers/llvmpipe/lp_scene.h b/src/gallium/drivers/llvmpipe/lp_scene.h -index b1db61b..801829d 100644 ---- a/src/gallium/drivers/llvmpipe/lp_scene.h -+++ b/src/gallium/drivers/llvmpipe/lp_scene.h -@@ -49,12 +49,18 @@ struct lp_rast_state; - #define TILES_Y (LP_MAX_HEIGHT / TILE_SIZE) - - --#define CMD_BLOCK_MAX 128 -+/* Commands per command block (ideally so sizeof(cmd_block) is a power of -+ * two in size.) -+ */ -+#define CMD_BLOCK_MAX 29 -+ -+/* Bytes per data block. -+ */ - #define DATA_BLOCK_SIZE (64 * 1024) - - /* Scene temporary storage is clamped to this size: - */ --#define LP_SCENE_MAX_SIZE (4*1024*1024) -+#define LP_SCENE_MAX_SIZE (9*1024*1024) - - /* The maximum amount of texture storage referenced by a scene is - * clamped ot this size: -diff --git a/src/gallium/drivers/nv50/nv50_blit.h b/src/gallium/drivers/nv50/nv50_blit.h -index d409f21..bdd6a63 100644 ---- a/src/gallium/drivers/nv50/nv50_blit.h -+++ b/src/gallium/drivers/nv50/nv50_blit.h -@@ -180,4 +180,44 @@ nv50_blit_eng2d_get_mask(const struct pipe_blit_info *info) - return mask; - } - -+#if NOUVEAU_DRIVER == 0xc0 -+# define nv50_format_table nvc0_format_table -+#endif -+ -+/* return TRUE for formats that can be converted among each other by NVC0_2D */ -+static INLINE boolean -+nv50_2d_dst_format_faithful(enum pipe_format format) -+{ -+ const uint64_t mask = -+ NV50_ENG2D_SUPPORTED_FORMATS & -+ ~NV50_ENG2D_NOCONVERT_FORMATS; -+ uint8_t id = nv50_format_table[format].rt; -+ return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0))); -+} -+static INLINE boolean -+nv50_2d_src_format_faithful(enum pipe_format format) -+{ -+ const uint64_t mask = -+ NV50_ENG2D_SUPPORTED_FORMATS & -+ ~(NV50_ENG2D_LUMINANCE_FORMATS | NV50_ENG2D_INTENSITY_FORMATS); -+ uint8_t id = nv50_format_table[format].rt; -+ return (id >= 0xc0) && (mask & (1ULL << (id - 0xc0))); -+} -+ -+static INLINE boolean -+nv50_2d_format_supported(enum pipe_format format) -+{ -+ uint8_t id = nv50_format_table[format].rt; -+ return (id >= 0xc0) && -+ (NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0))); -+} -+ -+static INLINE boolean -+nv50_2d_dst_format_ops_supported(enum pipe_format format) -+{ -+ uint8_t id = nv50_format_table[format].rt; -+ return (id >= 0xc0) && -+ (NV50_ENG2D_OPERATION_FORMATS & (1ULL << (id - 0xc0))); -+} -+ - #endif /* __NV50_BLIT_H__ */ -diff --git a/src/gallium/drivers/nv50/nv50_state_validate.c b/src/gallium/drivers/nv50/nv50_state_validate.c -index a95e96d..f5e7b36 100644 ---- a/src/gallium/drivers/nv50/nv50_state_validate.c -+++ b/src/gallium/drivers/nv50/nv50_state_validate.c -@@ -9,6 +9,7 @@ nv50_validate_fb(struct nv50_context *nv50) - struct pipe_framebuffer_state *fb = &nv50->framebuffer; - unsigned i; - unsigned ms_mode = NV50_3D_MULTISAMPLE_MODE_MS1; -+ uint32_t array_size = 0xffff, array_mode = 0; - - nouveau_bufctx_reset(nv50->bufctx_3d, NV50_BIND_FB); - -@@ -23,6 +24,13 @@ nv50_validate_fb(struct nv50_context *nv50) - struct nv50_surface *sf = nv50_surface(fb->cbufs[i]); - struct nouveau_bo *bo = mt->base.bo; - -+ array_size = MIN2(array_size, sf->depth); -+ if (mt->layout_3d) -+ array_mode = NV50_3D_RT_ARRAY_MODE_MODE_3D; /* 1 << 16 */ -+ -+ /* can't mix 3D with ARRAY or have RTs of different depth/array_size */ -+ assert(mt->layout_3d || !array_mode || array_size == 1); -+ - BEGIN_NV04(push, NV50_3D(RT_ADDRESS_HIGH(i)), 5); - PUSH_DATAh(push, bo->offset + sf->offset); - PUSH_DATA (push, bo->offset + sf->offset); -@@ -34,7 +42,7 @@ nv50_validate_fb(struct nv50_context *nv50) - PUSH_DATA (push, sf->width); - PUSH_DATA (push, sf->height); - BEGIN_NV04(push, NV50_3D(RT_ARRAY_MODE), 1); -- PUSH_DATA (push, sf->depth); -+ PUSH_DATA (push, array_mode | array_size); - } else { - PUSH_DATA (push, 0); - PUSH_DATA (push, 0); -@@ -63,7 +71,7 @@ nv50_validate_fb(struct nv50_context *nv50) - struct nv50_miptree *mt = nv50_miptree(fb->zsbuf->texture); - struct nv50_surface *sf = nv50_surface(fb->zsbuf); - struct nouveau_bo *bo = mt->base.bo; -- int unk = mt->base.base.target == PIPE_TEXTURE_2D; -+ int unk = mt->base.base.target == PIPE_TEXTURE_3D || sf->depth == 1; - - BEGIN_NV04(push, NV50_3D(ZETA_ADDRESS_HIGH), 5); - PUSH_DATAh(push, bo->offset + sf->offset); -diff --git a/src/gallium/drivers/nv50/nv50_surface.c b/src/gallium/drivers/nv50/nv50_surface.c -index 7a0470c..3a780f6 100644 ---- a/src/gallium/drivers/nv50/nv50_surface.c -+++ b/src/gallium/drivers/nv50/nv50_surface.c -@@ -35,25 +35,22 @@ - - #include "nv50_context.h" - #include "nv50_resource.h" --#include "nv50_blit.h" - - #include "nv50_defs.xml.h" - #include "nv50_texture.xml.h" - -+/* these are used in nv50_blit.h */ - #define NV50_ENG2D_SUPPORTED_FORMATS 0xff0843e080608409ULL -+#define NV50_ENG2D_NOCONVERT_FORMATS 0x0008402000000000ULL -+#define NV50_ENG2D_LUMINANCE_FORMATS 0x0008402000000000ULL -+#define NV50_ENG2D_INTENSITY_FORMATS 0x0000000000000000ULL -+#define NV50_ENG2D_OPERATION_FORMATS 0x060001c000608000ULL - --/* return TRUE for formats that can be converted among each other by NV50_2D */ --static INLINE boolean --nv50_2d_format_faithful(enum pipe_format format) --{ -- uint8_t id = nv50_format_table[format].rt; -- -- return (id >= 0xc0) && -- (NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0))); --} -+#define NOUVEAU_DRIVER 0x50 -+#include "nv50_blit.h" - - static INLINE uint8_t --nv50_2d_format(enum pipe_format format) -+nv50_2d_format(enum pipe_format format, boolean dst, boolean dst_src_equal) - { - uint8_t id = nv50_format_table[format].rt; - -@@ -62,6 +59,7 @@ nv50_2d_format(enum pipe_format format) - */ - if ((id >= 0xc0) && (NV50_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0)))) - return id; -+ assert(dst_src_equal); - - switch (util_format_get_blocksize(format)) { - case 1: -@@ -78,7 +76,7 @@ nv50_2d_format(enum pipe_format format) - static int - nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst, - struct nv50_miptree *mt, unsigned level, unsigned layer, -- enum pipe_format pformat) -+ enum pipe_format pformat, boolean dst_src_pformat_equal) - { - struct nouveau_bo *bo = mt->base.bo; - uint32_t width, height, depth; -@@ -86,7 +84,7 @@ nv50_2d_texture_set(struct nouveau_pushbuf *push, int dst, - uint32_t mthd = dst ? NV50_2D_DST_FORMAT : NV50_2D_SRC_FORMAT; - uint32_t offset = mt->level[level].offset; - -- format = nv50_2d_format(pformat); -+ format = nv50_2d_format(pformat, dst, dst_src_pformat_equal); - if (!format) { - NOUVEAU_ERR("invalid/unsupported surface format: %s\n", - util_format_name(pformat)); -@@ -155,15 +153,16 @@ nv50_2d_texture_do_copy(struct nouveau_pushbuf *push, - const enum pipe_format dfmt = dst->base.base.format; - const enum pipe_format sfmt = src->base.base.format; - int ret; -+ boolean eqfmt = dfmt == sfmt; - - if (!PUSH_SPACE(push, 2 * 16 + 32)) - return PIPE_ERROR; - -- ret = nv50_2d_texture_set(push, 1, dst, dst_level, dz, dfmt); -+ ret = nv50_2d_texture_set(push, 1, dst, dst_level, dz, dfmt, eqfmt); - if (ret) - return ret; - -- ret = nv50_2d_texture_set(push, 0, src, src_level, sz, sfmt); -+ ret = nv50_2d_texture_set(push, 0, src, src_level, sz, sfmt, eqfmt); - if (ret) - return ret; - -@@ -243,8 +242,8 @@ nv50_resource_copy_region(struct pipe_context *pipe, - } - - assert((src->format == dst->format) || -- (nv50_2d_format_faithful(src->format) && -- nv50_2d_format_faithful(dst->format))); -+ (nv50_2d_src_format_faithful(src->format) && -+ nv50_2d_dst_format_faithful(dst->format))); - - BCTX_REFN(nv50->bufctx, 2D, nv04_resource(src), RD); - BCTX_REFN(nv50->bufctx, 2D, nv04_resource(dst), WR); -@@ -936,7 +935,7 @@ nv50_blit_3d(struct nv50_context *nv50, const struct pipe_blit_info *info) - nv50_blit_select_fp(blit, info); - nv50_blitctx_pre_blit(blit); - -- nv50_blit_set_dst(blit, dst, info->dst.level, 0, info->dst.format); -+ nv50_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format); - nv50_blit_set_src(blit, src, info->src.level, -1, info->src.format, - blit->filter); - -@@ -977,6 +976,8 @@ nv50_blit_3d(struct nv50_context *nv50, const struct pipe_blit_info *info) - - BEGIN_NV04(push, NV50_3D(VIEWPORT_TRANSFORM_EN), 1); - PUSH_DATA (push, 0); -+ BEGIN_NV04(push, NV50_3D(VIEW_VOLUME_CLIP_CTRL), 1); -+ PUSH_DATA (push, 0x1); - - /* Draw a large triangle in screen coordinates covering the whole - * render target, with scissors defining the destination region. -@@ -1059,7 +1060,8 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info) - int64_t du_dx, dv_dy; - int i; - uint32_t mode; -- const uint32_t mask = nv50_blit_eng2d_get_mask(info); -+ uint32_t mask = nv50_blit_eng2d_get_mask(info); -+ boolean b; - - mode = nv50_blit_get_filter(info) ? - NV50_2D_BLIT_CONTROL_FILTER_BILINEAR : -@@ -1070,8 +1072,9 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info) - du_dx = ((int64_t)info->src.box.width << 32) / info->dst.box.width; - dv_dy = ((int64_t)info->src.box.height << 32) / info->dst.box.height; - -- nv50_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format); -- nv50_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format); -+ b = info->dst.format == info->src.format; -+ nv50_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format, b); -+ nv50_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format, b); - - if (info->scissor_enable) { - BEGIN_NV04(push, NV50_2D(CLIP_X), 5); -@@ -1094,6 +1097,17 @@ nv50_blit_eng2d(struct nv50_context *nv50, const struct pipe_blit_info *info) - PUSH_DATA (push, 0xffffffff); - BEGIN_NV04(push, NV50_2D(OPERATION), 1); - PUSH_DATA (push, NV50_2D_OPERATION_ROP); -+ } else -+ if (info->src.format != info->dst.format) { -+ if (info->src.format == PIPE_FORMAT_R8_UNORM || -+ info->src.format == PIPE_FORMAT_R16_UNORM || -+ info->src.format == PIPE_FORMAT_R16_FLOAT || -+ info->src.format == PIPE_FORMAT_R32_FLOAT) { -+ mask = 0xffff0000; /* also makes condition for OPERATION reset true */ -+ BEGIN_NV04(push, NV50_2D(BETA4), 2); -+ PUSH_DATA (push, mask); -+ PUSH_DATA (push, NV50_2D_OPERATION_SRCCOPY_PREMULT); -+ } - } - - if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) { -@@ -1224,10 +1238,25 @@ nv50_blit(struct pipe_context *pipe, const struct pipe_blit_info *info) - debug_printf("blit: cannot filter array or cube textures in z direction"); - } - -- if (!eng3d && info->dst.format != info->src.format) -- if (!nv50_2d_format_faithful(info->dst.format) || -- !nv50_2d_format_faithful(info->src.format)) -+ if (!eng3d && info->dst.format != info->src.format) { -+ if (!nv50_2d_dst_format_faithful(info->dst.format) || -+ !nv50_2d_src_format_faithful(info->src.format)) { - eng3d = TRUE; -+ } else -+ if (!nv50_2d_src_format_faithful(info->src.format)) { -+ if (!util_format_is_luminance(info->src.format)) { -+ if (util_format_is_intensity(info->src.format)) -+ eng3d = TRUE; -+ else -+ if (!nv50_2d_dst_format_ops_supported(info->dst.format)) -+ eng3d = TRUE; -+ else -+ eng3d = !nv50_2d_format_supported(info->src.format); -+ } -+ } else -+ if (util_format_is_luminance_alpha(info->src.format)) -+ eng3d = TRUE; -+ } - - if (info->src.resource->nr_samples == 8 && - info->dst.resource->nr_samples <= 1) -diff --git a/src/gallium/drivers/nvc0/nvc0_3d.xml.h b/src/gallium/drivers/nvc0/nvc0_3d.xml.h -index 1cf1f96..bd3de58 100644 ---- a/src/gallium/drivers/nvc0/nvc0_3d.xml.h -+++ b/src/gallium/drivers/nvc0/nvc0_3d.xml.h -@@ -1041,7 +1041,7 @@ WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - #define NVC0_3D_VIEWPORT_TRANSFORM_EN 0x0000192c - - #define NVC0_3D_VIEW_VOLUME_CLIP_CTRL 0x0000193c --#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK0 0x00000001 -+#define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_RANGE_0_1 0x00000001 - #define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1__MASK 0x00000006 - #define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1__SHIFT 1 - #define NVC0_3D_VIEW_VOLUME_CLIP_CTRL_UNK1_UNK0 0x00000000 -diff --git a/src/gallium/drivers/nvc0/nvc0_surface.c b/src/gallium/drivers/nvc0/nvc0_surface.c -index 281d740..66154a4 100644 ---- a/src/gallium/drivers/nvc0/nvc0_surface.c -+++ b/src/gallium/drivers/nvc0/nvc0_surface.c -@@ -36,29 +36,32 @@ - - #include "nv50/nv50_defs.xml.h" - #include "nv50/nv50_texture.xml.h" --#include "nv50/nv50_blit.h" - --#define NVC0_ENG2D_SUPPORTED_FORMATS 0xff9ccfe1cce3ccc9ULL -+/* these are used in nv50_blit.h */ -+#define NV50_ENG2D_SUPPORTED_FORMATS 0xff9ccfe1cce3ccc9ULL -+#define NV50_ENG2D_NOCONVERT_FORMATS 0x009cc02000000000ULL -+#define NV50_ENG2D_LUMINANCE_FORMATS 0x001cc02000000000ULL -+#define NV50_ENG2D_INTENSITY_FORMATS 0x0080000000000000ULL -+#define NV50_ENG2D_OPERATION_FORMATS 0x060001c000638000ULL - --/* return TRUE for formats that can be converted among each other by NVC0_2D */ --static INLINE boolean --nvc0_2d_format_faithful(enum pipe_format format) --{ -- uint8_t id = nvc0_format_table[format].rt; -- -- return (id >= 0xc0) && (NVC0_ENG2D_SUPPORTED_FORMATS & (1ULL << (id - 0xc0))); --} -+#define NOUVEAU_DRIVER 0xc0 -+#include "nv50/nv50_blit.h" - - static INLINE uint8_t --nvc0_2d_format(enum pipe_format format) -+nvc0_2d_format(enum pipe_format format, boolean dst, boolean dst_src_equal) - { - uint8_t id = nvc0_format_table[format].rt; - -+ /* A8_UNORM is treated as I8_UNORM as far as the 2D engine is concerned. */ -+ if (!dst && unlikely(format == PIPE_FORMAT_I8_UNORM) && !dst_src_equal) -+ return NV50_SURFACE_FORMAT_A8_UNORM; -+ - /* Hardware values for color formats range from 0xc0 to 0xff, - * but the 2D engine doesn't support all of them. - */ -- if (nvc0_2d_format_faithful(format)) -+ if (nv50_2d_format_supported(format)) - return id; -+ assert(dst_src_equal); - - switch (util_format_get_blocksize(format)) { - case 1: -@@ -72,6 +75,7 @@ nvc0_2d_format(enum pipe_format format) - case 16: - return NV50_SURFACE_FORMAT_RGBA32_FLOAT; - default: -+ assert(0); - return 0; - } - } -@@ -79,7 +83,7 @@ nvc0_2d_format(enum pipe_format format) - static int - nvc0_2d_texture_set(struct nouveau_pushbuf *push, boolean dst, - struct nv50_miptree *mt, unsigned level, unsigned layer, -- enum pipe_format pformat) -+ enum pipe_format pformat, boolean dst_src_pformat_equal) - { - struct nouveau_bo *bo = mt->base.bo; - uint32_t width, height, depth; -@@ -87,7 +91,7 @@ nvc0_2d_texture_set(struct nouveau_pushbuf *push, boolean dst, - uint32_t mthd = dst ? NVC0_2D_DST_FORMAT : NVC0_2D_SRC_FORMAT; - uint32_t offset = mt->level[level].offset; - -- format = nvc0_2d_format(pformat); -+ format = nvc0_2d_format(pformat, dst, dst_src_pformat_equal); - if (!format) { - NOUVEAU_ERR("invalid/unsupported surface format: %s\n", - util_format_name(pformat)); -@@ -157,15 +161,16 @@ nvc0_2d_texture_do_copy(struct nouveau_pushbuf *push, - const enum pipe_format dfmt = dst->base.base.format; - const enum pipe_format sfmt = src->base.base.format; - int ret; -+ boolean eqfmt = dfmt == sfmt; - - if (!PUSH_SPACE(push, 2 * 16 + 32)) - return PIPE_ERROR; - -- ret = nvc0_2d_texture_set(push, TRUE, dst, dst_level, dz, dfmt); -+ ret = nvc0_2d_texture_set(push, TRUE, dst, dst_level, dz, dfmt, eqfmt); - if (ret) - return ret; - -- ret = nvc0_2d_texture_set(push, FALSE, src, src_level, sz, sfmt); -+ ret = nvc0_2d_texture_set(push, FALSE, src, src_level, sz, sfmt, eqfmt); - if (ret) - return ret; - -@@ -243,8 +248,8 @@ nvc0_resource_copy_region(struct pipe_context *pipe, - return; - } - -- assert(nvc0_2d_format_faithful(src->format)); -- assert(nvc0_2d_format_faithful(dst->format)); -+ assert(nv50_2d_dst_format_faithful(dst->format)); -+ assert(nv50_2d_src_format_faithful(src->format)); - - BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(src), RD); - BCTX_REFN(nvc0->bufctx, 2D, nv04_resource(dst), WR); -@@ -490,19 +495,19 @@ nvc0_blitter_make_vp(struct nvc0_blitter *blit) - { - static const uint32_t code_nvc0[] = - { -- 0xfff01c66, 0x06000080, /* vfetch b128 { $r0 $r1 $r2 $r3 } a[0x80] */ -- 0xfff11c26, 0x06000090, /* vfetch b96 { $r4 $r5 $r6 } a[0x90]*/ -- 0x03f01c66, 0x0a7e0070, /* export b128 o[0x70] { $r0 $r1 $r2 $r3 } */ -- 0x13f01c26, 0x0a7e0080, /* export b96 o[0x80] { $r4 $r5 $r6 } */ -+ 0xfff11c26, 0x06000080, /* vfetch b64 $r4:$r5 a[0x80] */ -+ 0xfff01c46, 0x06000090, /* vfetch b96 $r0:$r1:$r2 a[0x90] */ -+ 0x13f01c26, 0x0a7e0070, /* export b64 o[0x70] $r4:$r5 */ -+ 0x03f01c46, 0x0a7e0080, /* export b96 o[0x80] $r0:$r1:$r2 */ - 0x00001de7, 0x80000000, /* exit */ - }; - static const uint32_t code_nve4[] = - { - 0x00000007, 0x20000000, /* sched */ -- 0xfff01c66, 0x06000080, /* vfetch b128 { $r0 $r1 $r2 $r3 } a[0x80] */ -- 0xfff11c46, 0x06000090, /* vfetch b96 { $r4 $r5 $r6 } a[0x90]*/ -- 0x03f01c66, 0x0a7e0070, /* export b128 o[0x70] { $r0 $r1 $r2 $r3 } */ -- 0x13f01c46, 0x0a7e0080, /* export b96 o[0x80] { $r4 $r5 $r6 } */ -+ 0xfff11c26, 0x06000080, /* vfetch b64 $r4:$r5 a[0x80] */ -+ 0xfff01c46, 0x06000090, /* vfetch b96 $r0:$r1:$r2 a[0x90] */ -+ 0x13f01c26, 0x0a7e0070, /* export b64 o[0x70] $r4:$r5 */ -+ 0x03f01c46, 0x0a7e0080, /* export b96 o[0x80] $r0:$r1:$r2 */ - 0x00001de7, 0x80000000, /* exit */ - }; - -@@ -515,13 +520,13 @@ nvc0_blitter_make_vp(struct nvc0_blitter *blit) - blit->vp.code = (uint32_t *)code_nvc0; /* const_cast */ - blit->vp.code_size = sizeof(code_nvc0); - } -- blit->vp.max_gpr = 7; -+ blit->vp.max_gpr = 6; - blit->vp.vp.edgeflag = PIPE_MAX_ATTRIBS; - - blit->vp.hdr[0] = 0x00020461; /* vertprog magic */ - blit->vp.hdr[4] = 0x000ff000; /* no outputs read */ -- blit->vp.hdr[6] = 0x0000003f; /* a[0x80], a[0x90] */ -- blit->vp.hdr[13] = 0x0003f000; /* o[0x70], o[0x80] */ -+ blit->vp.hdr[6] = 0x00000073; /* a[0x80].xy, a[0x90].xyz */ -+ blit->vp.hdr[13] = 0x00073000; /* o[0x70].xy, o[0x80].xyz */ - } - - static void -@@ -820,7 +825,7 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - nvc0_blit_select_fp(blit, info); - nvc0_blitctx_pre_blit(blit); - -- nvc0_blit_set_dst(blit, dst, info->dst.level, 0, info->dst.format); -+ nvc0_blit_set_dst(blit, dst, info->dst.level, -1, info->dst.format); - nvc0_blit_set_src(blit, src, info->src.level, -1, info->src.format, - blit->filter); - -@@ -859,6 +864,8 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - z += 0.5f * dz; - - IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 0); -+ IMMED_NVC0(push, NVC0_3D(VIEW_VOLUME_CLIP_CTRL), 0x2 | -+ NVC0_3D_VIEW_VOLUME_CLIP_CTRL_DEPTH_RANGE_0_1); - BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2); - PUSH_DATA (push, nvc0->framebuffer.width << 16); - PUSH_DATA (push, nvc0->framebuffer.height << 16); -@@ -925,11 +932,14 @@ nvc0_blit_3d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - if (info->dst.box.z + info->dst.box.depth - 1) - IMMED_NVC0(push, NVC0_3D(LAYER), 0); - -- /* re-enable normally constant state */ -+ nvc0_blitctx_post_blit(blit); - -- IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1); -+ /* restore viewport */ - -- nvc0_blitctx_post_blit(blit); -+ BEGIN_NVC0(push, NVC0_3D(VIEWPORT_HORIZ(0)), 2); -+ PUSH_DATA (push, nvc0->framebuffer.width << 16); -+ PUSH_DATA (push, nvc0->framebuffer.height << 16); -+ IMMED_NVC0(push, NVC0_3D(VIEWPORT_TRANSFORM_EN), 1); - } - - static void -@@ -948,7 +958,8 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - int64_t du_dx, dv_dy; - int i; - uint32_t mode; -- const uint32_t mask = nv50_blit_eng2d_get_mask(info); -+ uint32_t mask = nv50_blit_eng2d_get_mask(info); -+ boolean b; - - mode = nv50_blit_get_filter(info) ? - NVC0_2D_BLIT_CONTROL_FILTER_BILINEAR : -@@ -959,8 +970,9 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - du_dx = ((int64_t)info->src.box.width << 32) / info->dst.box.width; - dv_dy = ((int64_t)info->src.box.height << 32) / info->dst.box.height; - -- nvc0_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format); -- nvc0_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format); -+ b = info->dst.format == info->src.format; -+ nvc0_2d_texture_set(push, 1, dst, info->dst.level, dz, info->dst.format, b); -+ nvc0_2d_texture_set(push, 0, src, info->src.level, sz, info->src.format, b); - - if (info->scissor_enable) { - BEGIN_NVC0(push, NVC0_2D(CLIP_X), 5); -@@ -981,6 +993,25 @@ nvc0_blit_eng2d(struct nvc0_context *nvc0, const struct pipe_blit_info *info) - PUSH_DATA (push, 0xffffffff); - PUSH_DATA (push, 0xffffffff); - IMMED_NVC0(push, NVC0_2D(OPERATION), NVC0_2D_OPERATION_ROP); -+ } else -+ if (info->src.format != info->dst.format) { -+ if (info->src.format == PIPE_FORMAT_R8_UNORM || -+ info->src.format == PIPE_FORMAT_R8_SNORM || -+ info->src.format == PIPE_FORMAT_R16_UNORM || -+ info->src.format == PIPE_FORMAT_R16_SNORM || -+ info->src.format == PIPE_FORMAT_R16_FLOAT || -+ info->src.format == PIPE_FORMAT_R32_FLOAT) { -+ mask = 0xffff0000; /* also makes condition for OPERATION reset true */ -+ BEGIN_NVC0(push, NVC0_2D(BETA4), 2); -+ PUSH_DATA (push, mask); -+ PUSH_DATA (push, NVC0_2D_OPERATION_SRCCOPY_PREMULT); -+ } else -+ if (info->src.format == PIPE_FORMAT_A8_UNORM) { -+ mask = 0xff000000; -+ BEGIN_NVC0(push, NVC0_2D(BETA4), 2); -+ PUSH_DATA (push, mask); -+ PUSH_DATA (push, NVC0_2D_OPERATION_SRCCOPY_PREMULT); -+ } - } - - if (src->ms_x > dst->ms_x || src->ms_y > dst->ms_y) { -@@ -1106,10 +1137,24 @@ nvc0_blit(struct pipe_context *pipe, const struct pipe_blit_info *info) - debug_printf("blit: cannot filter array or cube textures in z direction"); - } - -- if (!eng3d && info->dst.format != info->src.format) -- if (!nvc0_2d_format_faithful(info->dst.format) || -- !nvc0_2d_format_faithful(info->src.format)) -+ if (!eng3d && info->dst.format != info->src.format) { -+ if (!nv50_2d_dst_format_faithful(info->dst.format)) { -+ eng3d = TRUE; -+ } else -+ if (!nv50_2d_src_format_faithful(info->src.format)) { -+ if (!util_format_is_luminance(info->src.format)) { -+ if (util_format_is_intensity(info->src.format)) -+ eng3d = info->src.format != PIPE_FORMAT_I8_UNORM; -+ else -+ if (!nv50_2d_dst_format_ops_supported(info->dst.format)) -+ eng3d = TRUE; -+ else -+ eng3d = !nv50_2d_format_supported(info->src.format); -+ } -+ } else -+ if (util_format_is_luminance_alpha(info->src.format)) - eng3d = TRUE; -+ } - - if (info->src.resource->nr_samples == 8 && - info->dst.resource->nr_samples <= 1) -diff --git a/src/gallium/drivers/r300/compiler/radeon_optimize.c b/src/gallium/drivers/r300/compiler/radeon_optimize.c -index 734c7f2..74afd6f 100644 ---- a/src/gallium/drivers/r300/compiler/radeon_optimize.c -+++ b/src/gallium/drivers/r300/compiler/radeon_optimize.c -@@ -708,6 +708,7 @@ static int peephole_mul_omod( - struct rc_list * writer_list; - struct rc_variable * var; - struct peephole_mul_cb_data cb_data; -+ unsigned writemask_sum; - - for (i = 0; i < 2; i++) { - unsigned int j; -@@ -815,10 +816,11 @@ static int peephole_mul_omod( - } - - /* Rewrite the instructions */ -+ writemask_sum = rc_variable_writemask_sum(writer_list->Item); - for (var = writer_list->Item; var; var = var->Friend) { - struct rc_variable * writer = var; - unsigned conversion_swizzle = rc_make_conversion_swizzle( -- writer->Inst->U.I.DstReg.WriteMask, -+ writemask_sum, - inst_mul->U.I.DstReg.WriteMask); - writer->Inst->U.I.Omod = omod_op; - writer->Inst->U.I.DstReg.File = inst_mul->U.I.DstReg.File; -diff --git a/src/gallium/drivers/r600/r600_pipe.c b/src/gallium/drivers/r600/r600_pipe.c -index a7973a5..80b859f 100644 ---- a/src/gallium/drivers/r600/r600_pipe.c -+++ b/src/gallium/drivers/r600/r600_pipe.c -@@ -1157,7 +1157,7 @@ struct pipe_screen *r600_screen_create(struct radeon_winsys *ws) - * case were triggering lockup quickly such as : - * piglit/bin/depthstencil-render-miplevels 1024 d=s=z24_s8 - */ -- rscreen->use_hyperz = debug_get_bool_option("R600_HYPERZ", TRUE); -+ rscreen->use_hyperz = debug_get_bool_option("R600_HYPERZ", FALSE); - rscreen->use_hyperz = rscreen->info.drm_minor >= 26 ? rscreen->use_hyperz : FALSE; - - rscreen->global_pool = compute_memory_pool_new(rscreen); -diff --git a/src/gallium/drivers/r600/r600_query.c b/src/gallium/drivers/r600/r600_query.c -index 0335189..782ad26 100644 ---- a/src/gallium/drivers/r600/r600_query.c -+++ b/src/gallium/drivers/r600/r600_query.c -@@ -186,10 +186,11 @@ static void r600_emit_query_end(struct r600_context *ctx, struct r600_query *que - case PIPE_QUERY_PRIMITIVES_GENERATED: - case PIPE_QUERY_SO_STATISTICS: - case PIPE_QUERY_SO_OVERFLOW_PREDICATE: -+ va += query->buffer.results_end + query->result_size/2; - cs->buf[cs->cdw++] = PKT3(PKT3_EVENT_WRITE, 2, 0); - cs->buf[cs->cdw++] = EVENT_TYPE(EVENT_TYPE_SAMPLE_STREAMOUTSTATS) | EVENT_INDEX(3); -- cs->buf[cs->cdw++] = query->buffer.results_end + query->result_size/2; -- cs->buf[cs->cdw++] = 0; -+ cs->buf[cs->cdw++] = va; -+ cs->buf[cs->cdw++] = (va >> 32UL) & 0xFF; - break; - case PIPE_QUERY_TIME_ELAPSED: - va += query->buffer.results_end + query->result_size/2; -diff --git a/src/gallium/drivers/radeon/Makefile.am b/src/gallium/drivers/radeon/Makefile.am -index e6eb241..a3a7b74 100644 ---- a/src/gallium/drivers/radeon/Makefile.am -+++ b/src/gallium/drivers/radeon/Makefile.am -@@ -1,11 +1,14 @@ - include Makefile.sources - include $(top_srcdir)/src/gallium/Automake.inc - -+LIBGALLIUM_LIBS= -+ - if HAVE_GALLIUM_R600 - if HAVE_GALLIUM_RADEONSI - lib_LTLIBRARIES = libllvmradeon@VERSION@.la - libllvmradeon@VERSION@_la_LDFLAGS = -Wl, -shared -avoid-version \ - $(LLVM_LDFLAGS) -+LIBGALLIUM_LIBS += $(top_builddir)/src/gallium/auxiliary/libgallium.la - else - noinst_LTLIBRARIES = libllvmradeon@VERSION@.la - endif -@@ -26,5 +29,6 @@ libllvmradeon@VERSION@_la_SOURCES = \ - $(C_FILES) - - libllvmradeon@VERSION@_la_LIBADD = \ -+ $(LIBGALLIUM_LIBS) \ - $(CLOCK_LIB) \ - $(LLVM_LIBS) -diff --git a/src/gallium/drivers/radeonsi/si_state_draw.c b/src/gallium/drivers/radeonsi/si_state_draw.c -index 8c35625..93766a3 100644 ---- a/src/gallium/drivers/radeonsi/si_state_draw.c -+++ b/src/gallium/drivers/radeonsi/si_state_draw.c -@@ -401,6 +401,11 @@ static void si_update_derived_state(struct r600_context *rctx) - } - - if (si_pm4_state_changed(rctx, ps) || si_pm4_state_changed(rctx, vs)) { -+ /* XXX: Emitting the PS state even when only the VS changed -+ * fixes random failures with piglit glsl-max-varyings. -+ * Not sure why... -+ */ -+ rctx->emitted.named.ps = NULL; - si_update_spi_map(rctx); - } - } -diff --git a/src/gallium/drivers/rbug/Makefile.am b/src/gallium/drivers/rbug/Makefile.am -index 655bfe1..3c1a8b5 100644 ---- a/src/gallium/drivers/rbug/Makefile.am -+++ b/src/gallium/drivers/rbug/Makefile.am -@@ -30,6 +30,7 @@ noinst_LTLIBRARIES = librbug.la - # preprocessor is determined by the ordering of the -I flags. - AM_CFLAGS = \ - $(GALLIUM_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) \ - -I$(top_srcdir)/src/gallium/drivers \ - -I$(top_srcdir)/include - -diff --git a/src/gallium/drivers/svga/Makefile.am b/src/gallium/drivers/svga/Makefile.am -index fdaa3c8..7eacd90 100644 ---- a/src/gallium/drivers/svga/Makefile.am -+++ b/src/gallium/drivers/svga/Makefile.am -@@ -29,6 +29,8 @@ AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - $(GALLIUM_CFLAGS) - -+AM_CFLAGS = $(VISIBILITY_CFLAGS) -+ - #On some systems -std= must be added to CFLAGS to be the last -std= - CFLAGS += -std=gnu99 - -diff --git a/src/gallium/drivers/trace/Makefile.am b/src/gallium/drivers/trace/Makefile.am -index a9e1457..984ead4 100644 ---- a/src/gallium/drivers/trace/Makefile.am -+++ b/src/gallium/drivers/trace/Makefile.am -@@ -1,7 +1,8 @@ - include $(top_srcdir)/src/gallium/Automake.inc - - AM_CFLAGS = \ -- $(GALLIUM_CFLAGS) -+ $(GALLIUM_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) - - noinst_LTLIBRARIES = libtrace.la - -diff --git a/src/gallium/include/pipe/p_compiler.h b/src/gallium/include/pipe/p_compiler.h -index 5958333..a131969 100644 ---- a/src/gallium/include/pipe/p_compiler.h -+++ b/src/gallium/include/pipe/p_compiler.h -@@ -29,6 +29,8 @@ - #define P_COMPILER_H - - -+#include "c99_compat.h" /* inline, __func__, etc. */ -+ - #include "p_config.h" - - #include -@@ -90,28 +92,7 @@ typedef unsigned char boolean; - #endif - #endif - --/* Function inlining */ --#ifndef inline --# ifdef __cplusplus -- /* C++ supports inline keyword */ --# elif defined(__GNUC__) --# define inline __inline__ --# elif defined(_MSC_VER) --# define inline __inline --# elif defined(__ICL) --# define inline __inline --# elif defined(__INTEL_COMPILER) -- /* Intel compiler supports inline keyword */ --# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) --# define inline __inline --# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -- /* C99 supports inline keyword */ --# elif (__STDC_VERSION__ >= 199901L) -- /* C99 supports inline keyword */ --# else --# define inline --# endif --#endif -+/* XXX: Use standard `inline` keyword instead */ - #ifndef INLINE - # define INLINE inline - #endif -@@ -127,26 +108,6 @@ typedef unsigned char boolean; - # endif - #endif - --/* -- * Define the C99 restrict keyword. -- * -- * See also: -- * - http://cellperformance.beyond3d.com/articles/2006/05/demystifying-the-restrict-keyword.html -- */ --#ifndef restrict --# if (__STDC_VERSION__ >= 199901L) -- /* C99 */ --# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -- /* C99 */ --# elif defined(__GNUC__) --# define restrict __restrict__ --# elif defined(_MSC_VER) --# define restrict __restrict --# else --# define restrict /* */ --# endif --#endif -- - - /* Function visibility */ - #ifndef PUBLIC -@@ -160,35 +121,10 @@ typedef unsigned char boolean; - #endif - - --/* The __FUNCTION__ gcc variable is generally only used for debugging. -- * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. -- */ -+/* XXX: Use standard `__func__` instead */ - #ifndef __FUNCTION__ --# if !defined(__GNUC__) --# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ -- (defined(__SUNPRO_C) && defined(__C99FEATURES__)) --# define __FUNCTION__ __func__ --# else --# define __FUNCTION__ "" --# endif --# endif --# if defined(_MSC_VER) && _MSC_VER < 1300 --# define __FUNCTION__ "" --# endif -+# define __FUNCTION__ __func__ - #endif --#ifndef __func__ --# if (__STDC_VERSION__ >= 199901L) || \ -- (defined(__SUNPRO_C) && defined(__C99FEATURES__)) -- /* __func__ is part of C99 */ --# elif defined(_MSC_VER) --# if _MSC_VER >= 1300 --# define __func__ __FUNCTION__ --# else --# define __func__ "" --# endif --# endif --#endif -- - - - /* This should match linux gcc cdecl semantics everywhere, so that we -diff --git a/src/gallium/state_trackers/egl/Makefile.am b/src/gallium/state_trackers/egl/Makefile.am -index e19e9a3..f78b36e 100644 ---- a/src/gallium/state_trackers/egl/Makefile.am -+++ b/src/gallium/state_trackers/egl/Makefile.am -@@ -27,7 +27,7 @@ include $(top_srcdir)/src/gallium/Automake.inc - AM_CFLAGS = $(GALLIUM_CFLAGS) - AM_CPPFLAGS = \ - -I$(top_srcdir)/src/egl/main \ -- -I$(top_srcdir)/src/egl/wayland/wayland-drm/ \ -+ -I$(top_builddir)/src/egl/wayland/wayland-drm/ \ - -I$(top_srcdir)/include - - noinst_LTLIBRARIES = libegl.la -diff --git a/src/gallium/state_trackers/xa/Makefile.am b/src/gallium/state_trackers/xa/Makefile.am -index 5b53ef9..57d55c4 100644 ---- a/src/gallium/state_trackers/xa/Makefile.am -+++ b/src/gallium/state_trackers/xa/Makefile.am -@@ -24,7 +24,9 @@ include $(top_srcdir)/src/gallium/Automake.inc - - AM_CFLAGS = \ - -Wall -pedantic \ -- $(GALLIUM_CFLAGS) -+ $(GALLIUM_CFLAGS) \ -+ $(VISIBILITY_CFLAGS) -+ - AM_CPPFLAGS = \ - -I$(top_srcdir)/src/gallium/ \ - -I$(top_srcdir)/src/gallium/winsys \ -diff --git a/src/gallium/winsys/svga/drm/Makefile.am b/src/gallium/winsys/svga/drm/Makefile.am -index 53bbcc2..d7ada3c 100644 ---- a/src/gallium/winsys/svga/drm/Makefile.am -+++ b/src/gallium/winsys/svga/drm/Makefile.am -@@ -31,6 +31,8 @@ AM_CPPFLAGS = \ - $(GALLIUM_CFLAGS) \ - $(LIBDRM_CFLAGS) - -+AM_CFLAGS = $(VISIBILITY_CFLAGS) -+ - #On some systems -std= must be added to CFLAGS to be the last -std= - CFLAGS += -std=gnu99 -D_FILE_OFFSET_BITS=64 - -diff --git a/src/glsl/glsl_types.cpp b/src/glsl/glsl_types.cpp -index 02d85b8..dee9709 100644 ---- a/src/glsl/glsl_types.cpp -+++ b/src/glsl/glsl_types.cpp -@@ -446,6 +446,8 @@ const glsl_type *glsl_type::get_scalar_type() const - return int_type; - case GLSL_TYPE_FLOAT: - return float_type; -+ case GLSL_TYPE_BOOL: -+ return bool_type; - default: - /* Handle everything else */ - return type; -diff --git a/src/glsl/ir_validate.cpp b/src/glsl/ir_validate.cpp -index d8cafd5..78ce13e 100644 ---- a/src/glsl/ir_validate.cpp -+++ b/src/glsl/ir_validate.cpp -@@ -695,6 +695,11 @@ check_node_type(ir_instruction *ir, void *data) - void - validate_ir_tree(exec_list *instructions) - { -+ /* We shouldn't have any reason to validate IR in a release build, -+ * and it's half composed of assert()s anyway which wouldn't do -+ * anything. -+ */ -+#ifdef DEBUG - ir_validate v; - - v.run(instructions); -@@ -704,4 +709,5 @@ validate_ir_tree(exec_list *instructions) - - visit_tree(ir, check_node_type, NULL); - } -+#endif - } -diff --git a/src/glsl/linker.cpp b/src/glsl/linker.cpp -index 57e7a9a..cf0420c 100644 ---- a/src/glsl/linker.cpp -+++ b/src/glsl/linker.cpp -@@ -1067,13 +1067,11 @@ link_intrastage_shaders(void *mem_ctx, - - free(linking_shaders); - --#ifdef DEBUG - /* At this point linked should contain all of the linked IR, so - * validate it to make sure nothing went wrong. - */ - if (linked) - validate_ir_tree(linked->ir); --#endif - - /* Make a pass over all variable declarations to ensure that arrays with - * unspecified sizes have a size specified. The size is inferred from the -diff --git a/src/glx/Makefile.am b/src/glx/Makefile.am -index 4aa900a..f01709b 100644 ---- a/src/glx/Makefile.am -+++ b/src/glx/Makefile.am -@@ -39,6 +39,7 @@ AM_CFLAGS = \ - -I$(top_srcdir)/src/mapi/glapi \ - -I$(top_builddir)/src/mapi \ - -I$(top_builddir)/src/mapi/glapi \ -+ $(VISIBILITY_CFLAGS) \ - $(SHARED_GLAPI_CFLAGS) \ - $(EXTRA_DEFINES_XF86VIDMODE) \ - -D_REENTRANT \ -diff --git a/src/mapi/glapi/gen/gl_x86-64_asm.py b/src/mapi/glapi/gen/gl_x86-64_asm.py -index a3548c2..19e0e15 100644 ---- a/src/mapi/glapi/gen/gl_x86-64_asm.py -+++ b/src/mapi/glapi/gen/gl_x86-64_asm.py -@@ -181,19 +181,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): - - def printRealFooter(self): - print '' -- print '#if defined(GLX_USE_TLS) && defined(__linux__)' -- print ' .section ".note.ABI-tag", "a"' -- print ' .p2align 2' -- print ' .long 1f - 0f /* name length */' -- print ' .long 3f - 2f /* data length */' -- print ' .long 1 /* note length */' -- print '0: .asciz "GNU" /* vendor name */' -- print '1: .p2align 2' -- print '2: .long 0 /* note data: the ABI tag */' -- print ' .long 2,4,20 /* Minimum kernel version w/TLS */' -- print '3: .p2align 2 /* pad out section */' -- print '#endif /* GLX_USE_TLS */' -- print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' -diff --git a/src/mapi/glapi/gen/gl_x86_asm.py b/src/mapi/glapi/gen/gl_x86_asm.py -index 8b0f6ee..919bbc0 100644 ---- a/src/mapi/glapi/gen/gl_x86_asm.py -+++ b/src/mapi/glapi/gen/gl_x86_asm.py -@@ -189,19 +189,6 @@ class PrintGenericStubs(gl_XML.gl_print_base): - print '\t\tALIGNTEXT16' - print 'GLNAME(gl_dispatch_functions_end):' - print '' -- print '#if defined(GLX_USE_TLS) && defined(__linux__)' -- print ' .section ".note.ABI-tag", "a"' -- print ' .p2align 2' -- print ' .long 1f - 0f /* name length */' -- print ' .long 3f - 2f /* data length */' -- print ' .long 1 /* note length */' -- print '0: .asciz "GNU" /* vendor name */' -- print '1: .p2align 2' -- print '2: .long 0 /* note data: the ABI tag */' -- print ' .long 2,4,20 /* Minimum kernel version w/TLS */' -- print '3: .p2align 2 /* pad out section */' -- print '#endif /* GLX_USE_TLS */' -- print '' - print '#if defined (__ELF__) && defined (__linux__)' - print ' .section .note.GNU-stack,"",%progbits' - print '#endif' -diff --git a/src/mapi/mapi/entry_x86-64_tls.h b/src/mapi/mapi/entry_x86-64_tls.h -index 72d4125..36cad00 100644 ---- a/src/mapi/mapi/entry_x86-64_tls.h -+++ b/src/mapi/mapi/entry_x86-64_tls.h -@@ -28,19 +28,6 @@ - - #include "u_macros.h" - --#ifdef __linux__ --__asm__(".section .note.ABI-tag, \"a\"\n\t" -- ".p2align 2\n\t" -- ".long 1f - 0f\n\t" /* name length */ -- ".long 3f - 2f\n\t" /* data length */ -- ".long 1\n\t" /* note length */ -- "0: .asciz \"GNU\"\n\t" /* vendor name */ -- "1: .p2align 2\n\t" -- "2: .long 0\n\t" /* note data: the ABI tag */ -- ".long 2,4,20\n\t" /* Minimum kernel version w/TLS */ -- "3: .p2align 2\n\t"); /* pad out section */ --#endif /* __linux__ */ -- - __asm__(".text\n" - ".balign 32\n" - "x86_64_entry_start:"); -diff --git a/src/mapi/mapi/entry_x86_tls.h b/src/mapi/mapi/entry_x86_tls.h -index de91812..58d09ca 100644 ---- a/src/mapi/mapi/entry_x86_tls.h -+++ b/src/mapi/mapi/entry_x86_tls.h -@@ -29,19 +29,6 @@ - #include - #include "u_macros.h" - --#ifdef __linux__ --__asm__(".section .note.ABI-tag, \"a\"\n\t" -- ".p2align 2\n\t" -- ".long 1f - 0f\n\t" /* name length */ -- ".long 3f - 2f\n\t" /* data length */ -- ".long 1\n\t" /* note length */ -- "0: .asciz \"GNU\"\n\t" /* vendor name */ -- "1: .p2align 2\n\t" -- "2: .long 0\n\t" /* note data: the ABI tag */ -- ".long 2,4,20\n\t" /* Minimum kernel version w/TLS */ -- "3: .p2align 2\n\t"); /* pad out section */ --#endif /* __linux__ */ -- - __asm__(".text"); - - __asm__("x86_current_tls:\n\t" -diff --git a/src/mapi/mapi/u_compiler.h b/src/mapi/mapi/u_compiler.h -index 2b019ed..f376e97 100644 ---- a/src/mapi/mapi/u_compiler.h -+++ b/src/mapi/mapi/u_compiler.h -@@ -1,28 +1,10 @@ - #ifndef _U_COMPILER_H_ - #define _U_COMPILER_H_ - --/* Function inlining */ --#ifndef inline --# ifdef __cplusplus -- /* C++ supports inline keyword */ --# elif defined(__GNUC__) --# define inline __inline__ --# elif defined(_MSC_VER) --# define inline __inline --# elif defined(__ICL) --# define inline __inline --# elif defined(__INTEL_COMPILER) -- /* Intel compiler supports inline keyword */ --# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) --# define inline __inline --# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -- /* C99 supports inline keyword */ --# elif (__STDC_VERSION__ >= 199901L) -- /* C99 supports inline keyword */ --# else --# define inline --# endif --#endif -+#include "c99_compat.h" /* inline, __func__, etc. */ -+ -+ -+/* XXX: Use standard `inline` keyword instead */ - #ifndef INLINE - # define INLINE inline - #endif -diff --git a/src/mesa/drivers/dri/i965/brw_clear.c b/src/mesa/drivers/dri/i965/brw_clear.c -index 53d8e54..cde1a06 100644 ---- a/src/mesa/drivers/dri/i965/brw_clear.c -+++ b/src/mesa/drivers/dri/i965/brw_clear.c -@@ -40,6 +40,8 @@ - #include "intel_mipmap_tree.h" - #include "intel_regions.h" - -+#include "brw_context.h" -+ - #define FILE_DEBUG_FLAG DEBUG_BLIT - - static const char *buffer_names[] = { -@@ -219,7 +221,8 @@ brw_fast_clear_depth(struct gl_context *ctx) - static void - brw_clear(struct gl_context *ctx, GLbitfield mask) - { -- struct intel_context *intel = intel_context(ctx); -+ struct brw_context *brw = brw_context(ctx); -+ struct intel_context *intel = &brw->intel; - - if (!_mesa_check_conditional_render(ctx)) - return; -@@ -229,6 +232,7 @@ brw_clear(struct gl_context *ctx, GLbitfield mask) - } - - intel_prepare_render(intel); -+ brw_workaround_depthstencil_alignment(brw); - - if (mask & BUFFER_BIT_DEPTH) { - if (brw_fast_clear_depth(ctx)) { -diff --git a/src/mesa/drivers/dri/i965/brw_defines.h b/src/mesa/drivers/dri/i965/brw_defines.h -index 79cc12f..4bcfb95 100644 ---- a/src/mesa/drivers/dri/i965/brw_defines.h -+++ b/src/mesa/drivers/dri/i965/brw_defines.h -@@ -437,6 +437,7 @@ - #define BRW_SURFACEFORMAT_B10G10R10A2_SSCALED 0x1B9 - #define BRW_SURFACEFORMAT_B10G10R10A2_UINT 0x1BA - #define BRW_SURFACEFORMAT_B10G10R10A2_SINT 0x1BB -+#define BRW_SURFACEFORMAT_RAW 0x1FF - #define BRW_SURFACE_FORMAT_SHIFT 18 - #define BRW_SURFACE_FORMAT_MASK INTEL_MASK(26, 18) - -@@ -857,6 +858,7 @@ enum brw_message_target { - GEN6_SFID_DATAPORT_CONSTANT_CACHE = 9, - - GEN7_SFID_DATAPORT_DATA_CACHE = 10, -+ HSW_SFID_DATAPORT_DATA_CACHE_1 = 12, - }; - - #define GEN7_MESSAGE_TARGET_DP_DATA_CACHE 10 -@@ -965,7 +967,44 @@ enum brw_message_target { - - /* GEN7 */ - #define GEN7_DATAPORT_WRITE_MESSAGE_OWORD_DUAL_BLOCK_WRITE 10 -+#define GEN7_DATAPORT_DC_OWORD_BLOCK_READ 0 -+#define GEN7_DATAPORT_DC_UNALIGNED_OWORD_BLOCK_READ 1 -+#define GEN7_DATAPORT_DC_OWORD_DUAL_BLOCK_READ 2 - #define GEN7_DATAPORT_DC_DWORD_SCATTERED_READ 3 -+#define GEN7_DATAPORT_DC_BYTE_SCATTERED_READ 4 -+#define GEN7_DATAPORT_DC_UNTYPED_SURFACE_READ 5 -+#define GEN7_DATAPORT_DC_UNTYPED_ATOMIC_OP 6 -+#define GEN7_DATAPORT_DC_MEMORY_FENCE 7 -+#define GEN7_DATAPORT_DC_OWORD_BLOCK_WRITE 8 -+#define GEN7_DATAPORT_DC_OWORD_DUAL_BLOCK_WRITE 10 -+#define GEN7_DATAPORT_DC_DWORD_SCATTERED_WRITE 11 -+#define GEN7_DATAPORT_DC_BYTE_SCATTERED_WRITE 12 -+#define GEN7_DATAPORT_DC_UNTYPED_SURFACE_WRITE 13 -+ -+/* HSW */ -+#define HSW_DATAPORT_DC_PORT0_OWORD_BLOCK_READ 0 -+#define HSW_DATAPORT_DC_PORT0_UNALIGNED_OWORD_BLOCK_READ 1 -+#define HSW_DATAPORT_DC_PORT0_OWORD_DUAL_BLOCK_READ 2 -+#define HSW_DATAPORT_DC_PORT0_DWORD_SCATTERED_READ 3 -+#define HSW_DATAPORT_DC_PORT0_BYTE_SCATTERED_READ 4 -+#define HSW_DATAPORT_DC_PORT0_MEMORY_FENCE 7 -+#define HSW_DATAPORT_DC_PORT0_OWORD_BLOCK_WRITE 8 -+#define HSW_DATAPORT_DC_PORT0_OWORD_DUAL_BLOCK_WRITE 10 -+#define HSW_DATAPORT_DC_PORT0_DWORD_SCATTERED_WRITE 11 -+#define HSW_DATAPORT_DC_PORT0_BYTE_SCATTERED_WRITE 12 -+ -+#define HSW_DATAPORT_DC_PORT1_UNTYPED_SURFACE_READ 1 -+#define HSW_DATAPORT_DC_PORT1_UNTYPED_ATOMIC_OP 2 -+#define HSW_DATAPORT_DC_PORT1_UNTYPED_ATOMIC_OP_SIMD4X2 3 -+#define HSW_DATAPORT_DC_PORT1_MEDIA_BLOCK_READ 4 -+#define HSW_DATAPORT_DC_PORT1_TYPED_SURFACE_READ 5 -+#define HSW_DATAPORT_DC_PORT1_TYPED_ATOMIC_OP 6 -+#define HSW_DATAPORT_DC_PORT1_TYPED_ATOMIC_OP_SIMD4X2 7 -+#define HSW_DATAPORT_DC_PORT1_UNTYPED_SURFACE_WRITE 9 -+#define HSW_DATAPORT_DC_PORT1_MEDIA_BLOCK_WRITE 10 -+#define HSW_DATAPORT_DC_PORT1_ATOMIC_COUNTER_OP 11 -+#define HSW_DATAPORT_DC_PORT1_ATOMIC_COUNTER_OP_SIMD4X2 12 -+#define HSW_DATAPORT_DC_PORT1_TYPED_SURFACE_WRITE 13 - - /* dataport atomic operations. */ - #define BRW_AOP_AND 1 -diff --git a/src/mesa/drivers/dri/i965/brw_eu_emit.c b/src/mesa/drivers/dri/i965/brw_eu_emit.c -index b34754a..40cae37 100644 ---- a/src/mesa/drivers/dri/i965/brw_eu_emit.c -+++ b/src/mesa/drivers/dri/i965/brw_eu_emit.c -@@ -2539,15 +2539,22 @@ void brw_shader_time_add(struct brw_compile *p, - brw_set_src0(p, send, brw_vec1_reg(BRW_MESSAGE_REGISTER_FILE, - base_mrf, 0)); - -+ uint32_t sfid, msg_type; -+ if (intel->is_haswell) { -+ sfid = HSW_SFID_DATAPORT_DATA_CACHE_1; -+ msg_type = HSW_DATAPORT_DC_PORT1_UNTYPED_ATOMIC_OP; -+ } else { -+ sfid = GEN7_SFID_DATAPORT_DATA_CACHE; -+ msg_type = GEN7_DATAPORT_DC_UNTYPED_ATOMIC_OP; -+ } -+ - bool header_present = false; - bool eot = false; - uint32_t mlen = 2; /* offset, value */ - uint32_t rlen = 0; -- brw_set_message_descriptor(p, send, -- GEN7_SFID_DATAPORT_DATA_CACHE, -- mlen, rlen, header_present, eot); -+ brw_set_message_descriptor(p, send, sfid, mlen, rlen, header_present, eot); - -- send->bits3.ud |= 6 << 14; /* untyped atomic op */ -+ send->bits3.ud |= msg_type << 14; - send->bits3.ud |= 0 << 13; /* no return data */ - send->bits3.ud |= 1 << 12; /* SIMD8 mode */ - send->bits3.ud |= BRW_AOP_ADD << 8; -diff --git a/src/mesa/drivers/dri/i965/brw_fs.cpp b/src/mesa/drivers/dri/i965/brw_fs.cpp -index f80219e..4924441 100644 ---- a/src/mesa/drivers/dri/i965/brw_fs.cpp -+++ b/src/mesa/drivers/dri/i965/brw_fs.cpp -@@ -2295,7 +2295,8 @@ clear_deps_for_inst_src(fs_inst *inst, int dispatch_width, bool *deps, - void - fs_visitor::insert_gen4_pre_send_dependency_workarounds(fs_inst *inst) - { -- int write_len = inst->regs_written() * dispatch_width / 8; -+ int reg_size = dispatch_width / 8; -+ int write_len = inst->regs_written() * reg_size; - int first_write_grf = inst->dst.reg; - bool needs_dep[BRW_MAX_MRF]; - assert(write_len < (int)sizeof(needs_dep) - 1); -@@ -2334,14 +2335,19 @@ fs_visitor::insert_gen4_pre_send_dependency_workarounds(fs_inst *inst) - * instruction but a MOV that might have left us an outstanding - * dependency has more latency than a MOV. - */ -- if (scan_inst->dst.file == GRF && -- scan_inst->dst.reg >= first_write_grf && -- scan_inst->dst.reg < first_write_grf + write_len && -- needs_dep[scan_inst->dst.reg - first_write_grf]) { -- inst->insert_before(DEP_RESOLVE_MOV(scan_inst->dst.reg)); -- needs_dep[scan_inst->dst.reg - first_write_grf] = false; -- if (scan_inst_16wide) -- needs_dep[scan_inst->dst.reg - first_write_grf + 1] = false; -+ if (scan_inst->dst.file == GRF) { -+ for (int i = 0; i < scan_inst->regs_written(); i++) { -+ int reg = scan_inst->dst.reg + i * reg_size; -+ -+ if (reg >= first_write_grf && -+ reg < first_write_grf + write_len && -+ needs_dep[reg - first_write_grf]) { -+ inst->insert_before(DEP_RESOLVE_MOV(reg)); -+ needs_dep[reg - first_write_grf] = false; -+ if (scan_inst_16wide) -+ needs_dep[reg - first_write_grf + 1] = false; -+ } -+ } - } - - /* Clear the flag for registers that actually got read (as expected). */ -@@ -2494,6 +2500,8 @@ fs_visitor::lower_uniform_pull_constant_loads() - inst->insert_before(setup2); - inst->opcode = FS_OPCODE_UNIFORM_PULL_CONSTANT_LOAD_GEN7; - inst->src[1] = payload; -+ -+ this->live_intervals_valid = false; - } else { - /* Before register allocation, we didn't tell the scheduler about the - * MRF we use. We know it's safe to use this MRF because nothing -diff --git a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp -index db8f397..4c7991d 100644 ---- a/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp -+++ b/src/mesa/drivers/dri/i965/brw_fs_live_variables.cpp -@@ -190,6 +190,37 @@ fs_visitor::calculate_live_intervals() - int reg = inst->src[i].reg; - - use[reg] = ip; -+ -+ /* In most cases, a register can be written over safely by the -+ * same instruction that is its last use. For a single -+ * instruction, the sources are dereferenced before writing of the -+ * destination starts (naturally). This gets more complicated for -+ * simd16, because the instruction: -+ * -+ * mov(16) g4<1>F g4<8,8,1>F g6<8,8,1>F -+ * -+ * is actually decoded in hardware as: -+ * -+ * mov(8) g4<1>F g4<8,8,1>F g6<8,8,1>F -+ * mov(8) g5<1>F g5<8,8,1>F g7<8,8,1>F -+ * -+ * Which is safe. However, if we have uniform accesses -+ * happening, we get into trouble: -+ * -+ * mov(8) g4<1>F g4<0,1,0>F g6<8,8,1>F -+ * mov(8) g5<1>F g4<0,1,0>F g7<8,8,1>F -+ * -+ * Now our destination for the first instruction overwrote the -+ * second instruction's src0, and we get garbage for those 8 -+ * pixels. There's a similar issue for the pre-gen6 -+ * pixel_x/pixel_y, which are registers of 16-bit values and thus -+ * would get stomped by the first decode as well. -+ */ -+ if (dispatch_width == 16 && (inst->src[i].smear || -+ (this->pixel_x.reg == reg || -+ this->pixel_y.reg == reg))) { -+ use[reg]++; -+ } - } - } - -@@ -264,28 +295,5 @@ fs_visitor::virtual_grf_interferes(int a, int b) - int start = MAX2(a_def, b_def); - int end = MIN2(a_use, b_use); - -- /* If the register is used to store 16 values of less than float -- * size (only the case for pixel_[xy]), then we can't allocate -- * another dword-sized thing to that register that would be used in -- * the same instruction. This is because when the GPU decodes (for -- * example): -- * -- * (declare (in ) vec4 gl_FragCoord@0x97766a0) -- * add(16) g6<1>F g6<8,8,1>UW 0.5F { align1 compr }; -- * -- * it's actually processed as: -- * add(8) g6<1>F g6<8,8,1>UW 0.5F { align1 }; -- * add(8) g7<1>F g6.8<8,8,1>UW 0.5F { align1 sechalf }; -- * -- * so our second half values in g6 got overwritten in the first -- * half. -- */ -- if (dispatch_width == 16 && (this->pixel_x.reg == a || -- this->pixel_x.reg == b || -- this->pixel_y.reg == a || -- this->pixel_y.reg == b)) { -- return start <= end; -- } -- - return start < end; - } -diff --git a/src/mesa/drivers/dri/i965/brw_state.h b/src/mesa/drivers/dri/i965/brw_state.h -index ecc61c4..02ce57b 100644 ---- a/src/mesa/drivers/dri/i965/brw_state.h -+++ b/src/mesa/drivers/dri/i965/brw_state.h -@@ -216,6 +216,8 @@ void gen7_set_surface_mcs_info(struct brw_context *brw, - bool is_render_target); - void gen7_check_surface_setup(uint32_t *surf, bool is_render_target); - void gen7_init_vtable_surface_functions(struct brw_context *brw); -+void gen7_create_shader_time_surface(struct brw_context *brw, -+ uint32_t *out_offset); - - /* brw_wm_sampler_state.c */ - uint32_t translate_wrap_mode(GLenum wrap, bool using_nearest); -diff --git a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c -index 4da7eaa..2aefc0c 100644 ---- a/src/mesa/drivers/dri/i965/brw_vs_surface_state.c -+++ b/src/mesa/drivers/dri/i965/brw_vs_surface_state.c -@@ -137,14 +137,11 @@ const struct brw_tracked_state brw_vs_ubo_surfaces = { - static void - brw_vs_upload_binding_table(struct brw_context *brw) - { -- struct intel_context *intel = &brw->intel; - uint32_t *bind; - int i; - - if (INTEL_DEBUG & DEBUG_SHADER_TIME) { -- intel->vtbl.create_constant_surface(brw, brw->shader_time.bo, 0, -- brw->shader_time.bo->size, -- &brw->vs.surf_offset[SURF_INDEX_VS_SHADER_TIME]); -+ gen7_create_shader_time_surface(brw, &brw->vs.surf_offset[SURF_INDEX_VS_SHADER_TIME]); - - assert(brw->vs.prog_data->num_surfaces <= SURF_INDEX_VS_SHADER_TIME); - brw->vs.prog_data->num_surfaces = SURF_INDEX_VS_SHADER_TIME; -diff --git a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -index 6ec7d71..657a56f 100644 ---- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c -@@ -770,7 +770,8 @@ brw_get_texture_swizzle(const struct gl_context *ctx, - case GL_RED: - case GL_RG: - case GL_RGB: -- swizzles[3] = SWIZZLE_ONE; -+ if (_mesa_get_format_bits(img->TexFormat, GL_ALPHA_BITS) > 0) -+ swizzles[3] = SWIZZLE_ONE; - break; - } - -@@ -1468,14 +1469,11 @@ const struct brw_tracked_state brw_wm_ubo_surfaces = { - static void - brw_upload_wm_binding_table(struct brw_context *brw) - { -- struct intel_context *intel = &brw->intel; - uint32_t *bind; - int i; - - if (INTEL_DEBUG & DEBUG_SHADER_TIME) { -- intel->vtbl.create_constant_surface(brw, brw->shader_time.bo, 0, -- brw->shader_time.bo->size, -- &brw->wm.surf_offset[SURF_INDEX_WM_SHADER_TIME]); -+ gen7_create_shader_time_surface(brw, &brw->wm.surf_offset[SURF_INDEX_WM_SHADER_TIME]); - } - - /* Might want to calculate nr_surfaces first, to avoid taking up so much -diff --git a/src/mesa/drivers/dri/i965/gen6_cc.c b/src/mesa/drivers/dri/i965/gen6_cc.c -index d32f636..7ac5d5f 100644 ---- a/src/mesa/drivers/dri/i965/gen6_cc.c -+++ b/src/mesa/drivers/dri/i965/gen6_cc.c -@@ -126,7 +126,7 @@ gen6_upload_blend_state(struct brw_context *brw) - * not read the alpha channel, but will instead use the correct - * implicit value for alpha. - */ -- if (!_mesa_base_format_has_channel(rb->_BaseFormat, GL_TEXTURE_ALPHA_TYPE)) -+ if (rb && !_mesa_base_format_has_channel(rb->_BaseFormat, GL_TEXTURE_ALPHA_TYPE)) - { - srcRGB = brw_fix_xRGB_alpha(srcRGB); - srcA = brw_fix_xRGB_alpha(srcA); -diff --git a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c -index 24f1b9c..2913fc6 100644 ---- a/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c -+++ b/src/mesa/drivers/dri/i965/gen7_wm_surface_state.c -@@ -413,6 +413,46 @@ gen7_create_constant_surface(struct brw_context *brw, - gen7_check_surface_setup(surf, false /* is_render_target */); - } - -+/** -+ * Create a surface for shader time. -+ */ -+void -+gen7_create_shader_time_surface(struct brw_context *brw, uint32_t *out_offset) -+{ -+ struct intel_context *intel = &brw->intel; -+ const int w = brw->shader_time.bo->size - 1; -+ -+ uint32_t *surf = brw_state_batch(brw, AUB_TRACE_SURFACE_STATE, -+ 8 * 4, 32, out_offset); -+ memset(surf, 0, 8 * 4); -+ -+ surf[0] = BRW_SURFACE_BUFFER << BRW_SURFACE_TYPE_SHIFT | -+ BRW_SURFACEFORMAT_RAW << BRW_SURFACE_FORMAT_SHIFT | -+ BRW_SURFACE_RC_READ_WRITE; -+ -+ surf[1] = brw->shader_time.bo->offset; /* reloc */ -+ -+ surf[2] = SET_FIELD(w & 0x7f, GEN7_SURFACE_WIDTH) | -+ SET_FIELD((w >> 7) & 0x1fff, GEN7_SURFACE_HEIGHT); -+ surf[3] = SET_FIELD((w >> 20) & 0x7f, BRW_SURFACE_DEPTH); -+ -+ /* Unlike texture or renderbuffer surfaces, we only do untyped operations -+ * on the shader_time surface, so there's no need to set HSW channel -+ * overrides. -+ */ -+ -+ /* Emit relocation to surface contents. Section 5.1.1 of the gen4 -+ * bspec ("Data Cache") says that the data cache does not exist as -+ * a separate cache and is just the sampler cache. -+ */ -+ drm_intel_bo_emit_reloc(intel->batch.bo, -+ *out_offset + 4, -+ brw->shader_time.bo, 0, -+ I915_GEM_DOMAIN_SAMPLER, 0); -+ -+ gen7_check_surface_setup(surf, false /* is_render_target */); -+} -+ - static void - gen7_update_null_renderbuffer_surface(struct brw_context *brw, unsigned unit) - { -diff --git a/src/mesa/drivers/dri/intel/intel_screen.c b/src/mesa/drivers/dri/intel/intel_screen.c -index 5ec93f1..4173c0f 100644 ---- a/src/mesa/drivers/dri/intel/intel_screen.c -+++ b/src/mesa/drivers/dri/intel/intel_screen.c -@@ -312,7 +312,7 @@ intel_create_image_from_name(__DRIscreen *screen, - cpp = _mesa_get_format_bytes(image->format); - image->region = intel_region_alloc_for_handle(intelScreen, - cpp, width, height, -- pitch, name, "image"); -+ pitch * cpp, name, "image"); - if (image->region == NULL) { - free(image); - return NULL; -diff --git a/src/mesa/drivers/dri/nouveau/nouveau_driver.c b/src/mesa/drivers/dri/nouveau/nouveau_driver.c -index f56b3b2..6c119d5 100644 ---- a/src/mesa/drivers/dri/nouveau/nouveau_driver.c -+++ b/src/mesa/drivers/dri/nouveau/nouveau_driver.c -@@ -69,7 +69,8 @@ nouveau_flush(struct gl_context *ctx) - __DRIdri2LoaderExtension *dri2 = screen->dri2.loader; - __DRIdrawable *drawable = nctx->dri_context->driDrawablePriv; - -- dri2->flushFrontBuffer(drawable, drawable->loaderPrivate); -+ if (drawable && drawable->loaderPrivate) -+ dri2->flushFrontBuffer(drawable, drawable->loaderPrivate); - } - } - -diff --git a/src/mesa/drivers/dri/nouveau/nv10_context.c b/src/mesa/drivers/dri/nouveau/nv10_context.c -index 7eda4e0..4ffc4ef 100644 ---- a/src/mesa/drivers/dri/nouveau/nv10_context.c -+++ b/src/mesa/drivers/dri/nouveau/nv10_context.c -@@ -469,7 +469,7 @@ nv10_context_create(struct nouveau_screen *screen, const struct gl_config *visua - goto fail; - - /* 3D engine. */ -- if (context_chipset(ctx) >= 0x17) -+ if (context_chipset(ctx) >= 0x17 && context_chipset(ctx) != 0x1a) - celsius_class = NV17_3D_CLASS; - else if (context_chipset(ctx) >= 0x11) - celsius_class = NV15_3D_CLASS; -diff --git a/src/mesa/drivers/osmesa/Makefile.am b/src/mesa/drivers/osmesa/Makefile.am -index c4b178b..2503401 100644 ---- a/src/mesa/drivers/osmesa/Makefile.am -+++ b/src/mesa/drivers/osmesa/Makefile.am -@@ -24,6 +24,7 @@ - AM_CPPFLAGS = \ - -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/mapi \ -+ -I$(top_builddir)/src/mapi \ - -I$(top_srcdir)/src/mesa/ \ - $(DEFINES) \ - $(API_DEFINES) -diff --git a/src/mesa/main/compiler.h b/src/mesa/main/compiler.h -index b22b994..8b23665 100644 ---- a/src/mesa/main/compiler.h -+++ b/src/mesa/main/compiler.h -@@ -48,6 +48,8 @@ - #include - #include - -+#include "c99_compat.h" /* inline, __func__, etc. */ -+ - - #ifdef __cplusplus - extern "C" { -@@ -111,30 +113,7 @@ extern "C" { - - - --/** -- * Function inlining -- */ --#ifndef inline --# ifdef __cplusplus -- /* C++ supports inline keyword */ --# elif defined(__GNUC__) --# define inline __inline__ --# elif defined(_MSC_VER) --# define inline __inline --# elif defined(__ICL) --# define inline __inline --# elif defined(__INTEL_COMPILER) -- /* Intel compiler supports inline keyword */ --# elif defined(__WATCOMC__) && (__WATCOMC__ >= 1100) --# define inline __inline --# elif defined(__SUNPRO_C) && defined(__C99FEATURES__) -- /* C99 supports inline keyword */ --# elif (__STDC_VERSION__ >= 199901L) -- /* C99 supports inline keyword */ --# else --# define inline --# endif --#endif -+/* XXX: Use standard `inline` keyword instead */ - #ifndef INLINE - # define INLINE inline - #endif -@@ -177,35 +156,10 @@ extern "C" { - # endif - #endif - --/** -- * The __FUNCTION__ gcc variable is generally only used for debugging. -- * If we're not using gcc, define __FUNCTION__ as a cpp symbol here. -- * Don't define it if using a newer Windows compiler. -- */ -+/* XXX: Use standard `__func__` instead */ - #ifndef __FUNCTION__ --# if !defined(__GNUC__) && !defined(__xlC__) && \ -- (!defined(_MSC_VER) || _MSC_VER < 1300) --# if (__STDC_VERSION__ >= 199901L) /* C99 */ || \ -- (defined(__SUNPRO_C) && defined(__C99FEATURES__)) --# define __FUNCTION__ __func__ --# else --# define __FUNCTION__ "" --# endif --# endif -+# define __FUNCTION__ __func__ - #endif --#ifndef __func__ --# if (__STDC_VERSION__ >= 199901L) || \ -- (defined(__SUNPRO_C) && defined(__C99FEATURES__)) -- /* __func__ is part of C99 */ --# elif defined(_MSC_VER) --# if _MSC_VER >= 1300 --# define __func__ __FUNCTION__ --# else --# define __func__ "" --# endif --# endif --#endif -- - - /** - * Either define MESA_BIG_ENDIAN or MESA_LITTLE_ENDIAN, and CPU_TO_LE32. -@@ -353,8 +307,9 @@ static INLINE GLuint CPU_TO_LE32(GLuint x) - * USE_IEEE: Determine if we're using IEEE floating point - */ - #if defined(__i386__) || defined(__386__) || defined(__sparc__) || \ -- defined(__s390x__) || defined(__powerpc__) || \ -+ defined(__s390__) || defined(__s390x__) || defined(__powerpc__) || \ - defined(__x86_64__) || \ -+ defined(__m68k__) || \ - defined(ia64) || defined(__ia64__) || \ - defined(__hppa__) || defined(hpux) || \ - defined(__mips) || defined(_MIPS_ARCH) || \ -diff --git a/src/mesa/main/fbobject.c b/src/mesa/main/fbobject.c -index 257f839..61c1151 100644 ---- a/src/mesa/main/fbobject.c -+++ b/src/mesa/main/fbobject.c -@@ -3160,7 +3160,9 @@ _mesa_BlitFramebuffer(GLint srcX0, GLint srcY0, GLint srcX1, GLint srcY1, - } - } - -- if (!mask) { -+ if (!mask || -+ (srcX1 - srcX0) == 0 || (srcY1 - srcY0) == 0 || -+ (dstX1 - dstX0) == 0 || (dstY1 - dstY0) == 0) { - return; - } - -diff --git a/src/mesa/main/get.c b/src/mesa/main/get.c -index 5f4e2fa..6fb2f5d 100644 ---- a/src/mesa/main/get.c -+++ b/src/mesa/main/get.c -@@ -34,6 +34,7 @@ - #include "state.h" - #include "texcompress.h" - #include "framebuffer.h" -+#include "samplerobj.h" - - /* This is a table driven implemetation of the glGet*v() functions. - * The basic idea is that most getters just look up an int somewhere -@@ -823,7 +824,16 @@ find_custom_value(struct gl_context *ctx, const struct value_desc *d, union valu - { - struct gl_sampler_object *samp = - ctx->Texture.Unit[ctx->Texture.CurrentUnit].Sampler; -- v->value_int = samp ? samp->Name : 0; -+ -+ /* -+ * The sampler object may have been deleted on another context, -+ * so we try to lookup the sampler object before returning its Name. -+ */ -+ if (samp && _mesa_lookup_samplerobj(ctx, samp->Name)) { -+ v->value_int = samp->Name; -+ } else { -+ v->value_int = 0; -+ } - } - break; - /* GL_ARB_uniform_buffer_object */ -diff --git a/src/mesa/main/get_hash_params.py b/src/mesa/main/get_hash_params.py -index 9aab889..15c1c4d 100644 ---- a/src/mesa/main/get_hash_params.py -+++ b/src/mesa/main/get_hash_params.py -@@ -412,7 +412,7 @@ descriptor=[ - [ "DEPTH_SCALE", "CONTEXT_FLOAT(Pixel.DepthScale), NO_EXTRA" ], - [ "DOUBLEBUFFER", "BUFFER_INT(Visual.doubleBufferMode), NO_EXTRA" ], - [ "DRAW_BUFFER", "BUFFER_ENUM(ColorDrawBuffer[0]), NO_EXTRA" ], -- [ "EDGE_FLAG", "LOC_CUSTOM, TYPE_BOOLEAN, 0, NO_EXTRA" ], -+ [ "EDGE_FLAG", "LOC_CUSTOM, TYPE_BOOLEAN, 0, extra_flush_current" ], - [ "FEEDBACK_BUFFER_SIZE", "CONTEXT_INT(Feedback.BufferSize), NO_EXTRA" ], - [ "FEEDBACK_BUFFER_TYPE", "CONTEXT_ENUM(Feedback.Type), NO_EXTRA" ], - [ "FOG_INDEX", "CONTEXT_FLOAT(Fog.Index), NO_EXTRA" ], -diff --git a/src/mesa/main/mtypes.h b/src/mesa/main/mtypes.h -index 3369623..8f906ae 100644 ---- a/src/mesa/main/mtypes.h -+++ b/src/mesa/main/mtypes.h -@@ -1274,6 +1274,7 @@ struct gl_texture_object - GLfloat Priority; /**< in [0,1] */ - GLint BaseLevel; /**< min mipmap level, OpenGL 1.2 */ - GLint MaxLevel; /**< max mipmap level, OpenGL 1.2 */ -+ GLint ImmutableLevels; /**< ES 3.0 / ARB_texture_view */ - GLint _MaxLevel; /**< actual max mipmap level (q in the spec) */ - GLfloat _MaxLambda; /**< = _MaxLevel - BaseLevel (q - b in spec) */ - GLint CropRect[4]; /**< GL_OES_draw_texture */ -diff --git a/src/mesa/main/samplerobj.c b/src/mesa/main/samplerobj.c -index 319a444..5cff329 100644 ---- a/src/mesa/main/samplerobj.c -+++ b/src/mesa/main/samplerobj.c -@@ -40,7 +40,7 @@ - #include "main/samplerobj.h" - - --static struct gl_sampler_object * -+struct gl_sampler_object * - _mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name) - { - if (name == 0) -@@ -206,9 +206,19 @@ _mesa_DeleteSamplers(GLsizei count, const GLuint *samplers) - - for (i = 0; i < count; i++) { - if (samplers[i]) { -+ GLuint j; - struct gl_sampler_object *sampObj = - _mesa_lookup_samplerobj(ctx, samplers[i]); -+ - if (sampObj) { -+ /* If the sampler is currently bound, unbind it. */ -+ for (j = 0; j < ctx->Const.MaxCombinedTextureImageUnits; j++) { -+ if (ctx->Texture.Unit[j].Sampler == sampObj) { -+ FLUSH_VERTICES(ctx, _NEW_TEXTURE); -+ _mesa_reference_sampler_object(ctx, &ctx->Texture.Unit[j].Sampler, NULL); -+ } -+ } -+ - /* The ID is immediately freed for re-use */ - _mesa_HashRemove(ctx->Shared->SamplerObjects, samplers[i]); - /* But the object exists until its reference count goes to zero */ -diff --git a/src/mesa/main/samplerobj.h b/src/mesa/main/samplerobj.h -index 3114257..69e3899 100644 ---- a/src/mesa/main/samplerobj.h -+++ b/src/mesa/main/samplerobj.h -@@ -62,6 +62,8 @@ _mesa_reference_sampler_object(struct gl_context *ctx, - _mesa_reference_sampler_object_(ctx, ptr, samp); - } - -+extern struct gl_sampler_object * -+_mesa_lookup_samplerobj(struct gl_context *ctx, GLuint name); - - extern struct gl_sampler_object * - _mesa_new_sampler_object(struct gl_context *ctx, GLuint name); -diff --git a/src/mesa/main/tests/hash_table/Makefile.am b/src/mesa/main/tests/hash_table/Makefile.am -index 272c63a..f63841d 100644 ---- a/src/mesa/main/tests/hash_table/Makefile.am -+++ b/src/mesa/main/tests/hash_table/Makefile.am -@@ -19,6 +19,7 @@ - # CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - - AM_CPPFLAGS = \ -+ -I$(top_srcdir)/include \ - -I$(top_srcdir)/src/mesa/main \ - $(API_DEFINES) $(DEFINES) $(INCLUDE_DIRS) - -diff --git a/src/mesa/main/texgetimage.c b/src/mesa/main/texgetimage.c -index 7299a4b..74b09ef 100644 ---- a/src/mesa/main/texgetimage.c -+++ b/src/mesa/main/texgetimage.c -@@ -518,6 +518,7 @@ get_tex_rgba(struct gl_context *ctx, GLuint dimensions, - if (type_needs_clamping(type)) { - /* the returned image type can't have negative values */ - if (dataType == GL_FLOAT || -+ dataType == GL_HALF_FLOAT || - dataType == GL_SIGNED_NORMALIZED || - format == GL_LUMINANCE || - format == GL_LUMINANCE_ALPHA) { -diff --git a/src/mesa/main/teximage.c b/src/mesa/main/teximage.c -index 1b9525b..1b91b89 100644 ---- a/src/mesa/main/teximage.c -+++ b/src/mesa/main/teximage.c -@@ -1362,6 +1362,7 @@ _mesa_legal_texture_dimensions(struct gl_context *ctx, GLenum target, - return GL_FALSE; - return GL_TRUE; - -+ case GL_TEXTURE_CUBE_MAP: - case GL_TEXTURE_CUBE_MAP_POSITIVE_X: - case GL_TEXTURE_CUBE_MAP_NEGATIVE_X: - case GL_TEXTURE_CUBE_MAP_POSITIVE_Y: -@@ -3438,19 +3439,21 @@ copyteximage(struct gl_context *ctx, GLuint dims, - _mesa_init_teximage_fields(ctx, texImage, width, height, 1, - border, internalFormat, texFormat); - -- /* Allocate texture memory (no pixel data yet) */ -- ctx->Driver.AllocTextureImageBuffer(ctx, texImage); -+ if (width && height) { -+ /* Allocate texture memory (no pixel data yet) */ -+ ctx->Driver.AllocTextureImageBuffer(ctx, texImage); - -- if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY, -- &width, &height)) { -- struct gl_renderbuffer *srcRb = -- get_copy_tex_image_source(ctx, texImage->TexFormat); -+ if (_mesa_clip_copytexsubimage(ctx, &dstX, &dstY, &srcX, &srcY, -+ &width, &height)) { -+ struct gl_renderbuffer *srcRb = -+ get_copy_tex_image_source(ctx, texImage->TexFormat); - -- ctx->Driver.CopyTexSubImage(ctx, dims, texImage, dstX, dstY, dstZ, -- srcRb, srcX, srcY, width, height); -- } -+ ctx->Driver.CopyTexSubImage(ctx, dims, texImage, dstX, dstY, dstZ, -+ srcRb, srcX, srcY, width, height); -+ } - -- check_gen_mipmap(ctx, target, texObj, level); -+ check_gen_mipmap(ctx, target, texObj, level); -+ } - - _mesa_update_fbo_texture(ctx, texObj, face, level); - -diff --git a/src/mesa/main/texparam.c b/src/mesa/main/texparam.c -index 6f18ec6..dd67baa 100644 ---- a/src/mesa/main/texparam.c -+++ b/src/mesa/main/texparam.c -@@ -1432,6 +1432,12 @@ _mesa_GetTexParameterfv( GLenum target, GLenum pname, GLfloat *params ) - *params = (GLfloat) obj->Immutable; - break; - -+ case GL_TEXTURE_IMMUTABLE_LEVELS: -+ if (!_mesa_is_gles3(ctx)) -+ goto invalid_pname; -+ *params = (GLfloat) obj->ImmutableLevels; -+ break; -+ - case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: - if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external) - goto invalid_pname; -@@ -1609,6 +1615,12 @@ _mesa_GetTexParameteriv( GLenum target, GLenum pname, GLint *params ) - *params = (GLint) obj->Immutable; - break; - -+ case GL_TEXTURE_IMMUTABLE_LEVELS: -+ if (!_mesa_is_gles3(ctx)) -+ goto invalid_pname; -+ *params = obj->ImmutableLevels; -+ break; -+ - case GL_REQUIRED_TEXTURE_IMAGE_UNITS_OES: - if (!_mesa_is_gles(ctx) || !ctx->Extensions.OES_EGL_image_external) - goto invalid_pname; -diff --git a/src/mesa/main/texstorage.c b/src/mesa/main/texstorage.c -index 00f19ba..675fd74 100644 ---- a/src/mesa/main/texstorage.c -+++ b/src/mesa/main/texstorage.c -@@ -397,6 +397,7 @@ texstorage(GLuint dims, GLenum target, GLsizei levels, GLenum internalformat, - } - - texObj->Immutable = GL_TRUE; -+ texObj->ImmutableLevels = levels; - } - } - -diff --git a/src/mesa/vbo/vbo_save_draw.c b/src/mesa/vbo/vbo_save_draw.c -index efb386e..f5b5c41 100644 ---- a/src/mesa/vbo/vbo_save_draw.c -+++ b/src/mesa/vbo/vbo_save_draw.c -@@ -253,7 +253,7 @@ vbo_save_playback_vertex_list(struct gl_context *ctx, void *data) - struct vbo_save_context *save = &vbo_context(ctx)->save; - GLboolean remap_vertex_store = GL_FALSE; - -- if (save->vertex_store->buffer) { -+ if (save->vertex_store && save->vertex_store->buffer) { - /* The vertex store is currently mapped but we're about to replay - * a display list. This can happen when a nested display list is - * being build with GL_COMPILE_AND_EXECUTE. diff --git a/mesa-9.2-llvmpipe-on-big-endian.patch b/mesa-9.2-llvmpipe-on-big-endian.patch index 1e5fe76..29619ff 100644 --- a/mesa-9.2-llvmpipe-on-big-endian.patch +++ b/mesa-9.2-llvmpipe-on-big-endian.patch @@ -1573,16 +1573,3 @@ index c9c6163..719acde 100644 { 0, 0, 0 } }; -diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c -index ff52aa1..1f8b941 100644 ---- a/src/mesa/state_tracker/st_manager.c -+++ b/src/mesa/state_tracker/st_manager.c -@@ -532,7 +532,7 @@ st_context_teximage(struct st_context_iface *stctxi, - internalFormat = GL_RGB; - - texFormat = st_ChooseTextureFormat(ctx, target, internalFormat, -- GL_BGRA, GL_UNSIGNED_BYTE); -+ GL_BGRA, GL_UNSIGNED_INT_8_8_8_8_REV); - - _mesa_init_teximage_fields(ctx, texImage, - tex->width0, tex->height0, 1, 0, diff --git a/mesa.spec b/mesa.spec index 8778af6..b7c4041 100644 --- a/mesa.spec +++ b/mesa.spec @@ -13,27 +13,39 @@ %define with_radeonsi 1 %endif +%ifarch %{arm} +%define with_freedreno 1 +%endif + # S390 doesn't have video cards, but we need swrast for xserver's GLX +# llvm (and thus llvmpipe) doesn't actually work on ppc32 or s390 + +%ifnarch s390 ppc +%define with_llvm 1 +%endif + %ifarch s390 s390x %define with_hardware 0 -%define dri_drivers --with-dri-drivers= +%ifarch s390 +%define base_drivers swrast +%endif %else %define with_hardware 1 %define base_drivers nouveau,radeon,r200 -%ifarch %{ix86} +%ifarch %{ix86} x86_64 %define platform_drivers ,i915,i965 %define with_vmware 1 %endif -%ifarch x86_64 -%define platform_drivers ,i915,i965 -%define with_vmware 1 +%ifarch ppc +%define platform_drivers ,swrast %endif -%define dri_drivers --with-dri-drivers=%{base_drivers}%{?platform_drivers} %endif +%define dri_drivers --with-dri-drivers=%{?base_drivers}%{?platform_drivers} + %define _default_patch_fuzz 2 -%define gitdate 20130508 +%define gitdate 20130514 #% define snapshot Summary: Mesa graphics libraries @@ -44,8 +56,6 @@ License: MIT Group: System Environment/Libraries URL: http://www.mesa3d.org -#Source0: http://www.mesa3d.org/beta/MesaLib-%{version}%{?snapshot}.tar.bz2 -#Source0: ftp://ftp.freedesktop.org/pub/%{name}/%{version}/MesaLib-%{version}.tar.bz2 # Source0: MesaLib-%{version}.tar.xz Source0: %{name}-%{gitdate}.tar.xz Source1: sanitize-tarball.sh @@ -57,18 +67,13 @@ Source3: make-git-snapshot.sh # Fedora opts to ignore the optional part of clause 2 and treat that code as 2 clause BSD. Source4: Mesa-MLAA-License-Clarification-Email.txt -# git diff-tree -p mesa-9.1..origin/9.1 > `git describe origin/9.1`.patch -Patch0: mesa-9.1.1-53-g3cff41c.patch - Patch1: nv50-fix-build.patch Patch9: mesa-8.0-llvmpipe-shmget.patch Patch12: mesa-8.0.1-fix-16bpp.patch -Patch14: i965-hack-hiz-snb-fix.patch Patch15: mesa-9.2-hardware-float.patch Patch16: mesa-9.2-no-useless-vdpau.patch -# this is suboptimal, or so dave says: -# http://lists.freedesktop.org/archives/mesa-dev/2013-May/039169.html -Patch17: 0001-mesa-Be-less-casual-about-texture-formats-in-st_fina.patch +# http://lists.freedesktop.org/archives/mesa-dev/2013-May/039265.html +Patch17: 0001-st-mesa-handle-texture_from_pixmap-and-other-surface.patch Patch18: mesa-9.2-llvmpipe-on-big-endian.patch BuildRequires: pkgconfig autoconf automake libtool @@ -132,17 +137,18 @@ Group: System Environment/Libraries %description libGLES Mesa GLES runtime libraries -%package dri-filesystem -Summary: Mesa DRI driver filesystem +%package filesystem +Summary: Mesa driver filesystem Group: User Interface/X Hardware Support -%description dri-filesystem -Mesa DRI driver filesystem +Provides: mesa-dri-filesystem = %{version}-%{release} +Obsoletes: mesa-dri-filesystem < %{version}-%{release} +%description filesystem +Mesa driver filesystem %package dri-drivers Summary: Mesa-based DRI drivers Group: User Interface/X Hardware Support -Requires: mesa-dri-filesystem%{?_isa} -Obsoletes: mesa-dri-drivers-experimental < 0:7.10-0.24 +Requires: mesa-filesystem%{?_isa} Obsoletes: mesa-dri-drivers-dri1 < 7.12 Obsoletes: mesa-dri-llvmcore <= 7.12 %description dri-drivers @@ -151,7 +157,7 @@ Mesa-based DRI drivers. %package vdpau-drivers Summary: Mesa-based DRI drivers Group: User Interface/X Hardware Support -Requires: mesa-dri-filesystem%{?_isa} +Requires: mesa-filesystem%{?_isa} %description vdpau-drivers Mesa-based VDPAU drivers. @@ -280,7 +286,6 @@ Mesa shared glapi #setup -q -n Mesa-%{version}%{?snapshot} %setup -q -n mesa-%{gitdate} grep -q ^/ src/gallium/auxiliary/vl/vl_decoder.c && exit 1 -#patch0 -p1 -b .git %patch1 -p1 -b .nv50rtti # this fastpath is: @@ -294,9 +299,6 @@ grep -q ^/ src/gallium/auxiliary/vl/vl_decoder.c && exit 1 #patch9 -p1 -b .shmget #patch12 -p1 -b .16bpp -# hack from chromium - awaiting real upstream fix -%patch14 -p1 -b .snbfix - %patch15 -p1 -b .hwfloat %patch16 -p1 -b .vdpau %patch17 -p1 -b .tfp @@ -329,12 +331,12 @@ export CFLAGS="$RPM_OPT_FLAGS" export CXXFLAGS="$RPM_OPT_FLAGS -fno-rtti -fno-exceptions" %ifarch %{ix86} # i do not have words for how much the assembly dispatch code infuriates me -%define common_flags --enable-selinux --enable-pic --disable-asm -%else -%define common_flags --enable-selinux --enable-pic +%define asm_flags --disable-asm %endif -%configure %{common_flags} \ +%configure \ + %{?asm_flags} \ + --enable-selinux \ --enable-osmesa \ --with-dri-driverdir=%{_libdir}/dri \ --enable-egl \ @@ -349,14 +351,14 @@ export CXXFLAGS="$RPM_OPT_FLAGS -fno-rtti -fno-exceptions" --disable-opencl \ --enable-glx-tls \ --enable-texture-float=hardware \ - --enable-gallium-llvm \ - --with-llvm-shared-libs \ + %{?with_llvm:--enable-gallium-llvm} \ + %{?with_llvm:--with-llvm-shared-libs} \ --enable-dri \ %if %{with_hardware} %{?with_vmware:--enable-xa} \ - --with-gallium-drivers=%{?with_vmware:svga,}r300,r600,%{?with_radeonsi:radeonsi,}nouveau,swrast \ + --with-gallium-drivers=%{?with_vmware:svga,}%{?with_radeonsi:radeonsi,}%{?with_llvm:swrast,}%{?with_freedreno:freedreno,}r300,r600,nouveau \ %else - --with-gallium-drivers=swrast \ + --with-gallium-drivers=%{?with_llvm:swrast} \ %endif %{?dri_drivers} @@ -372,6 +374,9 @@ make install DESTDIR=$RPM_BUILD_ROOT rm -f $RPM_BUILD_ROOT%{_libdir}/dri/{radeon,r200,nouveau_vieux}_dri.* %endif +# libvdpau opens the versioned name, don't bother including the unversioned +rm -f $RPM_BUILD_ROOT%{_libdir}/vdpau/*.so + # strip out useless headers rm -f $RPM_BUILD_ROOT%{_includedir}/GL/w*.h @@ -429,7 +434,7 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/libGLESv2.so.2 %{_libdir}/libGLESv2.so.2.* -%files dri-filesystem +%files filesystem %defattr(-,root,root,-) %doc docs/COPYING docs/Mesa-MLAA-License-Clarification-Email.txt %dir %{_libdir}/dri @@ -457,6 +462,9 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/dri/i915_dri.so %{_libdir}/dri/i965_dri.so %endif +%if 0%{?with_freedreno} +%{_libdir}/dri/freedreno_dri.so +%endif %{_libdir}/dri/nouveau_dri.so %if 0%{?with_vmware} %{_libdir}/dri/vmwgfx_dri.so @@ -468,10 +476,11 @@ rm -rf $RPM_BUILD_ROOT %{_libdir}/dri/swrast_dri.so %if %{with_hardware} -# should be explicit here but meh %files vdpau-drivers %defattr(-,root,root,-) -%{_libdir}/vdpau/*.so* +%{_libdir}/vdpau/libvdpau_nouveau.so.1* +%{_libdir}/vdpau/libvdpau_r600.so.1* +%{_libdir}/vdpau/libvdpau_radeonsi.so.1* %endif %files -n khrplatform-devel @@ -575,6 +584,13 @@ rm -rf $RPM_BUILD_ROOT %endif %changelog +* Tue May 14 2013 Adam Jackson 9.2-0.1.20130514 +- Today's git snap +- Revert to swrast on ppc32 and s390 since llvm doesn't actually work +- Build freedreno on arm +- Drop snb hang workaround (upstream 1dfea559) +- Rename filesystem package + * Wed May 08 2013 Adam Jackson 9.2-0.1.20130508 - Switch to Mesa master (pre 9.2) - Fix llvmpipe on big-endian and enable llvmpipe everywhere @@ -739,340 +755,3 @@ rm -rf $RPM_BUILD_ROOT * Tue Apr 24 2012 Richard Hughes 8.0.3-0.1 - Rebuild with new git snapshot - Remove upstreamed patches - -* Tue Apr 24 2012 Karsten Hopp 8.0.2-4 -- disable llvm on PPC(64) in Fedora as recommended in bugzilla 769803 - -* Tue Apr 10 2012 Adam Jackson 8.0.2-3 -- Require newer libX11 on F17+ - -* Mon Apr 02 2012 Adam Jackson 8.0.2-2 -- mesa-8.0.1-fix-16bpp.patch: Fix 16bpp in llvmpipe - -* Sat Mar 31 2012 Dave Airlie 8.0.2-1 -- get latest 8.0.2 set of fixes - -* Wed Mar 28 2012 Adam Jackson 8.0.1-9 -- Subpackage libglapi instead of abusing -dri-drivers for it to keep minimal - disk space minimal. (#807750) - -* Wed Mar 28 2012 Adam Jackson 8.0.1-8 -- mesa-8.0.1-llvmpipe-shmget.patch: Fix image pitch bug. - -* Fri Mar 23 2012 Adam Jackson 8.0.1-7 -- mesa-8.0-nouveau-tfp-blacklist.patch: gnome-shell blacklisting: nvfx and - below with <= 64M of vram, and all nv30. - -* Wed Mar 21 2012 Adam Jackson 8.0.1-6 -- mesa-8.0.1-llvmpipe-shmget.patch: Use ShmGetImage if possible - -* Mon Mar 19 2012 Adam Jackson 8.0.1-5 -- Move libglapi into -dri-drivers instead of -libGLES as being marginally - more appropriate (libGL wants to have DRI drivers, but doesn't need to - have a full libGLES too). - -* Thu Mar 15 2012 Dave Airlie 8.0.1-4 -- enable vmwgfx + xa state tracker - -* Thu Mar 01 2012 Adam Jackson 8.0.1-3 -- mesa-8.0.1-git.patch: Sync with 8.0 branch (commit a3080987) - -* Sat Feb 18 2012 Thorsten Leemhuis 8.0.1-2 -- a few changes for weston, the wayland reference compositor (#790542): -- enable gbm and shared-glapi in configure command (the latter is required by - the former) and add subpackages libgbm and libgbm-devel -- add --with-egl-platforms=x11,wayland,drm to configure command and add - subpackages libwayland-egl and libwayland-egl-devel - -* Fri Feb 17 2012 Adam Jackson 8.0.1-1 -- Mesa 8.0.1 - -* Mon Feb 13 2012 Adam Jackson 8.0-1 -- Mesa 8.0 - -* Mon Feb 13 2012 Adam Jackson 8.0-0.2 -- Default to DRI libGL on all arches (#789402) - -* Thu Jan 26 2012 Dave Airlie 8.0-0.1 -- initial 8.0 snapshot - -* Thu Jan 05 2012 Adam Jackson 7.12-0.7 -- Today's git snapshot - -* Wed Dec 14 2011 Adam Jackson 7.12-0.6 -- Today's git snapshot -- Disable hardware drivers on ppc* in RHEL - -* Fri Dec 02 2011 Dan Horák 7.12-0.5 -- fix build on s390(x) - -* Tue Nov 29 2011 Adam Jackson 7.12-0.4 -- Today's git snapshot -- --enable-xcb -- mesa-7.1-nukeglthread-debug.patch: Drop - -* Thu Nov 17 2011 Adam Jackson 7.12-0.3 -- mesa-dri-drivers Obsoletes: mesa-dri-drivers-dri1 < 7.12 - -* Wed Nov 16 2011 Adam Jackson 7.12-0.2 -- Cleanups to BuildRequires, Requires, Conflicts, etc. - -* Mon Nov 14 2011 Dave Airlie 7.12-0.1 -- rebase to upstream snapshot of 7.12 - -* Mon Nov 14 2011 Adam Jackson 7.11-12 -- Rebuild for new libllvm soname - -* Wed Nov 09 2011 Adam Jackson 7.11-11 -- Obsolete more -llvmcore (#752152) - -* Thu Nov 03 2011 Dave Airlie 7.11-10 -- snapshot latest mesa 7.11 stable branch (what will be 7.11.1) - -* Thu Nov 03 2011 Adam Jackson 7.11-9 -- mesa-7.11-fix-sw-24bpp.patch: Fix software rendering in 24bpp. - -* Fri Oct 28 2011 Adam Jackson 7.11-8 -- mesa-7.11-intel-swap-event.patch: Disable GLX_INTEL_swap_event by default; - DRI2 enables it explicitly, but swrast doesn't and oughtn't. (#748747) - -* Mon Oct 24 2011 Adam Jackson 7.11-6 -- 0001-nv50-fix-max-texture-levels.patch: Fix maximum texture size on - nouveau (and thus, gnome-shell init on wide display setups) (#748540) - -* Mon Oct 24 2011 Adam Jackson 7.11-5 -- mesa-7.11-drisw-glx13.patch: Fix GLX 1.3 ctors with swrast (#747276) - -* Fri Sep 09 2011 Adam Jackson 7.11-4 -- mesa-7.11-generic-wmb.patch: Add generic write memory barrier macro for - non-PC arches. - -* Thu Sep 08 2011 Adam Jackson 7.11-3 -- Add khrplatform-devel subpackage so {EGL,GLES}-devel are usable - -* Wed Aug 3 2011 Michel Salim - 7.11-2 -- Rebuild against final LLVM 2.9 release - -* Tue Aug 02 2011 Adam Jackson 7.11-1 -- Mesa 7.11 -- Redo the driver arch exclusion, yet again. Dear secondary arches: unless - it's an on-motherboard driver like i915, all PCI drivers are to be built - for all PCI arches. - -* Sat Jul 30 2011 Dave Airlie 7.11-0.18.20110730.0 -- rebase to latest upstream snapshot (same as F15) - -* Thu Jul 07 2011 Peter Lemenkov - 7.11-0.16.20110620.0 -- Fix building on ppc (some dri1 drivers are missing) - -* Wed Jul 6 2011 Ville Skyttä - 7.11-0.15.20110620.0 -- More include dir ownership fixes (#682357). - -* Tue Jul 05 2011 Adam Jackson 7.11-0.14.20110620.0 -- Arch-dep and file ownership fixes (#682357) - -* Mon Jun 20 2011 Dave Airlie 7.11-0.13.20110620.0 -- rebase to 20 June snapshot from upstream - new gallium config options - -* Mon Jun 20 2011 Dave Airlie 7.11-0.12.20110412.0 -- dropping DRI1 is premature, fix swrastg upstream first. - -* Tue May 10 2011 Dan Horák 7.11-0.11.20110412.0 -- r300 needs to be explicitely disabled when with_hardware == 0 - -* Mon May 09 2011 Adam Jackson 7.11-0.10.20110412.0 -- Drop the separate build pass for osmesa, no longer needed. - -* Mon May 09 2011 Adam Jackson 7.11-0.9.20110412.0 -- Drop dri1 subpackage (and its drivers), use "swrastg" consistently. - -* Mon May 09 2011 Adam Jackson 7.11-0.8.20110412.0 -- Use llvm-libs' shared lib instead of rolling our own. - -* Mon Apr 18 2011 Adam Jackson 7.11-0.7.20110412.0 -- Fix intel driver exclusion to be better arched (#697555) - -* Tue Apr 12 2011 Dave Airlie 7.11-0.6.20110412.0 -- latest upstream snapshot to fix r200 regression. - -* Fri Apr 01 2011 Dave Airlie 7.11-0.5.20110401.0 -- Revert upstream patches causing SNB regression. - -* Fri Apr 01 2011 Dave Airlie 7.11-0.4.20110401.0 -- upstream snapshot again - proper fix for ILK + nv50 gnome-shell issue - -* Wed Mar 30 2011 Dave Airlie 7.11-0.3.20110330.0 -- mesa-intel-fix-gs-rendering-regression.patch, attempt to fix gnome shell - rendering. - -* Wed Mar 30 2011 Dave Airlie 7.11-0.2.20110330.0 -- snapshot upstream again to hopefully fix ILK bug - -* Sun Mar 27 2011 Dave Airlie 7.11-0.1.20110327.0 -- pull latest snapshot + 3 post snapshot fixes - -* Wed Mar 23 2011 Adam Jackson 7.10.1-1 -- mesa 7.10.1 - -* Fri Mar 18 2011 Dennis Gilmore 7.10-0.30 -- fall back to non native jit on sparc. - -* Mon Mar 14 2011 Dave Airlie 7.10-0.29 -- use g++ to link llvmcore.so so it gets libstdc++ (#674079) - -* Fri Mar 04 2011 Dan Horák 7.10-0.28 -- enable gallium-llvm only when with_hardware is set (workarounds linking - failure on s390(x)) - -* Wed Feb 23 2011 Jerome Glisse 7.10-0.27 -- Build without -fno-omit-frame-pointer as gcc 4.6.0 seems to lead to - bogus code with that option (#679924) - -* Wed Feb 09 2011 Adam Jackson 7.10-0.26 -- BuildRequires: libdrm >= 2.4.24-0 (#668363) - -* Tue Feb 08 2011 Fedora Release Engineering - 7.10-0.25 -- Rebuilt for https://fedoraproject.org/wiki/Fedora_15_Mass_Rebuild - -* Thu Jan 20 2011 Ben Skeggs 7.10-0.24 -- nouveau: move out of -experimental - -* Thu Jan 20 2011 Ben Skeggs 7.10-0.23 -- nouveau: nvc0 (fermi) backport + nv10/nv20 gnome-shell fixes - -* Tue Jan 18 2011 Adam Jackson 7.10-0.22 -- Add -dri-filesystem common subpackage for directory and COPYING -- Add -dri-llvmcore subpackage and buildsystem hack - -* Tue Jan 18 2011 Adam Jackson 7.10-0.21 -- Fix the s390 case a different way -- s/i686/%%{ix86} -- Add libudev support for wayland (Casey Dahlin) - -* Tue Jan 18 2011 Dan Horák 7.10-0.20 -- updated for s390(x), r300 is really built even when with_hardware == 0 - -* Tue Jan 18 2011 Dave Airlie 7.10-0.19 -- split out DRI1 drivers to reduce package size. - -* Fri Jan 07 2011 Dave Airlie 7.10-0.18 -- new snapshot from 7.10 branch (include Radeon HD6xxx support) - -* Thu Dec 16 2010 Dave Airlie 7.10-0.17 -- new snapshot from 7.10 branch - -* Wed Dec 15 2010 Adam Jackson 7.10-0.16 -- Today's (yesterday's) git snap. -- Switch the sourceball to xz. - -* Mon Dec 06 2010 Adam Jackson 7.10-0.15 -- Really disable gallium EGL. Requires disabling OpenVG due to buildsystem - nonsense. Someone fix that someday. (Patch from krh) - -* Thu Dec 02 2010 Adam Jackson 7.10-0.14 -- --disable-gallium-egl - -* Wed Dec 01 2010 Dan Horák 7.10-0.13 -- workaround failing build on s390(x) - -* Mon Nov 29 2010 Adam Jackson 7.10-0.12 -- Today's git snap. - -* Thu Nov 18 2010 Adam Jackson 7.10-0.11 -- Today's git snap. -- Build with -fno-omit-frame-pointer for profiling. -- Install swrastg as the swrast driver. -- legacy-drivers.patch: Disable swrast classic. - -* Mon Nov 15 2010 Adam Jackson -- Drop Requires: mesa-dri-drivers from -experimental, not needed in a non- - dricore build. -- Drop Requires: mesa-dri-drivers from -libGL, let comps do that. - -* Thu Nov 11 2010 Adam Jackson 7.10-0.10 -- Build libOpenVG too -- Add X driver ABI magic for vmwgfx -- Linker script hack for swrastg to make it slightly less offensively huge - -* Mon Nov 08 2010 Dave Airlie 7.10-0.9 -- update to latest git snap + enable r600g by default - -* Sat Nov 06 2010 Dave Airlie 7.10-0.8 -- enable EGL/GLES - -* Wed Nov 03 2010 Dave Airlie 7.10-0.7 -- fix r300g selection - -* Tue Nov 02 2010 Adam Jackson 7.10-0.6 -- Use standard CFLAGS -- Move swrastg_dri to -experimental - -* Mon Nov 01 2010 Adam Jackson 7.10-0.5 -- BR: llvm-static not llvm-devel (#627965) - -* Thu Oct 28 2010 Adam Jackson 7.10-0.4 -- -dri-drivers-experimental Requires dri-drivers (#556789) - -* Thu Oct 28 2010 Adam Jackson 7.10-0.3 -- Drop demos and glx-utils subpackages, they have their own source package - now. (#605719) - -* Wed Oct 20 2010 Adam Jackson 7.10-0.2 -- git snapshot, fixes osmesa linking issues - -* Wed Oct 20 2010 Adam Jackson 7.10-0.1 -- git snapshot -- Drop osmesa16 and osmesa32, nothing's using them - -* Tue Aug 24 2010 Dave Airlie 7.9-0.7 -- latest git snapshot - enable talloc/llvm links - -* Tue Jul 20 2010 Dave Airlie 7.9-0.6 -- snapshot latest git - -* Fri Jul 09 2010 Dave Airlie 7.9-0.5 -- resnapshot latest git - -* Thu Jul 08 2010 Adam Jackson 7.9-0.4 -- Install COPYING like we ought to. - -* Thu Jun 24 2010 Dan Horák 7.9-0.3 -- add libtool (needed by mesa-demos) to BR: - normally it's brought via - xorg-x11-util-macros and xorg-x11-server-devel, but not on platforms - without hardware drivers -- build gallium drivers and the dri-drivers-experimental subpackage only - when hardware drivers are requested - -* Sat Jun 12 2010 Dave Airlie 7.9-0.2 -- rebase to git snapshot with TFP fixes for r300 + gallium - enable r300g - -* Sun May 30 2010 Dave Airlie 7.9-0.1 -- rebase to a git snapshot - disable vmwgfx - -* Mon Feb 08 2010 Ben Skeggs 7.8-0.16 -- patch mesa to enable legacy nouveau driver build on i386 - -* Mon Feb 08 2010 Ben Skeggs 7.8-0.15 -- rebase for legacy nouveau drivers - -* Thu Feb 04 2010 Dave Airlie 7.8-0.14 -- rebase again to fix r300 - -* Wed Feb 03 2010 Dave Airlie 7.8-0.13 -- update dri2proto requirement -- add nouveau to experimental drivers set - -* Wed Jan 27 2010 Dave Airlie 7.8-0.12 -- Fix radeon colors for rawhide - -* Thu Jan 21 2010 Dave Airlie 7.8-0.11 -- rebase for new DRI2 API - -* Fri Jan 08 2010 Dave Airlie 7.8-0.10 -- rebase to new snapshot with fix for radeon in it - -* Thu Jan 07 2010 Dave Airlie 7.8-0.9 -- Disable dricore for now as it conflicts with upstream vis changes - -* Wed Jan 06 2010 Dave Airlie 7.8-0.8 -- update to latest snapshot and fixup build diff --git a/sanitize-tarball.sh b/sanitize-tarball.sh index 77b6aef..ba472ab 100755 --- a/sanitize-tarball.sh +++ b/sanitize-tarball.sh @@ -2,6 +2,12 @@ # # usage: sanitize-tarball.sh [tarball] +if [ -e /usr/bin/pxz ]; then + XZ=/usr/bin/pxz +else + XZ=/usr/bin/xz +fi + dirname=$(basename $(basename "$1" .tar.bz2) .tar.xz) tar xf "$1" @@ -42,4 +48,4 @@ vl_create_decoder(struct pipe_context *pipe, EOF popd -tar Jcf $dirname.tar.xz $dirname +tar cf - $dirname | $XZ > $dirname.tar.xz diff --git a/sources b/sources index cd9670a..8709929 100644 --- a/sources +++ b/sources @@ -1 +1,2 @@ 50ffa2d23bc11686e29e836013ef917f mesa-20130508.tar.xz +70be608749ee12f3b0dda176f7de8fd2 mesa-20130514.tar.xz