mesa.git
11 years agoradeonsi: add 2d tiling support for texture v3
Jerome Glisse [Fri, 22 Mar 2013 21:55:49 +0000 (17:55 -0400)]
radeonsi: add 2d tiling support for texture v3

v2: Remove left over code
v3: Restage properly the commit so hunk of first one are not in
    second one.

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
11 years agogallium: handle drirc disable_glsl_line_continuations option
Vadim Girlin [Thu, 18 Apr 2013 21:04:51 +0000 (01:04 +0400)]
gallium: handle drirc disable_glsl_line_continuations option

NOTE: This is a candidate for the 9.1 branch

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agollvmpipe: Take in consideration all current constant buffers when mapping.
José Fonseca [Thu, 18 Apr 2013 18:05:53 +0000 (19:05 +0100)]
llvmpipe: Take in consideration all current constant buffers when mapping.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Zack Rusin <zackr@vmware.com>
11 years agonv50: add remaining RGBX formats
Christoph Bumiller [Thu, 18 Apr 2013 18:55:32 +0000 (20:55 +0200)]
nv50: add remaining RGBX formats

Not all are supported as render targets.

The state tracker fallback of using RGBA instead of RGBX currently
fails for blending, we could work around this by clearing their alpha
to 1 and modifying the color mask to disable writing alpha.

11 years agost/mesa: optionally apply texture swizzle to border color v2
Christoph Bumiller [Fri, 12 Apr 2013 11:42:01 +0000 (13:42 +0200)]
st/mesa: optionally apply texture swizzle to border color v2

This is the only sane solution for nv50 and nvc0 (really, trust me),
but since on other hardware the border colour is tightly coupled with
texture state they'd have to undo the swizzle, so I've added a cap.

The dependency of update_sampler on the texture updates was
introduced to avoid doing the apply_depthmode to the swizzle twice.

v2: Moved swizzling helper to u_format.c, extended the CAP to
provide more accurate information.

11 years agonv50: set BORDER_COLOR_SRGB in sampler objects
Christoph Bumiller [Sat, 13 Apr 2013 13:04:55 +0000 (15:04 +0200)]
nv50: set BORDER_COLOR_SRGB in sampler objects

11 years agonv50: fix 4th component of Lx_SINT/UINT formats
Christoph Bumiller [Fri, 12 Apr 2013 17:11:30 +0000 (19:11 +0200)]
nv50: fix 4th component of Lx_SINT/UINT formats

11 years agor600g: Fix build with --enable-opencl
Tom Stellard [Thu, 18 Apr 2013 18:24:48 +0000 (11:24 -0700)]
r600g: Fix build with --enable-opencl

11 years agomesa: enable GL_ARB_texture_float if TEXTURE_FLOAT_ENABLED is defined
Brian Paul [Thu, 18 Apr 2013 14:20:56 +0000 (08:20 -0600)]
mesa: enable GL_ARB_texture_float if TEXTURE_FLOAT_ENABLED is defined

Per message on mesa-users list, this wasn't working before.

Note: This is a candidate for the stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agogallivm: change cubemaps / derivatives handling, take 55
Roland Scheidegger [Thu, 18 Apr 2013 15:06:43 +0000 (17:06 +0200)]
gallivm: change cubemaps / derivatives handling, take 55

Turns out the previous "fix" for handling per-pixel face selection and
derivatives didn't work out that well - the derivatives were wrong by
quite a bit, in theory transformation of the derivatives into cube space
should work, but would be _a lot_ more work than the "simplified" transform
used.
So, for explicit derivatives, I'm just giving up and go back to not honoring
them.
For implicit derivatives (and the fake explicit ones) however we try
something a little different, we just calculate rho as we would for a 3d
texture, that is after scaling the coords by the inverse major axis.
This gives the same results as calculating the derivs after projection of
the coords to the same face as long as all pixels hit the same face (and
only without rho_no_opt, otherwise it should be a bit worse). And when
not all pixels are hitting the same face, the results aren't so hot but
not catastrophically bad (I believe not off by more than a factor of 2 without
no_rho_approx and not more than sqrt(2) with no_rho_approx). I think this is
better than just picking the wrong face but who knows...

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm: Add no_rho_approx debug option
Roland Scheidegger [Thu, 18 Apr 2013 15:04:01 +0000 (17:04 +0200)]
gallivm: Add no_rho_approx debug option

This will calculate rho correctly as
sqrt(max((ds/dx)^2 + (dt/dx)^2 + (dr/dx)^2), (ds/dx)^2 + (dt/dx)^2 + (dr/dx)^2))
instead of max(|ds/dx|,|dt/dx|,|dr/dx|,|ds/dy|,|dt/dy,|dr/dy|)
(for 3 coords - 2 coords work analogous, for 1 coord there's no point doing
the exact version), for both implicit and explicit derivatives.
While such approximation seems to be allowed in OpenGL some APIs may be less
forgiving, and the error can be quite large (sqrt(2) for 2 coords, sqrt(3) for
3 coords so wrong by nearly one mip level in the latter case).
This also helps to single out "real" bugs from "expected" ones, so it is debug
only (though at least combined with no_brilinear I didn't really see much of a
performance difference but only tested with a debug build - at least with
implicit mipmaps the instruction count is almost exactly the same though the
instructions are more complex (1 sqrt and mul/adds instead of and/max mostly).
The code when the option isn't set stays exactly the same.

v2: rename no_rho_opt to no_rho_approx.

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agollvmpipe: Support half integer pixel center fs coord.
José Fonseca [Thu, 18 Apr 2013 10:39:19 +0000 (11:39 +0100)]
llvmpipe: Support half integer pixel center fs coord.

Tested with graw/fs-fragcoord 2/3, and piglit
glsl-arb-fragment-coord-conventions.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agollvmpipe: Remove the static interpolation.
José Fonseca [Thu, 18 Apr 2013 09:33:09 +0000 (10:33 +0100)]
llvmpipe: Remove the static interpolation.

No longer used.

If we ever want the old behavior we can run a loop unroller pass.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agogallivm: Drop pos arg from lp_build_tgsi_soa.
José Fonseca [Thu, 18 Apr 2013 08:55:35 +0000 (09:55 +0100)]
gallivm: Drop pos arg from lp_build_tgsi_soa.

Never used.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agodocs: update release notes for 9.2
Andreas Boll [Wed, 17 Apr 2013 15:26:08 +0000 (17:26 +0200)]
docs: update release notes for 9.2

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoralloc: Move declarations before statements.
José Fonseca [Thu, 18 Apr 2013 05:21:04 +0000 (06:21 +0100)]
ralloc: Move declarations before statements.

Trivial.  Should fix MSVC build.

11 years agoconfigure: enable vdpau and xvmc detection, with gallium
Emil Velikov [Thu, 18 Apr 2013 00:40:40 +0000 (01:40 +0100)]
configure: enable vdpau and xvmc detection, with gallium

Currently the vdpau and xvmc detection code, is enabled for all builds. The
state trackers exist only within gallium. Enable whenever at least one gallium
driver is selected

v2: removed stray '-a'
[mattst88 v3]: Removed stray $.
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=63645
Reviewed-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
11 years agoi965: Check reg.nr for BRW_ARF_NULL instead of reg.file.
Matt Turner [Mon, 15 Apr 2013 22:00:08 +0000 (15:00 -0700)]
i965: Check reg.nr for BRW_ARF_NULL instead of reg.file.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Implement work-around for CMP with null dest on Haswell.
Matt Turner [Mon, 15 Apr 2013 21:59:09 +0000 (14:59 -0700)]
i965: Implement work-around for CMP with null dest on Haswell.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi915g: Release old fragment shader sampler views with current pipe
Stuart Abercrombie [Thu, 11 Apr 2013 17:57:43 +0000 (10:57 -0700)]
i915g: Release old fragment shader sampler views with current pipe

We were trying to use a destroy method from a deleted context.
This fix is based on what's in the svga driver.

Reviewed-by: Stéphane Marchesin <marcheu@chromium.org>
11 years agoi965/vec4: Fix hypothetical use of uninitialized data in attribute_map[].
Paul Berry [Tue, 16 Apr 2013 19:49:51 +0000 (12:49 -0700)]
i965/vec4: Fix hypothetical use of uninitialized data in attribute_map[].

Fixes issue identified by Klocwork analysis:

    'attribute_map' array elements might be used uninitialized in this
    function (vec4_visitor::lower_attributes_to_hw_regs).

The attribute_map array contains the mapping from shader input
attributes to the hardware registers they are stored in.
vec4_vs_visitor::setup_attributes() only populates elements of this
array which, according to core Mesa, are actually used by the shader.
Therefore, when vec4_visitor::lower_attributes_to_hw_regs() accesses
the array to lower a register access in the shader, it should in
principle only access elements of attribute_map that contain valid
data.  However, if a bug ever caused the driver back-end to access an
input that was not flagged as used by core Mesa, then
lower_attributes_to_hw_regs() would access uninitialized memory, which
could cause illegal instructions to get generated, resulting in a
possible GPU hang.

This patch makes the situation more robust by using memset() to
pre-initialize the attribute_map array to zero, so that if such a bug
ever occurred, lower_attributes_to_hw_regs() would generate a (mostly)
harmless access to r0.  In addition, it adds assertions to
lower_attributes_to_hw_regs() so that if we do have such a bug, we're
likely to discover it quickly.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoralloc: don't write to memory in case of alloc fail.
Dave Airlie [Wed, 17 Apr 2013 01:07:49 +0000 (11:07 +1000)]
ralloc: don't write to memory in case of alloc fail.

For some reason I made this happen under indirect rendering,
I think we might have a leak, valgrind gave out, so I said I'd
fix the basic problem.

NOTE: This is a candidate for stable branches.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
11 years agomesa: generate glGetInteger/Boolean/Float/Doublev() code for all APIs
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
mesa: generate glGetInteger/Boolean/Float/Doublev() code for all APIs

No longer pass -a flag to the get_hash_generate.py script to specify
OpenGL, ES1, ES2, etc.  This updates the autoconf, scons and android
build files too (so we can bisect).

This is the last of the API-dependent conditional compilation in
core Mesa.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: remove mfeatures.h
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
mesa: remove mfeatures.h

No longer needed.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: remove #include "mfeatures.h" from numerous source files
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
mesa: remove #include "mfeatures.h" from numerous source files

None of the remaining FEATURE_x symbols in mfeatures.h are used anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoglapi: no longer emit #include "mfeatures.h" in generated files
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
glapi: no longer emit #include "mfeatures.h" in generated files

None of the symbols in mfeatures.h are used anymore.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agomesa: remove FEATURE_remap_table from remap.[ch]
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
mesa: remove FEATURE_remap_table from remap.[ch]

It was always defined.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoglapi: remove FEATURE_remap_table test (it's always defined)
Brian Paul [Wed, 17 Apr 2013 15:49:39 +0000 (09:49 -0600)]
glapi: remove FEATURE_remap_table test (it's always defined)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agodraw/so: respect leading/provoking vertex info
Zack Rusin [Wed, 17 Apr 2013 22:21:35 +0000 (15:21 -0700)]
draw/so: respect leading/provoking vertex info

we were ignoring leading/provoking vertex settings which was
breaking decomposition of some strips.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agosoftpipe/so: use the correct variable for reporting stream out
Zack Rusin [Wed, 17 Apr 2013 22:19:34 +0000 (15:19 -0700)]
softpipe/so: use the correct variable for reporting stream out

we were using the wrong vars, reporting incorrect stream output
statistics.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm/gs: fix indirect addressing in geometry shaders
Zack Rusin [Wed, 17 Apr 2013 19:15:12 +0000 (12:15 -0700)]
gallivm/gs: fix indirect addressing in geometry shaders

We were always treating the vertex index as a scalar but when the
shader is using indirect addressing it will be a vector of indices
for each channel. This was causing some nasty crashes insides
LLVM.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agost/wgl: fix issue with SwapBuffers of minimized windows
Brian Paul [Wed, 17 Apr 2013 22:16:24 +0000 (16:16 -0600)]
st/wgl: fix issue with SwapBuffers of minimized windows

If a window's minimized we get a zero-size window.  Skip the SwapBuffers
in that case to avoid some warning messages with the VMware svga driver.
Internal bug #996695

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agointel: Don't dereference a NULL pointer of calloc fails
Ian Romanick [Tue, 16 Apr 2013 16:31:08 +0000 (09:31 -0700)]
intel: Don't dereference a NULL pointer of calloc fails

The caller of NewTextureObject does the right thing if NULL is returned,
so this function should do the right thing too.

NOTE: This is a candidate for stable branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agoi965: Trim trailing whitespace in brw_defines.h.
Eric Anholt [Thu, 21 Mar 2013 17:07:31 +0000 (10:07 -0700)]
i965: Trim trailing whitespace in brw_defines.h.

It was all over the formats section I wanted to edit.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor200: fix build failure introduced with cbbcb0247e6aa8d7adc274a94206ee02f9c70bea
Laurent Carlier [Wed, 17 Apr 2013 19:40:16 +0000 (21:40 +0200)]
r200: fix build failure introduced with cbbcb0247e6aa8d7adc274a94206ee02f9c70bea

Signed-off-by: Brian Paul <brianp@vmware.com>
11 years agost/mesa: clean up formatting in st_cb_msaa.c
Brian Paul [Wed, 17 Apr 2013 16:02:29 +0000 (10:02 -0600)]
st/mesa: clean up formatting in st_cb_msaa.c

Insert blank lines, wrap lines, remove trailing whitespace, etc.

11 years agomesa: remove gl_context::_TriangleCaps
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove gl_context::_TriangleCaps

No longer used anywhere.

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_TRI_LIGHT_TWOSIDE flag
Brian Paul [Wed, 17 Apr 2013 17:58:33 +0000 (11:58 -0600)]
mesa: remove DD_TRI_LIGHT_TWOSIDE flag

v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_TRI_UNFILLED flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_TRI_UNFILLED flag

Use alternate code in intel, r200, radeon drivers.
v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_TRI_SMOOTH flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_TRI_SMOOTH flag

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_TRI_STIPPLE flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_TRI_STIPPLE flag

Make it a local macro for the i915 driver.
v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_TRI_OFFSET flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_TRI_OFFSET flag

Make it a local macro for the i915 driver.
v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_POINT_ATTEN flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_POINT_ATTEN flag

For the i915 driver, make it a local macro.
v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_POINT_SMOOTH flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_POINT_SMOOTH flag

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_LINE_STIPPLE flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_LINE_STIPPLE flag

For the i915 driver, make it a local macro.
v2: use conditional operator instead of bit shifting

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove DD_SEPARATE_SPECULAR flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove DD_SEPARATE_SPECULAR flag

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agomesa: remove unused DD_LINE_SMOOTH flag
Brian Paul [Wed, 17 Apr 2013 01:06:22 +0000 (19:06 -0600)]
mesa: remove unused DD_LINE_SMOOTH flag

Reviewed-by: Eric Anholt <eric@anholt.net>
11 years agodraw/gs: make sure geometry shaders don't overflow
Zack Rusin [Wed, 17 Apr 2013 03:31:22 +0000 (20:31 -0700)]
draw/gs: make sure geometry shaders don't overflow

The specification says that the geometry shader should exit if the
number of emitted vertices is bigger or equal to max_output_vertices and
we can't do that because we're running in the SoA mode, which means that
our storing routines will keep getting called on channels that have
overflown (even though they will be masked out, but we just can't skip
them).
So we need some scratch area where we can keep writing the overflown
vertices without overwriting anything important or crashing.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agodraw/gs: Return early if the passed geometry shader is null
Zack Rusin [Wed, 17 Apr 2013 03:17:08 +0000 (20:17 -0700)]
draw/gs: Return early if the passed geometry shader is null

Can happen if we were using stream output without geometry
shader, by returning early we avoid a crash.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agodraw: implement pipeline statistics in the draw module
Zack Rusin [Thu, 11 Apr 2013 13:11:29 +0000 (06:11 -0700)]
draw: implement pipeline statistics in the draw module

This is a basic implementation of the pipeline statistics in the
draw module. The interface is similar to the stream output statistics
and also requires that the callers explicitly enable it.
Included is the implementation of the interface in llvmpipe and
softpipe. Only softpipe enables the pipeline statistics capability
though because llvmpipe is lacking gathering of the fragment shading
and rasterization statistics.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm/gs: fix the end primitive calls
Zack Rusin [Thu, 11 Apr 2013 09:22:06 +0000 (02:22 -0700)]
gallivm/gs: fix the end primitive calls

The issue with SOA execution and end_primitive opcode is that it
can be executed both when we haven't emitted any vertices, in
which case we don't want to emit an empty primitive, and when
the execution mask is zero and the execution should be skipped. We
handled only the latter of those conditions. Now we're combining the
execution mask with a mask created from emitted vertices to handle
both cases. As a result we don't need the pending_end_primitive
flag which was broken because it was static and could be affected
by both above mentioned conditions at run-time.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agotgsi/exec: geometry shaders are executed on a single primitive
Zack Rusin [Wed, 10 Apr 2013 22:28:01 +0000 (15:28 -0700)]
tgsi/exec: geometry shaders are executed on a single primitive

which means that our execution mask in GS is equal to 1 not 0xf.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agotgsi/exec: fix the udiv and umod instructions
Zack Rusin [Wed, 10 Apr 2013 22:25:18 +0000 (15:25 -0700)]
tgsi/exec: fix the udiv and umod instructions

Same as with llvmpipe: we can't be divind/moding by zero and we
need to make sure that dividing/moding by zero produces 0xffffffff.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm: JIT symbol resolution with linux perf.
José Fonseca [Wed, 17 Apr 2013 12:32:15 +0000 (13:32 +0100)]
gallivm: JIT symbol resolution with linux perf.

Details on docs/llvmpipe.html

Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agodraw: Silence uninitialized var warnings.
José Fonseca [Wed, 17 Apr 2013 12:32:46 +0000 (13:32 +0100)]
draw: Silence uninitialized var warnings.

Trivial.

11 years agor600g/llvm: Use gprcount from llvm
Vincent Lejeune [Sat, 13 Apr 2013 14:36:02 +0000 (16:36 +0200)]
r600g/llvm: Use gprcount from llvm

11 years agointel: Add a null pointer check before dereferencing the pointer
Anuj Phogat [Tue, 16 Apr 2013 17:34:43 +0000 (10:34 -0700)]
intel: Add a null pointer check before dereferencing the pointer

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agodocs: Update 'Making new mesa release'
Emil Velikov [Fri, 12 Apr 2013 11:41:52 +0000 (12:41 +0100)]
docs: Update 'Making new mesa release'

Add a note to update PACKAGE_VERSION for Android and scons builds

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agodocs: Add some missing release notes
Emil Velikov [Fri, 12 Apr 2013 11:41:51 +0000 (12:41 +0100)]
docs: Add some missing release notes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agodocs: move specs to a separate folder
Emil Velikov [Fri, 12 Apr 2013 11:41:50 +0000 (12:41 +0100)]
docs: move specs to a separate folder

Handle legacy/obsolete specs as well
List all specs in extensions.html
Mark 'OLD' extensions as obsolete in extensions.html
Update the spec location in old relnotes

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agodocs: restructure release notes into separate folder
Emil Velikov [Fri, 12 Apr 2013 11:41:49 +0000 (12:41 +0100)]
docs: restructure release notes into separate folder

relnotes-*html > relnotes/*html
RELNOTES-* > relnotes/*
fix links, css and frames

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallium: Disambiguate TGSI_OPCODE_IF.
José Fonseca [Wed, 17 Apr 2013 09:47:03 +0000 (10:47 +0100)]
gallium: Disambiguate TGSI_OPCODE_IF.

TGSI_OPCODE_IF condition had two possible interpretations:

- src.x != 0.0f

  - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was false either for
    vertex and fragment shaders
  - gallivm/llvmpipe
  - postprocess
  - vl state tracker
  - vega state tracker
  - most old drivers
  - old internal state trackers
  - many graw examples

- src.x != 0U

  - Mesa statetracker when PIPE_SHADER_CAP_INTEGERS was true for both
    vertex and fragment shaders
  - tgsi_exec/softpipe
  - r600
  - radeonsi
  - nv50

And drivers that use draw module also were a mess (because Mesa would
emit float IFs, but draw module supports native integers so it would
interpret IF arg as integers...)

This sort of works if the source argument is limited to float +0.0f or
+1.0f, integer 0, but would fail if source is float -0.0f, or integer in
the float NaN range.  It could also fail if source is integer 1, and
hardware flushes denormalized numbers to zero.

But with this change there are now two opcodes, IF and UIF, with clear
meaning.

Drivers that do not support native integers do not need to worry about
UIF.  However, for backwards compatibility with old state trackers and
examples, it is advisable that native integer capable drivers also
support the float IF opcode.

I tried to implement this for r600 and radeonsi based on the surrounding
code.  I couldn't do this for nouveau, so I just shunted IF/UIF
together, which matches the current behavior.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
v2:
- Incorporate Roland's feedback.
- Fix r600_shader.c merge conflict.
- Fix typo in radeon, spotted by Michel Dänzer.
- Incorporte  Christoph Bumiller's patch to handle TGSI_OPCODE_IF(float)
  properly in nv50/ir.

11 years agogallium: Eliminate TGSI_OPCODE_IFC.
José Fonseca [Sat, 13 Apr 2013 09:28:01 +0000 (10:28 +0100)]
gallium: Eliminate TGSI_OPCODE_IFC.

Never used or implemented.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
11 years agoi965: Enable the Bay Trail platform.
Kenneth Graunke [Wed, 3 Oct 2012 21:26:29 +0000 (14:26 -0700)]
i965: Enable the Bay Trail platform.

This patch adds PCI IDs for Bay Trail (sometimes called Valley View).
As far as the 3D driver is concerned, it's very similar to Ivybridge,
so the existing code should work just fine.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor600/uvd: cleanup disabling tiling on pre EG asics
Christian König [Fri, 12 Apr 2013 15:13:41 +0000 (17:13 +0200)]
r600/uvd: cleanup disabling tiling on pre EG asics

Set transfer flag instead of fiddling with the tilling params directly.

Signed-off-by: Christian König <christian.koenig@amd.com>
11 years agoautoconf: enable detection of vdpau and xvmc by default
Christian König [Fri, 12 Apr 2013 08:25:18 +0000 (10:25 +0200)]
autoconf: enable detection of vdpau and xvmc by default

Since we now have UVD support we should enable them by default.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
11 years agomesa/swrast: Move memory allocation outside the blit loop
Ian Romanick [Mon, 15 Apr 2013 19:25:18 +0000 (12:25 -0700)]
mesa/swrast: Move memory allocation outside the blit loop

Assume the maximum pixel size (16 bytes per pixel).  In addition to
moving redundant malloc and free calls outside the loop, this fixes a
potential resource leak when a surface is mapped and the malloc fails.
This also makes blit_nearest look a bit more like blit_linear.

v2: Use MAX_PIXEL_BYTES instead of 16.  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>
11 years agomesa/swrast: Move free calls outside the attachment loop
Ian Romanick [Fri, 12 Apr 2013 23:47:52 +0000 (16:47 -0700)]
mesa/swrast: Move free calls outside the attachment loop

This was originally discovered by Klocwork analysis:

    Possible memory leak. Dynamic memory stored in 'srcBuffer0'
    allocated through function 'malloc' at line 566 can be lost at line
    746

However, I think the problem is actually much worse.  Since the memory
is freed after the first pass through the loop, the released buffer may
be used on the next iteration!

NOTE: This is a candidate for stable release branches.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa/swrast: Refactor no-memory error checking in blit_linear
Ian Romanick [Fri, 12 Apr 2013 23:47:13 +0000 (16:47 -0700)]
mesa/swrast: Refactor no-memory error checking in blit_linear

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agor600g: Workaround for a harware bug with nested loops on Cayman
Martin Andersson [Tue, 16 Apr 2013 14:02:00 +0000 (18:02 +0400)]
r600g: Workaround for a harware bug with nested loops on Cayman

There is a hardware bug on Cayman where a BREAK/CONTINUE followed by
LOOP_STARTxxx for nested loops may put the branch stack into a state
such that ALU_PUSH_BEFORE doesn't work as expected. Workaround this
by replacing the ALU_PUSH_BEFORE with a PUSH + ALU

Fixes piglit tests EXT_transform_feedback/order*

v2: Use existing loop count and improve comment
v3: [Vadim Girlin] Set jump address for PUSH instructions

NOTE: This is a candidate for the 9.1 branch

Signed-off-by: Vadim Girlin <vadimgirlin@gmail.com>
11 years agogallium/hud: fix FPS computation for framerate > 4.2k
Marek Olšák [Thu, 11 Apr 2013 11:16:42 +0000 (13:16 +0200)]
gallium/hud: fix FPS computation for framerate > 4.2k

11 years agogallium/hud: increase vertex buffer size for background black rectangles
Marek Olšák [Wed, 10 Apr 2013 19:42:51 +0000 (21:42 +0200)]
gallium/hud: increase vertex buffer size for background black rectangles

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallium/hud: update the contents of GALLIUM_HUD=help
Marek Olšák [Wed, 10 Apr 2013 19:41:48 +0000 (21:41 +0200)]
gallium/hud: update the contents of GALLIUM_HUD=help

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agogallium/hud: remove pipeline-statistics- prefix in query names
Marek Olšák [Wed, 10 Apr 2013 19:40:39 +0000 (21:40 +0200)]
gallium/hud: remove pipeline-statistics- prefix in query names

for the env var string not to be awfully long

v2: fix bug in indexing of "name"

Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agor600g: implement pipeline statistics query
Marek Olšák [Wed, 10 Apr 2013 18:45:01 +0000 (20:45 +0200)]
r600g: implement pipeline statistics query

11 years agowinsys/radeon: use query_value for timestamp, remove query_timestamp
Marek Olšák [Wed, 10 Apr 2013 15:01:07 +0000 (17:01 +0200)]
winsys/radeon: use query_value for timestamp, remove query_timestamp

11 years agor600g: add a debug flag for printing virtual addresses of resources
Marek Olšák [Fri, 5 Apr 2013 23:33:21 +0000 (01:33 +0200)]
r600g: add a debug flag for printing virtual addresses of resources

11 years agor600g: add a query returning the amount of time spent during bo_map sync.
Marek Olšák [Fri, 5 Apr 2013 00:43:26 +0000 (02:43 +0200)]
r600g: add a query returning the amount of time spent during bo_map sync.

11 years agobuild: Get rid of GALLIUM_WINSYS_DIRS
Matt Turner [Sun, 20 Jan 2013 23:32:08 +0000 (15:32 -0800)]
build: Get rid of GALLIUM_WINSYS_DIRS

configure still uses it to print the enabled winsys.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Get rid of GALLIUM_TARGET_DIRS
Matt Turner [Sun, 20 Jan 2013 21:06:24 +0000 (13:06 -0800)]
build: Get rid of GALLIUM_TARGET_DIRS

configure still uses it to print the enabled targets.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Build pipe-loader before gallium tests
Matt Turner [Sun, 20 Jan 2013 20:54:31 +0000 (12:54 -0800)]
build: Build pipe-loader before gallium tests

And don't build it from other Makefiles. That's awful, and breaks
distclean.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Get rid of GALLIUM_MAKE_DIRS
Matt Turner [Sun, 20 Jan 2013 19:46:02 +0000 (11:46 -0800)]
build: Get rid of GALLIUM_MAKE_DIRS

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Stop using GALLIUM_STATE_TRACKERS_DIRS for SUBDIRS
Matt Turner [Sat, 19 Jan 2013 19:23:51 +0000 (11:23 -0800)]
build: Stop using GALLIUM_STATE_TRACKERS_DIRS for SUBDIRS

configure still uses it to print the enabled state trackers.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Get rid of DRIVER_DIRS
Matt Turner [Sat, 19 Jan 2013 08:35:43 +0000 (00:35 -0800)]
build: Get rid of DRIVER_DIRS

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Stop AC_SUBST'ing DRI_DIRS and GALLIUM_DRIVERS_DIRS
Matt Turner [Sat, 19 Jan 2013 08:28:29 +0000 (00:28 -0800)]
build: Stop AC_SUBST'ing DRI_DIRS and GALLIUM_DRIVERS_DIRS

Neither are used in Makefile.ams.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Remove GALLIUM_DIRS
Matt Turner [Sat, 19 Jan 2013 08:09:36 +0000 (00:09 -0800)]
build: Remove GALLIUM_DIRS

It's always constant anyway.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Get rid of SRC_DIRS
Matt Turner [Sat, 19 Jan 2013 07:59:49 +0000 (23:59 -0800)]
build: Get rid of SRC_DIRS

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Get rid of CORE_DIRS
Matt Turner [Sat, 19 Jan 2013 07:43:05 +0000 (23:43 -0800)]
build: Get rid of CORE_DIRS

A step toward working make dist/distcheck.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Move src/mapi/mapi/* to src/mapi/
Matt Turner [Mon, 21 Jan 2013 18:27:25 +0000 (10:27 -0800)]
build: Move src/mapi/mapi/* to  src/mapi/

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agobuild: Rename sources.mak -> Makefile.sources
Matt Turner [Mon, 21 Jan 2013 18:25:31 +0000 (10:25 -0800)]
build: Rename sources.mak -> Makefile.sources

For the sake of consistency.

Tested-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-and-Tested-by: Andreas Boll <andreas.boll.dev@gmail.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
11 years agoradeonsi: Read config values from the .AMDGPU.config ELF section
Tom Stellard [Thu, 4 Apr 2013 20:21:06 +0000 (16:21 -0400)]
radeonsi: Read config values from the .AMDGPU.config ELF section

Instead of emitting configuration values (e.g. number of gprs used) in a
predefined order, the LLVM backend now emits these values in
register/value pairs.  The first dword contains the register address and
the second dword contians the value to write.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
11 years agoradeon/llvm: Handle ELF formatted binary output from the LLVM backend
Tom Stellard [Thu, 4 Apr 2013 20:02:51 +0000 (13:02 -0700)]
radeon/llvm: Handle ELF formatted binary output from the LLVM backend

11 years agoradeon/llvm: Use a struct for storing compiled code
Tom Stellard [Thu, 4 Apr 2013 16:57:13 +0000 (09:57 -0700)]
radeon/llvm: Use a struct for storing compiled code

11 years agogallivm: fix small but severe bug in handling multiple lod level strides
Roland Scheidegger [Mon, 15 Apr 2013 01:57:23 +0000 (03:57 +0200)]
gallivm: fix small but severe bug in handling multiple lod level strides

Inserting the value for the second quad in the wrong place for the
following shuffle. This meant the row or image stride was undefined which is
quite catastrophic, can lead to bogus texels fetched or just segfault.
This code is only hit for SoA path currently, still surprising it
didn't crash more or caused more visible issues (I think llvm used a
broadcast shuffle for the undefined parts of the vector, hence the undefined
value for the second quad was just the same as that from the first quad,
so as long as both quads hit the same mip level everything was fine, and since
lower mips always have the same large stride it made it less likely to
hit out-of-bound memory in case of differing lods).

Note: this is a candidate for stable branches.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agoclover: Fix usage of incorrect object as destination in clEnqueueCopyBufferToImage.
Francisco Jerez [Sun, 7 Apr 2013 16:31:06 +0000 (18:31 +0200)]
clover: Fix usage of incorrect object as destination in clEnqueueCopyBufferToImage.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
11 years agoclover: Define platform class and merge with device_registry.
Francisco Jerez [Sat, 6 Apr 2013 12:35:00 +0000 (14:35 +0200)]
clover: Define platform class and merge with device_registry.

Null platform IDs are OK according to the spec, but some applications have
been reported to get paranoid and assume that our NULL platform is unusable.

As it doesn't hurt to have device enumeration separate from the rest of the
device code (quite the opposite, it makes the code cleaner), make the API use
an actual platform object that keeps track of the available devices instead of
the former NULL pointer.

Reported-and-reviewed-by: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Francisco Jerez <currojerez@riseup.net>
11 years agoclover: Add missing fields to the module serializer.
Francisco Jerez [Sat, 13 Apr 2013 10:17:32 +0000 (12:17 +0200)]
clover: Add missing fields to the module serializer.

Signed-off-by: Francisco Jerez <currojerez@riseup.net>
11 years agoi965: Shut up the last release build warning.
Eric Anholt [Thu, 11 Apr 2013 17:46:02 +0000 (10:46 -0700)]
i965: Shut up the last release build warning.

I don't see a sensible value to use in this path, but we shouldn't ever
hit this outside of developer new-texture-target enabling.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965: Silence one more compile warning.
Eric Anholt [Thu, 11 Apr 2013 17:38:04 +0000 (10:38 -0700)]
i965: Silence one more compile warning.

We don't want to store this thing in the class, and we do need the
definition to be at the top of the function and held onto until the end
here, so there's not much to do besides (void) reference it.

Reviewed-by: Matt Turner <mattst88@gmail.com>
11 years agoi965: Fix a warning in the release build.
Eric Anholt [Thu, 11 Apr 2013 17:37:13 +0000 (10:37 -0700)]
i965: Fix a warning in the release build.

This was copy and pasted from can_reswizzle_dst(), and we can just fold it
in instead to avoid the warning.

Reviewed-by: Matt Turner <mattst88@gmail.com>