[Date Prev][Date Next] [Thread Prev][Thread Next] [Date Index] [Thread Index]

mesa: Changes to 'ubuntu'



 bin/mklib                                                           |   42 +-
 debian/changelog                                                    |   10 
 debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff |   91 -----
 debian/patches/series                                               |    1 
 src/gallium/auxiliary/tgsi/tgsi_scan.c                              |    1 
 src/gallium/auxiliary/util/u_format_yuv.c                           |    1 
 src/gallium/auxiliary/util/u_inlines.h                              |    4 
 src/gallium/auxiliary/util/u_math.h                                 |    1 
 src/gallium/drivers/r600/evergreen_state.c                          |    2 
 src/gallium/drivers/radeon/AMDGPU.h                                 |    1 
 src/gallium/drivers/radeon/AMDGPUAsmPrinter.cpp                     |    8 
 src/gallium/drivers/radeon/AMDGPUTargetMachine.cpp                  |    2 
 src/gallium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp         |   39 +-
 src/gallium/drivers/radeon/Makefile.sources                         |    1 
 src/gallium/drivers/radeon/R600Instructions.td                      |    8 
 src/gallium/drivers/radeon/SIGenRegisterInfo.pl                     |    1 
 src/gallium/drivers/radeon/SIISelLowering.h                         |    2 
 src/gallium/drivers/radeon/SIInstrInfo.td                           |   10 
 src/gallium/drivers/radeon/SIInstructions.td                        |   35 --
 src/gallium/drivers/radeon/SILowerLiteralConstants.cpp              |  105 ------
 src/gallium/drivers/radeonsi/radeonsi_pipe.c                        |    4 
 src/gallium/drivers/radeonsi/radeonsi_shader.c                      |    8 
 src/gallium/drivers/radeonsi/si_state.c                             |    4 
 src/gallium/state_trackers/dri/common/dri_context.c                 |    6 
 src/gallium/state_trackers/dri/common/dri_screen.c                  |   10 
 src/gallium/state_trackers/glx/xlib/glx_usefont.c                   |    4 
 src/gallium/state_trackers/glx/xlib/xm_api.c                        |   10 
 src/gallium/state_trackers/glx/xlib/xm_st.c                         |    8 
 src/gallium/state_trackers/vega/handle.h                            |    1 
 src/glsl/glcpp/Makefile.am                                          |    2 
 src/glsl/glcpp/glcpp-parse.y                                        |    8 
 src/glsl/glcpp/glcpp.c                                              |    2 
 src/glsl/glcpp/glcpp.h                                              |    2 
 src/glsl/glcpp/pp.c                                                 |    2 
 src/glsl/glcpp/tests/086-reserved-macro-names.c                     |    1 
 src/glsl/glcpp/tests/086-reserved-macro-names.c.expected            |    5 
 src/glsl/glsl_parser_extras.h                                       |    2 
 src/glsl/main.cpp                                                   |    2 
 src/glsl/test_optpass.cpp                                           |    2 
 src/mesa/Makefile.am                                                |    2 
 src/mesa/drivers/dri/common/drisw_util.c                            |   12 
 src/mesa/drivers/dri/common/xmlconfig.c                             |   28 -
 src/mesa/drivers/dri/i915/i830_context.c                            |    2 
 src/mesa/drivers/dri/i915/i915_context.c                            |    6 
 src/mesa/drivers/dri/i965/brw_context.c                             |    2 
 src/mesa/drivers/dri/i965/brw_state_cache.c                         |    2 
 src/mesa/drivers/dri/i965/brw_wm_sampler_state.c                    |    5 
 src/mesa/drivers/dri/i965/brw_wm_surface_state.c                    |    2 
 src/mesa/drivers/dri/intel/intel_fbo.c                              |    2 
 src/mesa/drivers/dri/intel/intel_screen.c                           |   26 -
 src/mesa/drivers/dri/nouveau/nouveau_bufferobj.c                    |    8 
 src/mesa/drivers/dri/nouveau/nouveau_fbo.c                          |    2 
 src/mesa/drivers/dri/nouveau/nouveau_screen.c                       |    2 
 src/mesa/drivers/dri/nouveau/nv04_context.c                         |    2 
 src/mesa/drivers/dri/nouveau/nv10_context.c                         |    2 
 src/mesa/drivers/dri/nouveau/nv20_context.c                         |    2 
 src/mesa/drivers/dri/r200/r200_context.c                            |    4 
 src/mesa/drivers/dri/r200/r200_state_init.c                         |    4 
 src/mesa/drivers/dri/radeon/radeon_common_context.c                 |    6 
 src/mesa/drivers/dri/radeon/radeon_context.c                        |    4 
 src/mesa/drivers/dri/radeon/radeon_dma.c                            |   14 
 src/mesa/drivers/dri/radeon/radeon_fbo.c                            |    2 
 src/mesa/drivers/dri/radeon/radeon_queryobj.h                       |    2 
 src/mesa/drivers/dri/radeon/radeon_screen.c                         |   18 -
 src/mesa/drivers/dri/radeon/radeon_state_init.c                     |    4 
 src/mesa/drivers/dri/radeon/radeon_texture.c                        |    2 
 src/mesa/drivers/dri/swrast/swrast.c                                |    6 
 src/mesa/drivers/x11/xfonts.c                                       |    4 
 src/mesa/drivers/x11/xm_api.c                                       |    4 
 src/mesa/drivers/x11/xm_buffer.c                                    |    2 
 src/mesa/main/api_arrayelt.c                                        |    4 
 src/mesa/main/attrib.c                                              |   10 
 src/mesa/main/errors.c                                              |    6 
 src/mesa/main/eval.c                                                |   60 +--
 src/mesa/main/imports.h                                             |  175 +++++++---
 src/mesa/main/macros.h                                              |   32 -
 src/mesa/main/matrix.c                                              |    4 
 src/mesa/main/renderbuffer.c                                        |    6 
 src/mesa/main/samplerobj.c                                          |    2 
 src/mesa/main/teximage.c                                            |    2 
 src/mesa/program/ir_to_mesa.cpp                                     |    2 
 src/mesa/program/nvfragparse.c                                      |    4 
 src/mesa/program/nvvertparse.c                                      |    2 
 src/mesa/program/program_lexer.l                                    |    1 
 src/mesa/state_tracker/st_cb_fbo.c                                  |    2 
 src/mesa/state_tracker/st_cb_syncobj.c                              |    2 
 src/mesa/state_tracker/st_glsl_to_tgsi.cpp                          |   16 
 src/mesa/state_tracker/st_manager.c                                 |    2 
 src/mesa/state_tracker/st_mesa_to_tgsi.c                            |    8 
 src/mesa/state_tracker/st_program.c                                 |   12 
 src/mesa/swrast/s_context.c                                         |   14 
 src/mesa/swrast/s_renderbuffer.c                                    |    2 
 src/mesa/swrast/s_texcombine.c                                      |    2 
 src/mesa/swrast/s_zoom.c                                            |    2 
 src/mesa/swrast_setup/ss_context.c                                  |    4 
 src/mesa/tnl/t_context.c                                            |    4 
 src/mesa/tnl/t_vb_fog.c                                             |    4 
 src/mesa/tnl/t_vb_light.c                                           |    4 
 src/mesa/tnl/t_vb_program.c                                         |    4 
 src/mesa/tnl/t_vb_texgen.c                                          |   12 
 src/mesa/tnl/t_vb_texmat.c                                          |    4 
 src/mesa/tnl/t_vb_vertex.c                                          |    4 
 src/mesa/tnl/t_vertex.c                                             |    4 
 src/mesa/vbo/vbo_context.c                                          |    2 
 src/mesa/vbo/vbo_save.c                                             |    4 
 src/mesa/vbo/vbo_save_api.c                                         |    8 
 106 files changed, 448 insertions(+), 613 deletions(-)

New commits:
commit 1d6ef2e36f526e65a77cea59ed8ff42aa84d383e
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Mon Sep 17 13:24:57 2012 +0300

    release to quantal

diff --git a/debian/changelog b/debian/changelog
index bf1137f..fd83836 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,8 @@
-mesa (9.0~git20120917.7cfd42ce-0ubuntu1) UNRELEASED; urgency=low
+mesa (9.0~git20120917.7cfd42ce-0ubuntu1) quantal; urgency=low
 
   * Merge from unreleased debian git. (LP: #1047306)
 
- -- Timo Aaltonen <tjaalton@ubuntu.com>  Thu, 13 Sep 2012 20:25:01 +0300
+ -- Timo Aaltonen <tjaalton@ubuntu.com>  Mon, 17 Sep 2012 13:24:35 +0300
 
 mesa (9.0~git20120903.e1673d20-0ubuntu1) quantal; urgency=low
 

commit 5dd4b9f0b4629109434bcce81182603ca9a52656
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Mon Sep 17 10:34:43 2012 +0300

    drop the revert, the upstream 9.0 branch doesn't have the commit and we're now in sync with it

diff --git a/debian/changelog b/debian/changelog
index 89803bb..bf1137f 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,8 +1,6 @@
 mesa (9.0~git20120917.7cfd42ce-0ubuntu1) UNRELEASED; urgency=low
 
-  * Merge from unreleased debian git.
-  * revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
-    Revert an upstream commit in order to fix i915_dri. (LP: #1047306)
+  * Merge from unreleased debian git. (LP: #1047306)
 
  -- Timo Aaltonen <tjaalton@ubuntu.com>  Thu, 13 Sep 2012 20:25:01 +0300
 
diff --git a/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff b/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
deleted file mode 100644
index 559e53a..0000000
--- a/debian/patches/revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff
+++ /dev/null
@@ -1,91 +0,0 @@
-commit b156d8c4bf28fcbf469bb71b78fdb45887cb2dad
-Author: Timo Aaltonen <tjaalton@ubuntu.com>
-Date:   Thu Sep 13 20:23:51 2012 +0300
-
-    Revert "mesa: move IS_NEGATIVE() and DIFFERENT_SIGNS() to macros.h"
-    
-    This reverts commit c8a86f717f8e30204c615d06bcec159410ac06c5.
-
-diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
-index 2f854e5..bb42094 100644
---- a/src/mesa/main/imports.h
-+++ b/src/mesa/main/imports.h
-@@ -223,6 +223,35 @@ static inline int IS_INF_OR_NAN( float x )
- 
- 
- /***
-+ *** IS_NEGATIVE: test if float is negative
-+ ***/
-+#if defined(USE_IEEE)
-+static inline int GET_FLOAT_BITS( float x )
-+{
-+   fi_type fi;
-+   fi.f = x;
-+   return fi.i;
-+}
-+#define IS_NEGATIVE(x) (GET_FLOAT_BITS(x) < 0)
-+#else
-+#define IS_NEGATIVE(x) (x < 0.0F)
-+#endif
-+
-+
-+/***
-+ *** DIFFERENT_SIGNS: test if two floats have opposite signs
-+ ***/
-+#if defined(USE_IEEE)
-+#define DIFFERENT_SIGNS(x,y) ((GET_FLOAT_BITS(x) ^ GET_FLOAT_BITS(y)) & (1<<31))
-+#else
-+/* Could just use (x*y<0) except for the flatshading requirements.
-+ * Maybe there's a better way?
-+ */
-+#define DIFFERENT_SIGNS(x,y) ((x) * (y) <= 0.0F && (x) - (y) != 0.0F)
-+#endif
-+
-+
-+/***
-  *** CEILF: ceiling of float
-  *** FLOORF: floor of float
-  *** FABSF: absolute value of float
-diff --git a/src/mesa/main/macros.h b/src/mesa/main/macros.h
-index 7d0a375..5af9487 100644
---- a/src/mesa/main/macros.h
-+++ b/src/mesa/main/macros.h
-@@ -689,38 +689,6 @@ NORMALIZE_3FV(GLfloat v[3])
- }
- 
- 
--/** Is float value negative? */
--static inline GLboolean
--IS_NEGATIVE(float x)
--{
--#if defined(USE_IEEE)
--   fi_type fi;
--   fi.f = x;
--   return fi.i < 0;
--#else
--   return x < 0.0F;
--#endif
--}
--
--
--/** Test two floats have opposite signs */
--static inline GLboolean
--DIFFERENT_SIGNS(GLfloat x, GLfloat y)
--{
--#if defined(USE_IEEE)
--   fi_type xfi, yfi;
--   xfi.f = x;
--   yfi.f = y;
--   return (xfi.i ^ yfi.i) & (1u << 31);
--#else
--   /* Could just use (x*y<0) except for the flatshading requirements.
--    * Maybe there's a better way?
--    */
--   return ((x) * (y) <= 0.0F && (x) - (y) != 0.0F);
--#endif
--}
--
--
- /** Compute ceiling of integer quotient of A divided by B. */
- #define CEILING( A, B )  ( (A) % (B) == 0 ? (A)/(B) : (A)/(B)+1 )
- 
diff --git a/debian/patches/series b/debian/patches/series
index a142b7a..1d3510c 100644
--- a/debian/patches/series
+++ b/debian/patches/series
@@ -13,4 +13,3 @@
 100_no_abi_tag.patch
 101_ubuntu_hidden_glname.patch
 #117-static-gallium.patch
-revert-c8a86f717f8e30204c615d06bcec159410ac06c5.diff

commit 9fd4fbe8e1e403434a4226cf7ce95d16e7965525
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Mon Sep 17 09:51:12 2012 +0300

    revert local changes to upstream source

diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c b/src/glsl/glcpp/tests/086-reserved-macro-names.c
index fd0c29f..a6b7201 100644
--- a/src/glsl/glcpp/tests/086-reserved-macro-names.c
+++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c
@@ -1,2 +1,3 @@
 #define __BAD reserved
 #define GL_ALSO_BAD() also reserved
+#define THIS__TOO__IS__BAD reserved
diff --git a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
index 6a9df68..d8aa9f0 100644
--- a/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
+++ b/src/glsl/glcpp/tests/086-reserved-macro-names.c.expected
@@ -1,7 +1,10 @@
-0:1(10): preprocessor error: Macro names starting with "__" are reserved.
+0:1(10): preprocessor error: Macro names containing "__" are reserved.
 
 0:2(9): preprocessor error: Macro names starting with "GL_" are reserved.
 
+0:3(9): preprocessor error: Macro names containing "__" are reserved.
+
+
 
 
 

commit d9c10efc0b2f61e08b1d580f5dc28a844320a547
Author: Timo Aaltonen <tjaalton@ubuntu.com>
Date:   Mon Sep 17 09:47:13 2012 +0300

    bump the version

diff --git a/debian/changelog b/debian/changelog
index a383f65..6befa47 100644
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,4 +1,4 @@
-mesa (9.0~git20120914.c586fce4-1) UNRELEASED; urgency=low
+mesa (9.0~git20120917.7cfd42ce-1) UNRELEASED; urgency=low
 
   [ Julien Cristau ]
   * Use xz for all binary packages not just *-dbg.

commit 7cfd42cefe1949af51ecced9891f415eca2c0e66
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Sep 14 10:13:01 2012 +1000

    mesa/glsl: rename preprocess to glcpp_preprocess
    
    This symbol with dricore escapes into the namespace, its too generic,
    we should prefix it with something just to be nice.
    
    Should be applied to stable + 9.0
    
    Acked-by: Kenneth Graunke <kenneth@whitecape.org>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 88b0790b1ae8864d4ec6196b3939498bbffdbb5f)

diff --git a/src/glsl/glcpp/glcpp.c b/src/glsl/glcpp/glcpp.c
index e461a65..35db470 100644
--- a/src/glsl/glcpp/glcpp.c
+++ b/src/glsl/glcpp/glcpp.c
@@ -111,7 +111,7 @@ main (int argc, char *argv[])
 	if (shader == NULL)
 	   return 1;
 
-	ret = preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
+	ret = glcpp_preprocess(ctx, &shader, &info_log, NULL, API_OPENGL);
 
 	printf("%s", shader);
 	fprintf(stderr, "%s", info_log);
diff --git a/src/glsl/glcpp/glcpp.h b/src/glsl/glcpp/glcpp.h
index a13ade6..a459289 100644
--- a/src/glsl/glcpp/glcpp.h
+++ b/src/glsl/glcpp/glcpp.h
@@ -196,7 +196,7 @@ void
 glcpp_parser_destroy (glcpp_parser_t *parser);
 
 int
-preprocess(void *ralloc_ctx, const char **shader, char **info_log,
+glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log,
 	   const struct gl_extensions *extensions, int api);
 
 /* Functions for writing to the info log */
diff --git a/src/glsl/glcpp/pp.c b/src/glsl/glcpp/pp.c
index 9170d14..11b2941 100644
--- a/src/glsl/glcpp/pp.c
+++ b/src/glsl/glcpp/pp.c
@@ -150,7 +150,7 @@ remove_line_continuations(glcpp_parser_t *ctx, const char *shader)
 }
 
 int
-preprocess(void *ralloc_ctx, const char **shader, char **info_log,
+glcpp_preprocess(void *ralloc_ctx, const char **shader, char **info_log,
 	   const struct gl_extensions *extensions, int api)
 {
 	int errors;
diff --git a/src/glsl/glsl_parser_extras.h b/src/glsl/glsl_parser_extras.h
index fc08ee2..c8c40ab 100644
--- a/src/glsl/glsl_parser_extras.h
+++ b/src/glsl/glsl_parser_extras.h
@@ -296,7 +296,7 @@ _mesa_glsl_shader_target_name(enum _mesa_glsl_parser_targets target);
 extern "C" {
 #endif
 
-extern int preprocess(void *ctx, const char **shader, char **info_log,
+extern int glcpp_preprocess(void *ctx, const char **shader, char **info_log,
                       const struct gl_extensions *extensions, int api);
 
 extern void _mesa_destroy_shader_compiler(void);
diff --git a/src/glsl/main.cpp b/src/glsl/main.cpp
index 64c2496..04143ad 100644
--- a/src/glsl/main.cpp
+++ b/src/glsl/main.cpp
@@ -144,7 +144,7 @@ compile_shader(struct gl_context *ctx, struct gl_shader *shader)
       new(shader) _mesa_glsl_parse_state(ctx, shader->Type, shader);
 
    const char *source = shader->Source;
-   state->error = preprocess(state, &source, &state->info_log,
+   state->error = glcpp_preprocess(state, &source, &state->info_log,
 			     state->extensions, ctx->API) != 0;
 
    if (!state->error) {
diff --git a/src/glsl/test_optpass.cpp b/src/glsl/test_optpass.cpp
index 31f65c3..5ed1170 100644
--- a/src/glsl/test_optpass.cpp
+++ b/src/glsl/test_optpass.cpp
@@ -216,7 +216,7 @@ int test_optpass(int argc, char **argv)
    } else {
       shader->Source = input.c_str();
       const char *source = shader->Source;
-      state->error = preprocess(state, &source, &state->info_log,
+      state->error = glcpp_preprocess(state, &source, &state->info_log,
                                 state->extensions, ctx->API) != 0;
 
       if (!state->error) {
diff --git a/src/mesa/program/ir_to_mesa.cpp b/src/mesa/program/ir_to_mesa.cpp
index d675da2..c9c6db1 100644
--- a/src/mesa/program/ir_to_mesa.cpp
+++ b/src/mesa/program/ir_to_mesa.cpp
@@ -3060,7 +3060,7 @@ _mesa_glsl_compile_shader(struct gl_context *ctx, struct gl_shader *shader)
       return;
    }
 
-   state->error = preprocess(state, &source, &state->info_log,
+   state->error = glcpp_preprocess(state, &source, &state->info_log,
 			     &ctx->Extensions, ctx->API);
 
    if (ctx->Shader.Flags & GLSL_DUMP) {

commit 8f7990c5f2ca25e42c7fefff6312bee2ff77e134
Author: Dave Airlie <airlied@gmail.com>
Date:   Fri Sep 14 19:59:54 2012 +1000

    glcpp: fix abuse of yylex
    
    So glcpp tried to workaround yylex its own way, but failed,
    do it properly.
    
    This fixes another crash found after fixing the first crash.
    
    this is a candidate for 9.0 and stable branches
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit 53d46bc787318ccf9911fdd1d5fe99ee4db7f41a)

diff --git a/src/glsl/glcpp/Makefile.am b/src/glsl/glcpp/Makefile.am
index 7a95b68..87affce 100644
--- a/src/glsl/glcpp/Makefile.am
+++ b/src/glsl/glcpp/Makefile.am
@@ -31,7 +31,7 @@ AM_CFLAGS = \
 	$(LIBRARY_DEFINES) \
 	$(API_DEFINES)
 
-AM_YFLAGS = -v -d
+AM_YFLAGS = -v -d -p "glcpp_parser_"
 AM_LFLAGS = --nounistd -o$(LEX_OUTPUT_ROOT).c
 
 noinst_LTLIBRARIES = libglcpp.la
diff --git a/src/glsl/glcpp/glcpp-parse.y b/src/glsl/glcpp/glcpp-parse.y
index bf6f3ad..fb9bc58 100644
--- a/src/glsl/glcpp/glcpp-parse.y
+++ b/src/glsl/glcpp/glcpp-parse.y
@@ -133,8 +133,6 @@ _glcpp_parser_skip_stack_change_if (glcpp_parser_t *parser, YYLTYPE *loc,
 static void
 _glcpp_parser_skip_stack_pop (glcpp_parser_t *parser, YYLTYPE *loc);
 
-#define yylex glcpp_parser_lex
-
 static int
 glcpp_parser_lex (YYSTYPE *yylval, YYLTYPE *yylloc, glcpp_parser_t *parser);
 
@@ -1197,12 +1195,6 @@ glcpp_parser_create (const struct gl_extensions *extensions, int api)
 	return parser;
 }
 
-int
-glcpp_parser_parse (glcpp_parser_t *parser)
-{
-	return yyparse (parser);
-}
-
 void
 glcpp_parser_destroy (glcpp_parser_t *parser)
 {

commit a834381506d5be80251953666198fc3b9bc4b731
Author: Dave Airlie <airlied@redhat.com>
Date:   Fri Sep 14 10:05:53 2012 +1000

    mesa: use a prefix for the program lex
    
    This avoids us making a global yylex symbol which will interfere will
    all sorts of apps.
    
    with libdricore which can't do symbol visibility currently we pollute
    the namespace with this.
    
    This is a candidate for 9.0 & stable branches.
    
    Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
    Signed-off-by: Dave Airlie <airlied@redhat.com>
    (cherry picked from commit cc943c8470b38a1f13d2493f293a153f75754caa)

diff --git a/src/mesa/Makefile.am b/src/mesa/Makefile.am
index 57325af..8e4530d 100644
--- a/src/mesa/Makefile.am
+++ b/src/mesa/Makefile.am
@@ -73,7 +73,7 @@ main/api_exec_es1.c: main/APIspec.xml main/es_generator.py main/APIspecutil.py m
 
 program/program_parse.tab.c program/program_parse.tab.h: program/program_parse.y
 	$(MKDIR_P) program
-	$(AM_V_GEN) $(YACC) -v -d --output=program/program_parse.tab.c $<
+	$(AM_V_GEN) $(YACC) -p "_mesa_program_" -v -d --output=program/program_parse.tab.c $<
 
 program/lex.yy.c: program/program_lexer.l
 	$(MKDIR_P) program
diff --git a/src/mesa/program/program_lexer.l b/src/mesa/program/program_lexer.l
index 0a50dab..0947bb0 100644
--- a/src/mesa/program/program_lexer.l
+++ b/src/mesa/program/program_lexer.l
@@ -165,6 +165,7 @@ szf    [HR]?
 cc     C?
 sat    (_SAT)?
 
+%option prefix="_mesa_program_"
 %option bison-bridge bison-locations reentrant noyywrap
 %%
 

commit fafaf56479d41e87bb0003a55d30dca1825bc1ca
Author: Mike Frysinger <vapier@gentoo.org>
Date:   Tue Sep 11 01:57:25 2012 -0400

    mklib: clean up abi flags for x86 targets
    
    The current code is duplicated in two places and relies on `uname` to
    detect the flags.  This is no good for cross-compiling, and the current
    logic uses -m64 for the x32 ABI which breaks things.
    
    Unify the code in one place, avoid `uname` completely, and add support
    for the new x32 ABI.
    
    Signed-off-by: Mike Frysinger <vapier@gentoo.org>

diff --git a/bin/mklib b/bin/mklib
index 9bac29e..086b268 100755
--- a/bin/mklib
+++ b/bin/mklib
@@ -319,6 +319,25 @@ case $ARCH in
             fi
 	fi
 
+	# Check if objects are 32-bit and we're running in 64-bit
+	# environment.  If so, pass -m32 flag to linker.
+	add_abi_flag_to_opts() {
+	    case $(file $1) in
+		*32-bit*x86-64*)
+		    # x86_64 x32 ABI.
+		    OPTS="-mx32 ${OPTS}"
+		    ;;
+		*64-bit*x86-64*)
+		    # x86_64 64-bit ABI.
+		    OPTS="-m64 ${OPTS}"
+		    ;;
+		*32-bit*Intel*)
+		    # x86 32-bit ABI.
+		    OPTS="-m32 ${OPTS}"
+		    ;;
+	    esac
+	}
+
 	if [ $NOPREFIX = 1 ] ; then
 	    # No "lib" or ".so" part
 	    echo "mklib: Making" $ARCH "shared library: " ${LIBNAME}
@@ -330,15 +349,8 @@ case $ARCH in
 	    ;;
 	    esac
 
-	    # Check if objects are 32-bit and we're running in 64-bit
-	    # environment.  If so, pass -m32 flag to linker.
-	    set ${OBJECTS}
-	    ABI32=`file $1 | grep 32-bit`
-	    ARM=`file $1 | grep ARM`
-	    # Do not add "-m32" option for arm.
-            if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
-		OPTS="-m32 ${OPTS}"
-	    fi
+	    # Check to see if we are building for a different ABI.
+	    add_abi_flag_to_opts ${OBJECTS}
 
             if [ "${ALTOPTS}" ] ; then
                 OPTS=${ALTOPTS}
@@ -389,15 +401,9 @@ case $ARCH in
 		# exptmp is removed below
 	    fi
 
-	    # Check if objects are 32-bit and we're running in 64-bit
-	    # environment.  If so, pass -m32 flag to linker.
-	    set ${OBJECTS}
-	    ABI32=`file $1 | grep 32-bit`
-            ARM=`file $1 | grep ARM`
-	    # Do not add "-m32" option for arm.
-            if [ -z "$ARM" -a "${ABI32}" -a `uname -m` = "x86_64" ] ; then
-		OPTS="-m32 ${OPTS}"
-	    fi
+	    # Check to see if we are building for a different ABI.
+	    add_abi_flag_to_opts ${OBJECTS}
+
             if [ "${ALTOPTS}" ] ; then
                 OPTS=${ALTOPTS}
             fi

commit f94b6d706ff4340277b9c68d2bc51602792c5739
Author: Alex Deucher <alexander.deucher@amd.com>
Date:   Thu Sep 13 17:25:42 2012 -0400

    r600g: reduce quant mode on evergreen+
    
    Seems to have an affect on the allowable range of
    values.  Set evergreen+ to 1/256 to match 6xx/7xx.
    
    fixes:
    https://bugs.freedesktop.org/show_bug.cgi?id=54877
    
    Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
    (cherry picked from commit b33d7eaa5e77b5367584fe183c46f8c3d9a06760)

diff --git a/src/gallium/drivers/r600/evergreen_state.c b/src/gallium/drivers/r600/evergreen_state.c
index bda8ed5..ee47976 100644
--- a/src/gallium/drivers/r600/evergreen_state.c
+++ b/src/gallium/drivers/r600/evergreen_state.c
@@ -921,7 +921,7 @@ static void *evergreen_create_rs_state(struct pipe_context *ctx,
 	} else {
 		r600_pipe_state_add_reg(rstate, R_028C08_PA_SU_VTX_CNTL,
 					S_028C08_PIX_CENTER_HALF(state->gl_rasterization_rules) |
-					S_028C08_QUANT_MODE(V_028C08_X_1_4096TH));
+					S_028C08_QUANT_MODE(V_028C08_X_1_256TH));
 	}
 	r600_pipe_state_add_reg(rstate, R_028B7C_PA_SU_POLY_OFFSET_CLAMP, fui(state->offset_clamp));
 	r600_pipe_state_add_reg(rstate, R_028814_PA_SU_SC_MODE_CNTL,

commit a5a86652f17c5bc249a55b558310947a76de3d33
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Sep 11 22:14:59 2012 -0700

    i965: Fix out-of-order sampler unit usage in ARB fragment programs.
    
    ARB fragment programs use texture unit numbers directly, unlike GLSL
    which has an extra indirection.  If a fragment program only uses one
    texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single
    bit, which would make us only upload a single surface/sampler state
    entry.  However, it needs to be the second entry.
    
    Using _mesa_fls() instead of _mesa_bitcount() solves this.  For ARB
    programs, this makes num_samplers the ID of the highest texture unit
    used.  Since GLSL uses consecutive integers assigned by the linker,
    _mesa_fls() should give the same result as _mesa_bitcount()..
    
    Fixes a regression since 85e8e9e000732908b259a7e2cbc1724a1be2d447,
    which caused GPU hangs in ETQW (and probably others), as well as
    breaking piglit test fp-fragment-position.
    
    v2: Add a comment, as suggested by Matt.
    
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
    Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    Tested-by: meng <mengmeng.meng@intel.com>
    (cherry picked from commit 28f4be9eb91b12a2c6b1db6660cca71a98c486ec)

diff --git a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
index 610ef34..e51381b 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_sampler_state.c
@@ -341,7 +341,10 @@ brw_upload_samplers(struct brw_context *brw)
 
    GLbitfield SamplersUsed = vs->SamplersUsed | fs->SamplersUsed;
 
-   brw->sampler.count = _mesa_bitcount(SamplersUsed);
+   /* ARB programs use the texture unit number as the sampler index, so we
+    * need to find the highest unit used.  A bit-count will not work.
+    */
+   brw->sampler.count = _mesa_fls(SamplersUsed);
 
    if (brw->sampler.count == 0)
       return;
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 eefa427..582e239 100644
--- a/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
+++ b/src/mesa/drivers/dri/i965/brw_wm_surface_state.c
@@ -1250,7 +1250,7 @@ brw_update_texture_surfaces(struct brw_context *brw)
    struct gl_program *vs = (struct gl_program *) brw->vertex_program;
    struct gl_program *fs = (struct gl_program *) brw->fragment_program;
 
-   unsigned num_samplers = _mesa_bitcount(vs->SamplersUsed | fs->SamplersUsed);
+   unsigned num_samplers = _mesa_fls(vs->SamplersUsed | fs->SamplersUsed);
 
    for (unsigned s = 0; s < num_samplers; s++) {
       brw->vs.surf_offset[SURF_INDEX_VS_TEXTURE(s)] = 0;

commit 66e8f863d34fc8b8f7602c45bb3230fe663d4eb0
Author: Kenneth Graunke <kenneth@whitecape.org>
Date:   Tue Sep 11 22:14:58 2012 -0700

    mesa: Add a _mesa_fls() function to find the last bit set in a word.
    
    ffs() finds the least significant bit set; _mesa_fls() finds the /most/
    significant bit.
    
    v2: Make it an inline function in imports.h, per Brian's suggestion.
    
    Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
    Reviewed-by: Brian Paul <brianp@vmware.com>
    Reviewed-by: Matt Turner <mattst88@gmail.com>
    (cherry picked from commit 0fc163408e6b9521d545daba19f70631011d5752)

diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 73913b5..551aea7 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -587,6 +587,28 @@ extern unsigned int
 _mesa_bitcount_64(uint64_t n);
 #endif
 
+/**
+ * Find the last (most significant) bit set in a word.
+ *
+ * Essentially ffs() in the reverse direction.
+ */
+static inline unsigned int
+_mesa_fls(unsigned int n)
+{
+#if defined(__GNUC__) && ((__GNUC__ * 100 + __GNUC_MINOR__) >= 304)
+   return n == 0 ? 0 : 32 - __builtin_clz(n);
+#else
+   unsigned int v = 1;
+
+   if (n == 0)
+      return 0;
+
+   while (n >>= 1)
+       v++;
+
+   return v;
+#endif
+}
 
 extern GLhalfARB
 _mesa_float_to_half(float f);


Reply to: