mesa.git
11 years agogallivm: implement switch opcode
Roland Scheidegger [Fri, 19 Apr 2013 23:46:04 +0000 (01:46 +0200)]
gallivm: implement switch opcode

Should be able to handle all things which make this tricky to implement.
Fallthroughs, including most notably into/out of default, should be handled
correctly but are quite a mess.
If we see largely unoptimized switches in the wild should probably think
about some "real" switch optimization pass, e.g. things like this:

switch
case1
someinst
brk
case2
default
case3
someinst
brk
case4
someinst
endswitch

are legal, but the pointless case2/case3 statements not only cause condition
evaluation but will turn this into a "fake" fallthrough case (because
mask and defaultmask are already updated for case2 when default is
encountered) requiring executing code twice.
If default is at the end though, there's never any code re-execution, and
if that's not the case if there's no fallthrough in (not even a fake one)
and out of default there's no code re-execution neither.

v2: add comments, and use enum for break type instead of magic boolean.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm: use uint build context for mask instead of float
Roland Scheidegger [Fri, 19 Apr 2013 01:38:50 +0000 (03:38 +0200)]
gallivm: use uint build context for mask instead of float

Unsurprisingly noone was using it except for grabbing builder.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm/tgsi: fix up breakc
Roland Scheidegger [Fri, 19 Apr 2013 01:26:20 +0000 (03:26 +0200)]
gallivm/tgsi: fix up breakc

It seems there was a typo in gallivm breakc handling (I am actually still
not sure it is really needed but otherwise that statement really should go
away). Also fix the wrong src argument type, even though they weren't really
used.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agosvga: remove TGSI_OPCODE_BREAKC instruction translation
Roland Scheidegger [Fri, 19 Apr 2013 22:38:31 +0000 (00:38 +0200)]
svga: remove TGSI_OPCODE_BREAKC instruction translation

While initially that opcode probably was meant for something along the
lines of sm3 break_comp it has never worked that way (not even the
argument count was right) and now the opcode has quite different
semantics so just remove it. (Discovered by Jose Fonseca)

11 years agogallium: document breakc and switch/case/default/endswitch
Roland Scheidegger [Fri, 19 Apr 2013 22:34:20 +0000 (00:34 +0200)]
gallium: document breakc and switch/case/default/endswitch

docs were missing, especially the opcode-from-hell switch however is anything
but obvious.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agogallivm: increase nesting limit to 66
Roland Scheidegger [Thu, 18 Apr 2013 15:18:15 +0000 (17:18 +0200)]
gallivm: increase nesting limit to 66

This is still not really correct, since at least for sm 4.0
the nesting limit is 64 per subroutine, and subroutine nesting itself
has a limit of 32, so since we have a flat stack we'd need 32*64.
But this should probably be better fixed with per-subroutine stacks,
since otherwise these structures get really big (like 100kB for the
lp_exec_mask).

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agodraw: implement primitive assembler
Zack Rusin [Thu, 18 Apr 2013 10:08:41 +0000 (03:08 -0700)]
draw: implement primitive assembler

Input assembler needs to be able to decompose adjacency primitives
into something that can be understood by the rest of the pipeline.
The specs say that the adjacency primitives are *only* visible
in the geometry shader, for everything else they need to be
decomposed. Which in most of the cases is not an issue, because
the geometry shader always decomposes them for us, but without
geometry shader we were passing unchanged adjacency primitives
to the rest of the pipeline and causing crashes everywhere. This
commit introduces a primitive assembler which, if geometry
shader is missing and the input primitive is one of the
adjacency primitives, decomposes them into something
that the rest of the pipeline can understand.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
11 years agoutil/prim: fix decomposed counts for adjacency primitives
Zack Rusin [Thu, 18 Apr 2013 10:03:14 +0000 (03:03 -0700)]
util/prim: fix decomposed counts for adjacency primitives

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agodraw/so: uses the correct index with the pre clipped coordinates
Zack Rusin [Thu, 18 Apr 2013 02:25:20 +0000 (19:25 -0700)]
draw/so: uses the correct index with the pre clipped coordinates

pre_clip_pos is a float[4] we just used (*float)[4] to be able to
jump within the array of vertex_headers with it. So if the idx
happened to be anything but 0, we'd actually read from some garbage
in memory. Change it to just be a simple pointer instead of casting
it to something that it's not. As suggested by Jose.

Signed-off-by: Zack Rusin <zackr@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
11 years agoglapi: Add counter information for glBufferData(), like glBufferSubData().
Eric Anholt [Wed, 27 Feb 2013 21:56:51 +0000 (13:56 -0800)]
glapi: Add counter information for glBufferData(), like glBufferSubData().

This causes this function to become asynchronous with glthread.

11 years agoglapi: Add parameter count information for uniforms.
Eric Anholt [Wed, 27 Feb 2013 20:47:09 +0000 (12:47 -0800)]
glapi: Add parameter count information for uniforms.

This is the kind of information that would have been present for GLX, if
GLX supported modern GL.  This allows these entrypoints to get automatic
asynchronous marshalling code generated for glthread.

11 years agoglapi: skip padding in get_called_parameter_string
Paul Berry [Wed, 7 Nov 2012 21:49:41 +0000 (13:49 -0800)]
glapi: skip padding in get_called_parameter_string

This bug is currently benign, since get_called_parameter_string() is
currently only used for functions that return true for
glx_function.has_different_protocol(), and none of those functions
include padding.  However, in order to implement marshalling of GL API
functions, we'll need to use get_called_parameter_string() far more
often.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Fix up program_parse.y to avoid uninitialized $$
Paul Berry [Fri, 9 Nov 2012 17:17:22 +0000 (09:17 -0800)]
mesa: Fix up program_parse.y to avoid uninitialized $$

Without this patch, $$.negate, $$.rgba_valid, and $$.xyzw_valid take
on garbage values.  At the moment this problem is benign (the garbage
values happen to be zero), but in my experiments executing GL
operations on a background thread, the garbage values change, leading
to piglit failures.

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
11 years agomesa: Use quotes on bool driconf options to prevent stdbool.h breakage.
Eric Anholt [Thu, 3 Jan 2013 01:02:58 +0000 (17:02 -0800)]
mesa: Use quotes on bool driconf options to prevent stdbool.h breakage.

Since stdbool.h's "true" and "false" are #defines, they got expanded when
used as macro arguments, and that expanded value was stored in the
XML string, producing XML that driconf would then fail to parse.

Currently no drivers included stdbool along with driconf, but I keep
accidentally doing so on intel as we move towards using normal C.

v2: rebase on master.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org> (v1)
11 years agosvga: whitespace, comment fixes in svga_pipe_query.c
Brian Paul [Thu, 18 Apr 2013 22:09:27 +0000 (16:09 -0600)]
svga: whitespace, comment fixes in svga_pipe_query.c

11 years agosvga: whitespace, comment fixes in svga_pipe_fs/vs.c
Brian Paul [Thu, 18 Apr 2013 21:56:53 +0000 (15:56 -0600)]
svga: whitespace, comment fixes in svga_pipe_fs/vs.c

11 years agogallivm: Fix half floats with MCJIT.
José Fonseca [Fri, 19 Apr 2013 09:13:02 +0000 (10:13 +0100)]
gallivm: Fix half floats with MCJIT.

Prevents:

  LLVM ERROR: Cannot select: intrinsic %llvm.x86.vcvtph2ps.128

11 years agoRevert "i965: Check reg.nr for BRW_ARF_NULL instead of reg.file."
Matt Turner [Fri, 19 Apr 2013 04:51:49 +0000 (21:51 -0700)]
Revert "i965: Check reg.nr for BRW_ARF_NULL instead of reg.file."

This reverts commit ecdda414d361ab4430fd5747c9217687c1f3d63f.

Commit was supposed to be a simple typo fix. Clearly needs more
investigating.

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

11 years agoconfigure.ac: Remove gallium-g3dvl flag.
Matt Turner [Thu, 18 Apr 2013 01:21:47 +0000 (18:21 -0700)]
configure.ac: Remove gallium-g3dvl flag.

It's next to useless, since it just allows you to turn off VDPAU and
XvMC with a single switch. Just check whether Gallium drivers are
enabled instead.

Reviewed-by: Christian König <christian.koenig@amd.com>
11 years agoradeonsi: add support for compressed texture v2
Jerome Glisse [Mon, 8 Apr 2013 14:57:05 +0000 (10:57 -0400)]
radeonsi: add support for compressed texture v2

Most test pass, issue are with border color and swizzle.

Based on ircnick<maelcum> patch.

v2: Restaged commit hunk

Signed-off-by: Jerome Glisse <jglisse@redhat.com>
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>