mesa.git
8 years agomesa: Bump version to 9.2-rc1mesa-9.2-rc1
Ian Romanick [Mon, 19 Aug 2013 23:49:02 +0000 (19 16:49 -0700)]
mesa: Bump version to 9.2-rc1

8 years agoglsl: Use alignment of container record for its first field
Ian Romanick [Sat, 17 Aug 2013 07:27:43 +0000 (17 00:27 -0700)]
glsl: Use alignment of container record for its first field

The first field of a record in a UBO has the aligment of the record
itself.

Fixes piglit vs-struct-pad, fs-struct-pad, and (with the patch posted to
the piglit list that extends the test) layout-std140.

NOTE: The bit of strangeness with the version of visit_field without the
record_type poitner is because that method is pure virtual in the base
class.  The original implementation of the class did this to ensure
derived classes remembered to implement that flavor.  Now they can
implement either flavor but not both.  I don't know a C++ way to enforce
that.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=68195
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 574e4843e9e26aa6affa31c80ac42f745b68268b)

8 years agoglsl: Add new overload of program_resource_visitor::visit_field method
Ian Romanick [Sat, 17 Aug 2013 06:30:43 +0000 (16 23:30 -0700)]
glsl: Add new overload of program_resource_visitor::visit_field method

The outer-most record is passed into the visit_field method for
the first field.  In other words, in the following structure:

    struct S1 {
        vec4 v;
        float f;
    };

    struct S {
        S1 s1;
        S1 s2;
    };

    uniform Ubo {
        S s;
    };

s.s1.v would get record_type = S (because s1.v is the first non-record
field in S), and s.s2.v would get record_type = S1.  s.s1.f and s.s2.f
would get record_type = NULL becuase they aren't the first field of
anything.

This new overload isn't used yet, but the next patch will add several
uses.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Cc: "9.2 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 5ac884fd9f213baed1de52eb7d17b86455c48a02)

8 years agoglsl: Disallow embedded structure definitions
Ian Romanick [Tue, 13 Aug 2013 16:15:01 +0000 (13 09:15 -0700)]
glsl: Disallow embedded structure definitions

Continue to allow them in GLSL 1.10 because the spec allows it.
Generate an error in all other versions because the specs specifically
disallow it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d9bb8b7b56ce65bbf6909419aa6d3d69ccd34c08)

8 years agometa: Add default precision qualifier to all fragement shaders
Ian Romanick [Fri, 9 Aug 2013 23:25:17 +0000 (9 16:25 -0700)]
meta: Add default precision qualifier to all fragement shaders

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5fb1dd51f3845985b9389987a1c6337e7fafeabc)

8 years agoglsl: Add default precision qualifiers for ES builtins
Ian Romanick [Fri, 9 Aug 2013 22:02:49 +0000 (9 15:02 -0700)]
glsl: Add default precision qualifiers for ES builtins

Once the compiler proplerly checks for default precision qualifiers,
these shaders will cease to compile.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5ac247a73e78c6df7a3980c84e6207c3da601987)

8 years agoglsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE
Marek Olšák [Fri, 9 Aug 2013 20:34:45 +0000 (9 22:34 +0200)]
glsl: don't eliminate texcoords that can be set by GL_COORD_REPLACE

Tested by examining generated TGSI shaders from piglit/glsl-routing.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Henri Verbeet <hverbeet@gmail.com>
Tested-by: Henri Verbeet <hverbeet@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit d13003f544417db6de44c65a0c118bd2b189458a)

8 years agonv50: allow non-nv12 buffers to be created, just pass them through to vl
Ilia Mirkin [Sat, 17 Aug 2013 14:53:09 +0000 (17 10:53 -0400)]
nv50: allow non-nv12 buffers to be created, just pass them through to vl

Since we expose non-NV12 formats as supported when there is no decoer
profile selected, make sure that those formats are actually allowed to
be allocated.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit a8346a2f52d08233d376db3aa8205d0b2cc74318)

8 years agometa: Fix blitting a framebuffer with renderbuffer attachment
Anuj Phogat [Mon, 5 Aug 2013 21:27:47 +0000 (5 14:27 -0700)]
meta: Fix blitting a framebuffer with renderbuffer attachment

This patch fixes a case of framebuffer blitting with renderbuffer
as color attachment and GL_LINEAR filter. Meta implementation of
glBlitFrambuffer() converts source color buffer to a texture and
uses it to do the scaled blitting in to destination buffer. Using
the exact source rectangle to create the texture does incorrect
linear filtering along the edges. This patch makes the changes to
extend the texture edges by one pixel in x, y directions. This
ensures correct linear filtering.
It fixes failing piglit fbo-attachments-blit-scaled-linear test.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit d944a6144f6ee6a0b24126ce72de280db90038c9)

8 years agonv30: remove no-longer-used formats from table
Ilia Mirkin [Thu, 15 Aug 2013 23:52:48 +0000 (15 19:52 -0400)]
nv30: remove no-longer-used formats from table

Commit 14ee790df77 removed the formats from the vtxfmt_table but forgot
to also update the info_table.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c1a6f59b20dab380b77ad1375062f9987cad9183)

8 years agoi965: Force X-tiling for 128 bpp formats on Sandybridge.
Kenneth Graunke [Tue, 13 Aug 2013 22:03:12 +0000 (13 15:03 -0700)]
i965: Force X-tiling for 128 bpp formats on Sandybridge.

128 bpp formats are not allowed to be Y-tiled on any architectures
except Gen7.

+11 Piglits on Sandybridge (mostly regression fixes since the
switch to Y-tiling).

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63867
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64261
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit c189840b21e176d87cbb382e64e848061b8c7b06)

8 years agomesa/program: remove useless YYID
Laurent Carlier [Fri, 16 Aug 2013 17:51:49 +0000 (16 10:51 -0700)]
mesa/program: remove useless YYID

This fixes the build with Bison 3.0. Also works with Bison 2.7.1.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5ffa28df4e4cc22481b4ed41c78632f35765f41d)

8 years agomesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts
Ian Romanick [Wed, 7 Aug 2013 18:15:41 +0000 (7 11:15 -0700)]
mesa/vbo: Fix handling of attribute 0 in non-compatibilty contexts

It is only in OpenGL compatibility-style contexts where generic
attribute 0 and GL_VERTEX_ARRAY have a bizzare, aliasing relationship.
Moreover, it is only in OpenGL compatibility-style contexts and OpenGL
ES 1.x where one of these attributes provokes the vertex.  In all other
APIs each implicit call to glArrayElement provokes a vertex regardless
of which attributes are enabled.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Robert Bragg <robert@sixbynine.org>
Cc: "9.0 9.1 9.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55503
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66292
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67548
(cherry picked from commit 41eef83cc030e7087b79b0070d00fbc56538fb81)

8 years agoi915,i965: Fix memory leak in try_pbo_upload (v2)
Vinson Lee [Fri, 2 Aug 2013 06:04:27 +0000 (1 23:04 -0700)]
i915,i965: Fix memory leak in try_pbo_upload (v2)

Fixes "Resource leak" defect reported by Coverity.
Tested on Haswell, no Piglit regressions.

v2: Apply to i965, not just i915. (chadv)

CC: "9.2, 9.1" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 035bf2198368d3fa69387788a63039d71319f0bf)

8 years agoradeonsi: Don't leave gaps between position exports from vertex shader
Michel Dänzer [Wed, 7 Aug 2013 16:14:16 +0000 (7 18:14 +0200)]
radeonsi: Don't leave gaps between position exports from vertex shader

If the vertex shader exports clip distances but not point size, use
position exports 1/2 instead of 2/3 for the clip distances. Fixes
geometry corruption in that case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66974

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit b00269aa5887b88d2e037d6bfa374779902f8743)

8 years agollvmpipe: fix stencil bug if we have both stencil and depth tests
Roland Scheidegger [Thu, 15 Aug 2013 14:50:27 +0000 (15 16:50 +0200)]
llvmpipe: fix stencil bug if we have both stencil and depth tests

This is a very well hidden bug found by accident (only the fixed glean
tstencil2 test so far seems to hit it).
We must use new mask with combined s_pass values and orig_mask values
for zpass/zfail stencil ops, otherwise both the sfail op and one of
zpass/zfail op are applied (probably not hit in most tests because
some of the ops tend to be KEEP usually).

Note: this is a candidate for the 9.2 branch.

Reviewed-by: Zack Rusin <zackr@vmware.com>
(cherry picked from commit abdd32dcd5569c7caa393acd21753e03de24047f)

8 years agonv30: U8_USCALED only works for size 4
Ilia Mirkin [Wed, 14 Aug 2013 05:08:38 +0000 (14 01:08 -0400)]
nv30: U8_USCALED only works for size 4

See https://bugs.freedesktop.org/show_bug.cgi?id=61635 for a sample
program. Changing it to use a vec4 makes it work. Remove the unsupported
formats.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "9.2 and 9.1" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 14ee790df77c810f187860a8d51096173ff39fcf)

8 years agoglsl: Emit better warnings for things that look like default precision statements
Ian Romanick [Fri, 9 Aug 2013 20:32:40 +0000 (9 13:32 -0700)]
glsl: Emit better warnings for things that look like default precision statements

Previously we would emit a warning for empty declarations like

float;

We would also emit the same warning for things like

highp float;

However, this second case is most likely the application trying to set
the default precision.  This makes the compiler generate a stronger
warning with some suggestion of a fix.

It really seems like this should be an error.  I'll bet that 100% of the
time someone writes 'highp float;' the actually meant 'precision highp
float;'.  Alas, both AMD and NVIDIA accept this syntax, and the spec
doesn't explicitly forbid it.

This makes piglit's precision-05.vert generate the following warnings:

0:12(11): warning: empty declaration with precision qualifier, to set the default precision, use `precision lowp float;'
0:13(12): warning: empty declaration with precision qualifier, to set the default precision, use `precision mediump int;'

v2: Add { } around a one-line if body and fix a comment.  Suggested by
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 830f4df993b41fc90c776b19f77f77a29ce0e7f4)

8 years agodraw: always call util_cpu_detect() in draw context creation.
Roland Scheidegger [Tue, 23 Jul 2013 23:38:50 +0000 (24 01:38 +0200)]
draw: always call util_cpu_detect() in draw context creation.

Since disabling denorms in draw_vbo() we require the util_cpu_caps to be
initialized there. Hence add another util_cpu_detect() call in
draw_create_context() which should ensure this.
(There is another call in draw_get_option_use_llvm() which only gets called
with x86 (not x86_64) but calling it always there wouldn't help since it most
likely wouldn't get called when compiling without llvm, so leave it alone
there.)
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=66806.
(Because util_cpu_caps wasn't initialized when first calling util_fpstate_get()
hence it returning zero, but it would later get initialized by rtasm translate
code hence when draw call returned it unmasked all exceptions by calling
util_fpstate_set(). This was happening only with DRAW_USE_LLVM=0 or not
compiling with llvm, otherwise the llvm init code was calling it on time too.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
Tested-by: Vinson Lee <vlee@freedesktop.org>
8 years agoradeon/llvm: Add missing "%s" format string to fprintf.
Jon Severinsson [Sun, 11 Aug 2013 17:37:01 +0000 (11 19:37 +0200)]
radeon/llvm: Add missing "%s" format string to fprintf.

This fixes a compilation warning with -Wformat-security.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 9298f537a72dc2323898e91c40894f55e3c4754a)

8 years agoglsl: disable ARB_texture_cube_map_array_enable keywords for glsl es
Tapani Pälli [Fri, 26 Jul 2013 07:21:56 +0000 (26 10:21 +0300)]
glsl: disable ARB_texture_cube_map_array_enable keywords for glsl es

Patch fixes a crash with Webgl 'shader-with-non-reserved-words'
conformance test by ignoring desktop extension keywords on GLSL ES.

v2: fix reserved and allowed desktop glsl versions (Chris)

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 8c211dd742669bc03b44186e41e5aa40081d6bcc)

8 years agogbm: Link to libwayland-drm if Wayland EGL platform is enabled
Armin K [Tue, 13 Aug 2013 22:38:56 +0000 (13 15:38 -0700)]
gbm: Link to libwayland-drm if Wayland EGL platform is enabled

We were relying on libEGL to pull in libwayland-client symbols, but with
commit 2c2e64edaba0f6aeb181ca5b51eb8dea8e9b39f9 cleaned up the
symbol leak.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67962
Tested-by: Bryce Harrington <b.harrington@samsung.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit f423eba46e080b975a2b8366b490d99dee4729ad)

8 years agoglsl: Require function return type arrays be explicitly sized
Ian Romanick [Fri, 9 Aug 2013 00:40:38 +0000 (8 17:40 -0700)]
glsl: Require function return type arrays be explicitly sized

Fixes piglit array-function-return-unsized.vert.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 1b35e33af420cd335610289aa2d8a175a7139a97)

8 years agoglsl: Move and refine test for unsized arrays in GLSL ES
Ian Romanick [Fri, 9 Aug 2013 00:23:01 +0000 (8 17:23 -0700)]
glsl: Move and refine test for unsized arrays in GLSL ES

GLSL ES does not allow unsized arrays, and GLSL ES 1.00 does not allow
array initializers.  However, GLSL ES 3.00 allows array initializers,
and the initializer can explicitly size the array.  The specification
even includes some examples of this:

    float x[] = float[2] (1.0, 2.0);     // declares an array of size 2
    float y[] = float[] (1.0, 2.0, 3.0); // declares an array of size 3

    float a[5];
    float b[] = a;

Move the unsized array check to after the initializer has been
processed.  If the array is still unsized, generate the error.  This
should have no effect in GLSL ES 1.00 because, as previously mentioned,
array initializers are not allowed.

Fixes piglit "glsl-es-3.00 compiler array-sized-by-initializer.vert".

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 42624b1c8145375f987e380bb78456658f845a17)

8 years agoglx: Generate GLXBadDrawable when drawable is zero
Ian Romanick [Fri, 9 Aug 2013 01:17:24 +0000 (8 18:17 -0700)]
glx: Generate GLXBadDrawable when drawable is zero

Fixes piglit glx-query-drawable-GLXBadDrawable.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d5aee174b88878e6d47dc1fadd3935f535fd85f0)

8 years agomesa: Use _mesa_detach_renderbuffer when deleting a texture
Ian Romanick [Thu, 8 Aug 2013 22:41:36 +0000 (8 15:41 -0700)]
mesa: Use _mesa_detach_renderbuffer when deleting a texture

The functional change is that now invalidate_framebuffer is called if
the texture is actually detached from one of the currently bound FBOs.
Previously this was only done for renderbuffers.

The remaining changes make the texture delete path look more similar to
the renderbuffer delete path.  This includes adding relevant spec
quotations to justify the behavior.

Fixes piglit fbo-incomplete "delete texture of bound FBO" test.

v2: Move 'fb->Attachment[i].Texture == att' check from previous patch to
this patch... where it was intended to be in the first place.  Noticed
by Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit ef83bd2b9581c680439a5d22979c2f1b49b2834d)

8 years agomesa: Make detach_renderbuffer available outside fbobject.c
Ian Romanick [Thu, 8 Aug 2013 22:26:36 +0000 (8 15:26 -0700)]
mesa: Make detach_renderbuffer available outside fbobject.c

Also add a return value indicating whether any work was done.

This will be used by the next patch.

v2: Move 'fb->Attachment[i].Texture == att' check to the next
patch... where it was intended to be in the first place.  Noticed by
Chad.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 438cc6bc49d109f9ddeed6a741c4f0b8f1c4ffe2)

8 years agometa: Don't call _mesa_Ortho with width or height of 0
Ian Romanick [Thu, 8 Aug 2013 19:33:04 +0000 (8 12:33 -0700)]
meta: Don't call _mesa_Ortho with width or height of 0

Fixes failures in oglconform fbo mipmap.manual.color,
mipmap.manual.colorAndDepth, mipmap.automatic, and
mipmap.manualIterateTexTargets subtests.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 341fb93c162052e0b1eff7f5e53c49aba498ee9a)

8 years agor600g/sb: use MULADD workaround on R7xx for MULADD_IEEE
Vadim Girlin [Sat, 10 Aug 2013 22:52:34 +0000 (11 02:52 +0400)]
r600g/sb: use MULADD workaround on R7xx for MULADD_IEEE

Looks like the same issue that was seen with MULADD in trans slot on
R7xx also affects MULADD_IEEE (maybe all OP3 instructions and MULADD is
just a most frequently used?). So the workaround is to not allow affected
instructions to be placed into the trans slot.

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

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 17bb96b03d340c0aee8e1a332fdcd695e9179486)

8 years agoglsl: Don't allow const on out or inout function parameters
Ian Romanick [Thu, 8 Aug 2013 23:42:37 +0000 (8 16:42 -0700)]
glsl: Don't allow const on out or inout function parameters

Fixes piglit tests const-inout-parameter.frag and
const-out-parameter.frag.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 58948981480c1fe93a171373c7676761e4d0b41e)

8 years agor600g: disable GPUVM by default
Alex Deucher [Fri, 9 Aug 2013 01:11:22 +0000 (8 21:11 -0400)]
r600g: disable GPUVM by default

Cayman and trinity systems still seem to suffer from
stability problems with GPUVM.  This also fixes compute
on these asics.  It can still be enabled for testing
by setting env var RADEON_VA=true.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: "9.1" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit c88783047e2a0faa39d6f3ac6fbd3f26a480d5d3)

8 years agoegl: Do not export private symbols
Chad Versace [Thu, 1 Aug 2013 15:10:31 +0000 (1 08:10 -0700)]
egl: Do not export private symbols

libEGL was incorrectly exporting *all* symbols, public and private.
This patch adds -fvisibility=hidden to libEGL's linker flags to ensure
that only symbols annotated with __attribute__((visibility("default")))
get exported.

Sanity-checked with libEGL's builtin DRI2 driver and the i965 DRI driver
by running Piglit on X/EGL and by running weston-gears on Weston as an
X client.

Sanity-checked with libEGL's Gallium driver (which is not built-in) and
the swrast Gallium driver by running es2gears_x11.

Kristian reviewed the symbol diff in `nm libEGL.so`.

CC: "9.2" <mesa-stable@lists.freedesktop.org>
CC: Ian Romanick <idr@freedesktop.org>
Acked-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 2c2e64edaba0f6aeb181ca5b51eb8dea8e9b39f9)

8 years agoi965: Remember to call intel_prepare_render() before blitting.
Kenneth Graunke [Tue, 6 Aug 2013 21:36:09 +0000 (6 14:36 -0700)]
i965: Remember to call intel_prepare_render() before blitting.

Otherwise, blits to the window system buffer may cause crashes,
since dst_irb->mt may be NULL.

This code is lifted straight out of brw_blorp_framebuffer()'s
try_blorp_blit() helper.

Fixes crashes in Piglit's fbo-sys-blit on systems without BLORP.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=65919
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Cc: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit fb3d62fe3d4fc40ba4ad9804d8b6f451316c9ae2)

8 years agor300g/compiler/tests: Pass the required LDFLAGS when building the test program
Tom Stellard [Thu, 8 Aug 2013 00:26:17 +0000 (7 17:26 -0700)]
r300g/compiler/tests: Pass the required LDFLAGS when building the test program

CC: "9.2 <mesa-stable@lists.freedesktop.org>"
(cherry picked from commit d0c13fba172c56c3670bc8bebf453d98e455d482)

8 years agor300g/compiler/tests: Fix segfault
Tom Stellard [Thu, 8 Aug 2013 00:26:01 +0000 (7 17:26 -0700)]
r300g/compiler/tests: Fix segfault

CC: "9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit d691ba4d9412b68dd56a300549bafc733e1bb7ee)

8 years agonv50: handle pure integer vertex attributes
Emil Velikov [Fri, 21 Jun 2013 17:04:55 +0000 (21 18:04 +0100)]
nv50: handle pure integer vertex attributes

And as a side effect fix a crash in the following piglit test:
general/attribs GL3

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Cc: "9.2 and 9.1" mesa-stable@lists.freedesktop.org
(cherry picked from commit 07c8f7a6f8dfe724c1ae92ec45dd04532b6fd453)

8 years agomesa: Generate a renderbuffer wrapper even if the texture has no image
Ian Romanick [Sun, 28 Jul 2013 20:08:27 +0000 (28 13:08 -0700)]
mesa: Generate a renderbuffer wrapper even if the texture has no image

This prevents a segfault in check_begin_texture_render when an FBO is
rebound while in this state.  This fixes the piglit test
fbo-incomplete-invalid-texture.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 2f9fe2d80a35b8857682771fddbee628213da7b3)

8 years agomesa: Validate the layer selection of an array texture too
Ian Romanick [Sat, 27 Jul 2013 19:27:45 +0000 (27 12:27 -0700)]
mesa: Validate the layer selection of an array texture too

Previously only the slice of a 3D texture was validated in the FBO
completeness check.  This fixes the failure in the 'invalid layer of an
array texture' subtest of piglit's fbo-incomplete test.

v2: 1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

v3: Handle CUBE_MAP_ARRAY textures too.  Noticed by Marek.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 25281fef0f480260c2e180e70af3eafdd5ecc9cd)

8 years agomesa: Don't call driver RenderTexture for invalid zoffset
Ian Romanick [Sat, 27 Jul 2013 19:16:56 +0000 (27 12:16 -0700)]
mesa: Don't call driver RenderTexture for invalid zoffset

This fixes the segfault in the 'invalid slice of 3D texture' and
'invalid layer of an array texture' subtests of piglit's fbo-incomplete
test.

The 'invalid layer of an array texture' subtest still fails.

v2: Fix off-by-one comparison error noticed by Chris Forbes.  Also,
1D_ARRAY textures have Depth == 1.  Instead, compare against Height.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 41485fea7c6061cca9d2706f39fa425da291b260)

8 years agomesa: Don't call driver RenderTexture for really broken textures
Ian Romanick [Sat, 27 Jul 2013 19:04:20 +0000 (27 12:04 -0700)]
mesa: Don't call driver RenderTexture for really broken textures

This fixes the segfault in the '0x0 texture' subtest of piglit's
fbo-incomplete test.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit fb49713f8ed099559d255403dc1065a06305e0d8)

8 years agomesa: Remove stray debug printfs in attachment completeness code
Ian Romanick [Sat, 27 Jul 2013 19:03:45 +0000 (27 12:03 -0700)]
mesa: Remove stray debug printfs in attachment completeness code

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 0c3dbd689b3269c605ee07589a35af9147db5fe0)

8 years agomesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctly
Ian Romanick [Fri, 19 Jul 2013 00:39:22 +0000 (18 17:39 -0700)]
mesa: Treat glBindFramebuffer and glBindFramebufferEXT more correctly

Allow user-generated names for glBindFramebufferEXT on desktop GL.
Disallow its use altogether for core profiles.

Names bound with glBindFramebuffer in desktop OpenGL are still
(incorrectly) shared across the share group instead of being
per-context.  This gets us a bit closer to being strictly conformant.

v2: Disallow glBindFramebufferEXT in 3.1 by not installing it in the
dispatch table.  Suggested by Jordan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 4a9522a5a0c11b6e162188337fd5938f9e2695fd)

8 years agomesa: Treat glBindRenderbuffer and glBindRenderbufferEXT correctly
Ian Romanick [Fri, 19 Jul 2013 00:38:16 +0000 (18 17:38 -0700)]
mesa: Treat glBindRenderbuffer and glBindRenderbufferEXT correctly

Allow user-generated names for glBindRenderbufferEXT on desktop GL.
Disallow its use altogether for core profiles.

v2: Disallow glBindRenderbufferEXT in 3.1 by not installing it in the
dispatch table.  Suggested by Jordan.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> [v1]
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com> [v1]
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 97965e87fc0771a99c16b639caed01e5d0b64353)

8 years agomesa: Disable GL_EXT_framebuffer_object in core profiles and OpenGL 3.1
Ian Romanick [Thu, 18 Jul 2013 23:48:49 +0000 (18 16:48 -0700)]
mesa: Disable GL_EXT_framebuffer_object in core profiles and OpenGL 3.1

GL_EXT_framebuffer_object differs from GL_ARB_framebuffer_object in ways
that we can't and don't implement in core profiles.  Exposing it is a
lie, so we shouldn't do that.

It's possible the some other GL_EXT_framebuffer_* extensions should be
disabled, but it's not quite so clear cut.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b55c1638ad0da8980837376e44cffa41bb47b9d1)

8 years agoMakefile.am: Remove api_exec_es* from EXTRA_FILES.
Matt Turner [Fri, 2 Aug 2013 16:51:25 +0000 (2 09:51 -0700)]
Makefile.am: Remove api_exec_es* from EXTRA_FILES.

These files were removed in commits a0102154 and a8ab7e33.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
8 years agost/dri: add a new driconf option disable_shader_bit_encoding for Unigine
Marek Olšák [Tue, 30 Jul 2013 20:29:27 +0000 (30 22:29 +0200)]
st/dri: add a new driconf option disable_shader_bit_encoding for Unigine

Now Unigine Heaven 3.0 finally works with r600g.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7568a89500c35f14cbd397f87c77acc915afc672)

8 years agomesa,glsl,st/dri: add a new driconf option force_glsl_version for Unigine
Marek Olšák [Tue, 30 Jul 2013 20:29:24 +0000 (30 22:29 +0200)]
mesa,glsl,st/dri: add a new driconf option force_glsl_version for Unigine

See documentation in mtypes.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 0f6a7cb00c86fbdb415b01450bb1ece8cfe1e31d)

8 years agodriconf: enable app-specific workarounds for all drivers
Marek Olšák [Tue, 30 Jul 2013 20:29:22 +0000 (30 22:29 +0200)]
driconf: enable app-specific workarounds for all drivers

They were only enabled for i965.

Note that drirc must be installed in /etc.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7f2f804c75f6c7451c3630cb48e4675686bd68a7)

8 years agost/dri: remove more unused driconf options
Marek Olšák [Tue, 30 Jul 2013 20:29:19 +0000 (30 22:29 +0200)]
st/dri: remove more unused driconf options

vblank_mode is read by dri_util.c and falls under the "dri2" driver name,
which is not connected to the actual Mesa/Gallium driver in any way.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 772070527f6a6db72505575d6571470280a131ab)

8 years agost/dri: implement the driconf option force_s3tc_enable properly
Marek Olšák [Tue, 30 Jul 2013 20:29:18 +0000 (30 22:29 +0200)]
st/dri: implement the driconf option force_s3tc_enable properly

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 83dbe61ea4308638f1c041d2f550f0f719e36967)

8 years agodriconf: remove the unused option allow_large_textures
Marek Olšák [Tue, 30 Jul 2013 20:29:17 +0000 (30 22:29 +0200)]
driconf: remove the unused option allow_large_textures

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit f27f3a4b15449e9ba3c0ee4e01b9db753e48e55f)

8 years agost/dri: support the driconf option disable_blend_func_extended
Marek Olšák [Tue, 30 Jul 2013 20:29:16 +0000 (30 22:29 +0200)]
st/dri: support the driconf option disable_blend_func_extended

This is needed for Unigine.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2acc27cc6de5cae395d19017daf86ddd8de704cf)

8 years agost/osmesa: initialize disable_glsl_line_continuations
Marek Olšák [Tue, 30 Jul 2013 20:29:15 +0000 (30 22:29 +0200)]
st/osmesa: initialize disable_glsl_line_continuations

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 71e0b5d688e8442c4c19d905db84caad94314d5e)

8 years agoradeonsi: Number of SGPRs retrieved from LLVM already includes VCC
Michel Dänzer [Tue, 6 Aug 2013 08:45:50 +0000 (6 10:45 +0200)]
radeonsi: Number of SGPRs retrieved from LLVM already includes VCC

Fixes spurious 'Assertion `num_sgprs <= 104' failed.' with shaders using
all 104 SGPRs.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
(cherry picked from commit 46b6f79fea1042604ebb61a8214188fb807316ff)

8 years agodocs: Document UVD (2.2 and 3.0) video decoding support in mesa 9.2
Andreas Boll [Fri, 2 Aug 2013 09:22:23 +0000 (2 11:22 +0200)]
docs: Document UVD (2.2 and 3.0) video decoding support in mesa 9.2

Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 9d569fed8dec675446d37ff9d8b16554b18e542e)

8 years agodocs: Document that i965 Gen6+ requires Kernel 3.6 or later
Andreas Boll [Fri, 2 Aug 2013 09:22:09 +0000 (2 11:22 +0200)]
docs: Document that i965 Gen6+ requires Kernel 3.6 or later

Cc: "9.2" mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ec4a6a94b1d7b88f0310c089ea556df274cce93b)

8 years agonvc0: properly align NVE4_COMPUTE_MP_TEMP_SIZE
Samuel Pitoiset [Thu, 25 Jul 2013 08:35:33 +0000 (25 10:35 +0200)]
nvc0: properly align NVE4_COMPUTE_MP_TEMP_SIZE

MP_TEMP_SIZE must be aligned to 0x8000, while TEMP_SIZE on NVE4_3D
must be aligned to 0x20000, so perform both alignments to be sure
we allocate enough space (actually the bo will most likely use 128
KiB pages and not aligning to that would be a waste anyway).

Cc: "9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit ef6d5ee9f34bce89c8bb8ff001be4c70a2a5421d)

8 years agomesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.
Kenneth Graunke [Mon, 29 Jul 2013 23:03:46 +0000 (29 16:03 -0700)]
mesa/program: Switch from the deprecated YYLEX_PARAM to %lex-param.

YYLEX_PARAM is no longer supported as of Bison 3.0.  Instead, the Bison
developers recommend using %lex-param.

%lex-param takes a type and variable name, similar to %parse-param,
so you can't pass an arbitrary expression like state->scanner.  But Flex
insists on passing the actual scanner object, not an arbitrary object
like state.

To solve this, the parser defines a wrapper lex() function which accepts
"state," and calls Flex's lex() function with state->scanner.

Fixes the build with Bison 3.0.  Also works with Bison 2.7.1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit 6d2a9220b832d9a0c0cf35fcc5b9de1542af267d)

8 years agomesa/program: Change the program parser's namespace.
Kenneth Graunke [Mon, 29 Jul 2013 22:55:06 +0000 (29 15:55 -0700)]
mesa/program: Change the program parser's namespace.

Bison 3.0 removes the YYLEX_PARAM macro.  In preparation for handling
this using %lex-param, the parser needs a wrapper function for the
actual Flex lex() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit de917b4c4c4dfc949d5f8e3d9eb2dd48b63a3de5)

8 years agoglsl: Switch from the deprecated YYLEX_PARAM to %lex-param.
Kenneth Graunke [Mon, 29 Jul 2013 22:28:59 +0000 (29 15:28 -0700)]
glsl: Switch from the deprecated YYLEX_PARAM to %lex-param.

YYLEX_PARAM is no longer supported as of Bison 3.0.  Instead, the Bison
developers recommend using %lex-param.

%lex-param takes a type and variable name, similar to %parse-param,
so you can't pass an arbitrary expression like state->scanner.  But Flex
insists on passing the actual scanner object, not an arbitrary object
like state.

To solve this, the parser defines a wrapper lex() function which accepts
"state," and calls Flex's lex() function with state->scanner.

Fixes the build with Bison 3.0.  Also works with Bison 2.7.1.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit f043381334a0760ec118d07b6fb7785b5692572a)

8 years agoglsl: Change the lexer's namespace.
Kenneth Graunke [Mon, 29 Jul 2013 22:27:46 +0000 (29 15:27 -0700)]
glsl: Change the lexer's namespace.

Bison 3.0 removes the YYLEX_PARAM macro.  In preparation for handling
this using %lex-param, the parser needs a wrapper function for the
actual Flex lex() function.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67354
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Laurent Carlier <lordheavym@gmail.com>
Cc: "9.2" mesa-stable@lists.freedesktop.org
(cherry picked from commit eb7c8c7fb6e49a04f3fe84a6d438160dc4a14ac0)

8 years agoegl: Restore "bogus" DRI2 invalidate event code.
Eric Anholt [Fri, 21 Jun 2013 22:34:52 +0000 (21 15:34 -0700)]
egl: Restore "bogus" DRI2 invalidate event code.

I had removed it in commit 1e7776ca2bc59a6978d9b933d23852d47078dfa8
because it was obviously wrong -- why do we care whether the server is a
version that emits events, if we're not watching for the server's events,
anyway?  And why would you only invalidate on a server that emits
invalidate events, when the comment said to emit invalidates if the server
*doesn't*?  Only, I missed that we otherwise don't flag that our buffers
might have changed at swap time at all, so the driver was only checking
for new buffers when triggered by the Viewport hack.  Of course you don't
expect Viewport to be called after a swap.

So, this is effectively a revert of the previous commit, except that I
dropped the check for only emitting invalidates on a new server -- we
*always* need to invalidate if we're doing a SwapBuffers.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63435
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: "9.1 and 9.2" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit eed0a80137dfac641adfd39ce316938dbcf2be10)

8 years agomesa: fix multisampling proxy textures not being queryable
Mikko Juola [Tue, 30 Jul 2013 17:39:00 +0000 (30 20:39 +0300)]
mesa: fix multisampling proxy textures not being queryable

The code that checks if some texture target is valid for
glGetTexLevelParameter*() was not programmed to check for multisampling
proxy textures.  This made it impossible(?) to use the proxy textures
for their intended purpose as glGetTexLevelParameter*() would just fail
on you.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 8624a514c21e00ec51d4d9d2f4aee315378357ae)

8 years agomesa: fix proxy textures becoming immutable and unusable
Mikko Juola [Tue, 30 Jul 2013 03:36:43 +0000 (30 06:36 +0300)]
mesa: fix proxy textures becoming immutable and unusable

glTexStorage*() functions make textures immutable.  This carries on to
proxy textures.  Error checking in texture storage functions prevents
proxy textures from working after first time because internally, they
became immutable.

This commit makes the error checking ignore the immutability flag when
working with proxy textures.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit e404105e7dc192ddfb88b80df4238a97caedf32e)

8 years agomesa: fix proxy textures not working with default texture binding
Mikko Juola [Tue, 30 Jul 2013 03:29:54 +0000 (30 06:29 +0300)]
mesa: fix proxy textures not working with default texture binding

When working with the glTexStorage*() functions, the error checking
checks that a non-default (i.e., non-zero) texture is currently bound.
However, this check made glTexStorage*() functions fail with proxy
textures when the default texture is bound. Proxy textures do not care
about the current texture bindings so for them this check should not
be done.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 3f3f66fd94c1790de1b97839e58e35c47836c836)

8 years agomesa: fix number of mipmaps calculation for proxy textures
Mikko Juola [Tue, 30 Jul 2013 03:19:59 +0000 (30 06:19 +0300)]
mesa: fix number of mipmaps calculation for proxy textures

The function _mesa_get_tex_max_num_levels() is supposed to calculate
the number of mipmap levels but it was not written to handle proxy
textures, at best returning a maximum of 1 mipmap level. Because of
this, at least glTexStorage*() calls would incorrectly fail when used
with proxy textures with more than one mipmap level.

Reviewed-by: Brian Paul <brianp@vmware.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit de7e3741ebca9fb794b890e00b5fed5b2bbb62a2)

8 years agomesa: improve free() cleanup in generate_mipmap_compressed()
Brian Paul [Fri, 26 Jul 2013 15:50:36 +0000 (26 09:50 -0600)]
mesa: improve free() cleanup in generate_mipmap_compressed()

Free all our temporary buffers in one place at the end of the
function.  Fixes memory leak detected by Coverity.

Note: This is a candidate for the 9.x branches
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit e5f32a0b3a9f8541f0c8ffc5f303612ac9963bb1)

8 years agoi965/vs: Put lod parameter in the correct place for Gen4
Chris Forbes [Tue, 30 Jul 2013 04:03:58 +0000 (30 16:03 +1200)]
i965/vs: Put lod parameter in the correct place for Gen4

This was never visible before due to the bogus sampler state pointer.
Fixes remaining vertex texturing breakage on Gen4.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit cace82b0cdd9b93a21adbb5857f1f69ee0a2f925)

8 years agoi965/vs: set up sampler state pointer for Gen4/5.
Chris Forbes [Mon, 29 Jul 2013 18:12:24 +0000 (30 06:12 +1200)]
i965/vs: set up sampler state pointer for Gen4/5.

Fixes broken filter and lod selection for vertex texturing.
(txs/txf only worked properly because they ignore the sampler state
completely)

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 97676032c28e20b4c4150c3632794f5bdaa9efad)

8 years agost/mesa: fix opcode translation for ARB_shader_bit_encoding functions
Marek Olšák [Tue, 30 Jul 2013 20:29:25 +0000 (30 22:29 +0200)]
st/mesa: fix opcode translation for ARB_shader_bit_encoding functions

We treat the opcodes as MOVs, but we should at least change the type
of the expression, which later affects which TGSI opcode is chosen.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 369c8291523682dda5df5a64aded89ff696370f2)

8 years agogallium/postprocessing: convert blits to pipe->blit
Marek Olšák [Tue, 30 Jul 2013 20:29:14 +0000 (30 22:29 +0200)]
gallium/postprocessing: convert blits to pipe->blit

PP saves current states to cso_context and then util_blit_pixels does
the same. cso_context doesn't like that and the original state is not
correctly restored.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 4c89ec1f69c0cba995cb4aa939469ead82c6a8ec)

8 years agogallium/postprocessing: fix shader parsing
Marek Olšák [Tue, 30 Jul 2013 20:29:12 +0000 (30 22:29 +0200)]
gallium/postprocessing: fix shader parsing

tokens was converted to a pointer, which made the Elements macro return 1.

Broken by e87fc11cac696881469a57955af2ac7b4929a2c7.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c84e8d039ec9c7532b25757012aa3828f4f8a70d)

8 years agomesa: default texture buffer format should be R8 in the core profile
Marek Olšák [Tue, 30 Jul 2013 20:29:10 +0000 (30 22:29 +0200)]
mesa: default texture buffer format should be R8 in the core profile

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
v2: Since we don't expose the extension in the compatibility profile,
    the "if (API == CORE) .. else .." statement is removed.
(cherry picked from commit 7db83d8d4b6329f8edcac7bc72d225016b5188d4)

8 years agomesa: default DEPTH_TEXTURE_MODE should be RED in the core profile
Marek Olšák [Tue, 30 Jul 2013 20:29:08 +0000 (30 22:29 +0200)]
mesa: default DEPTH_TEXTURE_MODE should be RED in the core profile

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a6b1a7c0d269256ffbaf2300710601cde8ac872c)

8 years agost/mesa: fix sRGB renderbuffers without EXT_framebuffer_sRGB support
Marek Olšák [Tue, 30 Jul 2013 20:29:04 +0000 (30 22:29 +0200)]
st/mesa: fix sRGB renderbuffers without EXT_framebuffer_sRGB support

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

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 1302c66896e6fbdb4eeb086d41901ddaeb89513f)

8 years agoRevert "r300g: Give CLIP_DISABLE another try"
Marek Olšák [Tue, 30 Jul 2013 20:29:00 +0000 (30 22:29 +0200)]
Revert "r300g: Give CLIP_DISABLE another try"

This reverts commit e866bd1adea2c3b4971ad68e69c644752f2ab7b6.

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

Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 4dfe1a0df56d084b6a29fe423afe0535abec29e9)

8 years agoglsl: Less const for glsl_type convenience accessors
Ian Romanick [Fri, 26 Jul 2013 20:37:29 +0000 (26 13:37 -0700)]
glsl: Less const for glsl_type convenience accessors

The second 'const' says that the pointer itself is constant.  This in
unenforcible in C++, so GCC emits a warning (see) below for each of
these functions in every file that includes glsl_types.h.  It's a lot of
warning spam.

../../../src/glsl/glsl_types.h:176:58: warning: type qualifiers ignored on function return type [-Wignored-qualifiers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 803f755edeabd1b0af3d8f4ebf2005333e152ad4)

8 years agoglsl: Disallow auxiliary storage qualifiers on FS outputs.
Kenneth Graunke [Sat, 27 Jul 2013 04:18:56 +0000 (26 21:18 -0700)]
glsl: Disallow auxiliary storage qualifiers on FS outputs.

This has always been an error; we just forgot to check for it.

Fixes Piglit's no-aux-qual-on-fs-output.frag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67333
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 17856726c94000bf16156f7f9acea77a271a6005)

8 years agoglsl: Classify "layout" like other identifiers.
Kenneth Graunke [Fri, 26 Jul 2013 19:31:06 +0000 (26 12:31 -0700)]
glsl: Classify "layout" like other identifiers.

When "layout" isn't being lexed as LAYOUT_TOK, we should treat it like
an ordinary identifier.  This means we need to classify it to determine
whether we should return IDENTIFIER, TYPE_IDENTIFIER, or NEW_IDENTIFIER.

Fixes the WebGL conformance test "shader-with-non-reserved-words."

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64087
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit c178ec0d7e8cc7007cb34e4f56f14261a057c200)

8 years agoi965/vs: Fix flaky texture swizzling
Chris Forbes [Tue, 23 Jul 2013 19:21:22 +0000 (24 07:21 +1200)]
i965/vs: Fix flaky texture swizzling

If any component used the ZERO or ONE swizzle, its corresponding member
in the `swizzle` array would never be initialized. We *mostly* got away
with this, except when that memory happened to contain a value that
clobbered another channel when combined using BRW_SWIZZLE4().

NOTE: This is a candidate for stable branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 124f567f1d575eaea98a6ae1d0a4687b8fb5bba2)

8 years agogallium/vl: add prime support
Dave Airlie [Thu, 25 Jul 2013 03:31:26 +0000 (25 13:31 +1000)]
gallium/vl: add prime support

This fixes the dri2 opening to check if DRI_PRIME is set,
and picks the correct drm device path to open, this along
with a change to libvdpau allows vdpauinfo to work at least,

Martin Peres tested with nouveau, and there seems to be a
further issue with final displaying, it only works sometimes,
but this patch is at least necessary to help debug further.

Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Christian König <christian.koenig@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=67283
Tested-by: Armin K. <krejzi@email.com>
(cherry picked from commit 19338157c97becac1e61cc51dc0904ddfab8e9da)

8 years agoRevert "i965: Delete pre-DRI2.3 viewport hacks."
Kenneth Graunke [Thu, 25 Jul 2013 22:11:13 +0000 (25 15:11 -0700)]
Revert "i965: Delete pre-DRI2.3 viewport hacks."

This reverts commit c9db037dc999eadbcaa8816c814e6ec1776d1a40.

Eric believes that the viewport hacks are still necessary for EGL;
invalidate events aren't hooked up properly.

This commit caused a regression where EFL applications wouldn't show
anything other than window decorations; GLBenchmark also showed issues.

The revert had conflicts due to the intel_context/brw_context merge.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66606
Cc: mesa-stable@lists.freedesktop.org
(cherry picked from commit 0e9549e2bd57168086421468cbf1db0821c36730)

8 years agoglsl: Handle empty if statement encountered during loop analysis.
Paul Berry [Wed, 24 Jul 2013 15:04:44 +0000 (24 08:04 -0700)]
glsl: Handle empty if statement encountered during loop analysis.

The is_loop_terminator() function was asserting that the following
kind of if statement could never occur:

    if (...) { } else { }

(presumably based on the assumption that such an if statement would be
eliminated by previous optimization stages).  But that isn't the
case--it's possible that previous optimization stages might simplify
more complex code down to this empty if statement, in which case it
won't be eliminated until the next time through the optimization loop.

So is_loop_terminator() needs to handle it.  Fortunately it's easy to
handle--it's not a loop terminator because it does nothing.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=64330
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a5eecb246d66fd8f27eca3c4f6f83bf2641b9403)

8 years agomesa: implement mipmap generation for compressed 2D array textures
Brian Paul [Tue, 16 Jul 2013 12:04:32 +0000 (16 06:04 -0600)]
mesa: implement mipmap generation for compressed 2D array textures

We weren't looping over all the slices in the array.  The updated
code should also correctly handle 3D compressed textures too, whenever
we have that feature.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850

NOTE: This is a candidate for the 9.x branches
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8a9df7a370b66ec50b6255e4d66ac1ed331319fb)

8 years agometa: handle 2D texture arrays in decompress_texture_image()
Brian Paul [Tue, 16 Jul 2013 12:27:33 +0000 (16 06:27 -0600)]
meta: handle 2D texture arrays in decompress_texture_image()

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 484fa879847fdc7c9ef22231315f78a4c342e85d)

8 years agomesa: handle 2D texture arrays in get_tex_rgba_compressed()
Brian Paul [Mon, 15 Jul 2013 16:23:49 +0000 (15 10:23 -0600)]
mesa: handle 2D texture arrays in get_tex_rgba_compressed()

If we call glGetTexImage() for a compressed 2D texture array we need
to loop over all the slices.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66850

NOTE: This is a candidate for the 9.x branches.
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 2931bcb0d245c356ea9c467e792fd176790f9cfc)

8 years agoclover: Respect kernel argument alignment restrictions.
Francisco Jerez [Sat, 20 Jul 2013 23:14:54 +0000 (21 01:14 +0200)]
clover: Respect kernel argument alignment restrictions.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit df530829f757a8968389427eb26f45a0d46623fa)

8 years agoclover: Extend kernel arguments for differing host and device data types.
Francisco Jerez [Mon, 22 Jul 2013 21:08:46 +0000 (22 23:08 +0200)]
clover: Extend kernel arguments for differing host and device data types.

Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit f64c0ca692d3e8c78dd9ae1f015f58f1dfc1c760)

8 years agoclover: Byte-swap kernel arguments when host and device endianness differ.
Francisco Jerez [Sat, 20 Jul 2013 23:06:13 +0000 (21 01:06 +0200)]
clover: Byte-swap kernel arguments when host and device endianness differ.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 829caf410e2c2c6f79902199da5a7900abc16129)

8 years agoclover: Add kernel argument fields to allow differing host/target data types.
Francisco Jerez [Sat, 20 Jul 2013 22:49:54 +0000 (21 00:49 +0200)]
clover: Add kernel argument fields to allow differing host/target data types.

Loosely based on a similar patch by Tom Stellard.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 2265b40e377cc2c9d1091498df2aede5df2ff684)

8 years agoclover: Pass corresponding module::argument to kernel::argument::bind().
Francisco Jerez [Sat, 20 Jul 2013 22:43:18 +0000 (21 00:43 +0200)]
clover: Pass corresponding module::argument to kernel::argument::bind().

And remove size information from most kernel::argument derived
classes, it's no longer going to be necessary.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit a3dcab43c6b6fed2f35aa0e802be6398985f100c)

8 years agoclover: Return correct value for CL_DEVICE_ENDIAN_LITTLE
Tom Stellard [Wed, 10 Jul 2013 04:21:40 +0000 (9 21:21 -0700)]
clover: Return correct value for CL_DEVICE_ENDIAN_LITTLE

Query the driver using PIPE_CAP_ENDIANNESS rather than always returning
true.

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
(cherry picked from commit 8c9d3c62f60a2819948bdfb005600cdc10aa2547)

8 years agogallium: Add PIPE_CAP_ENDIANNESS
Tom Stellard [Wed, 10 Jul 2013 04:21:39 +0000 (9 21:21 -0700)]
gallium: Add PIPE_CAP_ENDIANNESS

Cc: mesa-stable@lists.freedesktop.org
[ Francisco Jerez: Fix "PIPE_ENDIAN_SMALL" in the documentation,
  define PIPE_ENDIAN_NATIVE. ]
(cherry picked from commit 4e90bc9a12bea93c6b5522abe8151a8cfe1d6d1d)

8 years agonvc0: force use of correct firmware file
Maarten Lankhorst [Sun, 28 Jul 2013 10:06:57 +0000 (28 12:06 +0200)]
nvc0: force use of correct firmware file

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
(cherry picked from commit e847b5ae066bf9a209dad482fcc664f944983633)

8 years agonv50: fix some h264 interlaced decoding on vp2
Ilia Mirkin [Thu, 1 Aug 2013 16:50:10 +0000 (1 12:50 -0400)]
nv50: fix some h264 interlaced decoding on vp2

Some videos specify mb_adaptive_frame_field_flag instead of
field_pic_flag. This implies that the pic height needs to be halved, and
this field needs to be passed to the VP engine.

Cc: "9.2" mesa-stable@lists.freedesktop.org
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
(cherry picked from commit 8edb79f1ef95581c20ed0c3dc49aabe99d7f072a)

8 years agonv50,nvc0: s/uint16/uint32 for constant buffer offset
Christoph Bumiller [Wed, 24 Jul 2013 18:41:31 +0000 (24 20:41 +0200)]
nv50,nvc0: s/uint16/uint32 for constant buffer offset

Looks like a thinko, "Hey, constant buffers can be at most 64 KiB
in size, offset can't be larger." But it can, of course.

I think piglit lacks a test for UBO and BindBufferRange that
tests if it actually works.

9 years agoApple: glFlush() is not needed with CGLFlushDrawable()
Jeremy Huddleston Sequoia [Sat, 20 Jul 2013 17:25:28 +0000 (20 10:25 -0700)]
Apple: glFlush() is not needed with CGLFlushDrawable()

<rdar://problem/14496373>

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit fa5ed99d8e809fb86e486a40273a4a6971055398)

9 years agomesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently9.2-branchpoint
Tomasz Lis [Tue, 16 Jul 2013 18:57:26 +0000 (16 20:57 +0200)]
mesa: Dispatch ARB_framebuffer_object and EXT_framebuffer_object differently

Almost all of the functions between the ARB and the EXT share the same
GLX protocol because the functionality is, essentially, identical.
However, there are some differences between the extensions:

- In the ARB extension, names must come from glGenBuffers.

- In the ARB extension, framebuffer objects are not shared (but they are
  in the EXT).

For these reasons, glBindFramebuffer and glBindRenderbuffer have
different GLX protocol opcodes than their EXT counterparts.  Currently
these functions alias each other in the dispatch table.  This makes it
impossible to be truly spec conformant.

This patch enables fixing the conformance issue by splitting
glBindFramebuffer / glBindFramebufferEXT and glBindRenderbuffer /
glBindRenderbufferEXT into separate dispatch table entries.

Patches will be available shortly to:

- Fix the conformance issue.

- Stop advertising the EXT in OpenGL 3.1 (or core profiles).

HOWEVER, this does represent a compatibility break between the loader
(libGL or the Xserver GLX module) and the driver.  Mesa drivers compiled
without this change will request a single dispatch table entry for
glBindFramebuffer and glBindFramebufferEXT.  Since the updated loader
has different entries for each, the request will fail, and the driver
will die in a fire.

Drivers built with the change should continue to load fine on loaders
without the change.  In this case, the driver will separately ask for
entries for glBindFramebuffer and glBindFramebufferEXT, and the loader
will tell it the same location.  Since the loader in the server's GLX
module is not (yet) updated, this should not be a problem.  We also do
not advertise the ARB extension from the server, so, again, this should
not be a problem for the server.

HOWEVER, this means that DRI1 drivers (remember mga_dri.so?) will no
longer load with libGL build hereafter.  That means this patch will need
to be back ported to the 8.0 branch.

v2 (idr): Added missing GLX protocol opcodes for the EXT functions and
corrected the opcodes for the ARB functions.  Updated GLX indirect_api
unit test and dispatch sanity unit test.

Signed-off-by: Tomasz Lis <tomasz.lis@intel.com>
Signed-off-by: Bartosz Zawistowski <bartosz.l.zawistowski@intel.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> [v1]
9 years agost/mesa: Enable the ARB_shading_language_420pack extension for 1.30+.
Kenneth Graunke [Thu, 18 Jul 2013 18:49:44 +0000 (18 11:49 -0700)]
st/mesa: Enable the ARB_shading_language_420pack extension for 1.30+.

Any driver that supports GLSL 1.30 should be able to handle this
extension, as it's entirely implemented in the GLSL compiler.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
9 years agoi965: Enable the GL_ARB_shading_language_420pack extension on Gen6+.
Kenneth Graunke [Thu, 18 Jul 2013 01:18:00 +0000 (17 18:18 -0700)]
i965: Enable the GL_ARB_shading_language_420pack extension on Gen6+.

While all the work is in the shared GLSL compiler, this extension
requires GLSL 1.30, which is currently only supported on Gen6+.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>