platform/upstream/mesa.git
11 years agomesa: whitespace, formatting, 80-column wrapping 66/7466/1
Brian Paul [Fri, 12 Jul 2013 14:32:22 +0000 (08:32 -0600)]
mesa: whitespace, formatting, 80-column wrapping

11 years agosoftpipe: silence some MSVC warnings 65/7465/1
Brian Paul [Mon, 8 Jul 2013 16:02:14 +0000 (10:02 -0600)]
softpipe: silence some MSVC warnings

11 years agohud: silence some MSVC warnings 64/7464/1
Brian Paul [Mon, 8 Jul 2013 16:01:44 +0000 (10:01 -0600)]
hud: silence some MSVC warnings

11 years agoutil: add casts to silence MSVC warnings in u_blit.c 63/7463/1
Brian Paul [Mon, 8 Jul 2013 16:01:22 +0000 (10:01 -0600)]
util: add casts to silence MSVC warnings in u_blit.c

11 years agotgsi: s/unsigned/int/ to silence MSVC warning 62/7462/1
Brian Paul [Mon, 8 Jul 2013 16:00:54 +0000 (10:00 -0600)]
tgsi: s/unsigned/int/ to silence MSVC warning

11 years agomesa: s/unsigned/int/ to fix MSVC warning in uniforms.c 61/7461/1
Brian Paul [Mon, 8 Jul 2013 16:00:29 +0000 (10:00 -0600)]
mesa: s/unsigned/int/ to fix MSVC warning in uniforms.c

11 years agomesa: s/GLuint/GLint/ to silence MSVC warning in textore.c 60/7460/1
Brian Paul [Mon, 8 Jul 2013 16:00:01 +0000 (10:00 -0600)]
mesa: s/GLuint/GLint/ to silence MSVC warning in textore.c

11 years agomesa: add casts to fix MSVC warnings in multisample.c 59/7459/1
Brian Paul [Mon, 8 Jul 2013 15:59:40 +0000 (09:59 -0600)]
mesa: add casts to fix MSVC warnings in multisample.c

11 years agomesa: s/GLint/GLuint/ to fix MSVC warnings in mipmap.c 58/7458/1
Brian Paul [Mon, 8 Jul 2013 15:59:20 +0000 (09:59 -0600)]
mesa: s/GLint/GLuint/ to fix MSVC warnings in mipmap.c

11 years agomesa: fix inconsistent function declaration, definitions 57/7457/1
Brian Paul [Mon, 8 Jul 2013 15:58:12 +0000 (09:58 -0600)]
mesa: fix inconsistent function declaration, definitions

To silence MSVC warnings that the declaration and definitions
were different.

11 years agomesa: add cast to silence MSVC warning 56/7456/1
Brian Paul [Mon, 8 Jul 2013 15:55:38 +0000 (09:55 -0600)]
mesa: add cast to silence MSVC warning

11 years agoradeon/uvd: fall back to shader based decoding for MPEG2 on UVD 2.x v2 55/7455/1
Christian König [Wed, 10 Jul 2013 13:43:16 +0000 (15:43 +0200)]
radeon/uvd: fall back to shader based decoding for MPEG2 on UVD 2.x v2

UVD 2.x doesn't support hardware decoding of MPEG2, just use shader
based decoding for those chipsets.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=66450

v2: fix interlacing as well

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoglsl: Avoid variable length arrays. 54/7454/1
José Fonseca [Fri, 12 Jul 2013 08:27:22 +0000 (09:27 +0100)]
glsl: Avoid variable length arrays.

They are a non-standard GCC extension that's not widely supported by
other C/C++ compilers.

Use a dynamic array instead.

Trivial. Should fix the MSVC build.

11 years agoglsl: Add support for C-style initializers. 53/7453/1
Matt Turner [Sun, 30 Jun 2013 02:29:16 +0000 (19:29 -0700)]
glsl: Add support for C-style initializers.

Required by GL_ARB_shading_language_420pack.

Parts based on work done by Todd Previte and Ken Graunke, implementing
basic support for C-style initializers of arrays.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add infrastructure for aggregate initializers. 52/7452/1
Matt Turner [Sun, 30 Jun 2013 02:27:50 +0000 (19:27 -0700)]
glsl: Add infrastructure for aggregate initializers.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add an is_declaration field to ast_struct_specifier. 51/7451/1
Matt Turner [Wed, 26 Jun 2013 22:53:12 +0000 (15:53 -0700)]
glsl: Add an is_declaration field to ast_struct_specifier.

Will be used in a later commit to differentiate between a structure type
declaration and a variable declaration of a struct type. I.e., the
difference between

   struct S { float x; }; (is_declaration = true)

and

   S s;                   (is_declaration = false)

Also note that is_declaration = true for

   struct S { float x; } s;

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Track structs' ast_type_specifiers in symbol table. 50/7450/1
Matt Turner [Tue, 25 Jun 2013 07:27:41 +0000 (00:27 -0700)]
glsl: Track structs' ast_type_specifiers in symbol table.

Will be used in a future commit. An ast_type_specifier is stored (rather
than an ast_struct_specifier) with the idea that we may have more
general uses for this in the future. struct names are prefixed with
'#ast.' to avoid collisions with the glsl_types in the symbol table.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add process_vec_mat_constructor() function. 49/7449/1
Matt Turner [Sat, 29 Jun 2013 22:45:46 +0000 (15:45 -0700)]
glsl: Add process_vec_mat_constructor() function.

Based largely on process_array_constructor().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Separate code into process_record_constructor(). 48/7448/1
Matt Turner [Thu, 13 Jun 2013 19:05:21 +0000 (12:05 -0700)]
glsl: Separate code into process_record_constructor().

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add copy-constructor for ast_struct_specifier. 47/7447/1
Matt Turner [Wed, 26 Jun 2013 22:52:28 +0000 (15:52 -0700)]
glsl: Add copy-constructor for ast_struct_specifier.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Add a constructor for ast_type_specifier. 46/7446/1
Matt Turner [Tue, 25 Jun 2013 04:38:30 +0000 (21:38 -0700)]
glsl: Add a constructor for ast_type_specifier.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Clean up and clarify comment explaining initializer rules. 45/7445/1
Matt Turner [Mon, 10 Jun 2013 20:28:40 +0000 (13:28 -0700)]
glsl: Clean up and clarify comment explaining initializer rules.

Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl: Change type of is_array to bool. 44/7444/1
Matt Turner [Mon, 10 Jun 2013 22:59:55 +0000 (15:59 -0700)]
glsl: Change type of is_array to bool.

Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl: Add a comment to note what an exec_list is a list of. 43/7443/1
Matt Turner [Wed, 26 Jun 2013 22:58:08 +0000 (15:58 -0700)]
glsl: Add a comment to note what an exec_list is a list of.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl: Fix inverted conditional in error message. 42/7442/1
Matt Turner [Mon, 10 Jun 2013 20:28:40 +0000 (13:28 -0700)]
glsl: Fix inverted conditional in error message.

The code float a[2] = float[2]( 3.4, 4.2, 5.0 ); previously generated
this:

   error: array constructor must have at least 2 parameters

when in fact it requires exactly two.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl: Add missing return error_value(ctx) in error path. 41/7441/1
Matt Turner [Sat, 29 Jun 2013 22:32:09 +0000 (15:32 -0700)]
glsl: Add missing return error_value(ctx) in error path.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl: Remove unnecessary #include from ast_type.cpp. 40/7440/1
Matt Turner [Thu, 20 Jun 2013 19:03:44 +0000 (12:03 -0700)]
glsl: Remove unnecessary #include from ast_type.cpp.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romainck@intel.com>
11 years agoglsl/build: build builtin_compiler with VISIBILITY_CFLAGS 39/7439/1
Chia-I Wu [Thu, 11 Jul 2013 01:14:16 +0000 (09:14 +0800)]
glsl/build: build builtin_compiler with VISIBILITY_CFLAGS

libglslcore.la and libglcpp.la that are built with builtin_compiler are also
linked to by drivers not using libdricore.  Since there is no public symbol in
them, it is better to mark all symbols hidden.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoglsl: Add comment explaining "row_major" parsing. 38/7438/1
Matt Turner [Thu, 11 Jul 2013 18:28:58 +0000 (11:28 -0700)]
glsl: Add comment explaining "row_major" parsing.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Mark "row_major" as not a reserved word in GLSL ES 3.0. 37/7437/1
Matt Turner [Thu, 11 Jul 2013 17:11:18 +0000 (10:11 -0700)]
glsl: Mark "row_major" as not a reserved word in GLSL ES 3.0.

We mark ARB_uniform_buffer_object as enabled under ES 3 since it
contains that functionality, which tricked the compiler into tokenizing
"row_major".

Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoglsl: Remove outdated FINISHME comment. 36/7436/1
Matt Turner [Wed, 10 Jul 2013 18:12:10 +0000 (11:12 -0700)]
glsl: Remove outdated FINISHME comment.

Explicit index support was added by commit 1256a5dc.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoradeon: bump libdrm_radeon requirement for CIK support 35/7435/1
Alex Deucher [Thu, 11 Jul 2013 22:51:32 +0000 (18:51 -0400)]
radeon: bump libdrm_radeon requirement for CIK support

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: x/y coordinates must be divided by block dim in dma blit 34/7434/1
Christoph Bumiller [Fri, 5 Jul 2013 18:55:36 +0000 (20:55 +0200)]
r600g: x/y coordinates must be divided by block dim in dma blit

Note: this is a candidate for the 9.1 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g/sb: Fix Android build v2 33/7433/1
Chih-Wei Huang [Thu, 27 Jun 2013 21:31:05 +0000 (14:31 -0700)]
r600g/sb: Fix Android build v2

Add the sb CXX files to the Android Makefile and also stop using some
c++11 features.

v2 (Vadim Girlin): use &bc[0] instead of bc.begin()

11 years agor600g/sb: improve math optimizations v2 32/7432/1
Vadim Girlin [Wed, 5 Jun 2013 16:55:31 +0000 (20:55 +0400)]
r600g/sb: improve math optimizations v2

This patch adds support for some math optimizations that are generally
considered unsafe, that's why they are currently disabled for compute
shaders.

GL requirements are less strict, so they are enabled for
for GL shaders by default. In case of any issues with
applications that rely on higher precision than guaranteed by GL,
'sbsafemath' option in R600_DEBUG allows to disable them.

v2 - always set proper src vector size for transformed instructions
   - check for clamp modifier in the expr_handler::fold_assoc

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agost/xvmc/tests: avoid non portable error.h functions 31/7431/1
Jonathan Gray [Thu, 11 Jul 2013 07:52:00 +0000 (09:52 +0200)]
st/xvmc/tests: avoid non portable error.h functions

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agoi965/blorp: Fix clear rectangle alignment in fast color clear 30/7430/1
Anuj Phogat [Tue, 9 Jul 2013 23:09:14 +0000 (16:09 -0700)]
i965/blorp: Fix clear rectangle alignment in fast color clear

From BSpec: 3D-Media-GPGPU Engine > 3D Pipeline > Pixel >
Pixel Backend > MCS Buffer for Render Target(s) [DevIVB+]:
[DevHSW:GT3]: Clear rectangle must be aligned to two times
the number of pixels in the table shown below...
Observed no piglit, gles3conform regressions with this patch.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65744

11 years agowinsys/intel: build with VISIBILITY_CFLAGS 29/7429/1
Chia-I Wu [Thu, 11 Jul 2013 01:01:42 +0000 (09:01 +0800)]
winsys/intel: build with VISIBILITY_CFLAGS

There is no public symbol in this winsys.

11 years agoilo: reduce PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS to 12 28/7428/1
Chia-I Wu [Thu, 11 Jul 2013 00:02:19 +0000 (08:02 +0800)]
ilo: reduce PIPE_CAP_MAX_TEXTURE_CUBE_LEVELS to 12

So that there are at most (2^22 * 6) texels, lower than the 2^26 limit.

11 years agoilo: correctly initialize undefined registers in fs 27/7427/1
Chia-I Wu [Wed, 10 Jul 2013 22:39:05 +0000 (06:39 +0800)]
ilo: correctly initialize undefined registers in fs

Initialize all 4 channels of undefined registers (that is, TEMPs that are used
before being assigned) in FS.

11 years agoradeonsi: Handle TGSI_OPCODE_DDX/Y using local memory 26/7426/1
Michel Dänzer [Wed, 19 Jun 2013 16:14:01 +0000 (18:14 +0200)]
radeonsi: Handle TGSI_OPCODE_DDX/Y using local memory

16 more little piglits.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoradeonsi: Handle TGSI_OPCODE_TXD 25/7425/1
Michel Dänzer [Thu, 21 Feb 2013 15:10:55 +0000 (16:10 +0100)]
radeonsi: Handle TGSI_OPCODE_TXD

One more little piglit.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
11 years agoutil/u_math: Use xmmintrin.h whenever possible. 24/7424/1
José Fonseca [Wed, 10 Jul 2013 06:56:17 +0000 (07:56 +0100)]
util/u_math: Use xmmintrin.h whenever possible.

It seems  __builtin_ia32_ldmxcsr is only available on gcc and only when
-msse is used. xmmintrin.h/pmmintrin.h provide portable intrinsics, but
these too are only available with gcc when -msse/-msse3 are set.

scons build always sets -msse on x86 builds, but autotools doesn't seem
to.

We could try to get this working on gcc x86 without -msse by emitting
assembly, but I believe that in this day and age we really should be
building Mesa with -msse and -msse2.

11 years agoilo: honor surface padding requirements 23/7423/1
Chia-I Wu [Wed, 10 Jul 2013 04:05:37 +0000 (12:05 +0800)]
ilo: honor surface padding requirements

The PRM specifies several padding requirements that we failed to honor.

11 years agoutil: treat denorm'ed floats like zero 22/7422/1
Zack Rusin [Tue, 9 Jul 2013 03:45:55 +0000 (23:45 -0400)]
util: treat denorm'ed floats like zero

The D3D10 spec is very explicit about treatment of denorm floats and
the behavior is exactly the same for them as it would be for -0 or
+0. This makes our shading code match that behavior, since OpenGL
doesn't care and on a few cpu's it's faster (worst case the same).
Float16 conversions will likely break but we'll fix them in a follow
up commit.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agomesa: Set ProfileMask properly for core profile. 21/7421/1
Matt Turner [Mon, 8 Jul 2013 23:07:36 +0000 (16:07 -0700)]
mesa: Set ProfileMask properly for core profile.

Fixes MESA_GL_VERSION_OVERRIDE=3.2 egl-create-context-verify-gl-flavor.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Delete intel_context entirely. 20/7420/1
Kenneth Graunke [Sat, 6 Jul 2013 07:46:38 +0000 (00:46 -0700)]
i965: Delete intel_context entirely.

This makes brw_context inherit directly from gl_context; that was the
only thing left in intel_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::gen and gt fields to brw_context. 19/7419/1
Kenneth Graunke [Sat, 6 Jul 2013 07:36:46 +0000 (00:36 -0700)]
i965: Move intel_context::gen and gt fields to brw_context.

Most functions no longer use intel_context, so this patch additionally
removes the local "intel" variables to avoid compiler warnings.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::has_llc to brw_context. 18/7418/1
Kenneth Graunke [Sat, 6 Jul 2013 07:20:25 +0000 (00:20 -0700)]
i965: Move intel_context::has_llc to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::is_<platform> flags to brw_context. 17/7417/1
Kenneth Graunke [Sat, 6 Jul 2013 07:15:44 +0000 (00:15 -0700)]
i965: Move intel_context::is_<platform> flags to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move must_use/has_separate_stencil fields to brw_context. 16/7416/1
Kenneth Graunke [Sat, 6 Jul 2013 06:43:36 +0000 (23:43 -0700)]
i965: Move must_use/has_separate_stencil fields to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::has_hiz to brw_context. 15/7415/1
Kenneth Graunke [Thu, 4 Jul 2013 19:45:39 +0000 (12:45 -0700)]
i965: Move intel_context::has_hiz to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Free brw, not intel. 14/7414/1
Kenneth Graunke [Thu, 4 Jul 2013 17:37:31 +0000 (10:37 -0700)]
i965: Free brw, not intel.

Things worked out in the past because both brw and intel share the same
memory address (by virtue of intel being the first member of brw).

However, brw is what actually gets rzalloc'd (brw_context.c:285), so
freeing that seems safer and more obvious.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Shorten context base class dereference chains. 13/7413/1
Kenneth Graunke [Thu, 4 Jul 2013 06:32:20 +0000 (23:32 -0700)]
i965: Shorten context base class dereference chains.

ctx->DrawBuffer is much more sensible than brw->intel.ctx.DrawBuffer.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::has_swizzling to brw_context. 12/7412/1
Kenneth Graunke [Wed, 3 Jul 2013 22:00:34 +0000 (15:00 -0700)]
i965: Move intel_context::has_swizzling to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::intelScreen to brw_context. 11/7411/1
Kenneth Graunke [Wed, 3 Jul 2013 21:55:19 +0000 (14:55 -0700)]
i965: Move intel_context::intelScreen to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Delete unused intel_context::driFd field. 10/7410/1
Kenneth Graunke [Wed, 3 Jul 2013 21:52:34 +0000 (14:52 -0700)]
i965: Delete unused intel_context::driFd field.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Store brw_context as the DRI driver private, not intel_context. 09/7409/1
Kenneth Graunke [Thu, 4 Jul 2013 17:30:47 +0000 (10:30 -0700)]
i965: Store brw_context as the DRI driver private, not intel_context.

Right now, they're interchangeable.  In the future, intel_context will
either go away or change purpose.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::driContext to brw_context. 08/7408/1
Kenneth Graunke [Thu, 4 Jul 2013 17:30:01 +0000 (10:30 -0700)]
i965: Move intel_context::driContext to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::NewGLState to brw_context. 07/7407/1
Kenneth Graunke [Thu, 4 Jul 2013 17:29:50 +0000 (10:29 -0700)]
i965: Move intel_context::NewGLState to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::upload to brw_context. 06/7406/1
Kenneth Graunke [Wed, 3 Jul 2013 21:46:44 +0000 (14:46 -0700)]
i965: Move intel_context::upload to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::max_gtt_map_object_size to brw_context. 05/7405/1
Kenneth Graunke [Wed, 3 Jul 2013 21:44:07 +0000 (14:44 -0700)]
i965: Move intel_context::max_gtt_map_object_size to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::perf_debug to brw_context. 04/7404/1
Kenneth Graunke [Wed, 3 Jul 2013 21:41:58 +0000 (14:41 -0700)]
i965: Move intel_context::perf_debug to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::no_batch_wrap to brw_context. 03/7403/1
Kenneth Graunke [Wed, 3 Jul 2013 21:29:56 +0000 (14:29 -0700)]
i965: Move intel_context::no_batch_wrap to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context's framerate throttling fields to brw_context. 02/7402/1
Kenneth Graunke [Wed, 3 Jul 2013 21:28:29 +0000 (14:28 -0700)]
i965: Move intel_context's framerate throttling fields to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::stats_wm to brw_context. 01/7401/1
Kenneth Graunke [Wed, 3 Jul 2013 21:26:01 +0000 (14:26 -0700)]
i965: Move intel_context::stats_wm to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::batch to brw_context. 00/7400/1
Kenneth Graunke [Wed, 3 Jul 2013 21:21:19 +0000 (14:21 -0700)]
i965: Move intel_context::batch to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::hw_ctx to brw_context. 99/7399/1
Kenneth Graunke [Wed, 3 Jul 2013 21:12:41 +0000 (14:12 -0700)]
i965: Move intel_context::hw_ctx to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::bufmgr to brw_context. 98/7398/1
Kenneth Graunke [Wed, 3 Jul 2013 21:09:51 +0000 (14:09 -0700)]
i965: Move intel_context::bufmgr to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context's driconf flags to brw_context. 97/7397/1
Kenneth Graunke [Wed, 3 Jul 2013 20:54:53 +0000 (13:54 -0700)]
i965: Move intel_context's driconf flags to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::reduced_primitive to brw_context. 96/7396/1
Kenneth Graunke [Wed, 3 Jul 2013 18:55:59 +0000 (11:55 -0700)]
i965: Move intel_context::reduced_primitive to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move front buffer rendering fields from intel_context to brw. 95/7395/1
Kenneth Graunke [Wed, 3 Jul 2013 18:37:51 +0000 (11:37 -0700)]
i965: Move front buffer rendering fields from intel_context to brw.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::vtbl to brw_context. 94/7394/1
Kenneth Graunke [Wed, 3 Jul 2013 18:14:56 +0000 (11:14 -0700)]
i965: Move intel_context::vtbl to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move intel_context::optionCache to brw_context. 93/7393/1
Kenneth Graunke [Wed, 3 Jul 2013 17:57:11 +0000 (10:57 -0700)]
i965: Move intel_context::optionCache to brw_context.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Pass brw_context to functions rather than intel_context. 92/7392/1
Kenneth Graunke [Wed, 3 Jul 2013 06:17:14 +0000 (23:17 -0700)]
i965: Pass brw_context to functions rather than intel_context.

This makes brw_context available in every function that used
intel_context.  This makes it possible to start migrating fields from
intel_context to brw_context.

Surprisingly, this actually removes some code, as functions that use
OUT_BATCH don't need to declare "intel"; they just use "brw."

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Remove pointless intel_context parameter from try_copy_propagate. 91/7391/1
Kenneth Graunke [Wed, 3 Jul 2013 07:49:28 +0000 (00:49 -0700)]
i965: Remove pointless intel_context parameter from try_copy_propagate.

It's already part of the visitor class.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Add forward declarations of brw_context to a few places. 90/7390/1
Kenneth Graunke [Wed, 3 Jul 2013 06:15:53 +0000 (23:15 -0700)]
i965: Add forward declarations of brw_context to a few places.

These files have forward declarations for intel_context.  This makes
brw_context available in the same places without further #include
monkeying.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Replace #include "intel_context.h" with brw_context.h. 89/7389/1
Kenneth Graunke [Wed, 3 Jul 2013 01:56:43 +0000 (18:56 -0700)]
i965: Replace #include "intel_context.h" with brw_context.h.

brw_context.h includes intel_context.h, but additionally makes the
brw_context structure available.  Switching this allows us to start
using brw_context in more places.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Move ctx->Const setup from intelInitContext to the new helper. 88/7388/1
Kenneth Graunke [Wed, 3 Jul 2013 01:05:48 +0000 (18:05 -0700)]
i965: Move ctx->Const setup from intelInitContext to the new helper.

This also requires moving _mesa_init_point() to after the ctx->Const
initialization.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Split code to set ctx->Const values into a helper function. 87/7387/1
Kenneth Graunke [Wed, 3 Jul 2013 00:57:42 +0000 (17:57 -0700)]
i965: Split code to set ctx->Const values into a helper function.

brwCreateContext() has a lot of random things to do.  Factoring out the
part that initializes ctx->Const values and shader compiler options
makes the main function a bit easier to read.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi915: Remove i965+ chip names. 86/7386/1
Kenneth Graunke [Thu, 4 Jul 2013 18:46:51 +0000 (11:46 -0700)]
i915: Remove i965+ chip names.

i965+ chipsets shouldn't ever hit this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Remove i915 chip names. 85/7385/1
Kenneth Graunke [Thu, 4 Jul 2013 18:46:07 +0000 (11:46 -0700)]
i965: Remove i915 chip names.

i915 chipsets shouldn't ever hit this driver.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Replace intel_context:needs_ff_sync with intel->gen == 5. 84/7384/1
Kenneth Graunke [Thu, 4 Jul 2013 18:26:54 +0000 (11:26 -0700)]
i965: Replace intel_context:needs_ff_sync with intel->gen == 5.

Technically, needs_ff_sync was set on Gen5+, but it was only consulted
in the clipper threads and quad/lineloop decomposition code, which are
both Gen4-5 only.  So in reality it only identified Ironlake.

The named flag doesn't really clarify things, and seems like overkill.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Chris Forbes <chrisf@ijw.co.nz>
Acked-by: Paul Berry <stereotype441@gmail.com>
Acked-by: Anuj Phogat <anuj.phogat@gmail.com>
11 years agoi965: Add missing newline to blorp color clear perf_debug message. 83/7383/1
Kenneth Graunke [Tue, 9 Jul 2013 17:09:57 +0000 (10:09 -0700)]
i965: Add missing newline to blorp color clear perf_debug message.

perf_debug() doesn't add a newline for you; without this, all the
INTEL_DEBUG=perf output was jumbled together.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Silence unused variable warning in the release build 82/7382/1
Emil Velikov [Mon, 8 Jul 2013 17:30:44 +0000 (18:30 +0100)]
glsl: Silence unused variable warning in the release build

Resolves the following gcc warning

 opt_flip_matrices.cpp:84:32: warning: unused variable 'deref'

v2: keep the variable, but wrap it in a ifndef NDEBUG block
    (suggested by Ian)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl/ast: Silence uninitialized variable warnings in the release build 81/7381/1
Emil Velikov [Mon, 8 Jul 2013 17:29:17 +0000 (18:29 +0100)]
glsl/ast: Silence uninitialized variable warnings in the release build

Resolves the following gcc warnings

 warning: 'iface_type_name' may be used uninitialized in this function
 warning: 'var_mode' may be used uninitialized in this function

Note: The variables are initialised to UNKNOWN and ir_var_auto

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agoi965: Add an assertion to brwProgramStringNotify. 80/7380/1
Paul Berry [Tue, 2 Jul 2013 15:02:47 +0000 (08:02 -0700)]
i965: Add an assertion to brwProgramStringNotify.

driver->ProgramStringNotify is only called for ARB programs, fixed
function vertex programs, and ir_to_mesa (which isn't used by the i965
back-end).  Therefore, even after geometry shaders are added,
brwProgramStringNotify should only ever be called with a target of
GL_VERTEX_PROGRAM_ARB or GL_FRAGMENT_PROGRAM_ARB.

This patch adds an assertion to clarify that.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoglsl: Allow non-constant expression initializers of const-qualified vars. 79/7379/1
Matt Turner [Thu, 23 May 2013 18:48:40 +0000 (11:48 -0700)]
glsl: Allow non-constant expression initializers of const-qualified vars.

Required by ARB_shading_language_420pack.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor600g: improve the mechanism for recognizing an empty CS 78/7378/1
Marek Olšák [Sun, 30 Jun 2013 16:29:17 +0000 (18:29 +0200)]
r600g: improve the mechanism for recognizing an empty CS

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: explicitly flush caches for streamout-based buffer copying & clearing 77/7377/1
Marek Olšák [Mon, 1 Jul 2013 00:31:22 +0000 (02:31 +0200)]
r600g: explicitly flush caches for streamout-based buffer copying & clearing

It's done automatically for vertex buffers, but not for constant buffers,
textures, and colorbuffers.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: only flush the caches that need to be flushed during CP DMA operations 76/7376/1
Marek Olšák [Sun, 30 Jun 2013 17:57:59 +0000 (19:57 +0200)]
r600g: only flush the caches that need to be flushed during CP DMA operations

This should increase performance if constant uploads are done with the CP DMA,
because only the cache that needs to be flushed is flushed.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: split INVAL_READ_CACHES into vertex, tex, and const cache flags 75/7375/1
Marek Olšák [Sun, 30 Jun 2013 15:01:24 +0000 (17:01 +0200)]
r600g: split INVAL_READ_CACHES into vertex, tex, and const cache flags

also flushing any cache in evergreen_emit_cs_shader seems to be superfluous
(we don't flush caches when changing the other shaders either)

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: adjust flush flags (v3) 74/7374/1
Alex Deucher [Sun, 23 Jun 2013 17:36:42 +0000 (13:36 -0400)]
r600g: adjust flush flags (v3)

1. flush SH with read caches
2. add flag for DB flushes
3. add flag for CB flushes

v2: flush all CBs, remove redundant emit_state variable.
v3: Marek: also set the new flags in r600_context_flush, the CP dma functions,
    and texture_barrier, and rename them

Signed-off-by: Marek Olšák <maraeo@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: don't call buffer_wait in buffer_mmap_sync_with_rings 73/7373/1
Marek Olšák [Sun, 30 Jun 2013 12:57:17 +0000 (14:57 +0200)]
r600g: don't call buffer_wait in buffer_mmap_sync_with_rings

The winsys should do this, because it measures how much time we spend
in buffer_map doing synchronization, which can be viewed with the gallium
HUD.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: don't read back the MSAA depth buffer if the read flag is not set 72/7372/1
Marek Olšák [Sun, 30 Jun 2013 12:55:06 +0000 (14:55 +0200)]
r600g: don't read back the MSAA depth buffer if the read flag is not set

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: don't flush the context in texture_transfer_map 71/7371/1
Marek Olšák [Sun, 30 Jun 2013 12:53:03 +0000 (14:53 +0200)]
r600g: don't flush the context in texture_transfer_map

the winsys does this automatically

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: fix texture offset computation for mapped MSAA depth buffers 70/7370/1
Marek Olšák [Sun, 30 Jun 2013 12:34:23 +0000 (14:34 +0200)]
r600g: fix texture offset computation for mapped MSAA depth buffers

It was wrong, because the offset shouldn't be applied to MSAA depth buffers.
This small cleanup should prevent such issues in the future.

This fixes a lockup in "piglit/fbo-depthstencil default_fb -samples=n".

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: fix color resolve for RGBX8 and RGBX16 integer formats 69/7369/1
Marek Olšák [Mon, 1 Jul 2013 00:36:37 +0000 (02:36 +0200)]
r600g: fix color resolve for RGBX8 and RGBX16 integer formats

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: enable fast MSAA color clear for array/3D/cube textures 68/7368/1
Marek Olšák [Mon, 1 Jul 2013 00:29:50 +0000 (02:29 +0200)]
r600g: enable fast MSAA color clear for array/3D/cube textures

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agor600g: implement fast MSAA color clear for integer textures 67/7367/1
Marek Olšák [Mon, 1 Jul 2013 00:57:21 +0000 (02:57 +0200)]
r600g: implement fast MSAA color clear for integer textures

this also fixes the fast clear with multiple colorbuffers and each having
a different format

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>