mesa.git
9 years agofreedreno/a3xx: make vs-set point size work
Ilia Mirkin [Tue, 17 Mar 2015 05:02:32 +0000 (01:02 -0400)]
freedreno/a3xx: make vs-set point size work

This appears to need the A2XX version of the point list, so select it at
draw time if necessary.

Experimentally, always using the A2XX version causes hangs when PSIZE
isn't actually emitted.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agofreedreno/a3xx: point size should not be divided by 2
Ilia Mirkin [Tue, 17 Mar 2015 05:00:38 +0000 (01:00 -0400)]
freedreno/a3xx: point size should not be divided by 2

The division is probably a holdover from the days when the fixed point
inline functions generated by headergen were broken.

Also reduce the maximum point size to 4092 (vs 4096), which is what the
blob does.

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agofreedreno/a3xx: fix 3d texture layout
Ilia Mirkin [Sun, 15 Mar 2015 20:38:42 +0000 (16:38 -0400)]
freedreno/a3xx: fix 3d texture layout

The SZ2 field contains the layer size of a lower miplevel. It only
contains 4 bits, which limits the maximum layer size it can describe. In
situations where the next miplevel would be too big, the hardware
appears to keep minifying the size until it hits one of that size.
Unfortunately the hardware's ideas about sizes can differ from
freedreno's which can still lead to issues. Minimize those by stopping
to minify as soon as possible.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
9 years agofreedreno/a3xx: LAYERSZ2 appears to have no effect on arrays
Ilia Mirkin [Fri, 13 Mar 2015 22:01:11 +0000 (18:01 -0400)]
freedreno/a3xx: LAYERSZ2 appears to have no effect on arrays

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonir: Fix copy and pasted error message in nir_validate.
Kenneth Graunke [Sat, 28 Mar 2015 01:22:20 +0000 (18:22 -0700)]
nir: Fix copy and pasted error message in nir_validate.

These are nir_cf_nodes, not ALU instructions.
Also, use unreachable() to preempt said review feedback.

v2: Do it right (thanks Ilia).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir: Use NIR for ARB_vertex_program support on Gen8+.
Kenneth Graunke [Wed, 25 Mar 2015 22:16:30 +0000 (15:16 -0700)]
i965/nir: Use NIR for ARB_vertex_program support on Gen8+.

Everything is already in place; we simply have to take the scalar code
generation path.  This gives us SIMD8 VS programs, instead of SIMD4x2.

v2: Rebase on the patch that drops brw->gen >= 8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoi965: Move env_var_as_boolean to intel_debug.c.
Kenneth Graunke [Fri, 27 Mar 2015 20:48:44 +0000 (13:48 -0700)]
i965: Move env_var_as_boolean to intel_debug.c.

I need to use this in brw_vec4.cpp, so it can't be static anymore.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/fs: Add ARB_fragment_program support to the NIR backend.
Kenneth Graunke [Fri, 30 Jan 2015 09:16:49 +0000 (01:16 -0800)]
i965/fs: Add ARB_fragment_program support to the NIR backend.

Use prog_to_nir where we would normally call glsl_to_nir, handle program
parameter lists, and skip a few things that don't exist.

Using NIR generates much better shader code than Mesa IR, since we get
real optimizations, as opposed to prog_optimize:

total instructions in shared programs: 314007 -> 279892 (-10.86%)
instructions in affected programs:     285173 -> 251058 (-11.96%)
helped:                                2001
HURT:                                  67
GAINED:                                4
LOST:                                  7

v2: Change early return in nir_setup_uniforms to if/else (Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agonir: Lower subtraction to add with negation when !lower_negate.
Kenneth Graunke [Wed, 25 Mar 2015 22:22:12 +0000 (15:22 -0700)]
nir: Lower subtraction to add with negation when !lower_negate.

prog->nir will generate fsub opcodes, but i965 doesn't implement them.
We may as well lower them at the NIR level, since it's trivial to do.

Suggested by Connor Abbott.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Implement a Mesa IR -> NIR translator.
Kenneth Graunke [Fri, 30 Jan 2015 07:22:08 +0000 (23:22 -0800)]
nir: Implement a Mesa IR -> NIR translator.

Shamelessly ripped off from Eric Anholt's tgsi_to_nir pass.

This is not built on SCons, like the rest of NIR.

v2:
- Delete redundant c->s, c->impl, and c->cf_node_list pointers (Ken)
- Use nir_builder directly instead of ptn_compile in more places (Ken)
- Drop 'struct' keyword in front of nir_builder (ken)
- Add a file level Doxygen comment (Ken)
- Use scalar constants instead of splatting (Eric)
- Use nir_builder helpers for constants, moves, and swizzles (Connor)

v3: Minor indentation improvements.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Add builder helpers for MOVs with ALU sources and swizzling MOVs.
Kenneth Graunke [Wed, 25 Mar 2015 21:51:02 +0000 (14:51 -0700)]
nir: Add builder helpers for MOVs with ALU sources and swizzling MOVs.

These will be useful for prog->nir and tgsi->nir.

v2: Don't forget to mark nir_swizzle as inline (Eric).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agonir: Add nir_builder helpers for creating load_const intrinsics.
Kenneth Graunke [Wed, 25 Mar 2015 09:11:52 +0000 (02:11 -0700)]
nir: Add nir_builder helpers for creating load_const intrinsics.

Both prog->nir and tgsi->nir will want to use these.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
9 years agoi965/skl: Don't use the PMA depth stall workaround
Ben Widawsky [Wed, 25 Mar 2015 23:52:46 +0000 (16:52 -0700)]
i965/skl: Don't use the PMA depth stall workaround

The PMA depth stall must be enabled (optimization turned off) under certain
circumstances on gen8. This was supposedly fixed for Gen9, which means we do not
need to check, or toggle the state. The hardware is supposed to enable the
hardware optimization by default, unlike BDW, so we also don't need to set it at
init. For whatever reason this improves stability on ETQW with the bug mentioned
below.

References: https://bugs.freedesktop.org/show_bug.cgi?id=89039 (doesn't fix)
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Tested-by: Anuj Phogat <anuj.phogat@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965/skl: Disable partial resolve in VC
Ben Widawsky [Fri, 27 Feb 2015 02:14:17 +0000 (18:14 -0800)]
i965/skl: Disable partial resolve in VC

Recomendation [sic] is to set this field to 1 always. Programming it to default
value of 0, may have -ve impact on performance for MSAA WLs.

Another don't suck bit which needs to get set.

The patch wasn't as well tested as I would have liked, primarily I don't have
perf numbers for it, but it's getting to a point where it is in danger of being
lost.

v2: v1 was a mix of two patches. Since 0x7004 is masked, we only need to set it
once at initialization and make sure the pma workaround doesn't set the mask bit
(which it doesn't).
Move LRI to init gpu state (Ken)
Add a comment.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agollvmpipe: simplify address calculation for 4x4 blocks
Roland Scheidegger [Fri, 27 Mar 2015 15:49:54 +0000 (16:49 +0100)]
llvmpipe: simplify address calculation for 4x4 blocks

These functions looked quite complicated, even though what they actually did
was trivial (ever since we dropped swizzled rendering). Also drop lookup of
format block per bytes done for each block, and do it once per scene instead.
This improves everybody's favorite "benchmark" by 3% or so, though
lp_rast_shade_quads_all() which calls this shows up still quite high for a
function which does little more than call the jit function.
(This would most likely be much better handled by the jit function itself,
the strides are passed through anyway already, though for being able to
handle layers it would definitely add some complexity.)

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: fix texture function name (key) when using txf/ld
Roland Scheidegger [Sat, 28 Mar 2015 01:57:13 +0000 (02:57 +0100)]
gallivm: fix texture function name (key) when using txf/ld

When using the texel fetch functions rather than ordinary texturing,
the arguments are all int vecs instead of float vecs, not to mention
the actual function would look completely different. Hence this must
be included in the texture function name (which serves as the key)
otherwise things crash badly when a shader accesses the same texture
and sampler unit with both txf/ld and ordinary texturing instructions
with otherwise matching keys.

9 years agoglsl: mark uniform and input interface blocks as read only
Timothy Arceri [Fri, 27 Mar 2015 12:03:40 +0000 (23:03 +1100)]
glsl: mark uniform and input interface blocks as read only

Reviewed-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agonv50/ir/gk110: fix offset flag position for TXD opcode
Ilia Mirkin [Fri, 27 Mar 2015 22:38:24 +0000 (18:38 -0400)]
nv50/ir/gk110: fix offset flag position for TXD opcode

Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonv50/ir: take postFactor into account when doing peephole optimizations
Ilia Mirkin [Wed, 25 Mar 2015 22:00:00 +0000 (18:00 -0400)]
nv50/ir: take postFactor into account when doing peephole optimizations

Multiply operations can have a post-factor on them, which other ops
don't support. Only perform the peephole optimizations when there is no
post-factor involved.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89758
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agogallivm: Fix build since llvm r233411
Jan Vesely [Fri, 27 Mar 2015 22:45:23 +0000 (18:45 -0400)]
gallivm: Fix build since llvm r233411

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agonir: Add optional lowering of flrp.
Eric Anholt [Wed, 18 Feb 2015 20:24:38 +0000 (12:24 -0800)]
nir: Add optional lowering of flrp.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agogallivm: use llvm function calls for texturing instead of inlining
Roland Scheidegger [Fri, 27 Mar 2015 01:39:59 +0000 (02:39 +0100)]
gallivm: use llvm function calls for texturing instead of inlining

There are issues with inlining everything, most notably llvm will use much
more memory (and be slower) when compiling. Ideally we'd probably use
functions for shader functions too but texture sampling usually is responsible
for quite some IR (it can easily reach 80% of total IR instructions) so this
seems like a good start.
This still generates a different function for all different combinations just
like before, however it is possible llvm is missing some optimization
opportunities - it is believed though such opportunities should be somewhat
rare, but at least for now it can still be switched off (at compile time only).
It should probably make compiled code also smaller because the same function
should be used for different variants in the same module (so for the
opaque/partial or linear/elts variants).
No piglit change (though it does indeed speed up unrealistic tests like
fp-indirections2 by a factor of 30 or so).
Has a small negative performance impact in openarena - I suspect this could
be fixed by running some IPO passes (despite the private linkage, llvm right
now does NO optimization at all wrt anything going past the call, even if
there's just one caller - so things like values stored before the call and then
always written by the function etc. will not be optimized away, nor will dead
arguments (which we mostly shouldn't have) be eliminated, always constant
arguments promoted etc.).

v2: use proper return values instead of pointer function arguments.
llvm supports aggregate return values, which do wonders here eliminating
unnecessary stack variables - everything in fact will be returned in registers
even without any IPO optimizations. It makes the code simpler too.
With this I could not measure a peformance impact in openarena any longer
(though since there's still no constant value propagation etc. into the tex
functions this does not mean it couldn't have a negative impact elsewhere).

v3: fix some minor issues suggested by Jose, and do disassembly (and the
profiling) without hacks.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallivm: pass jit_context pointer through to sampling
Roland Scheidegger [Wed, 25 Mar 2015 02:10:10 +0000 (03:10 +0100)]
gallivm: pass jit_context pointer through to sampling

The callbacks used for getting the dynamic texture/sampler state were using
the jit_context from the generated jit function. This works just fine, however
that way it's impossible to generate separate functions for texture sampling,
as will be done in the next commit. Hence, pass this pointer through all
interfaces so it can be passed to a separate function (technically, it would
probably be possible to extract this pointer from the current function instead,
but this feels hacky and would probably require some more hacks if we'd use
real functions instead of inlining all shader functions at some point).
There should be no difference in the generated code for now.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agogallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places."
Christian König [Thu, 26 Mar 2015 13:49:18 +0000 (14:49 +0100)]
gallium/vl: partially revert "Use util_cpu_to_le{16,32} in many more places."

The data in memory is in big endian format and needs to be converted
into CPU byte order. So the patch actually reversed what needs to be done.

Signed-off-by: Christian König <christian.koenig@amd.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agotgsi: fix out-of-bounds access for cube arrays
Ilia Mirkin [Thu, 26 Mar 2015 23:06:37 +0000 (19:06 -0400)]
tgsi: fix out-of-bounds access for cube arrays

The CUBE_ARRAY case uses r[4]. Make sure that the stack variable is
there.

Noticed by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agost/mesa: initialize have_fma in constructor
Ilia Mirkin [Thu, 26 Mar 2015 23:33:01 +0000 (19:33 -0400)]
st/mesa: initialize have_fma in constructor

Spotted by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/util: remove u_linkage
Ilia Mirkin [Thu, 26 Mar 2015 23:26:38 +0000 (19:26 -0400)]
gallium/util: remove u_linkage

Does not appear to be used in tree. Coverity spotted some errors in the
bitmask stuff, but the whole thing appears to be unused.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/hud: avoid overflowing hud graph name size
Ilia Mirkin [Thu, 26 Mar 2015 23:37:50 +0000 (19:37 -0400)]
gallium/hud: avoid overflowing hud graph name size

Spotted by Coverity.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agost/mesa: update arrays when the current attrib has been updated
Ilia Mirkin [Thu, 26 Mar 2015 19:14:22 +0000 (15:14 -0400)]
st/mesa: update arrays when the current attrib has been updated

Fixes the recently-sent gl-2.0-vertex-const-attr piglit test. Makes sure
to revalidate arrays when only the current attribute has been updated
via glVertexAttrib*.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89754
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: "10.4 10.5" <mesa-stable@lists.freedesktop.org>
9 years agost_glsl_to_tgsi: only do mov copy propagation on temps (v2)
Dave Airlie [Wed, 25 Mar 2015 23:17:39 +0000 (09:17 +1000)]
st_glsl_to_tgsi: only do mov copy propagation on temps (v2)

Don't propagate ARRAYs

This should fix:
https://bugs.freedesktop.org/show_bug.cgi?id=89759

v2: just specify arrays so we get input propagation
Signed-off-by: Dave Airlie <airlied@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agoi965: Drop unnecessary brw->gen >= 8 check from scalar VS code.
Kenneth Graunke [Wed, 25 Mar 2015 22:15:43 +0000 (15:15 -0700)]
i965: Drop unnecessary brw->gen >= 8 check from scalar VS code.

brw->scalar_vs already implies that brw->gen >= 8.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/fs: Implement texture projection support.
Kenneth Graunke [Sun, 1 Feb 2015 07:36:52 +0000 (23:36 -0800)]
i965/fs: Implement texture projection support.

Our fragment program backend implements support for TXP directly, and
there's no NIR lowering pass to remove the projection.  When we switch
fragment program support over to NIR, we need to support it somehow.

It's easy enough to support directly.

v2: Split out offset/tex_offset rename (requested by Jordan).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/fs: Rename offset to tex_offset to avoid shadowing offset().
Kenneth Graunke [Wed, 25 Mar 2015 20:12:20 +0000 (13:12 -0700)]
i965/fs: Rename offset to tex_offset to avoid shadowing offset().

fs_visitor::nir_emit_texture() created an fs_reg variable called offset,
which shadowed the offset() helper function in brw_ir_fs.h.

Rename the variable to tex_offset so we can still call offset().

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agonir: Add glsl_float_type() wrapper.
Kenneth Graunke [Tue, 24 Feb 2015 03:56:00 +0000 (19:56 -0800)]
nir: Add glsl_float_type() wrapper.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Use INFINITY instead of std::numeric_limits<float>::infinity().
Matt Turner [Tue, 13 Jan 2015 06:35:53 +0000 (22:35 -0800)]
glsl: Use INFINITY instead of std::numeric_limits<float>::infinity().

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoautomake: add missing egl files to the tarball
Emil Velikov [Sat, 21 Mar 2015 20:45:22 +0000 (20:45 +0000)]
automake: add missing egl files to the tarball

Namely the Haiku EGL driver backend and the SConscript for the dri2 EGL
driver backend.

Cc: Alexander von Gluck IV <kallisti5@unixzen.com>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglsl: Constify ir_instruction::equals
Ian Romanick [Thu, 19 Mar 2015 02:00:48 +0000 (19:00 -0700)]
glsl: Constify ir_instruction::equals

v2: Don't be lazy.  Constify the as_foo functions and use those instead
of ugly casts.  Suggested by Curro.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Constify the as_foo functions
Ian Romanick [Tue, 24 Mar 2015 16:14:35 +0000 (09:14 -0700)]
glsl: Constify the as_foo functions

Now that they're all implemented using macros, this is trivial.

v2: Remove redundant parenthesis.  Suggested by Curro.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Implement remaining as_foo functions with macros
Ian Romanick [Tue, 24 Mar 2015 16:02:24 +0000 (09:02 -0700)]
glsl: Implement remaining as_foo functions with macros

The downcast functions for non-leaf classes were previously implemented
"by hand."  Now they are implemented using macros based on the is_foo
functions added in the previous patch.

v2: Remove redundant parenthesis.  Suggested by Curro (on the next
patch).

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoglsl: Add is_rvalue, is_dereference, and is_jump methods
Ian Romanick [Tue, 24 Mar 2015 15:55:15 +0000 (08:55 -0700)]
glsl: Add is_rvalue, is_dereference, and is_jump methods

These functions deteremine when an IR node is one of the non-leaf
classes.

v2: Adjust indentation to line up.  Suggested by Matt.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoutil/u_atomic: Ignore warnings interlocked accesses.
Jose Fonseca [Tue, 24 Mar 2015 19:56:21 +0000 (19:56 +0000)]
util/u_atomic: Ignore warnings interlocked accesses.

These are due how we implemented the atomic tests, not the atomic
implementation itself.  It's also difficult to refactor the code to
avoid the warnings due to the use of macros -- the code would be quite
hairy.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Disable MSVC warnings about inconsistent function annotation.
Jose Fonseca [Tue, 24 Mar 2015 19:50:48 +0000 (19:50 +0000)]
scons: Disable MSVC warnings about inconsistent function annotation.

Somehow, merely including any of the *intrin.h headers causes dozens of
this warnings (when compiling pretty much every source file).  MSVC does
not always complain the same -- so it's possible we're doing something
weird --, but silence these warnings in the meanwhile.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: Avoid MSVC C6334 warning in /analyze mode.
Jose Fonseca [Tue, 24 Mar 2015 19:01:46 +0000 (19:01 +0000)]
mesa: Avoid MSVC C6334 warning in /analyze mode.

MSVC's implementation of signbit(x) uses sizeof(x) with expressions to
dispatch to an internal function based on the argument's type (float,
double, etc), but that raises a flag with MSVC's own static analyzer,
and because this is an inline function in a header it causes substantial
warning spam.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoc99_math: Don't reimplement lrint and friends on MSVC 2013.
Jose Fonseca [Tue, 24 Mar 2015 13:16:24 +0000 (13:16 +0000)]
c99_math: Don't reimplement lrint and friends on MSVC 2013.

MSVC 2013 declares these functions, both for C and C++ source files.

This was caught with MSVC in analyze mode.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build osmesa.
Jose Fonseca [Tue, 24 Mar 2015 20:30:03 +0000 (20:30 +0000)]
scons: Don't build osmesa.

There doesn't seem much interest on osmesa on Windows, particularly classic osmesa.

If there is indeed interest in osmesa on Windows, we should instead
integrate src/gallium/targets/osmesa into SCons.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build loader on Windows.
Jose Fonseca [Tue, 24 Mar 2015 20:26:21 +0000 (20:26 +0000)]
scons: Don't build loader on Windows.

EGL was the last user.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Don't build egl on Windows.
Jose Fonseca [Tue, 24 Mar 2015 20:11:36 +0000 (20:11 +0000)]
scons: Don't build egl on Windows.

Useless, as there are no drivers for it.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoscons: Fix git_sha1.h generation fallback.
Jose Fonseca [Mon, 23 Mar 2015 10:48:31 +0000 (10:48 +0000)]
scons: Fix git_sha1.h generation fallback.

I didn't meant to remove the 'if not os.path.exists(filename)' statement.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agodocs: Update progress on ARB_direct_state_access.
Martin Peres [Thu, 19 Mar 2015 17:44:56 +0000 (19:44 +0200)]
docs: Update progress on ARB_direct_state_access.

v2:
- Fix the state of the Program pipelines and Query objects (Laura)

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry points for NamedRenderbufferStorage/Multisample
Martin Peres [Fri, 13 Feb 2015 13:35:48 +0000 (15:35 +0200)]
main: Added entry points for NamedRenderbufferStorage/Multisample

v2: Review from Laura Ekstrand
- get rid of a change that should not have happened in this patch
- improve the error messages
- fix alignments
- fix a capitalization in a function name in an error message

v3: Review from Laura Ekstrand
- move the test for the validity of the renderbuffer to less generic
  functions
- get rid of some changes that accidentally landed in the wrong commit
- revert some alignment fixes

v3: Review from Laura Ekstrand
- check that the lookup returns a valid renderbuffer
- cosmetic changes to some error messages

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetNamedRenderbufferParameteriv
Martin Peres [Fri, 13 Feb 2015 13:46:55 +0000 (15:46 +0200)]
main: Added entry point for glGetNamedRenderbufferParameteriv

v2:
- improve an error message

v3:
- move a test to less generic functions
- fix an alignment

v4:
- take the caller as a parameter instead of bool dsa
- check that the lookup returns a valid renderbuffer

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateRenderbuffers
Martin Peres [Thu, 12 Feb 2015 16:52:10 +0000 (18:52 +0200)]
main: Added entry point for glCreateRenderbuffers

v2:
- refactor bindRenderBuffer and create_render_buffers to fix an assertion

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateSamplers
Martin Peres [Thu, 12 Feb 2015 11:12:19 +0000 (13:12 +0200)]
main: Added entry point for glCreateSamplers

Because of the current way the code is architectured, there is no
functional difference between the DSA and the non-DSA path.

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateProgramPipelines
Martin Peres [Wed, 11 Feb 2015 16:12:21 +0000 (18:12 +0200)]
main: Added entry point for glCreateProgramPipelines

v2:
- add spaces in an error message (Laura)

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry points for glGetQueryBufferObject*
Martin Peres [Mon, 16 Feb 2015 10:20:19 +0000 (12:20 +0200)]
main: Added entry points for glGetQueryBufferObject*

These entry points will be fleshed out when the GL_ARB_query_buffer_object
extension gets implemented. In the meantime, return GL_INVALID_OPERATION as
suggested by Ian.

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glCreateQueries
Martin Peres [Tue, 10 Feb 2015 15:13:06 +0000 (17:13 +0200)]
main: Added entry point for glCreateQueries

v2:
- display the name of the target instead of its id (Laura)

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbacki64_v
Martin Peres [Thu, 22 Jan 2015 14:55:29 +0000 (16:55 +0200)]
main: Added entry point for glGetTransformFeedbacki64_v

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

v4: Review from Laura Ekstrand
- fix some alignement problems

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbacki_v
Martin Peres [Mon, 16 Feb 2015 14:13:59 +0000 (16:13 +0200)]
main: Added entry point for glGetTransformFeedbacki_v

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

v3:
- use the new name of _mesa_lookup_transform_feedback_object_err

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glGetTransformFeedbackiv
Martin Peres [Mon, 16 Feb 2015 14:13:58 +0000 (16:13 +0200)]
main: Added entry point for glGetTransformFeedbackiv

v2: Review from Laura Ekstrand
- use the transform feedback object lookup wrapper

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: Added entry point for glTransformFeedbackBufferRange
Martin Peres [Wed, 21 Jan 2015 10:22:11 +0000 (12:22 +0200)]
main: Added entry point for glTransformFeedbackBufferRange

v2: review from Laura Ekstrand
- use the refactored code to lookup the objects
- improve some error messages
- factor out the gl method name computation
- better handle the spec differences between the DSA and non-DSA cases
- quote the spec a little more

v3: review from Laura Ekstrand
- use the new name of _mesa_lookup_bufferobj_err
- swap the comments around the offset and size checks

v4: review from Laura Ekstrand
- add more spec quotes
- properly fix the comments around the offset and size checks

v5: review from Laura Ekstrand
- add quotes on the spec citations
- revert some changes in the printf format

v6: review from Laura Ekstrand
- remove a redondant "gl" in a method name

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agomain: Added entry point for glTransformFeedbackBufferBase
Martin Peres [Tue, 20 Jan 2015 14:30:32 +0000 (16:30 +0200)]
main: Added entry point for glTransformFeedbackBufferBase

v2: Review from Laura Ekstrand
- give more helpful error messages
- factor the lookup code for the xfb and objBuf
- replace some already-existing tabs with spaces
- add comments to explain the cases where xfb == 0 or buffer == 0
- fix the condition for binding the transform buffer or not

v3: Review from Laura Ekstrand
- rename _mesa_lookup_bufferobj_err to
  _mesa_lookup_transform_feedback_bufferobj_err and make it static to avoid a
  future conflict
- make _mesa_lookup_transform_feedback_object_err static

v4: Review from Laura Ekstrand
- add the pdf page number when quoting the spec
- rename some of the symbols to follow the public/private conventions

v5: Review from Laura Ekstrand
- properly rename some of the symbols to follow the public/private conventions
- fix some alignments
- add quotes around a spec citation
- add back a newline I accidentally deleted
- add spaces around the ternary operator usages

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
9 years agomain: Added entry point for glCreateTransformFeedbacks
Martin Peres [Wed, 14 Jan 2015 16:17:21 +0000 (18:17 +0200)]
main: Added entry point for glCreateTransformFeedbacks

v2: Review from Laura Ekstrand
- generate the name of the gl method once
- shorten some lines to stay in the 78 chars limit

v3: Review from Fredrik Höglund <fredrik@kde.org>
- rename gl_mthd_name to func
- set EverBound in _mesa_create_transform_feedbacks in the dsa case

v4:
- rename _mesa_create_transform_feedbacks to create_transform_feedbacks and
  make it static

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: fix the validation of the number of samples
Martin Peres [Fri, 13 Feb 2015 16:14:15 +0000 (18:14 +0200)]
main: fix the validation of the number of samples

Maybe this should be the job of the dispatch layer.

v2:
- add the section name and pdf page number of the quote (Laura)
- OpenGL 3.0 core does not exist, get rid of "core"

Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: replace tabs by 8 spaces in fbobject.c
Martin Peres [Thu, 12 Feb 2015 15:54:43 +0000 (17:54 +0200)]
main: replace tabs by 8 spaces in fbobject.c

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomain: replace tabs by 8 spaces in bufferobj.c
Martin Peres [Wed, 11 Feb 2015 09:21:56 +0000 (11:21 +0200)]
main: replace tabs by 8 spaces in bufferobj.c

Reviewed-by: Laura Ekstrand <laura@jlekstrand.net>
Signed-off-by: Martin Peres <martin.peres@linux.intel.com>
9 years agomesa: Apply visibility flags to src/Makefile.am targets
Kristian Høgsberg [Tue, 24 Mar 2015 16:41:08 +0000 (09:41 -0700)]
mesa: Apply visibility flags to src/Makefile.am targets

We were building libglsl_util.la without our visibility flags and
leaking hash_table_* symbols.

Signed-off-by: Kristian Høgsberg <kristian.h.kristensen@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agonir: Fix typo.
Matt Turner [Wed, 25 Mar 2015 02:14:18 +0000 (19:14 -0700)]
nir: Fix typo.

9 years agonir: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.
Matt Turner [Wed, 18 Mar 2015 06:30:43 +0000 (23:30 -0700)]
nir: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.

Transform this into b2f(or(a, b)).

instructions in affected programs:     432 -> 430 (-0.46%)
helped:                                2

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agonir: Recognize mul(b2f(a), b2f(b)) as a logical AND.
Matt Turner [Wed, 18 Mar 2015 06:30:32 +0000 (23:30 -0700)]
nir: Recognize mul(b2f(a), b2f(b)) as a logical AND.

Transform this into b2f(and(a, b)).

total instructions in shared programs: 6205448 -> 6204391 (-0.02%)
instructions in affected programs:     284030 -> 282973 (-0.37%)
helped:                                903
HURT:                                  6

Acked-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoglsl: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.
Matt Turner [Wed, 18 Mar 2015 17:39:38 +0000 (10:39 -0700)]
glsl: Recognize sat(add(b2f(a), b2f(b))) as a logical OR.

Transform this into b2f(or(a, b)).

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoglsl: Recognize mul(b2f(a), b2f(b)) as a logical AND.
Matt Turner [Wed, 18 Mar 2015 06:28:27 +0000 (23:28 -0700)]
glsl: Recognize mul(b2f(a), b2f(b)) as a logical AND.

Transform this into b2f(and(a, b)).

total instructions in shared programs: 6190291 -> 6189225 (-0.02%)
instructions in affected programs:     267247 -> 266181 (-0.40%)
helped:                                866

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agonir: Handle mixed scalar/vector arguments to logical and/or/xor.
Matt Turner [Mon, 23 Mar 2015 23:04:41 +0000 (16:04 -0700)]
nir: Handle mixed scalar/vector arguments to logical and/or/xor.

Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoglsl: Allow vector logic ops to be generated.
Matt Turner [Wed, 18 Mar 2015 06:27:38 +0000 (23:27 -0700)]
glsl: Allow vector logic ops to be generated.

They're not accessible from the source language, but optimizations are
allowed to generate them.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoconfigure.ac: move AC_MSG_RESULT reporting back into the m4 macro
Emil Velikov [Mon, 23 Mar 2015 17:49:23 +0000 (17:49 +0000)]
configure.ac: move AC_MSG_RESULT reporting back into the m4 macro

The one who does AC_MSG_CHECKING should provide the AC_MSG_RESULT.

Fixes: ced9425327b (configure: Introduce new output variable to
ax_check_python_mako_module.m4"

Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89328
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
9 years agogallium/util: Use HAVE___BUILTIN_FFS* macros.
Jonathan Gray [Tue, 17 Mar 2015 01:49:39 +0000 (12:49 +1100)]
gallium/util: Use HAVE___BUILTIN_FFS* macros.

Make use of the builtin ffs macros and split out ffsll
to a seperate block.  Needed for at least OpenBSD which
does not have ffsll in libc.

Signed-off-by: Jonathan Gray <jsg@jsg.id.au>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoi965: add the remaining files to the tarball
Emil Velikov [Mon, 23 Mar 2015 16:17:36 +0000 (16:17 +0000)]
i965: add the remaining files to the tarball

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoglsl: add the remaining files to the tarball
Emil Velikov [Mon, 23 Mar 2015 16:17:35 +0000 (16:17 +0000)]
glsl: add the remaining files to the tarball

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agomakefile: add all headers to the tarball
Emil Velikov [Mon, 23 Mar 2015 16:17:34 +0000 (16:17 +0000)]
makefile: add all headers to the tarball

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agogbm: remove gbm_gallium_drm from the loader
Emil Velikov [Sat, 21 Mar 2015 17:45:26 +0000 (17:45 +0000)]
gbm: remove gbm_gallium_drm from the loader

No longer used as of commit 48c7461d5a0(st/gbm: remove state-tracker)

v2: Add commit message.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net> (v1)
9 years agoglsl: Generate link error for non-matching gl_FragCoord redeclarations
Anuj Phogat [Thu, 5 Mar 2015 19:07:52 +0000 (11:07 -0800)]
glsl: Generate link error for non-matching gl_FragCoord redeclarations

in different fragment shaders. This also applies to a case when gl_FragCoord
is redeclared with no layout qualifiers in one fragment shader and not
declared but used in other fragment shader.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Khronos Bug#12957
Cc: "10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agovc4: Add a dump-the-surface-contents routine.
Eric Anholt [Tue, 13 Jan 2015 20:58:35 +0000 (09:58 +1300)]
vc4: Add a dump-the-surface-contents routine.

This has been useful once again while trying to debug stride issues
between render targets and texturing.

9 years agovc4: Allow DRI3 on simulation, as well.
Eric Anholt [Mon, 23 Mar 2015 23:15:11 +0000 (16:15 -0700)]
vc4: Allow DRI3 on simulation, as well.

The problem I'd seen before seems to be gone.

9 years agovc4: Fix pitch alignment of linear textures.
Eric Anholt [Mon, 16 Mar 2015 21:48:26 +0000 (14:48 -0700)]
vc4: Fix pitch alignment of linear textures.

Fixes some non-power-of-two texture rendering when I force ARGB8888 to
raster.

9 years agovc4: Write the alignment of level width consistently in validation.
Eric Anholt [Mon, 23 Mar 2015 23:34:24 +0000 (16:34 -0700)]
vc4: Write the alignment of level width consistently in validation.

16 / cpp happens to be the same as utile_w on the only raster format
supported (4 bytes per pixel), but simulator/hw source code generally
talks in terms of utiles.

9 years agovc4: Fix use of a bool as an enum.
Eric Anholt [Mon, 16 Mar 2015 21:14:22 +0000 (14:14 -0700)]
vc4: Fix use of a bool as an enum.

The enum compared to was 0, so it worked out, but it sure looked wrong.

9 years agovc4: Decide the HW's format before laying out the miptree.
Eric Anholt [Mon, 23 Mar 2015 23:21:25 +0000 (16:21 -0700)]
vc4: Decide the HW's format before laying out the miptree.

I'm experimenting with a workaround for raster texture misrendering on
hardware, and this lets me look at the format chosen when computing
strides.

9 years agovc4: Use our device-specific ioctls for create/mmap.
Eric Anholt [Tue, 24 Mar 2015 00:17:17 +0000 (17:17 -0700)]
vc4: Use our device-specific ioctls for create/mmap.

They don't do anything special for us, but I've been told by kernel
maintainers that relying on dumb for my acceleration-capable buffers
is not OK.

9 years agovc4: Make a new #define for making code conditional on the simulator.
Eric Anholt [Tue, 24 Mar 2015 00:26:40 +0000 (17:26 -0700)]
vc4: Make a new #define for making code conditional on the simulator.

I'd like to compile as much of the device-specific code as possible
when building for simulator, and using if (using_simulator) instead of
ifdefs helps.

9 years agovc4: Add some useful debug printfs for miptrees.
Eric Anholt [Tue, 24 Mar 2015 00:38:29 +0000 (17:38 -0700)]
vc4: Add some useful debug printfs for miptrees.

I keep rewriting these.

9 years agoglsl: avoid calling base_alignment when samplers are involved
Ilia Mirkin [Mon, 23 Mar 2015 10:32:08 +0000 (06:32 -0400)]
glsl: avoid calling base_alignment when samplers are involved

Earlier commit 53bf7c8fd2e changed the logic to always call
base_alignment on structs. 1ec715ce8b12 hacked the function to return 0
for sampler fields, but didn't handle sampler arrays. Instead of
extending the hack, avoid calling base_alignment in the first place on
non-UBO uniforms.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=89726
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Tapani Palli <tapani.palli@intel.com>
9 years agoRevert "nv50,nvc0: remove bogus 64_FLOAT formats"
Ilia Mirkin [Tue, 24 Mar 2015 00:53:19 +0000 (20:53 -0400)]
Revert "nv50,nvc0: remove bogus 64_FLOAT formats"

This reverts commit 20346808cf4f1ee4f320afaf18f94043fb146f2e.

The conversion is actually done since these are the *B macro variants
and no vtx format is supplied, which makes them go through the translate
module.

This restores the following piglit tests to passing:

  draw-vertices user
  gl-2.0-vertexattribpointer

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agomapi: Make private copies of name strings provided by client.
Mario Kleiner [Thu, 12 Mar 2015 22:34:12 +0000 (23:34 +0100)]
mapi: Make private copies of name strings provided by client.

glXGetProcAddress("glFoo") ends up in stub_add_dynamic() to
create dynamic stubs for dynamic functions. stub_add_dynamic()
doesn't store the caller provided name string "Foo" in a mesa
private copy, but just stores a pointer to the "glFoo" string
passed to glXGetProcAddress - a pointer into arbitrary memory
outside mesa's control.

If the caller passes some dynamically allocated/changing
memory buffer to glXGetProcAddress(), or the caller gets unmapped
from memory, e.g., some dynamically loaded application
plugin which uses OpenGL, this ends badly - with a dangling
pointer.

strdup() the name string provided by the client to avoid
this problem.

Cc: "10.3 10.4 10.5" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoclover: Return 0 as storage size for local kernel args that are not set v2
Tom Stellard [Fri, 20 Mar 2015 22:19:43 +0000 (22:19 +0000)]
clover: Return 0 as storage size for local kernel args that are not set v2

The storage size for local kernel args can be queried before the
arguments are set by using the CL_KERNEL_LOCAL_MEM_SIZE param
of clGetKernelWorkGroupInfo().

The spec says that if local kernel arguments have not been specified,
then we should assume their size is 0.

v2:
  - Implement using c++11 member initialization.

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Cc: 10.5 10.4 <mesa-stable@lists.freedesktop.org>
9 years agogallivm: Use MCInstrInfo in the disassembler for querying instruction info
Tom Stellard [Mon, 23 Mar 2015 14:37:24 +0000 (14:37 +0000)]
gallivm: Use MCInstrInfo in the disassembler for querying instruction info

This fixes the build since llvm r232885 and also simplifies the code.

9 years agoclover: use get_device_vendor instead of get_vendor
Giuseppe Bilotta [Sun, 22 Mar 2015 06:21:02 +0000 (07:21 +0100)]
clover: use get_device_vendor instead of get_vendor

The pipe's get_vendor method returns something more akin to a driver
vendor string in most cases, instead of the actual device vendor. Use
get_device_vendor instead, which was introduced specifically for this
purpose.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agogallium: implement get_device_vendor() for existing drivers
Giuseppe Bilotta [Sun, 22 Mar 2015 06:21:01 +0000 (07:21 +0100)]
gallium: implement get_device_vendor() for existing drivers

The only hackish ones are llvmpipe and softpipe, which currently return
the same string as for get_vendor(), while ideally they should return
the CPU vendor.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agogallium: introduce get_device_vendor() entrypoint for pipes
Giuseppe Bilotta [Sun, 22 Mar 2015 06:21:00 +0000 (07:21 +0100)]
gallium: introduce get_device_vendor() entrypoint for pipes

This will be needed by Clover to return the correct information
to CL_DEVICE_VENDOR info queries.

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agogallium: remove trailing whitespace in p_screen.h
Giuseppe Bilotta [Sun, 22 Mar 2015 06:20:59 +0000 (07:20 +0100)]
gallium: remove trailing whitespace in p_screen.h

Signed-off-by: Giuseppe Bilotta <giuseppe.bilotta@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoclover: The unit for CL_DEVICE_MEM_BASE_ADDR_ALIGN is bits not bytes
Tom Stellard [Sat, 21 Mar 2015 00:44:47 +0000 (00:44 +0000)]
clover: The unit for CL_DEVICE_MEM_BASE_ADDR_ALIGN is bits not bytes

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoclover: Add all the mandatory 1.1 extensions to the extension string
Tom Stellard [Sat, 21 Mar 2015 00:25:34 +0000 (00:25 +0000)]
clover: Add all the mandatory 1.1 extensions to the extension string

Reviewed-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>