profile/ivi/mesa.git
11 years agoglcpp: fix abuse of yylex
Dave Airlie [Fri, 14 Sep 2012 09:59:54 +0000 (19:59 +1000)]
glcpp: fix abuse of yylex

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

This fixes another crash found after fixing the first crash.

this is a candidate for 9.0 and stable branches

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit 53d46bc787318ccf9911fdd1d5fe99ee4db7f41a)

11 years agomesa: use a prefix for the program lex
Dave Airlie [Fri, 14 Sep 2012 00:05:53 +0000 (10:05 +1000)]
mesa: use a prefix for the program lex

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

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

This is a candidate for 9.0 & stable branches.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
(cherry picked from commit cc943c8470b38a1f13d2493f293a153f75754caa)

11 years agomklib: clean up abi flags for x86 targets
Mike Frysinger [Tue, 11 Sep 2012 05:57:25 +0000 (01:57 -0400)]
mklib: clean up abi flags for x86 targets

The current code is duplicated in two places and relies on `uname` to
detect the flags.  This is no good for cross-compiling, and the current
logic uses -m64 for the x32 ABI which breaks things.

Unify the code in one place, avoid `uname` completely, and add support
for the new x32 ABI.

Signed-off-by: Mike Frysinger <vapier@gentoo.org>
11 years agor600g: reduce quant mode on evergreen+
Alex Deucher [Thu, 13 Sep 2012 21:25:42 +0000 (17:25 -0400)]
r600g: reduce quant mode on evergreen+

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

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

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

11 years agoi965: Fix out-of-order sampler unit usage in ARB fragment programs.
Kenneth Graunke [Wed, 12 Sep 2012 05:14:59 +0000 (22:14 -0700)]
i965: Fix out-of-order sampler unit usage in ARB fragment programs.

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

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

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

v2: Add a comment, as suggested by Matt.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54098
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54179
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: meng <mengmeng.meng@intel.com>
(cherry picked from commit 28f4be9eb91b12a2c6b1db6660cca71a98c486ec)

11 years agomesa: Add a _mesa_fls() function to find the last bit set in a word.
Kenneth Graunke [Wed, 12 Sep 2012 05:14:58 +0000 (22:14 -0700)]
mesa: Add a _mesa_fls() function to find the last bit set in a word.

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

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

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
(cherry picked from commit 0fc163408e6b9521d545daba19f70631011d5752)

11 years agor600g: adjust QUANT_MODE for higher precision
Vadim Girlin [Mon, 3 Sep 2012 20:18:13 +0000 (00:18 +0400)]
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)

11 years agomesa: don't wait in _mesa_ClientWaitSync if timeout is 0
Vadim Girlin [Fri, 31 Aug 2012 21:02:24 +0000 (01:02 +0400)]
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)

11 years agomesa: fix proxy texture error handling in glTexStorage()
Brian Paul [Sat, 8 Sep 2012 15:33:13 +0000 (09:33 -0600)]
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)

11 years agomesa: make _mesa_get_proxy_target() non-static
Brian Paul [Sat, 8 Sep 2012 15:46:14 +0000 (09:46 -0600)]
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)

11 years agomesa: do internal format error checking for glTexStorage()
Brian Paul [Sat, 8 Sep 2012 15:27:46 +0000 (09:27 -0600)]
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)

11 years agomesa/msaa: Allow X and Y flips in multisampled blits.
Paul Berry [Wed, 5 Sep 2012 23:07:16 +0000 (16:07 -0700)]
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)

11 years agoglsl: Generate compile errors for explicit blend indices < 0 or > 1.
Kenneth Graunke [Fri, 31 Aug 2012 23:04:19 +0000 (16:04 -0700)]
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)

11 years agoi965: Fix virtual_grf_interferes() between calculate_live_intervals() and DCE.
Eric Anholt [Thu, 6 Sep 2012 05:10:41 +0000 (22:10 -0700)]
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)

11 years agoglapi/glx: rename 'table' variable to 'disp_table'
Brian Paul [Thu, 6 Sep 2012 14:16:56 +0000 (08:16 -0600)]
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)

11 years agomesa: fix per-level max texture size error checking
Brian Paul [Wed, 5 Sep 2012 02:17:15 +0000 (20:17 -0600)]
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)

11 years agost/mesa: s/CALLOC/calloc/ to fix allocation bug
Brian Paul [Thu, 30 Aug 2012 22:12:53 +0000 (16:12 -0600)]
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)

11 years agoSet OSMESA_VERSION=8.
Johannes Obermayr [Sat, 1 Sep 2012 23:35:47 +0000 (01:35 +0200)]
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)

11 years agor600g: fix num of dwords needed for alphatest_state atom
Jerome Glisse [Thu, 6 Sep 2012 19:09:21 +0000 (15:09 -0400)]
r600g: fix num of dwords needed for alphatest_state atom

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
11 years agomesa: Don't advertise GLES extensions in GL contexts
Chad Versace [Tue, 4 Sep 2012 17:02:43 +0000 (10:02 -0700)]
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)

11 years agoandroid: do not expose single buffered eglconfigs
Tapani Pälli [Mon, 13 Aug 2012 13:47:52 +0000 (16:47 +0300)]
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)

11 years agoandroid: fix liblog API changes
Tapani Pälli [Mon, 13 Aug 2012 06:03:06 +0000 (09:03 +0300)]
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)

11 years agoxmlconfig: use __progname when building for Android
Tapani Pälli [Tue, 5 Jun 2012 13:04:14 +0000 (16:04 +0300)]
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)

11 years agometa: Don't save and restore fog state when there is no fog state
Ian Romanick [Fri, 31 Aug 2012 22:26:27 +0000 (15:26 -0700)]
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)

11 years agoi965/fs: Don't use brw->fragment_program in calculate_urb_setup().
Kenneth Graunke [Fri, 31 Aug 2012 08:00:15 +0000 (01:00 -0700)]
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)

11 years agobuild: Remove left over echo from GLU removal
Matt Turner [Fri, 31 Aug 2012 22:11:11 +0000 (15:11 -0700)]
build: Remove left over echo from GLU removal

11 years agoRemove libGLU
Matt Turner [Thu, 23 Aug 2012 23:39:20 +0000 (16:39 -0700)]
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>
11 years agodri: Rework planar image interface
Jakob Bornecrantz [Fri, 31 Aug 2012 17:48:26 +0000 (19:48 +0200)]
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>
11 years agowinsys/radeon: disable virtual memory on Cayman
Marek Olšák [Thu, 30 Aug 2012 14:36:21 +0000 (16:36 +0200)]
winsys/radeon: disable virtual memory on Cayman

It hangs.

11 years agoscons: Remove leftover print statement.
Vinson Lee [Fri, 31 Aug 2012 15:23:28 +0000 (08:23 -0700)]
scons: Remove leftover print statement.

Remove print statement left over from commit
c57fb034b19156e06e2ec25d9b06a0e174d861c9.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
(cherry picked from commit f3bb6bd9b37d58ec16aac09d41546bd4702ecab8)

11 years agodocs: update relnotes-9.0
Andreas Boll [Fri, 31 Aug 2012 14:53:25 +0000 (16:53 +0200)]
docs: update relnotes-9.0

Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agomesa: also bump version in Makefile.am and configure.ac to 9.0
Andreas Boll [Fri, 31 Aug 2012 14:43:56 +0000 (16:43 +0200)]
mesa: also bump version in Makefile.am and configure.ac to 9.0

Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agoscons: Add default libraries to Solaris build.
Vinson Lee [Thu, 30 Aug 2012 06:16:44 +0000 (23:16 -0700)]
scons: Add default libraries to Solaris build.

Fixes SCons build on Solaris.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=54293
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agodocs: Add some missing features to 9.0 release notes and GL3.txt
Ian Romanick [Thu, 30 Aug 2012 22:22:37 +0000 (15:22 -0700)]
docs: Add some missing features to 9.0 release notes and GL3.txt

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agomesa: Bump version to 9.0
Ian Romanick [Thu, 30 Aug 2012 20:55:02 +0000 (13:55 -0700)]
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>
11 years agor600g: enable transform feedback on Cayman
Marek Olšák [Thu, 30 Aug 2012 14:33:36 +0000 (16:33 +0200)]
r600g: enable transform feedback on Cayman

There doesn't seem to be anything wrong with it.

11 years agor600g: implement MSAA for Cayman
Marek Olšák [Thu, 30 Aug 2012 03:38:02 +0000 (05:38 +0200)]
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.

11 years agoi965/msaa: flag _NEW_MULTISAMPLE in the brw_tracked_state
Anuj Phogat [Wed, 29 Aug 2012 19:22:11 +0000 (12:22 -0700)]
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>
11 years agor600g: enable MSAA on r6xx by default
Marek Olšák [Sun, 26 Aug 2012 21:03:51 +0000 (23:03 +0200)]
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.

11 years agor600g: disable MSAA depth decompression on r6xx
Marek Olšák [Sun, 26 Aug 2012 21:02:37 +0000 (23:02 +0200)]
r600g: disable MSAA depth decompression on r6xx

11 years agor600g: implement color resolve for r600
Marek Olšák [Sun, 26 Aug 2012 20:38:35 +0000 (22:38 +0200)]
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.

11 years agor600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx
Marek Olšák [Sun, 26 Aug 2012 20:33:55 +0000 (22:33 +0200)]
r600g: fix CB_SHADER_MASK and CB_TARGET_MASK for r6xx

11 years agor600g: implement draw_rectangle callback
Marek Olšák [Fri, 24 Aug 2012 03:57:22 +0000 (05:57 +0200)]
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.

11 years agor600g: implement MSAA for r700
Marek Olšák [Thu, 2 Aug 2012 20:31:22 +0000 (22:31 +0200)]
r600g: implement MSAA for r700

Reviewed-by: Jerome Glisse <jglisse@redhat.com>
11 years agor600g: change programming of CB_SHADER_MASK on r600-r700
Marek Olšák [Tue, 21 Aug 2012 18:26:20 +0000 (20:26 +0200)]
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>
11 years agoconfigure.ac: require libdrm_radeon 2.6.39 for MSAA
Marek Olšák [Sun, 26 Aug 2012 22:22:31 +0000 (00:22 +0200)]
configure.ac: require libdrm_radeon 2.6.39 for MSAA

11 years agometa: remove call to _meta_in_progress(), fix multisample enable/disable
Brian Paul [Thu, 30 Aug 2012 14:45:13 +0000 (08:45 -0600)]
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>
11 years agometa: add parenthesis to silence compiler warnings
Brian Paul [Thu, 30 Aug 2012 14:43:27 +0000 (08:43 -0600)]
meta: add parenthesis to silence compiler warnings

Reviewed-by: Paul Berry <stereotype441@gmail.com>
11 years agoscons : add HAVE_DLOPEN to build environment
Tapani Pälli [Tue, 28 Aug 2012 11:01:51 +0000 (14:01 +0300)]
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>
11 years agoradeonsi: fix stupid bug added in commit 07838603b9a69c05911edbcd351bfce5ad9b5a2c
Christian König [Fri, 24 Aug 2012 08:55:16 +0000 (10:55 +0200)]
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>
11 years agoi965/fs: Remove a dead member from live variables analysis.
Eric Anholt [Mon, 4 Jun 2012 22:44:58 +0000 (15:44 -0700)]
i965/fs: Remove a dead member from live variables analysis.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965/fs: Initialize output_components[] by filling it with zeros.
Kenneth Graunke [Wed, 29 Aug 2012 08:51:17 +0000 (01:51 -0700)]
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>
11 years agomesa: Do something sensible when on-line compression is requested but not possible
Ian Romanick [Tue, 21 Aug 2012 22:20:23 +0000 (15:20 -0700)]
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>
11 years agoi965: Allow creation of OpenGL 3.1 contexts
Ian Romanick [Tue, 7 Aug 2012 19:50:44 +0000 (12:50 -0700)]
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>
11 years agoi965: Advertise GLSL 1.40 and TexBOs in core contexts
Ian Romanick [Wed, 8 Aug 2012 16:11:05 +0000 (09:11 -0700)]
i965: Advertise GLSL 1.40 and TexBOs in core contexts

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agointel: Clean up bits of cruft in intelCreateContext
Ian Romanick [Tue, 7 Aug 2012 19:46:22 +0000 (12:46 -0700)]
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>
11 years agoi965: Set context flags
Ian Romanick [Fri, 17 Aug 2012 16:32:59 +0000 (09:32 -0700)]
i965: Set context flags

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/dri: Allow creation of forward-compatible contexts
Ian Romanick [Fri, 17 Aug 2012 16:23:50 +0000 (09:23 -0700)]
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>
11 years agomesa/es: Enable GL_OES_vertex_array_object
Ian Romanick [Wed, 22 Aug 2012 01:03:49 +0000 (18:03 -0700)]
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>
11 years agomesa: Enable GL_{ARB,APPLE}_vertex_array_object in all drivers
Ian Romanick [Wed, 22 Aug 2012 00:57:22 +0000 (17:57 -0700)]
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>
11 years agometa: Don't use deprecated keyword in 1.30 shader
Ian Romanick [Sat, 18 Aug 2012 00:57:17 +0000 (17:57 -0700)]
meta: Don't use deprecated keyword in 1.30 shader

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow alpha, luminance, and LA textures in core context
Ian Romanick [Sat, 18 Aug 2012 00:15:06 +0000 (17:15 -0700)]
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>
11 years agomesa: Disallow more deprecated functions in core context
Ian Romanick [Sat, 18 Aug 2012 00:14:47 +0000 (17:14 -0700)]
mesa: Disallow more deprecated functions in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Require names from Gen in core context
Ian Romanick [Sat, 18 Aug 2012 00:14:02 +0000 (17:14 -0700)]
mesa: Require names from Gen in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Allow NULL vertex pointer without a VBO
Ian Romanick [Sat, 18 Aug 2012 00:12:39 +0000 (17:12 -0700)]
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>
11 years agomesa: Disallow VertexAttribPointer without a VAO in a core context
Ian Romanick [Sat, 18 Aug 2012 00:12:12 +0000 (17:12 -0700)]
mesa: Disallow VertexAttribPointer without a VAO in a core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Disallow wide lines in forward compatible context
Ian Romanick [Fri, 17 Aug 2012 23:08:40 +0000 (16:08 -0700)]
mesa: Disallow wide lines in forward compatible context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Only FRONT_AND_BACK is allowed for PolygonMode in core context
Ian Romanick [Fri, 17 Aug 2012 23:03:06 +0000 (16:03 -0700)]
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>
11 years agometa: Don't stray outside the confines of the API specified in the context
Paul Berry [Wed, 8 Aug 2012 18:56:33 +0000 (11:56 -0700)]
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>
11 years agomesa: Don't allow display lists or evaluators in core context
Ian Romanick [Fri, 17 Aug 2012 21:32:43 +0000 (14:32 -0700)]
mesa: Don't allow display lists or evaluators in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Don't allow GL_EXTENSIONS query in core context
Ian Romanick [Fri, 17 Aug 2012 21:32:21 +0000 (14:32 -0700)]
mesa: Don't allow GL_EXTENSIONS query in core context

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Non-sprite points are deprecated
Ian Romanick [Wed, 15 Aug 2012 15:45:03 +0000 (08:45 -0700)]
mesa: Non-sprite points are deprecated

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa: Fix VAO deletion on GL 3.1 core.
Eric Anholt [Thu, 9 Aug 2012 01:44:40 +0000 (18:44 -0700)]
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.

11 years agomesa: Enable a bunch of missing getters on 3.1 core.
Eric Anholt [Thu, 9 Aug 2012 01:29:14 +0000 (18:29 -0700)]
mesa: Enable a bunch of missing getters on 3.1 core.

NOTE: maybe I enabled too many?

11 years agomesa: Expose texture buffer objects when the context is GL 3.1 core.
Eric Anholt [Thu, 26 Jul 2012 22:10:04 +0000 (15:10 -0700)]
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>
11 years agomesa: Allow PACK / UNPACK queries for ES2
Ian Romanick [Wed, 8 Aug 2012 18:47:15 +0000 (11:47 -0700)]
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>
11 years agomesa: Kill ES2 wrapper functions
Ian Romanick [Sat, 28 Jul 2012 22:20:48 +0000 (15:20 -0700)]
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>
11 years agomesa: glGetVertexAttribPointerv is part of core profile and ES2
Ian Romanick [Wed, 8 Aug 2012 20:37:45 +0000 (13:37 -0700)]
mesa: glGetVertexAttribPointerv is part of core profile and ES2

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glPointParameter pname in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:43:22 +0000 (17:43 -0700)]
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>
11 years agomesa: Require OpenGL 2.0 for GL_POINT_SPRITE_COORD_ORIGIN
Ian Romanick [Sat, 28 Jul 2012 00:40:34 +0000 (17:40 -0700)]
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>
11 years agomesa: Require that drivers supporting point sprites support point parameters
Ian Romanick [Sat, 28 Jul 2012 00:38:32 +0000 (17:38 -0700)]
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>
11 years agomesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:48:30 +0000 (17:48 -0700)]
mesa/es: Validate glGetTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper
Ian Romanick [Sat, 28 Jul 2012 00:22:42 +0000 (17:22 -0700)]
mesa/es: Validate glTexEnv parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:47:27 +0000 (16:47 -0700)]
mesa/es: Validate glGetTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:27:23 +0000 (16:27 -0700)]
mesa/es: Validate glTexGen parameters in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:13:02 +0000 (16:13 -0700)]
mesa/es: Validate glLightModel pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glMaterial face and pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 23:07:19 +0000 (16:07 -0700)]
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>
11 years agomesa/es: Validate glGetMaterial pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:57:09 +0000 (15:57 -0700)]
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>
11 years agomesa/es: Validate glGetPointerv pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:49:50 +0000 (15:49 -0700)]
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>
11 years agomesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 22:47:16 +0000 (15:47 -0700)]
mesa/es: Validate glMatrixMode mode in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glFog pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:37:05 +0000 (12:37 -0700)]
mesa/es: Validate glFog pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate glReadPixels format and type in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:24:24 +0000 (12:24 -0700)]
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>
11 years agomesa/es: Validate glPixelStore pname in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 19:11:32 +0000 (12:11 -0700)]
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>
11 years agomesa/es: Validate glEnable cap in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 18:56:42 +0000 (11:56 -0700)]
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>
11 years agomesa/es: Validate glHint target in Mesa code rather than the ES wrapper
Ian Romanick [Fri, 27 Jul 2012 18:03:06 +0000 (11:03 -0700)]
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>
11 years agomesa/es: Validate glGetVertexAttribf pname in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 23:21:49 +0000 (16:21 -0700)]
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>
11 years agomesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 22:39:50 +0000 (15:39 -0700)]
mesa/es: Validate glGetString pname in Mesa code rather than the ES wrapper

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
11 years agomesa/es: Validate primitive modes in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 14:15:29 +0000 (07:15 -0700)]
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>
11 years agomesa: Refactor _mesa_valid_prim_mode to use a switch-statement
Ian Romanick [Wed, 25 Jul 2012 14:12:33 +0000 (07:12 -0700)]
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>
11 years agomesa/es: Validate blend function enums in Mesa code rather than the ES wrapper
Ian Romanick [Wed, 25 Jul 2012 02:52:53 +0000 (19:52 -0700)]
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>