profile/ivi/mesa.git
11 years agomesa: don't expose IBM_rasterpos_clip in a core context
Brian Paul [Mon, 11 Feb 2013 19:34:53 +0000 (12:34 -0700)]
mesa: don't expose IBM_rasterpos_clip in a core context

glRasterPos doesn't exist in the core profile.

NOTE: This is a candidate for the stable branches (9.0 and 9.1).

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

Conflicts:

src/mesa/main/extensions.c

11 years agost/mesa: only enable GL_EXT_framebuffer_multisample if GL_MAX_SAMPLES >= 2
Brian Paul [Mon, 28 Jan 2013 18:32:13 +0000 (11:32 -0700)]
st/mesa: only enable GL_EXT_framebuffer_multisample if GL_MAX_SAMPLES >= 2

We never really have multisampling with one sample per pixel.
See also http://bugs.freedesktop.org/show_bug.cgi?id=59873

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit c80bacba2ed88bccc92ab7a7151e14ad32729249)

11 years agomesa: don't enable GL_EXT_framebuffer_multisample for software drivers
Brian Paul [Mon, 11 Feb 2013 19:29:20 +0000 (12:29 -0700)]
mesa: don't enable GL_EXT_framebuffer_multisample for software drivers

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8f3c81d0182b10d99976dd0a80f10eebebf54017)

Conflicts:

src/mesa/main/extensions.c

11 years agogallium/u_upload_mgr: fix a serious memory leak
Marek Olšák [Mon, 28 Jan 2013 01:47:24 +0000 (02:47 +0100)]
gallium/u_upload_mgr: fix a serious memory leak

It can eat all memory and crash in a matter of minutes with r600g.
(cherry picked from commit 87592cff57feef29565150b9203e220b50623f30)

11 years agoutil: add new error checking code in vbuf helper
Brian Paul [Mon, 11 Feb 2013 19:28:23 +0000 (12:28 -0700)]
util: add new error checking code in vbuf helper

Check the return value of calls to u_upload_alloc() and
u_upload_data() and return early if needed.

Since we don't have a way to propagate errors all the way up to
Mesa through pipe_context::draw_vbo(), call debug_warn_once() so
the user might have some clue about OOM errors.

Note: This is a candidate for the 9.0 branch.
(cherry picked from commit b13c534f1479549e53b9896ea4d25d79f8466c24)

Conflicts:

src/gallium/auxiliary/util/u_vbuf.c

11 years agost/mesa: do proper error checking for u_upload_alloc() calls
Brian Paul [Thu, 24 Jan 2013 21:51:05 +0000 (14:51 -0700)]
st/mesa: do proper error checking for u_upload_alloc() calls

We weren't properly checking the return value of these calls (and
calls to u_upload_data()) to detect OOM errors.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8c3f9ea07392177b6de9d946d40f97128fa51632)

11 years agoutil: add some defensive coding in u_upload_alloc()
Brian Paul [Mon, 11 Feb 2013 19:27:29 +0000 (12:27 -0700)]
util: add some defensive coding in u_upload_alloc()

Some callers of this function were checking the 'ptr' result to see if
the function failed.  But the correct way is to check the regular
return value for PIPE_ERROR_x.  Now we initialize all the returned
values at the top of the function in case we do hit an error (like OOM).

Callers are more likely to detect OOM conditions now.  But there
are some callers which don't do any error checking...

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 68a097596efdf314ec60487a1761cac789ae2367)

Conflicts:

src/gallium/auxiliary/util/u_upload_mgr.c

11 years agost/mesa: add null pointer check in st_renderbuffer_delete()
Brian Paul [Mon, 3 Dec 2012 15:30:04 +0000 (08:30 -0700)]
st/mesa: add null pointer check in st_renderbuffer_delete()

In my testing I haven't found any cases where we get a null context
pointer, but it might still be possible.  Check for null just to be safe.

Note: This is a candidate for the stable branches.
(cherry picked from commit a4311054c78536acba0c3006c5d2805e182fa483)

11 years agomesa: remove warning message in _mesa_reference_renderbuffer_()
Brian Paul [Sat, 1 Dec 2012 17:52:42 +0000 (10:52 -0700)]
mesa: remove warning message in _mesa_reference_renderbuffer_()

We were warning when there was no current context and we're about
to delete a renderbuffer, but that happens fairly often and isn't
really a problem.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=57754

Note: This is a candidate for the stable branches.

Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 006918c0db77e945ac56b15bc64eba502b86d56c)

11 years agodri_glx: fix use after free report
Brian Paul [Mon, 11 Feb 2013 18:57:34 +0000 (11:57 -0700)]
dri_glx: fix use after free report

the critical error would use driverName.

Found by internal RH coverity scan.

Note: This is a candidate for stable branches.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit a0ec9185eb90568ab57170dc682de0ba0c9e5e62)

Conflicts:

src/glx/dri_glx.c

11 years agost/mesa: fix context use-after-free problem in st_renderbuffer_delete()
Brian Paul [Fri, 30 Nov 2012 17:11:54 +0000 (10:11 -0700)]
st/mesa: fix context use-after-free problem in st_renderbuffer_delete()

The use-after-free happened when the renderbuffer was shared by multiple
contexts and we tried to delete the renderbuffer using a context which
was previously deleted.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 4cedb65a43ae81c7ac71e631c854b7404dd2b61b)

11 years agomesa: pass context parameter to gl_renderbuffer::Delete()
Brian Paul [Mon, 11 Feb 2013 18:55:44 +0000 (11:55 -0700)]
mesa: pass context parameter to gl_renderbuffer::Delete()

We sometimes need a rendering context when deleting renderbuffers.
Pass it explicitly instead of trying to grab a current context
(which might be NULL).  The next patch will make use of this.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit c73245882c7ff1277b190b97f093f7b423a22f10)

Conflicts:

src/mesa/swrast/s_renderbuffer.c

11 years agomesa: fix-up and use _mesa_delete_renderbuffer()
Brian Paul [Thu, 30 Aug 2012 15:27:16 +0000 (09:27 -0600)]
mesa: fix-up and use _mesa_delete_renderbuffer()

_mesa_delete_renderbuffer() should free the mutex (though that may be a
no-op) and then free the renderbuffer object itself.  Subclasses of
gl_renderbuffer can use this function too.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 8472bb4508515cf0f717344ef5cc863b6e97e56a)

11 years agoconfigure.ac: GLX cannot work without OpenGL
Michel Dänzer [Thu, 31 Jan 2013 10:47:55 +0000 (11:47 +0100)]
configure.ac: GLX cannot work without OpenGL

GLX uses mapi/glapi/libglapi.la, which is only built for OpenGL.

If the user specified --enable-xlib-glx --disable-opengl, error out, as these
cannot be both observed at the same time. If the user just specified
--disable-opengl but not --disable-glx, print a warning and disable GLX as
well.

NOTE: This is a candidate for the stable branches.

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

Tested-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 3b888f534cd42065b01ede8b9c646a2be0015509)

11 years agost/mesa: set ctx->Const.MaxSamples = 0, not 1
Brian Paul [Sat, 26 Jan 2013 17:09:37 +0000 (10:09 -0700)]
st/mesa: set ctx->Const.MaxSamples = 0, not 1

The gallium docs for pipe_screen::is_format_supported() says that
samples==0 or samples==1 both mean that multisampling is not supported.
Return GL_MAX_SAMPLES==0 instead of 1 for consistency with other drivers.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit d60da27273d2cdb68bc32cae2ca66718dab15f27)

11 years agoxlib: use _mesa_generate_mipmap() for mipmap generation, not meta
Brian Paul [Sat, 26 Jan 2013 17:58:37 +0000 (10:58 -0700)]
xlib: use _mesa_generate_mipmap() for mipmap generation, not meta

The swrast fragment program interpreter has trouble computing the
right texture LOD because it doesn't have easy access to input
derivatives.  This causes the GLSL-based meta generate mipmap code
to fetch texels from the wrong mipmap level.

One possible fix would be to set the GL_TEXTURE_MIN/MAX_LOD parameters
to limit sampling from the right level.  But let's just use the
_mesa_generate_mipmap() fallback since it's a lot faster than using
the fragment shader interpreter.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=54240

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 89551ae04f4cf994c0f7f2ac3aef7e1c57936a29)

11 years agoosmesa: use _mesa_generate_mipmap() for mipmap generation, not meta
Brian Paul [Sat, 26 Jan 2013 18:07:35 +0000 (11:07 -0700)]
osmesa: use _mesa_generate_mipmap() for mipmap generation, not meta

See previous commit for more info.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit 2180f3297285e96d7b69e1cef4414461ba42b0d2)

11 years agovbo: add a null pointer check to handle OOM instead of crashing
Brian Paul [Thu, 24 Jan 2013 23:32:42 +0000 (16:32 -0700)]
vbo: add a null pointer check to handle OOM instead of crashing

Note: This is a candidate for the 9.0 branch.
(cherry picked from commit 7a89f08a22eb83ed2f0c51e516397d6415e64a3d)

11 years agosvga: add NULL pointer check in svga_create_sampler_state()
Brian Paul [Thu, 24 Jan 2013 23:53:33 +0000 (16:53 -0700)]
svga: add NULL pointer check in svga_create_sampler_state()

Note: This is a candidate for the 9.0 branch.
(cherry picked from commit 9227c5374170caccb7ffac85a131971d7d603171)

11 years agomesa: use GLbitfield64 when copying program inputs
Brian Paul [Wed, 23 Jan 2013 00:44:02 +0000 (17:44 -0700)]
mesa: use GLbitfield64 when copying program inputs

Note: This is a candidate for the 9.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
(cherry picked from commit ccbb479f4090948ed3765495192332ebc4cf1f4f)

11 years agoglx: only advertise GLX_INTEL_swap_event if it's supported
Zack Rusin [Fri, 25 Jan 2013 01:48:12 +0000 (17:48 -0800)]
glx: only advertise GLX_INTEL_swap_event if it's supported

Only drivers supporting DRI2 version >=4 support GLX_INTEL_swap_event.
So lets mark it as such otherwise applications which use this extension
(i.e. everything based on Clutter, e.g. gnome-shell) break horribly on
drivers supporting DRI2 versions only up to 3.

Note: This is a candidate for the 9.0 branch.

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

11 years agobuild: Fix build on systems where /usr/bin/python isn't python 2.
Kenneth Graunke [Mon, 21 Jan 2013 18:42:50 +0000 (10:42 -0800)]
build: Fix build on systems where /usr/bin/python isn't python 2.

configure.ac sets up a PYTHON2 variable, which is what we want
AX_PYTHON_MODULE to use (since we only use Python 2 for now).

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 121d19de920212225586c9269f2d34ab7e6e1aec)

11 years agobuild: require python module libxml2
Andreas Boll [Fri, 18 Jan 2013 14:31:57 +0000 (15:31 +0100)]
build: require python module libxml2

configure should warn if libxml2 is not found.
libxml2 is needed by glapi/gen.

Fixes error during build in src/mapi/glapi/gen:
ImportError: No module named libxml2

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=31598
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 410b58c7bfcebbc866d2dc4ab32c6f23b55d383b)

11 years agoglsl: Track UBO block names in the symbol table.
Kenneth Graunke [Wed, 28 Nov 2012 08:18:02 +0000 (00:18 -0800)]
glsl: Track UBO block names in the symbol table.

The GLSL 1.40 spec says:

    "Uniform block names and variable names declared within uniform
    blocks are scoped at the program level."

Track the block name in the symbol table and emit errors when conflicts
exist.

Fixes es3conform's uniform_buffer_object_block_name_conflict test, and
fixes the piglit block-name-clashes-with-{variable,function,struct}.vert
tests.

NOTE: This is a candidate for the 9.0 branch.

v2: Fix bad constructor initialization.  Noticed by Topi Pohjolainen.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 4f29169913f99252c54e1922f6d164e2ef530a58)

11 years agor200: Fix probable thinko in r200EmitArrays
Adam Jackson [Fri, 4 Jan 2013 19:26:20 +0000 (14:26 -0500)]
r200: Fix probable thinko in r200EmitArrays

Effectively this path would always assert.  Move the break statement to
the (probable) intended place.

Note: This is a candidate for the stable branches.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
(cherry picked from commit 06f3a1f792e5f280c8e83581622b2f4bab811720)

11 years agounpack: support unpacking MESA_FORMAT_ARGB2101010
Jordan Justen [Thu, 27 Dec 2012 21:21:01 +0000 (13:21 -0800)]
unpack: support unpacking MESA_FORMAT_ARGB2101010

Note: This is a candidate for the stable branches.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 2ace406b1fa502219d353e5d259d1c4bcd5633a5)

11 years agoutil: add get/put_tile_z() support for PIPE_FORMAT_Z32_FLOAT_S8X24_UINT
Brian Paul [Thu, 3 Jan 2013 15:02:57 +0000 (08:02 -0700)]
util: add get/put_tile_z() support for PIPE_FORMAT_Z32_FLOAT_S8X24_UINT

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

Note: This is a candidate for the stable branches.
(cherry picked from commit 073a53fe2f39cfa42090b223cbaf287b48cefe8e)

11 years agoutil: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT
Brian Paul [Thu, 3 Jan 2013 15:04:50 +0000 (08:04 -0700)]
util: fix addressing bug in pipe_put_tile_z() for PIPE_FORMAT_Z32_FLOAT

The Z32 pixel is 4 bytes so multiply x by 4, not 2.

Note: This is a candidate for the stable branches.
(cherry picked from commit 69c2528b8374156adc45c427faaa59cee88a6541)

11 years agost/glx: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Brian Paul [Fri, 4 Jan 2013 00:30:34 +0000 (17:30 -0700)]
st/glx: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values

Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit fe90762414ea3191143a82534e304871c1e311a8)

11 years agoxlib: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values
Brian Paul [Fri, 4 Jan 2013 00:31:22 +0000 (17:31 -0700)]
xlib: allow GLX_DONT_CARE for glXChooseFBConfig() attribute values

Fixes piglit glx-dont-care-mask test.

Note: This is a candidate for the stable branches.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 46bad058eb1f2fa73a4db19655bc660dde1befb9)

11 years agor600g: fix int->bool conversion in fence_signalled
Marek Olšák [Fri, 4 Jan 2013 11:40:04 +0000 (12:40 +0100)]
r600g: fix int->bool conversion in fence_signalled

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 9f0ddbc9e4b44f165c96841fe32ebc66c68d2709)

11 years agoxlib: handle _mesa_initialize_visual()'s return value
Brian Paul [Wed, 26 Dec 2012 23:26:58 +0000 (16:26 -0700)]
xlib: handle _mesa_initialize_visual()'s return value

If the call fails, we should return NULL from XMesaCreateVisual().
This was found when Waffle tried to create a visual with depth/stencil
bits = -1.  That's an illegal value for glXChooseFBConfig() and we should
return NULL in that situation.

Note: This is a candidate for the stable branches.
(cherry picked from commit 05cd6cfd5f5a128404f09c4de1a7cf12f3f6f08a)

11 years agomesa: add bounds checking for uniform array access
Frank Henigman [Fri, 14 Dec 2012 20:52:17 +0000 (15:52 -0500)]
mesa: add bounds checking for uniform array access

No piglit regressions and now passes glsl-uniform-out-of-bounds-2.

validate_uniform_parameters now checks that the array index is
valid.  This means if an index is out of bounds, glGetUniform* now
fails with GL_INVALID_OPERATION, as it should.
_mesa_uniform and _mesa_uniform_matrix also call
validate_uniform_parameters so the bounds checks there became
redundant and were removed.

The test in glGetUniformLocation is modified to check array bounds
so it now returns GL_INVALID_INDEX (-1) if you ask for the location
of a non-existent array element, as it should.

Signed-off-by: Frank Henigman <fjhenigman@google.com>
Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
(cherry picked from commit 46e3aeb07702f57d389fbfcade9d4ef66218dc53)

11 years agomesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.
Paul Berry [Wed, 19 Dec 2012 18:08:58 +0000 (10:08 -0800)]
mesa: Allow glReadBuffer(GL_NONE) for winsys framebuffers.

Previously, Mesa code assumed that glReadBuffer(GL_NONE) was only
valid for user-created framebuffer objects.  However, the spec is
quite clear that is should also be valid for the default framebuffer.
From section 18.2.1 ("Obtaining Pixels from the Framebuffer") of the
GL 4.3 spec:

    "When READ_FRAMEBUFFER_BINDING is zero, i.e. the default
    framebuffer, src must be one of the values listed in table 17.4,
    including NONE."

Similar language exists in the GLES 3.0 spec, and in desktop GL all
the way back to ARB_framebuffer_object.

Partially fixes GLES3 conformance test "CoverageES30.test".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit cf5632094ba0c19d570ea47025cf6da75ef8457a)

11 years agosoftpipe: fix unreliable FS variant binding bug
Brian Paul [Fri, 14 Dec 2012 17:34:33 +0000 (10:34 -0700)]
softpipe: fix unreliable FS variant binding bug

In exec_prepare() we were comparing pointers to see if the fragment
shader variant had changed before calling tgsi_exec_machine_bind_shader().
This didn't work reliably when there was a lot of shader token malloc/
freeing going on because the memory might get reused.
Instead, bind the shader variant during regular state validation.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=40404
(fixes a couple of piglit's glsl-max-varyings test)

Note: This is a candidate for the stable branches.
(cherry picked from commit 18ef8f83b2586de037df7e578d88cbfb6e764012)

11 years agosoftpipe: fix up FS variant unbinding / deletion
Brian Paul [Fri, 14 Dec 2012 17:47:46 +0000 (10:47 -0700)]
softpipe: fix up FS variant unbinding / deletion

The old call to tgsi_exec_machine_bind_shader() in
softpipe_delete_fs_state() was never called since the shader's original
tokens are never passed to the tgsi interpreter (only shader _variant_
tokens are).  Now, unbind the variant's tokens from the tgsi interpreter
when we free the variant.

This doesn't fix any known bugs but it's the right thing to do.

Note: This is a candidate for the stable branches.
(cherry picked from commit fddcc67f5cb41f70d1d11827eb9190a5caec13c5)

11 years agomesa/uniform_query: Don't write to *params if there is an error
Matt Turner [Sat, 8 Dec 2012 00:32:30 +0000 (16:32 -0800)]
mesa/uniform_query: Don't write to *params if there is an error

The GL 3.1 and ES 3.0 specs say of glGetActiveUniformsiv:
   "If an error occurs, nothing will be written to params."

So, make a pass through the indices and check that they're valid before
the pass that actually writes to params. Checking pname happens on the
first iteration of the second loop.

Fixes es3conform's getactiveuniformsiv_for_nonexistent_uniform_indices
test.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 11cea472466f731fa9c44d56f1643dec26e6601c)

11 years agor200: Initialize swrast before setting limits
Stefan Dösinger [Wed, 5 Dec 2012 22:08:19 +0000 (23:08 +0100)]
r200: Initialize swrast before setting limits

Otherwise the driver announces 4096 vertex shader constants and other
way too high limits.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 654a945f4d5fa00a40d47b952162a3b7f71dca5d)

Conflicts:
src/mesa/drivers/dri/r200/r200_context.c

11 years agoradeon: Initialize swrast before setting limits
Stefan Dösinger [Wed, 5 Dec 2012 22:08:20 +0000 (23:08 +0100)]
radeon: Initialize swrast before setting limits

NOTE: This is a candidate for stable release branches.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f6a4e1bc1eb3df1e9172474b60cf9fce571e35d1)

Conflicts:
src/mesa/drivers/dri/radeon/radeon_context.c

11 years agometa: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER
Stefan Dösinger [Wed, 5 Dec 2012 22:08:21 +0000 (23:08 +0100)]
meta: Disable GL_FRAGMENT_SHADER_ATI in MESA_META_SHADER

Fixes clears in Wine on r200.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit d8069b7603c368c59e7a605d696d2bd65ad414f6)

Port to 9.0: Andreas Boll <andreas.boll.dev@gmail.com>
    s/API_OPENGL_COMPAT/API_OPENGL/

11 years agodraw: set precalc_flat flag for AA lines too
Brian Paul [Tue, 4 Dec 2012 23:32:01 +0000 (16:32 -0700)]
draw: set precalc_flat flag for AA lines too

Fixes flat shading for AA lines.  demos/src/trivial/line-smooth is a
test case which hits this.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit d2c7fe5389e40871a7e339dc0ecaa7f570f851ed)

11 years agodraw: Properly limit vertex buffer fetches on draw arrays.
José Fonseca [Fri, 16 Nov 2012 17:09:05 +0000 (17:09 +0000)]
draw: Properly limit vertex buffer fetches on draw arrays.

We need to clamp vertex buffer fetch based on its size, not based on the
user specified max index hint.

This matches draw_pt_fetch_run() above.

NOTE: This is a candidate for the stable branches.

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

11 years agomesa: Disable GL_NV_primitive_restart extension in core contexts.
Kenneth Graunke [Mon, 3 Dec 2012 06:30:45 +0000 (22:30 -0800)]
mesa: Disable GL_NV_primitive_restart extension in core contexts.

The NV formulation of primitive restart is turned on/off with
glEnableClientState/glDisableClientState.  These two functions don't
exist in core contexts, which mean that GL_NV_primitive_restart is
essentially useless...even broken.

However, leaving it on causes oglconform's primitive-restart-nv tests to
run in OpenGL 3.1 contexts, which results in them all failing.  This
patch causes 29 subtests to go from "fail" to "not run".

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 32c6db3978e89e61660d9479d7548cb7a5e04ba2)

11 years agost/glx: accept GLX_SAMPLE_BUFFERS/SAMPLES_ARB == 0
Brian Paul [Sun, 2 Dec 2012 23:18:22 +0000 (16:18 -0700)]
st/glx: accept GLX_SAMPLE_BUFFERS/SAMPLES_ARB == 0

Only fail if GLX_SAMPLE_BUFFERS_ARB or GLX_SAMPLES_ARB are non-zero.
We were already doing this in the older swrast/glx code.

This fixes a piglit/waffle problem where we'd always fail to get a
visual/config and report the test as "skip".

Note: This is a candidate for the stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c6d74bfaf61a6d52e6f886e33f2e98c3007d79fc)

11 years agomesa: Fix GL_LUMINANCE handling for textures in glGetTexImage
Anuj Phogat [Fri, 16 Nov 2012 18:47:56 +0000 (10:47 -0800)]
mesa: Fix GL_LUMINANCE handling for textures in glGetTexImage

We need to rebase colors (ex: set G=B=0) when getting GL_LUMINANCE
textures in following cases:
1. If the luminance texture is actually stored as rgba
2. If getting a luminance texture, but returning rgba
3. If getting an rgba texture, but returning luminance

A similar fix was pushed by Brian Paul for uncompressed textures
in commit: f5d0ced.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=47220

Observed no regressions in piglit and ogles2conform due to this fix.
This patch will cause failures in intel oglconform pxconv-gettex,
pxstore-gettex and pxtrans-gettex test cases. The cause of failures
is a bug in test cases. Expected luminance value is calculted
incorrectly in test cases: L = R+G+B.

V2: Set G = 0 when getting a RG texture but returning luminance.

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
(cherry picked from commit 9ab896243cfdee7f6a626aceb26e4cb88bd4da2d)

11 years agomesa: Set transform feedback's default buffer mode to INTERLEAVED_ATTRIBS
Matt Turner [Mon, 26 Nov 2012 23:13:25 +0000 (15:13 -0800)]
mesa: Set transform feedback's default buffer mode to INTERLEAVED_ATTRIBS

Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 13f9012ad3837c98a2c891244e64878fa61f9cd2)

11 years agomesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings
Matt Turner [Fri, 23 Nov 2012 08:03:59 +0000 (00:03 -0800)]
mesa: Return 0 for XFB_VARYING_MAX_LENGTH if no varyings

v2: Perform this count the same way as elsewhere in this file, per
    Brian Paul's review.

Fixes part of es3conform's transform_feedback_init_defaults test.
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 7c2060f0f08134e8c4ea00af94f59c18f30d05e2)

11 years agomesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)
José Fonseca [Thu, 25 Oct 2012 14:47:12 +0000 (15:47 +0100)]
mesa/st: Don't use 4bits for GL_UNSIGNED_BYTE_3_3_2(_REV)

4bits and 3bits quantitization values differ significantly for
values other than 0 and 1.

Fixes piglit draw-pixels for softpipe/llvmpipe.

NOTE: Probably a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 0cb0c38ccea84ab524d10447585000d41fbb8c74)

11 years agoconfigure.ac: Allow OpenGL ES1 and ES2 only with enabled OpenGL
Andreas Boll [Fri, 1 Feb 2013 12:17:47 +0000 (13:17 +0100)]
configure.ac: Allow OpenGL ES1 and ES2 only with enabled OpenGL

Building OpenGL ES1 and/or ES2 without OpenGL is not supported on mesa
9.0.x

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
11 years agoi965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.
Eric Anholt [Wed, 17 Oct 2012 20:07:33 +0000 (13:07 -0700)]
i965: Actually add support for GL_ANY_SAMPLES_PASSED from GL_ARB_oq2.

v2: Fix mangled sentence in the comment, and make the loop exit early.

Fixes assertion failures in Piglit's spec/ARB_occlusion_query2/render
test as well as the game PlaneShift.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> (v1)
(cherry picked from commit e755c1a36b27d6e45f0ae81729908342b8775c74)

11 years agor600g: add cs memory usage accounting and limit it v3 (backport for mesa 9.0)
Jerome Glisse [Wed, 30 Jan 2013 20:02:32 +0000 (15:02 -0500)]
r600g: add cs memory usage accounting and limit it v3 (backport for mesa 9.0)

We are now seing cs that can go over the vram+gtt size to avoid
failing flush early cs that goes over 70% (gtt+vram) usage. 70%
is use to allow some fragmentation.

The idea is to compute a gross estimate of memory requirement of
each draw call. After each draw call, memory will be precisely
accounted. So the uncertainty is only on the current draw call.
In practice this gave very good estimate (+/- 10% of the target
memory limit).

v2: Remove left over from testing version, remove useless NULL
    checking. Improve commit message.
v3: Add comment to code on memory accounting precision

This version is a backport for mesa 9.0

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
11 years agocherry-ignore: Ignore candidates for the 9.1 branch.
Kenneth Graunke [Wed, 30 Jan 2013 19:10:54 +0000 (11:10 -0800)]
cherry-ignore: Ignore candidates for the 9.1 branch.

11 years agoi965/disasm: Fix horizontal stride of dest registers
Chad Versace [Wed, 23 Jan 2013 19:17:51 +0000 (11:17 -0800)]
i965/disasm: Fix horizontal stride of dest registers

The bug: The printed horizontal stride was the numerical value of the
  BRW_HORIZONTAL_$N enum.
The fix: Translate the enum before printing.

Note: This is a candidate for the stable releases.
Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit ca7d332253e237c51fdf5c88a8f7937e65e8abff)

11 years agoi965/vs: Store texturing results into a vec4 temporary.
Kenneth Graunke [Thu, 17 Jan 2013 04:24:13 +0000 (20:24 -0800)]
i965/vs: Store texturing results into a vec4 temporary.

The sampler appears to ignore writemasks (even when correcting the
WRITEMASK_XYZW in brw_vec4_emit.cpp to the proper writemask) and just
always writes all four values.

To cope with this, just texture into a temporary, then MOV out into a
register that has the proper number of components.

NOTE: This is a candidate for stable branches.

Fixes es3conform's shadow_execution_vert.test.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
(cherry picked from commit f0dbd9255b5813d1567e1f09266f80e35dcbeb70)

11 years agoi965/vs: Set LOD to 0 for ordinary texture() calls.
Kenneth Graunke [Thu, 17 Jan 2013 03:09:52 +0000 (19:09 -0800)]
i965/vs: Set LOD to 0 for ordinary texture() calls.

Previously it was left undefined, causing us to select a random LOD.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
(cherry picked from commit aeff9a0d9889c4583e4f7fc89539380c1e6d043c)

11 years agoi965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.
Kenneth Graunke [Thu, 17 Jan 2013 03:08:12 +0000 (19:08 -0800)]
i965/vs: Create a 'lod_type' temporary for ir->lod_info.lod->type.

This is purely a refactor.  However, in a moment, we'll want to set
lod_type to float for ir_tex, where ir->lod_info.lod is NULL.

NOTE: This is a candidate for stable branches (for the next patch).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
(cherry picked from commit 56ce55d198af65d4a9de7119eb9e2417296c54ea)

11 years agoi965: Add missing _NEW_BUFFERS dirty bit in Gen7 SBE state.
Kenneth Graunke [Thu, 29 Nov 2012 10:40:09 +0000 (02:40 -0800)]
i965: Add missing _NEW_BUFFERS dirty bit in Gen7 SBE state.

This is needed to compute render_to_fbo.  It even has the comment.

NOTE: This is a candidate for stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit bd87441ac028068f422e2c96b39f93644a0f246f)

11 years agoi965/fs: Don't generate saturates over existing variable values.
Eric Anholt [Mon, 26 Nov 2012 22:22:12 +0000 (14:22 -0800)]
i965/fs: Don't generate saturates over existing variable values.

Fixes a crash in http://workshop.chromeexperiments.com/stars/ on i965,
and the new piglit test glsl-fs-clamp-5.
We were trying to emit a saturating move into a uniform, which the code
generator appropriately choked on.  This was broken in the change in
32ae8d3b321185a85b73ff703d8fc26bd5f48fa7.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57166
NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b9b033d8e456228fb05c5e28f85323de40f3292f)

Conflicts: 9.0 doesn't have the MOV() helper.  Convert to old style.

11 years agocherry-ignore: Ignore i965 guardband bug fixes.
Kenneth Graunke [Wed, 30 Jan 2013 19:05:28 +0000 (11:05 -0800)]
cherry-ignore: Ignore i965 guardband bug fixes.

Guardband clipping is disabled in 9.0, so these aren't actually needed
(and don't apply cleanly either).

11 years agoi965/fs: Fix the gen6-specific if handling for 80ecb8f15b9ad7d6edc
Eric Anholt [Mon, 12 Nov 2012 21:13:55 +0000 (13:13 -0800)]
i965/fs: Fix the gen6-specific if handling for 80ecb8f15b9ad7d6edc

Fixes oglconform shad-compiler advanced.TestLessThani.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48629
NOTE: This is a candidate for the 9.0 branch.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0482998ccc205a9d29953c7a8b33f41ae3584935)

Conflicts: fs_inst doesn't have a "predicate" field on the 9.0 branch,
so convert it to "predicated = true".  See 54679fcbcae7a2d41cb43.

11 years agoi965: Add chipset limits for Haswell GT1/GT2.
Kenneth Graunke [Sat, 13 Aug 2011 01:27:16 +0000 (18:27 -0700)]
i965: Add chipset limits for Haswell GT1/GT2.

The maximum number of URB entries come from the 3DSTATE_URB_VS and
3DSTATE_URB_GS state packet documentation; the thread count information
comes from the 3DSTATE_VS and 3DSTATE_PS state packet documentation.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eugeni Dodonov <eugeni.dodonov@intel.com>
(cherry picked from commit 9add4e803877f97ad7f6d479d81d537426f09b6f)

11 years agoi965: Use Haswell's sample_d_c for textureGrad with shadow samplers.
Kenneth Graunke [Fri, 4 Jan 2013 15:53:09 +0000 (07:53 -0800)]
i965: Use Haswell's sample_d_c for textureGrad with shadow samplers.

The new hardware actually just supports this now.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 899017fc54c40c969b5239b33f3a17b311878b0d)

11 years agoi965: Lower textureGrad() with samplerCubeShadow.
Kenneth Graunke [Wed, 16 Jan 2013 19:14:14 +0000 (11:14 -0800)]
i965: Lower textureGrad() with samplerCubeShadow.

We weren't lowering textureGrad() with samplerCubeShadow because I
couldn't figure out the LOD calculations.  It turns out they're easy:
you just have to use 1 for the depth.  This causes it to pass
oglconform's four tests.

(cherry picked from commit 613e64060c2bc58c3920c3c6ff77291642ba0e23)

When cherry-picking this to stable, I've reordered this before the
Haswell commit that would have introduced a regression.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Anuj Phogat <anuj.phogat@gmail.com> (original)
Tested-by: Ian Romanick <idr@freedesktop.org> (original)
11 years agoi965: Do texture swizzling in hardware on Haswell.
Kenneth Graunke [Fri, 21 Sep 2012 10:13:36 +0000 (03:13 -0700)]
i965: Do texture swizzling in hardware on Haswell.

Haswell supports EXT_texture_swizzle and legacy DEPTH_TEXTURE_MODE
swizzling by setting SURFACE_STATE entries.  This means we don't have to
bake the swizzle settings into the shader code by emitting MOV
instructions, and thus don't have to recompile shaders whenever the
swizzles change.

Unfortunately, we can't handle GL_ALPHA this way: unlike all the others,
which store the comparison result in the .r channel (and possibly others
as well), GL_ALPHA puts it in the .a channel.  The GLSL 1.30+ style
functions which return a float always simply return the .r channel,
which would be zero if we handled this as a surface override.  In this
case, fall back to doing it the old way.  DEPTH_TEXTURE_MODE = GL_ALPHA
isn't an interesting performance path anyway.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 6d6aef79742ece3bb570ae44e6c13791aae15e01)

11 years agoi965: Refactor texture swizzle generation into a helper.
Kenneth Graunke [Fri, 7 Sep 2012 20:24:16 +0000 (13:24 -0700)]
i965: Refactor texture swizzle generation into a helper.

It's going to be reused in a second place soon.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b5a042a657fed45264406cbd0d67fa6217a410a1)

11 years agoi965: Fix primitive restart on Haswell.
Kenneth Graunke [Sat, 25 Aug 2012 01:40:40 +0000 (18:40 -0700)]
i965: Fix primitive restart on Haswell.

Haswell moved the "Cut Index Enable" bit from the INDEX_BUFFER packet to
a new 3DSTATE_VF packet, so we need to emit that.  Also, it requires us
to specify the cut index rather than assuming it's 0xffffffff.

This adds a new Haswell-specific tracked state atom to gen7_atoms.
Normally, we would create a new generation-specific atom list, but since
there's only one difference over Ivybridge so far, I chose to simply
make it return without doing any work on non-Haswell systems.

Fixes five piglit tests:
- general/primitive-restart-DISABLE_VBO
- general/primitive-restart-VBO_COMBINED_VERTEX_AND_INDEX
- general/primitive-restart-VBO_INDEX_ONLY
- general/primitive-restart-VBO_SEPARATE_VERTEX_AND_INDEX
- general/primitive-restart-VBO_VERTEX_ONLY

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 815d9d405c69bb07d550ae9f79283dcdc7466e2c)

11 years agodocs: add news item for 9.0.2 release
Andreas Boll [Tue, 22 Jan 2013 20:25:04 +0000 (21:25 +0100)]
docs: add news item for 9.0.2 release

11 years agodocs: Add 9.0.2 release md5sums
Andreas Boll [Tue, 22 Jan 2013 20:24:43 +0000 (21:24 +0100)]
docs: Add 9.0.2 release md5sums

11 years agodocs: Add 9.0.2 release notes
Andreas Boll [Sun, 20 Jan 2013 14:40:11 +0000 (15:40 +0100)]
docs: Add 9.0.2 release notes

11 years agomesa: Bump version to 9.0.2
Andreas Boll [Sun, 20 Jan 2013 14:18:44 +0000 (15:18 +0100)]
mesa: Bump version to 9.0.2

11 years agoegl/wayland: Destroy the pending buffer callback with the egl surface
Ander Conselvan de Oliveira [Mon, 21 Jan 2013 15:36:52 +0000 (17:36 +0200)]
egl/wayland: Destroy the pending buffer callback with the egl surface

Otherwise, we crash when the callback is executed, since the dri2_surf
pointer may point to invalid data.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
11 years agomesa: update .cherry-ignore list
Andreas Boll [Sun, 20 Jan 2013 14:14:40 +0000 (15:14 +0100)]
mesa: update .cherry-ignore list

11 years agoRevert "r600g: try to fix streamout for the cases where BURST_COUNT > 0"
Andreas Boll [Fri, 18 Jan 2013 11:46:52 +0000 (12:46 +0100)]
Revert "r600g: try to fix streamout for the cases where BURST_COUNT > 0"

This reverts commit 42f71b4861b9d01a8f925fea3182fc1a292222f3.

Fixes the following piglit regressions on my rv770

./bin/ext_transform_feedback-output-type float[2] -auto -fbo
./bin/ext_transform_feedback-output-type float[2]-no-subscript -auto -fbo
./bin/ext_transform_feedback-output-type int[2] -auto -fbo
./bin/ext_transform_feedback-output-type int[2]-no-subscript -auto -fbo
./bin/ext_transform_feedback-output-type uint[2] -auto -fbo
./bin/ext_transform_feedback-output-type uint[2]-no-subscript -auto -fbo

11 years agotests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).
Johannes Obermayr [Sat, 29 Dec 2012 00:52:11 +0000 (01:52 +0100)]
tests: AM_CPPFLAGS must include $(top_srcdir) instead of $(top_builddir).

Reviewed-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit ebcabb88cfd19b35cd1b0a327fa055fff0c1b2be)

Additionally it fixes the missing $(top_srcdir)/include in
src/glsl/tests/Makefile.am

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

11 years agor600g: Use LOOP_START_DX10 for loops
Tom Stellard [Mon, 17 Sep 2012 14:33:56 +0000 (14:33 +0000)]
r600g: Use LOOP_START_DX10 for loops

LOOP_START_DX10 ignores the LOOP_CONFIG* registers, so it is not limited
to 4096 iterations like the other LOOP_* instructions.  Compute shaders
need to use this instruction, and since we aren't optimizing loops with
the LOOP_CONFIG* registers for pixel and vertex shaders, it seems like
we should just use it for everything.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 810345492eca34c2ad12728b5491a4691cc62ec2)

Fixes a hang on the following piglit test on my rv770
./bin/ext_timer_query-time-elapsed -auto -fbo

11 years agogallivm: support more immediates in lp_build_tgsi_info()
Brian Paul [Wed, 2 Jan 2013 20:46:20 +0000 (13:46 -0700)]
gallivm: support more immediates in lp_build_tgsi_info()

Bump limit from 32 to 128.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=58545
(cherry picked from commit 1b6ba9c4c840e291cbbe19a8601b56d1d103179c)

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoclover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced...
Johannes Obermayr [Fri, 30 Nov 2012 00:44:56 +0000 (01:44 +0100)]
clover: Adapt libclc's INCLUDEDIR and LIBEXECDIR to make use of the new introduced libclc.pc.

Tom Stellard:
  -Keep --with-libclc-path and mark it deprecated.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 959e83d65075513f989cb1fe634dca314a7e185f)

11 years agogallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.
Johannes Obermayr [Fri, 30 Nov 2012 22:53:58 +0000 (23:53 +0100)]
gallium/auxiliary: Add -fno-rtti to CXXFLAGS on LLVM >= 3.2.

Also remove the recently added and overloaded LLVM_CXXFLAGS from CXXFLAGS.

Note: This is a candidate for the stable branches.

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
(cherry picked from commit 21694b8eacbf63f8abdee6340510c0458a25a7fb)

Conflicts:
src/gallium/auxiliary/Makefile

11 years agoradeon/r200: Fix tcl culling
smoki [Thu, 3 Jan 2013 17:57:40 +0000 (18:57 +0100)]
radeon/r200: Fix tcl culling

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57842
(cherry picked from commit 5bf357db89836d0f4e4b8a4cb559755d4734b81b)

11 years agor200: fix broken tcl lighting
smoki [Mon, 10 Dec 2012 16:30:26 +0000 (17:30 +0100)]
r200: fix broken tcl lighting

command mistakenly used vector instead of scalar emit (the more or less
identical code in radeon is already correct).
Seems like it would be broken ever since kms probably.
Should fix bugs 22576, 26809.
(cherry picked from commit 320d531373e7b0873f5de42f6173b986290f593f)

11 years agoglsl: Don't add structure fields to the symbol table
Ian Romanick [Thu, 6 Dec 2012 22:57:01 +0000 (14:57 -0800)]
glsl: Don't add structure fields to the symbol table

I erroneously added this back in January 2011 in commit 88421589.
Looking at the commit message, I have no idea why I added it.  It only
added non-array structure fields to the symbol table, so array structure
fields are treated correctly.

Fixes piglit tests structure-and-field-have-same-name.vert and
structure-and-field-have-same-name-nested.vert.  It should also fix
WebGL conformance tests shader-with-non-reserved-words.

NOTE: This is a candidate for the stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57622
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ed3f237e09a42bdb55afb58d1536affad9000d76)

11 years agor300g: Fix visibility CFLAGS in automake
Adam Jackson [Wed, 2 Jan 2013 19:04:18 +0000 (14:04 -0500)]
r300g: Fix visibility CFLAGS in automake

Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit c8d3fd4a120be0f62367f679e31ea5763c10c197)

11 years agogalahad, noop: Fix visibility CFLAGS in automake
Adam Jackson [Wed, 2 Jan 2013 19:02:59 +0000 (14:02 -0500)]
galahad, noop: Fix visibility CFLAGS in automake

Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 443954d161dc3db0605926e4e759080e299710ce)

11 years agoglcpp: Typo fix.
Adam Jackson [Wed, 2 Jan 2013 19:09:22 +0000 (14:09 -0500)]
glcpp: Typo fix.

Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 86b6964ef9839f1bd5a05efe47712843c97196ca)

11 years agoglcpp: Fix visibility CFLAGS in automake
Adam Jackson [Wed, 2 Jan 2013 19:02:00 +0000 (14:02 -0500)]
glcpp: Fix visibility CFLAGS in automake

Note: this is a candidate for the 9.0 stable branch.

Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 0daabd52394899ec4947dc2cf3119201d2e79b1c)

11 years agoclover: Install CL headers.
Johannes Obermayr [Tue, 4 Dec 2012 13:18:03 +0000 (14:18 +0100)]
clover: Install CL headers.

Note: This is a candidate for the stable branches.
(cherry picked from commit b361bb3de4bd8d27f6fcb920e5516e51db00ef73)

11 years agobuild: Fix GLES linkage without libglapi
Andreas Boll [Thu, 6 Dec 2012 17:36:25 +0000 (18:36 +0100)]
build: Fix GLES linkage without libglapi

fixes a regression introduced with
fc9ea7c74dc5cb996c3d9fe6663fd6da080e8360

NOTE: This is a candidate for the 9.0 branch.

Reported-by: Brian Paul <brianp@vmware.com>
Acked-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 520892688af7ce9baca6e2b72e7e7eaebe02260c)

11 years agoglsl: fix uninitialised variable from constructor
Dave Airlie [Fri, 30 Nov 2012 10:24:33 +0000 (20:24 +1000)]
glsl: fix uninitialised variable from constructor

Coverity pointed out this uninitialised class member.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit f3476ec8fa5a94d469a12318c537b13ce9cc5a45)

11 years agoglsl: initialise killed_all field.
Dave Airlie [Fri, 30 Nov 2012 10:23:20 +0000 (20:23 +1000)]
glsl: initialise killed_all field.

coverity pointed out this field was being used uninitialised.

Note: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 906670a7906a785210c872f637239bf4afa5b63d)

11 years agoglsl: fix cut-n-paste error in error handling. (v2)
Dave Airlie [Fri, 30 Nov 2012 08:33:21 +0000 (18:33 +1000)]
glsl: fix cut-n-paste error in error handling. (v2)

Reported by coverity scan.

v2: fix second case

Note: This is a candidate for stable branches.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e85c9a4d2874a302195c66742b446f0645440c43)

11 years agoutil: added pipe_surface_release() function
Brian Paul [Fri, 30 Nov 2012 17:10:25 +0000 (10:10 -0700)]
util: added pipe_surface_release() function

To fix a pipe_context::surface_destroy() use-after-free problem.
We previously added pipe_sampler_view_release() for similar reasons.

Note: this is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 51223784d6a8ee93cf004c9ba87a7e4dcb7b3161)

11 years agobuild: use git ls-files for adding all Makefile.in into the release tarball
Andreas Boll [Fri, 16 Nov 2012 09:46:06 +0000 (10:46 +0100)]
build: use git ls-files for adding all Makefile.in into the release tarball

Until we have proper 'make dist' this is an improvement of the current
situation, because each time some old Makefiles got converted to automake
we had to update the tarballs target.

NOTE: This is a candidate for the 9.0 branch.

Cc: Eric Anholt <eric@anholt.net>
Acked-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0f5e2ce8541855c65852dabbb19313fd0bb65b3d)

Conflicts:
Makefile.am

11 years agoi965/gen4: Fix memory leak each time compile_gs_prog() is called.
Eric Anholt [Fri, 16 Nov 2012 17:56:03 +0000 (09:56 -0800)]
i965/gen4: Fix memory leak each time compile_gs_prog() is called.

Commit 774fb90db3e83d5e7326b7a72e05ce805c306b24 introduced a ralloc context to
each user of struct brw_compile, but for this one a NULL context was used,
causing the later ralloc_free(mem_ctx) to not do anything.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55175
NOTE: This is a candidate for the stable branches.
(cherry picked from commit 59bfd66a614177320817a97e1dadfcfcf3b9b092)

11 years agoradeonsi: add a new SI pci id
Alex Deucher [Wed, 21 Nov 2012 23:48:18 +0000 (18:48 -0500)]
radeonsi: add a new SI pci id

Note: this is a candidate for the stable branch.

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit e2df37f69a4e513b756fc193a544d48d8fd0ddac)

11 years agoi915: Fix wrong sizeof argument in i915_update_tex_unit.
Vinson Lee [Wed, 14 Nov 2012 07:20:42 +0000 (23:20 -0800)]
i915: Fix wrong sizeof argument in i915_update_tex_unit.

The bug was found by Coverity.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 10f214e5b248e5dd5f323c689549cd66d2f6ad22)

11 years agoAdd .dirstamp to toplevel .gitignore
Andreas Boll [Sat, 17 Nov 2012 17:04:54 +0000 (18:04 +0100)]
Add .dirstamp to toplevel .gitignore
(cherry picked from commit 59b3d3ad6e77af92eb23b77c59dc60e6f9566d87)

11 years agoegl/dri2: Set error code when dri2CreateContextAttribs fails
Chad Versace [Fri, 9 Nov 2012 22:06:41 +0000 (14:06 -0800)]
egl/dri2: Set error code when dri2CreateContextAttribs fails

When dri2CreateContextContextAttribs failed, eglCreateContext returned
NULL yet set the error code to EGL_SUCCESS! The problem was that
eglCreateContext ignored the error code returned by
driCreateContextAttribs.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56706
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 5cf8536690226b3bd19d19197fcec501a278703c)

11 years agoi965: Validate requested GLES context version in brwCreateContext
Chad Versace [Fri, 9 Nov 2012 22:06:40 +0000 (14:06 -0800)]
i965: Validate requested GLES context version in brwCreateContext

For GLES1 and GLES2, brwCreateContext neglected to validate the requested
context version received from the DRI layer. If DRI requested an OpenGL
ES2 context with version 3.9, we provided it one.

Before this fix, the switch statement that validated the requested GL
context flavor was an ugly #ifdef copy-paste mess. Instead of reproducing
the copy-past-mess for GLES1 and GLES2, I first refactored it.  Now the
switch statement is readable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 243cf7a924eaef78ce0d5150747fae6c3c4e6974)

11 years agoautomake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too
Maarten Lankhorst [Mon, 19 Nov 2012 08:43:29 +0000 (09:43 +0100)]
automake: strip LLVM_CXXFLAGS and LLVM_CPPFLAGS too

It seems that -NDEBUG and other flags might still be leaked through
those variables, so strip those off there as well.

NOTE: This is a candidate for the 9.0 branch.

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

11 years agomesa: Fix segfault on reading from a missing color read buffer.
Eric Anholt [Tue, 13 Nov 2012 21:39:37 +0000 (13:39 -0800)]
mesa: Fix segfault on reading from a missing color read buffer.

The diff looks funny, but it's moving the integer vs non-integer check
below the _mesa_source_buffer_exists() check that ensures
_ColorReadBuffer is non-null, so we get a GL_INVALID_OPERATION instead
of a segfault.  This looks like it had regressed in the
_mesa_error_check_format_and_type() changes, which removed the first of
the two duplicated checks for the source buffer.  Fixes segfault in the
new piglit ARB_framebuffer_object/negative-readpixels-no-rb.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=45877
NOTE: This is a candidate for the stable branches.
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 5c99697f74c68f7e170564d791b95d986a18774a)