History log of /external/mesa3d/src/
Revision Date Author Comments (<<< Hide modified files) (Show modified files >>>)
39b588b9680a2ce28dc6a5000700c2b315d6a61c 25-Jan-2014 Colin Cross <ccross@android.com> external/mesa3d: convert LOCAL_MODULE_PATH to LOCAL_MODULE_RELATIVE_PATH

LOCAL_MODULE_PATH doesn't work for multiarch builds, replace it
with LOCAL_MODULE_RELATIVE_PATH.

Change-Id: I4e4ceec61d026bbe74ba604554c06104bde42e5e
gl/main/Android.mk
183a28a34a2184395e14d4682fbb425b5791eac6 21-Feb-2013 Andreas Boll <andreas.boll.dev@gmail.com> mesa: Bump version to 9.0.3
esa/main/version.h
f84fe6aa2eac6984b77ca6da0c7e5a571b425827 15-Feb-2013 Zack Rusin <zackr@vmware.com> DRI2: Don't disable GLX_INTEL_swap_event unconditionally

GLX_INTEL_swap_event is broken on the server side, where it's
currently unconditionally enabled. This completely breaks
systems running on drivers which don't support that extension.
There's no way to test for its presence on this side, so instead
of disabling it uncondtionally, just disable it for drivers
which are known to not support it. It makes sense because
most drivers do support it right now.
We'll be able to remove this once Xserver properly advertises
GLX_INTEL_swap_event.

Note: This is a candidate for stable branch branches.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60052
Reviewed-by: Jesse Barnes <jbarnes@virtuousgeek.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 076403c30d9f5cc79374e30d9f6007b08a63bf2d)
lx/dri2_glx.c
be7048477a2989bd11ab590c65ea1515f764a86c 14-Feb-2013 Eric Anholt <eric@anholt.net> i965/gen7: Set up all samplers even if samplers are sparsely used.

In GLSL, sampler indices are allocated contiguously from 0. But in the
case of ARB_fragment_program (and possibly fixed function), an app that
uses texture 0 and 2 will use sampler indices 0 and 2, so we were only
allocating space for samplers 0 and 1 and setting up sampler 0. We
would read garbage for sampler 2, resulting in flickering textures and
an angry simulator.

Fixes bad rendering in 0 A.D. and ETQW. This was fixed for pre-gen7 by
28f4be9eb91b12a2c6b1db6660cca71a98c486ec

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=25201
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=58680
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for stable branches.
(cherry picked from commit 5bb05c6e6d596d66c177e42a36128d2ca2e300aa)
esa/drivers/dri/i965/gen7_sampler_state.c
4e35ffa762d763820b7defc14af564b2a02c61c8 03-Oct-2012 Eric Anholt <eric@anholt.net> i965/vs: Try again when we've successfully spilled a reg.

Before, we'd spill one reg, then continue on without actually register
allocating, then assertion fail when we tried to use a vgrf number as a
register number.

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

This should have been picked when 9237f0e was picked.

Bugzill: https://bugs.freedesktop.org/show_bug.cgi?id=59700
esa/drivers/dri/i965/brw_vec4.h
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
15693b7925ccdd45bbb60b375ce6b7a3f60bfa3e 01-Dec-2012 Brian Paul <brian.e.paul@gmail.com> nouveau: Fix build.

Fixes nouveau build failure introduced at
c73245882c7ff1277b190b97f093f7b423a22f10.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=57746
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit a17750b6884939a36947c76a30d3077f1488f943)
esa/drivers/dri/nouveau/nouveau_fbo.c
dddc5df5192931f40da4f9a4a3b7b59438bc908a 02-Feb-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Fix the SF Vertex URB Read Length calculation for Gen7 platforms.

Ivybridge doesn't appear to have the same errata as Sandybridge; no
corruption was observed by setting it to more than the minimal correct
value. It's possible that we were simply lucky, since the URB entries
are 1024-bit on Ivybridge vs. 512-bit Sandybridge. Or perhaps the
underlying hardware issue is fixed.

Either way, we may as well program the minimum value since it's now
readily available, likely to be more efficient, and possibly more
correct.

v2: Use GEN7_SBE_* defines rather than GEN6_SF_*. (A copy and paste
mistake.) They're the same, but using the right names is better.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 44aa2e15f692965be76229e67f919bf967fc7d67)
esa/drivers/dri/i965/gen7_sf_state.c
e11ef54a92843be70850ae0244169b5b9708ecab 02-Feb-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Fix the SF Vertex URB Read Length calculation for Sandybridge.

(This commit message was primarily written by Paul Berry, who explained
what's going on far better than I would have.)

Previous to this patch, we thought that the only restrictions on
3DSTATE_SF's URB read length were (a) it needs to be large enough to
read all the VUE data that the SF needs, and (b) it can't be so large
that it tries to read VUE data that doesn't exist. Since the VUE map
already tells us how much VUE data exists, we didn't bother worrying
about restriction (a); we just did the easy thing and programmed the
read length to satisfy restriction (b).

However, we didn't notice this erratum in the hardware docs: "[errata]
Corruption/Hang possible if length programmed larger than recommended".
Judging by the context surrounding this erratum, it's pretty clear that
it means "URB read length must be exactly the size necessary to read all
the VUE data that the SF needs, and no larger". Which means that we
can't program the read length based on restriction (b)--we have to
program it based on restriction (a).

The URB read size needs to precisely match the amount of data that the
SF consumes; it doesn't work to simply base it on the size of the VUE.

Thankfully, the PRM contains the precise formula the hardware expects.

Fixes random UI corruption in Steam's "Big Picture Mode", random terrain
corruption in PlaneShift, and Piglit's fbo-5-varyings test.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56920
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=60172
Tested-by: Jordan Justen <jordan.l.justen@intel.com> (v1/Piglit)
Tested-by: Martin Steigerwald <martin@lichtvoll.de> (PlaneShift)
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 09fbc298283b41cf3f25d75842a6d8ab4952dca1)
esa/drivers/dri/i965/gen6_sf_state.c
2de8874ec37bfc548de2e16bbefa51341e25d340 02-Feb-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Compute the maximum SF source attribute.

The maximum SF source attribute is necessary to compute the Vertex URB
read length properly, which will be done in the next commit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 5e9bc7bd1290b0c34be90e9a0b8298ebe4b4b131)
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/gen6_sf_state.c
esa/drivers/dri/i965/gen7_sf_state.c
d47020b6d4d810ac3f20c1e47c90d9de3fb8a53a 02-Feb-2013 Kenneth Graunke <kenneth@whitecape.org> i965: Refactor Gen6+ SF attribute override code.

The next patch will benefit from easy access to the source attribute
number and whether or not we're swizzling. It doesn't want the final
attr_override DWord form, however.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Martin Steigerwald <martin@lichtvoll.de>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit b3efc5bea85a84493a4b81eea0d3c3acfe42813f)
esa/drivers/dri/i965/gen6_sf_state.c
71e3ee38aca50b6954cc7e341aa082797741f02d 06-Feb-2013 Roland Scheidegger <sroland@vmware.com> softpipe: fix using optimized filter function

This optimized filter (when using repeat wrap modes,
linear min/mag/mip filters, pot textures) only applies to 2d textures,
but nothing prevented it from being used for other textures (likely
leading to very bogus sample results).

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 66b6d5121475ecdd6b76ff660e28dfa6cc3f727c)
allium/drivers/softpipe/sp_tex_sample.c
fdfb299c22318ad54520de86fade5754848f8366 01-Feb-2013 Marek Olšák <maraeo@gmail.com> r300g: fix blending with blend color and RGBA formats

NOTE: This is a candidate for the stable branches.
(cherry picked from commit f40a7fc34a601195191b1b2ffef55818a4086d5f)
allium/drivers/r300/r300_state.c
2389fcc8025458e4872b83feb72727ab38f07f33 05-Feb-2013 Brian Paul <brianp@vmware.com> svga: fix sRGB rendering

We weren't emitting the SVGA_RS_OUTPUTGAMMA state so sRGB rendering
didn't work properly.

Fixes piglit's framebuffer-srgb test.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit ff605091579a0dfbb6a6b3ea0e46d6fed28a278b)
allium/drivers/svga/svga_state_rss.c
cef854dba71dc1af27b0e32cc026e9a54bc45473 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
esa/main/extensions.c
adcf0a0cf464fb27762ae04d599f50f778c32481 28-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/state_tracker/st_extensions.c
663e41547a2ff2ada167c078922b63aaf9a3f9fb 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
esa/main/extensions.c
d40df8073209e54c943d3ecaa20cf3297a765907 28-Jan-2013 Marek Olšák <maraeo@gmail.com> 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)
allium/auxiliary/util/u_upload_mgr.c
914368538ec72926f160e784dcbae5db05e34abe 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
allium/auxiliary/util/u_vbuf.c
c760677c85a1019eef67b2ce0ce97e8218918f44 24-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/state_tracker/st_cb_bitmap.c
esa/state_tracker/st_cb_clear.c
esa/state_tracker/st_cb_drawpixels.c
esa/state_tracker/st_cb_drawtex.c
esa/state_tracker/st_draw.c
a1cb12c1fbec30c23d50209db2fbf2b563ddcbe0 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
allium/auxiliary/util/u_upload_mgr.c
d32aff91c1c42b3f8bfb6c4109a8ea79c1f46d8d 03-Dec-2012 Brian Paul <brianp@vmware.com> 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)
esa/state_tracker/st_cb_fbo.c
d4fc90c129389de2b5ac6e2ac1561cca7e1f1185 01-Dec-2012 Brian Paul <brianp@vmware.com> 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)
esa/main/renderbuffer.c
5fdc42fb877644ae4c3343c9391f959bc7d71515 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
lx/dri_glx.c
527b3b8555f695d5b349d00eb1e63208b797bf2c 30-Nov-2012 Brian Paul <brianp@vmware.com> 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)
esa/state_tracker/st_cb_fbo.c
9d4ab9a663d4088ec553edaae0eeafb746d2490d 11-Feb-2013 Brian Paul <brianp@vmware.com> 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
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/nouveau/nouveau_fbo.c
esa/drivers/dri/radeon/radeon_fbo.c
esa/drivers/dri/swrast/swrast.c
esa/drivers/osmesa/osmesa.c
esa/drivers/windows/gdi/wmesa.c
esa/drivers/x11/xm_buffer.c
esa/main/fbobject.c
esa/main/mtypes.h
esa/main/renderbuffer.c
esa/main/renderbuffer.h
esa/main/shared.c
esa/state_tracker/st_cb_fbo.c
esa/swrast/s_renderbuffer.c
esa/swrast/s_texrender.c
dca04373c2efb177dbb7dca3ad2b57cb36b2ebe6 30-Aug-2012 Brian Paul <brianp@vmware.com> 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)
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/nouveau/nouveau_fbo.c
esa/drivers/dri/radeon/radeon_fbo.c
esa/drivers/dri/swrast/swrast.c
esa/main/renderbuffer.c
esa/state_tracker/st_cb_fbo.c
esa/swrast/s_renderbuffer.c
d2d3cd2be78022e585b4a155d742d346471453d0 26-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/state_tracker/st_extensions.c
f4e33c551df241bb07a457c67ed515fdad72b5b4 26-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/drivers/x11/xm_dd.c
8d38c7229827cf76a29f942725e1d907fd335dc1 26-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/drivers/osmesa/osmesa.c
3fa0423c0230154c80d8f45d3232acc10b6e2014 25-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/vbo/vbo_exec_api.c
6b745a4e245305aae7b41b246c853a273a397673 25-Jan-2013 Brian Paul <brianp@vmware.com> 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)
allium/drivers/svga/svga_pipe_sampler.c
998f402af5b37aadc6dc8adcc19f7b6428ada007 23-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/program/program.c
63f858943084b5cbeb20cce96ccae3c25e633663 25-Jan-2013 Zack Rusin <zackr@vmware.com> 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)
lx/dri2_glx.c
765221c0d5fdb0357bf6fae3220c7d57d93f938d 28-Nov-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
lsl/ast_to_hir.cpp
lsl/glsl_symbol_table.cpp
lsl/glsl_symbol_table.h
c10c3eab4c9d8617bb12dc5958eb9cfe06cc2e4d 04-Jan-2013 Adam Jackson <ajax@redhat.com> 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)
esa/drivers/dri/r200/r200_maos_arrays.c
2cde1e592e404bd382ee392449673dbb6c67b034 27-Dec-2012 Jordan Justen <jordan.l.justen@intel.com> 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)
esa/main/format_unpack.c
96c1678c3ad2dd460d8a5e8787d3dc7a0d9588c9 03-Jan-2013 Brian Paul <brianp@vmware.com> 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)
allium/auxiliary/util/u_tile.c
af41a1d49107f5020bfceda8ea930601bb6b92b9 03-Jan-2013 Brian Paul <brianp@vmware.com> 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)
allium/auxiliary/util/u_tile.c
3a39c3cb678e2b41b6d2edd4fe0ba8c6c381b614 04-Jan-2013 Brian Paul <brianp@vmware.com> 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)
allium/state_trackers/glx/xlib/glx_api.c
938b156d824d2dd34eea9247e0efc4467a3fc804 04-Jan-2013 Brian Paul <brianp@vmware.com> 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)
esa/drivers/x11/fakeglx.c
cd95b673479f8a8ac3d5aabf387d33f705e156e9 04-Jan-2013 Marek Olšák <maraeo@gmail.com> r600g: fix int->bool conversion in fence_signalled

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 9f0ddbc9e4b44f165c96841fe32ebc66c68d2709)
allium/drivers/r600/r600_pipe.c
439842e434c87ea1775e828820d11e8194982bcc 27-Dec-2012 Brian Paul <brianp@vmware.com> 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)
esa/drivers/x11/xm_api.c
3bdb75893491acaca571de6c8caf241dc47b9953 14-Dec-2012 Frank Henigman <fjhenigman@google.com> 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)
esa/main/uniform_query.cpp
dcb6a7ccbb63aaeec719b873a809c61a8bf45297 19-Dec-2012 Paul Berry <stereotype441@gmail.com> 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)
esa/main/buffers.c
e8830f5a4009c3784836edb441319a62c7beef36 14-Dec-2012 Brian Paul <brianp@vmware.com> 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)
allium/drivers/softpipe/sp_fs_exec.c
allium/drivers/softpipe/sp_quad_fs.c
allium/drivers/softpipe/sp_state_derived.c
e6e58cfa9dd8cbd5d6977822355d150e76eb987a 14-Dec-2012 Brian Paul <brianp@vmware.com> 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)
allium/drivers/softpipe/sp_fs_exec.c
allium/drivers/softpipe/sp_state.h
allium/drivers/softpipe/sp_state_shader.c
5f8a8716b6b58a470be0b0d176e38d37eda2c8f7 08-Dec-2012 Matt Turner <mattst88@gmail.com> 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)
esa/main/uniform_query.cpp
460096f5da820d3701cf7ca2800d94ef00b5967e 05-Dec-2012 Stefan Dösinger <stefandoesinger@gmx.at> 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
esa/drivers/dri/r200/r200_context.c
25e34c3526e5a999997d8966ede8a11d2deb0122 05-Dec-2012 Stefan Dösinger <stefandoesinger@gmx.at> 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
esa/drivers/dri/radeon/radeon_context.c
794c133dfb954268fe8ee5989af81d891901de08 05-Dec-2012 Stefan Dösinger <stefandoesinger@gmx.at> 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/
esa/drivers/common/meta.c
9ae069dbbd6814fc86ad371e439b7750b938408a 05-Dec-2012 Brian Paul <brianp@vmware.com> 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)
allium/auxiliary/draw/draw_pipe_validate.c
4a0423e1bd2ba287f7c0599d1a9b80d9206f14cb 16-Nov-2012 José Fonseca <jfonseca@vmware.com> 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)
allium/auxiliary/draw/draw_pt_fetch.c
e582e35227adefccdfa5954008ee8543d5d81fcf 03-Dec-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/main/extensions.c
37be707f57df72071a43b9899dec063730c338f5 03-Dec-2012 Brian Paul <brianp@vmware.com> 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)
allium/state_trackers/glx/xlib/glx_api.c
b086d9ced7d3ab07afa008aea0253c75e827f392 16-Nov-2012 Anuj Phogat <anuj.phogat@gmail.com> 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)
esa/drivers/common/meta.c
esa/main/texgetimage.c
ce220540744c0dde30e5670441bbc7eab915cf89 27-Nov-2012 Matt Turner <mattst88@gmail.com> 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)
esa/main/shaderobj.c
b7af6550b1201f8883823c9fece85fedf1a49a92 23-Nov-2012 Matt Turner <mattst88@gmail.com> 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)
esa/main/shaderapi.c
738d1ae3b59b073605c7fb58ec6f0a85a185ffd3 25-Oct-2012 José Fonseca <jfonseca@vmware.com> 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)
esa/state_tracker/st_cb_drawpixels.c
ebd4883a0c53a3584f6da78042dbc38da779291b 17-Oct-2012 Eric Anholt <eric@anholt.net> 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)
esa/drivers/dri/i965/brw_queryobj.c
78222e63630280b96488de0d51d1b2578e26f814 30-Jan-2013 Jerome Glisse <jglisse@redhat.com> 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>
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
allium/winsys/radeon/drm/radeon_drm_cs.c
allium/winsys/radeon/drm/radeon_winsys.h
d9c7fcff8fb3247f2ff241d97326b329f5bab487 23-Jan-2013 Chad Versace <chad.versace@linux.intel.com> 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)
esa/drivers/dri/i965/brw_disasm.c
bc7112746d4663b814aab018c8c1fb97af03fb42 17-Jan-2013 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_vec4_visitor.cpp
29bc8e7d8f166ae09edb8efda0b8c3bd8b7b7321 17-Jan-2013 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_vec4_visitor.cpp
de150e24781cfb9f2f7e62355f3af68d23c681df 17-Jan-2013 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_vec4_visitor.cpp
a3d2e3e061f219edc684e46b4c27d3fbcf322c18 29-Nov-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/gen7_sf_state.c
0ba14013f66c03c6a3cc0a5e3ef74e92bfe5afb9 26-Nov-2012 Eric Anholt <eric@anholt.net> 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.
esa/drivers/dri/i965/brw_fs_visitor.cpp
457eab5a9bf563b54d46fa57cba513837224b120 12-Nov-2012 Eric Anholt <eric@anholt.net> 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.
esa/drivers/dri/i965/brw_fs_visitor.cpp
871da78263673cf123e28b3c0aa88b48745ac93d 13-Aug-2011 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_context.c
d02343e5016a5795451af3e0315b658b39463a30 04-Jan-2013 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_defines.h
esa/drivers/dri/i965/brw_fs_emit.cpp
esa/drivers/dri/i965/brw_shader.cpp
esa/drivers/dri/i965/brw_vec4_emit.cpp
e4793701647c9b4112c7789926a564f796d4faeb 16-Jan-2013 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_lower_texture_gradients.cpp
42df904f88a3515bf8bea5c1228380714c9146fb 21-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_wm.c
esa/drivers/dri/i965/gen7_wm_surface_state.c
3ebfd3f7743e5c05661eab977b23441e45441b39 07-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_wm.c
esa/drivers/dri/i965/brw_wm_surface_state.c
b922999a404322a1034c4f96c21acae860483bb0 25-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> 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)
esa/drivers/dri/i965/brw_defines.h
esa/drivers/dri/i965/brw_draw_upload.c
esa/drivers/dri/i965/brw_primitive_restart.c
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_state_upload.c
2b2ab2b3eab6f016dc7027ee4610f5f9500a0ac7 20-Jan-2013 Andreas Boll <andreas.boll.dev@gmail.com> mesa: Bump version to 9.0.2
esa/main/version.h
81d40e66ad1c0c53c1de2f183a4987a3159c7c55 21-Jan-2013 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> 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>
gl/drivers/dri2/egl_dri2.h
gl/drivers/dri2/platform_wayland.c
88258e0dfe2371c2d591f27fba3511977e31e5ea 18-Jan-2013 Andreas Boll <andreas.boll.dev@gmail.com> 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
allium/drivers/r600/r600_shader.c
d63e946587bb104e2b320fbebafe25bb969d01b8 29-Dec-2012 Johannes Obermayr <johannesobermayr@gmx.de> 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
lsl/tests/Makefile.am
lx/tests/Makefile.am
api/shared-glapi/tests/Makefile.am
4cf2be408eeabd7ae8b0d3c3c81a6dc17e98e323 17-Sep-2012 Tom Stellard <thomas.stellard@amd.com> 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
allium/drivers/r600/eg_asm.c
allium/drivers/r600/r600_asm.c
allium/drivers/r600/r600_shader.c
7045f222cdd3a50f03e66ae2c184af17d9c32364 02-Jan-2013 Brian Paul <brianp@vmware.com> 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>
allium/auxiliary/gallivm/lp_bld_tgsi_info.c
39fdab1d66bd3374c6de31bb8d890b911391c1fa 30-Nov-2012 Johannes Obermayr <johannesobermayr@gmx.de> 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)
allium/state_trackers/clover/Makefile.am
allium/state_trackers/clover/llvm/invocation.cpp
dfb3dc3fb817af398c51269691948a93f6164a30 30-Nov-2012 Johannes Obermayr <johannesobermayr@gmx.de> 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
allium/auxiliary/Makefile
320b5abda5026f23f327c6f60c1b6287cc507e78 03-Jan-2013 smoki <smoki00790@gmail.com> radeon/r200: Fix tcl culling

Should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=57842
(cherry picked from commit 5bf357db89836d0f4e4b8a4cb559755d4734b81b)
esa/drivers/dri/r200/r200_state.c
esa/drivers/dri/radeon/radeon_state.c
b694aa4ab9579815903220a0a3536f648914551a 10-Dec-2012 smoki <smoki00790@gmail.com> 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)
esa/drivers/dri/r200/r200_state_init.c
6b3355c91dc24bd93b63ed6c6701faa581499810 06-Dec-2012 Ian Romanick <ian.d.romanick@intel.com> 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)
lsl/glsl_parser.yy
ced638e674e5fedb8432ec72c19dd90b3d260f35 02-Jan-2013 Adam Jackson <ajax@redhat.com> 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)
allium/drivers/r300/Makefile.am
727b56b5787dd1e3f5afd898ad6650e18d8758f7 02-Jan-2013 Adam Jackson <ajax@redhat.com> 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)
allium/drivers/Makefile.am
8333a7b6e3a8a49ef5b7b673ca0c0bb3369b5222 02-Jan-2013 Adam Jackson <ajax@redhat.com> 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)
lsl/glcpp/Makefile.am
7eddf861859135caea9cea20576d024909660d95 02-Jan-2013 Adam Jackson <ajax@redhat.com> 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)
lsl/glcpp/Makefile.am
5a36510f71fa9e348b094b4b88c6639b0850e5e4 04-Dec-2012 Johannes Obermayr <johannesobermayr@gmx.de> clover: Install CL headers.

Note: This is a candidate for the stable branches.
(cherry picked from commit b361bb3de4bd8d27f6fcb920e5516e51db00ef73)
allium/state_trackers/clover/Makefile.am
67fb55b03df31c57b6382d78d8c27f558db8759d 06-Dec-2012 Andreas Boll <andreas.boll.dev@gmail.com> 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)
api/es1api/Makefile.am
api/es2api/Makefile.am
a096942592142c98ccba5f82cea41d53df328137 30-Nov-2012 Dave Airlie <airlied@gmail.com> 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)
lsl/ir_function_detect_recursion.cpp
eadadecbaad7f72dbdb122385447e3f4e251837d 30-Nov-2012 Dave Airlie <airlied@gmail.com> 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)
lsl/opt_constant_propagation.cpp
a00623174b629525fa5a9ba651ba31809b23b6e7 30-Nov-2012 Dave Airlie <airlied@gmail.com> 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)
lsl/ir_validate.cpp
da8876c7dd4b4a3db1df723b83e963575cdad3d6 30-Nov-2012 Brian Paul <brianp@vmware.com> 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)
allium/auxiliary/util/u_inlines.h
f05a0226b88bd58f3d2f07ec0e7df8032b739304 16-Nov-2012 Eric Anholt <eric@anholt.net> 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)
esa/drivers/dri/i965/brw_gs.c
b5d25dd849a8b843f05bdc92c5f06bbd321b8eb6 14-Nov-2012 Vinson Lee <vlee@freedesktop.org> 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)
esa/drivers/dri/i915/i915_texstate.c
65476169f344115462a652da39972d16aadee86f 09-Nov-2012 Chad Versace <chad.versace@linux.intel.com> 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)
gl/drivers/dri2/egl_dri2.c
8a3a76e1dac98244140b3e8d663719965c38be5f 09-Nov-2012 Chad Versace <chad.versace@linux.intel.com> 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)
esa/drivers/dri/i965/brw_context.c
b683891fdabda6b8dcec655652c0709419d4922c 13-Nov-2012 Eric Anholt <eric@anholt.net> 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)
esa/main/readpix.c
3ec28fc976dcf75960c023c31ddc663925763e92 11-Nov-2012 Marek Olšák <maraeo@gmail.com> mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2

MaxLog2 led to bugs, because it didn't work well with 1D and 3D textures.

NOTE: This is a candidate for the stable branches.

v2: correct the comment at MaxNumlevels

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>

(cherry picked from commit 8111342e814304730bed34446ea816cbc17a5775)
esa/main/teximage.h
ba36bd0375d89e78e3c2ffb923b9ba7af0e4bfb9 08-Nov-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix AA Line Distance Mode in 3DSTATE_SF on Ivybridge.

We were accidentally setting bit 14 in DWord 2 (which is Reserved/MBZ)
rather than bit 14 in DWord 3 (which is AA Line Distance Mode).

There's also no reason to ever set it to legacy mode; the bit is only
used when drawing antialiased lines anyway. Set it unconditionally.

NOTE: This is a candidate for stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit e639385064663ba401544de5dbd463fa7f6cce2d)
esa/drivers/dri/i965/gen7_sf_state.c
a3f5601465086bfcda4e68c3c55a284dd84879c6 06-Nov-2012 Matt Turner <mattst88@gmail.com> glcpp: Reject garbage after #else and #endif tokens

Previously we were accepting garbage after #else and #endif tokens when
the previous preprocessor conditional evaluated to false (eg, #if 0).

When the preprocessor hits a false conditional, it switches the lexer
into the SKIP state, in which it ignores non-control tokens. The parser
pops the SKIP state off the stack when it reaches the associated #elif,
#else, or #endif. Unfortunately, that meant that it only left the SKIP
state after the lexing the entire line containing the #token and thus
would accept garbage after the #token.

To fix this we use a mid-rule, which is executed immediately after the
#token is parsed.

NOTE: This is a candidate for the stable branch
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56442
Fixes: preprocess17_frag.test from oglconform
Reviewed-by: Carl Worth <cworth@cworth.org> (glcpp-parse.y)
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 060e69679925f171cfcc2a5f84fab1d833a7e804)
lsl/glcpp/glcpp-parse.y
lsl/glcpp/tests/102-garbage-after-endif.c
lsl/glcpp/tests/102-garbage-after-endif.c.expected
lsl/glcpp/tests/103-garbage-after-else.c
lsl/glcpp/tests/103-garbage-after-else.c.expected
2d00d104b4c0c7e51b6f969b658573cbe60b0046 07-Oct-2012 Mario Kleiner <mario.kleiner@tuebingen.mpg.de> mesa: Don't glPopAttrib() GL_POINT_SPRITE_COORD_ORIGIN on < OpenGL-2.0

The GL_POINT_BIT state attribute GL_POINT_SPRITE_COORD_ORIGIN
is only supported on OpenGL-2.0 or later. Prevent glPopAttrib()
from trying to restore it on OpenGL-1.4 implementations which
support GL_ARB_POINT_SPRITE, as otherwise the sequence...

glPushAttrib(GL_POINT_BIT);
glPopAttrib();

throws an GL_INVALID_ENUM error in glPopAttrib().

See also commit f778174ea1e431a7113f12c12beb4aba9e825a9f

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Mario Kleiner <mario.kleiner@tuebingen.mpg.de>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit eabbe5c45f5d05822c5f841628afa4008398d553)
esa/main/attrib.c
422f3bb8ab95f00e17aa969f7a09c7ceee5f8bef 08-Nov-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Fix glGetVertexAttribI[u]iv now that we have real integer attribs.

Since cf438f5375e242, we store actual integers for the attribute data.
We just need to reinterpret the GLfloat array as a GLint/GLuint array
so we can read the proper data.

Fixes oglconform's glsl-vertex-attrib/basic.VertexAttribI[1234][u]i
subtests (after fixing an unrelated bug in those test cases).

v2: Use the COPY_4V macro to be concise.

NOTE: This is a candidate for the stable branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com> [v1]
(cherry picked from commit c299f44782d7d7d6719fce622a121aad58856139)
esa/main/varray.c
cc8ff5354da0eeba5551b5d5bd12898c38e6191f 01-Sep-2012 Dave Airlie <airlied@gmail.com> glsl_to_tgsi: fix dst register for texturing fetches.

I've no idea why there isn't a piglit that triggers this behaviour,
but while enabling TBOs for softpipe and r600g, I noticed all the
integer tests failed. I tracked it back to the TXF returning a float
when it should be returning an int. This fixed it and I haven't
seen any regressions in a full piglit run on softpipe.

http://bugs.freedesktop.org/55010

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 9785ae0973cc206afc36dbc7d5b9553f92d06b47)
esa/state_tracker/st_glsl_to_tgsi.cpp
c4263ac0baa37ee7cff9e36f973afab5fda433d4 02-Nov-2012 Anuj Phogat <anuj.phogat@gmail.com> meta: Remove redundant code in _mesa_meta_GenerateMipmap

Integer textures generate invalid operation in glGenerateMipmap.
So, the code related to integer textures is now redundant.

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit a196f43596f6cb85a8f3e446596a2fb8e0ee7872)
esa/drivers/common/meta.c
cb3bcb73e5646d25e9a313b478671c71a3440bf7 02-Nov-2012 Anuj Phogat <anuj.phogat@gmail.com> mesa: Generate invalid operation in glGenerateMipMap for integer textures

Khronos has reached a conclusion and disallowed following texture formats in
glGenerateMipMap():
(a) ASTC textures
(b) integer internal formats (e.g., RGBA8UI, RG16I)
(c) textures with stencil formats (e.g., STENCIL_INDEX8)
(d) textures with packed depth/stencil formats (e.g, DEPTH24_STENCIL8)

https://cvs.khronos.org/bugzilla/show_bug.cgi?id=9471

Note: This is a candidate for stable branches.
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit c0a78d7d7b51e125d143e693fdfc78b90f2d68cf)
esa/main/fbobject.c
7e80685340dad7c76f72285c2f6c8268c413fbde 31-Oct-2012 Eric Anholt <eric@anholt.net> mesa: Fix core GL genned-name handling for glBeginQuery().

Fixes piglit gl-3.1/genned-names.

NOTE: This is a candidate for the 9.0 branch.
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 4fce0230fc3528be32562410bcddfc887c4d25a0)
esa/main/queryobj.c
e6174a9fd91071841d432a6e63523840b97e4e0e 31-Oct-2012 Eric Anholt <eric@anholt.net> mesa: Fix the core GL genned-name handling for glBindBufferBase()/Range().

This is part of fixing gl-3.1/genned-names.

v2: Fix a missing return value.

NOTE: This is a candidate for the 9.0 branch.
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 947d8ff4a7c4b7ffb4013056b48dbabe6b3931b0)
esa/main/bufferobj.c
9e1050d72fb78b56b03304727abb122713a90ed1 30-Oct-2012 José Fonseca <jose.r.fonseca@gmail.com> llvmpipe: Obey back writemask.

Tested with a modified glean tstencil2 test.

NOTE: This is a candidate for stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit f69fc3612768d9cfed974b9d6ecf6a70fa0db99c)
allium/drivers/llvmpipe/lp_bld_depth.c
18a9979dc138adc743f4c19acde7218538614db9 23-Oct-2012 Bryan Cain <bryancain3@gmail.com> glsl_to_tgsi: set correct register type for array and structure elements

This fixes an issue where glsl_to_tgsi_visior::get_opcode() would emit the
wrong opcode because the register type was GLSL_TYPE_ARRAY/STRUCT instead of
GLSL_TYPE_FLOAT/INT/UINT/BOOL, so the function would use the float opcodes for
operations on integer or boolean values dereferenced from an array or
structure. Assertions have been added to get_opcode() to prevent this bug
from reappearing in the future.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit 170f0459a2367406d4ec838b2eebdc6ff2f84f2c)
esa/state_tracker/st_glsl_to_tgsi.cpp
f19b7eceb0a4465a729031a5493154e9ab45203a 25-Oct-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> nv50/ir: restore use of long immediate encodings

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 9ae7d8bb799a8c5008c7c4824d414ca856e13ba5)
allium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp
allium/drivers/nv50/codegen/nv50_ir_target_nv50.cpp
05974cb8c6cce68344b5622c5cb55adf3e51164c 25-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Preserve the type when copy propagating into an instruction.

Consider the following code, which reinterprets a register as a
different type:

mov(8) g6<1>F g1.4<0,4,1>.xF
and(8) g5<1>.xUD g6<4,4,1>.xUD 0x7fffffffUD

Copy propagation would notice that we can replace the use of g6 with
g1.4 and eliminate the MOV. Unfortunately, it failed to preserve the UD
type, incorrectly generating:

and(8) g5<1>.xUD g6<4,4,1>.xF 0x7fffffffUD

Found while debugging Ian's uncommitted ARB_vertex_program LOG opcode
test with my new Mesa IR -> Vec4 IR translator.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 03ea156f1b3e57ef223c0340afb49e513fa0b407)
esa/drivers/dri/i965/brw_vec4_copy_propagation.cpp
97eed6da9704deb2c57fe47cd110c2b70191e2c2 25-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Don't lose the MRF writemask when doing compute-to-MRF.

Consider the following code sequence:

mul(8) g4<1>F g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
mov.sat(8) m1<1>.xyF g4<4,4,1>F
mul(8) g4<1>F g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
mov.sat(8) m1<1>.zwF g4<4,4,1>F

The compute-to-MRF pass will discover the first mov.sat and attempt to
replace it by rewriting earlier instructions. Everything works out,
so it replaces scan_inst's destination file, reg, and reg_offset,
resulting in:

mul(8) m1<1>F g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
mul(8) g4<1>F g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF
mov.sat(8) m1<1>.zwF g4<4,4,1>F

Unfortunately, it loses the .xy writemask on the mov.sat's MRF
destination. While this doesn't pose an immediate problem, it then
proceeds to transform the second mov.sat, resulting in:

mul(8) m1<1>F g1<0,4,1>.wzwwF g3<4,4,1>.wzwwF
mul(8) m1<1>F g1<0,4,1>.xxyxF g3<4,4,1>.xxyxF

Instead of writing both halves of the vector (like the original code),
it overwrites the full vector both times, clobbering the desired .xy
values.

When encountering a MOV, the compute-to-MRF code scans for instructions
which generate channels of the MOV source. It ensures that all
necessary channels are available (possibly written by several
instructions). In this case, *more* channels are available than
necessary, so we want to take the subset that's actually used.
Taking the bitwise and of both writemasks should accomplish that.

This was discovered by analyzing an ARB_vertex_program test
(glean/vertProg1/MUL test (with swizzle and masking)) with my new
Mesa IR -> Vec4 IR translator code. However, it should be possible
with GLSL programs as well.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 10ff6772c8054aea12ac0f08e2e3898fd4a7f76b)
esa/drivers/dri/i965/brw_vec4.cpp
a908f4a75401284dd45bf559de18c83adaacb335 22-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> glcpp: Don't use infinite lookhead for #define differentiation.

Previously, we used lookahead patterns to differentiate:

#define FOO(x) function macro
#define FOO (x) object macro

Unfortunately, our rule for function macros:

{HASH}define{HSPACE}+/{IDENTIFIER}"("

relies on infinite lookahead, and apparently triggers a Flex bug where
the generated code overflows a state buffer (see YY_STATE_BUF_SIZE).

There's no need to use infinite lookahead. We can simply change state,
match the identifier, and use a single character lookahead for the '('.
This apparently makes Flex not generate the giant state array, which
avoids the buffer overflow, and should be more efficient anyway.

Fixes piglit test 17000-consecutive-chars-identifier.frag.

NOTE: This is a candidate for every release branch ever.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Carl Worth <cworth@cworth.org>
(cherry picked from commit 9142ade15416415f2d5eb20b093b898c649cd2bb)
lsl/glcpp/glcpp-lex.l
lsl/glcpp/glcpp-parse.y
f1188d4464c78bfa0cd114d9331de8fba70724ac 19-Oct-2012 Brian Paul <brianp@vmware.com> st/mesa: free TGSI tokens with ureg_free_tokens()

since they're allocated by ureg_get_tokens().

NOTE: This is a candidate for the 8.0 and 9.0 branches.

(cherry picked from commit 11070105f0b5ad20f12bb40a8dd0b357924bcfdd)
esa/state_tracker/st_mesa_to_tgsi.c
fb8d6b41d89c6221c8477eab229ecf0750c2c4e0 19-Oct-2012 Brian Paul <brianp@vmware.com> st/mesa: replace REALLOC() with realloc()

We should use the later since we're freeing the memory with free(),
not the gallium FREE() macro.

This fixes a mismatch when using the gallium debug memory functions.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit bb93439873e0f270383d8a802eec79807d32c10a)
esa/state_tracker/st_mesa_to_tgsi.c
b63f8f7906e4bc8a074cee8dbdbcb1c66e90448f 20-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Don't flatten IF statements by default.

MaxIfDepth of 0 means "flatten all the time", not "never flatten".
This is only desirable on hardware that can't support control flow;
software rasterization and most hardware drivers want this.

This alters behavior for swrast as well as i915. Tested on i915.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 56705cd36bf48d5050ac9ec10d91fd097a577f42)
esa/main/shaderapi.c
a5848562b501f67e4f51013277b12157d9c7fb18 12-Oct-2012 Abdiel Janulgue <abdiel.janulgue@linux.intel.com> mesa: Fix a crash in update_texture_state() for external texture type

NOTE: This is a candidate for the stable branch.

Signed-off-by: Abdiel <abdiel.janulgue@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit bcb10ca17221833b2502970fb94ff52cf328ee30)
esa/main/texobj.c
esa/main/texstate.c
19c1e7c664a3dfef7d40dd5ecc4173c80821dc1f 12-Oct-2012 Chris Fester <camaronut@gmail.com> util: null-out the node's prev/next pointers in list_del()

Note: This is a candidate for the 9.0 branch.
Signed-off-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 3fffe8f7b77938fcbf449a7f9a2ae9614c8e2bd4)
allium/auxiliary/util/u_double_list.h
070f317d99f03a111c79d7c8b0cee954ee77e5ee 02-Oct-2012 Tapani Pälli <tapani.palli@intel.com> android: generate matching remap_helper to dispatch table

commit a010215463c63680c69e90202fe3fcd2e5b25fa6 removed ES2 specific dispatch
table and remap_helper, since now we are using dispatch.h which is generated
from gl_and_es_API.xml we need to generate a matching remap_helper using the
same xml.

Note: This is a candidate for the 9.0 branch.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 60565b564bc969ce47fb8417c79050c261e5aec9)
esa/Android.gen.mk
409cb4fc736ee34f55062d8a2c61a28d96c44a79 11-Oct-2012 Brian Paul <brianp@vmware.com> svga: don't use uninitialized framebuffer state

Only the first 'nr_cbufs' color buffers in the pipe_framebuffer_state are
valid. The rest of the color buffer pointers might be unitialized.
Fixes a regression in the piglit fbo-srgb-blit test since changes in the
gallium blitter code.

NOTE: This is a candidate for the 9.0 branch (just to be safe).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 60a9390978db0a3c9b0170c726ebe684baf75734)
allium/drivers/svga/svga_pipe_misc.c
b22de71c1bc2530e139d75d934e203f4eee89f41 02-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Implement register spilling.

To validate this code, I ran piglit -t vs quick.tests with the "go spill
everything" debugging code enabled. There was only one regression:
glsl-vs-unroll-explosion simply ran out of registers. This should be
fine in the real world, since no one actually spills every single
register.

NOTE: This is a candidate for the 9.0 branch. Even if it proves to have
bugs, it's likely better than simply failing to compile.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 9237f0ea8d176fb5dcd41868dcc723fe34f6b1f3)
esa/drivers/dri/i965/brw_vec4.h
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_vec4_reg_allocate.cpp
cb415d4df644a8caffe861626dec5f7aa4cefa49 02-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Fix unit mismatch in scratch base_offset parameter.

move_grf_array_access_to_scratch() calculates scratch buffer offsets in
bytes. However, emit_scratch_read/write() expects the base_offset
parameter to be measured in OWords.

As a result, a shader using a scratch read/write offset greater than
zero (in practice, a shader containing more than one variable in
scratch) would use too large an offset, frequently exceeding the
available scratch space.

This patch corrects the mismatch by removing spurious conversion from
OWords to bytes in move_grf_array_access_to_scratch().

This is based on a patch by Paul Berry.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 46e529672bb124b78eb454cbf55c72074ef6d35c)
esa/drivers/dri/i965/brw_vec4_visitor.cpp
esa/drivers/dri/i965/brw_vs.c
esa/drivers/dri/i965/brw_vs.h
3703e9920c2a4d1a022871624bd0d7bd16073867 19-Jan-2013 Christoph Bumiller <christoph.bumiller@speed.at> nouveau: fix undefined behaviour when testing sample_count

NOTE: This is a candidate for the 9.0 branch.
allium/drivers/nv30/nv30_screen.c
allium/drivers/nv50/nv50_screen.c
allium/drivers/nvc0/nvc0_screen.c
b3cd93d933e985123eabe18dd4fd14bf33fa6968 07-Jan-2013 Christoph Bumiller <e0425955@student.tuwien.ac.at> nv50/ir: wrap assertion using typeid in #ifndef NDEBUG

Note: this is a candidate for the 9.0 stable branch.
allium/drivers/nv50/codegen/nv50_ir.cpp
ddf1e620e9ba64feaac4686c4596a4f21c2efeeb 07-Jan-2013 Christoph Bumiller <e0425955@student.tuwien.ac.at> nvc0: add missing call to map edge flag in push_vbo

Note: this is a candidate for the 9.0 stable branch.
allium/drivers/nvc0/nvc0_vbo_translate.c
f2da7e720f60e8df96bf2530f35e3e79897e0cb7 25-Dec-2012 Jonas Ådahl <jadahl@gmail.com> wayland: Don't cancel a roundtrip when any event is received

Since wl_display_dispatch_queue() returns the number of processed events
or -1 on error, only cancel the roundtrip if an -1 is returned.

This also fixes a potential memory corruption bug happening when the
roundtrip does an early return and the callback later writes to the then
out of scope stack allocated `done' parameter.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
gl/drivers/dri2/platform_wayland.c
allium/state_trackers/egl/wayland/native_wayland.c
f9d8d0c3b5e11c4ae08b078dca2aa48a3218f8d9 22-Nov-2012 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> egl/wayland: Dispatch the event queue before get_buffers

When a client frame callback is executed and the client starts rendering
again, the egl event queue might not have been dispatched so that the
buffer release event for the previous frame hasn't been processed. In
that case a third buffer is allocated, even though it would be possible
to reuse the buffer that was just released.

The wl_display_dispatch_queue_pending() entry point is available from
wayland-client 1.0.2, so require that in configure.ac. Also, just
let the pkg-config macro throw its own error, which will show what version
we were looking for and failed to find.

Note: This is a candidate for stable branches.

Signed-off-by: Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>
gl/drivers/dri2/platform_wayland.c
b49d9338d7e79752e886eede34db08e37c34f8ed 30-Nov-2012 Kristian Høgsberg <krh@bitplanet.net> egl/wayland: Add invalidate back in eglSwapBuffers()

Commit ca3ed3e024864e91ca3cccc59fb96950e1d079b5 fixed the problem where
eglMakeCurrent would trigger a getbuffer callback that then breaks the
following wl_egl_window_resize() call. However, we still need to
invalidate buffers in eglSwapBuffers, since in wayland we always swap
buffers, so the dri driver needs to come out and ask us for the next buffer
after each swapbuffer.

Note: this is a candidate for stable branches.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
gl/drivers/dri2/platform_wayland.c
eaf6884621661288624fc060974c3aa485771324 30-Nov-2012 Ander Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com> egl/wayland: Don't invalidate drawable on swap buffers

We used to invalidate the drawable after a call to eglSwapBuffers(),
so that a wl_egl_window_resize() would take effect for the next frame.
However, that leads to calling dri2_get_buffers() when eglMakeCurrent()
is called with the current context and surface, and a later call to
wl_egl_window_resize() would not take effect until the next buffer
swap.

Instead, add a callback from wl_egl_window_resize() back to the wayland
egl platform, and invalidate the drawable only when it is resized.

This solves a bug on wayland clients when going back to windowed mode
from fullscreen when clicking a pop up menu, where the window size
after this would be the fullscreen size.

Note: this is a candidate for stable branches.
CC: wayland-devel@lists.freedesktop.org
gl/drivers/dri2/platform_wayland.c
gl/wayland/wayland-egl/wayland-egl-priv.h
gl/wayland/wayland-egl/wayland-egl.c
0ac90296a092f846647812318913b0e492775f31 21-Dec-2012 Marek Olšák <maraeo@gmail.com> r600g: always use a tiled resource as the destination of MSAA resolve

i.e. we have to allocate a temporary tiled resource if dst isn't tiled.

This fixes hardlocks on r6xx-r7xx, though using a linear resource is forbidden
on later asics as well.

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

Conflicts:
src/gallium/drivers/r600/r600_blit.c
src/gallium/drivers/r600/r600_texture.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_texture.c
42f71b4861b9d01a8f925fea3182fc1a292222f3 19-Dec-2012 Marek Olšák <maraeo@gmail.com> r600g: try to fix streamout for the cases where BURST_COUNT > 0

The burst was incorrectly used, because ELEM_SIZE was always 0.
I don't know if the burst works, because I don't know of any test
which uses it.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 6a2ec765bd22ae5d94e5fdac8507c659175efa4e)

Conflicts:
src/gallium/drivers/r600/r600_shader.c
allium/drivers/r600/r600_shader.c
9311e55c8ad97329bb2d06a0680f5165de9b21f5 07-Dec-2012 Stefan Dösinger <stefandoesinger@gmx.at> r300: Don't disable destination read if the src blend factor needs it

The read can remain disabled if the src alpha factor needs it because
the result would still be zero.

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

NOTE: This is a candidate for stable release branches.

Signed-off-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit ff5a9868c8d5041a3d944ce300c857934f4e8251)
allium/drivers/r300/r300_state.c
e1cb624a43cf3ef1c928bf03c26c0cf2f236a1a1 23-Nov-2012 Marek Olšák <maraeo@gmail.com> mesa: fix BlitFramebuffer between linear and sRGB formats

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 91ca053714957aca5205122e8478002c62cc4344)
esa/main/fbobject.c
d0a9ab29b2c8abf2900b1095883cba71b05b5cd9 06-Nov-2012 Dave Airlie <airlied@redhat.com> r600g: fix lod bias/explicit lod with cube maps.

While developing cube map array support I found that we didn't
support this properly, also piglit didn't test for it at all.

I've submitted a test to piglit to check for this, and this
fixes explicit lod and lod bias with cube maps.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 037b4f80384c72c12e31192d1a30411d4660972d)
allium/drivers/r600/r600_shader.c
8b2922ff5aa68b5dca90d5b83d1e31da48b069b3 23-Nov-2012 Marek Olšák <maraeo@gmail.com> r600g: fix broken streamout if streamout_begin caused a context flush

This fixes graphics corruption in the case where the DISCARD_RANGE flag
is used to map a buffer.

NOTE: This is a candidate for the stable branches.
(cherry picked from commit cff4c948ed2708a6eb4b090ae87443a707cbd67f)
allium/drivers/r600/r600_hw_context.c
b55c98ea4124f63a6a4b5ecf349ae80404449695 26-Oct-2012 Marek Olšák <maraeo@gmail.com> r600g: advertise 32 streamout vec4 outputs

to match the varying limit.
(cherry picked from commit b78b62497f1e5cc64eb924c64e4685fe5d814fd7)
allium/drivers/r600/r600_pipe.c
1106bbc7d6cd024d1e20573e281ea4c48c5eaf19 25-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: fix streamout on RS780 and RS880

The latest kernel from git is required. Transform feedback (along with GL3.0)
is turned off on older kernels.
(cherry picked from commit d063c7b1421a6e8ad4e2efc1bf913920766cc5ee)
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_pipe.c
7bcc228beb754a8f1586590d2c5b1786be281531 11-Nov-2012 Marek Olšák <maraeo@gmail.com> st/mesa: fix computation of last_level in GenerateMipmap

Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit e7dde5c8fb8ae6964bd5972d5962c2a26fc6ee0f)
esa/state_tracker/st_gen_mipmap.c
7ca75b62cdd9ddc943ded3a6904b11f62162affb 11-Nov-2012 Marek Olšák <maraeo@gmail.com> st/mesa: fix computation of last_level during texture creation

Array textures were broken.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 6dd839f23a8ee7b6853f7320a2715df44040b358)
esa/state_tracker/st_cb_texture.c
d1dfe4e020e563606e7d987968682501829800db 11-Nov-2012 Marek Olšák <maraeo@gmail.com> st/mesa: fix guessing the base level size

It was pretty broken with array textures, where the array size (height or
depth depending on the target) shouldn't be magnified.

The guessing also doesn't fail with 1D and cube textures.

NOTE: This is a candidate for the stable branches.

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

Conflicts:
src/mesa/state_tracker/st_cb_texture.c
esa/state_tracker/st_cb_texture.c
5b007761fef03547ef09585bef6920a8dcedf1ce 11-Nov-2012 Marek Olšák <maraeo@gmail.com> mesa: fix error checking of TexStorage(levels) for array and rect textures

NOTE: This is a candidate for the stable branches.

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

Conflicts:
src/mesa/main/texstorage.c
esa/main/texstorage.c
efa6b5e42b427c1ec9f2d636d280c84e7da71346 11-Nov-2012 Marek Olšák <maraeo@gmail.com> mesa: add MaxNumLevels to gl_texture_image, remove MaxLog2

MaxLog2 led to bugs, because it didn't work well with 1D and 3D textures.

NOTE: This is a candidate for the stable branches.

v2: correct the comment at MaxNumlevels

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

Conflicts:
src/mesa/main/teximage.h
esa/drivers/dri/nouveau/nouveau_texture.c
esa/drivers/dri/radeon/radeon_mipmap_tree.c
esa/main/mtypes.h
esa/main/teximage.c
esa/main/teximage.h
492b69f3be3e355064c67bc6f4a30d40e997ce9d 30-Oct-2012 Marek Olšák <maraeo@gmail.com> vbo: fix glVertexAttribI* functions

The functions were broken, because they converted ints to floats.
Now we can finally advertise OpenGL 3.0. ;)

In this commit, the vbo module also tracks the type for each attrib
in addition to the size. It can be one of FLOAT, INT, UNSIGNED_INT.

The little ugliness is the vertex attribs are declared as floats even though
there may be integer values. The code just copies integer values into them
without any conversion.

This implementation passes the glVertexAttribI piglit test which I am going
to commit in piglit soon. The test covers vertex arrays, immediate mode and
display lists.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: cosmetic changes as suggested by Brian
(cherry picked from commit acf438f5375e2426386694e541b843dc6f8fd11a)
esa/main/imports.h
esa/main/macros.h
esa/vbo/vbo_attrib_tmp.h
esa/vbo/vbo_context.h
esa/vbo/vbo_exec.h
esa/vbo/vbo_exec_api.c
esa/vbo/vbo_exec_draw.c
esa/vbo/vbo_save.h
esa/vbo/vbo_save_api.c
esa/vbo/vbo_save_draw.c
de5e3774d04da66dbf85ca0705de38b7942943fe 30-Oct-2012 Marek Olšák <maraeo@gmail.com> draw: fix assertion failure in draw_emit_vertex_attr

This is a regression since b3921e1f53833420e0a0fd581f7417.

The array stores VS outputs, not FS inputs.
Now llvmpipe can do 32 varyings too.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 183e122bdfe27f875c3c121964484dae9587c051)
allium/auxiliary/draw/draw_vertex.h
8ff8c91893cee8b1893de91e145c8496a12ab9ca 26-Oct-2012 Marek Olšák <maraeo@gmail.com> mesa: bump MAX_VARYING to 32

We're starting to get apps utilizing more than 16 varyings and
most current hardware supports 32 anyway.

Tested with r600g.
swrast, softpipe and llvmpipe still advertise 16 varyings.

This fixes a WebGL crash after launching this demo:
https://developer.mozilla.org/en-US/demos/detail/falling-cubes

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

NOTE: This is a candidate for the stable branches.

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

Conflicts:
src/mesa/main/context.c
allium/auxiliary/tgsi/tgsi_ureg.c
allium/include/pipe/p_state.h
esa/main/config.h
esa/main/context.c
esa/program/prog_print.c
94864becb0ebf9e610dc53b2687a4d9d41a47c7e 26-Oct-2012 Marek Olšák <maraeo@gmail.com> r300g: fix texture border color for sRGB formats

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 8fb4b1dce156d02a0907925364d8945915c29bcf)
allium/drivers/r300/r300_state_derived.c
23c71839e994c9c0ca684e54630991e16b0530af 15-Oct-2012 Marek Olšák <maraeo@gmail.com> st/mesa: fix integer texture border color for some formats (v2)

And the clear color too, though that may be an issue only with GL_RGB if it's
actually RGBA in the driver.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>

v2: The types of st_translate_color parameters were changed to gl_color_union
and pipe_color_union as per Brian's comment.
(cherry picked from commit 2bbd307fa638f6d256d020ddf1cff5fc7f735fd2)
esa/state_tracker/st_atom_sampler.c
esa/state_tracker/st_cb_clear.c
esa/state_tracker/st_format.c
esa/state_tracker/st_format.h
b2f18cd2b0f75d200d4fc713325269171ac87616 16-Nov-2012 Maarten Lankhorst <maarten.lankhorst@canonical.com> [PATCH] makefiles: use configured name for -ldrm* where possible

For precise lts support I had to do some magic with the library names, which works fine
as long as the libraries from pkg-config are used.

The parts with src/gallium/targets/va-*/Makefile will not apply on the master branch,
but do apply to the 9.0 branch.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Maarten Lankhorst <maarten.lankhorst@canonical.com>
Acked-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 4f0537e645f9c34e305f2808c70eafbbc1c7689c)
allium/targets/dri-i915/Makefile
allium/targets/dri-r300/Makefile
allium/targets/dri-r600/Makefile
allium/targets/dri-radeonsi/Makefile
allium/targets/egl-static/Makefile
allium/targets/gbm/Makefile
allium/targets/pipe-loader/Makefile
allium/targets/vdpau-r300/Makefile
allium/targets/vdpau-r600/Makefile
allium/targets/vdpau-radeonsi/Makefile
allium/targets/xvmc-r300/Makefile
allium/targets/xvmc-r600/Makefile
49150fd43c4f6dacb2b2f1df9c3b7a38f57a4b95 24-Oct-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> nv50/ir/tgsi: fix srcMask for TXP with SHADOW1D
(cherry picked from commit d310e29302fb409c0c23442c2b1d1a6c044dd6f0)
allium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
51ba1c1ae1ea6eff0e0c727aeec48d3433ec5bce 08-Oct-2012 Ben Skeggs <bskeggs@redhat.com> nv50: point vertex runout at a valid address

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit 63c3a799aecff5348ecec3c4c13355996e4bf820)
allium/drivers/nv50/nv50_screen.c
854b8099c3120f3b12624faccf768b2afaff88c8 08-Oct-2012 Ben Skeggs <bskeggs@redhat.com> nvc0: point vertex runout at a valid address

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit c47a01c29cf14d11731c88bc8ed10a3f575c5a12)
allium/drivers/nvc0/nvc0_screen.c
c1534a5fdf0147b59c07947935c7ca4ce35cf665 08-Oct-2012 Ben Skeggs <bskeggs@redhat.com> nvc0: fix missing permanent bo reference on poly cache

Reviewed-by: Christoph Bumiller <e0425955@student.tuwien.ac.at>
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
(cherry picked from commit d53bbabe6119a697bcf1a2e393d1c2283560bc01)
allium/drivers/nvc0/nvc0_context.c
2332bc26d435e465a6f6571ab267db2a33ce05d2 28-Oct-2012 Jonas Ådahl <jadahl@gmail.com> wayland: Destroy frame callback when destroying surface

If a frame callback is not destroyed when destroying a surface, its
handler function will be invoked if the surface was destroyed after the
callback was requested but before it was invoked, causing a write on
free:ed memory.

This can happen if eglDestroySurface() is called shortly after
eglSwapBuffers().

Note: This is a candidate for stable branches.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit a3b6b2d3055070da9bf7054fecfd0b171c398eb7)
gl/drivers/dri2/platform_wayland.c
allium/state_trackers/egl/wayland/native_wayland.c
d26890688fc4efdec64e8fef33b54049f9c690bf 06-Nov-2012 Fredrik Höglund <fredrik@kde.org> egl_dri2/x11: Fix eglPostSubBufferNV()

This got broken in commit 0a523a8820e8a2549ac1c7887eb1892b228af44b.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55856
(cherry picked from commit f42518962a08ce927e4ddd233d19d2661e135834)
gl/drivers/dri2/platform_x11.c
c4f392aafb78c80dde4b126984a498f8f2feee10 08-Nov-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Bump version to 9.0.1

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/version.h
895a5873d141c726e2e81ba53d5b757e4708fb29 24-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Allow ir_if in the linker's move_non_declarations function.

Global initializers using the ?: operator with at least one non-constant
operand generate ir_if statements. For example,

float foo = some_boolean ? 0.0 : 1.0;

becomes:

(declare (temporary) float conditional_tmp)
(if (var_ref some_boolean)
((assign (x) (var_ref conditional_tmp) (constant float (0.0))))
((assign (x) (var_ref conditional_tmp) (constant float (1.0)))))

This pattern is necessary because the second or third arguments could be
function calls, which create statements (not expressions).

The linker moves these global initializers into the main() function.
However, it incorrectly had an assertion that global initializer
statements were only assignments, calls, or temporary variable
declarations. As demonstrated above, they can be if statements too.

Other than the assertion, everything works fine. So remove it.

Fixes new Piglit test condition-08.vert, as well as an upcoming
game that will be released on Steam.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b45a68eebf3cf7227fc70082cb1e796041fc81ab)
lsl/linker.cpp
4b507f809c66a1b4245e63778943aeeed71f575c 12-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> glx: Set sRGBCapable to a default value

Previously, if the server didn't send a GLX_FRAMEBUFFER_SRGB_CAPABLE_EXT
tag, it would still be set to GLX_DONT_CARE (which is -1). Set it to
GL_FALSE instead.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: Maciej Wieczorek <maciej.t.wieczorek@intel.com>
(cherry picked from commit 7b0f912e70d79bcb863ea38f7d3910ab2be0860e)
lx/glxext.c
94cc306e41a2565b1dc7d410713ac78a9f1edaf3 23-Oct-2012 Matt Turner <mattst88@gmail.com> ralloc: Annotate printf functions with PRINTFLIKE(...)

This is a squash of the following two commits:

ralloc: Annotate printf functions with PRINTFLIKE(...)

Catches problems such as (in the gles3 branch)

glcpp-parse.y: In function '_glcpp_parser_handle_version_declaration':
glcpp-parse.y:1990:39: warning: format '%lli' expects argument of type
'long long int', but argument 4 has type 'int' [-Wformat]

As a side-effect, remove ralloc.c's likely/unlikely macros and just use
the ones from main/compiler.h.

NOTE: This is a candidate for the release branches.

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

and

src/glsl/tests/Makefile.am: Specify -I... in AM_CPPFLAGS

When specifying per-target CFLAGS (e.g., ralloc_test_CFLAGS) AM_CFLAGS
are not used. AM_CPPFLAGS should be used for includes anyway.

Fixes a build problem since 41b14d125:

CC ralloc_test-ralloc.o
In file included from ../../../src/glsl/ralloc.c:42:0:
../../../src/glsl/ralloc.h:57:27: fatal error: main/compiler.h: No such file or directory

Acked-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 67f1e7bf5f5d1482cb8684dd5a405b7bab5b1f34)
lsl/ralloc.c
lsl/ralloc.h
lsl/tests/Makefile.am
8d00f077c9672ed2f00a1c67b688c82c3fc7d480 17-Oct-2012 Adam Jackson <ajax@redhat.com> glx: Add GLXBadProfileARB to the error string list

Note: This is a candidate for the stable branches.

Reviewed-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit a30d14635d5d55ce0e022b0b66770da32155a3d7)
lx/glxext.c
8aab8a50d3c56e73ea53be111bbb8b477f6e8c99 17-Oct-2012 Owen W. Taylor <otaylor@fishsoup.net> glx: Fix listing of INTEL_swap_event in glXQueryExtensionsString()

Due to a string mismatch, INTEL_swap_event wasn't listed among GLX
extensions for the connection, even when present on both client and
server. That is, glXQueryServerString and glXGetClientString reported the
extension, but glXQueryExtensionsString did not.

Note: This is a candidate for the stable branches.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=56057
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 1d0c6211212a2d486c8f7f64349fd9683061342e)
lx/dri2_glx.c
cf7634d9665b26a321a9d8542d50c76693141b52 09-Oct-2012 Matt Turner <mattst88@gmail.com> egl: Return EGL_BAD_MATCH for invalid profile attributes

Version 12 of the EGL_KHR_create_context spec changed this behavior.

NOTE: This is a candidate for the 9.0 branch
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 587d5db11d8047663201c5fb06a6b2feb5d55891)
gl/main/eglcontext.c
2a81037439afb04d4170f674646cdae59619707d 16-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> wayland: Drop support for ill-defined, unused wl_egl_pixmap

It doesn't provide the cross-process buffer sharing that a window system
pixmap could otherwise support and we don't have anything left that uses
this type of surface.
gl/drivers/dri2/platform_wayland.c
gl/wayland/wayland-egl/wayland-egl-priv.h
gl/wayland/wayland-egl/wayland-egl.c
allium/state_trackers/egl/wayland/native_wayland.c
allium/state_trackers/egl/wayland/native_wayland.h
b565197c5c1a516fa416bb2587365e15bb38b5b0 16-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> wayland: Remove 0.85 compatibility #ifdefs
gl/wayland/wayland-drm/wayland-drm.c
a5776ac0b8c015bf5d6a8513cefec5920895cc8e 11-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> egl/wayland: Update to Wayland 0.99 API

The 0.99.0 Wayland release changes the event API to provide a thread-safe
mechanism for receiving events specific to a subsystem (such as EGL) and
we need to use it in the EGL platform.

The Wayland protocol now also requires a commit request to make changes
take effect, issue that from eglSwapBuffers.
gl/drivers/dri2/egl_dri2.h
gl/drivers/dri2/platform_wayland.c
allium/state_trackers/egl/wayland/native_drm.c
allium/state_trackers/egl/wayland/native_shm.c
allium/state_trackers/egl/wayland/native_wayland.c
allium/state_trackers/egl/wayland/native_wayland.h
79d9471efda3630c050c809cdc8c26236283fc6a 21-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> gbm: Use the kms dumb ioctls for cursor instead of libkms

We need to create bos suitable for cursor usage that we can map and
write data into. The kms dumb ioctls is all we need for this, so drop
the dependency on libkms.
bm/backends/dri/gbm_dri.c
bm/backends/dri/gbm_driint.h
0a72dbd3504e7a97750561a50556978b13bc0361 01-Oct-2012 Kristian Høgsberg <krh@bitplanet.net> gbm: Reject buffers that are not wl_drm buffers in gbm_bo_import()

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
bm/backends/dri/gbm_dri.c
5fe5aa8e55a8db0b80f6ff9838bad47ce0406fd0 19-Oct-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Fix regression in depth texture rendering on pre-SNB

This was introduced by commit 24db6d6 (cherry-picked from a683012). The
original patch fixed potential GPU hangs on SNB, and it caused some
rendering regressions there. The benefits outweigh the costs.

However, the work-around is not necessary for pre-SNB chipsets.
Applying the work-around there gives rendering regressions with no
benefit. This patch disables the work-around on pre-SNB chipsets.

Without the original patch, the piglit test
depthstencil-render-miplevels would reliably hang an SNB GPU. On ILK
this test would not hang, and it does not hang with this patch.

NOTE: This is a candidate for the 8.0 and 9.0 branches

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
esa/drivers/dri/i965/brw_misc_state.c
8e019506257b720a1a6ff668aef57bff445a1725 22-Oct-2012 Michel Dänzer <michel.daenzer@amd.com> st/mesa: Fix assertions for copying texture image to finalized miptree.

The layer dimension of array textures is not subject to mipmap minification.
OTOH we were missing an assertion for the depth dimension.

Fixes assertion failures with piglit {f,v}s-textureSize-sampler1DArrayShadow.
For some reason, they only resulted in piglit 'warn' results for me, not
failures.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit eee1ff423c6a0c9c776b4e76b79bb5ed5480d83c)
esa/state_tracker/st_cb_texture.c
77b1d2e09cfe968a01978a9042ad4edcaad3ada2 02-Oct-2012 Marcin Slusarz <marcin.slusarz@gmail.com> nouveau: use pre-calculated stride for resource_get_handle

Fixes FDO#55294.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 93eba269351c6e256db3a4cc7c7018f5a3fae5a1)
allium/drivers/nv30/nv30_miptree.c
allium/drivers/nv50/nv50_miptree.c
8f772b34b0d59e369177c129a1d195917b288adf 19-Oct-2012 Michel Dänzer <michel.daenzer@amd.com> st/mesa: Fix source miptree level for copying data to finalized miptree.

Fixes WebGL texture mips conformance test, no piglit regressions.

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

NOTE: This is a candidate for the stable branches.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
(cherry picked from commit c2e37b1d2e1b8014475c7d2698fba317c9082d70)
esa/state_tracker/st_cb_texture.c
3913cd19b82802449dad2008ff4cfc1d546c05a6 09-Oct-2012 Quentin Glidic <sardemff7@sardemff7.net> intel: Add missing #include <time.h>

Commit 006c1a3c652803e2ff8d5f7ea55c9cb5d8353279 introduced a call to
clock_gettime, but failed to include <time.h>, breaking the build in
some cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 7cb8764ca39cb7f325d6da10a8b11bf24adf2ae0)
esa/drivers/dri/intel/intel_screen.c
d56ee2433578ff10ca47b76e2303b2bf70270b7a 09-Oct-2012 Imre Deak <imre.deak@intel.com> glget: fix make check for glGet GL_POLYGON_OFFSET_BIAS

This got broken by:
22b7ddc7f glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension
section

Fix it by appending the _EXT suffix to the enum in the test too.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/tests/enum_strings.cpp
8dc79ae7d73cf6711c2182ff9a5d37ef6c989d23 10-Sep-2012 Imre Deak <imre.deak@intel.com> mesa: glGet: fix parameter lookup for apps using multiple APIs

The glGet hash was initialized only once for a single GL API, even if
the application later created a context for a different API. This
resulted in glGet failing for otherwise valid parameters in a context
if that parameter was invalid in another context created earlier.

Fix this by using a separate hash table for each API.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/context.c
esa/main/get.c
esa/main/mtypes.h
22b7ddc7f0ea0a253e58c2be384031e7bd8c51f9 10-Sep-2012 Imre Deak <imre.deak@intel.com> glapi: rename/move GL_POLYGON_OFFSET_BIAS to its extension section

This should be named GL_POLYGON_OFFSET_BIAS_EXT and listed under the
EXT_polygon_offset section. (Solution by Ian Romanick)

Signed-off-by: Imre Deak <imre.deak@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
api/glapi/gen/gl_API.xml
dc74c9d0f45824f6d08a0132c7d7025c371fdfad 11-Sep-2012 Tomeu Vizoso <tomeu@tomeuvizoso.net> mesa/es: Define GL_MAX_TEXTURE_MAX_ANISOTROPY_EXT enum for all GLs

instead of just for GL and ES1.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/get.c
b4419477fb3b4384ef91959bbf1f098d2efd63c8 10-Sep-2012 Imre Deak <imre.deak@intel.com> mesa: glGet: fix API check for EGL_image_external enums

These enums are valid only in ES1 and ES2. So far they were marked valid
incorrectly, depending on the previous API mask in the enum list.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/get.c
dee121b88520fd4c39f1d195900239d204ffc20c 10-Sep-2012 Imre Deak <imre.deak@intel.com> mesa: glGet: fix indentation of print_table_stats

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/get.c
0c3c77ba17811ed9b89e252369b524c50979c7db 10-Sep-2012 Imre Deak <imre.deak@intel.com> mesa: glGet: fix indentation of find_value

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/get.c
0f5d87c3ddfe02cbdf311827fa77017b9d021620 10-Sep-2012 Imre Deak <imre.deak@intel.com> mesa: glGet: fix indentation of _mesa_init_get_hash

No functional change.

Signed-off-by: Imre Deak <imre.deak@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
esa/main/get.c
e75051d1967350ceff0209dde24ae42696b13b5c 06-Oct-2012 Brian Paul <brianp@vmware.com> mesa: fix error check for zero-sized compressed subtexture

For glCompressedTexSubImage, width or height = 0 is legal.
Fixes a failure in piglit's s3tc-errors test.

This is for the 9.0 and 8.0 branches. Already fixed on master.
esa/main/teximage.c
32faf7ab0de8b88bb15a2cb262a73c411dce9d0d 06-Oct-2012 Brian Paul <brianp@vmware.com> mesa: don't call TexImage driver hooks for zero-sized images

This simply avoids some failed assertions but there's no reason to
call the driver hooks for storing a tex image if its size is zero.

Note: This is a candidate for the stable branches.
(cherry picked from commit 91d84096497ff538f55591f7e6bb0b563726db8d)
esa/main/teximage.c
e5fdeef1e08b55acd48dc68f0cc8fe213f2820b8 08-Oct-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Bump version number to 9.0 (final)

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/version.h
ad4b3b93ded960c22388c7bc3ba14d32b30b8f1d 31-Aug-2012 Anuj Phogat <anuj.phogat@gmail.com> _mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

This is a squash for the following 7 commits. The first introduces the
functionality, and the remaining six fix various bugs.

Patch 1:
_mesa_meta_GenerateMipmap: Support all texture targets by generating shaders at runtime

glsl path of _mesa_meta_GenerateMipmap() function would require different fragment
shaders depending on the texture target. This patch adds the code to generate
appropriate fragment shader programs at run time.
Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54296

V2: Removed the code for integer textures as ARB is planning to
disallow automatic mipmap generation for integer textures.
Now using ralloc_asprintf in setup_glsl_generate_mipmap().

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 299acac849eb8506de9760c94c6e8e8b1046d909)

Patch 2:
_mesa_meta_GenerateMipmap: Generate separate shaders for glsl 120 / 130

glsl version of _mesa_meta_GenerateMipmap() would require separate
shaders for glsl 120 and 130.

V2: Removed the code for integer textures as ARB is planning to
disallow automatic mipmap generation for integer textures.

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 15bf3103b48a5928321fe56fbb3ed28a0f314418)

Patch 3:
meta: Add on demand compilation of per target shader programs

A call to glGenerateMipmap() follows the generation of a relevant
shader program in setup_glsl_generate_mipmap().

To support all texture targets and to avoid compiling shaders
everytime, per target shader programs are compiled on demand
and saved for the next call.

Fixes float-texture(mipmap.manual):
See Comment 6: https://bugs.freedesktop.org/show_bug.cgi?id=54296

NOTE: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit eb1d87fb945783448cc40ad43c9cd4d98002d424)

Patch 4:
meta: make mem_ctx non-global.

I can't see any external users, and this is a global symbol,

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 36639ec6e9a2758e344235fbdc1450719d8851e3)

Patch 5:
meta: Remove unsafe global mem_ctx pointer

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit ab097dde0c958dd8b1c06a07ef8913512753760c)

Patch 6:
meta: Rearrange shader creation in setup_glsl_generate_mipmap

The diff looks weird, but this moves the code from the first 'if
(ctx->Const.GLSLVersion < 130)' block down into the second block. It
also moves some variable decalarations closer to their use.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 3308c079bd00e9b9aa546f5214ce197a904d059b)

Patch 7:
meta: Don't use GLSL 1.30 shader on OpenGL ES 2

Fixes GLES2 CoverageGL conformance test.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 0242381f06edb09dcf0eaacd6d26ccd8584700cc)
esa/drivers/common/meta.c
7851d398def2df3f6836a500d67123eed50f3943 06-Oct-2012 Marek Olšák <maraeo@gmail.com> r600g: fix possible issue with stencil mipmap rendering

Somehow I only hit this issue with my latest libdrm changes.
This won't be needed with DB texturing.

NOTE: This is a candidate for the 9.0 branch.
(cherry picked from commit 9dfca930d7fcfda6767d3be9b1690d010f08fea5)
allium/drivers/r600/evergreen_state.c
19a15cd5ba320b71295c4afbe73c5d656f829ad8 02-Oct-2012 Brian Paul <brianp@vmware.com> mesa: remove bogus compressed texture size checks

A compressed texture image size doesn't have to be a multiple of the
compressed block size (only sub-images do). Fixes issues when building
compressed mipmaps because we often wind up with non-block-size images
for the higher mipmap levels.

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

Note: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
Tested-by: Sven Arvidsson <sa@whiz.se>
(cherry picked from commit df4a88ac4398ec4c152eb57a7129c07bb623edd7)
esa/main/teximage.c
esa/main/texstore.c
c566267f5c3b480c1a805790c45fc13ab52c98e2 22-Sep-2012 Anuj Phogat <anuj.phogat@gmail.com> intel/i965: Disable SampleAlphaToOne if dual source blending enabled

From SandyBridge PRM, volume 2 Part 1, section 12.2.3, BLEND_STATE:
DWord 1, Bit 30 (AlphaToOne Enable):
"If Dual Source Blending is enabled, this bit must be disabled"

Note: This is a candidate for stable branches.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ea0d08872724b5e31e9e32db2338e15fdfdcc4de)
esa/drivers/dri/i965/gen6_cc.c
8491e03b2befd7e9d16c5d17f95a83d91c5b16c9 02-Oct-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Flag _NEW_VARYING_VP_INPUTS when TexEnv programs are active.

The idea here is to not flag _NEW_VARYING_VP_INPUTS when shaders (either
GLSL or ARB vp/fp) are in use. If either TNL or TexEnv programs are
active, at least one stage is using fixed function.

On Pineview, fixes 20 Piglit, 60 oglconforms, and 7 ES 1.1 conformance
tests, as well as missing textures in Xonotic. These were all
regressions since commit fb4a34e60eb4c1bdc7b0fdcd98d1bf3038c354e8.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49127
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54807
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 7fa0f10cd85ccb5afbc3a961164011de70970ff3)
esa/main/state.c
78c9adb17e158ef40f03b5041803991ea8a0aa27 03-Oct-2012 Paul Berry <stereotype441@gmail.com> mesa: don't enable glVertexPointer() when using API_OPENGLES2.

This function is only present in GLES1 and in the OpenGL compatibility
profile.

Fixes the following "make check" failure:

[----------] 1 test from DispatchSanity_test
[ RUN ] DispatchSanity_test.GLES2
Mesa warning: couldn't open libtxc_dxtn.so, software DXTn
compression/decompression unavailable
dispatch_sanity.cpp:122: Failure
Value of: table[i]
Actual: 0x4de54e
Expected: (_glapi_proc) _mesa_generic_nop
Which is: 0x41af72
i = 321
[ FAILED ] DispatchSanity_test.GLES2 (4 ms)
[----------] 1 test from DispatchSanity_test (4 ms total)

NOTE: This is a candidate for stable release branches.

Reviewed-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Tested-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit 8f0b81bf7ddcdf5715a3e00af67395b91f27a243)
esa/main/api_exec.c
e1cb50b15dbb75d1ba0fe184d05be7d302b058ee 18-Sep-2012 Robert Bragg <robert@linux.intel.com> SwapBuffersRegionNOK: invert rectangles on y axis

The EGL_NOK_swap_region2 spec states that the rectangles are specified
with a bottom-left origin within a surface coordinate space also with a
bottom left origin, so this patch ensures the rectangles are flipped
before passing them on to dri2_copy_region.

Fixes piglit's egl-nok-swap-region test.

Tested-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0a523a8820e8a2549ac1c7887eb1892b228af44b)
gl/drivers/dri2/platform_x11.c
542f6feda9bf18267dbd337943a5e871400d425a 06-Sep-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Remove R600InstrInfo.td from TD_FILES

Fixes build bug introduced by
cebbdd4ac23725963207bf6f8fc7101150e6065f
(cherry picked from commit 2baaa5c7eb21517f0197bfd91154e9b4886fbb1b)
allium/drivers/radeon/Makefile.sources
71b5503164deee189df5ac4e2b8d2fcd09a8ec55 29-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Cleanup makefile

Hopefully, this will fix all the parallel make problems people have
been having.
(cherry picked from commit cebbdd4ac23725963207bf6f8fc7101150e6065f)
allium/drivers/radeon/Makefile
allium/drivers/radeon/Makefile.sources
b2048c5e905cb6321212e33391926fc720b89121 21-Sep-2012 Eric Anholt <eric@anholt.net> i965: Use visibility cflags on the driver code.
(cherry picked from commit 837f06b42fd46fdfdc0c85734dbad5497ea6d19f)

The only symbols that need to be public (those in intel_screen.c that the
loader looks for) are already marked public. Saves 100k of compiled driver
size.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
esa/drivers/dri/i965/Makefile.am
ddb9ecca3b0f820feb4dee6bd8901f8b6e3ee0d8 21-Sep-2012 Matt Turner <mattst88@gmail.com> build: Don't build libdricore if not building classic drivers
(cherry picked from commit 523c01524638b3d1bb363f4c0a647b0777840b7a)
esa/Makefile.am
76732c9ca5ae857ba8fa4773b25847299b50d098 28-Sep-2012 Matt Turner <mattst88@gmail.com> build: Add visibility CFLAGS to OSMesa
(cherry picked from commit 24ded898761757ec68e8f6dbe7de1f18c0be3f63)
esa/drivers/osmesa/Makefile.am
c8669c7ba7a01780d4cfd1cfc6ab8cc6f7fc2510 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Link OSMesa with glapi, libdl, libstdc++
(cherry picked from commit 1762ec28db4bfb85eeb6e61377839a3889f77216)

Bugzilla: https://bugs.gentoo.org/show_bug.cgi?id=399813
https://bugs.freedesktop.org/show_bug.cgi?id=53179
esa/drivers/osmesa/Makefile.am
f9a8673a7ad286af46931a09761bef435074bfe8 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/swrast
(cherry picked from commit 4cfff7211c7897353a07c48ad80a681c8e1e8298)
esa/drivers/dri/swrast/Makefile.am
f88046a1f04a4ea20544de8d1a554350d3efa1b2 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/r200
(cherry picked from commit 362840270702f32c1b4e5a52e04f4cad3f1de004)
esa/drivers/dri/r200/Makefile.am
8ebcf34d87002334a0df0dbdfb2a43ce2aecd7e9 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/radeon
(cherry picked from commit 55d45efdd8276ec4b2795e82e3d9bb57c3b1425d)
esa/drivers/dri/radeon/Makefile.am
3b794e4a5680a201c429c6943c12c7cf92478edf 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/nouveau
(cherry picked from commit 340637d54db171d9b5ee95ee943b590c416c0b66)
esa/drivers/dri/nouveau/Makefile.am
0470fa395fef898b3e13203bb5fa62bd854799af 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/i915
(cherry picked from commit 381d120b8af9e25d3bcb829a250e602b61d0971a)
esa/drivers/dri/i915/Makefile.am
6512610f9acb7dab70f66a8dc0d316b120b9f167 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Set visibility CFLAGS in dri/common
(cherry picked from commit d2872b561258d66e1b606310d12398a64002a25d)
esa/drivers/dri/common/Makefile.am
03cfc8d66002f653d5a946521c664b4050f861d3 27-Sep-2012 Matt Turner <mattst88@gmail.com> build: Build src/glsl with visibility CFLAGS
(cherry picked from commit 8746f641bb47d210fa16bb99aeb8150b06aff674)
lsl/Makefile.am
a1f1add42d5ee0122627df3b2b5f4ab12e49752b 21-Sep-2012 Matt Turner <mattst88@gmail.com> build: Turn on visibility CFLAGS for core mesa
(cherry picked from commit 710a90ccaf6ebdaad71b5d1d3fbb3e84773271ce)
esa/Makefile.am
a2f28ceea22254f09ee37039eec873ccdf689e6c 19-Sep-2012 Matt Turner <mattst88@gmail.com> build: Use AX_PTHREAD's HAVE_PTHREAD preprocessor definition
(cherry picked from commit 814345f54b74eee2597cf84f3c34817488f07522)

Conflicts:

src/mapi/glapi/gen/gl_x86-64_asm.py
src/mapi/glapi/gen/gl_x86_asm.py
gl/main/eglcurrent.c
gl/main/eglmutex.h
lx/apple/Makefile
lx/glxclient.h
lx/glxcurrent.c
api/glapi/gen/gl_SPARC_asm.py
api/glapi/gen/gl_x86-64_asm.py
api/glapi/gen/gl_x86_asm.py
api/glapi/glapi_entrypoint.c
api/mapi/stub.c
api/mapi/u_thread.h
421dda800de3aff588e97ccb6398b94e780590cd 19-Sep-2012 Matt Turner <mattst88@gmail.com> build: Use PTHREAD_LIBS and PTHREAD_CFLAGS
(cherry picked from commit b6651ae6ad314a93287e431a41f5c7a8f8f6c855)

Conflicts:

src/mesa/main/tests/Makefile.am
lsl/tests/Makefile.am
lx/tests/Makefile.am
api/glapi/tests/Makefile.am
api/shared-glapi/tests/Makefile.am
esa/main/tests/Makefile.am
89e76252ca3fd015544f76d0f528babe9c723938 01-Oct-2012 Matt Turner <mattst88@gmail.com> dri drivers: Link dricommon before dynamic libraries

I think libtool should be handling this for us, but the build fails for
Jordan because libdricommon (a static library, which uses expat) appears
before -lexpat on the linker command.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 31ab61cac10bf75210134b6d8a354ac3cbd3b4da)

Conflicts:

src/mesa/drivers/dri/i965/Makefile.am
esa/drivers/dri/i915/Makefile.am
esa/drivers/dri/i965/Makefile.am
esa/drivers/dri/nouveau/Makefile.am
esa/drivers/dri/r200/Makefile.am
esa/drivers/dri/radeon/Makefile.am
f2b4f588f5a5b656843b720f59b8cd6ce573ac93 02-Oct-2012 Oliver McFadden <oliver.mcfadden@linux.intel.com> Revert "i965: Implement guardband clipping on Ivybridge."

This reverts commit 610910a66d1a97ca51ad8a003bdeadfe9563d721.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55523
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/gen7_clip_state.c
esa/drivers/dri/i965/gen7_viewport_state.c
dbe13c105faafed6823c32ed37596f530577be91 02-Oct-2012 Oliver McFadden <oliver.mcfadden@linux.intel.com> Revert "i965: Implement guardband clipping on Sandybridge."

This reverts commit 85cd30406ff8414bc6ac6de1064d059a4c564160.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=55523
Signed-off-by: Oliver McFadden <oliver.mcfadden@linux.intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/gen6_clip_state.c
esa/drivers/dri/i965/gen6_viewport_state.c
604cd6b966d060334fdaa11ae8444797d54d3142 27-Sep-2012 Brian Paul <brianp@vmware.com> mesa: fix glCompressedTexSubImage assertion/segfault

If the destination texture image doesn't exist we'd hit an assertion
(or crash in a release build). The piglit/s3tc-errors test hits this.
This has already been fixed in master by the error checking code
consolidation.

Note: This is a candidate for the 8.0 branch.
esa/main/teximage.c
e642d61d130b725c0c3efbc87f86a4968311ba2a 15-Sep-2012 Brian Paul <brianp@vmware.com> scons: add new -p (prefix) options for yacc

These were recently added to the Makefiles.
(cherry picked from commit e78ebbc5f9448d459b57884d90b0a6496294c1dd)
lsl/SConscript
esa/SConscript
d9197f90372dec8a293d2d3e576261c6e3d38750 25-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: fix EXP on Cayman

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 96f50d0cf7bb13507f272d2f6ef9a6fca24d18e1)
allium/drivers/r600/r600_shader.c
fc62ee7e0d642e084175f36433aa42af63400799 25-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: fix RSQ of negative value on Cayman

NOTE: This is a candidate for the stable branches.
(cherry picked from commit fd5c5384648a0d6191c19748a2d1f1148c5ee98f)
allium/drivers/r600/r600_shader.c
50ba62e231272ee207402a778a2dc5cbedd77d1f 25-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: fix instance divisor on Cayman

Not sure if this is the best way to fix it.

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 836325bf7edd797e02ab0717a05ca5c51aa1ac93)
allium/drivers/r600/r600_asm.c
549129838ca5f80152c83474276b65f89b0f8013 16-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> meta: Use float for temporary images, not (un)signed normalized.

In commit 091eb15b694, Jordan changed get_temp_image_type() to use
_mesa_get_format_datatype() instead of returning GL_FLOAT. That has
several possible return values: GL_FLOAT, GL_INT, GL_UNSIGNED_INT,
GL_SIGNED_NORMALIZED, and GL_UNSIGNED_NORMALIZED.

We do want to use GL_INT/GL_UNSIGNED_INT for integer formats. However,
we want to continue using GL_FLOAT for the normalized fixed-point types.
There isn't any code in pack.c to handle GL_(UN)SIGNED_NORMALIZED.

Fixes oglconform's fboarb advanced.blit.copypix, which was regressed by
commit 091eb15b694a396f8453093575ccec2db7f14eb8.

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53573
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 3767b25bd3f77cede452cfbe9b66a51b352d9036)
esa/drivers/common/meta.c
0586a94929bb276c349220026cfac6267b776fb3 21-Sep-2012 Eric Anholt <eric@anholt.net> i965: Remove broken non-interleaved-to-interleaved upload code.

This failed when all the uploads to occur were uniform-type vertex data (like
glColor4f being active across a DrawArrays), because it would upload 1 element
instead of 1 element per vertex. There was no citation for how this code
helped any particular application, and it breaks ETQW, so just remove it.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=47170
NOTE: This is a candidate for the 9.0 and 8.0 branches.
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 0334e8dc25d09e3254e61d5d122b4fd7bfbd627a)
esa/drivers/dri/i965/brw_draw_upload.c
fdabc7d9f6db82d0c8dbca09c30cf25be29b30d8 14-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> meta: Don't _mesa_set_enable() invalid targets in ES 1.

GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and
GL_TEXTURE_GEN_S/T/R/Q don't exist in ES 1 contexts, so any meta ops
that used _mesa_meta_begin with MESA_META_TEXTURE would trigger GL
errors. One such operation is _mesa_meta_Clear().

On ES 1, we want to disable GL_TEXTURE_GEN_STR_OES instead.

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f216232d3974f5997b266a8dd720928.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comment.
v3: Disable GL_TEXTURE_GEN_STR_OES, per Ian's comment.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Reviewed-by: Brian Paul <brianp@vmware.com> [v1]
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 679c93ff89c71cbd3b1d24e88abd38f00b8c1f02)
esa/drivers/common/meta.c
cb84fe5e1003262eea058990777c82e8e25a0639 19-Sep-2012 Matt Turner <mattst88@gmail.com> build: Link libglapi with pthreads

NOTE: This is a candidate for the 9.0 branch.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=839060
https://bugs.gentoo.org/show_bug.cgi?id=435152
Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 9ed00075d8ea0ffaa675237e32b8611ad3064dbf)
api/shared-glapi/Makefile.am
5ef472dd83b7b96538432157e2569dedf5625161 22-Sep-2012 Brian Paul <brianp@vmware.com> mesa: fix incorrect error for glCompressedSubTexImage

If a subtexture region isn't aligned to the compressed block size,
return GL_INVALID_OPERATION, not gl_INVALID_VALUE.

NOTE: This is a candidate for the stable branches.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1f586684d62c4f5208d1f3929d067a79ea2140ac)
esa/main/teximage.c
7c60a95a0e4e4e8b31c9028a5edc22dca791dcb7 27-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> i915: Don't free the intel_context structure when intelCreateContext fails.

intelDestroyContext will eventually be called, and it will clean things up.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
(cherry picked from commit de958de71b1450952e021af4e729c87406353db6)
esa/drivers/dri/i915/i915_context.c
8aaef12a599db583def7aa3558dfab98ce76f913 31-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Don't free the intel_context structure when intelCreateContext fails.

This squashes two commits from master:

i965: Don't free the intel_context structure when intelCreateContext fails.

intelDestroyContext will eventually be called, and it will clean things
up. The call to brwInitVtbl is moved earlier so that
intelDestroyContext can call the device-specific destructor. This also
makes the code look more like the i915 code.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit 87f26214d6bdeb439b30615ec53c293c5141cf11)

And:

i965: brwInitVtbl needs to know the chipset generation

Fixes major regressions since de958de.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
(cherry picked from commit e87c63f2889fcbeb5a8bbd91eda1333d7ed44bf2)

The second commit message should have read 'since 87f2621', of course.
esa/drivers/dri/i965/brw_context.c
esa/drivers/dri/i965/brw_vtbl.c
a87b0110b93597c6df5d84e720f685816d01ed40 28-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> intel: Don't call intelDestroyContext if there is no context to destroy

Some error paths in the device-specific context creation functions can exit
before the deintel_context structure is allocated.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit 22897c74979aa02facdd5cd729db8dadf86924f5)
esa/drivers/dri/intel/intel_screen.c
5174eed79343346e7e39cf47d1cb18e6caa76c54 26-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> dri_util: Use calloc to allocate __DRIcontext

The __DRIcontext contains some pointers, and some drivers check for them to be
NULL in some failure paths. Instead of sprinkling NULL assignments across the
various drivers, just zero out the whole thing.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53618
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54301
(cherry picked from commit f93cb0bebb10e3e3e5df099be51021b211650356)
esa/drivers/dri/common/dri_util.c
8c1c18769ef4838b11065b353f6f62bfd1de1cd2 12-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> i965/blorp: Add support for blits between SRGB and linear formats (fixed).

This is a squash of 2 commits from master.
The first commit is:

i965/blorp: Add support for blits between SRGB and linear formats.

Fixes colorspace issues in L4D2 when multisampling is enabled (the
scene was far too dark, but the flashlight area was way too bright).

The nVidia and AMD binary drivers both allow this kind of blit.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit e2249e8c4d06a85d6389ba1689e15d7e29aa4dff)

The second commit is:

i965/blorp: Fix sRGB MSAA resolves.

Commit e2249e8c4d06a85d6389ba1689e15d7e29aa4dff (i965/blorp: Add
support for blits between SRGB and linear formats) changed blorp to
always configure surface states for in linear format (even if the
underlying surface is sRGB). This allowed sRGB-to-linear and
linear-to-sRGB blits to occur without causing the image to be
inappropriately brightened or darkened.

However, it broke sRGB MSAA resolves, since they rely on the
destination buffer format being sRGB in order to ensure that samples
are averaged together in sRGB-correct fashion.

This patch fixes the problem by instead configuring the source buffer
to use the *same* format as the destination buffer. This ensures that
the image won't be brightened or darkened, but preserves proper sRGB
averaging.

Fixes piglit tests "EXT_framebuffer_multisample/accuracy srgb".

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-and-tested-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 124b214f094fa63ff1ddb7e9f0a1c2e0ba8214fb)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_blorp_blit.cpp
849a3d243d8a0d951202515c06d9b17daf59d2f2 19-Sep-2012 Paul Berry <stereotype441@gmail.com> i965: Don't spill "smeared" registers.

Fixes an assertion failure when compiling certain shaders that need both
pull constants and register spilling:

brw_eu_emit.c:204: validate_reg: Assertion `execsize >= width' failed.

NOTE: This is a candidate for the 8.0 release branch.

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit ab5ce2789fe9e5f2789ee22fdb02bcfed42a7125)
esa/drivers/dri/i965/brw_fs_reg_allocate.cpp
36bc0fe4f2e90ea9efa19940f477472dad6fb18f 12-Sep-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Increase Y alignment for multisampled stencil blits.

This patch is a band-aid fix for a bug in commit 5fd67fa (i965/blorp:
Reduce alignment restrictions for stencil blits), which causes
multisampled stencil blits to work incorrectly on Sandy Bridge.

When blitting to or from a normal stencil buffer, we have to use a
coordinate transformation that swizzles coordinates to account for the
fact that stencil buffers use W tiling, but the most similar tiling
format available for textures and render targets is Y tiling. The
differences between W and Y tiling cause pixels to be scrambled within
a block of size 8x4 (width x height) as measured relative to a W tile,
or 16x2 as measured relative to a Y tile. So in order to make sure
that pixels at the edges of the blit aren't lost, we need to align the
rendering rectangle (and the buffer sizes) to multiples of the 8x4
block size. This alignment happens in the brw_blorp_blit_params
constructor, whereas the determination of how to swizzle the
coordinates happens during code generation, in the
brw_blorp_blit_program class.

When blitting to or from a multisampled stencil buffer, the coordinate
swizzling is more complex, because it has to account for the
interleaving pattern of samples, which uses 4x4 blocks for 4x MSAA and
8x4 blocks for 8x MSAA. The end result is that if multisampling is in
use, the 16x2 block size (relative so a Y tile) needs to be expanded
to 16x4, and the corresponding size relative to a W tile expands to
8x8.

The problem doesn't affect Ivy Bridge severely enough to crop up in
Piglit tests because on Ivy Bridge we have to disable multisampling
when blitting *to* a multisampled stencil buffer (the blorp compiler
generates code to compensate for the fact that multisampling is
disabled). However I suspect a bug is still present because we don't
disable multisampling when blitting *from* a multisampled stencil
buffer.

This patch fixes the problem by doubling the vertical alignment
requirement when blitting to or from a multisampled stencil buffer,
and multisampling has not been disabled.

In the long run I would like to rework the brw_blorp_blit_params
constructor--it's difficult to follow and has had several subtle bugs
like this one. However this band-aid fix should be suitable for
cherry-picking to release branches.

Fixes Piglit tests "unaligned-blit {2,4} stencil {msaa,upsample}" on
Sandy Bridge.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit a33ce665a5827c598b85bb04d94b33e6a5e41c28)
esa/drivers/dri/i965/brw_blorp_blit.cpp
76c1c34c4aa2fa48126aee8d16e943bf0e3ff750 30-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Fix offsets and width/height for stencil blits.

Fixes piglit test "framebuffer-blit-levels draw stencil".

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a5d4f7cb2367c7863b28efbd78e9169114baf42)
esa/drivers/dri/i965/brw_blorp_blit.cpp
21e9850d5369f9757b5005df4c8af38668a3053b 29-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Reduce alignment restrictions for stencil blits.

Previously, we aligned all stencil blit operations to multiples of the
size of a tile, since stencil buffers use W-tiling, and blorp has to
approximate this by configuring the 3D pipeline for Y-tiling and
swizzling coordinates.

However, this was unnecessarily conservative; it turns out that the
differences between W-tiling and Y-tiling are confined to 32-byte
sub-tiles within the 4k tiling pattern; the layout of these 32-byte
sub-tiles within the larger 4k tile is the same (8 sub-tiles across by
16 sub-tiles down, in column-major order). Therefore we only need to
align stencil blit operations to multiples of the sub-tile size.

Note: although the performance improvement of this change is probably
quite small, the fact that W-tiling and Y-tiling formats only differ
within 32-byte sub-tiles will be essential in a future patch to ensure
that stencil blits work correctly between parts of the miptree other
than level/layer 0. Making this change provides handy documentation
(and validation) of this fact.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 5fd67fac14d7f35c311eb5c671be8d4ae9b2ea37)
esa/drivers/dri/i965/brw_blorp_blit.cpp
62bc4af0e18f76dd30a4d5ae6d45a365a1fa226f 30-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: don't reduce stencil alignment restrictions when multisampling.

When blitting to a stencil buffer, we need to align the rectangle we
send down the rendering pipeline, to account for the fact that the
stencil buffer uses a W-tiled layout, but we are configuring its
surface state as Y-tiled.

Previously, when the stencil buffer was multisampled, we assumed that
we could reduce the amount of alignment that was necessary, since each
pixel occupies a block of 2x2 or 4x2 samples in the stencil buffer.
That would have been correct if the coordinates we were adjusting were
measured in pixels. However, the conversion from pixel coordinates to
coordinates within the interleaved buffer has already been done;
therefore the full alignment restriction applies.

Note: the reason this mistake wasn't previously uncovered by piglit
tests is because it is being masked by another mistake: the blorp
engine is using overly conservative alignment restrictions when doing
stencil blits. The overly conservative alignment restrictions will be
removed in the patch that follows. Doing this fix now will prevent
the subsequent patch from introducing regressions.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1a75063d5f829547b75b60ae64bddf3905b4cb8f)
esa/drivers/dri/i965/brw_blorp_blit.cpp
68da5dfc2c2e9c0aca47431076be0cd43406d4aa 30-Aug-2012 Paul Berry <stereotype441@gmail.com> intel: Add map_stencil_as_y_tiled to intel_region_get_aligned_offset.

This patch modifies intel_region_get_aligned_offset() to make the
appropriate calculation when the blorp engine sets up a W-tiled
stencil buffer using a Y-tiled SURFACE_STATE.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b760c9913dcff848a2aa0e60abeb48e596ae8fee)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_misc_state.c
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_blorp.cpp
esa/drivers/dri/i965/gen7_misc_state.c
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_regions.c
esa/drivers/dri/intel/intel_regions.h
96fd94ba9421c7c3072988f999ee869534f2bc2a 30-Aug-2012 Paul Berry <stereotype441@gmail.com> intel: Add map_stencil_as_y_tiled to intel_region_get_tile_masks.

When the blorp engine is performing a blit from one stencil buffer to
another, it sets up the surface state for these buffers as Y-tiled, so
it needs to be able to force intel_region_get_tile_masks() to return
the appropriate masks for a Y-tiled region.

Acked-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 50dec7fc2d5ba813aaa822596d124098a22db301)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_misc_state.c
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_misc_state.c
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_regions.c
esa/drivers/dri/intel/intel_regions.h
esa/drivers/dri/intel/intel_screen.c
239e9bef92bd4602bc30e05177fa85a6e5b69fe0 30-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Account for offsets when emitting SURFACE_STATE.

Fixes piglit tests "framebuffer-blit-levels {read,draw} depth".

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit f04f219906e40a6647a10fd9c1928509fe25fb84)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_blorp.h
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_blorp.cpp
e87174cf4b499c8e9558438e70b0da5f0f38f54a 16-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Thread level and layer through brw_blorp_blit_miptrees().

Previously, when performing a blit using the blorp engine, we failed
to account for the level and layer of the source and destination. As
a result, all blits would occur between miplevel 0 and layer 0 of the
corresponding textures, regardless of which level/layer was bound to
the framebuffer.

This patch passes the correct level and layer through
brw_blorp_miptrees() into the brw_blorp_blit_params data structure.

Further patches in the series will adapt
gen{6,7}_blorp_emit_surface_state to make use of these parameters.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3123f0621561549c4566248100661ef77cab2834)
esa/drivers/dri/i965/brw_blorp.h
esa/drivers/dri/i965/brw_blorp_blit.cpp
esa/drivers/dri/intel/intel_mipmap_tree.c
127dc6d136db64fcf9448d66cb4c86db3bb11226 29-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: store x and y offsets in brw_blorp_mip_info.

Currently, gen{6,7}_blorp_emit_surface_state assumes that the src and
dst surfaces are mapped to miplevel 0 and layer 0 (thus no surface
offset is required). This is a bug, since the user might try to blit
to and from levels/layers other than 0.

To fix this bug, it will not be sufficient to have
gen6_{6,7}_blorp_emit_surface_state look up the surface offset at the
time they set up the surface state, since these offsets will need to
be tweaked when blitting stencil buffers (due to the fact that stencil
buffer blits have to swizzle between W and Y tiling formats).

So, to pave the way for the bug fix, this patch causes the x and y
offsets to be computed during blit setup and stored in
brw_blorp_mip_info.

As a result of this change, brw_blorp_mip_info doesn't need to store
the level and layer anymore.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit c130ce7b2b26b4b67d4bf2b6dd1044a200efe25d)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_blorp.h
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_blorp.cpp
602e9a0f3727b036caf3a7b228fe90d36d832ea7 29-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: store surface width/height in brw_blorp_mip_info.

Previously, gen{6,7}_blorp_emit_surface_state would look up the width
and height of the surface at the time they set up the surface state,
and then tweak it if necessary (it's necessary when a W-tiled surface
is being mapped as Y-tiled). With this patch, we look up the width
and height when setting up the blit, and store them in
brw_blorp_mip_info. This allows us to do the necessary tweak in the
brw_blorp_blit_params constructor (where it makes more sense). It
also reduces the need to keep track of level and layer in
brw_blorp_mip_info, so that a future patch can eliminate them
entirely.

For consistency, this patch makes a similar change to the handling of
depth buffers when doing HiZ operations.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 09b0fa8499d8035fa31ccb2b550056305fbd149b)
esa/drivers/dri/i965/brw_blorp.cpp
esa/drivers/dri/i965/brw_blorp.h
esa/drivers/dri/i965/brw_blorp_blit.cpp
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_blorp.cpp
5c66640ac7c271a96f66f4cb49adad54eb58cc47 15-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Change gl_renderbuffer* params to intel_renderbuffer*.

This makes it more convenient for blorp functions to get access to
Intel-specific data inside the renderbuffer objects.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit e14b1288ef5b5b6091facaecd42e86f0a8157f28)
esa/drivers/dri/i965/brw_blorp_blit.cpp
cb9765ca94b5a73eaafe0468ed40052dce55fdc8 29-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/blorp: Clarify why width/height must be adjusted for Gen6 IMS surfaces.

Also add a clarifying comment for why the width/height doesn't need
adjustment for Gen7.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 32c7b2769cbe80ff56d1c73c4f9b62f13f577c8d)
esa/drivers/dri/i965/gen6_blorp.cpp
esa/drivers/dri/i965/gen7_blorp.cpp
5db1deab5118a986167ea6e8f8c7c196c74457c1 04-Sep-2012 Paul Berry <stereotype441@gmail.com> i965/gen6+: Adjust stencil buffer size after computing miptree layout.

Since Gen6+ stencil buffers use W-tiling (a tiling arrangement which
drm and the kernel are not aware of) we need to round up the width and
height of a stencil buffer to multiples of the W-tile size (64x64)
before allocating a stencil buffer. Previously, we rounded up the
size of the base miplevel, and then computed the miptree layout based
on the rounded up size. This was incorrect, because it meant that the
total size of the miptree would not be properly W-tile aligned, and
therefore we would not always allocate enough pages.

(Note: even though the GL API doesn't allow creation of mipmapped
stencil textures, it does allow mipmapping of a combined depth/stencil
texture, and on Gen6+, a combined depth/stencil texture is internally
implemented as a pair of separate depth and stencil buffers.)

For example, on Sandy Bridge, when allocating a mipmapped stencil
texture of size 128x128, we would first round up to the nearest
multiple of 64x64 (causing no change to the size), and then compute
the miptree layout (whose size worked out to 128x196). Then we would
request an allocation of 128*196 bytes (6.125 pages), causing 7 pages
to be allocated to the texture. However, the texture needs 8 pages,
since each W-tile occupies a page, and it takes 2 W-tiles to cover a
width of 128 and 4 W-tiles to cover a height of 196.

This patch changes the order of operations so that the miptree layout
is computed first and then the total size of the miptree is rounded up
to be W-tile aligned.

NOTE: This is a candidate for the 8.0 release branch.

Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit bde833c9d014ad8aebfab0d2285184d7e6d5896d)
esa/drivers/dri/intel/intel_mipmap_tree.c
4cdbf27fac2537fe1c5216afd5c10bde224eb57b 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set uniform dispatch pointers for many things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 6c01a0e770432eda0e29dbd7278a94efc688a6d3)
esa/main/api_exec.c
esa/main/uniforms.c
esa/main/uniforms.h
0fb12a40e48ca804653a51e2f5ff1acba13e703e 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set shaderapi dispatch pointers for many things in ES2 or core

v2: Allow GL_ARB_shader_objects functions in core profile because we
still expose the extension string there. Don't allow
glBindFragDataLocation in GLES3 because it's not part of that API.
Based (mostly) on review comments from Eric Anholt.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit be66cf950e01d217b5341f8e56676dc5bf81ca47)
esa/main/api_exec.c
esa/main/dlist.c
esa/main/shaderapi.c
esa/main/shaderapi.h
f16031513f32f9094238af80c01db4025c70519b 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set vtxfmt dispatch pointers for many things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit aa0f588e2d4c160879699180f0e7f4d3e52b55b9)
esa/main/vtxfmt.c
0dc989ea5b54a35bbafb00a0d40a799f8cdf0fac 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set loopback dispatch pointers for most things in ES2 or core

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a13c07f7528c74fc433a7227777351110087b89d)
esa/main/api_exec.c
esa/main/api_loopback.c
esa/main/api_loopback.h
esa/main/dlist.c
c01f89606214e1b630c9a58c5dafc1aca2b97f40 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Pass GL context to _mesa_create_save_table

This isn't used by this patch, but it will be necessary for several
follow-on patches. Separating this out will make it easier to reorder
patches later.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 3ef9e43865f38e9c8c5681768645513ce26e0488)
esa/main/context.c
esa/main/dlist.c
esa/main/dlist.h
b56c93dfff1e718c4e4a2f688d1275580c2c4ce0 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glTexStorage in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit ee77061277b640d78befb43c26a3ffbe227e9244)
esa/main/api_exec.c
90ec1db9f4c62d345fc78518570f4fde5e177d57 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glGetProgramivARB in ES2

This function is not the same as glGetProgramiv.

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 7f7268d385cc1435264b8d3111e1596b2dae9183)
esa/main/api_exec.c
dd0dd9aa52061eb1ce8436bb3e1fdc5234e79987 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glResizeBuffersMESA in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit a83b01371e60356d2ed69c131bf9e0a0daba59a4)
esa/main/api_exec.c
7dc8dc0f7cb21b23190f59ec2fc61fbf8b1556ae 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointers for glPointParameter[if][v] in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 1c0a44aaf5c095ca261d1ce11bb8a67dbbce54a2)
esa/main/api_exec.c
961567d0fe29915b9b5ed0be9970d180a18eea4e 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointers for glClearDepth or glDepthRange in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 2a3a68e4c7b15860ac9398c5a56c0d6762573633)
esa/main/api_exec.c
de4e2227948f9f65fdadfb7cc9fe5fee7e95d92b 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glGetBufferSubData in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 11927bfc4a43aefbac5af35aae34d5cdf5d9e6bb)
esa/main/bufferobj.c
f57bc97c7a7f225a3844817748db011f53ef5e06 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glGetDoublev in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit 850412b8ab272b9616da9a0df29e424b07bddde9)
esa/main/api_exec.c
bb16b471d28b575fe3e7346aa1d6dbefa9bf90cd 05-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't set dispatch pointer for glPointSize in ES2

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit aa129b0833052f613a6ec570aef092733769ee0e)
esa/main/api_exec.c
d87c3193907bb232420b86fd5de459fc7f3233b0 02-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> gles2: Alias glReadBufferNV with desktop glReadBuffer

NOTE: This is a candidate for the 9.0 branch

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Cc: Kristian Høgsberg <krh@bitplanet.net>
(cherry picked from commit 23ff634c9c2eff744b5ddae7d1ba02bc1ef19ac5)
api/glapi/gen/es_EXT.xml
cf81335712d489a1f4778596c5a6610fc8547692 18-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Allow glGetTexParameter of GL_TEXTURE_SRGB_DECODE_EXT

This was already (correctly) supported for glGetSamplerParameter paths.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit ae3023e9675a033ff66b9bb14598aa1f02530d7f)
esa/main/texparam.c
8d06574d2b80ea645b27a0b1c2b68054a80dad3f 16-Sep-2012 Chris Forbes <chrisf@ijw.co.nz> mesa: fix dropped && in glGetStringi()

This fixes glGetStringi(GL_EXTENSIONS,.. for core contexts. Previously,
all extension names returned would be NULL.

NOTE: This is a candidate for release branches.

Signed-off-by: Chris Forbes <chrisf@ijw.co.nz>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit d30a7d2eb4b6d853bfa90169341334f2b2a643d5)
esa/main/extensions.c
b1ce5749b996d6ce3dcf9bbd1537c46d14e62adb 24-Sep-2012 Matt Turner <mattst88@gmail.com> targets/xorg-i915: Rename driver to i915_drv.so.

modesetting_drv.so is undescriptive and collides with
xf86-video-modesetting.

Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
allium/targets/xorg-i915/Makefile
allium/targets/xorg-i915/intel_xorg.c
82a08e2f469d7f7a09006aaf28290ece26dd979d 04-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Ignore SRGB when determining compatible resolve formats.

MSAA resolves and other blit-like operations ignore SRGB state anyway,
so we should be able to safely allow resolves between compatible
SRGB/linear formats like SRGBA8 and RGBA8888.

This matches the behavior of the nVidia and AMD binary drivers.

Fixes completely black rendering when using multisampling in L4D2.

NOTE: This is a candidate for the 9.0 branch.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit c96828ecb46b5aee3121a018be365b738c35cbdc)
esa/main/fbobject.c
3dd84a58bb3a066eeaf854dd83a8d33801011367 19-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Don't override S3TC internalFormat if data is pre-compressed.

Commit 42723d88d intended to override an S3TC internalFormat to a
generic compressed format when the application requested online
compression of uncompressed data. Unfortunately, it also broke
pre-compressed textures when libtxc_dxtn isn't installed but the
extensions are forced on.

Both glCompressedTexImage2D() and glTexImage2D() call teximage(), which
calls _mesa_choose_texture_format(), hitting this override code. If we
have actual S3TC source data, we can't treat it as any other format, and
need to avoid the override.

Since glCompressedTexImage2D() passes in a format of GL_NONE (which is
illegal for glTexImage), we can use that to detect the pre-compressed
case and avoid the overrides.

Fixes a regression since 42723d88d370a7599398cc1c2349aeb951ba1c57.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-and-tested-by: Jordan Justen <jordan.l.justen@intel.com>
(cherry picked from commit 328961d95586931a17fe81ba816d362e8389c105)
esa/main/teximage.c
0231c54ebbfd4ace99c3be6bb6e5c76127279aca 14-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> meta: Don't _mesa_set_enable() invalid targets in ES 1.

GL_TEXTURE_1D, GL_TEXTURE_3D, GL_TEXTURE_RECTANGLE, and GL_TEXTURE_GEN_*
don't exist in ES 1 contexts, so any meta ops that used _mesa_meta_begin
with MESA_META_TEXTURE would trigger GL errors. One such operation is
_mesa_meta_Clear().

Fixes the ES1 conformance test miplin.c, which was regressed by commit
08be1d288f216232d3974f5997b266a8dd720928.

NOTE: This is a candidate for the 9.0 branch.

v2: Also blacklist GL_TEXTURE_3D, per Brian's comments.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54297
Cc: Ian Romanick <idr@freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/common/meta.c
2fe673fec3d602ba2b686eedbdf2d70a42794a82 10-Sep-2012 Jonas Maebe <jonas.maebe@elis.ugent.be> darwin: do not create double-buffered offscreen pixel formats

http://xquartz.macosforge.org/trac/ticket/536

Signed-off-by: Jeremy Huddleston Sequoia <jeremyhu@apple.com>
(cherry picked from commit 5fdf1f784bf449d7ce9839506fa23c5357696c4c)
lx/apple/apple_visual.c
f6a66a33f7ba52e36242db9346573bf477efa04e 19-Sep-2012 Vadim Girlin <vadimgirlin@gmail.com> winsys/radeon: fix relocs caching

Don't cache pointers to elements of reallocatable array.
In some circumstances it caused false cache hits resulting in incorrect
command stream and gpu lockup.

Note: This is a candidate for the stable branches.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
(cherry picked from commit 9aa8bac98b823e8783bc3a06a6e5b23fbf8d87fb)
allium/winsys/radeon/drm/radeon_drm_cs.c
allium/winsys/radeon/drm/radeon_drm_cs.h
38d1191f4133dc427fccdbaec61bef33201c2dcc 14-Sep-2012 Marek Olšák <maraeo@gmail.com> draw: fix non-indexed draw calls if there's an index buffer

pipe_draw_info::indexed determines if it should be indexed and not
the presence of an index buffer.

This fixes crashes in r300g.

NOTE: This is a candidate for the stable branches.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
(cherry picked from commit 2988fa940e1d8a4531fddff4d554eec1e6e04474)
allium/auxiliary/draw/draw_context.c
allium/auxiliary/draw/draw_private.h
allium/auxiliary/draw/draw_pt.c
a940c74bc3bb129b074601cc7967c331e2b97322 19-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: set QUANT_MODE on Cayman too

This fixes piglit/fbo-blit-stretched.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit bfe489c76b6fd58bc4d8cc7f7a3859ff3dc1782e)
allium/drivers/r600/evergreen_state.c
c3454d95af46d6de52f319e538378dee57d6fe36 08-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: do not require MSAA renderbuffer support if not asked for

to allow stencil-only sampler-only formats (like X24S8)

NOTE: This is a candidate for the stable branches.
(cherry picked from commit df5e2c058f73b72909fa99a2a189f5877525e3bf)
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_state.c
27e056ff15ff365e0e00209738ff97ca64f02f2a 08-Sep-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: fix stencil-only blits

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 61706915a3b5644faf7a5e67f47c9c593620bf8c)
allium/auxiliary/util/u_blitter.c
e81717e9e7c46eed05f9a29adaaf4c86306a8920 14-Sep-2012 Marek Olšák <maraeo@gmail.com> r300g: fix colormask with non-BGRA formats

NOTE: This is a candidate for the stable branches.
(cherry picked from commit 1e51d368eb5360378218217ff35731896f48512f)
allium/drivers/r300/r300_context.h
allium/drivers/r300/r300_emit.c
allium/drivers/r300/r300_state.c
allium/drivers/r300/r300_texture.c
86735d78e67c44a6ab786c85562c8fca2384f4a5 13-Sep-2012 Marek Olšák <maraeo@gmail.com> r600g: don't use a staging resource for large transfers

It kills performance if the resource is linear.
(cherry picked from commit e386972f5bcb59a37489ea627030315bf8961fd4)
allium/drivers/r600/r600_texture.c
7cfd42cefe1949af51ecced9891f415eca2c0e66 14-Sep-2012 Dave Airlie <airlied@redhat.com> mesa/glsl: rename preprocess to glcpp_preprocess

This symbol with dricore escapes into the namespace, its too generic,
we should prefix it with something just to be nice.

Should be applied to stable + 9.0

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 88b0790b1ae8864d4ec6196b3939498bbffdbb5f)
lsl/glcpp/glcpp.c
lsl/glcpp/glcpp.h
lsl/glcpp/pp.c
lsl/glsl_parser_extras.h
lsl/main.cpp
lsl/test_optpass.cpp
esa/program/ir_to_mesa.cpp
8f7990c5f2ca25e42c7fefff6312bee2ff77e134 14-Sep-2012 Dave Airlie <airlied@gmail.com> glcpp: fix abuse of yylex

So glcpp tried to workaround yylex its own way, but failed,
do it properly.

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 53d46bc787318ccf9911fdd1d5fe99ee4db7f41a)
lsl/glcpp/Makefile.am
lsl/glcpp/glcpp-parse.y
a834381506d5be80251953666198fc3b9bc4b731 14-Sep-2012 Dave Airlie <airlied@redhat.com> mesa: use a prefix for the program lex

This avoids us making a global yylex symbol which will interfere will
all sorts of apps.

with libdricore which can't do symbol visibility currently we pollute
the namespace with this.

This is a candidate for 9.0 & stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit cc943c8470b38a1f13d2493f293a153f75754caa)
esa/Makefile.am
esa/program/program_lexer.l
f94b6d706ff4340277b9c68d2bc51602792c5739 13-Sep-2012 Alex Deucher <alexander.deucher@amd.com> r600g: reduce quant mode on evergreen+

Seems to have an affect on the allowable range of
values. Set evergreen+ to 1/256 to match 6xx/7xx.

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

Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit b33d7eaa5e77b5367584fe183c46f8c3d9a06760)
allium/drivers/r600/evergreen_state.c
a5a86652f17c5bc249a55b558310947a76de3d33 12-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix out-of-order sampler unit usage in ARB fragment programs.

ARB fragment programs use texture unit numbers directly, unlike GLSL
which has an extra indirection. If a fragment program only uses one
texture assigned to GL_TEXTURE1, SamplersUsed will only contain a single
bit, which would make us only upload a single surface/sampler state
entry. However, it needs to be the second entry.

Using _mesa_fls() instead of _mesa_bitcount() solves this. For ARB
programs, this makes num_samplers the ID of the highest texture unit
used. Since GLSL uses consecutive integers assigned by the linker,
_mesa_fls() should give the same result as _mesa_bitcount()..

Fixes a regression since 85e8e9e000732908b259a7e2cbc1724a1be2d447,
which caused GPU hangs in ETQW (and probably others), as well as
breaking piglit test fp-fragment-position.

v2: Add a comment, as suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: meng <mengmeng.meng@intel.com>
(cherry picked from commit 28f4be9eb91b12a2c6b1db6660cca71a98c486ec)
esa/drivers/dri/i965/brw_wm_sampler_state.c
esa/drivers/dri/i965/brw_wm_surface_state.c
66e8f863d34fc8b8f7602c45bb3230fe663d4eb0 12-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Add a _mesa_fls() function to find the last bit set in a word.

ffs() finds the least significant bit set; _mesa_fls() finds the /most/
significant bit.

v2: Make it an inline function in imports.h, per Brian's suggestion.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0fc163408e6b9521d545daba19f70631011d5752)
esa/main/imports.h
c586fce4fb537e904e35cb5197b6b7fe02217acb 03-Sep-2012 Vadim Girlin <vadimgirlin@gmail.com> r600g: adjust QUANT_MODE for higher precision

Use 1/256 for R6xx/7xx, 1/4096 for evergreen, instead of default 1/16.

Helps to pass some piglit tests (fbo, multisample).

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit f44bda17f515c411071ca8744ebd96039d9c583b)
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/evergreend.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600d.h
405d47bbe78106f44e4283925e58a1d1ebc88455 31-Aug-2012 Vadim Girlin <vadimgirlin@gmail.com> mesa: don't wait in _mesa_ClientWaitSync if timeout is 0

From ARB_sync spec:

If the value of <timeout> is zero, then ClientWaitSync does not
block, but simply tests the current state of <sync>. TIMEOUT_EXPIRED
will be returned in this case if <sync> is not signaled, even though
no actual wait was performed.

Fixes random fails of the arb_sync-timeout-zero piglit test on r600g.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
(cherry picked from commit b05a1fc156c4776d97d6ff3dcce71e6e34bac21d)
esa/main/syncobj.c
04f902b47226f976d3d81c66ddadb7414051c957 08-Sep-2012 Brian Paul <brianp@vmware.com> mesa: fix proxy texture error handling in glTexStorage()

This is basically a follow-on to 1f5b1f98468d5e80be39e619ed15c422fbede8d3.
Basically, generate GL errors for ordinary invalid parameters for proxy
targets the same as for non-proxy targets. Only texture size and OOM
errors should be handled specially for proxies.

Note: This is a candidate for the stable branches.
(cherry picked from commit 35c75f6777c177a59df8a87adf0777403113ce74)
esa/main/texstorage.c
f9bb66b1cee2272b20ff3086e84d17026b8e8bb9 08-Sep-2012 Brian Paul <brianp@vmware.com> mesa: make _mesa_get_proxy_target() non-static

Needed for the next patch.

Note: This is a candidate for the stable branches.
(cherry picked from commit d17440dcaa42ac4c19dad1be7d4c7199395135a9)
esa/main/teximage.c
esa/main/teximage.h
10b9a02952ff0918c40024326228324704992329 08-Sep-2012 Brian Paul <brianp@vmware.com> mesa: do internal format error checking for glTexStorage()

Turns out we weren't doing any format checking before. Now check
the internal format and, in particular, make sure that unsized internal
formats aren't accepted.

Note: This is a candidate for the stable branches.
(cherry picked from commit 2e4fc54977977e674ee77294e6632a24e594d17f)
esa/main/texstorage.c
1f4d074f75055fd9591c5b5506727000e4a5526d 06-Sep-2012 Paul Berry <stereotype441@gmail.com> mesa/msaa: Allow X and Y flips in multisampled blits.

From the GL 4.3 spec, section 18.3.1 "Blitting Pixel Rectangles":

If SAMPLE_BUFFERS for either the read framebuffer or draw
framebuffer is greater than zero, no copy is performed and an
INVALID_OPERATION error is generated if the dimensions of the
source and destination rectangles provided to BlitFramebuffer are
not identical, or if the formats of the read and draw framebuffers
are not identical.

It is not clear from the spec whether "dimensions" should mean both
sign and magnitude, or just magnitude.

Previously, Mesa interpreted "dimensions" as meaning both sign and
magnitude, so any multisampled blit that attempted to flip the image
in the X and/or Y direction would fail.

However, Y flips are likely to be commonplace in OpenGL applications
that have been ported from DirectX applications, as a result of the
fact that DirectX and OpenGL differ in their orientation of the Y
axis. Furthermore, at least one commercial driver (nVidia) permits Y
filps, and L4D2 relies on them being permitted. So it seems prudent
for Mesa to permit them.

This patch changes Mesa to allow both X and Y flips, since there is no
language in the spec to indicate that X and Y flips should be treated
differently.

NOTE: This is a candidate for stable release branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
(cherry picked from commit 5d5f0f349135786cdd76b6004f38b12e50d7f8f9)
esa/main/fbobject.c
42ef3f68c9621eb713f154955dccabacd6e1e0ef 01-Sep-2012 Kenneth Graunke <kenneth@whitecape.org> glsl: Generate compile errors for explicit blend indices < 0 or > 1.

According to the GLSL 4.30 specification, this is a compile time error.
Earlier specifications don't specify a behavior, but since 0 and 1 are
the only valid indices for dual source blending, it makes sense to
generate the error.

Fixes (the fixed version of) piglit's layout-12.frag.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 354f2cb5c7330a7d43cf0b177daf758d2aa31e0a)
lsl/ast_to_hir.cpp
e2b4f9aac38b6fcd8eacef24afab47e9d346ba22 06-Sep-2012 Eric Anholt <eric@anholt.net> i965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.

This fixes the blue zombies bug in l4d2.

NOTE: This is a candidate for the 9.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
(cherry picked from commit 39aca5076fa0e31d418b481167063933f5f7b74f)
esa/drivers/dri/i965/brw_fs_live_variables.cpp
8b8416676e959d2ef4ade0d52aa7792641a5ed6c 06-Sep-2012 Brian Paul <brianp@vmware.com> glapi/glx: rename 'table' variable to 'disp_table'

This fixes an issue where the local 'table' variable was hiding the
function parameter name in glGetColorTable(..., void *table).

This should be OK as long as there's never a GL entrypoint that uses
'disp_table' as a parameter name.

Note: This is a candidate for the 9.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
(cherry picked from commit 043f66204b1a190e18747c3befa8826c82dd87a7)
api/glapi/gen/glX_proto_send.py
6e9baa85a95495e9343ca899a808d264076d67f8 05-Sep-2012 Brian Paul <brianp@vmware.com> mesa: fix per-level max texture size error checking

This is a long-standing omission in Mesa's texture image size checking.
We need to take the mipmap level into consideration when checking if the
width, height and depth are too large.

Fixes the new piglit max-texture-size-level test.
Thanks to Stéphane Marchesin for finding this problem.

Note: This is a candidate for the stable branches.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
(cherry picked from commit 771e7b6d884bb4294a89f276a904d90b28efb90a)
esa/main/teximage.c
3f6ce3454f4d1331234f74670c82595f84269b1b 31-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: s/CALLOC/calloc/ to fix allocation bug

The CALLOC() macro only takes one argument so this was being treated
as a comma expression. Simply use calloc() instead.

A follow-on patch will replace all CALLOC() calls with calloc().

NOTE: This is a candidate for the 8.0 and 9.0 branches.
(cherry picked from commit 43ed822a50db6b980041ddf91c16c7f8fccc4092)
esa/state_tracker/st_mesa_to_tgsi.c
7f011e20758b1f4552d56dd40204605f7ae0e3c3 02-Sep-2012 Johannes Obermayr <johannesobermayr@gmx.de> Set OSMESA_VERSION=8.

VERSION_NUMBER is not required anymore. So it will be removed.

Reviewed-by: Adam Jackson <ajax@redhat.com>
(cherry picked from commit 10a96f4a4d3d3166fa6907d4b302e01ece5ccd7e)
esa/drivers/osmesa/Makefile.am
esa/drivers/osmesa/osmesa.pc.in
41d14eaf193c6b1eb87fe1998808a887f1c6c698 06-Sep-2012 Jerome Glisse <jglisse@redhat.com> r600g: fix num of dwords needed for alphatest_state atom

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/r600_state_common.c
13b8eb64523a70af30b576271886a737f51dbe40 04-Sep-2012 Chad Versace <chad.versace@linux.intel.com> mesa: Don't advertise GLES extensions in GL contexts

glGetStringi(GL_EXTENSIONS) failed to respect the context's API, and so
returned all internally enabled GLES extensions from a GL context.
Likewise, glGetIntegerv(GL_NUM_EXTENSIONS) also failed to repsect the
context's API.

Note: This is a candidate for the 8.0 and 9.0 branches.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit f29a4b0157c6a7a31d2a2991a431b4211d01d162)
esa/main/extensions.c
c7775e842bec815ede6badc35dbfe4991c183e3a 13-Aug-2012 Tapani Pälli <tapani.palli@intel.com> android: do not expose single buffered eglconfigs

On Android we want to add only double buffered configs for visuals.
Earlier implementation set the SurfaceType as 0 for single buffered
configs but driver still exposed these configs that were not compatible
with any egl surface type. This caused Khronos conformance test runs to
fail on Android. This patch fixes the issue by skipping single buffered
configs earlier and not exposing them.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit d58ca43b809593314907694e744780ab9b28d590)
gl/drivers/dri2/platform_android.c
2a69de60bf9d8a4b35a115a0b1ac115301dd954d 13-Aug-2012 Tapani Pälli <tapani.palli@intel.com> android: fix liblog API changes

android logging macros changed their name in JellyBean.

Signed-off-by: Bruce E. Robertson <bruce.e.robertson@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 29d394b9ba4d7a23524fc6fba6da6e043085744b)
gl/drivers/dri2/platform_android.c
8cffec495c73f104819deab2bc5631abc1b36429 05-Jun-2012 Tapani Pälli <tapani.palli@intel.com> xmlconfig: use __progname when building for Android

__progname symbol and strrchr are available with bionic.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
(cherry picked from commit 4d02b018f456c447e2c24ebd1460c27d6e5fb385)
esa/drivers/dri/common/xmlconfig.c
284fe97515998178962b5abb4ed0b828b3497c77 01-Sep-2012 Ian Romanick <ian.d.romanick@intel.com> meta: Don't save and restore fog state when there is no fog state

I wonder if the better solution is to have _mesa_meta_GenerateMipmap not
use MESA_META_ALL for the GLSL path. Even on compatibility profiles
there is no reason to save and restore fog on this path.

NOTE: This is a candidate for the 9.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Tested-by: Lu Hua <huax.lu@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54295
(cherry picked from commit 51b069e7aa81cdc8f38db71554ae3dd12ce0a6c4)
esa/drivers/common/meta.c
6886da783ac2fc549b4ffc1f42a47985044757f0 31-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Don't use brw->fragment_program in calculate_urb_setup().

Reading brw->fragment_program is nonsensical in compiler code: it
contains the currently active program (if any), not the one currently
being compiled. Attempting to access it may either lead to crashes
(null pointer dereference if no program is active) or wrong results.

Fixes piglit regressions since 9ef710575b914ddfc8e9a162d98ad554c1c217f7
on pre-Sandybridge hardware. The actual bug was created in commit
7b1fbc688999fd568e65211d79d7678562061594.

NOTE: This is a candidate for the 8.0 branch.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54183
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
(cherry picked from commit 4d9abd96cc177cade79b64544096eb45bf8313a2)
esa/drivers/dri/i965/brw_fs.cpp
d240dcee6de7369a423ed230c67e3be5ff47140a 24-Aug-2012 Matt Turner <mattst88@gmail.com> Remove libGLU

It's been moved to its own repository, found at
http://cgit.freedesktop.org/mesa/glu/

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Conscript
lu/.gitignore
lu/Makefile
lu/glu.pc.in
lu/sgi/.gitignore
lu/sgi/Makefile
lu/sgi/SConscript
lu/sgi/dummy.cc
lu/sgi/glu.def
lu/sgi/glu.exports
lu/sgi/glu.exports.darwin
lu/sgi/include/gluos.h
lu/sgi/libnurbs/interface/bezierEval.cc
lu/sgi/libnurbs/interface/bezierEval.h
lu/sgi/libnurbs/interface/bezierPatch.cc
lu/sgi/libnurbs/interface/bezierPatch.h
lu/sgi/libnurbs/interface/bezierPatchMesh.cc
lu/sgi/libnurbs/interface/bezierPatchMesh.h
lu/sgi/libnurbs/interface/glcurveval.cc
lu/sgi/libnurbs/interface/glcurveval.h
lu/sgi/libnurbs/interface/glimports.h
lu/sgi/libnurbs/interface/glinterface.cc
lu/sgi/libnurbs/interface/glrenderer.cc
lu/sgi/libnurbs/interface/glrenderer.h
lu/sgi/libnurbs/interface/glsurfeval.cc
lu/sgi/libnurbs/interface/glsurfeval.h
lu/sgi/libnurbs/interface/incurveeval.cc
lu/sgi/libnurbs/interface/insurfeval.cc
lu/sgi/libnurbs/interface/mystdio.h
lu/sgi/libnurbs/interface/mystdlib.h
lu/sgi/libnurbs/internals/arc.cc
lu/sgi/libnurbs/internals/arc.h
lu/sgi/libnurbs/internals/arcsorter.cc
lu/sgi/libnurbs/internals/arcsorter.h
lu/sgi/libnurbs/internals/arctess.cc
lu/sgi/libnurbs/internals/arctess.h
lu/sgi/libnurbs/internals/backend.cc
lu/sgi/libnurbs/internals/backend.h
lu/sgi/libnurbs/internals/basiccrveval.cc
lu/sgi/libnurbs/internals/basiccrveval.h
lu/sgi/libnurbs/internals/basicsurfeval.cc
lu/sgi/libnurbs/internals/basicsurfeval.h
lu/sgi/libnurbs/internals/bezierarc.h
lu/sgi/libnurbs/internals/bin.cc
lu/sgi/libnurbs/internals/bin.h
lu/sgi/libnurbs/internals/bufpool.cc
lu/sgi/libnurbs/internals/bufpool.h
lu/sgi/libnurbs/internals/cachingeval.cc
lu/sgi/libnurbs/internals/cachingeval.h
lu/sgi/libnurbs/internals/ccw.cc
lu/sgi/libnurbs/internals/coveandtiler.cc
lu/sgi/libnurbs/internals/coveandtiler.h
lu/sgi/libnurbs/internals/curve.cc
lu/sgi/libnurbs/internals/curve.h
lu/sgi/libnurbs/internals/curvelist.cc
lu/sgi/libnurbs/internals/curvelist.h
lu/sgi/libnurbs/internals/curvesub.cc
lu/sgi/libnurbs/internals/dataTransform.cc
lu/sgi/libnurbs/internals/dataTransform.h
lu/sgi/libnurbs/internals/defines.h
lu/sgi/libnurbs/internals/displaylist.cc
lu/sgi/libnurbs/internals/displaylist.h
lu/sgi/libnurbs/internals/displaymode.h
lu/sgi/libnurbs/internals/flist.cc
lu/sgi/libnurbs/internals/flist.h
lu/sgi/libnurbs/internals/flistsorter.cc
lu/sgi/libnurbs/internals/flistsorter.h
lu/sgi/libnurbs/internals/gridline.h
lu/sgi/libnurbs/internals/gridtrimvertex.h
lu/sgi/libnurbs/internals/gridvertex.h
lu/sgi/libnurbs/internals/hull.cc
lu/sgi/libnurbs/internals/hull.h
lu/sgi/libnurbs/internals/intersect.cc
lu/sgi/libnurbs/internals/jarcloc.h
lu/sgi/libnurbs/internals/knotvector.cc
lu/sgi/libnurbs/internals/knotvector.h
lu/sgi/libnurbs/internals/mapdesc.cc
lu/sgi/libnurbs/internals/mapdesc.h
lu/sgi/libnurbs/internals/mapdescv.cc
lu/sgi/libnurbs/internals/maplist.cc
lu/sgi/libnurbs/internals/maplist.h
lu/sgi/libnurbs/internals/mesher.cc
lu/sgi/libnurbs/internals/mesher.h
lu/sgi/libnurbs/internals/monoTriangulationBackend.cc
lu/sgi/libnurbs/internals/monotonizer.cc
lu/sgi/libnurbs/internals/monotonizer.h
lu/sgi/libnurbs/internals/myassert.h
lu/sgi/libnurbs/internals/mycode.cc
lu/sgi/libnurbs/internals/mymath.h
lu/sgi/libnurbs/internals/mysetjmp.h
lu/sgi/libnurbs/internals/mystring.h
lu/sgi/libnurbs/internals/nurbsconsts.h
lu/sgi/libnurbs/internals/nurbsinterfac.cc
lu/sgi/libnurbs/internals/nurbstess.cc
lu/sgi/libnurbs/internals/nurbstess.h
lu/sgi/libnurbs/internals/patch.cc
lu/sgi/libnurbs/internals/patch.h
lu/sgi/libnurbs/internals/patchlist.cc
lu/sgi/libnurbs/internals/patchlist.h
lu/sgi/libnurbs/internals/pwlarc.h
lu/sgi/libnurbs/internals/quilt.cc
lu/sgi/libnurbs/internals/quilt.h
lu/sgi/libnurbs/internals/reader.cc
lu/sgi/libnurbs/internals/reader.h
lu/sgi/libnurbs/internals/renderhints.cc
lu/sgi/libnurbs/internals/renderhints.h
lu/sgi/libnurbs/internals/simplemath.h
lu/sgi/libnurbs/internals/slicer.cc
lu/sgi/libnurbs/internals/slicer.h
lu/sgi/libnurbs/internals/sorter.cc
lu/sgi/libnurbs/internals/sorter.h
lu/sgi/libnurbs/internals/splitarcs.cc
lu/sgi/libnurbs/internals/subdivider.cc
lu/sgi/libnurbs/internals/subdivider.h
lu/sgi/libnurbs/internals/tobezier.cc
lu/sgi/libnurbs/internals/trimline.cc
lu/sgi/libnurbs/internals/trimline.h
lu/sgi/libnurbs/internals/trimregion.cc
lu/sgi/libnurbs/internals/trimregion.h
lu/sgi/libnurbs/internals/trimvertex.h
lu/sgi/libnurbs/internals/trimvertpool.cc
lu/sgi/libnurbs/internals/trimvertpool.h
lu/sgi/libnurbs/internals/types.h
lu/sgi/libnurbs/internals/uarray.cc
lu/sgi/libnurbs/internals/uarray.h
lu/sgi/libnurbs/internals/varray.cc
lu/sgi/libnurbs/internals/varray.h
lu/sgi/libnurbs/nurbtess/definitions.h
lu/sgi/libnurbs/nurbtess/directedLine.cc
lu/sgi/libnurbs/nurbtess/directedLine.h
lu/sgi/libnurbs/nurbtess/glimports.h
lu/sgi/libnurbs/nurbtess/gridWrap.cc
lu/sgi/libnurbs/nurbtess/gridWrap.h
lu/sgi/libnurbs/nurbtess/monoChain.cc
lu/sgi/libnurbs/nurbtess/monoChain.h
lu/sgi/libnurbs/nurbtess/monoPolyPart.cc
lu/sgi/libnurbs/nurbtess/monoPolyPart.h
lu/sgi/libnurbs/nurbtess/monoTriangulation.cc
lu/sgi/libnurbs/nurbtess/monoTriangulation.h
lu/sgi/libnurbs/nurbtess/mystdio.h
lu/sgi/libnurbs/nurbtess/mystdlib.h
lu/sgi/libnurbs/nurbtess/partitionX.cc
lu/sgi/libnurbs/nurbtess/partitionX.h
lu/sgi/libnurbs/nurbtess/partitionY.cc
lu/sgi/libnurbs/nurbtess/partitionY.h
lu/sgi/libnurbs/nurbtess/polyDBG.cc
lu/sgi/libnurbs/nurbtess/polyDBG.h
lu/sgi/libnurbs/nurbtess/polyUtil.cc
lu/sgi/libnurbs/nurbtess/polyUtil.h
lu/sgi/libnurbs/nurbtess/primitiveStream.cc
lu/sgi/libnurbs/nurbtess/primitiveStream.h
lu/sgi/libnurbs/nurbtess/quicksort.cc
lu/sgi/libnurbs/nurbtess/quicksort.h
lu/sgi/libnurbs/nurbtess/rectBlock.cc
lu/sgi/libnurbs/nurbtess/rectBlock.h
lu/sgi/libnurbs/nurbtess/sampleComp.cc
lu/sgi/libnurbs/nurbtess/sampleComp.h
lu/sgi/libnurbs/nurbtess/sampleCompBot.cc
lu/sgi/libnurbs/nurbtess/sampleCompBot.h
lu/sgi/libnurbs/nurbtess/sampleCompRight.cc
lu/sgi/libnurbs/nurbtess/sampleCompRight.h
lu/sgi/libnurbs/nurbtess/sampleCompTop.cc
lu/sgi/libnurbs/nurbtess/sampleCompTop.h
lu/sgi/libnurbs/nurbtess/sampleMonoPoly.cc
lu/sgi/libnurbs/nurbtess/sampleMonoPoly.h
lu/sgi/libnurbs/nurbtess/sampledLine.cc
lu/sgi/libnurbs/nurbtess/sampledLine.h
lu/sgi/libnurbs/nurbtess/searchTree.cc
lu/sgi/libnurbs/nurbtess/searchTree.h
lu/sgi/libnurbs/nurbtess/zlassert.h
lu/sgi/libtess/README
lu/sgi/libtess/alg-outline
lu/sgi/libtess/dict-list.h
lu/sgi/libtess/dict.c
lu/sgi/libtess/dict.h
lu/sgi/libtess/geom.c
lu/sgi/libtess/geom.h
lu/sgi/libtess/memalloc.c
lu/sgi/libtess/memalloc.h
lu/sgi/libtess/mesh.c
lu/sgi/libtess/mesh.h
lu/sgi/libtess/normal.c
lu/sgi/libtess/normal.h
lu/sgi/libtess/priorityq-heap.c
lu/sgi/libtess/priorityq-heap.h
lu/sgi/libtess/priorityq-sort.h
lu/sgi/libtess/priorityq.c
lu/sgi/libtess/priorityq.h
lu/sgi/libtess/render.c
lu/sgi/libtess/render.h
lu/sgi/libtess/sweep.c
lu/sgi/libtess/sweep.h
lu/sgi/libtess/tess.c
lu/sgi/libtess/tess.h
lu/sgi/libtess/tessmono.c
lu/sgi/libtess/tessmono.h
lu/sgi/libutil/error.c
lu/sgi/libutil/glue.c
lu/sgi/libutil/gluint.h
lu/sgi/libutil/mipmap.c
lu/sgi/libutil/project.c
lu/sgi/libutil/quad.c
lu/sgi/libutil/registry.c
lu/sgi/mesaglu.opt
00978098794f723230a33cab1c1152686f1c4fa5 31-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> dri: Rework planar image interface

As discussed with Kristian on #wayland. Pushes the decision of components into
the dri driver giving it greater freedom to allow t to implement YUV samplers
in hardware, and which mode to use.

This interface will also allow drivers like SVGA to implement YUV surfaces
without the need to sub-allocate and instead send 3 seperate buffers for each
channel, currently not implemented.

I have tested these changes on Gallium Svga. Scott tested them on both intel
and Gallium Radeon. Kristan and Pekka tested them on intel.

v2: Fix typo in dri2_from_planar.
v3: Merge in intel changes.

(cherry picked from commit 6a7dea93fa70d670a5954e47a47075a2703209d4)

Tested-by: Scott Moreau <oreaus@gmail.com>
Tested-by: Pekka Paalanen <ppaalanen@gmail.com>
Tested-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
gl/drivers/dri2/egl_dri2.c
allium/state_trackers/dri/common/dri_screen.h
allium/state_trackers/dri/drm/dri2.c
bm/backends/dri/gbm_dri.c
esa/drivers/dri/intel/intel_regions.h
esa/drivers/dri/intel/intel_screen.c
ef557eacfffedd58dea4645c317ea8140daa3475 30-Aug-2012 Marek Olšák <maraeo@gmail.com> winsys/radeon: disable virtual memory on Cayman

It hangs.
allium/winsys/radeon/drm/radeon_drm_winsys.c
0791484c4233f3b474b1d9ba1af2f4608fe7e962 30-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Bump version to 9.0

Now that OpenGL 3.1 is supported by at least one driver, follow
tradition and bump the major version number.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/version.h
0e470533ad0aecb58341a8935618c8cdf642bedd 30-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: enable transform feedback on Cayman

There doesn't seem to be anything wrong with it.
allium/drivers/r600/r600_pipe.c
64db3cc6ad2d52dec46119e5b80030393cb60bf4 30-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement MSAA for Cayman

Everything works except for blitting MSAA colorbuffers, which isn't
so trivial on Cayman. It's a rarely-used feature anyway.
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r600/evergreen_hw_context.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/evergreend.h
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state_common.c
f8a8f069ee2dae35470c6e2a681e5e110044e6fe 29-Aug-2012 Anuj Phogat <anuj.phogat@gmail.com> i965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_state

This is required to get the program recompiled when SampleAlphaToCoverage
is enabled.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
esa/drivers/dri/i965/brw_wm.c
esa/drivers/dri/i965/brw_wm.h
c2e9dd0276464ed61d48d3d80b9be8228767dfe2 26-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: enable MSAA on r6xx by default

DRM 2.22.0 is required though. Also require the new DRM for r700, as
there are some important fixes for that generation too.
allium/drivers/r600/r600_state.c
2f6eb3afb725112b2a0b110493f5062f80a78a3f 26-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: disable MSAA depth decompression on r6xx
allium/drivers/r600/r600_blit.c
78354011f99c4103345f8f32e10b0b4b884ebdaf 26-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement color resolve for r600

The blend state is different and the resolve single-sample buffer must have
FMASK and CMASK enabled. I decided to have one CMASK and one FMASK
per context instead of per resource.

There are new FMASK and CMASK allocation helpers and a new buffer_create
helper for that.
allium/drivers/r600/r600_buffer.c
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.c
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_texture.c
863e2c85b9c59d717ad786c709638d948ff0f38e 26-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx
allium/drivers/r600/r600_state.c
187d7fb2fec7da889f25366696faaac4c2e8f9c4 24-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement draw_rectangle callback

The color resolve on r6xx needs PT_RECTLIST. Using conventional primitive
types (triangles and quads) produces an ugly line between two diagonally
opposite corners. I guess a rectangular point sprite would work too.
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state_common.c
8698a3b85dd89c5d2fa473e7942b7dc8d25f3c8f 02-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement MSAA for r700

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_texture.c
allium/drivers/r600/r600d.h
edf22a5c6de5107c3f67357dad7cebbc8daf8368 21-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: change programming of CB_SHADER_MASK on r600-r700

This one actually makes more sense and gives the expected value
for MSAA resolve.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/r600_state.c
055093e33fc90705c429e948caefedf0e0fb82af 30-Aug-2012 Brian Paul <brianp@vmware.com> meta: remove call to _meta_in_progress(), fix multisample enable/disable

This partially reverts d638da23d2ec2e9c52655b1ea138249e7f8bcccb.

With gallium the meta code is not always built so the call to
_meta_in_progress() was unresolved. Simply special-case the
GL_MULTISAMPLE case in the meta code. There might be other special
cases in the future given all the differences between legacy GL,
core GL, GLES, etc.

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=54234
and https://bugs.freedesktop.org/show_bug.cgi?id=54239

v2 (Paul Berry <stereotype441@gmail.com>): keep _meta_in_progress
function, since it's needed by the i965 driver, but don't call it from
core mesa.

Signed-off-by: Brian Paul <brianp@vmware.com>
esa/drivers/common/meta.c
esa/main/enable.c
aad7ccd261e67e9d943dcab17ebe8082d7b6f4d9 30-Aug-2012 Brian Paul <brianp@vmware.com> meta: add parenthesis to silence compiler warnings

Reviewed-by: Paul Berry <stereotype441@gmail.com>
esa/drivers/common/meta.c
9121460f13c420d9cd2783636fe79bc4798eebed 28-Aug-2012 Tapani Pälli <tapani.palli@intel.com> scons : add HAVE_DLOPEN to build environment

fixes dlopen issue caused by 57c57df7b4579b60a84062df2e64f84dd84558b5

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

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Signed-off-by: José Fonseca <jfonseca@vmware.com>
esa/SConscript
f1fd94f3550372a91e79c4ff6c0b09821dfb0192 24-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: fix stupid bug added in commit 07838603b9a69c05911edbcd351bfce5ad9b5a2c

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/si_state_draw.c
83933606596a0197e6cd1740cb439eaf055e544d 05-Jun-2012 Eric Anholt <eric@anholt.net> i965/fs: Remove a dead member from live variables analysis.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_fs_live_variables.cpp
esa/drivers/dri/i965/brw_fs_live_variables.h
6928bea7ca1f2ed308d8255c6816f44467306255 29-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Initialize output_components[] by filling it with zeros.

Prior to commit 2f1869822, emit_fb_writes() looped from 0 to 3, writing
all four components of a vec4 color output. However, that broke for
smaller output types (float, vec2, or vec3). To fix that, I introduced
a new variable (output_components[]) containing the size of the output
type for each render target.

Unfortunately, I forgot to actually initialize it in the constructor,
which meant that unless a shader wrote to gl_FragColor, or the specific
output for each render target, output_components would contain a garbage
value, and we'd loop for a completely non-deterministic amount of time.

Not actually emitting any color writes seems like the right approach.
We may still need to emit a render target write (to terminate the
thread), but don't have to put in any sensible values (the shader didn't
write anything, after all).

Fixes a regression since 2f18698220d8b27991fab550c4721590d17278e0.
NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54193
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Tested-by: Ian Romanick <idr@freedesktop.org>
esa/drivers/dri/i965/brw_fs_visitor.cpp
42723d88d370a7599398cc1c2349aeb951ba1c57 22-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Do something sensible when on-line compression is requested but not possible

It is possible to force S3TC extensions to be enabled. This is
generally done to support applications that will only supply
pre-compressed textures. This accounts for the vast majority of
applications.

However, there is still the possibility of an application asking for
on-line compression. In that case, generate a warning and substitute a
generic compressed format. The driver will either pick an uncompressed
format or a compressed format that Mesa can handle on-line (e.g., FXT1).

This should only cause problems for applications that request on-line
compression and read the compressed texture back. This is likely an
infinitesimal subset of an already infinitesimal subset.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/teximage.c
0e0d66446194ab0b2d114dc83e76ec9c9b1a01f1 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Allow creation of OpenGL 3.1 contexts

v2: Fix API_OPENGL_CORE handling when TEXTURE_FLOAT_ENABLED is not
defined. Based on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_context.c
2a33a997376e1b628ad91e609a090bedf5964704 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Advertise GLSL 1.40 and TexBOs in core contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/intel/intel_extensions.c
91473485fcf3e2cef465784ae5581787a2a8a3b3 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> intel: Clean up bits of cruft in intelCreateContext

This and the previous three commits should probably be squashed together...

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/intel/intel_screen.c
bf8644e64daa4e1d59d1e399355b349406438d7a 17-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Set context flags

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/i965/brw_context.c
esa/drivers/dri/i965/brw_context.h
esa/drivers/dri/intel/intel_screen.c
ca2b1fcb30bb1bec2eab520626c58727949f7cd6 17-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/dri: Allow creation of forward-compatible contexts

This is done by changing the API to API_OPENGL_CORE.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/common/dri_util.c
36ceabfb745f27bc5754ee2a9766945d1dd59551 22-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Enable GL_OES_vertex_array_object

Functionally the same as GL_ARB_vertex_array_object.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
api/glapi/gen/es_EXT.xml
api/glapi/gen/gles_api.py
esa/main/api_exec.c
esa/main/extensions.c
esa/main/get.c
35cf6aeb8c26821e704db737b61cf2623b3e8f6b 22-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers

This is a purely software extension. The drivers don't need to do any
work to support it.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/intel/intel_extensions.c
esa/drivers/dri/r200/r200_context.c
esa/main/extensions.c
esa/main/get.c
esa/main/mtypes.h
esa/main/version.c
esa/state_tracker/st_extensions.c
d1cf5c77b73d6b2c1cfd79ce0e3363e097177b6a 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> meta: Don't use deprecated keyword in 1.30 shader

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/common/meta.c
ae88281b7b67d656a7d1467c39c8d93dc8778485 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Disallow alpha, luminance, and LA textures in core context

Also disallow the 1, 2, 3, and 4 formats.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/teximage.c
04d6ffa06deff792aea49eccc4bceb1a91a1892e 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Disallow more deprecated functions in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/api_exec.c
esa/main/vtxfmt.c
91107b4ccf7a47633fce98b9ccfba7f559098cb7 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Require names from Gen in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/bufferobj.c
esa/main/texobj.c
843b876ba3e01af73ea4ca55a529911448c10b2a 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Allow NULL vertex pointer without a VBO

There is text in the OpenGL 3.x specs to explicitly allow this case.
Weird.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/varray.c
792214e8d45675b756e02a5e39bfe2ab32f7383d 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Disallow VertexAttribPointer without a VAO in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/varray.c
29512df6355706cc678d3994185c20c4d66b57c4 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Disallow wide lines in forward compatible context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/lines.c
7e1cab09a155a0f986342323624f460340de355f 18-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context

Page 407 (page 423 of the PDF) of the OpenGL 3.0 spec says (in the list
of deprecated functionality):

"Separate polygon draw mode - PolygonMode face values of FRONT and
BACK; polygons are always drawn in the same mode, no matter which
face is being rasterized."

Also modify meta to not use FRONT or BACK in a core context.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/common/meta.c
esa/main/polygon.c
d638da23d2ec2e9c52655b1ea138249e7f8bcccb 08-Aug-2012 Paul Berry <stereotype441@gmail.com> meta: Don't stray outside the confines of the API specified in the context

Signed-off-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/common/meta.c
esa/main/enable.c
8e7b6a69e9cb00345e0c08966036b305cbda46c9 17-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't allow display lists or evaluators in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/context.c
esa/main/vtxfmt.c
2bcf55549026972c186b5e6c9f351ee77da30166 17-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't allow GL_EXTENSIONS query in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/getstring.c
c85a9a99965745bac23a72a6794cd9d9493e27be 15-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Non-sprite points are deprecated

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/points.c
7d8d1c781967e0c29b0523e2c8056c2d7412dd60 09-Aug-2012 Eric Anholt <eric@anholt.net> mesa: Fix VAO deletion on GL 3.1 core.

We were calling through a dispatch table entry that was NULL, since the apple
variant is only on legacy desktop. Just call the function we mean instead of
indirecting through the dispatch.
esa/main/arrayobj.c
8a4d560796f0ec3424c363fc82852a02c2701fe5 09-Aug-2012 Eric Anholt <eric@anholt.net> mesa: Enable a bunch of missing getters on 3.1 core.

NOTE: maybe I enabled too many?
esa/main/get.c
bb4a39ec951a696efa07a120c9446b677703abab 27-Jul-2012 Eric Anholt <eric@anholt.net> mesa: Expose texture buffer objects when the context is GL 3.1 core.

v2: Use API_OPENGL_CORE.

v3: Only require desktop GL. If a driver can't support TexBOs in a non-core
context, it should not enable them.

Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/get.c
esa/main/teximage.c
1b86a91c643fdd4c3de1a2f5e84f94e812105766 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Allow PACK / UNPACK queries for ES2

These are part of the GL_EXT_unpack_subimage extension and ES 3.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/get.c
a010215463c63680c69e90202fe3fcd2e5b25fa6 29-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Kill ES2 wrapper functions

v2: Fix completely broken condition around ClearColorIiEXT and
ClearColorIuiEXT.

v3: Add special VertexAttrib handling for ES2.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/Android.gen.mk
esa/Makefile.am
esa/SConscript
esa/main/.gitignore
esa/main/api_exec.c
esa/main/context.c
esa/main/vtxfmt.c
esa/sources.mak
esa/vbo/vbo_exec_api.c
fc2219e4482c4b940ea32dbe8ad220a22c300f3d 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: glGetVertexAttribPointerv is part of core profile and ES2

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/api_exec.c
917f68071bcba705970f474fae2cb56cfffa20f5 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/points.c
f778174ea1e431a7113f12c12beb4aba9e825a9f 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN

The comment in the code even says this is the right thing to do.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/points.c
25ffb8689350bc7bb58a564bb1c5fc3ba62cb1df 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Require that drivers supporting point sprites support point parameters

All drivers in Mesa do. This allows a lot of extension checking code to be
gutted from the function.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/points.c
33e01d93ca1a1d3183243c308a2c87f4b969b3bd 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/texenv.c
8a263b6efd2c520a4ed9c98b9c8142c6c2c6f389 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texenv.c
d2b03f6e993f08b0a80a206d7bf6f0d42b308266 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texgen.c
esa/main/texgen.h
f329adfa497b6b2e0a125ab98a38c656a017270d 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texgen.c
0fa4ed05cf51fc64f5e43d8ea6916115672bf7ab 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/light.c
fb4f2d34256aee6b0005b18769a395dd066d3820 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/vbo/vbo_exec_api.c
8df3f9bd5f7626a4548e9901c0b7af33a21af8a6 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper

Fixes a bug that glGetMaterial[fx]v in ES1 contexts would (try to) allow
queries of GL_AMBIENT_AND_DIFFUSE. This enum can only be used in glMaterial,
not in the get.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/light.c
9555d7bdc1cec4cf08be85a2d1e9095de8dd3771 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile, GLES1, and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/getstring.c
d6c8913bc629fedc520353cd9de51f1c7ba262a4 28-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/matrix.c
10e7db1ccf4d3b2023f04663f7a6c079eb6afc57 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/fog.c
b7c7e5e45a14ed78eda104ebca25072172730645 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper

v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/readpix.c
4114dee99ecd848693302078597076ced9426f95 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/pixelstore.c
08be1d288f216232d3974f5997b266a8dd720928 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper

Also handle glDisable, glIsEnabled, glEnableClientState, and
glDisableClientState.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/enable.c
bca2cece02385a14f61d5dd8d31aba775b0afb8e 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glHint target in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/hint.c
2c87030a00eb5b7034f14f6060093d4b264bc5c0 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Allow glGetVertexAttribfv(0, GL_CURRENT_VERTEX_ATTRIB_ARB, param) in
OpenGL 3.1, just like OpenGL ES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
c13f36ce4e34821144ca6479e4bc3598b598d855 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/getstring.c
6a9b8f897a8b59fae03c73e05203bc708fb17793 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate primitive modes in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/api_validate.c
72e076cb17e47c608fa6534641653cdc6133fb27 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor _mesa_valid_prim_mode to use a switch-statement

This makes the next change a bit easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/api_validate.c
01497a356048ce23e089ad8ab8ab0102aae97b3c 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate blend function enums in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

v3: Allow GL_SRC_ALPHA_SATURATE as a destination factor in GLES3. Based
on review feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/blend.c
e58c19a204a028b0c3db7416250387ba98ed0a2d 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glClear mask in Mesa code rather than the ES wrapper
esa/main/APIspec.xml
esa/main/clear.c
f0c99d0a6a897189dd4b66f508385eb2ecf3f76f 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glRenderbufferStorage internalFormat in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Allow GL_RGB10_A2UI in GLES3 based on review feedback from Eric
Anholt.

v4: Arg. Reject unsized RED and RG enums on GLES. More feedback from
Eric.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/fbobject.c
ae86ebfcc9fb3e89744c3ee38766a505857b3e7a 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetRenderbufferParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/fbobject.c
0cdaa471ecb7ce6442b5ed4a54314de0ffeab614 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetFramebufferAttachmentParameter pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile, GLES1, and GLES3 filtering.

v3: Fix the GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME query when the
attachment type is GL_NONE on GLES3. Other cleanups. Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/fbobject.c
5b44a77428863292d49aeed2960afbde5ee8f509 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGenerateMipmap target in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Fix a typo in GL_TEXTURE_2D_ARRAY checking.

v4: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test. The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2). Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/fbobject.c
7f991d26ad189bc3c08c04dc248a5b2df5ce9f68 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glFramebufferTexture2D textarget in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: Change !_mesa_is_desktop_gl tests to _mesa_is_gles test. The test
around GL_TEXTURE_2D_ARRAY got some other changes because that enum is
also available with GLES3 (which uses API_OPENGLES2). Based on review
feedback from Eric Anholt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/fbobject.c
2809ae3d445bc10a79f119946439431ba73bb069 29-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Fix encoding of FP immediates on SI
allium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp
05113fd2662eeb0d17fd1074001b7405eeeca43c 29-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Create a register class for the M0 register

The Common Subexpression Elimination pass will not operate on
instructions with physical register defs, so we end up with
several redundant copies to M0 when using interpolation.

Adding a register class that only contains the M0 register allows
use to use a virtual register to represent M0, and makes it possible
for the Common Subexpression Elimination pass to remove the extra
copies.
allium/drivers/radeon/SIGenRegisterInfo.pl
allium/drivers/radeon/SIISelLowering.cpp
allium/drivers/radeon/SIISelLowering.h
allium/drivers/radeon/SIInstrInfo.td
allium/drivers/radeon/SIInstructions.td
733c28a0d95c1da87b14ef893f8a59b1f940322a 29-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Set the neverHasSideEffects bit on more instructions

This flag makes these instructions candidates for the dead code
elimination and common subexpression elimination.
allium/drivers/radeon/SIInstructions.td
cf4ac69928eb17685958e6b3b01b97544560d90e 29-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Declare the interpolation intrinsics as ReadOnly

This signals to the Dead Code Elimination pass that it is safe to
remove these instructions when they are dead.
allium/drivers/radeon/SIInstrInfo.td
allium/drivers/radeon/SIIntrinsics.td
allium/drivers/radeonsi/radeonsi_shader.c
73a2c4b9db638cad83e412097ed3433649aab47b 28-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Mark M0 as a def when lowering interpolation instructions
allium/drivers/radeon/SIISelLowering.cpp
0fc11a24c85413a335b87bc34659d2381fd6670c 29-Aug-2012 Anuj Phogat <anuj.phogat@gmail.com> meta: Add GLSL variant of _mesa_meta_GenerateMipmap() function

This reduces the overhead of using the fixed function internally
in the driver.

V2: Use setup_glsl_generate_mipmap() and setup_ff_generate_mipmap()
functions to avoid code duplication.
Use glsl version when ARB_{vertex, fragmet}_shader are present.
Remove redundant code.

V3: Remove redundant border related code leaving the assertion.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ian Romanick <idr@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/drivers/common/meta.c
c824804c6f10eeb58ae91033682ca871c0e373c4 29-Aug-2012 Brian Paul <brianp@vmware.com> glsl: s/class/struct/ for ast_type_qualifier

To silence an MSVC compiler warning about class vs. struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/glsl_parser_extras.h
ec6478fd322646ae4f6ae20eed8d9c14ea503dfc 25-Aug-2012 Brian Paul <brianp@vmware.com> mesa: convert a few more macros to inline functions
esa/main/macros.h
cf41d7c63aab2289d739c0f9df116caf2cc410e3 25-Aug-2012 Brian Paul <brianp@vmware.com> mesa: remove COPY_4V_CAST() macro

Only used in one place, and not really needed.
esa/main/clear.c
esa/main/macros.h
fd9afb87d81f922ea3c13a5bf2d6b17d06b43424 25-Aug-2012 Brian Paul <brianp@vmware.com> mesa: convert a bunch of math macros to inline functions
esa/main/macros.h
454e23776dbcb4946fbd6e610d837137f7f8ed76 25-Aug-2012 Brian Paul <brianp@vmware.com> tnl: use INTERP_4F() instead of four INTERP_F() calls
esa/tnl/t_vertex_generic.c
ba6f47132d057937cb55f5aaf9b79bd667b7a48d 25-Aug-2012 Brian Paul <brianp@vmware.com> swrast: fix wrong assignments in _swrast_add_spec_terms_line()
esa/swrast/s_lines.c
1aee8803f83f7ae24d9c2150c70afff2b1ee4c2f 28-Aug-2012 Brian Paul <brianp@vmware.com> mesa: test for GL_EXT_framebuffer_sRGB in glPopAttrib()

To avoid spurious GL_INVALID_ENUM errors if the extension isn't supported.
esa/main/attrib.c
c4c4d4ad1e2dd25656543bac5bde3a59b85e22b8 29-Aug-2012 Martin Pieuchot <mpi@openbsd.org> mesa: Define CPU_TO_LE32 to work on OpenBSD

Signed-off-by: Brian Paul <brianp@vmware.com>
esa/main/compiler.h
67e9ae856355be532455c1cf1211d59b3a4c5992 27-Aug-2012 Eric Anholt <eric@anholt.net> i965: Disable the swrast context setup on GL 3.1 core.

I've reviewed the code, and the swrast callsites remaining are all in
drawpixels/copypixels/bitmap/accum, or _swrast_BlitFramebuffer that shouldn't
be hit. A piglit run with the context setup disabled on legacy GL and GLES2
showed regressions only in the copypixels and drawpixels tests.

If the context type is forced, this reduces the shader_runner maximum heap
size for glsl-algebraic-add-add-1.shader_test from 15,137,496b to 4,165,376b.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_context.c
esa/drivers/dri/intel/intel_context.c
esa/drivers/dri/intel/intel_span.c
993c52d0be5bdf0e30e64ab4c6e1347c5dcb8e3b 27-Aug-2012 Eric Anholt <eric@anholt.net> i965: Replace general sw fallback support with a manual check for rendermode.

There were no other cases that set it any more.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/i965/Makefile.sources
esa/drivers/dri/i965/brw_draw.c
esa/drivers/dri/i965/brw_fallback.c
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_state_upload.c
b0d23b66cf2514949650bdfa9c918ab2fb1d8986 27-Aug-2012 Eric Anholt <eric@anholt.net> intel: Move RenderMode fallback func to i915 driver.

The Fallback field of the context struct doesn't work that way on i965, and
it's the only caller of FALLBACK() in the driver.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/i915/i830_state.c
esa/drivers/dri/i915/i915_state.c
esa/drivers/dri/intel/intel_context.c
esa/drivers/dri/intel/intel_context.h
esa/drivers/dri/intel/intel_state.c
628dfe9511c15cc265b103e4752e3ee31b04602b 27-Aug-2012 Eric Anholt <eric@anholt.net> i965: Drop the old sw fallback for position array being disabled.

This code has been in the driver since the first commit. I think it was
trying to stop rendering from happening with a disabled position array. Core
mesa has since had changes to deal with disabled position arrays correctly.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/i965/brw_draw_upload.c
5e3c093ff866b74fbf6483ece671edbf5eb3ae7a 27-Aug-2012 Eric Anholt <eric@anholt.net> i965: Drop support for forcing drawing through sw fallbacks.

It turns out it hasn't worked since at least 8.0.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/i965/brw_fallback.c
esa/drivers/dri/intel/intel_context.c
bfae8650ec25d9f03ed1f58435325fd9b62b8da8 26-Aug-2012 Eric Anholt <eric@anholt.net> i965: Move depth resolve for span fallbacks to a simpler place.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/intel/intel_span.c
esa/drivers/dri/intel/intel_tex_validate.c
707f242c4be9bd6ea9140b9a7a7673ae5e4e191d 26-Aug-2012 Eric Anholt <eric@anholt.net> i965: Drop manual hiz resolves in span rendering.

swrast uses MapRenderbuffer, which leads to intel_miptree_map, which does the
depth resolve.

Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
Acked-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/intel/intel_span.c
70f9dbe298043f0e3914e6956ddcc0a098f7eca3 28-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeon/llvm: Handle TGSI KIL opcode for SI.

Fixes piglit fp-kil and glBitmap() with radeonsi.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/SIISelLowering.cpp
allium/drivers/radeon/SIISelLowering.h
allium/drivers/radeon/SIInstructions.td
16e42a5dd065c09f6d561537009639906b22ce45 28-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeon/llvm: Basic support for SI EXEC register.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/AMDGPUAsmPrinter.cpp
allium/drivers/radeon/SIGenRegisterInfo.pl
allium/drivers/radeon/SIInstructions.td
6ca64393c9f357160c8439bf7e73610641c6ded2 24-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Don't write to the PA_SC_RASTER_CONFIG register.

It should be initialized by the kernel as necessary.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
allium/drivers/radeonsi/si_state.c
999b7f66655c86eb8e8e1686631511e27f50cc98 27-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fix relative addressing on RS780 and RS880

They should be treated like RV670.

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
allium/drivers/r600/r600_asm.c
bc8509b43b591796fa7c3b7a7497053eb298dc8b 06-Jul-2012 José Fonseca <jfonseca@vmware.com> llvmpipe: Bump the maximum texture size (in pixels).

But cap the size in bytes, to avoid depleting the whole system memory,
with humongus textures.

Tested with max-texture-size piglit test.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
allium/drivers/llvmpipe/lp_limits.h
allium/drivers/llvmpipe/lp_texture.c
6463eb013f645440d252b8b390e1c6e3c1212b7e 28-Aug-2012 Vadim Girlin <vadimgirlin@gmail.com> u_vbuf: avoid unnecessary update of the vertex elements

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
allium/auxiliary/util/u_vbuf.c
971750e1cd76dabe22bf2ca83f07266837e3a2a6 25-Aug-2012 Matt Turner <mattst88@gmail.com> egl: fix invalid flag detection for EGL_KHR_create_context

We want to check whether there are bits set outside of the valid flags.

Fixes piglit test egl-create-context-invalid-flag-gl

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
gl/main/eglcontext.c
77d675926a5a5b6cfafe11d1b692e0ba93fdac85 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Make VS programs obey the shader_precompile driconf option.

Now that it's on by default, we may as well make it obey the flag,
for consistency's sake if nothing else.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_shader.cpp
9ef710575b914ddfc8e9a162d98ad554c1c217f7 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Reenable the fragment shader precompile.

Precompiling the shader at link time often allows us to avoid compiling
it at the first use. This moves the expensive compilation and
optimization process to game or level load time, rather than at draw
time, where we really can't avoid any cycles and don't want to risk
stalling the GPU.

The downside is that we have to guess the non-orthagonal state the
program will have set when it draws with the shader. Previously, we
guessed wrong for nearly every shader, so it wasn't useful. With the
recent SamplerUnits rework and this series, we've either eliminated
state or made smarter guesses, and usually get it right now.

In the L4D2 time demo, I now have 39 fragment shader recompiles and no
vertex shader recompiles. Before this series and the SamplerUnits
rework, I had 206 fragment shader recompiles and 192 vertex shader
recompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/intel/intel_screen.c
88b3850c272636e0385f2111b4bc56724febb45b 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Set swizzle fields in the VS precompile program key.

This fixes a regression since 76d1301e8e8e50dc962601a9977bc52148798349:
I began setting SWIZZLE_XYZW for unused sampler units in the actual
program keys, since this matched the FS precompile behavior. However,
the VS precompile was expecting zero, so that commit made essentially
every vertex shader (even those not using texturing) mismatch and need
to be recompiled.

Setting them in the VS precompile key solves the issue. It also is an
improvement over our old behavior: previously we guessed that vertex
shaders didn't use any textures at all. Now we actually look to see if
the VS had any sampler uniforms and guess based on that.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vs.c
c20cb8d1f6cac0b98950828e69376bb9406761ff 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Add VS program key dumping to INTEL_DEBUG=perf.

Eric added support for WM key debugging. This adds it for the VS.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_vs.c
esa/drivers/dri/i965/brw_vs.h
85b24b07512c5f3f05c5a3eb9561598ace97526c 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Assume shadow sampler swizzling is <X, X, X, 1>.

Our previous assumption, SWIZZLE_XYZW, was completely bogus for depth
textures. There are no Y, Z, or W components.

DEPTH_TEXTURE_MODE has three options:
- GL_LUMINANCE: <X, X, X, 1>
- GL_INTENSITY: <X, X, X, X>
- GL_ALPHA: <0, 0, 0, X>

The default value is GL_LUMINANCE, and most applications don't seem to
alter DEPTH_TEXTURE_MODE. Make that our precompile guess.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.cpp
f3d0daf7ea7e42ff9ce11e8bd6fba1059a2406e8 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Index sampler program key data by linker-assigned index.

Now that most things are based on the linker-assigned index, it makes
sense to convert the arrays in the VS/WM program key as well. It seems
silly to leave them indexed by texture unit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_visitor.cpp
esa/drivers/dri/i965/brw_program.h
esa/drivers/dri/i965/brw_vec4_visitor.cpp
esa/drivers/dri/i965/brw_wm.c
ab17762c70852ca8fc400d7b5c6696d412ff2afe 14-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Only set proj_attrib_mask for fixed function.

brw_wm_prog_key's proj_attrib_mask field is designed to enable an
optimization for fixed-function programs, letting us avoid projecting
attributes where the divisor is 1.0.

However, for shaders, this is not useful, and is pretty much impossible
to guess when building the FS precompile key. Turning it off for
shaders should allow the precompile to work and not lose much.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Suggested-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_wm.c
6cc14c2493bb6957f2581671020809e90a8d8643 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Don't set stats_wm in the WM program key on Gen6+.

It's only needed for Gen4/5 IZ lookup workarounds.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_wm.c
b6b1fc1261e86e2aa03ae8d2dd587c88a207354f 14-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Don't set vp_outputs_written in the WM program key on Gen6+.

It's only used by on pre-Sandybridge hardware.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_wm.c
87cdefed405da1a57a006737297d20ba0c25fa1b 26-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Double the size of the state cache.

We probably want to do something more sophisticated here, but this at
least makes it through L4D2 without dumping the program cache.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_state_cache.c
ac889b24109ba0aec4f8c7f103d3c23e78c11a29 20-Jul-2012 Julien Cristau <julien.cristau@logilab.fr> glapi/glx: call __glEmptyImage if USE_XCB, not memcpy directly

We were stomping on the caller's buffer by ignoring their alignment
requests and other pixel store modes. This patch makes the USE_XCB path match
the older one more closely.

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

Signed-off-by: Julien Cristau <julien.cristau@logilab.fr>
Signed-off-by: Brian Paul <brianp@vmware.com>
api/glapi/gen/glX_proto_send.py
f308c804905ef7f2a976397c8d48a295d8f6853c 27-Aug-2012 Brian Paul <brianp@vmware.com> gallium/util: implement tile code for PIPE_FORMAT_Z32_FLOAT

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/auxiliary/util/u_tile.c
a971476cc7913edde1944f33f164cd507199e1dd 27-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: use fallback path for glCopyTexSubImage(GL_TEXTURE_1D_ARRAY)

Fixes many failing cases in piglit copyteximage test.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_cb_texture.c
88edbdf9f0c79e05593a71929f791fa4efb08ffb 14-Aug-2012 Chad Versace <chad.versace@linux.intel.com> i965: Move hiz resolve to after renderbuffer resizing (v2)

Do all pre-draw hiz resolves *after* the renderbuffers are resized by
intel_prepare_render. Otherwise, we may resolve buffers that are
immediately discarded afterwards.

Fixes the assertion failure below when resizing windows in KDE and under
some unknown circumstance in Chrome OS:
intel_resolve_map.c:46: intel_resolve_map_set: Assertion
`(*tail)->need == need' failed.

Also, remove the comment that "resolves must occur [...] before setting up
any hardware state". That was true when resolves were implemented with
meta-ops, but no longer with blorp.

v2:
- Keep brw_predraw_resolve_buffers in its current position, which is
before any brw_context bits are modified. Instead, move the call to
intel_prepare_render.

Note: This is a candiate for the 8.0 branch.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52252
Reported-by: Lu Hua <huax.lu@intel.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_draw.c
a2a7e640a4e81c906e42a98602c84757c37ed0b1 14-Aug-2012 Chad Versace <chad.versace@linux.intel.com> i965: Remove redundant null check

intel_renderbuffer_resolve_hiz checks if rb->mt is null, so there is no
need for the caller to do so.

Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_draw.c
7f0fcf17c342dcb788c2182b20973c48806ee498 27-Aug-2012 Marek Olšák <maraeo@gmail.com> r300g: implement TRUNC correctly

This fixes some integer division tests.
allium/drivers/r300/compiler/radeon_opcodes.c
allium/drivers/r300/compiler/radeon_opcodes.h
allium/drivers/r300/compiler/radeon_program_alu.c
allium/drivers/r300/r300_tgsi_to_rc.c
f402acdbe244e5de9b2b616e0a908f5d1416ce89 22-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Use FP16 shader export format when necessary / possible.

Fixes piglit fbo-blending-formats.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeon/SIInstructions.td
allium/drivers/radeon/SIIntrinsics.td
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/radeonsi_shader.c
allium/drivers/radeonsi/si_state.c
allium/drivers/radeonsi/si_state_draw.c
26c7139d2c594edbe33cbbd5f786988a529389c8 24-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Refactor initialization of shader export intrinsic arguments.

In preparation for extending this code, which would make it rather unwieldy in
its current place.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_shader.c
d1e40b3d40b2e90ad4f275565f1ae27fe6f964cc 23-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Maintain cache of pixel shader variants according to contxt state.

Mostly inspired by r600g commit 4acf71f01ea1edb253cd38cc059d4af1a2a40bf4
('r600g: cache shader variants instead of rebuilding v3').

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/radeonsi_shader.c
allium/drivers/radeonsi/radeonsi_shader.h
allium/drivers/radeonsi/si_state.c
allium/drivers/radeonsi/si_state.h
allium/drivers/radeonsi/si_state_draw.c
84fdda280f4361add3802476ce9a30ac1c0b4c69 23-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Drop extraneous semicolons from pm4 state macro definitions.

Could cause build failures if trying to use the macros in certain constructs.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/si_state.h
a3d9d7ec79d6f7205fab2324e47d8ea185431de0 12-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement compression for MSAA colorbuffers for evergreen

This adds the FMASK and CMASK buffers. They share the same resource
with color data.

COMPRESSION and FAST_CLEAR are always enabled if both FMASK and CMASK are
allocated. We initialize the CMASK to a "compressed" state (not "fast cleared"),
so that we can keep FAST_CLEAR enabled all the time.

Both FMASK and CMASK must be present at the moment. If either one is missing,
the other one is not used.

v2: add cayman regs in the list

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r600/evergreen_hw_context.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/evergreend.h
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
allium/drivers/r600/r600_texture.c
48edfe0505ee79d35f770f53b9c9b7ca3c69fd2b 13-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: cleanup names around depth decompression

for consistency with the upcoming color decompression naming

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state_common.c
allium/drivers/r600/r600_texture.c
3ac54ac2c85d3ed035a9f1cbcc7de7010c609cfb 23-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fix evergreen 8x MSAA sample positions

The original samples positions took samples outside of the pixel boundary,
leading to dark pixels on the edge of the colorbuffer, among other things.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/evergreen_state.c
1cfec6e2c8f15b2448e0297f4ca975ed7ab0c505 19-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: set CB_TARGET_MASK to 0xf and not 0xff for resolve on evergreen

independent_blend_enable must be true, so that the colormask isn't replicated
in all colorbuffers.

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/evergreen_state.c
1516a4f3538b3b1720d0f5c771fbdcd52b34b9f9 18-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: initialize sample mask in resolve

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
allium/auxiliary/util/u_blitter.c
07c71d6ede4f2ad62bcaab8d3f84452485979e2e 24-Jun-2012 Tom Stellard <thomas.stellard@amd.com> r300/compiler: Use variable lists in the rename_regs pass
allium/drivers/r300/compiler/radeon_rename_regs.c
7540f25a345ed8d35d97ba4fbf66227a281eff6a 23-Aug-2012 Eric Anholt <eric@anholt.net> i965: Rewrite the comment describing the query object support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_queryobj.c
f0159018d7709b57d9916575512d75cb3f2fb395 18-Jul-2012 Eric Anholt <eric@anholt.net> i965/gen6+: Add support for GL_ARB_timer_query.

Needs updated libdrm.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_context.c
esa/drivers/dri/i965/brw_queryobj.c
esa/drivers/dri/intel/intel_extensions.c
esa/drivers/dri/intel/intel_reg.h
9a2943ddf28eee417b692d9338b81aa89a51dea8 23-Aug-2012 Eric Anholt <eric@anholt.net> i965: Add support for GL_ARB_occlusion_query2.

This extension is just a bit of core code on top of the GL_ARB_occlusion_query
support.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_extensions.c
b765119c5d2cd41a7f47cce10fd1fdbcf162b03d 23-Aug-2012 Eric Anholt <eric@anholt.net> mesa: Add constants for the GL_QUERY_COUNTER_BITS per target.

Drivers need to be able to communicate their actual number of bits populated
in the field in order for applications to be able to properly handle rollover.

There's a small behavior change here: Instead of reporting the
GL_SAMPLES_PASSED bits for GL_ANY_SAMPLES_PASSED (which would also be valid),
just return 1, because more bits don't make any sense.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/mtypes.h
esa/main/queryobj.c
6754ec831e5aaec516db929c8db6e7478a2f5540 13-Aug-2012 Eric Anholt <eric@anholt.net> i965: Fix accumulator_contains() test to also reject swizzles of the dst.

When faced with this sequence:

MOV R1, c[1];
MAD R0, R2, R1.x, R1.y;

we were concluding that the MOV of R1 set up our accumulator and so we could
just use the previous result. Only, it's got R1.xyzw in it instead of the
r1.y we're looking for.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46784
NOTE: This is a candidate for the 8.0 branch.
esa/drivers/dri/i965/brw_vs_emit.c
33ee019422558d50033e02754d0a2a19ed9bf737 15-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> st/dri: Support width and height getters

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
allium/state_trackers/dri/drm/dri2.c
15effe1fabe9e47e680f9f9c12ea6b61acf97cd5 21-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> st/dri: Claim to support validate_usage

Support version 3 as well as 2, since that is only the new format query,
which Jesse added support for to st/dri when he added it to dri_inteface.h.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
allium/state_trackers/dri/drm/dri2.c
93ebec87ed46978942464a6f08801ae06e86fa8b 21-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> dri: Make query image WIDTH and HEIGHT be version 4

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
bm/backends/dri/gbm_dri.c
6bb71b8cbe6b17a5d59e369631502e642804406e 15-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> dri: Remove image write function

Since its not used by anything anymore and no release has gone out
where it was being used.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
bm/backends/dri/gbm_dri.c
esa/drivers/dri/intel/intel_regions.h
esa/drivers/dri/intel/intel_screen.c
a669a5055eadae85ffa000cea19a2241d0699348 13-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> gbm: Use libkms to replace DRI cursor images

Uses libkms instead of dri image cursor. Since this is the only user of the
DRI cursor and write interface we can remove cursor surfaces entirely from
the DRI interface and as a consequence also from the Gallium interface as
well. Tho to make everybody happy with this it would probably should add a
kms_bo_write function, but that is probably wise in anyways.

The only downside is that it adds a dependancy on libkms, this could how ever
be replaced with the dumb_bo drm ioctl interface.

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
gl/drivers/dri2/Makefile.am
bm/Makefile.am
bm/backends/dri/gbm_dri.c
bm/backends/dri/gbm_driint.h
a3685544e1e88828c4931059686cf3acc199079c 14-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Don't set iz_lookup the FS precompile's program key on Gen6+.

We already changed the actual program key builder to only set these bits
on gen < 6; this patch just brings the precompile state back in line so
it doesn't mismatch every time.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.cpp
98211d5af7efa26c350f6191457ab2564847abde 16-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Fix INTEL_DEBUG=perf program key printing.

When dumping differences in program keys, it printed messages of the
format:

[Name of thing that changed] [new]->[old]

This was terribly confusing: the right arrow implies "the value changed
from this to that", when in fact the message conveyed the opposite.

Except that some of the time, it didn't, since we accidentally swapped
the arguments to brw_debug_recompile_sampler_key. With two swaps, it
would often come out in the expected format.

This patch fixes it to properly print:

[Name of thing that changed] [old]->[new]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_wm.c
174d44a9c4d39a030fe3528acf07f9ac9aa617a1 22-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Use a new, more specific hook for shader uniform changes.

Gallium drivers and i965 don't require special notification when
sampler uniforms change. They simply see the _NEW_TEXTURE and adjust
their indirection tables. These drivers don't want ProgramStringNotify:
it simply causes pointless recompiles.

Unfortunately, i915 still requires shader recompiles and needs
ProgramStringNotify. Rather than trying to fix that, simply change the
hook to a new, more specific one: ShaderUniformChange. On i915, this
translates to ProgramStringNotify; others simply ignore it.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i915/i915_fragprog.c
esa/main/dd.h
esa/main/ff_fragment_shader.cpp
esa/main/uniform_query.cpp
85e8e9e000732908b259a7e2cbc1724a1be2d447 24-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Use linker-assigned sampler IDs in instruction encoding.

When assigning uniform locations, the linker assigns each sampler
uniform a sequential numerical ID. gl_shader_program::SamplerUnits maps
these sampler variable IDs to the actual texture units they reference
(specified via glUniform1i).

Previously, we encoded this mapping in the SEND instruction encoding:
the "sampler" was the texture unit number, and the binding table index
was SURF_INDEX_TEXTURE(the texture unit number). This unfortunately
meant that whenever the application changed the value of a sampler
uniform, we had to recompile the shader to change the SEND instructions.

This was horrible for the game Cogs, which repeatedly switches between
using texture unit 0 and 1. It also made fragment shader precompiles
useless: we'd do the precompile at glLinkShader() time, before the
application called glUniform1i to set the sampler values. As soon as
it did that, we'd have to recompile, wasting time and space in the
program cache.

This patch encodes the SamplerUnits indirection in the binding table,
sampler state, and sampler default color tables. Instead of baking the
texture unit number into the shader, we bake in the sampler variable ID
assigned by the linker. Since those never change, we don't need to
recompile programs on uniform changes.

This does mean that the tables now depend on the linked shader program
being used for rendering, rather than simply representing all available
texture units. This could cause an increase in state emission.

Another plus is that the sampler state and sampler default color tables
are now compact: we only emit as many entries as there are sampler
uniforms, with no holes in the table since the new sampler IDs are
sequential. Previously we had to emit a full 16 entries every time,
since the tables tracked the state of all active texture units.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs_visitor.cpp
esa/drivers/dri/i965/brw_vec4_visitor.cpp
esa/drivers/dri/i965/brw_wm_sampler_state.c
esa/drivers/dri/i965/brw_wm_surface_state.c
esa/drivers/dri/i965/gen7_sampler_state.c
2faa592e7f54ef21b799b61ffa50c6bc8039ddc1 24-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Add a "sampler state index" parameter to update_sampler_state().

This represents the index into the sampler state table or sampler
default color table (the two are identical).

Right now, this is still the texture unit, but that will change shortly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_wm_sampler_state.c
esa/drivers/dri/i965/gen7_sampler_state.c
28fab4295e9631ca91c5ebdf26d1bee23011d57e 15-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Un-hardcode WM binding table from update_texture_surface.

Currently, we mirror the VS and WM binding tables' texture entries.
That may not continue to be true, so in preparation, pass in the binding
table and surface index as arguments.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_wm_surface_state.c
esa/drivers/dri/i965/gen7_wm_surface_state.c
esa/drivers/dri/intel/intel_context.h
96a22f35830859c938901ecbb4817aa8e1a9dff9 21-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Rename "sampler" to "texunit" in texturing code.

The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms. Calling it
"texunit" clarifies this slightly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vec4_visitor.cpp
0ad2dce24aa0475e607e3c58b8aa50057412c6ef 21-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Rename "sampler" to "texunit" in texturing code.

The number we're passing around is actually the ID of the texture unit,
as opposed to the numerical value our of sampler uniforms. Calling it
"texunit" clarifies this slightly.

Don't bother renaming fs_instruction::sampler. Although it's currently
the texture unit, this series will change that. No need for the churn.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs_visitor.cpp
bf0308d8d6fbc842d0120060e65a3fe445f5b2fb 21-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Remove unused 'sampler' parameter in emit_texture_genX().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_visitor.cpp
76d1301e8e8e50dc962601a9977bc52148798349 14-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Set SWIZZLE_NOOP for unused texture units in the program keys.

Previously, we left the swizzle key field as zero for unused texture
units. The precompile sets all of them to SWIZZLE_NOOP, which meant
that we mismatched almost every time.

Since either works equally well, change it to SWIZZLE_NOOP to match
the precompiles.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_wm.c
f510dd5d60401ee44512ba7ae4ded3b32b19f12d 22-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Remove four and a half year old TODO comments about samplers.

I can't actually understand what these mean, and they seem to
essentially say "we should simplify things", which is a nice goal but
not very specific.

Presumably things got cleaned up at some point.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_wm_sampler_state.c
esa/drivers/dri/i965/gen7_sampler_state.c
d1447f5bc92e6bcbc9180e606cdfef9540678918 21-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Fix brw_link_shader to return false rather than NULL.

Fixes brw_shader.cpp:101:9: warning: converting to non-pointer type
'GLboolean {aka unsigned char}' from NULL [-Wconversion-null]

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-with-great-enthusiasm-by: Paul Berry <stereotype441@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_shader.cpp
f9767dac9a06aad93a9d61d108055ad673498bf8 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetBufferParameteriv pname in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/bufferobj.c
93d109645a2b3d43b4b0106f2b496ece11970c01 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glMapBuffer access in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

v3: *Really* add proper core-profile and GLES3 filtering based on review
feedback from Eric Anholt. It looks like previously there was some
rebase / merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/bufferobj.c
bd4e5dd3553c5d7152af419f8b12ce228aba2dd2 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glBufferData usage in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering based on review feedback
from Eric Anholt. It looks like previously there was some rebase /
merge fail.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/bufferobj.c
b0b6b76d5213587250c567d7ca62451813a10366 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate buffer object targets in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/main/APIspec.xml
esa/main/bufferobj.c
e2cf14d7b273657cce364236cd041c4ca3f94a6b 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate VertexPointer types in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
ef723ecce42c1823e5a9eb3b9e25be9bd9d66208 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant vertex pointer size validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
a8f475d8f6b56ddec36634437d007e06b48ff1cd 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate TexCoordPointer size in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
c3e9a207d0cb650045304cac559958d275a63284 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate TexCoordPointer types in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
e5ef0cbe0e4e45df6ff74a2a40ddb83d8bc3a8cc 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate NormalPointer types in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
fb8218508a9b5cfe9e14830f9590df889e5b8785 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate ColorPointer size in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
07ccfef8d175f6c4b408ee48f7da210975a09fb9 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate ColorPointer types in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
esa/main/varray.c
28ee443d7baea642e267e49c8e74850ecce22a3e 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant vertex attrib pointer type validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
ae633d0b2e1ef85191027aca6987557091345fc1 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant vertex attrib pointer size validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/APIspec.xml
946ddec163b9360be44e7db04ce67a2165daa3b7 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Disallow BGRA vertex arrays in ES or ES2 contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/varray.c
bbceed268e14593a07a7cc08060ffd20f2718718 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Rearrange array type checking, filter more types in ES

v2: Fix handling of GL_INT and GL_UNSIGNED_INT types pre-ES3.0, and fix
handling of GL_INT_2_10_10_10_REV and GL_UNSIGNED_INT_2_10_10_10_REV in
ES3.0. Based on review comments by Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/varray.c
a33f360e8f8138c5b37b5e33324283e764d0750c 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor element type checking into its own function

This consolidates the tests and makes the emitted error message
consistent.

v2: Rename _mesa_valid_element_type to valid_elements_type. Log the
enum string instead of the hex value in error messages. Based on review
comments from Brian Paul and Ken Graunke.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/api_validate.c
229868edf7f4232a4d97867a2ccea12db4c8cf57 24-Aug-2012 Brian Paul <brianp@vmware.com> wgl: update some comments
allium/state_trackers/wgl/stw_framebuffer.h
allium/state_trackers/wgl/stw_winsys.h
4b7c0938e43dcc534fa2fbba012e12dbbf4aefd6 24-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: don't do (generic) compression of 1D or 1D_ARRAY textures

As with the previous commit for core Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
esa/state_tracker/st_format.c
a3af27e99362c0da9f467a39427d32d1270a720f 24-Aug-2012 Brian Paul <brianp@vmware.com> mesa: add generic compressed -> uncompressed format helper

_mesa_generic_compressed_format_to_uncompressed_format() probably wins the
prize for longest function name in Mesa.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
esa/main/glformats.c
esa/main/glformats.h
13d0bb21a9ba04424019df25d6757e77304a1f9a 24-Aug-2012 Brian Paul <brianp@vmware.com> mesa: don't try (generic) compression of 1D and 1D_ARRAY textures

See comments in the code for details.

Note: we only need to special-case the generic compressed formats since
specific texture formats are error-checked earlier to see if the compression
format is compatible with the texture type.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
esa/main/texformat.c
d47a6ada9ca9670c60fc141fabadf40c63031c08 24-Aug-2012 Brian Paul <brianp@vmware.com> mesa: add texture target field to ChooseTextureFormat() driver hook

This will let us choose the actual hardware format depending on the
type of texture.

v2: fixup radeon, nouveau, intel and swrast drivers too

Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/nouveau/nouveau_texture.c
esa/drivers/dri/radeon/radeon_texture.c
esa/drivers/dri/radeon/radeon_texture.h
esa/drivers/dri/swrast/swrast.c
esa/main/dd.h
esa/main/texformat.c
esa/main/texformat.h
esa/main/teximage.c
esa/main/texobj.c
esa/state_tracker/st_format.c
esa/state_tracker/st_format.h
esa/state_tracker/st_manager.c
ba7218061b6a6c09d5d20f12de6267673276e094 24-Aug-2012 Brian Paul <brianp@vmware.com> xlib: remove texture compression hackery

I think this was left-over debug code from long ago.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/x11/xm_api.c
esa/drivers/x11/xm_dd.c
esa/drivers/x11/xmesaP.h
09fafd3b856109ad4b24ac082ccf436022a1701c 24-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: clean up use of 'target' variable in st_context_teximage()

'target' was used both as a parameter of type st_texture_type and then
re-used for GL_TEXTURE_x targets. Rename the function parameter and
add a new local 'GLenum target'.

And remove an extraneous break statement.
esa/state_tracker/st_manager.c
261719b21c3dab4e2c0b79bbe148f494667da67c 23-Aug-2012 Matt Turner <mattst88@gmail.com> automake: convert vgapi
api/vgapi/.gitignore
api/vgapi/Makefile
api/vgapi/Makefile.am
api/vgapi/vg.pc.in
179d8aa3317eaadcdfe73a2fcd1894612b7380d0 22-Aug-2012 Matt Turner <mattst88@gmail.com> Move _mesa_dl* functions into dlopen.h and inline them

No point in having an extra function call for inlinable functions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
esa/SConscript
esa/main/dlopen.c
esa/main/dlopen.h
esa/sources.mak
57c57df7b4579b60a84062df2e64f84dd84558b5 16-Aug-2012 Tapani Pälli <tapani.palli@intel.com> mesa/dlopen: use HAVE_DLOPEN instead of _GNU_SOURCE

Patches changes mesa to use 'HAVE_DLOPEN' defined by configure and Android.mk
instead of _GNU_SOURCE for detecting dlopen capability. This makes dlopen to
work also on Android where _GNU_SOURCE is not defined.

[mattst88] v2: HAVE_DLOPEN is sufficient for including dlfcn.h, remove
mingw/blrts checks around dlfcn.h inclusion.

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
esa/main/dlopen.c
df4dccc7a9691555e05c8945048603621340b5d7 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Only add links to .so files if we're building them

Xlib-GLX and OSMesa support static building.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=53962
esa/drivers/osmesa/Makefile.am
esa/drivers/x11/Makefile.am
c56b57f4a124b218aec21e6a53cd6b5ae1718054 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Add libOSMesa.so.$(VERSION) link to libdir
esa/drivers/osmesa/Makefile.am
a8fd8cb9e7840c508d20466ff6e7c04bdc09d3bf 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Replace OSMESA_VERSION with generic VERSION_NUMBER

Can be used by other modules.
esa/drivers/osmesa/Makefile.am
8cdce6c136799aa75310086c078d8cd5f19b84ce 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Only build libmesa.la when needed

Namely, for Xlib-GLX, OSMesa, or test programs.
esa/Makefile.am
00f3d9b11acd366329c347e4797b8af3437fcfe6 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Remove duplicate DRI automake conditionals
esa/libdricore/Makefile.am
d23b1b79777828848656e350a19ec3031205e9fc 20-Aug-2012 Matt Turner <mattst88@gmail.com> build: Remove GLU_DIRS
lu/Makefile
0abb26ebff45bcbb82c094591079b6b70c4720bd 22-Aug-2012 Matt Turner <mattst88@gmail.com> build: Only generate dispatch assembly code that will be built
api/glapi/gen/Makefile.am
5133bd6585552a5708b294180fa9a561bf7564a6 22-Aug-2012 Paul Berry <stereotype441@gmail.com> i965: don't clear resolve map when doing fast depth clears.

Previously, when performing a fast depth clear, we would also clear
the miptree's resolve map. This destroyed important information,
since the resolve map contains information about needed resolves for
all levels and layers of the miptree, whereas a depth clear only
applies to a single level/layer combination at a time. As a result,
resolves would sometimes fail to occur, leading to incorrect
rendering.

Fixes rendering artifacts with shadow maps in Unigine Heaven and
Unigine Sanctuary.

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

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_clear.c
4b8b6f385e855ecb6da0b7dea56e70e69d1517b9 22-Aug-2012 Paul Berry <stereotype441@gmail.com> i965/HiZ: remove assertion from intel_resolve_map_set().

There are three possible resolve map states for each (level, layer) of
a depth miptree: "needs HiZ resolve", "needs depth resolve", and
"needs neither". When HiZ was first implemented on i965, any attempt
to directly transition between "needs HiZ resolve" and "needs depth
resolve" without passing through the "needs neither" state would have
been a bug indicating that a necessary resolve hadn't been performed.
Accordingly, intel_resolve_map_set() contained an assertion to verify
that no such direct transition happened.

However, now that we support fast depth clears, there is a valid
transition from the "needs HiZ resolve" to the "needs depth resolve"
state. When doing a fast depth clear, the old state of the buffer is
irrelevant, since we are completely replacing it with the clear value,
so it is not necessary to do any resolves before clearing--we can
transition, if necessary, directly from the "needs HiZ resolve" state
to the "needs depth resolve" state.

To avoid spurious assertions in this valid case, this patch just
removes the assertion.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_resolve_map.c
9aacd5cc67ccbc3984bce6a0b40768a6cec2ec2d 23-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: remove old tilling handling

Just use the functionality provided by the surface manager instead.

This fixes just another bunch of piglit tests.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
allium/drivers/radeonsi/r600_resource.h
allium/drivers/radeonsi/r600_texture.c
allium/drivers/radeonsi/si_state.c
86f29cf7d0817f1b6c9a9665c044ce36822b23b4 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glCreateShader targets in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/APIspec.xml
esa/main/shaderapi.c
b042f7a1ff905a7136557f35f368166526fab9ed 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetProgramiv pnames in Mesa code rather than the ES wrapper

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/APIspec.xml
esa/main/shaderapi.c
1a200b68cd57e2aee419e45ac8f1ce32e5cf8951 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Filter glGetProgramiv pnames based on available extensions

Previously you could always glGetProgramiv one of the transform feedback
or geometry shader enums even if the extension wasn't supported.

In addtion, this reverts part of bda6ad27. I think the hunks involving
GL_PROGRAM_BINARY_LENGTH_OES were spurious. Mesa has no support for any
other part of GL_OES_get_program_binary.

v2: Remove redundant return in get_programiv based on review feedback
from Matt Turner.

v3: Correctly handle UBO related enums.

v4: Emit the bad enum in the _mesa_error call based on review feedback
from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/shaderapi.c
9282ebbaa5fdb4bc1d6234d746acac525660185d 24-Aug-2012 Brian Paul <brianp@vmware.com> swrast: implement cubical depth texture sampling

Fixes a few more failures in the piglit copyteximage test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/swrast/s_texfilter.c
87280d56a375fcfc9231e72963439f9a370c408a 23-Aug-2012 Blaž Tomažič <blaz.tomazic@gmail.com> clover: Accept CL_MEM_READ_WRITE flag

Fix API functions for memory objects to accept CL_MEM_READ_WRITE flag.

Signed-off-by: Blaž Tomažič <blaz.tomazic@gmail.com>
[ Francisco Jerez: Drop incorrect change in clCreateSubBuffer. ]
allium/state_trackers/clover/api/memory.cpp
167ecf5ba358f750aecb07439ef5110e72895f25 24-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Cleanup R600Instructions.td
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600Instructions.td
388af5b6f43fc81d7a9423a42358bcea65ab8ba9 24-Aug-2012 Brian Paul <brianp@vmware.com> main: fix ES compile breakage
esa/main/teximage.c
4fec5e9154582439bc185eb143e89f220b169c32 23-Aug-2012 Brian Paul <brianp@vmware.com> mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for dxt formats

As with the previous commit.

This fixes the last crash in the piglit copyteximage test but there's
still some failures.
esa/main/texcompress.c
esa/main/texcompress_s3tc.c
esa/main/texcompress_s3tc.h
esa/swrast/s_texfetch.c
d78b44c2651b45c337dda71b17351beb41eb9c14 23-Aug-2012 Brian Paul <brianp@vmware.com> mesa/swrast: fix GL_TEXTURE_2D_ARRAY texture fetches for latc/rgtc formats

Fix-up the texel fetch functions so that they handle 3D coords (as used for
array textures) and remove the "f_2d" part from their names.

Helps fix swrast crashes in piglit's copyteximage test. More to come.
esa/main/texcompress.c
esa/main/texcompress_rgtc.c
esa/main/texcompress_rgtc.h
esa/swrast/s_texfetch.c
fe2cc65fbb37bca40ff215a3709dacbcd317350c 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: code movement in teximage.c

To get rid of a forward declaration.
esa/main/teximage.c
bdff1dfb398afdc187787b70bb62511ae1edd4ee 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: consolidate glTexImage and glCompressedTexImage code

There was a lot of similar or duplicated code before.
To minimize this patch's size, use a forward declaration for
compressed_texture_error_check(). Move the function in the next patch.
esa/main/teximage.c
e93cb4b34fed27eccf291963b5fe2c26cea46251 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: make glTexImage, glCompressedTexImage proxy code more alike

Next up, we can combine the teximage() and compressed_teximage() functions.
esa/main/teximage.c
c1a9e6010baceeff78f72ac0692aefc4312d815f 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: rename texpal.[ch] to texcompress_cpal.[ch]

To be consistent with other files related to texture compression.
esa/SConscript
esa/main/texcompress_cpal.c
esa/main/texcompress_cpal.h
esa/main/teximage.c
esa/main/texpal.c
esa/main/texpal.h
esa/sources.mak
aab06dc0f0bf295abe213021b79ff65d70a4f4c0 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: s/GLuint/gl_format/ in _mesa_compressed_format_to_glenum()

No real change here, just use the right type.
esa/main/texcompress.c
esa/main/texcompress.h
46751edca9a95baff81771aa69986fa6e2422ed6 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: new _mesa_num_tex_faces() helper

Not a real big help now, but will be useful for the
GL_ARB_texture_cube_map_array extension in the future.
esa/drivers/dri/intel/intel_tex.c
esa/drivers/dri/intel/intel_tex_validate.c
esa/drivers/dri/radeon/radeon_mipmap_tree.c
esa/drivers/dri/radeon/radeon_texture.c
esa/main/mipmap.c
esa/main/texobj.c
esa/main/texobj.h
esa/main/texstorage.c
esa/state_tracker/st_cb_texture.c
esa/swrast/s_texture.c
8a935d71ff4ded6f3cdd8e06dcd1a5e3de3d3cc0 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: make _mesa_get_proxy_tex_image() static

It's not used by any other file.
esa/main/teximage.c
esa/main/teximage.h
637a79aa2381e363d6b94c0bb5692a1882e9c945 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: don't clear proxy image fields when regular GL error is generated

If a proxy texture call generates a regular GL error, we should not
clear the proxy image's width/height/depth/format fields. Use a new
PROXY_ERROR token to distinguish proxy errors from regular GL errors.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
esa/main/teximage.c
1f5b1f98468d5e80be39e619ed15c422fbede8d3 22-Aug-2012 Brian Paul <brianp@vmware.com> mesa: fix glTexImage proxy texture error generation

When calling glTexImage() with a proxy target most error conditions should
generate a GL error. We were erroneously doing the proxy-error behaviour
(where we zeroed-out the image's width/height/depth/format fields) in too
many places.

There's another issue with proxy textures, but that'll be fixed in the
next patch.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
esa/main/teximage.c
3e3f99277df947a96029580dc4e66ae38a93f004 24-Aug-2012 José Fonseca <jfonseca@vmware.com> draw: Fix regression in draw_set_sampler(_views).

draw->samplers(_views) now has PIPE_SHADER_TYPES elements, instead of
PIPE_MAX_SAMPLERS as before.

Also, shader_stage must be less than PIPE_SHADER_TYPES to prevent buffer
overflow.

Trivial.
allium/auxiliary/draw/draw_context.c
e84d45fdb73687019a6798cfb37b01291b212f4d 24-Aug-2012 Vadim Girlin <vadimgirlin@gmail.com> build: don't leave git_sha1.h.tmp after build/install

Fixes "`main/git_sha1.h.tmp': Permission denied" build error.
See https://bugs.freedesktop.org/show_bug.cgi?id=52064

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/Makefile.am
1434a86f50e4ffc69316c7e948ebfe56a25d31da 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Set End of Program bit on RAT instructions

This code was accidently dropped during the MCCodeEmitter conversion.
allium/drivers/radeon/MCTargetDesc/R600MCCodeEmitter.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600Instructions.td
1bd7b29a661a336dbc96c160197c739657991ef3 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Use correct instruction for moving immediates

This should fix an assertion failure that was happening in some compute
shaders.
allium/drivers/radeon/R600ISelLowering.cpp
2ad8608cb3e6a8d2f375ad2295504167b082711f 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Fix some coding style issues
allium/drivers/radeon/AMDGPUAsmPrinter.cpp
allium/drivers/radeon/AMDGPUAsmPrinter.h
allium/drivers/radeon/AMDGPUMCInstLower.cpp
allium/drivers/radeon/AMDGPUMCInstLower.h
allium/drivers/radeon/AMDGPUSubtarget.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCAsmInfo.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCTargetDesc.cpp
allium/drivers/radeon/MCTargetDesc/R600MCCodeEmitter.cpp
allium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
allium/drivers/radeon/R600KernelParameters.cpp
228a6641ccddaf24a993f827af1e97379785985a 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Pull changes from external version of the backend
allium/drivers/radeon/AMDGPUISelLowering.h
allium/drivers/radeon/AMDIL7XXDevice.cpp
allium/drivers/radeon/AMDIL7XXDevice.h
allium/drivers/radeon/AMDILDevice.h
allium/drivers/radeon/AMDILEvergreenDevice.cpp
allium/drivers/radeon/AMDILEvergreenDevice.h
allium/drivers/radeon/AMDILIntrinsicInfo.cpp
allium/drivers/radeon/AMDILIntrinsicInfo.h
allium/drivers/radeon/MCTargetDesc/AMDGPUAsmBackend.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCAsmInfo.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCAsmInfo.h
allium/drivers/radeon/MCTargetDesc/AMDGPUMCTargetDesc.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCTargetDesc.h
allium/drivers/radeon/MCTargetDesc/AMDILMCAsmInfo.cpp
allium/drivers/radeon/MCTargetDesc/AMDILMCAsmInfo.h
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.cpp
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.h
allium/drivers/radeon/MCTargetDesc/R600MCCodeEmitter.cpp
allium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp
allium/drivers/radeon/Makefile.sources
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600RegisterInfo.cpp
allium/drivers/radeon/SIAssignInterpRegs.cpp
allium/drivers/radeon/SIRegisterInfo.cpp
allium/drivers/radeon/TargetInfo/AMDGPUTargetInfo.cpp
allium/drivers/radeon/TargetInfo/AMDILTargetInfo.cpp
5a1edb8655aeab17bf0d90e202fb31a1adb53498 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Simplify the convert to ISA pass
allium/drivers/radeon/AMDGPUConvertToISA.cpp
allium/drivers/radeon/AMDGPUInstrInfo.cpp
allium/drivers/radeon/AMDGPUInstrInfo.h
cb5227b403a9c78a734e5e67657da6c485881cbb 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Make sure to use the Text section in the AsmPrinter
allium/drivers/radeon/AMDGPUAsmPrinter.cpp
68a2c510a6f8f62377dd745babe9d71ed4c192d3 23-Aug-2012 Matt Turner <mattst88@gmail.com> build: Fix installation of GLES2 headers

Reported-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
Tested-by: U. Artie Eoff <ullysses.a.eoff@intel.com>
api/es2api/Makefile.am
fc9ea7c74dc5cb996c3d9fe6663fd6da080e8360 23-Aug-2012 Matt Turner <mattst88@gmail.com> build: Fix GLES linkage with libglapi

Reported-by: Ian Romanick <idr@freedesktop.org>
api/es1api/Makefile.am
api/es2api/Makefile.am
e592f7df0361eb8b5c75944f0151c4e6b3f839dd 02-Aug-2012 Anuj Phogat <anuj.phogat@gmail.com> i965/msaa: Add sample-alpha-to-coverage support for multiple render targets

Render Target Write message should include source zero alpha value when
sample-alpha-to-coverage is enabled for an FBO with multiple render targets.
Source zero alpha value is used as fragment coverage for all the render
targets.

This patch makes piglit tests draw-buffers-alpha-to-coverage and
alpha-to-coverage-no-draw-buffer-zero to pass on Sandybridge. No
regressions are observed with piglit all.tests.

V2: Revert all the changes made in emit_color_write() function to
include src0 alpha for targets > 0. Now handling this case in a if
block.

V3: Correctly calculate the instruction length for buffer zero.
Properly handle the case of dual_src_blend when alpha-to-coverage
is enabled.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
esa/drivers/dri/i965/brw_fs_emit.cpp
esa/drivers/dri/i965/brw_fs_visitor.cpp
esa/drivers/dri/i965/brw_wm.c
esa/drivers/dri/i965/brw_wm.h
ff996cafce511dd8a6c4e066e409c23e147a670c 15-Aug-2012 Stéphane Marchesin <marcheu@chromium.org> glsl/linker: Avoid buffer over-run in parcel_out_uniform_storage::visit_field

When too may uniforms are used, the error will be caught in
check_resources (src/glsl/linker.cpp).

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Stéphane Marchesin <marcheu@chromium.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Tested-by: Benoit Jacob <bjacob@mozilla.com>
lsl/link_uniforms.cpp
9b028faeaa2c4b0ca2e86892aac70a2f2b872fbb 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glCompressedTexSubImage internalFormat in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
dd0eb004874645135b9aaac3ebbd0aaf274079ea 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glCompressedTexImage internalFormat in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/glformats.c
c11096e94a68ce0a1d7c9cda0f178ceca44ce25d 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glCopyTexImage internalFormat in Mesa code rather than the ES wrapper

v2: Add GLES3 filtering. I'm not 100% sure this is correct.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
9848e86af0c937a6f7609289ab2705c3535f378f 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexSubImage format and type in Mesa code rather than the ES wrapper

v2: Add proper GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
409620e47748479aaef593dc9bec0d6dd520e14a 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexImage format, type, and internalFormat in Mesa code rather than the ES wrapper

v2: Add proper GLES3 filtering.

v3: Collapse ALPHA, LUMINANCE, and LUMINANCE_ALPHA cases per review
comment from Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
esa/main/teximage.h
0686ccac950bac1a650400b29c47ddaafea22fa9 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexImage border in Mesa code rather than the ES wrapper

Also validate glCopyTexImage border. This fixes a bug in the APIspec.
Previously glTexImage3DOES could be passed a non-zero border without error.

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
59d965333c05534475b60042571366656b97ab9d 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Generate an error when glCopyTexImage border is invalid

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/teximage.c
2dcb40bb44a813295e3133bcec66c0de1e5f5a34 15-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Add support for GL_APPLE_texture_max_level

This is desktop OpenGL functionality that has always existed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/extensions.c
c9689e3e55928d4a95f1c10c7a33fffba8cbdece 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glGetTexParameter pnames in Mesa code rather than the ES wrapper

This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile and GLES3 filtering. GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts. A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/texparam.c
b3dd524a1082efd12d4a796122c300a61ba016d9 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexParameter pnames in Mesa code rather than the ES wrapper

This also adds a missing extension (and API) check around
GL_TEXTURE_CROP_RECT_OES.

v2: Add proper core-profile, GLES1, and GLES3 filtering. GL_TEXTURE_MAX_LEVEL
is (incorrectly) accepted in ES contexts. A future patch will add
GL_APPLE_texture_max_level, and meta really needs this.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texparam.c
4269cace7944b465860213acbaf82ffddb91efcb 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glBindTexture target validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
3f7c8364cf1d763f04413aecfac66df5534aeb34 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Filter glBindTexture targets based on supported features.

Fixed the piglit test arb_texture_buffer_object-negative-unsupported.

NOTE: This is a candidate for stable release branches.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/texobj.c
530c9d764b84035728a28ee2db996fffe49125ce 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate tex image targets in Mesa code rather than the ES wrapper

This should take care of all the TexImage, TexSubImage, CopyTexImage,
CompressedTexImage3DOES, and CopyTexSubImage type paths.

v2: Add proper core-profile and GLES3 filtering.

v3: Squash the CompressedTexImage3DOES patch per review comment from
Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
ea9b212fca78eada7cc7c4449de3f31d2ceea1c3 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate EGLImageTargetTexture2DOES target in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/teximage.c
a0595cb4506251509e032a2592d6bb684480de4b 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate glTexParameter targets in Mesa code rather than the ES wrapper

Ditto for glGetTexParameter targets.

v2: Add proper core-profile and GLES3 filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texparam.c
842efb9447bd4c8c29599f1baeee8a380d5276c2 03-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Validate GL_TEXTURE_WRAP param in Mesa code rather than the ES wrapper

v2: Add proper core-profile filtering.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
esa/main/texparam.c
d53101a9f31e1cba553c80dbafd23c748dd58a1d 03-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa: Refactor validate_texture_wrap_mode to use a switch-statement

This makes the next couple changes a little easier.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
esa/main/texparam.c
2abf555496b8f5a7319542756508dd2f2e8ed07c 23-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> meta: Don't modify GL_GENERATE_MIPMAP state when it doesn't exist

This is a bit of a hack. _mesa_meta_GenerateMipmap shouldn't even be
used in contexts where GL_GENERATE_MIPMAP doesn't exist (i.e., core
profile and ES2) because it uses fixed-function, and fixed-function
doesn't exist there either!

A GLSL-based _mesa_meta_GenerateMipmap should be available soon. When
that is available, this patch will be irrelevant and should be reverted.

v2: Change (ctx->API != API_OPENGLES2 && ctx->API != API_OPENGL_CORE) to
(ctx->API == API_OPENGL || ctx->API == API_OPENGLES) based on review
comment from Brian Paul.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/common/meta.c
2ddfca98378a1eb4044e8e9d7168d73443709068 17-Aug-2012 Tapani Pälli <tapani.palli@intel.com> build/glsl: fix android build v2

Commit 77a3efc6b907943903190b385fdf107c4acfcdca broke android build that
sets its own value for GLSL_SRCDIR before including Makefile.sources.
Patch moves overriding the value after include, this works as GLSL_SRCDIR
variable gets expanded only later.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
lsl/Android.mk
a6b8b709cdc280d3dc77cd9f78654726132d22bb 21-Aug-2012 Matt Turner <mattst88@gmail.com> automake: convert es1api
api/es1api/.gitignore
api/es1api/Makefile
api/es1api/Makefile.am
api/es1api/glesv1_cm.pc.in
0f8110cb0c782b179933da0b47649c3f8fe42328 21-Aug-2012 Matt Turner <mattst88@gmail.com> automake: convert es2api
api/es2api/.gitignore
api/es2api/Makefile
api/es2api/Makefile.am
api/es2api/glesv2.pc.in
api/glapi/gen/glapi_gen.mk
68d6441930fa19e2414a4c273ddce15e0c71de99 12-Apr-2012 Vadim Girlin <vadimgirlin@gmail.com> st/dri: pass config options to the state tracker

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
allium/state_trackers/dri/common/dri_context.c
a6457c0692f1bc292ae4120ff5cd0bed340271b9 12-Apr-2012 Vadim Girlin <vadimgirlin@gmail.com> st/mesa: accept and handle configuration options from st/dri

Currently there is a single option - force_glsl_extensions_warn.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
allium/include/state_tracker/st_api.h
esa/state_tracker/st_context.c
esa/state_tracker/st_context.h
esa/state_tracker/st_extensions.c
esa/state_tracker/st_manager.c
44f69fc82518d343733c77905cf9b9963fe102e4 12-Apr-2012 Vadim Girlin <vadimgirlin@gmail.com> st/dri: add force_glsl_extensions_warn option to dri options

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
allium/state_trackers/dri/common/dri_screen.c
e7c177ec9e37d0c406c3b0ef8f228159d7ee5d69 12-Apr-2012 Vadim Girlin <vadimgirlin@gmail.com> st/dri: use driver name for driconf section lookup

The name is taken from the driver_descriptor, so it will be the same as
expected by driconf utility.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
allium/state_trackers/dri/common/dri_context.c
6547733593f137e5e6e024a6084d4c04ca2abc34 22-Aug-2012 Vadim Girlin <vadimgirlin@gmail.com> swrast: add DRM_DRIVER_DESCRIPTOR to store driver name
allium/targets/dri-swrast/swrast_drm_api.c
b41f36bde778e6b11129f51de423b7c3aece26b4 17-Aug-2012 Paulo Alcantara <pcacjr@profusion.mobi> egl_dri2: Fix segmentation fault

The segmentation fault occurs when DRI2 is not loaded up and
dri2_setup_screen() function deferences dri2_dpy->dri2 (since it's NULL
at this point).

This patch fixes the segmentation fault by checking if dri2 pointer is
not NULL before deferencing it.

Signed-off-by: Paulo Alcantara <pcacjr@profusion.mobi>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Signed-off-by: Brian Paul <brianp@vmware.com>
gl/drivers/dri2/egl_dri2.c
90bd1d52bbf95947955a66ec67f5f6c7dc87119a 21-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Use the MCCodeEmitter for R600
allium/drivers/radeon/AMDGPU.h
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/AMDGPUMCInstLower.cpp
allium/drivers/radeon/AMDGPUTargetMachine.cpp
allium/drivers/radeon/AMDGPUTargetMachine.h
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.cpp
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.h
allium/drivers/radeon/MCTargetDesc/R600MCCodeEmitter.cpp
allium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp
allium/drivers/radeon/Makefile.sources
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600Defines.h
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
235318a578b3d7772a60590c7e76791ed6d1a78e 17-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Use the MCCodeEmitter for SI
allium/drivers/radeon/AMDGPUAsmPrinter.cpp
allium/drivers/radeon/AMDGPUAsmPrinter.h
allium/drivers/radeon/AMDGPUTargetMachine.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUAsmBackend.cpp
allium/drivers/radeon/MCTargetDesc/AMDGPUMCCodeEmitter.h
allium/drivers/radeon/MCTargetDesc/AMDILMCAsmInfo.cpp
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.cpp
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.h
allium/drivers/radeon/MCTargetDesc/SIMCCodeEmitter.cpp
allium/drivers/radeon/Makefile
allium/drivers/radeon/Makefile.sources
allium/drivers/radeon/SICodeEmitter.cpp
allium/drivers/radeon/SIInstrInfo.cpp
allium/drivers/radeon/SIInstrInfo.h
allium/drivers/radeon/radeon_llvm_emit.cpp
2de24024c1ca5366e76f449b115392a97808ef2d 17-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Set 64BitPtr feature bit for SI
allium/drivers/radeon/Processors.td
3f9b6aa0f467b8d918ce277697db2f42abe1cf4c 17-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Lower RETFLAG DAG Node to S_ENDPGM on SI
allium/drivers/radeon/AMDILInstrInfo.td
allium/drivers/radeon/R600Instructions.td
allium/drivers/radeon/SIInstructions.td
e30b4644b613a130318cdf240ad237b0afbc525a 17-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add AsmPrinter
allium/drivers/radeon/AMDGPUAsmPrinter.cpp
allium/drivers/radeon/AMDGPUAsmPrinter.h
allium/drivers/radeon/AMDGPUMCInstLower.cpp
allium/drivers/radeon/AMDGPUMCInstLower.h
allium/drivers/radeon/InstPrinter/AMDGPUInstPrinter.cpp
allium/drivers/radeon/InstPrinter/AMDGPUInstPrinter.h
allium/drivers/radeon/MCTargetDesc/AMDILMCTargetDesc.cpp
allium/drivers/radeon/Makefile.sources
e61c54cb6b220dea243568919a001e5dc7c01303 16-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Mark JUMP as a pseudo instruction
allium/drivers/radeon/R600Instructions.td
ead72204f1864008430189421663a5d07a02293b 23-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Remove the last uses of MachineOperand flags
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
67a47a445b544ac638d10303dc697d70f25d12fb 22-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add flag operand to some instructions

This new operand replaces the MachineOperand flags in LLVM, which
will be deprecated soon. Eventually all instructions should have a flag
operand, but for now this operand has only been added to instructions
that need it.
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
allium/drivers/radeon/R600Instructions.td
3a7a56e7aa56bc6cb847c241ef6bd749713ae6e1 21-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Encapsulate setting of MachineOperand flags

MachineOperand flags will be removed soon, so it is convienent to
have only one function that modifies them.
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
bfd7d6f58b47984853cf0831057e84a617de25ed 18-Aug-2012 Matt Turner <mattst88@gmail.com> build: Only build libmesagallium.la if building Gallium

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/Makefile.am
f9786394e5969593f9a0ea6e5653168197506523 18-Aug-2012 Matt Turner <mattst88@gmail.com> build: Clean glx Makefile.am

mapi/glapi is already built when make is run in src/glx.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lx/Makefile.am
625651cf813f2b18626f0d26e68e3a2935325b8d 17-Aug-2012 Matt Turner <mattst88@gmail.com> build/x11: Force usage of C++ linker

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/x11/Makefile.am
9049b7f0fa8689582437ad5413c100fdb607e37b 17-Aug-2012 Matt Turner <mattst88@gmail.com> build/x11: Don't link against shared-glapi

Tested-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/x11/Makefile.am
302c66ff813221998bbdcd56887a440aa3c60650 22-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: rework vertex format handling

Preventing piglit's draw-vertices test from hanging the GPU.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
allium/drivers/radeonsi/si_state.c
07838603b9a69c05911edbcd351bfce5ad9b5a2c 21-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: fix SPI_PS_INPUT_ENA handling

We need to enable at least one interpolation mode,
otherwise the GPU will hang.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
allium/drivers/radeonsi/si_state_draw.c
8d1a9a984f33d8e45f932a9f47cdd57da617a919 21-Aug-2012 Vadim Girlin <vadimgirlin@gmail.com> r600g: fix lockups with dual_src_blend v2

Disable blending when dual_src_blend is enabled and number of color exports
in the current fragment shader is less than 2.

Fixes lockups with ext_framebuffer_multisample-
alpha-to-coverage-dual-src-blend piglit test.

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state_common.c
c4610e9f927caa679f34f0d3135d7b1b8cb8bd29 14-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> st/dri: Add shared usage on buffers created

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
allium/state_trackers/dri/drm/dri2.c
61e95b8a5f8524c7ff726f92ef6edc6b6bb35196 14-Aug-2012 Jakob Bornecrantz <jakob@vmware.com> gbm: Add shared usage on images created

Tested-by: Scott Moreau <oreaus@gmail.com>
Signed-off-by: Jakob Bornecrantz <jakob@vmware.com>
bm/backends/dri/gbm_dri.c
df2c4cbcedb2dcf2aa44adaa6462d9becccbea49 21-Aug-2012 Anuj Phogat <anuj.phogat@gmail.com> mesa: Fix generic compressed texture formats' handling in glTexImage/glCopyTexImage

The generic texture formats should be accepted by the <internalformat>
parameter of TexImage1D, TexImage2D, TexImage3D, CopyTexImage1D, and
CopyTexImage2D functions. When the application specifies a generic
format, the driver is free to pick an uncompressed format.

This patch reverts the changes due to following commit:
commit a36581ccc06693231011c3fe136207e73191b1ce
mesa: do more teximage error checking for generic compressed formats

This patch fixes compressed texture format failures in intel oglconform
pxconv-gettex test case:
https://bugs.freedesktop.org/show_bug.cgi?id=47220

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/teximage.c
1cb07bd3b8abd5e52e9dbd80bb1666058545387e 21-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: ExpandSpecialInstrs - Add support for cube instructions
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600Instructions.td
6c99f2101fbd3edb7d5899c44ca9d984a3c0f8b6 21-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: ExpandSpecialInstrs - Add support for vector instructions
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
82a5d0c64142990236b40567561b6e99b7158216 20-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add R600ExpandSpecialInstrs pass

This pass expends reduction instructions into a MachineInstrBundle that
contains 4 instruction, one for each instruction slot.
allium/drivers/radeon/AMDGPU.h
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/AMDGPUTargetMachine.cpp
allium/drivers/radeon/Makefile.sources
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600ExpandSpecialInstrs.cpp
05882985757e655f5298af483c881008d45e6249 20-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add helper function for getting sub reg indices
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600RegisterInfo.cpp
allium/drivers/radeon/R600RegisterInfo.h
1a25ebe3ce95a6a4aef7c844dbe95909976b68da 21-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Handle NULL sampler views getting passed in by the state tracker.

Don't dereference NULL pointers, and if all views are NULL, don't generate an
invalid PM4 packet which locks up the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
allium/drivers/radeonsi/radeonsi_pm4.c
allium/drivers/radeonsi/si_state.c
c1114c619acf347917565cd1d0467240a89a76c0 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> APIspec: Remove cruft about AMD_compressed_???_texture

Mesa doesn't support these extensions, and it seems unlikely that it
ever will

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
4c32ee5bcaa0815f4f975066de98c6598bdaf51d 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glFramebufferTexture3D textarget validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
7c9afe50fd674c3503d880b1f0f5216577bf7d9d 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glGetShaderiv pname validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
aaef4416385883a1bb23785164c0ca3973b3267e 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glCompressedTexImage border validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
d39cb8e9ef23b7fadde945f27e956f762301a0ec 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glPointSizePointer type validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
d54004c3526e2040be6521546b263f29c77f06ce 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glGetBufferPointer pname validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
68d7ce3e9e54bfa544a1438b73d0920bf89a2de7 26-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glGetVertexAttribPointer pname validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
5be5cf69341c4acf0ae666373790db9ad1df06fd 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant element type validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
b99a8caff14d66a963a68d5599da2b50a9938765 25-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant glGetShaderPrecisionFormat shader type validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
c914ac239e74282458f69956a4358545b41f9c3f 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant depth func validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
af276d9d4bbdafe0845956480edeacfe820bcd84 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant stencil op fail/zfail/zpass validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
f3f993153c5310c35e79bb6184d32e2271793b0f 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant shade model mode validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
5a193557d115e62bf70c599e4037d8e1e3f5a9fc 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant light pname and light validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
02344107913f6322360fe4bb09133eda5d57e5b8 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant hint mode validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
a4251da3b220079a8326fcc39bde00ec16240ae1 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant separate stencil face validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
9113d0e686caf5f5e28728fa9b2157234aa33662 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant stencil function validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
1087745afe0035d2240014697155577f1a0bd573 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant logic op operand validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
bf03589882ee4b36a9c3fb618a1d5f6b567163db 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant alpha function validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
8f55d83569aa364ac7c6928c30b13d846d187389 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant separate stencil mask face validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
52d57985c69a0d8dab23db7070e2d83d914438f4 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant front-face mode validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
e1dbf56a10b08aa51a9186979548fcc929615b27 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant face culling mode validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
66404557db9d20aa6c761680a2188960e946dd6a 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant blend equation mode validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
e39ea674d0a51bdd10205a1c554f5e25df09156f 21-Sep-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant texture target validation

Mesa doesn't check the parameter passed to glMultiTexCoord*. It does,
however, mask the texture value to prevent out-of-bounds writes. This
patch will promote this non-conformant behavior to OpenGL ES 1. I don't
think anyone will care, and the gets some silly code out of a hot path.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
386e2f32895b5e66982fc4c18a636ceabfb762fd 03-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Rearrange placement of GL_TEXTURE_MAX_ANISOTROPY_EXT in APIspec

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
27e55805fbc4b11331c402b1185d097a2564f6b1 03-Oct-2011 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Remove redundant min/mag filter validation

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/APIspec.xml
esa/main/es1_conversion.c
926a4a922f9a5ec397cb3d316dd915b00b39c54d 18-Aug-2012 Mathias Fröhlich <Mathias.Froehlich@gmx.net> radeon-llvm: Start multithreaded before using llvm.

This is required to make some of llvm's api calls
thread save. In particular the PassRegistry, which is
implicitly accessed while compiling shader programs.
The PassRegistry uses a mutex that is only active if
the llvm_is_multithreaded() returns true.
Calling llvm_start_multithreading() makes this happen
and by calling this function we try to make sure that
we can savely compile shaders in paralell.
Since there is also a call llvm_stop_multithreading()
in the llvm api, we cannot guarantee that this does
not get switched off while we are relying on this being
set, but for the easier use cases this fixes a race with
the radeon llvm compiler we have as of today.

Signed-off-by: Mathias Froehlich <Mathias.Froehlich@web.de>
Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/radeon_llvm_emit.cpp
59361d76a5b0b6b77d6e6bc976e02df2e8df9ec3 20-Aug-2012 archibald <archibald@ethernull.org> r600g: Move common compute/3D register init to its own function

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/r600/evergreen_compute.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_pipe.h
c51f8e2790e9f1aed51133ca0e33dac236fba4a0 18-Aug-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> nv50/ir/tgsi: handle DP2 in tgsi Instruction srcMask

Solved by Tiziano Bacocco on IRC.
allium/drivers/nv50/codegen/nv50_ir_from_tgsi.cpp
f3a7be740dd9658097c2518a3bc6ec4ec197ad70 18-Aug-2012 Christoph Bumiller <e0425955@student.tuwien.ac.at> nv50/ir/emit: don't forget saturation bit on f32 add immediate

Solved by Maxim Levitsky on IRC.
allium/drivers/nv50/codegen/nv50_ir_emit_nv50.cpp
d0ace4e949d0e2f11e6f0fb0fd97ccde58457937 18-Aug-2012 Tilman Sauerbeck <tilman@code-monkey.de> mesa: use #if over #ifdef in the FEATURE_ES1 check to fix a build failure.

mfeatures.h will define FEATURE_ES1 to 0 if it's not defined yet.

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

Signed-off-by: Brian Paul <brianp@vmware.com>
esa/main/es1_conversion.c
5b542681dc05b8b9eba677ee74323ac0ff85a5f0 17-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: fix sampler view counting

In the past, when we called pipe::set_sampler_views(n) the drivers set
samplers [n..MAX] to NULL. We no longer do that. The state tracker
code was already trying to set unused sampler views to NULL to cover
that case, but the logic was broken and unnoticed until now. This patch
fixes it.

Strictly speaking, this patch shouldn't be necessary. Drivers should simply
ignore unused samplers and sampler views. But some drivers like llvmpipe (and
others?) count those things and they figure into state validation. That could
be fixed in the future.

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

Reviewed-by: Marek Olšák <maraeo@gmail.com>
esa/state_tracker/st_atom_texture.c
d65eb02537813ad1f469fa3d597726fcb5a76bb0 17-Aug-2012 Brian Paul <brianp@vmware.com> util: update and fix u_upload_mgr.h comments
allium/auxiliary/util/u_upload_mgr.h
84e5cb37d3cf0dd0b224d2431c7417d5e2fa6453 17-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: use Elements() instead of hard-coded number

And add a comment about the velems_util_draw[] array.
esa/state_tracker/st_context.c
1a9e4d5113cf1fd608668506312167a676fcdb4f 17-Aug-2012 Brian Paul <brianp@vmware.com> mesa: remove unused params, add const qualifiers

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/texparam.c
a6af24ee14a3e3cef99e96db539aa2abc911e6e0 17-Aug-2012 Brian Paul <brianp@vmware.com> mesa: querying GL_TEXTURE_COMPRESSED_IMAGE_SIZE for a buffer obj is illegal

GL_INVALID_OPERATION is to be raised when querying a non-compressed
image/buffer. Since a buffer object can't have a compressed format this
query always generates an error.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/texparam.c
34472a0d8713c4eb300c9d1de0844c8b78bcf1ab 27-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Don't generate ES1 type conversion wrappers

These are gradually going to get whittled away and eventually folded into the
source files with the native type functions.

v2: Add (speculative) SConscript changes. These may be broken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/SConscript
esa/main/es1_conversion.c
esa/main/es1_conversion.h
esa/main/es_generator.py
esa/sources.mak
d707e337f5f9a7b6ed465ade1b0b7c06606dde22 14-Aug-2012 Eric Anholt <eric@anholt.net> i965: Fix bug in the old FS backend's projtex() calculation.

In the old backend, we looked at any FS attribute's proj_attrib_mask bits, not
just texcoords. Now that we have _mesa_vert_result_to_frag_attrib(), we can
fill in the other FS inputs with correct proj_attrib_mask info.

NOTE: This is a candidate for stable branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46644
Signed-off-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vs_constval.c
3df13b32e56dbc76bdc72b75ea1462f79b44dce9 11-Jun-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Support GL_TEXTURE_BUFFER in GetTexLevelParameter[if]v in GL 3.1+.

The OpenGL 3.1 specification explicitly allows this. Oddly, the
ARB_texture_buffer_object spec's issues section claims this isn't
allowed, but proceeds to explain that the extension simply doesn't edit
the underlying spec to allow it, and thus it didn't appear in the list
of legal texture targets.

Thus, this patch legalizes it only in 3.1+ contexts, but still returns
INVALID_ENUM in earlier contexts that expose ARB_texture_buffer_object.

Unfortunately, the behavior of the call is horrendously undefined.

Fixes oglconform's tbo/negative.textureParams test.

v2: Require desktop OpenGL.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/teximage.c
esa/main/texparam.c
8c37fc1e9240a323b07c21da83dbd5432fc6895a 11-Jun-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Split out part of glGetTexLevelParameter into a helper function.

Move the _mesa_GetTexLevelParameter[iv] functions below the helper
function so the prototype is available.

This will be useful in the next commit.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/texparam.c
58d11524dace34f6e9e513b23eaeb098d1eafd0b 11-Jun-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Add GL_TEXTURE_CUBE_MAP to _mesa_max_texture_levels(). [v2]

For cube maps, _mesa_generate_mipmap() calls this with
GL_TEXTURE_CUBE_MAP (the gl_texture_object's Target) rather than one
of the faces. This caused _mesa_max_texture_levels() to return 0, which
resulted in maxLevels == -1 and the next line's assertion to fail.

This function is called from seven places:
- fbobject.c: framebuffer_texture()
- mipmap.c: _mesa_generate_mipmap()
- texgetimage.c:
- getteximage_error_check()
- getcompressedteximage_error_check()
- texparam.c: _mesa_GetTexLevelParameteriv()
- texstorage.c: tex_storage_error_check()

All of these (or their callers) now explicitly check for invalid targets
already, so this shouldn't cause invalid targets to slip through.
(Technically _mesa_generate_mipmap() doesn't check for invalid targets,
but the API-facing _mesa_GenerateMipmapEXT() function does.)

+2 oglconforms (float-texture/mipmap.automatic and mipmap.manual)

In addition to fixing the mipmap bug, it should also cause glTexStorage
to accept GL_TEXTURE_CUBE_MAP, which is explicitly allowed by the spec.

v2: Drop alterations to callers; this is now in a patch series that adds
explicit checking to API functions.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/teximage.c
9e4fde85e46f406b37ad372487fbff4ed51c65e4 11-Jun-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Add explicit target checking to GetTexLevelParameter[if]v().

Previously, it relied on _mesa_max_texture_levels() for texture target
error checking. This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels(), so
this patch should not introduce any change in behavior. Future patches
will cause the two to diverge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/texparam.c
63396ce4c0fe067f69d1b53d0408627a421c4678 11-Jun-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Add explicit target checking to Get[Compressed]TexImage().

Previously, they relied on _mesa_max_texture_levels() for texture target
error checking. This was somewhat dodgy, as _mesa_max_texture_levels()
is called in seven diferent places, not all of which necessarily accept
the same list of targets.

I copied the list of legal targets from _mesa_max_texture_levels() but
removed the proxy targets, as both functions explicitly rejected those
targets. This changes the order in which we check errors, which could
change whether we return INVALID_VALUE or INVALID_ENUM. However, it
shouldn't change the list of accepted targets.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
esa/main/texgetimage.c
f69273f9522a0c1486cf1870e35b3a16516f7233 17-Aug-2012 Brian Paul <brianp@vmware.com> llvmpipe: remove polygon stipple assertion

It's possible for us to have an unused sampler bound when the fragment
shader itself doesn't use any samplers. So the assertion isn't valid.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53616
allium/drivers/softpipe/sp_state_derived.c
553a08d3144b8b668f28c6094948afe64be309d9 16-Aug-2012 Brian Paul <brianp@vmware.com> svga: minor code reformatting

To be consistent with other functions.
allium/drivers/svga/svga_cmd.c
81ba2c53b698b3926e71dd37e7898719fd2deb3e 14-Aug-2012 Matt Turner <mattst88@gmail.com> build: Remove -shared from OSMesa's LDFLAGS

Would break the static build.
esa/drivers/osmesa/Makefile.am
d12b07eb1a881df641f81ce7e31d3da8043a5b80 14-Aug-2012 Matt Turner <mattst88@gmail.com> build: Remove EXTRA_LIB_PATH

You can add extra library paths to LDFLAGS directly.
allium/targets/Makefile.va
allium/targets/Makefile.vdpau
allium/targets/Makefile.xvmc
f36c404f900dee95ecfe9d5c6a7c6efdf5e25963 16-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: disable tiling for 422 formats again
allium/drivers/r600/r600_texture.c
795834432b11418d82db9a5580c916b3bee1a8f2 07-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fix blits of subsampled formats
allium/drivers/r600/r600_blit.c
6fd9218bb44b8719da60ce325d4f41c4a611e871 16-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fix copying between NPOT mipmapped compressed textures

We aligned the dimensions to the blocksize, then divided by it
(in r600_blit.c), then minified, which was wrong.

The minification must be done first, not last.
This fixes piglit/fbo-generatemipmap-formats with S3TC and maybe
a bunch of other tests too. Tested on RV730.
allium/drivers/r600/r600_texture.c
b8e9cf5d965ce09227cd9875c4381c73f237f196 15-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: make F2U trans-only on r600-r700

This fixes a failing assertion in r600_asm.c.
allium/drivers/r600/r600_shader.c
0d7e00281505b4537a8aee9002792d56619269a4 14-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: set CB_COLOR_INFO to INVALID for disabled colorbuffers on r600-r700

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
allium/drivers/r600/r600_state.c
951ac46a6a0a901b53a518c8dcde734578cbf228 14-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: rename r600_resource_texture to r600_texture
allium/drivers/r600/compute_memory_pool.c
allium/drivers/r600/evergreen_compute_internal.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
allium/drivers/r600/r600_texture.c
952c90576753550f4deed4dac42d8fd6129a9cce 14-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: always put tiled textures in VRAM
allium/drivers/r600/r600_texture.c
773ff5705f3b2d88fb7094b8d2e051bb684c2323 12-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: cleanup r600_resource_texture in favor of radeon_surface
allium/drivers/r600/evergreen_compute_internal.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_texture.c
362a25aac5f8cd71c08ad92b4b19be6712d8fd72 12-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: remove unused parameter in r600_texture_create_object
allium/drivers/r600/r600_texture.c
c4993d15eb07d95ac465b5f25ea96072e4b008bf 12-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: fixup the usage flag for the flushed depth texture
allium/drivers/r600/r600_texture.c
0efd564a09988a4a7f49cab70b778026459dff1b 15-Aug-2012 Philipp Brüschweiler <blei42@gmail.com> wayland-drm: close fd after the display is uninitialized

This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
wl_drm display destruction.

Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
allium/state_trackers/egl/wayland/native_drm.c
5f82d1924831da7467bfe8025ca18e98b9548ca4 16-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Lower implicit parameters before ISel
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600ISelLowering.h
allium/drivers/radeon/R600Instructions.td
0d308ef8feb081bedd12e01b270278e5f0de8e5a 16-Aug-2012 Brian Paul <brianp@vmware.com> gallium/draw: move misplaced brace
allium/auxiliary/draw/draw_context.c
f6b7157550205a0633b4c2cb49a807d581176e21 10-Aug-2012 Brian Paul <brianp@vmware.com> mesa: raise GL_INVALID_OPERATION in glGenerateMipmap for missing base image

This seems to be expected by the WebGL texture-mips test. The error makes
sense, but I haven't found (yet) any OpenGL documentation specifying this
error condition.

See http://bugs.freedesktop.org/show_bug.cgi?id=44912

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/main/fbobject.c
d663a557fd27d7c238248e19f22f2e6b05f03030 10-Aug-2012 Brian Paul <brianp@vmware.com> r600: update sampler, sampler_view code for the future

For when we have pipe->set_sampler_states(pipe, shader, start, num, samplers),
etc.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
10e552d056dd080c4e763a31df517c2d7684a9cf 10-Aug-2012 Brian Paul <brianp@vmware.com> rbug: update data structures, functions for future changes

To support geom/compute/etc shaders, samplers, sampler views, etc.
To support pipe->bind_sampler_states() w/ start_slot.
allium/drivers/rbug/rbug_context.c
allium/drivers/rbug/rbug_context.h
allium/drivers/rbug/rbug_core.c
109e87dc6aed1ad42d36b3757accbb7e79401bce 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium/trace: add 'start' parameter to bind_sampler_states/views()
allium/drivers/trace/tr_context.c
d4ab8bd0955f1b114acee80f17a2e82c7129cc1a 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium/identity: add 'start' parameter to bind_sampler_states/views()
allium/drivers/identity/id_context.c
f3cc4990a090ee076d8217c83aaf16e036e66686 10-Aug-2012 Brian Paul <brianp@vmware.com> galahad: add 'start' parameter to bind_sampler_states/views()
allium/drivers/galahad/glhd_context.c
bd3733c0be174f947dd729e5fd987ea3a9566c27 10-Aug-2012 Brian Paul <brianp@vmware.com> svga: add 'start' parameter to bind_sampler_states/views()
allium/drivers/svga/svga_pipe_sampler.c
c969cb1447a0dc0da3cd8016f3e86dcfb381643f 10-Aug-2012 Brian Paul <brianp@vmware.com> llvmpipe: add 'start' parameter to bind_sampler_states/views()
allium/drivers/llvmpipe/lp_state_sampler.c
25a42f39e362322dbac836c29b76b3104bbfe6f4 10-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: add 'start' parameter to bind_sampler_states/views()

To support updating a sub-range of sampler states/views in the future.
Note that we always pass start=0 at this time.
allium/drivers/softpipe/sp_state_sampler.c
348ac08bfdc0741e8b2e14a747e2299c49771ece 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium/trace: consolidate sampler, sampler_view code
allium/drivers/trace/tr_context.c
0ad95b923a2bfd91677872765946b6a2f8d11260 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium/identity: consolidate sampler, sampler_view code

This will simplify things when the pipe_context functions are consolidated.
allium/drivers/identity/id_context.c
f3c3aff6efed49b7740a144f767c713cb22561e2 10-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: add support for GS textures and samplers
esa/state_tracker/st_atom.c
esa/state_tracker/st_atom.h
esa/state_tracker/st_atom_sampler.c
esa/state_tracker/st_atom_texture.c
6c8a13215813841703e7c2efa233e8d4cf517dfd 10-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: combine vertex/fragment sampler state in arrays

As with other recent changes, put the vertex and fragment sampler state
into arrays indexed by the shader type. This will let us easily add
support for other types of shaders in the future.
esa/state_tracker/st_atom_sampler.c
esa/state_tracker/st_atom_texture.c
esa/state_tracker/st_cb_bitmap.c
esa/state_tracker/st_context.c
esa/state_tracker/st_context.h
cab2fed135bc1edf7b65ddca3236020638427061 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium: remove PIPE_MAX_VERTEX/GEOMETRY_SAMPLERS #define

PIPE_MAX_SAMPLERS, PIPE_MAX_VERTEX_SAMPLERS and PIPE_MAX_GEOMETRY_SAMPLERS
were all defined to the same value (16).

In various places we're creating arrays such as
sampler_views[PIPE_SHADER_TYPES][PIPE_MAX_SAMPLERS] so we were assuming
the same number of max samplers for all shader stages anyway.

Of course, drivers are still free to advertise different numbers of max
samplers for different shaders.
allium/auxiliary/cso_cache/cso_context.c
allium/auxiliary/draw/draw_llvm.c
allium/auxiliary/draw/draw_llvm.h
allium/auxiliary/draw/draw_llvm_sample.c
allium/drivers/galahad/glhd_context.c
allium/drivers/i915/i915_context.h
allium/drivers/i915/i915_screen.c
allium/drivers/i915/i915_state.c
allium/drivers/identity/id_context.c
allium/drivers/llvmpipe/lp_context.c
allium/drivers/llvmpipe/lp_context.h
allium/drivers/llvmpipe/lp_screen.c
allium/drivers/llvmpipe/lp_state_sampler.c
allium/drivers/rbug/rbug_context.c
allium/drivers/rbug/rbug_context.h
allium/drivers/softpipe/sp_context.c
allium/drivers/softpipe/sp_context.h
allium/drivers/softpipe/sp_screen.c
allium/drivers/trace/tr_context.c
allium/include/pipe/p_state.h
esa/state_tracker/st_context.h
a2c1df4c9a7375bc5306e8cfd07a9f7087759a96 10-Aug-2012 Brian Paul <brianp@vmware.com> draw: index samplers and sampler_view state by shader type

So that we can handle GS state and other types of shaders in the future.
allium/auxiliary/draw/draw_context.c
allium/auxiliary/draw/draw_llvm.c
allium/auxiliary/draw/draw_private.h
bef196c7929606bb8c7e9c06fe83a90fc0d95f09 10-Aug-2012 Brian Paul <brianp@vmware.com> draw: move tgsi-related state into a tgsi sub-struct

To better organize things a bit.
allium/auxiliary/draw/draw_context.c
allium/auxiliary/draw/draw_gs.c
allium/auxiliary/draw/draw_private.h
allium/auxiliary/draw/draw_vs.c
allium/auxiliary/draw/draw_vs_exec.c
df87fb59136eb302d72eac4b58fd8ffb25989ed5 10-Aug-2012 Brian Paul <brianp@vmware.com> gallium: add a shader stage/type param to some draw functions

To prepare for geometry shader texture support in the draw module.
Note: we still only handle the vertex shader case.
allium/auxiliary/draw/draw_context.c
allium/auxiliary/draw/draw_context.h
allium/drivers/i915/i915_state.c
allium/drivers/llvmpipe/lp_state_sampler.c
allium/drivers/softpipe/sp_state_sampler.c
a8ed00d5f13d7b016bc2ea56f130adc3fa857cc8 16-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: silence signed/unsigned comparison warning
esa/state_tracker/st_glsl_to_tgsi.cpp
d733e5da9c50f0bb93549642304da2f211879bb9 09-Aug-2012 Brian Paul <brianp@vmware.com> svga: move result->key expression after result != NULL check
allium/drivers/svga/svga_state_constants.c
50188adf7d4ca12488a3cb4b70ffdedea2e9c9b1 09-Aug-2012 Brian Paul <brianp@vmware.com> svga: fix result==NULL logic in emit_fs_consts()

The previous test for result != NULL was kind of bogus since we dereferenced
the pointer earlier in the code. Now, check for result != NULL first, then
get the result->key info.

Also, remove the useless "offset +=" code at the end.
allium/drivers/svga/svga_state_constants.c
d55e0f1ba05252af658ca084769a279c956575b9 09-Aug-2012 Brian Paul <brianp@vmware.com> svga: update comment (s/SVGA_NEW_VS_RESULT/SVGA_NEW_VS_PRESCALE/)
allium/drivers/svga/svga_state_constants.c
2a5eeeaebe4f631e0f4e3dbe73f22d5f60a53db5 09-Aug-2012 Brian Paul <brianp@vmware.com> svga: rename svga_hw_vs_parameters -> svga_hw_vs_constants

and similarly for svga_hw_fs_parameters
allium/drivers/svga/svga_state.c
allium/drivers/svga/svga_state.h
allium/drivers/svga/svga_state_constants.c
8cc1860d4a55c93ce12a649c281012b37212ffbd 12-Aug-2012 Niels Ole Salscheider <niels_ole@salscheider-online.de> st/mesa: index can be negative in the PROGRAM_CONSTANT case

NOTE: This is a candidate for the 8.0 branch.

Reviewed-by: Brian Paul <brianp@vmware.com>
esa/state_tracker/st_glsl_to_tgsi.cpp
fd41cbc557509a36ae513eb7170edffbaa5e5715 16-Aug-2012 Brian Paul <brianp@vmware.com> mesa: add cast to silence warning in _mesa_pack_rgba_span_from_ints()
esa/main/pack.c
658044cde1dbdd6d58ad61ef44850da7afa5c413 16-Aug-2012 Brian Paul <brianp@vmware.com> meta: remove unused variable
esa/drivers/common/meta.c
1b11395a36a44a902cfb3e1783758544662df73f 16-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Fix symbol conflicts with r600g.

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/r600.h
allium/drivers/radeonsi/r600_blit.c
allium/drivers/radeonsi/r600_buffer.c
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/r600_resource.c
allium/drivers/radeonsi/r600_resource.h
allium/drivers/radeonsi/r600_texture.c
allium/drivers/radeonsi/radeonsi_pipe.c
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/si_state_draw.c
51d9f37a72b3c7893204efbbeca034d1581d30f1 15-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Fix memory leaks if returning early from some state functions.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/si_state.c
4b64fa2ff18ecf5b991f3f5e11daf1e3d8314664 15-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Fix LLVM context leak.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_shader.c
18abc270c56d5debc02a196634583a25074b3fef 15-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Don't assign virtual address space for BO that already has one.

We'd end up re-using the old one and throwing away the new one anyway, but only
after a roundtrip to the kernel.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
a60be05284399202c7a5a7aaf4d1f8f0626aee80 15-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Create hole for waste when allocating from va_offset.

Otherwise, the wasted area could never be used for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
1f455ef5bc3c9711d9452dcc09fd849656ad8b33 26-Apr-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Fix potential address space loss in radeon_bomgr_force_va().

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
6d59b7f6dc3131e773e9c9729388c08a2f987364 26-Apr-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Delete uppermost virtual address space hole if it's at the top.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
f5fe81daea622f8f043edc19fb61ba367b6958aa 26-Apr-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Fix losing holes when allocating virtual address space.

If a hole exactly matches the allocated size plus alignment, we would fail to
preserve the alignment as a hole. This would result in never being able to use
the alignment area for an allocation again.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
206d07625c9fd69c7d00a8722bd7390c5215bfe2 26-Apr-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Merge holes when freeing virtual address space.

Otherwise we'll likely end up with an ever increasing amount of ever smaller
holes.

Requires keeping the list ordered wrt offsets.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
c25968f3e2a1b5144a2e88d15b95e5b477a55f5d 03-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> gallium/radeon: Make va_offset 64 bits wide.

Otherwise we'd wrap around after 32 bits. The kernel currently limits GPU
virtual address space to 4GB anyway, but that will probably change sooner or
later, and this would result in confusing error messages when running out of
virtual address space even now.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
1597176f7090eea73f41b3114ae2a02a50ac7a12 12-Aug-2012 Vinson Lee <vlee@freedesktop.org> llvmpipe: Silence Coverity incorrect sizeof expression defect.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/llvmpipe/lp_state_setup.c
6a3ac03f2b80c80655d66b31c0218754f70156de 12-Mar-2010 Dave Airlie <airlied@redhat.com> glx/dri2: add dri2 prime support.

This adds support for having libGL pick a different driver for prime support.

DRI_PRIME env var is set to the value retrieved from the server randr
provider calls, by the calling process. (generally DRI_PRIME=1 will be
the right answer).

Signed-off-by: Dave Airlie <airlied@redhat.com>
lx/dri2.c
565a4e2a8625c79bde0eacf674a4f633151eeb0e 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Enable if-cvt

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/AMDGPUTargetMachine.cpp
a614979286f8d329af318c1e9fb067e17cab4315 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Add callbacks needed by if-cvt

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
0eca5fd919b0a31ea926b5f5072e5e56f7a55269 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Lower branch/branch_cond into predicated jump

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/AMDGPUInstrInfo.cpp
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/AMDILCFGStructurizer.cpp
allium/drivers/radeon/AMDILInstrInfo.td
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
6db2e9fdb0a35e27e6fc86a1485918b78717a425 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Add a predicated JUMP instruction

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/R600Instructions.td
8263408a91b6b3beb5af5de6bdc7e5d13197a268 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Support for predicate bit

Tom Stellard:
- A few changes to predicate register defs

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600GenRegisterInfo.pl
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
allium/drivers/radeon/R600Instructions.td
allium/drivers/radeon/R600RegisterInfo.cpp
8f597d57e959830040473b548e0e04cfc63866c2 04-Aug-2012 Vincent Lejeune <vljn@ovi.com> r600g: Glue to handle predicate aware output from llvm

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/r600/r600_shader.c
72f7632c6bbbfc062ac7d90290e99f71272f6059 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> r600g: Fix instruction group merge when there are predicated insts.

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/r600/r600_asm.c
56227f875bdff6ef4fd53b09ba267c786ae9dac2 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> radeon/llvm: Do not use PV/PS if PRED_SEL does not match

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/r600/r600_asm.c
da676eab93e7dad30b574b4eb4cffd4df952e819 01-Aug-2012 Vincent Lejeune <vljn@ovi.com> r600g: Add support for predicates

Signed-off-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/r600/r600_asm.c
allium/drivers/r600/r600_asm.h
allium/drivers/r600/r600_shader.c
allium/drivers/r600/r700_asm.c
cf76edd300b3e58a906d07404e7d7533a6d54a41 12-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move ps sampler state into PM4 stream

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/si_state.c
ec5b698525ccd9d5cd734e723e284dea7cc2041d 12-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move ps sampler views into PM4 stream

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/si_state.c
54de6f452c3132a331f22c50cadff9b3ad99c6c2 12-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move vertex state descriptors into PM4 stream

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/si_state_draw.c
f2c95d93db197fe175d510436d7f4fa45aed1180 12-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: add shader data infrastructure

With this we can embed data for the shaders (like resource
descriptors) into the PM4 stream.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_pm4.c
allium/drivers/radeonsi/radeonsi_pm4.h
allium/drivers/radeonsi/sid.h
4444b9d1ecddb09468d2878ffb1463a66ea0ffd3 12-Aug-2012 Christian König <deathsimple@vodafone.de> radeon/llvm: add support to fetch temps as vectors

Necessary for texture fetches with temp regs as source on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeon/radeon_setup_tgsi_llvm.c
b6051bc7859829588b2361da96f8e828a7fe1326 26-Jul-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Remove AMDGPUUtil.cpp
allium/drivers/radeon/AMDGPUISelLowering.cpp
allium/drivers/radeon/AMDGPUUtil.cpp
allium/drivers/radeon/AMDGPUUtil.h
allium/drivers/radeon/Makefile.sources
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/SIAssignInterpRegs.cpp
allium/drivers/radeon/SICodeEmitter.cpp
allium/drivers/radeon/SIRegisterInfo.cpp
040c2e04568e2fe9ec07167f5300a3dcdfebb04e 26-Jul-2012 Apostolos Bartziokas <barz621@gmail.com> radeon/llvm: Cleanup AMDGPUUtil.cpp
allium/drivers/radeon/AMDGPUInstrInfo.h
allium/drivers/radeon/AMDGPUUtil.cpp
allium/drivers/radeon/AMDGPUUtil.h
allium/drivers/radeon/R600CodeEmitter.cpp
allium/drivers/radeon/R600InstrInfo.cpp
allium/drivers/radeon/R600InstrInfo.h
3aaa209293a281e103ef71e3578fad042972e092 26-Jul-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Lower loads from USE_SGPR adddress space during DAG lowering
allium/drivers/radeon/AMDGPUISelLowering.cpp
allium/drivers/radeon/AMDGPUISelLowering.h
allium/drivers/radeon/SIISelLowering.cpp
allium/drivers/radeon/SIISelLowering.h
allium/drivers/radeon/SIInstructions.td
40c41fe890e53d99afb4e2c3fbf10043081edd9e 25-Jul-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add live-in registers during DAG lowering

Psuedo instructions emulating live-in registers have been removed
and their corresponding intrinsics are now being lowered during DAG
lowering.
allium/drivers/radeon/AMDGPUISelLowering.cpp
allium/drivers/radeon/AMDGPUISelLowering.h
allium/drivers/radeon/AMDGPUUtil.cpp
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600Instructions.td
allium/drivers/radeon/SIISelLowering.cpp
allium/drivers/radeon/SIInstructions.td
allium/drivers/radeon/SIIntrinsics.td
allium/drivers/radeonsi/radeonsi_shader.c
f3480f92349c90f55e2e80d9a4536ab048fb5652 26-Jul-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Lower store_output intrinsic during DAG lowering
allium/drivers/radeon/AMDGPUIntrinsics.td
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600Instructions.td
a76a0f74225802f4d3f11028ab54afe98b26302b 15-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Force VTX_READ instructions to use same reg for src and dst

I was seeing some GPU hangs that seemed to be cause by ALU instructions
writing to the same register used as the source for VTX_READ. Adding
this constraint to the VTX_READ instructions avoids this situation.
allium/drivers/radeon/R600Instructions.td
97b4b97b2f9b0e4532c8ba9cedfff9f013a76fc2 15-Aug-2012 Marek Olšák <maraeo@gmail.com> radeonsi: fix build breakage after u_blitter changes
allium/drivers/radeonsi/r600_blit.c
e0cc61bd91f5ef84bacaf5e7c6cda9eeefed478d 13-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: document custom meta helpers
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r300/r300_blit.c
allium/drivers/r600/r600_blit.c
b3b5bb9ddb05989b2dc5fc17f88491bbd0e6ecac 15-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: disable handling of DISCARD_RANGE

https://bugs.freedesktop.org/show_bug.cgi?id=53130
allium/drivers/r600/r600_buffer.c
44f14ebd7b9ba7186342039d2602fdd6ea5077f5 05-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: implement timestamp query and get_timestamp hook

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_query.c
allium/winsys/radeon/drm/radeon_drm_winsys.c
allium/winsys/radeon/drm/radeon_winsys.h
1932bc8aaeb59287a7f769b0cb9a55f49dd6d553 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: enable MSAA on evergreen by default

v2: add the DRM version check
allium/drivers/r600/evergreen_state.c
870af19d70bf985a253f1ea8398fb7ec8704cf9c 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement copying between MSAA textures
allium/drivers/r600/r600_blit.c
0f86915c5322b096b7154b6c84e21288074b775d 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement MSAA color resolve
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
94b634eca0e2bd32d4b5bd92d06d510eae8a5625 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement MSAA depth-stencil decompression and resolve

and integer textures, which are resolved the same as depth, I think.
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_texture.c
6d3ad2dd2ba3ccdd211dbc618404519930631be2 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement TXQ_LZ opcode
allium/drivers/r600/r600_shader.c
4b78df9c81f1ca8af2b750616de8ff440e99c3c1 09-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement MSAA rendering and texturing for evergreen and cayman
allium/drivers/r600/evergreen_hw_context.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/evergreend.h
allium/drivers/r600/r600_texture.c
a01791add08fbcb5386e0e9209ba21ed58fbdc42 22-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: implement set_sample_mask
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
6517225078a6a56c9fb3c1ea9f310992e6400b77 22-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: implement alpha-to-coverage
allium/drivers/r600/evergreen_hw_context.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/evergreend.h
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600d.h
26cb887ea213be2445e0fd64364d9264ed4fbfd2 04-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: implement alpha-to-one
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_shader.c
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
4f215952760b2e5a92b25ddfa89469c1ec110160 04-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: remove support for 3-channel colorbuffers

We have no sampler support for them.
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_state.c
2f14202f52c9f61f5bb5bfb6beaf954ef5c18de9 12-Aug-2012 Marek Olšák <maraeo@gmail.com> configure.ac: bump libdrm_radeon requirement to 2.6.38
allium/winsys/radeon/drm/radeon_drm_winsys.c
a7f4d3b740d4c85b0dc2b006c30c2bc4a3ed8597 04-Aug-2012 Marek Olšák <maraeo@gmail.com> winsys/radeon: print error if CS is overflowed

and don't submit the CS to the kernel.
allium/winsys/radeon/drm/radeon_drm_cs.c
dc5e61d8842501e0b67907e360392eb355c8b73d 04-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: implement X and Y texture flipping
allium/auxiliary/util/u_blitter.c
825b45366d5308fd3e8e71c0c1943cb6ca8f69ea 25-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: implement blitting multisample resources

It can blit only one sample at a time (it should be called in a loop).
allium/auxiliary/util/u_blit.c
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/auxiliary/util/u_inlines.h
allium/auxiliary/util/u_simple_shaders.c
allium/auxiliary/util/u_simple_shaders.h
allium/drivers/i915/i915_surface.c
allium/drivers/r300/r300_blit.c
allium/drivers/r600/r600_blit.c
dacf5dc9ac1a700b86e0dc385513afaff41e7aea 28-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium: add TGSI support for multisample textures

The only allowed instructions are TXQ_LZ and TXF.

TXQ_LZ is like TXQ, but without the LOD parameter (which is always zero
with MSAA textures)

The 3rd or the 4th texcoord component in TXF should contain the sample index
for a 2D_MSAA or 2D_ARRAY_MSAA texture, respectively.
allium/auxiliary/tgsi/tgsi_info.c
allium/auxiliary/tgsi/tgsi_strings.c
allium/auxiliary/tgsi/tgsi_util.c
allium/include/pipe/p_shader_tokens.h
ba53573a8b14a7ab41307a38710610611dfa1cc5 04-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium/tgsi: fix TGSI text parser

The problem was that the string matching succeeded e.g. for "2D" when there
was actually "2D_MSAA" and then failed parsing "_MSAA".

To prevent similar failures in the future, let's fix this kind of error
everywhere.
allium/auxiliary/tgsi/tgsi_text.c
b7c4ee21c53a73d84e352d6f3db2547f6434d14e 05-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blit: set dst format from pipe_resource, not pipe_surface

We use it to decide whether we can use resource_copy_region.

NOTE: This is a candidate for the 8.0 branch.
allium/auxiliary/util/u_blit.c
1a17c4234431a17ec60503d69d7e84f85b3ae50d 04-Aug-2012 Marek Olšák <maraeo@gmail.com> gallium: make pipe_box signed in order to represent flipped blits

This will be used by u_blitter.
allium/include/pipe/p_state.h
03b78ceb50b97611bcaa2d2354ff5b505306b0a1 04-Aug-2012 Marek Olšák <maraeo@gmail.com> st/mesa: don't clamp fragment color with integer colorbuffer
esa/state_tracker/st_atom_rasterizer.c
esa/state_tracker/st_atom_shader.c
esa/state_tracker/st_cb_bitmap.c
esa/state_tracker/st_cb_drawpixels.c
e06d6168cb4367728fac68264757a700932c2f73 04-Aug-2012 Marek Olšák <maraeo@gmail.com> mesa: flush vertices in test_framebuffer_completeness
esa/main/fbobject.c
538085c5d423df4fed3c3b2c473c3684f7b08db6 15-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> st/egl: Fix up for ClientVersion -> ClientMajorVersion rename.

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

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
allium/state_trackers/egl/common/egl_g3d_api.c
b3900ed5ad9bd5df112490dd2b5d2c17d6124067 09-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> i965: add ARB_texture_rgb10_a2ui support

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/drivers/dri/i965/brw_wm_surface_state.c
esa/drivers/dri/intel/intel_extensions.c
091eb15b694a396f8453093575ccec2db7f14eb8 21-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> meta: allow CopyTexSubImage on integer formats

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/drivers/common/meta.c
6671d0dad300e591ac7c0e5110c6778373d0149a 25-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> mesa ReadPixels: handle signed/unsigned integer clamping

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/readpix.c
f7333b6345deb1c0322079039544bc322ca1dad9 10-Jul-2012 Jordan Justen <jordan.l.justen@intel.com> mesa pack: handle packed integer formats with clamping

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/pack.c
1a814217c336529b6f3133f9491ff5920ecaf346 10-Jul-2012 Jordan Justen <jordan.l.justen@intel.com> mesa unpack: call _mesa_problem when unpack function is not available

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/format_unpack.c
b3dd048cbb310b2c3ea40f09f9d89944851b2048 25-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> mesa texstore: handle signed/unsigned integer clamping

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/texstore.c
7208505d30fe05e828eb7d2450bfd8c2bee289a0 25-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> mesa GetTexImage: handle signed/unsigned integer clamping

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/texgetimage.c
7ef270867cb1f3e19067c93449e48987a32730d3 25-Jun-2012 Jordan Justen <jordan.l.justen@intel.com> mesa pack: handle uint and int clamping properly

Rename _mesa_pack_rgba_span_int to _mesa_pack_rgba_span_from_uints.
Add _mesa_pack_rgba_span_from_ints.

These separate routines allow the integer clamping to be handled
properly for signed versus unsigned integers.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/pack.c
esa/main/pack.h
esa/main/readpix.c
esa/main/texgetimage.c
1938501fbfb5052b1de7d78dc7ca8a8738f814e2 09-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Fix rendering to a multisample front buffer

We need to downsample before flushing BUFFER_FAKE_FRONT_LEFT to
BUFFER_FRONT_LEFT in intel_flush_front.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_context.c
a43599d1d1a583b25c0a63c28c0a5001387fa518 09-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Clean up intel_flush_front

Stop repeating ourselves. Replace the 4 instances of
`driContext->driDrawablePriv` with `driDrawable`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_context.c
38b748ce29a6415558bbe4886589134e3db047c8 09-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor intel_downsample_for_dri2_flush

Move it from intel_screen.c to intel_context.c. Redeclare as non-static.
A future commit will use it in multiple files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_context.c
esa/drivers/dri/intel/intel_context.h
esa/drivers/dri/intel/intel_screen.c
dbecb413008c19e1864de93d9a8a9123bfee46e7 20-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl: Allow OpenGL ES 3.0 as a version

In the DRI2 back-end this will get the same API as GLES 2.0.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
gl/main/eglcontext.c
7b4b4f8e68ba7a6109cc508de10314e966e56f5f 20-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Add support for EGL_KHR_create_context and EGL_EXT_create_context_robustness

Just like in GLX, EGL_KHR_create_context requires DRI2 version >= 3, and
EGL_EXT_create_context_robustness requires both DRI2 version >= 3 and the
__DRI2_ROBUSTNESS extension.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
gl/drivers/dri2/egl_dri2.h
f171571bfc897921cee63cbba3b71fd9b64174c9 20-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl: Implement front-end support for EGL_EXT_create_context_robustness

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/main/eglcontext.c
gl/main/egldisplay.h
gl/main/eglmisc.c
63beb3df98147f34fd0965cb0afbb97444206d0c 19-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl: Implement front-end support for EGL_KHR_create_context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/main/eglcontext.c
gl/main/eglcontext.h
gl/main/egldisplay.h
gl/main/eglmisc.c
9d76ad2fac5b6558d63656e9a29cda394bb4ec80 19-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Silence warnings about missing initializers

egl_dri2.c: At top level:
egl_dri2.c:325:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:325:4: warning: (near initialization for 'swrast_driver_extensions[2].version') [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: missing initializer [-Wmissing-field-initializers]
egl_dri2.c:330:4: warning: (near initialization for 'swrast_core_extensions[1].version') [-Wmissing-field-initializers]

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
3fd79dd9886f05f45f3dc94c028a38dd75b8ee1b 19-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl: Rename ClientVersion to ClientMajorVersion, add ClientMinorVersion

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
gl/main/eglcontext.c
gl/main/eglcontext.h
ce55741cbc0837338b73f9112ab4d84363ebaee1 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Use createContextAttribs if DRI2 version >= 3

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
38f91f2b08e2457fa637c631490fe713e8ee5429 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Require DRI2 version 2

The extra block in dri2_create_context is to prevent extra white space noise
in the next patch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
gl/drivers/dri2/egl_dri2.c
0c445bb618479adceb9243098fc20bebac4eecc7 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> dri_util: Compare against the correct API enums

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/common/dri_util.c
258771882d8996c0f8f66c01071c26b0d85f9a0e 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Enable GL_ARB_invalidate_subdata

v2: Add GL_ARB_invalidate_subdata to release notes at Brian's
suggestion.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/main/extensions.c
07e12c49175e0bf23dbd8bdc3afd7aa79ccc7140 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Add skeleton implementations of glInvalidateTex{Sub,}Image

These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Add comment explaining why minimum dimensions are set to 1 for some
texture targets. Add default case to switch statement to silence
compiler warnings and detect new texture targets. Both changes
suggested by Brian. Also use _mesa_is_desktop_gl as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/api_exec.c
esa/main/texobj.c
esa/main/texobj.h
f241ffd48c2063557461f5b7bb2dea0b744b8bef 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Add skeleton implementations of glInvalidateBuffer{Sub,}Data

These are part of GL_ARB_invalidate_subdata (but not OpenGL ES 3.0).

v2: Use _mesa_bufferobj_mapped instead of testing
gl_buffer_object::Pointer as suggested by Brian. Also use
_mesa_is_desktop_gl as suggested by Ken.

v3: Add a comment by the map subrange / discard range overlap test and
fix an off-by-one error noticed by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/bufferobj.c
e2370bcc1ddde84d5d1ff676c29638645cb21731 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es: Pass context to _mesa_init_bufferobj_dispatch

With this change _mesa_init_bufferobj_dispatch won't set function
pointers that don't exist in OpenGL ES.

v2: Use _mesa_is_desktop_gl and _mesa_is_gles3 as suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/api_exec.c
esa/main/bufferobj.c
esa/main/bufferobj.h
342be8aa88819446220bba680d8e0b628078156f 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Add skeleton implementations of glInvalidate{Sub,}Framebuffer

These are part of GL_ARB_invalidate_subdata and OpenGL ES 3.0.

v2: Reject aux buffers in core context, and use _mesa_is_desktop_gl and
_mesa_is_gles3. Both suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/api_exec.c
esa/main/fbobject.c
esa/main/fbobject.h
12249b9c96da730ea958976908e1bbb88bda9789 13-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> glapi: Add GL_ARB_invalidate_subdata

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
api/glapi/gen/ARB_invalidate_subdata.xml
api/glapi/gen/gl_API.xml
2a1ca4ff73129825a7578b0a5ed1f0ac9476a4c3 14-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/es3: Add _mesa_is_gles3 predicate

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/context.h
9bcb9fad65f0926d665317d6830e9812baafcf86 11-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> intel: Implement ARB_texture_storage

This is basically cut-and-paste from the swrast implementation, and it
could probably be (slightly) more optimal.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_extensions.c
esa/drivers/dri/intel/intel_tex.c
79e9e1b32f54f4fb6d752643fc9843c45eddd2f6 01-Aug-2012 Matt Turner <mattst88@gmail.com> build: Use MKDIR_P in src/mesa/Makefile.am

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/Makefile.am
02f52e8df58aad16e6b59fe35ac0c10b46dad36e 01-Aug-2012 Matt Turner <mattst88@gmail.com> build: Use AM_V_GEN in src/mesa/Makefile.am

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/Makefile.am
85d355f1220443c9efdf2d759f23512a7c691a3e 01-Aug-2012 Matt Turner <mattst88@gmail.com> build: Fix out-of-tree generation of builtin_function.cpp

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/Makefile.am
2191a79b4e66be0fd31371989505eec63b07899d 01-Aug-2012 Matt Turner <mattst88@gmail.com> build: Fix gtest out-of-tree build

Introduced by 3d000e7dd.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
test/Makefile.am
e939250b63f70c671b5d7654b6b326237b1e353e 01-Aug-2012 Matt Turner <mattst88@gmail.com> build: Fix out-of-tree generation of api_exec_es{1,2}.c

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/Makefile.am
5c2a6b74ed67021545b0f89fec558dacde37792e 01-Aug-2012 Matt Turner <mattst88@gmail.com> build/sources.mak: Add src/glsl/glcpp to INCLUDE_DIRS

Fixes problem where libdricore's of-out-tree build couldn't find
glcpp.h.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/sources.mak
fa7417521045d9bf6eea32607066543bd3ce07bb 01-Aug-2012 Matt Turner <mattst88@gmail.com> build/sources.mak: Remove unused GLSL_LIBS

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/sources.mak
707f0679157f83ac45127e41647b96ed924d45c9 11-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Kill GL_ARB_shadow_ambient with fire

No driver supports this extension, and it seems unlikely than any driver
ever will. I think r300c may have supported it at one time, but that
driver has already been removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
allium/drivers/r300/compiler/radeon_compiler.h
allium/drivers/r300/compiler/radeon_program_tex.c
esa/main/attrib.c
esa/main/extensions.c
esa/main/mtypes.h
esa/main/samplerobj.c
esa/main/texobj.c
esa/main/texparam.c
esa/program/prog_statevars.c
esa/program/prog_statevars.h
esa/swrast/s_texfilter.c
b49771970bb8d06a179da69a7eb6b0af1b379d2d 01-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Inline immediate offset when lowering implicit parameters
allium/drivers/radeon/R600ISelLowering.cpp
2fae8227ad906a6d6290134368b62f5dd3a1858e 13-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Use correct opcocde for BREAK_LOGICALNZ_i32
allium/drivers/r600/r600_shader.c
allium/drivers/radeon/R600CodeEmitter.cpp
605f964d5cc7016fc74e0563829fa794da845c20 13-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> mesa: Use GLdouble for depthMax in final unpack conversions.

The final step of _mesa_unpack_depth_span is to take the temporary
GLfloat depth values and convert them to the desired format. When
converting to GL_UNSIGNED_INTEGER with depthMax > 0xffffff, we use
double-precision math to avoid overflow and precision problems.

Or at least that's the idea. Unfortunately

GLdouble z = depthValues[i] * (GLfloat) depthMax;

actually causes single-precision multiplication, since both operands are
GLfloats. Casting depthMax to GLdouble causes the scaling to be done
with double-precision math.

Fixes a regression in oglconform's depth-stencil basic.read.ds test
since c60ac7b17993d28af65b04f9bbbf3ee74c35358c, where the expected and
actual values differed slightly. For example, 0xcfa7a6 vs. 0xcfa7a4.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=49772
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/pack.c
43e3a7533d5537e48cef23588131dd25d938ee4b 14-Aug-2012 Eric Anholt <eric@anholt.net> i965: Fix the scaling of seconds to ms in perf debug.

*headdesk*
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_vec4_emit.cpp
d60692601388b5448fb0ed4eb894103293b2f074 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i965: Validate API and version in brwCreateContext

v2: Use base-10 for versions like gl_context::Version. Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_context.c
esa/drivers/dri/i965/brw_context.h
esa/drivers/dri/intel/intel_screen.c
db273724c9484d513f5caa34729475d2873d9f7b 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i915: Validate API and version in i915CreateContext

v2: Use base-10 for versions like gl_context::Version. Suggested by Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i915/i915_context.c
esa/drivers/dri/i915/i915_context.h
esa/drivers/dri/intel/intel_screen.c
a81e4b3e9272f70ab9074f1c133dda94c58daeff 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> i830: Validate API and version before calling i830CreateContext

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
esa/drivers/dri/intel/intel_screen.c
2b636243265f0f09b7fd8d42046119222a63cad4 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> intel: In the i915 driver, the chipset cannot be i965

In the i965 dirver, the chipset must be i965.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/intel/intel_screen.c
70f47505a2e5d4cf949b7c2650f3d9f6559bacb3 07-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> dri: Pass API_OPENGL_CORE through to the drivers

This forces the drivers to do at least some validation of context API
and version before creating the context. In r100 and r200 drivers, this
means that they don't do any post-hoc validation.

v2: Actually reject compatibility profile 3.2+ contexts. Thanks Ken.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/common/dri_util.c
esa/drivers/dri/intel/intel_screen.c
esa/drivers/dri/nouveau/nouveau_context.c
esa/drivers/dri/r200/r200_context.c
esa/drivers/dri/radeon/radeon_context.c
esa/drivers/dri/swrast/swrast.c
7e81f553bccda66fafa769f8456b4918d088181a 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Filter a bunch more functions based on API

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/api_exec.c
0fef911ce4c8b35311213cab36f1d8510cf6f814 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't advertise extensions that are part of GL 1.5 in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/extensions.c
aa0b1e902b33f95a2aa7c822239bd960fce13b1b 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't advertise extensions that are part of GL 1.4 in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/extensions.c
213945385a1fb24e57d5d9609a9f4ec0ead41cae 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't advertise extensions that are part of GL 1.3 in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/extensions.c
7ef1869d69005c523ad81b23060ed02e306073f3 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't advertise extensions that are part of GL 1.2 in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/extensions.c
4d39b8631587e59416d7b956fa147f00c6b6b174 08-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa: Don't advertise deprecated extensions in a core context

It may be possible to trim the list of extensions futher. These are
just the obvious extensions that add functionality that the core context
explicitly forbids. Apple's core-context extension list is *just* the
extensions on top of the core GL version. I'm not sure we want to go
that far, but removing some things that have been in core since 2.1 may
be okay.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/extensions.c
cd4a61100da889afec96dc79b33a88b7b8049cec 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build: Fix libdricore out-of-tree builds (v2)

v2: Add both top_srcdir and top_builddir to mesa asm include dirs.
These require both in-tree and build-time-generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
esa/libdricore/Makefile.am
73fef0178ad9fb0fc47679fcc485144b4ef08fb6 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build/mapi: More killing of TOP in favour of top_srcdir

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
api/es1api/Makefile
api/glapi/gen/glapi_gen.mk
77a3efc6b907943903190b385fdf107c4acfcdca 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build/glsl: fix location of generated files.

Like in src/mesa, use GLSL_BUILDDIR/GLSL_SRCDIR to unambiguously
distinguish between in-tree and generated files.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
lsl/Makefile.am
lsl/Makefile.sources
lsl/glcpp/Makefile.am
37a1b8083e7f7a6c3abe3843cfaed84163f2d19f 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build/glapi: fix includes for generated files

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
api/glapi/Makefile.am
3fe69bac498aa87052768507a04c640050ee9d98 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build: fix out of tree generation of glapi_mapi_tmp.h

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
api/glapi/gen/Makefile.am
726f534bbb3f0356fbd5ceef7a1bba23024b4147 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build/glx: fix include paths for out-of-tree builds

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
lx/Makefile.am
b2ecaab7ad671f97840867c26869e0accf25592c 18-Jul-2012 Christopher James Halse Rogers <christopher.halse.rogers@canonical.com> build: fix location of generated files in src/mesa (v4)

Also fix include paths for the generated headers.

v2: Switch to using self-explanatory BUILDDIR/SRCDIR defined from
top_builddir/top_srcdir rather than the ambiguous TOP.
v3: Add both top_builddir and top_srcdir to include flags for mesa asm.
These rely on both in-tree and build-time-generated includes.
v4: Rebased on top of 948c8f502a.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Christopher James Halse Rogers <christopher.halse.rogers@canonical.com>
Signed-off-by: Matt Turner <mattst88@gmail.com>
lx/apple/Makefile
esa/Makefile.am
esa/libdricore/Makefile.am
esa/sources.mak
4e087de51ad0e7ba4a7199d3664e1d096f8dc510 10-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> intel: Reserve enough space to finish occlusion queries on Gen6.

After realizing that brw_finish_batch emitted some final PIPE_CONTROLs
to record occlusion queries, Chris noted that we probably hadn't
reserved enough space to actually emit them.

Reserving a full 60 bytes seems a bit harsh, since we only need that
much if occlusion queries are actually active. Plus, 28 bytes would be
sufficient for Gen7, and 24 for Gen4-5.

We could optimize this in the future, but it doesn't seem too critical.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vtbl.c
esa/drivers/dri/intel/intel_batchbuffer.h
9da50667f490ba2c6240f4c91c9707e3f181adae 10-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> intel: Move finish_batch() call before MI_BATCH_BUFFER_END and padding.

On Gen4+, brw_finish_batch() calls brw_emit_query_end(), which emits
some extra PIPE_CONTROLs to capture the current occlusion query data.
Unfortunately, it was being called *after* _intel_batchbuffer_flush
added the MI_BATCH_BUFFER_END, meaning those PIPE_CONTROLs didn't get
inside the batch.

Not only does this likely cause bogus occlusion query values, it can
also cause crashes: with the recent change to use 64-bit depth count
writes on Gen6+, we started emitting an odd-length PIPE_CONTROL, which
happened after the MI_NOOP padding. This resulted in an odd-length
batch buffer, which resulted in execbuf2 returning -EINVAL and the
application dying with an intel_do_flush_locked failure.

On older generations, finish_batch() doesn't emit any state, so this
change shouldn't have any effect.

Huge thanks to Chris Wilson for helping me figure this out.

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53311
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/intel/intel_batchbuffer.c
006c1a3c652803e2ff8d5f7ea55c9cb5d8353279 07-Aug-2012 Eric Anholt <eric@anholt.net> i965: Add perf debug for stalls during shader compiles.

v2: fix bad comment from before I gave up and decided to just use doubles.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/intel/intel_screen.c
esa/drivers/dri/intel/intel_screen.h
97a5f0ff2eb3a6e8b303ce402a4e1d9be7e7b323 12-Jul-2012 Eric Anholt <eric@anholt.net> i965: Add performance debug for when the state cache gets nuked.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_state_cache.c
fc3b7c9b56701f23b002543de33a8d8c43f9bdc2 12-Jul-2012 Eric Anholt <eric@anholt.net> i965: Add performance debug for shader recompiles.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_context.h
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_program.h
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_wm.c
esa/drivers/dri/i965/brw_wm.h
b4da272a6ea58a7c81c71477d65d82651555709a 12-Jul-2012 Eric Anholt <eric@anholt.net> i965: Add performance debug for fast clear fallbacks.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_clear.c
0e723b135bfd59868c92c3ae243f1adaedaec3a5 12-Jul-2012 Eric Anholt <eric@anholt.net> intel: Add performance debug for some common GPU stalls.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_queryobj.c
esa/drivers/dri/intel/intel_buffer_objects.c
esa/drivers/dri/intel/intel_regions.c
4cfb9e30000eea9cb1f316ace9347083b619cdb0 12-Jul-2012 Eric Anholt <eric@anholt.net> i965: Add performance debug for register spilling.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vs.c
esa/drivers/dri/i965/brw_wm.c
d72ff03e699e78381049e29d89163519e6730dd4 12-Jul-2012 Eric Anholt <eric@anholt.net> i965: Add INTEL_DEBUG=perf for failure to compile 16-wide shaders.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_fs_reg_allocate.cpp
esa/drivers/dri/intel/intel_context.h
79198063b8adb23536b291081f8df8571926950e 12-Jul-2012 Eric Anholt <eric@anholt.net> intel: Rename INTEL_DEBUG=fall to INTEL_DEBUG=perf.

I want to introduce some more debug output for performance surprises that
includes fallbacks, but aren't necessarily software rasterization. Leave
INTEL_DEBUG=fall in place for those that have used that flag before.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i915/i915_program.c
esa/drivers/dri/i915/intel_tris.c
esa/drivers/dri/i965/brw_fallback.c
esa/drivers/dri/i965/brw_urb.c
esa/drivers/dri/intel/intel_context.c
esa/drivers/dri/intel/intel_context.h
esa/drivers/dri/intel/intel_tex_copy.c
bf6c1b74705243efdd43f07d381768fceede1f91 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> meta: texture rectangle textures may not have mipmaps

Avoid INVALID_OPERATION error if decompressing rectangle texture.
Setting mipmap level limits for those textures is error that must not be
hit by meta code to mislead user.

[v3/Kayden]: Resolve conflicts due to Eric picking a subset of Pauli's
original changes.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/common/meta.c
b9daa834633f0e012a35f67cf232464e5cb3b9b6 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> meta: Use sampler object for mipmap generation

Sampler objects are perfect for meta operations.Sampler object
is separate state object that shadows the sampling state in texture
object. With sampler object mipmap can maintain same sampling state for
all subsequent generation requests.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/common/meta.c
ac4dc5e9312f3ef154135a68521e7a20c88b7837 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> mesa/samplerobj: Avoid crash in sampler query if texture unit is disabled

Sampler queries are so far made only for enabled texture unit. But if
any code would query sampler before checking texture unit state that
would result to NULL deference.

Making the inline helper easier to use with NULL check makes a lot sense
because compiler is likely to combine the checks for the current texture.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/samplerobj.h
5606bd574e264c4beda8eb1d10b48d17e9b8b497 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> mesa: Remove unnecessary parameters CompressedTexImage

In tune with previous patches. Again there is duplication of information
in function parameters that is good to remove.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/nouveau/nouveau_texture.c
esa/main/dd.h
esa/main/teximage.c
esa/main/texstore.c
esa/main/texstore.h
esa/state_tracker/st_cb_texture.c
c9a7dfcf92e6adb4b85338c2c8dbbfbaf39fbfe7 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> mesa: Remove unnecessary parameters from AllocTextureImageBuffer

Size and format information is always stored in gl_texture_image
structure. That makes it preferable to remove duplicate information from
parameters to make interface easier to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_tex.c
esa/drivers/dri/intel/intel_tex_image.c
esa/drivers/dri/radeon/radeon_texture.c
esa/main/dd.h
esa/main/mipmap.c
esa/main/texstore.c
esa/state_tracker/st_cb_texture.c
esa/swrast/s_texture.c
esa/swrast/swrast.h
c5af8891805fc4f590c1371c098cdbc704c44e00 12-Jun-2012 Pauli Nieminen <pauli.nieminen@linux.intel.com> mesa: Remove unnecessary parameters from TexImage

gl_texture_image structure always holds size and internal format before
TexImage driver hook is called. Those passing same information in
function parameters only duplicates information making the interface
harder to understand.

Signed-off-by: Pauli Nieminen <pauli.nieminen@linux.intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_tex_image.c
esa/drivers/dri/nouveau/nouveau_texture.c
esa/drivers/dri/radeon/radeon_texture.c
esa/main/dd.h
esa/main/teximage.c
esa/main/texobj.c
esa/main/texstore.c
esa/main/texstore.h
esa/state_tracker/st_cb_texture.c
4c73282d2bfa8fa52acdb3ac32c5eca260bad792 09-Aug-2012 Chí-Thanh Christopher Nguyễn <chithanh@gentoo.org> gbm: Fix build without gallium_drm_loader

pipe_loader_drm_probe_fd only exists if HAVE_PIPE_LOADER_DRM is defined.
Patch improved as suggested by Vadim A. Misbakh-Soloviov.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=52962
allium/targets/gbm/gbm.c
9f5ff5981cfc1b1eb613890e4f8cec6a448611cc 03-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move drawing into new state handling

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/evergreen_hw_context.c
allium/drivers/radeonsi/r600.h
allium/drivers/radeonsi/si_state.h
allium/drivers/radeonsi/si_state_draw.c
583c212115795bef65da92761180ce830fafc927 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move sync handling into new state handler

So we can remove all the old atom handling.

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/Makefile.sources
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/r600_state_common.c
allium/drivers/radeonsi/radeonsi_pipe.c
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/radeonsi_pm4.c
allium/drivers/radeonsi/radeonsi_pm4.h
allium/drivers/radeonsi/si_commands.c
allium/drivers/radeonsi/si_state.h
allium/drivers/radeonsi/si_state_draw.c
303f4b7dcddee384d6f1dc1027cbdee840a38d7d 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: separate and disable streamout for now

I have my doubts that this code still works on SI.

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/Makefile.sources
allium/drivers/radeonsi/evergreen_hw_context.c
allium/drivers/radeonsi/r600.h
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/r600_hw_context_priv.h
allium/drivers/radeonsi/radeonsi_pipe.c
allium/drivers/radeonsi/si_state.c
allium/drivers/radeonsi/si_state.h
allium/drivers/radeonsi/si_state_draw.c
allium/drivers/radeonsi/si_state_streamout.c
696b6cf46609281711add5331b9c3e1d0240ecbc 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: remove ps_partial_flush

Not needed any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/evergreen_hw_context.c
allium/drivers/radeonsi/r600.h
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/si_state_draw.c
7acb194a7bb4534674bccc351771915ea60d0869 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: remove r6xx_flush_and_inv atom

It is not used any more.

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/r600_state_common.c
allium/drivers/radeonsi/radeonsi_pipe.h
708337e62e86cfb2df893f0733bb7c5a4938fab6 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: move init state to new state handling

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/evergreen_hw_context.c
allium/drivers/radeonsi/r600_hw_context.c
allium/drivers/radeonsi/r600_hw_context_priv.h
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/si_state.c
862df0885aa04ef68319382fc2df27a7b68fc0dd 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: add support for PKT3 cmds to new state handling

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/radeonsi_pm4.c
allium/drivers/radeonsi/radeonsi_pm4.h
ce40e4726cf30196b87df387255c64ddc2a97638 02-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: cleanup shader headers

Signed-off-by: Christian König <deathsimple@vodafone.de>
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/radeonsi_shader.c
allium/drivers/radeonsi/radeonsi_shader.h
allium/drivers/radeonsi/si_state.c
allium/drivers/radeonsi/si_state.h
allium/drivers/radeonsi/si_state_draw.c
16c702ef3b9cff320c2adbfa853e00088adbf689 10-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: fix softpipe_delete_fs_state() failed assertion

The var!=softpipe->fs_variant assertion was failing because we weren't
nulling the softpipe->fs_variant pointer when binding a new shader.
Since softpipe->fs_variant depends on the current fs, it's of no use
when a new FS is bound.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/softpipe/sp_state_shader.c
3487b93cc4b8bea44f966a4f5cfd29b26dbbcff2 10-Aug-2012 Brian Paul <brianp@vmware.com> cso: rearrange some structure fields for consistency
allium/auxiliary/cso_cache/cso_context.c
cf77c29e6015d177c046adee3c48589cc9fb5015 10-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: fix renderbuffer validation bug

After we attach a new renderbuffer in this function we need to make
sure Mesa's update_framebuffer() gets called.

Fixes crash in WebGL conformance/textures/texture-attachment-formats.html,
but the test still fails for other reasons.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_cb_fbo.c
f7af4beae5e25c060d4f2c53d55b0e87ee9bdaeb 10-Aug-2012 Brian Paul <brianp@vmware.com> gallivm: fix crash in lp_sampler_static_state()

Fixes WebGL conformance/uniforms/uniform-default-values.html crash.

We need to check for the null view pointer before accessing view->texture.

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

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
allium/auxiliary/gallivm/lp_bld_sample.c
9b04abe36812a34ba447e5b1f8d8e44a10510820 10-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: fix glCopyTexSubImage crash

Fixes a WebGL crash. The dest texture image is at level 2 and is of
size 1x1 texel. The st texture image is a stand-alone resource, not
a pointer into a complete mipmap. So the resource has one level and
trying to write to level 2 blows up.

Fixes http://bugs.freedesktop.org/show_bug.cgi?id=53314
and http://bugs.freedesktop.org/show_bug.cgi?id=53319

Note: This is a candidate for the 8.0 branch.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_cb_texture.c
6cb9e99a757bd5a9d908ed6c5515a9ae5fb041ba 09-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Always downsample in intel_miptree_map_multisample

Always downsample before mapping, even if the map mode contains
GL_MAP_INVALIDATE_RANGE_BIT. If we neglect to downsample when only
a subrect is mapped then the upsample in intel_miptree_unmap_multisample
may write garbage to the region outside the subrect.

(Eric gave my patch e88cfbb a conditional reviewed-by with the condition
that it always downsample before mapping. I forgot to make that change
before pushing the patch.)

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.c
04a11b5f5e22155e5816e2da560b485eb0eaaec9 28-Jul-2012 Eric Anholt <eric@anholt.net> i965/gen6+: Add support for edge flags.

Fixes the 3 new piglit edgeflag tests.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=40707
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_defines.h
esa/drivers/dri/i965/brw_draw_upload.c
esa/drivers/dri/i965/brw_vs.c
b3367f56d880550befb31a0100c448e1d607915f 28-Jul-2012 Eric Anholt <eric@anholt.net> i965/vs: Convert EdgeFlagPointer values appropriately for the VS on gen4.

Fixes piglit gl-2.0/edgeflag.

NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_draw_upload.c
3eb8d7122507600ca7c65f8f3fd0e9e9dee7a432 28-Jul-2012 Eric Anholt <eric@anholt.net> i965/vs: Add comment noting copy_edgeflag state dependency.

It's already in the state struct.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vs.c
e119f98472f6ceb03ffd564eb0398233e7b81437 27-Jul-2012 Eric Anholt <eric@anholt.net> i965/vs: Add support for copying user edge flags.

Fixes the glsl skinning demo regression since changing to the new GLSL
compiler, and is part of fixing piglit gl-2.0-edgeflag.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50079
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vec4_visitor.cpp
7426d9d7699452f15f3288e781e1791d8d00a64a 19-Jul-2012 Olivier Galibert <galibert@pobox.com> i965/fs: Fix the FS inputs setup when some SF outputs aren't used in the FS.

If there was an edge flag or a two-side-color pair present, we'd end up
mismatched and read values from earlier in the VUE for later FS inputs.

v2: Fix regression in gles2conform shaders generating point size. (change by
anholt)

Signed-off-by: Olivier Galibert <galibert@pobox.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
NOTE: This is a candidate for the 8.0 branch.
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_wm_pass2.c
34665381713249c29b7da5028396222dfea477c2 08-Aug-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Initialize tgsi_texture_offset Padding field.

Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_glsl_to_tgsi.cpp
68bccc40f55aee7f4af8eb64b15a95f0b49d6a17 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> glx/dri: Initialize reset to __DRI_CTX_RESET_NO_NOTIFICATION.

If the application has requested reset notification, then
dri2_convert_glx_attribs will initialize this to the correct value.

Otherwise, it's supposed to initialize this to NO_NOTIFICATION, but
doesn't when num_attribs == 0. (The consensus seems to be that we
should make it do so, but that's more invasive, so I'm pushing this for
now.)

Fixes a regression since a8724d85f8cb2f0fb73b9c6c1f268f9084c6d473
where trying to run OilRush_x86 or apitrace heaven_x64 would result in:

dri_util.c:221: dri2CreateContextAttribs: Assertion `!"Should not get
here."' failed.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=53076
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
lx/dri2_glx.c
lx/drisw_glx.c
94f22fbe787214580a1a13a774114d2650c166cb 08-Aug-2012 Tapani Pälli <tapani.palli@intel.com> intel: use _mesa_meta_Clear with OpenGL ES 1.1 v2

Patch changes i915 and i965 drivers to use fixed function version of
meta clear when running on ES 1.1. This fixes rendering errors seen with
Google Maps, Angry Birds and Gallery3D on Android platform.

Change 88128516d43be5d25288ff5b64db63cda83c04b3 exposes all extensions
internally to be available independent of GL flavour, therefore check
against ARB_fragment_shader does not work.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=50333
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i915/intel_clear.c
esa/drivers/dri/i965/brw_clear.c
5deb1d1a1f9e3354597569032af9bdf27d629cca 08-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Rework the extra flushes surrounding occlusion queries.

This removes the CS stall on Ivybridge.

On Sandybridge, the depth stall needs to be preceded by a non-zero
post-sync op, which requires a CS stall, which needs a stall at
scoreboard. Emit the full workaround.

Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Cc: Eric Anholt <eric@anholt.net>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_queryobj.c
b0adbda75a092a92211bb519a395494532ddb17e 07-Aug-2012 Eric Anholt <eric@anholt.net> i965/vs: Protect pow(x,y) MOV of y on gen4 from other instruction flags.

I don't know if it was possible to trigger this bug -- we don't merge
saturates into the math instruction because we're bad at coalescing currently,
and there's nothing generating these with predicates. Still, let's avoid
future bugs when we do smarter codegen.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vec4_emit.cpp
9b4053cabd8bda180b352d2d2047209f6ca5f6e8 06-Aug-2012 Eric Anholt <eric@anholt.net> i965: Drop the confusing saturate argument to math instruction setup.

This was ridiculous. We were ignoring the inst->header.saturate flag in the
case of math and only math. On gen4, we would leave inst->header.saturate in
place if it happened to be set, which would end up being applied to the
implicit mov and thus trash the first argument. On gen6, we would overwrite
inst->header.saturate with the saturate flag from the argument, which was not
set appropriately in brw_vec4_emit.cpp, and was only not a bug due to our
incompetence at coalescing saturate moves.

By ripping the argument out and making saturate work just like all the other
brw_eu_emit.c code generation, we can avoid both these classes of bugs.

Fixes piglit fog-modes, and the new specific fs-saturate-exp2 case.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=48628
NOTE: This is a candidate for the 8.0 branch.
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_eu.h
esa/drivers/dri/i965/brw_eu_emit.c
esa/drivers/dri/i965/brw_eu_util.c
esa/drivers/dri/i965/brw_fs_emit.cpp
esa/drivers/dri/i965/brw_sf_emit.c
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_vs_emit.c
esa/drivers/dri/i965/brw_wm_emit.c
33dfdc735e052d9c9b33883350e926d40220b6ac 09-Aug-2012 Eric Anholt <eric@anholt.net> i965: Make brw_set_saturate() use stdbool.

There was a chance for brw_wm_emit.c to screw up and pass (1 << 4) instead of
1, which would get converted to 0 when stored. Instead, use stdbool which
converts nonzero to true/1 like we want.
esa/drivers/dri/i965/brw_eu.c
esa/drivers/dri/i965/brw_eu.h
1b148e660e4cefcfbdc65ef8a58a7e52e8820782 06-Aug-2012 Eric Anholt <eric@anholt.net> mesa: In conditional rendering fallback, check the query status.

Otherwise, conditional rendering always takes the fallthrough "render it
anyway" case unless the application had itself done a check or wait on the
query.

Fixes intel oglconform's conditional_render advanced.nofbo.readpixels.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
esa/main/condrender.c
4bbd12036819ed6a2d0993c437e0c02bf0c92b0b 01-Aug-2012 Eric Anholt <eric@anholt.net> mesa: Fix glPopAttrib() behavior on GL_FRAMEBUFFER_SRGB.

I happened to notice this while looking at a blit pass in l4d2, which had an
optional push/pop around framebuffer srgb setting. It didn't matter in the
end, but the fix is sitting in my tree now.

Reviewed-by: Brian Paul <brianp@vmware.com>
NOTE: This is a candidate for the 8.0 branch.
esa/main/attrib.c
5602f0f955f370735d4487003bcfb5eb08a6f946 01-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/tests: Fix trivial typos in src/mapi/glapi tests

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
api/glapi/tests/check_table.cpp
45d3d0ad2154ccfa0fc1d02c943cefccb5f67b5b 01-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/tests: Add tests for the generated shared-glapi dispatch table

These are largely based on the src/mapi/glapi/tests. However,
shared-glapi provides less external visibility into the dispatch table,
so there is less to test. Also, shared-glapi does not implement
_glapi_get_proc_name, so that test was removed.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
api/shared-glapi/tests/.gitignore
api/shared-glapi/tests/Makefile.am
api/shared-glapi/tests/check_table.cpp
d9f899bb93c4faa202acb8703aad70c5a5b2fcf1 01-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> glapi: Prevent accidental use of lies w/shared-glapi

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
api/glapi/gen/gl_table.py
99fee476a102be898a1a093c037e06382f90a5b9 01-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> glx: Don't use glapitable.h at all

When --enable-shared-glapi is used, all non-ABI entries in the table are
lies. Avoiding the use of glapitable.h avoids the lies. The only
entries used in this code are entries that are ABI. For these, the ABI
offset can be used directly.

Since this code is in src/glx, it can't use src/mesa/main/dispatch.h to
get the pretty names for these offsets.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
lx/glxclient.h
lx/single2.c
lx/singlepix.c
api/glapi/gen/glX_proto_send.py
f5dffb7e36487ff8a012725aaf78a4b7d3169102 01-Aug-2012 Ian Romanick <ian.d.romanick@intel.com> glx: Don't rely on struct _glapi_table

When --enable-shared-glapi is used, all non-ABI entries in the table are
lies. There are two completely separate code generation paths used to
assign dispatch offset. Neither has any clue about the other.
Unsurprisingly, the can't agree on what offsets to assign.

This adds a bunch of overhead to __glXNewIndirectAPI, but this function
is called at most once.

The test ExtensionNopDispatch was removed. There was just no way to
make this test work with the information provided in shared-glapi.
Since indirect_glx.c uses _glapi_get_proc_offset now, it was also
impossible to make the tests work without shared-glapi. So much pain.

This fixes indirect rendering with shared-glapi.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
lx/tests/Makefile.am
lx/tests/indirect_api.cpp
api/glapi/gen/glX_proto_send.py
52d6df8aa7231c1d4d80a8599af0e2c5d02c7b6c 31-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> mesa/tests: Don't build glapi tests with shared-glapi

This fixes 'make check' on with --enable-shared-glapi. This test cannot work
in that environment.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
api/glapi/tests/Makefile.am
e45a9ce474c3562f16c8a773260752d77a4fed5c 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Use 64-bit writes for occlusion queries.

The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits. Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
20c09b82d0520843f1c168adaf9bd5d17a572085 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Refactor depth count write PIPE_CONTROLs into a helper function.

This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
a2cdd5ada8ae315acbc4225398b7cbf78181f610 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Emit a CS stall before timestamp writes.

This implements one of the Sandybridge PIPE_CONTROL workarounds. It
doesn't appear to be required for Ivybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
c4c78c275abffe8d1014b1355f02239859d6aa2b 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Use 64-bit writes for timestamp queries.

The hardware seems to use the length of the PIPE_CONTROL command to
indicate whether the write is 64-bits or 32-bits. Which makes sense
for immediate writes.

Daniel discovered this by writing a pattern into the query object bo
and noticing that the high 32-bits were left intact, even on those
pipe control writes that seemingly worked.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
03f14664b6b12bc7853866fe613d8af350e51e08 07-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Refactor timestamp write PIPE_CONTROLs into a helper function.

This consolidates the complexity in one place, which is important
because it's about to get even more complicated.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
61d0b9f52c6be4a4a64c30ea3a2a93ef8260c67b 26-Jul-2012 Kenneth Graunke <kenneth@whitecape.org> intel: Make the length for PIPE_CONTROL explicit.

PIPE_CONTROL has variable length, depending upon generation and whether
we want to do 32-bit or 64-bit data writes. Make it explicit, rather
than hiding a length of 4 in the #define for _3DSTATE_PIPE_CONTROL.

Generated by s/3DSTATE_PIPE_CONTROL/3DSTATE_PIPE_CONTROL | (4 - 2)/g.
This is equivalent since the #define used to have | 2 in it. A grep
through the sources shows that all instances have been converted, so
it's safe to remove the | 2 from the #define.

Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_queryobj.c
esa/drivers/dri/i965/gen6_vs_state.c
esa/drivers/dri/intel/intel_batchbuffer.c
esa/drivers/dri/intel/intel_reg.h
ecac178aa2591afc36e5d34d11a773ff07cb71b1 08-Aug-2012 Brian Paul <brianp@vmware.com> swrast: add missing switch case for API_OPENGL_CORE

To silence compiler warning.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/drivers/dri/swrast/swrast.c
b4d6502fcd4d779dfebefbf6e76110e046d9e1c1 08-Aug-2012 Brian Paul <brianp@vmware.com> gallivm: remove unused src_elem_type variable

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/auxiliary/gallivm/lp_bld_format_aos_array.c
f21669e9a2f07502e3c4b0633adcfab397fb0760 08-Aug-2012 Brian Paul <brianp@vmware.com> svga: remove unused svga_shader::use_sm30 field, add comments

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/svga/svga_context.h
allium/drivers/svga/svga_tgsi.h
16a289195eefeee9c711b89d8917a3408c660cd7 08-Aug-2012 Brian Paul <brianp@vmware.com> svga: remove unused svga_winsys_handle type

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/svga/svga_winsys.h
82cd9c0fc2838a153006a646b0d356ed54b8680e 08-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: If pixel shader compilation fails, use a dummy shader.

Otherwise we're likely to hang the GPU.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_pipe.c
allium/drivers/radeonsi/radeonsi_pipe.h
allium/drivers/radeonsi/radeonsi_shader.c
allium/drivers/radeonsi/si_state_draw.c
be42a45e023aed5fd82647719bb81bee49a9a2ac 03-Aug-2012 Christian König <deathsimple@vodafone.de> radeonsi: fix memory leak and/or segfaults

Fix a stupid typo that could lead to memory
leaks and/or segfaults.

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/drivers/radeonsi/radeonsi_pm4.c
8c44e5a144009a03c20befa6468d19d41c802795 06-Aug-2012 Christian König <deathsimple@vodafone.de> radeon/winsys: fix winsys VM handling

Move releasing the VM area after closing the bo handle.

This partially fixes: https://bugs.freedesktop.org/show_bug.cgi?id=45018

Signed-off-by: Christian König <deathsimple@vodafone.de>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
allium/winsys/radeon/drm/radeon_drm_bo.c
7528e2104fdda88a9eca5d84d979a21f5c517dc9 07-Aug-2012 Vinson Lee <vlee@freedesktop.org> translate: Fix typo in is_legal_int_format_combo.

Fixes same on both sides defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/auxiliary/translate/translate_generic.c
1ea263fccb9259218addec9e805db075be9eba7c 07-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: remove unused parameters in texture functions
allium/drivers/r600/r600_texture.c
4a078516b6e9dd6876aaa2c95f0a98b7f5e08d19 27-Jun-2012 Eric Anholt <eric@anholt.net> i965: Enable uniform buffer objects on gen6+.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_extensions.c
04871058eb01c5b51a0180055e7dbdc967f56604 25-Jun-2012 Eric Anholt <eric@anholt.net> i965/vs: Add support for loading uniform buffer variables as pull constants.

Unlike the FS side in the previous commit, this does variable indexing just
fine, using the same code as we used for other variable-indexed pull
constants.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vec4_visitor.cpp
esa/drivers/dri/i965/brw_vs.c
90de96ff0d6d54ba0f9a337a6a107acf4134682d 21-Jun-2012 Eric Anholt <eric@anholt.net> i965/fs: Add support for loading uniform buffer variables as pull constants.

Variable array indexing isn't finished, because the lowering pass
turns it all into conditional moves of constant index accesses so I
can't test it.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_fs_visitor.cpp
esa/drivers/dri/i965/brw_shader.cpp
bb020d09c382285210a5aebe412ddabfad19e4a0 25-Jun-2012 Eric Anholt <eric@anholt.net> i965/vs: Add a surface index to VS_OPCODE_PULL_CONSTANT instructions.

Similar to the previous commit for the fragment shader, now we have a buffer
index and an offset.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_vec4.h
esa/drivers/dri/i965/brw_vec4_emit.cpp
esa/drivers/dri/i965/brw_vec4_visitor.cpp
454dc83f66643e66ea7ee9117368211f0cfe84d7 21-Jun-2012 Eric Anholt <eric@anholt.net> i965/fs: Communicate the pull constant block read parameters through fs_regs.

I wanted to add the surface index as a variable value for UBO support,
and a reg seemed like the obvious way to go. This exposes more of the
information to CSE, which we'll probably want to apply to pull
constant loads for UBOs eventually (you might access 4 floats in a
row, each of which would produce an oword block read of the same
block).

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_fs.cpp
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_emit.cpp
25d2bf3845e9a6faaef8d808c1255ec57dc71dba 20-Jun-2012 Eric Anholt <eric@anholt.net> i965: Bind UBOs as surfaces like we do for pull constants.

v2: Comment fix, drop extraneous parens (review by Kenneth)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_context.h
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_state_upload.c
esa/drivers/dri/i965/brw_vs.c
esa/drivers/dri/i965/brw_vs_surface_state.c
esa/drivers/dri/i965/brw_wm_surface_state.c
5bffbd7ba2ba2ff21469b2a69a0ed67f0802fec7 20-Jun-2012 Eric Anholt <eric@anholt.net> i965: Add an offset argument to constant buffer setup.

We'll use this for UBO surfaces.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/i965/brw_state.h
esa/drivers/dri/i965/brw_vs_surface_state.c
esa/drivers/dri/i965/brw_wm_surface_state.c
esa/drivers/dri/i965/gen7_wm_surface_state.c
esa/drivers/dri/intel/intel_context.h
5fc5b29a543a7a229bf03f8f9f37ed4c592a67e7 31-Jul-2012 Eric Anholt <eric@anholt.net> mesa: Add support for glUniformBlockBinding() in display lists.

Fixes piglit GL_ARB_uniform_buffer_object/dlist.

v2: Use the .ui fields instead of .i for type consistency (review by Brian
Paul)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/dlist.c
bfa046b5f2e50a0297ecb7e325395367362c4c39 31-Jul-2012 Eric Anholt <eric@anholt.net> mesa: Unbind uniform buffer bindings on glDeleteBuffers().

Fixes piglit GL_ARB_uniform_buffer_object/deletebuffers.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/bufferobj.c
1eb3c06ae82cc962c5d867238acd089f833c2337 27-Jul-2012 Eric Anholt <eric@anholt.net> mesa: Default to GL 3.1's limits on uniform blocks.

The ARB spec lets you get away with the default block counting against the
blocks for combined size limits. The core spec says you need to be able to
support the maximum size of default block *and* the maximum size of each
uniform block. I see no reason that any driver would have a problem with
that.

Fixes gl 3.1/minmax (with an associated fix to the test)

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/context.c
803262a5f55ca5b94a09dfe8f35e64a579778209 26-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Refuse to parse uniform block declarations when UBOs aren't available.

Fixes piglit
GL_ARB_uniform_buffer_object/compiler/extension-disabled-block.frag

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/glsl_parser.yy
e45f1b11c081a7b965bf58539d2dbcc231d543f4 25-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Align GL_UNIFORM_BLOCK_DATA_SIZE according to std140 rules.

Fixes piglit GL_ARB_uniform_buffer_object/data-size test.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/link_uniforms.cpp
86e0045578cd8d8be7736a8f56e2b51d61bda32a 23-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Only flag RowMajor on matrix-type variables.

We were only propagating it to the API when the variable was a matrix type,
but we were still tripping over it in lower_ubo_reference when it was set on a
vector.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/ast_to_hir.cpp
ffb2d430596258aaeaf3b7ae7f295036ea4094d5 23-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Fix calculation of std140 offset alignment for mat2s.

We were getting the base offset of a vec2, not of a vec2[2] like the quoted
spec text says we should.

v2: Fix swapped then/else cases.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/glsl_types.cpp
300315fe69ba275dda8a4786783c2bdd007d0758 23-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Fix glGetActiveUniformsiv(GL_UNIFORM_BLOCK_INDEX).

Previously, we were returning the index into the UniformBlocks of one of the
linked shaders, when it's supposed to be the program global index.

Fixes piglit getactiveuniformsiv-uniform_block_index.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/link_uniforms.cpp
af3fc6bb2836ce545c624bce2b47c3fd8cf4f9fa 21-Jul-2012 Eric Anholt <eric@anholt.net> ir_to_mesa: Don't whack the ->location field of uniform block variables.

Fixes some failures in GL_ARB_uniform_buffer_object/maxblocks.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/program/ir_to_mesa.cpp
56e82e30cb60368bb3605f95130732f5edbab0a0 26-Jun-2012 Eric Anholt <eric@anholt.net> mesa: Make glBindBufferBase/glBindBufferRange() work on just-genned names.

In between glGenBuffers() and glBindBuffer(), the buffer object points to this
dummy buffer with a name of 0, and a glBindBufferBase() would point to that.
It seems pretty clear, given that glBindBufferBase() only cares about the
current size of the buffer at render time, that it should bind up the buffer
that you passed in instead of pointing it at this useless dummy buffer.

However, what should glBindBufferRange() do? As of this patch, it will
promote the genned buffer to a proper buffer like it had been
glBindBuffer()ed, and then detect that the size is greater than the buffer's
current size of 0 and throw INVALID_VALUE. It seems like the most reasonable
answer here.

Note that this also changes the behavior of these two on non-glGenBuffers() bo
names. We haven't yet set up the error throwing for glBindBuffers() on gl
3.1+, and my assumption is that these two functions should inherit their
behavior on un-genned names from glBindBuffers().

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/main/bufferobj.c
a75f2681d26aecad185895c1c2f13dd542281ff9 11-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Add a lowering pass to turn complicated UBO references to vector loads.

v2: Reduce the impenetrable code in emit_ubo_loads() by 23 lines by keeping
the ir_variable as the variable part of the offset from handle_rvalue(),
and track the constant offsets from that with a plain old integer value,
avoiding a bunch of temporary variables in the array and struct handling.
Also, fix file description doxygen.
v3: Fix a row vs col typo, and fix spelling in a comment.

Reviewed-by: Eric Anholt <eric@anholt.net>
lsl/Makefile.sources
lsl/ir_optimization.h
lsl/lower_ubo_reference.cpp
8c2a9838355cfd02356bf7b22eead408d909fe25 20-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Add a variant of the rvalue visitor for handle_rvalue() on the way down.

For the UBO lowering pass, I want to see the whole dereference chain for
replacing, not the innermost ir_dereference_variable.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/ir_rvalue_visitor.cpp
lsl/ir_rvalue_visitor.h
2ea3ab14f2182978f471674c9dfce029d37f70a7 10-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Add a "ubo_load" expression type for fetches from UBOs.

Drivers will probably want to be able to take UBO references in a
shader like:

uniform ubo1 {
float a;
float b;
float c;
float d;
}

void main() {
gl_FragColor = vec4(a, b, c, d);
}

and generate a single aligned vec4 load out of the UBO. For intel,
this involves recognizing the shared offset of the aligned loads and
CSEing them out. Obviously that involves breaking things down to
loads from an offset from a particular UBO first. Thus, the driver
doesn't want to see

variable_ref(ir_variable("a")),

and even more so does it not want to see

array_ref(record_ref(variable_ref(ir_variable("a")),
"field1"), variable_ref(ir_variable("i"))).

where a.field1[i] is a row_major matrix.

Instead, we're going to make a lowering pass to break UBO references
down to expressions that are obvious to codegen, and amenable to
merging through CSE.

v2: Fix some partial thoughts in the ir_binop comment (review by Kenneth)

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/ir.cpp
lsl/ir.h
lsl/ir_validate.cpp
esa/drivers/dri/i965/brw_fs_channel_expressions.cpp
esa/drivers/dri/i965/brw_fs_visitor.cpp
esa/drivers/dri/i965/brw_vec4_visitor.cpp
esa/program/ir_to_mesa.cpp
esa/state_tracker/st_glsl_to_tgsi.cpp
71ba6de342b88dcf8ed3aa347da157b7724230e7 21-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Fix a reference to UniformBlocks during uniform linking.

When converting var->location from pointing at the program's UniformBlocks to
pointing at the linked shader's UniformBlocks, I missed this change. It
usually worked out in the end because the two lists happen to be the same in
many testcases.

Fixes a valgrind complaint on
oglconform ubo-compile.cpp advanced.std140.2stage

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/link_uniforms.cpp
7e42302e7188a783221d2b17a4bb07ee89cae367 10-Jul-2012 Eric Anholt <eric@anholt.net> glsl: Update the notes on adding a new expression type.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
lsl/README
9c1b41879aab2ff7386c547a2ccce7686c018cf5 26-Jul-2012 Eric Anholt <eric@anholt.net> mesa: Replace VersionMajor/VersionMinor with a Version field.

As we get into supporting GL 3.x core, we come across more and more features
of the API that depend on the version number as opposed to just the extension
list. This will let us more sanely do version checks than "(VersionMajor == 3
&& VersionMinor >= 2) || VersionMajor >= 4".

v2: Fix a bad <= 30 check.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_screen.c
esa/drivers/dri/nouveau/nouveau_context.c
esa/drivers/dri/r200/r200_context.c
esa/drivers/dri/radeon/radeon_context.c
esa/main/enable.c
esa/main/fbobject.c
esa/main/get.c
esa/main/glformats.c
esa/main/mtypes.h
esa/main/texformat.c
esa/main/teximage.c
esa/main/texparam.c
esa/main/varray.c
esa/main/version.c
esa/state_tracker/st_manager.c
3aaeb3e5e76b7b468e2eb2a26f30d68d19d3c854 07-Aug-2012 Eric Anholt <eric@anholt.net> intel: Fix compiler warnings from winsys msaa.
esa/drivers/dri/i965/brw_blorp_blit.cpp
esa/drivers/dri/intel/intel_screen.c
e943e5c291c5f4c017f9f5a483f1940313333fc3 03-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Advertise multisample DRI2 configs on gen >= 6

This turns on window system MSAA.

This patch changes the id of many GLX visuals and configs, but that
couldn't be prevented. I attempted to preserve the id's of extant configs
by appending the multisample configs to the end of the extant ones. But
somewhere, perhaps in the X server, the configs are reordered with
multisample configs interspersed among the singlesample ones.

Test results:
Tested with xonotic and `glxgears -samples 1` on Ivybridge.

No piglit regressions on Ivybridge.

On Sandybridge, passes 68/70 of oglconform's
winsys multisample tests. The two failing tests are:
multisample(advanced.pixelmap.depth)
multisample(advanced.pixelmap.depthCopyPixels)
These tests hang the gpu (on kernel 3.4.6) due to
a glDrawPixels/glReadPixels pair on an MSAA depth buffer. I don't expect
realworld apps to do that, so I'm not too concerned about the hang.

On Ivybridge, passes 69/70. The failing case is
multisample(advanced.line.changeWidth).

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_screen.c
8b5d68dd28a78c2250bfc4a7fa62cd9e5cdd756e 02-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Clarify intel_screen_make_configs

This function felt sloppy, so this patch cleans it up a little bit.

- Rename `color` to `i`. It is not a color value, only an iterator int.
- Move `depth_bits[0] = 0` into the non-accum loop because that is where
it used. The accum loop later overwrites depth_bits[0].
- Rename `depth_factor` to `num_depth_stencil_bits`.
- Redefine `msaa_samples_array` as static const because it is never
modified. Rename to `singlesample_samples`.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_screen.c
a4bf68ca50da0ce291a464aec9b03a469ab2561a 02-Aug-2012 Chad Versace <chad.versace@linux.intel.com> dri: Simplify use of driConcatConfigs

If either argument to driConcatConfigs(a, b) is null or the empty list,
then simply return the other argument as the resultant list.

All callers were accomplishing that same behavior anyway. And each caller
accopmplished it with the same pattern. So this patch moves that external
pattern into the function.

Reviewed-by: <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
allium/state_trackers/dri/common/dri_screen.c
esa/drivers/dri/common/utils.c
esa/drivers/dri/intel/intel_screen.c
esa/drivers/dri/nouveau/nouveau_screen.c
esa/drivers/dri/radeon/radeon_screen.c
b2d428cb8d20e003b65769c7757a137406c671e6 12-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor creation of DRI2 configs

DRI2 configs were constructed in intelInitScreen2. That function already
does too much, so move verbatim the code for creating configs to a new
function, intel_screen_make_configs.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_screen.c
61fd6847827048ce9b01b1d164111472ad8bf593 12-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Downsample on DRI2 flush

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_screen.c
e88cfbb95f631ca1275a5cef4ccc5aaffb70aaba 28-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Support mapping multisample miptrees

Add two new functions: intel_miptree_{map,unmap}_multisample, to which
intel_miptree_{map,unmap} dispatch. Only mapping flat, renderbuffer-like
miptrees are supported.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.c
esa/drivers/dri/intel/intel_mipmap_tree.h
4c0ccc13bd3ec149c4a51c4937811894fbe713f0 28-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor use of intel_miptree_map

Move the opencoded construction and destruction of intel_miptree_map into
new functions, intel_miptree_attach_map and intel_miptree_release_map.
This patch prevents code duplication in a future commit that adds support
for mapping multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.c
81980958d0d3def26741cfe78b7c23f6635f826a 28-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor intel_miptree_map/unmap

Move the body of intel_miptree_map into a new function,
intel_miptree_map_singlesample. Now intel_miptree_map dispatches to the
new function. A future commit adds a multisample variant.

Ditto for intel_miptree_unmap.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.c
6b56140b4bafcef8bea5ca67cb31023a533c3bd4 27-Jul-2012 Chad Versace <chad.versace@linux.intel.com> i965: Mark needed downsamples for msaa winsys buffers

Add function intel_renderbuffer_set_needs_downsample. It is a no-op
except on multisample winsys buffers shared with DRI2.

Mark the needed downsamples with the new function at two locations:
- Immediately after drawing is complete.
- After blitting.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_blorp_blit.cpp
esa/drivers/dri/i965/brw_draw.c
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_fbo.h
d3746354fbfadf821dc108e072d86b5329737444 12-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Define functions for up/downsampling on miptrees

Flesh out the stub functions intel_miptree_{up,down}sample.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.c
6cc9df331b4799715b31d7ec606ad09fa914e260 07-Aug-2012 Chad Versace <chad.versace@linux.intel.com> i965: Add function brw_blorp_blit_miptrees

Define a function, brw_blorp_blit_miptrees, that simply wraps
brw_blorp_blit_params + brw_blorp_exec with C calling conventions. This
enables intel_miptree.c, in a following commit, to perform blits with
blorp for the purpose of downsampling multisample miptrees.

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/i965/brw_blorp.h
esa/drivers/dri/i965/brw_blorp_blit.cpp
f4873babdc27f697df9f4642209eca21a02ac476 19-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Allocate miptree for multisample DRI2 buffers

Immediately after obtaining, with DRI2GetBuffersWithFormat, the DRM buffer
handle for a DRI2 buffer, we wrap that DRM buffer handle with a region and
a miptree. This patch additionally allocates an accompanying multisample
miptree if the DRI2 buffer is multisampled.

Since we do not yet advertise multisample GL configs, the code for
allocating the multisample miptree is currently inactive.

This patch adds the following fields to intel_mipmap_tree:
singlesample_mt
needs_downsample
and the following function stubs:
intel_miptree_downsample
intel_miptree_upsample

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_context.c
esa/drivers/dri/intel/intel_mipmap_tree.c
esa/drivers/dri/intel/intel_mipmap_tree.h
4eba67285fb6b5d2dd4927e8dc4b3e2945435309 20-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor creation of hiz and mcs miptrees

Move the logic for creating the ancillary hiz and mcs miptress for winsys
and non-texture renderbuffers from intel_alloc_renderbuffer_storage to
intel_miptree_create_for_renderbuffer. Let's try to isolate complex
miptree logic to intel_mipmap_tree.c.

Without this refactor, code duplication would be required along the
intel_process_dri2_buffer codepath in order to create the mcs miptree.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com>
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_mipmap_tree.c
e2f2376e884225705e2369caee4a8c4e90e938f3 12-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Set num samples for winsys renderbuffers

Add a new param, num_samples, to intel_create_renderbuffer and
intel_create_private_renderbuffer.

No multisample GL config is yet advertised, so the value of num_samples is
currently 0. For server-owned winsys buffers, gl_renderbuffer::NumSamples
is not yet used.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_fbo.h
esa/drivers/dri/intel/intel_screen.c
53fa28f7b1f21251a3807abf1f234f52beff0256 11-Jul-2012 Chad Versace <chad.versace@linux.intel.com> intel: Refactor quantize_num_samples

Rename quantize_num_samples to intel_quantize_num_samples and change the
first param from struct intel_context* to struct intel_screen*. The
function will later be used by intelCreateBuffer, which is not bound to
any context but is bound to a screen.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Paul Berry <stereotype441@gmail.com> (v1)
Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_fbo.c
esa/drivers/dri/intel/intel_fbo.h
7a2e40ed283b70e1da8ea762959ca7462b0f2fc3 01-Aug-2012 Chad Versace <chad.versace@linux.intel.com> intel: Update stale comment for intel_miptree_slice::map

The comment referred to intel_tex_image_map/unmap, but should more
accurately refer to intel_miptree_map/unmap.

Signed-off-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/intel/intel_mipmap_tree.h
4b40375c438f9a10231dabedcf72bf6f27bbe327 06-Aug-2012 Paulo Zanoni <paulo.r.zanoni@intel.com> i965: add more Haswell PCI IDs

Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
esa/drivers/dri/intel/intel_chipset.h
esa/drivers/dri/intel/intel_context.c
99695f58fde6d364f2310d97303768782a1e537d 07-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: fix loop limit for tex_cache[] array

Fixes https://bugs.freedesktop.org/show_bug.cgi?id=53199
allium/drivers/softpipe/sp_flush.c
7d65356d8a4d268dce4c933d7704d709e1cdacfa 04-Aug-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Fix a potential memory leak in get_mesa_program.

Fixes resource leak defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_glsl_to_tgsi.cpp
c3894bc2d5d5eabdc913d88d1fedc552fef074a5 04-Aug-2012 Vinson Lee <vlee@freedesktop.org> gallivm: Add constructor for raw_debug_ostream.

Fixes uninitialized scalar field defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/auxiliary/gallivm/lp_bld_debug.cpp
b50703aea55450e04bcd8154335774786e0f253b 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl: Replace KHR_surfaceless_* extensions with KHR_surfaceless_context

KHR extension name is reserved for Khronos ratified extensions, and there is
no such thing as EGL_KHR_surfaceless_{gles1,gles2,opengl}. Replace these
three extensions with EGL_KHR_surfaceless_context since that extension
actually exists.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gl/drivers/dri2/egl_dri2.c
gl/main/eglapi.c
gl/main/eglcontext.c
gl/main/egldisplay.h
gl/main/eglmisc.c
allium/state_trackers/egl/common/egl_g3d.c
cb77f5dd1f6658fca671454c9b5be9a23c3bf3e4 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Refactor dereference of dri2_ctx_shared

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gl/drivers/dri2/egl_dri2.c
05413ddb1da5d4f17b6da891fd2d76cff4947979 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> egl_dri2: Remove swrast version >= 2 checks

Since support for swrast version 2 was added (f55d027a), it has also been
required. In swrast_driver_extensions, version 2 is set for __DRI_SWRAST
extension. Remove the spurious version checks sprinked through the code.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
gl/drivers/dri2/egl_dri2.c
63adb6b9eaa723f6bf9603f3f567e04451df857e 18-Jul-2012 Ian Romanick <ian.d.romanick@intel.com> dri2: Fix bug in attribute handling for non-desktop OpenGL contexts

Previously an error would be generated if any attributes were specified when
creating a non-desktop OpenGL context. This was a mistake, and it will
prevent old drivers from working with new EGL libraries that add support for
the createContextAttribs interface. Instead, match the behavior of
EGL_KHR_create_context: allow versions that make sense, reject non-zero flags.

NOTE: This is a candidate for the 8.0 branch.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Cc: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Chad Versace <chad.versace@linux.intel.com>
esa/drivers/dri/common/dri_util.c
caa4ae5d7d864278ffbf5dbd9c25bb2932e91fc5 05-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965: Allocate dummy slots for point sprites before computing VUE map.

Commit f0cecd43d6b6d moved the VUE map computation to be only once, at
VS compile time. However, it did so in slightly the wrong place: it
made the one call to brw_vue_compute_map happen right before the
allocation of dummy slots for replaced point sprite coordinates, causing
a different VUE map to be generated (at least on Ironlake).

Fixes a regression in Piglit's point-sprite test on Ironlake.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=46489
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vs.c
54c045b93cd205bcf031e70d65238d60bfc07da4 05-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/vs: Don't clobber sampler message MRFs with subexpressions.

See the preceding commit for a description of the problem.

NOTE: This is a candidate for stable release branches.

v2: Use a separate dPdx variable rather than reusing the lod src_reg.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_vec4_visitor.cpp
c0f60106df724188d6ffe7c9f21eeff22186ab25 05-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Don't clobber sampler message MRFs with subexpressions.

Consider a texture call such as:

textureLod(s, coordinate, log2(...))

First, we begin setting up the sampler message by loading the texture
coordinates into MRFs, starting with m2. Then, we realize we need the
LOD, and go to compute it with:

ir->lod_info.lod->accept(this);

On Gen4-5, this will generate a SEND instruction to compute log2(),
loading the operand into m2, and clobbering our texcoord.

Similar issues exist on Gen6+. For example, nested texture calls:

textureLod(s1, c1, texture(s2, c2).x)

Any texturing call where evaluating the subexpression trees for LOD or
shadow comparitor would generate SEND instructions could potentially
break. In some cases (like register spilling), we get lucky and avoid
the issue by using non-overlapping MRF regions. But we shouldn't count
on that.

Fixes four Piglit test regressions on Gen4-5:
- glsl-fs-shadow2DGradARB-{01,04,07,cumulative}

NOTE: This is a candidate for stable release branches.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=52129
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_visitor.cpp
27bf9c1997b77f85c2099436e9ad5dfc0f1608c7 05-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Factor out texcoord setup into a helper function.

With the textureRect support and GL_CLAMP workarounds, it's grown
sufficiently that it deserves its own function. Separating it out
makes the original function much more readable.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_visitor.cpp
82bfb4b41af7d61aa45e41d62c1842b6a09e9585 05-Aug-2012 Kenneth Graunke <kenneth@whitecape.org> i965/fs: Move message header and texture offset setup to generate_tex().

Setting the texture offset bits in the message header involves very
specific hardware register descriptions. As such, I feel it's better
suited for the lower level "generate" layer that has direct access to
the weird register layouts, rather than at the fs_inst abstraction layer.

This also parallels the approach I took in the VS backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
esa/drivers/dri/i965/brw_fs.h
esa/drivers/dri/i965/brw_fs_emit.cpp
esa/drivers/dri/i965/brw_fs_visitor.cpp
2df399c34bb39122a45bdd5b430b48346542e1cb 01-Aug-2012 Jerome Glisse <jglisse@redhat.com> r600g: atomize sampler state v2

Use atom for sampler state. Does not provide new functionality
or fix any bug. Just a step toward full atom base r600g.

v2: Split seamless on r6xx/r7xx into it's own atom. Make sure it's
emited after sampler and with a pipeline flush before otherwise
it does not take effect.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
allium/drivers/r600/evergreen_hw_context.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600.h
allium/drivers/r600/r600_hw_context.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_state_common.c
8eeeef37057e8f31834e421902c529b273295d0b 06-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: merge fragment/vertex sampler update code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_atom_sampler.c
819e786339fe0eebcd6e8e0ec9e501da548846ba 06-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: massage update_vertex_samplers() code

...to look like update_fragment_samplers() code, as with the previous
commit. The next step would be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_atom_sampler.c
2aac0d145a3f03572f19fd913bed2e951d543030 06-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: merge fragment/vertex texture update code

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_atom_texture.c
dd6aafcf72e79d7caacd4406528da9b2003915da 06-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: massage the update_vertex_textures() code

...to look like update_fragment_textures() code. The next step would
be to merge the two functions.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_atom_texture.c
5749ae919e386e49dbf373e362dd74b513c96360 06-Aug-2012 Brian Paul <brianp@vmware.com> st/mesa: rename some vertex/fragment state fields for better consistency

Reviewed-by: José Fonseca <jfonseca@vmware.com>
esa/state_tracker/st_atom_sampler.c
esa/state_tracker/st_atom_texture.c
esa/state_tracker/st_cb_bitmap.c
esa/state_tracker/st_context.c
esa/state_tracker/st_context.h
29604441deb6e94f6ced8c93b11fd8a3511f97f2 04-Aug-2012 Brian Paul <brianp@vmware.com> llvmpipe: consolidate the sampler and sampler view setting code

Less code. And as with softpipe, if/when we consolidate the pipe_context
functions for binding sampler state, this will make the llvmpipe changes
trivial.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/llvmpipe/lp_state_sampler.c
b3538d356316b282d6408f710f2df5f06bf315f5 04-Aug-2012 Brian Paul <brianp@vmware.com> llvmpipe: combine vertex/fragment sampler state into an array

This will allow code consolidation in the next patch.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/llvmpipe/lp_context.c
allium/drivers/llvmpipe/lp_context.h
allium/drivers/llvmpipe/lp_draw_arrays.c
allium/drivers/llvmpipe/lp_setup.c
allium/drivers/llvmpipe/lp_setup.h
allium/drivers/llvmpipe/lp_state_derived.c
allium/drivers/llvmpipe/lp_state_fs.c
allium/drivers/llvmpipe/lp_state_sampler.c
1f34e1a6cbac4b96d07a3d6d01bc443d5282add4 04-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: consolidate vert/frag/geom sampler setting functions

The functions for setting samplers and sampler views for vertex,
fragment and geometry shaders were nearly identical. Now they
use shared code.

In the future, if the pipe_context functions for setting samplers
and sampler views for vert/frag/geom/compute are combined, this
will make updating the softpipe driver a snap.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/softpipe/sp_state_sampler.c
d6c3e6d8f34fc39dcbe9395c3a5953af726443f1 04-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: consolidate sampler-related arrays

Combine separate arrays for vertex/fragment/geometry samplers, etc into
one array indexed by PIPE_SHADER_x.

This allows us to collapse separate code for vertex/fragment/geometry
state into loops over the shader stage. More to come.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/softpipe/sp_context.c
allium/drivers/softpipe/sp_context.h
allium/drivers/softpipe/sp_flush.c
allium/drivers/softpipe/sp_quad_fs.c
allium/drivers/softpipe/sp_state_derived.c
allium/drivers/softpipe/sp_state_sampler.c
0a14e9f09fc1cf9d5c277bb239f349203d3bed79 04-Aug-2012 Brian Paul <brianp@vmware.com> softpipe: combine vert/frag/geom texture caches in an array

This lets us consolidate some code now, and more in subsequent patches.

Reviewed-by: José Fonseca <jfonseca@vmware.com>
allium/drivers/softpipe/sp_context.c
allium/drivers/softpipe/sp_context.h
allium/drivers/softpipe/sp_flush.c
allium/drivers/softpipe/sp_state_derived.c
allium/drivers/softpipe/sp_state_sampler.c
61b62c007a7941e9b45e83440e932160a597e0e1 04-Aug-2012 Vinson Lee <vlee@freedesktop.org> mesa: Fix off-by-one error in Parse_TextureImageId.

Fixes out-of-bounds write defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/program/nvfragparse.c
3e7b3a04bf7667583dac18f1267d213aa7f33800 04-Aug-2012 Vinson Lee <vlee@freedesktop.org> util: Move dereference after null check in util_resource_copy_region.

Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_surface.c
a5ca29100bd64f47e24ad1bd8ae04f0007021541 04-Aug-2012 Brian Paul <brianp@vmware.com> i915g: silence a const pointer warning
allium/drivers/i915/i915_state.c
f9a498d1bc71f26e786d91c002759c5bce11338b 04-Aug-2012 Marek Olšák <maraeo@gmail.com> radeonsi: fix build failure after blitter changes
allium/drivers/radeonsi/r600_blit.c
cb922b63eba1d75706354614bc5de4d39dbe9ad3 02-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: precompute color buffer state in pipe_surface and reuse it
allium/drivers/r600/evergreen_compute_internal.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
cdc681c3ad746fe8adab4ea71358bcc54e024ff9 02-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: precompute depth buffer state in pipe_surface and reuse it

This is done on-demand, because we don't know in advance if a zbuffer
will be bound as depth or color.
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
e6dfc8c77bc00c06a35270a4e50aa52c738c8629 01-Aug-2012 Marek Olšák <maraeo@gmail.com> r600g: simplify create_surface
allium/drivers/r600/r600_texture.c
581f7e3101980a4e1068bb75c2eca60bb2071229 29-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: drop the old texture allocation code

Made obsolete by the libdrm surface allocator.
allium/drivers/r600/evergreen_compute_internal.c
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_pipe.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_resource.h
allium/drivers/r600/r600_state.c
allium/drivers/r600/r600_texture.c
7c371f46958910dd2ca9487c89af1b72bbfdada9 28-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: make sure copying of all texture formats is accelerated
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_texture.c
84645fa61390475e6efb080685e0dec059622a39 28-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: add a query for checking whether copying is supported

v2: add comments
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/i915/i915_resource_texture.c
allium/drivers/i915/i915_surface.c
e2f623f1d6da9bc987582ff68d0471061ae44030 28-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: don't decompress depth or stencil if there isn't any
allium/drivers/r600/evergreen_state.c
allium/drivers/r600/r600_blit.c
allium/drivers/r600/r600_pipe.h
allium/drivers/r600/r600_state.c
ea72351a919c594e7f40e901dca42aebb866f8a6 29-Jul-2012 Marek Olšák <maraeo@gmail.com> r600g: correct texture memory size for Z32F_S8X24 on evergreen
allium/drivers/r600/r600_texture.c
c8ff737a18672c86f4ec01b25b4893550667b17c 27-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: remove fallback for stencil copy that all drivers skipped

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/i915/i915_surface.c
allium/drivers/r600/r600_blit.c
ef1bf6d69e99d9a12557a09eccaf4f2b6c628997 27-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: add ability to blit only depth or only stencil

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
allium/drivers/r300/r300_blit.c
88426780479743036993a0fcd112232d2792690a 27-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium: define PIPE_MASK_RGBAZS

I need this and it seems like it could be useful.

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/include/pipe/p_defines.h
8aaf6972d128551dd720b3e3525806d39aad6f53 27-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: minor cleanup

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
67a3e5bc32fe359b54121355295e6a19a24b44eb 27-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/tgsi: fixup texture name strings

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/tgsi/tgsi_strings.c
6c420b166814fccb160e39cc9ea8cbdaf4e7c830 22-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blitter: set sample mask to ~0

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blitter.c
allium/auxiliary/util/u_blitter.h
9d1ef354f9e613d62c5bd61398c00e80d301fcee 24-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blit: bail out if src is a multisample texture

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blit.c
6b3f1ae12b7d53bf88cdcf0e78803e929cdf5bbd 24-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium/u_blit: check nr_samples before using resource_copy_region

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/util/u_blit.c
e7689303a8e4790c38cc69ae7a197712f98e8f5b 24-Jul-2012 Marek Olšák <maraeo@gmail.com> gallium: set sample mask to ~0 for clear, blit and gen_mipmap

The sample mask affects single-sampled rendering too (it's orthogonal
to the color mask).

Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/cso_cache/cso_context.c
allium/auxiliary/cso_cache/cso_context.h
allium/auxiliary/util/u_blit.c
allium/auxiliary/util/u_gen_mipmap.c
esa/state_tracker/st_cb_clear.c
cd97a5f660399212a23b6dcd02906231f2dc5525 04-Aug-2012 Dave Airlie <airlied@redhat.com> r600g: fix F2U opcode translation

Signed-off-by: Marek Olšák <maraeo@gmail.com>
allium/drivers/r600/r600_shader.c
5bce0b51755e465d6aa9077df2167018d2e5150c 03-Aug-2012 Vinson Lee <vlee@freedesktop.org> draw: Ensure channel in convert_to_soa is initialized.

Fixes uninitialized pointer read defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
allium/auxiliary/draw/draw_llvm.c
9d36b3abfd557d8eb6a1a571d387dd53ef64068b 03-Aug-2012 Vinson Lee <vlee@freedesktop.org> u_blitter: Move a pointer dereference after null check.

Fixes dereference before null check defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
allium/auxiliary/util/u_blitter.c
fb85558ab1e40698bfb1aedaaf32b182560f2479 01-Aug-2012 Matt Turner <mattst88@gmail.com> Use C99 NAN and INFINITY macros
allium/auxiliary/util/u_format_tests.c
65da837fcfd4eaf444c54df22b0887440424297c 03-Aug-2012 Brian Paul <brianp@vmware.com> gallium/tests/trivial: updates for CSO interface changes
allium/tests/trivial/quad-tex.c
c61d3fe8bddcbcf750c5f057a45b262fea92ca5e 03-Aug-2012 Brian Paul <brianp@vmware.com> st/xorg: updates for CSO interface changes
allium/state_trackers/xorg/xorg_composite.c
allium/state_trackers/xorg/xorg_xv.c
459dd568979a5745d84f8fd2bdff38242ee3c16f 03-Aug-2012 Brian Paul <brianp@vmware.com> st/xa: updates for CSO interface changes
allium/state_trackers/xa/xa_composite.c
allium/state_trackers/xa/xa_context.c
allium/state_trackers/xa/xa_renderer.c
allium/state_trackers/xa/xa_yuv.c
3d1bec5d9a1a365286110000a1a37dc96c8db883 03-Aug-2012 Brian Paul <brianp@vmware.com> vega: fix build breakage from cso sampler/view changes
allium/state_trackers/vega/renderer.c
832706a80beb1643ec777a0a795a4ddcf6dfaca4 03-Aug-2012 Brian Paul <brianp@vmware.com> cso: remove unreachable break statements
allium/auxiliary/cso_cache/cso_context.c
076e5eacf1e5653acd1e99f0e7fdfe7499da5665 03-Aug-2012 Brian Paul <brianp@vmware.com> cso: 80-column wrapping, remove trailing whitespace, etc
allium/auxiliary/cso_cache/cso_context.c
ea6f035ae90895bd4ee3247408eb179dfdf96d22 02-Aug-2012 Brian Paul <brianp@vmware.com> gallium: consolidate CSO sampler and sampler_view functions

Merge the vertex/fragment versions of the cso_set/save/restore_samplers()
functions. Now we pass the shader stage (PIPE_SHADER_x) to the function
to indicate vertex/fragment/geometry samplers. For example:

cso_single_sampler(cso, PIPE_SHADER_FRAGMENT, unit, sampler);

This results in quite a bit of code reduction, fewer CSO functions and
support for geometry shaders.

Reviewed-by: Marek Olšák <maraeo@gmail.com>
allium/auxiliary/cso_cache/cso_context.c
allium/auxiliary/cso_cache/cso_context.h
allium/auxiliary/postprocess/pp_colors.c
allium/auxiliary/postprocess/pp_init.c
allium/auxiliary/postprocess/pp_mlaa.c
allium/auxiliary/util/u_blit.c
allium/auxiliary/util/u_gen_mipmap.c
esa/state_tracker/st_atom_sampler.c
esa/state_tracker/st_atom_texture.c
esa/state_tracker/st_cb_bitmap.c
esa/state_tracker/st_cb_drawpixels.c
350f12fb657a2ac860796c179233fa357e4bf46c 02-Aug-2012 Vinson Lee <vlee@freedesktop.org> st/mesa: Ensure dst in compile_instruction is initialized.

Fixes uninitialized scalar variable defect reported by Coverity.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
esa/state_tracker/st_mesa_to_tgsi.c
f6ad8b45c2731075d91f43e92862847f2c26e95a 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add $(LLVM_LDFLAGS) to the loader linker flags
allium/drivers/radeon/Makefile
4a89a207179d8cf25f259aba8e6c867de42bae54 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add support for more f32 CMP instructions on SI
allium/drivers/radeon/SIInstructions.td
a35eea786823f0130b925cb25486d7d162f2d68c 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add support for fneg on SI
allium/drivers/radeon/SIISelLowering.cpp
allium/drivers/radeon/SIInstructions.td
4104bae063a3a06ddc00371a576ad0a55f520473 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Add support for fp_to_sint on SI
allium/drivers/radeon/SIInstructions.td
f7fcaa07df7b3aab124576dec346ae4fa7c6715b 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeon/llvm: Remove CMOVLOG DAG node
allium/drivers/radeon/AMDGPUISelLowering.cpp
allium/drivers/radeon/AMDGPUISelLowering.h
allium/drivers/radeon/AMDILISelLowering.cpp
allium/drivers/radeon/AMDILInstrInfo.td
allium/drivers/radeon/R600ISelLowering.cpp
allium/drivers/radeon/R600Instructions.td
a5ac8ee2c5e7dad3985b06c620d96cf077804ff9 02-Aug-2012 Tom Stellard <thomas.stellard@amd.com> radeonsi: Properly initialize si_shader_ctx.radeon_bld
allium/drivers/radeonsi/radeonsi_shader.c
c2bae6b91de8bd023dbac7fef4c2a3b8eba28afa 02-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Handle TGSI TXP opcode.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeonsi/radeonsi_shader.c
93b4f1f97ea961f09218c9cf7d928e499f267f58 02-Aug-2012 Michel Dänzer <michel.daenzer@amd.com> radeonsi: Handle TGSI DIV opcode.

Signed-off-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
allium/drivers/radeon/SIInstructions.td
daf4254d07328381ed013aac25e25d6021fbfd14 02-Aug-2012 Brian Paul <brianp@vmware.com> svga: remove questionable INLINE qualifiers
allium/drivers/svga/svga_resource_buffer_upload.c
421f134028ea2930cb80c7189e552320a8a6e49f 02-Aug-2012 Brian Paul <brianp@vmware.com> svga: sort #includes
allium/drivers/svga/svga_resource_buffer_upload.c
81f2f3f65c5cbff6db476e564da18198336e13d1 02-Aug-2012