mesa.git
9 years agoutil: simplify writemask parameters for util_blit_pixels()
Brian Paul [Wed, 24 Sep 2014 13:27:02 +0000 (07:27 -0600)]
util: simplify writemask parameters for util_blit_pixels()

Instead of separate color and Z/S writemasks, just have one writemask
parameter that takes a mask of the PIPE_MASK_[RGBAZS] flags.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agoutil: s/PIPE_TEX_MIPFILTER/PIPE_TEX_FILTER/ in u_blit code
Brian Paul [Mon, 15 Sep 2014 21:33:26 +0000 (15:33 -0600)]
util: s/PIPE_TEX_MIPFILTER/PIPE_TEX_FILTER/ in u_blit code

PIPE_TEX_MIPFILTER_x is not legal for the pipe_sampler_state::
min/mag_img_filter fields.  But PIPE_TEX_MIPFILTER_x == PIPE_TEX_FILTER_x
so we were getting lucky.

This also makes the code consistent with u_blitter.c.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
9 years agomesa: remove EXT suffix from FBO error messages
Brian Paul [Tue, 23 Sep 2014 22:36:36 +0000 (16:36 -0600)]
mesa: remove EXT suffix from FBO error messages

And use pass caller="" for _mesa_FramebufferTexture().

Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agomesa: Drop _mesa_getenv() wrapper.
Matt Turner [Mon, 22 Sep 2014 05:53:04 +0000 (22:53 -0700)]
mesa: Drop _mesa_getenv() wrapper.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Drop _mesa_bsearch() wrapper.
Matt Turner [Mon, 22 Sep 2014 05:50:36 +0000 (22:50 -0700)]
mesa: Drop _mesa_bsearch() wrapper.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Unifdef _WIN32_WCE.
Matt Turner [Mon, 22 Sep 2014 05:57:10 +0000 (22:57 -0700)]
mesa: Unifdef _WIN32_WCE.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Unifdef _XBOX.
Matt Turner [Mon, 22 Sep 2014 05:59:33 +0000 (22:59 -0700)]
mesa: Unifdef _XBOX.

Inexplicably added in commit 36940429.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoconfigure.ac: Remove duplicate -DHAVE_PTHREAD.
Matt Turner [Mon, 22 Sep 2014 00:33:21 +0000 (17:33 -0700)]
configure.ac: Remove duplicate -DHAVE_PTHREAD.

It's also defined by the AX_PTHREAD macro.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoconfigure.ac: Stop checking for perl.
Matt Turner [Sun, 21 Sep 2014 20:25:24 +0000 (13:25 -0700)]
configure.ac: Stop checking for perl.

Added by commit a75c6163, but no longer used.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoconfigure.ac: Use test -a, rather than another test.
Matt Turner [Sun, 21 Sep 2014 20:22:28 +0000 (13:22 -0700)]
configure.ac: Use test -a, rather than another test.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agomesa: Use realloc() instead of _mesa_realloc() and remove the latter.
Matt Turner [Sun, 21 Sep 2014 23:32:57 +0000 (16:32 -0700)]
mesa: Use realloc() instead of _mesa_realloc() and remove the latter.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agomesa: Remove duplicate _mesa_{init,free}_shader_state prototypes.
Matt Turner [Sun, 21 Sep 2014 02:47:05 +0000 (19:47 -0700)]
mesa: Remove duplicate _mesa_{init,free}_shader_state prototypes.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agogallivm: Wrap deleted inlcude in if HAVE_LLVM < 0x0306
Tom Stellard [Wed, 24 Sep 2014 15:46:09 +0000 (11:46 -0400)]
gallivm: Wrap deleted inlcude in if HAVE_LLVM < 0x0306

This was missed in 8f4ee56.

9 years agoi965: Add and use functions to get next/prev blocks.
Matt Turner [Wed, 3 Sep 2014 04:07:51 +0000 (21:07 -0700)]
i965: Add and use functions to get next/prev blocks.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Call insert and remove functions from exec_node directly.
Matt Turner [Wed, 3 Sep 2014 00:53:04 +0000 (17:53 -0700)]
i965: Call insert and remove functions from exec_node directly.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Make instruction lists local to the bblocks.
Matt Turner [Mon, 1 Sep 2014 22:01:23 +0000 (15:01 -0700)]
i965: Make instruction lists local to the bblocks.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/cfg: Add note about double-loop macros and break behavior.
Matt Turner [Wed, 3 Sep 2014 00:30:29 +0000 (17:30 -0700)]
i965/cfg: Add note about double-loop macros and break behavior.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Replace initialization loops with memset().
Matt Turner [Mon, 25 Aug 2014 04:51:28 +0000 (21:51 -0700)]
i965: Replace initialization loops with memset().

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Don't iterate between blocks with inst->next/prev.
Matt Turner [Tue, 2 Sep 2014 21:43:43 +0000 (14:43 -0700)]
i965/vec4: Don't iterate between blocks with inst->next/prev.

The register coalescing portion of this patch hurts three shaders in
Guacamelee by one instruction each, but examining the diff makes me
believe that what we were generating was (perhaps harmlessly) incorrect.

9 years agoi965/fs: Don't iterate between blocks with inst->next/prev.
Matt Turner [Tue, 2 Sep 2014 17:08:24 +0000 (10:08 -0700)]
i965/fs: Don't iterate between blocks with inst->next/prev.

When instruction lists are per-basic block, this won't work.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/cfg: Add macros to iterate through a block given a starting point.
Matt Turner [Tue, 2 Sep 2014 03:01:50 +0000 (20:01 -0700)]
i965/cfg: Add macros to iterate through a block given a starting point.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/fs: Make count_to_loop_end() use basic blocks.
Matt Turner [Mon, 1 Sep 2014 22:38:58 +0000 (15:38 -0700)]
i965/fs: Make count_to_loop_end() use basic blocks.

When the instructions aren't in a flat list, this wouldn't have worked.
Also, this should be faster.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Don't use instruction list after calculating the cfg.
Matt Turner [Mon, 1 Sep 2014 20:42:51 +0000 (13:42 -0700)]
i965/vec4: Don't use instruction list after calculating the cfg.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/fs: Don't use instruction list after calculating the cfg.
Matt Turner [Mon, 1 Sep 2014 20:35:04 +0000 (13:35 -0700)]
i965/fs: Don't use instruction list after calculating the cfg.

The only trick is changing a break into a return true in register
coalescing, since the macro is actually a double loop, and break will do
something different than you expect. (Wish I'd realized that earlier!)

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Remove now unneeded calls to calculate_cfg().
Matt Turner [Mon, 1 Sep 2014 17:58:11 +0000 (10:58 -0700)]
i965: Remove now unneeded calls to calculate_cfg().

Now that nothing invalidates the CFG, we can calculate_cfg() immediately
after emit_fb_writes()/emit_thread_end() and never again.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Remove cfg-invalidating parameter from invalidate_live_intervals.
Matt Turner [Mon, 1 Sep 2014 17:54:00 +0000 (10:54 -0700)]
i965: Remove cfg-invalidating parameter from invalidate_live_intervals.

Everything has been converted to preserve the CFG.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Preserve the CFG in instruction scheduling.
Matt Turner [Mon, 1 Sep 2014 04:19:47 +0000 (21:19 -0700)]
i965: Preserve the CFG in instruction scheduling.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Preserve CFG in spill_reg().
Matt Turner [Mon, 25 Aug 2014 02:38:21 +0000 (19:38 -0700)]
i965/vec4: Preserve CFG in spill_reg().

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Preserve the CFG in a few more places.
Matt Turner [Mon, 25 Aug 2014 02:27:09 +0000 (19:27 -0700)]
i965/vec4: Preserve the CFG in a few more places.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/fs: Preserve the CFG in a few more places.
Matt Turner [Mon, 25 Aug 2014 02:07:01 +0000 (19:07 -0700)]
i965/fs: Preserve the CFG in a few more places.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Restructure debug flags
Kristian Høgsberg [Tue, 23 Sep 2014 23:15:22 +0000 (16:15 -0700)]
i965: Restructure debug flags

This cleans up the debug flags to be consistently indented, use bit
shifting instead of hex-values and fixes a bug where the new DEBUG_NO8 flag
used the same value as the DEBUG_VUE flag.  This was hidden by the numbers not
being aligned.  Also removes gaps in the range where DEBUG_IOCTL (0x4) and
DEBUG_REGION (0x400) used to be.

Signed-off-by: Kristian Høgsberg <krh@bitplanet.net>
Reviewed-by: Chris Forbes <chrisf@ijw.co.nz>
9 years agogallivm: Disable gallivm to fix build with LLVM 3.6
Tom Stellard [Tue, 23 Sep 2014 20:15:52 +0000 (16:15 -0400)]
gallivm: Disable gallivm to fix build with LLVM 3.6

LLVM commit r218316 removes the JITMemoryManager class, which is
the parent for a seemingly important class in gallivm.  In order to
fix the build, I've wrapped most of lp_bld_misc.cpp in
if HAVE_LLVM < 0x0306 and modifyed the
lp_build_create_jit_compiler_for_module() function to return false
for 3.6 and newer which effectively disables the gallivm functionality.

I realize this is overkill, but I could not come up with a simple
solution to fix the build.  Also, since 3.6 will be the first release
without the old JIT, it would be really great if we could
move gallivm to use the C API only for accessing MCJIT.  There
is still time before the 3.6 release to extend the C API in
case it is missing some functionality that is required by gallivm.

9 years agogallium/rbug: correctly unreference a sampler view
Marek Olšák [Mon, 22 Sep 2014 20:12:43 +0000 (22:12 +0200)]
gallium/rbug: correctly unreference a sampler view

This fixes heap corruption. The sampler view can be bound in the context,
so we cannot call destroy directly.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agogallium/rbug: unlock a mutex in rbug_create_query
Marek Olšák [Mon, 22 Sep 2014 20:12:10 +0000 (22:12 +0200)]
gallium/rbug: unlock a mutex in rbug_create_query

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoradeonsi: remove old cache flushing code
Marek Olšák [Sat, 20 Sep 2014 10:02:59 +0000 (12:02 +0200)]
radeonsi: remove old cache flushing code

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi/compute: do CS partial flush with si_emit_cache_flush
Marek Olšák [Sat, 20 Sep 2014 09:54:46 +0000 (11:54 +0200)]
radeonsi/compute: do CS partial flush with si_emit_cache_flush

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agoradeonsi/compute: flush caches with si_emit_cache_flush
Marek Olšák [Sat, 20 Sep 2014 09:48:58 +0000 (11:48 +0200)]
radeonsi/compute: flush caches with si_emit_cache_flush

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agoradeonsi/compute: directly emit CONTEXT_CONTROL
Marek Olšák [Sat, 20 Sep 2014 09:33:06 +0000 (11:33 +0200)]
radeonsi/compute: directly emit CONTEXT_CONTROL

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agoradeonsi: properly destroy the GS copy shader and scratch_bo for compute
Marek Olšák [Thu, 18 Sep 2014 21:48:04 +0000 (23:48 +0200)]
radeonsi: properly destroy the GS copy shader and scratch_bo for compute

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: release GS rings at context destruction
Marek Olšák [Thu, 18 Sep 2014 19:40:02 +0000 (21:40 +0200)]
radeonsi: release GS rings at context destruction

Cc: 10.2 10.3 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: don't use pipe_constant_buffer for GS rings
Marek Olšák [Thu, 18 Sep 2014 19:30:58 +0000 (21:30 +0200)]
radeonsi: don't use pipe_constant_buffer for GS rings

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: don't pass the context to the shader translator
Marek Olšák [Wed, 17 Sep 2014 20:44:22 +0000 (22:44 +0200)]
radeonsi: don't pass the context to the shader translator

This should prevent accessing context state there.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: don't snoop currently-bound GS shader when compiling ES
Marek Olšák [Wed, 17 Sep 2014 20:17:02 +0000 (22:17 +0200)]
radeonsi: don't snoop currently-bound GS shader when compiling ES

Instead, pass the layout of GS inputs in memory to the ES using the shader
key. Only 64 bits are needed to represent the layout in the key.

Mixing and matching different VS and GS shaders should now always work.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: shorten si_pipe_* prefixes to si_*
Marek Olšák [Tue, 16 Sep 2014 16:45:33 +0000 (18:45 +0200)]
radeonsi: shorten si_pipe_* prefixes to si_*

This was the original naming convention in r600g and it somehow crept
into radeonsi.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: merge si_pipe_shader into si_shader
Marek Olšák [Tue, 16 Sep 2014 16:40:07 +0000 (18:40 +0200)]
radeonsi: merge si_pipe_shader into si_shader

One is part of the other anyway.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: disable gl_SampleMask fragment shader output if MSAA is disabled
Marek Olšák [Fri, 19 Sep 2014 16:00:49 +0000 (18:00 +0200)]
radeonsi: disable gl_SampleMask fragment shader output if MSAA is disabled

This fixes piglit: arb_sample_shading-builtin-gl-sample-mask 0

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: only update MSAA-specific framebuffer state if nr_samples is changed
Marek Olšák [Fri, 19 Sep 2014 15:38:01 +0000 (17:38 +0200)]
radeonsi: only update MSAA-specific framebuffer state if nr_samples is changed

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: move DB_SHADER_CONTROL into db_render_state
Marek Olšák [Fri, 19 Sep 2014 15:27:02 +0000 (17:27 +0200)]
radeonsi: move DB_SHADER_CONTROL into db_render_state

I will need this for fixing sample shading with 1 sample.

The good news is that all shader pm4 states no longer use the current context
state, so we can generate the pm4 states outside of draw_vbo if needed.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: set KILL_ENABLE during shader compilation, remove uses_kill flag
Marek Olšák [Fri, 19 Sep 2014 15:07:07 +0000 (17:07 +0200)]
radeonsi: set KILL_ENABLE during shader compilation, remove uses_kill flag

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove shader.ps_conservative_z, set db_shader_control instead
Marek Olšák [Fri, 19 Sep 2014 14:19:44 +0000 (16:19 +0200)]
radeonsi: remove shader.ps_conservative_z, set db_shader_control instead

Also set the field on SI too. It's not just specific to CIK.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: move DB registers from draw_vbo into new db_render_state
Marek Olšák [Tue, 16 Sep 2014 15:39:52 +0000 (17:39 +0200)]
radeonsi: move DB registers from draw_vbo into new db_render_state

It's called db_misc_state in r600g.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: remove unused variable si_pipe_shader::sprite_coord_enable
Marek Olšák [Tue, 16 Sep 2014 15:10:26 +0000 (17:10 +0200)]
radeonsi: remove unused variable si_pipe_shader::sprite_coord_enable

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: document what si_descriptors.c does
Marek Olšák [Mon, 15 Sep 2014 21:19:44 +0000 (23:19 +0200)]
radeonsi: document what si_descriptors.c does

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agor300g: implement MSAA copies by resolving and upsampling
Marek Olšák [Wed, 17 Sep 2014 12:34:06 +0000 (14:34 +0200)]
r300g: implement MSAA copies by resolving and upsampling

There's no other way. It will use hw resolve + blit.

9 years agost/mesa: redefine mapping from VARYING_SLOT_TEXi/PNTC/VARi to TGSI GENERIC[i]
Marek Olšák [Thu, 18 Sep 2014 19:03:24 +0000 (21:03 +0200)]
st/mesa: redefine mapping from VARYING_SLOT_TEXi/PNTC/VARi to TGSI GENERIC[i]

Generic varyings in TGSI were based on the value of VARYING_SLOT_TEX0, so VAR0
was always GENERIC[22] (with tessellation patches). Some drivers might not
be able to cope with that.

This commit defines a proper mapping, so that PNTC is GENERIC[8] and VAR0 is
GENERIC[9].

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agost/mesa: don't set coord_enable for gl_PointCoord if using TGSI_SEMANTIC_PCOORD
Marek Olšák [Fri, 19 Sep 2014 17:15:31 +0000 (19:15 +0200)]
st/mesa: don't set coord_enable for gl_PointCoord if using TGSI_SEMANTIC_PCOORD

This was missed when Christoph Bumiller added PIPE_CAP_TGSI_TEXCOORD.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agost/mesa: use UniformBooleanTrue in glsl_to_tgsi
Marek Olšák [Fri, 12 Sep 2014 13:39:29 +0000 (15:39 +0200)]
st/mesa: use UniformBooleanTrue in glsl_to_tgsi

Just for consistency. This doesn't fix anything as the original code was
already pretty good.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agost/mesa: drop dependence on API profile in st_init_extensions
Marek Olšák [Fri, 12 Sep 2014 14:41:19 +0000 (16:41 +0200)]
st/mesa: drop dependence on API profile in st_init_extensions

The extensions and limits being set in the conditional block are core-only
anyway and don't have any effect on other profiles.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: allow forcing >=3.1 compatibility contexts with MESA_GL_VERSION_OVERRIDE
Marek Olšák [Sun, 14 Sep 2014 21:12:06 +0000 (23:12 +0200)]
mesa: allow forcing >=3.1 compatibility contexts with MESA_GL_VERSION_OVERRIDE

E.g. the 4.0 compatibility profile can be forced with:

MESA_GL_VERSION_OVERRIDE=4.0COMPAT

Some tests that I have require 4.0 compatibility.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agomesa: don't set ES versions to GLSLVersion in _mesa_init_constants
Marek Olšák [Fri, 12 Sep 2014 14:30:50 +0000 (16:30 +0200)]
mesa: don't set ES versions to GLSLVersion in _mesa_init_constants

No place in Mesa expects an ES version there.
Drivers don't even set it like this.

Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agotargets/vl: don't forget to set GALLIUM_STATIC_TARGETS
Emil Velikov [Wed, 24 Sep 2014 10:54:07 +0000 (11:54 +0100)]
targets/vl: don't forget to set GALLIUM_STATIC_TARGETS

git rebase failure while dropping out a patch that reworks
the way we build aux/vl.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agotargets/egl: fold in target LDFLAGS variables
Emil Velikov [Sun, 21 Sep 2014 16:01:30 +0000 (17:01 +0100)]
targets/egl: fold in target LDFLAGS variables

Both variables are identical thus we can fold them into AM_LDFLAGS.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agotargets: drop the old MEGADRIVERS & STATIC_TARGET... variables
Emil Velikov [Wed, 24 Sep 2014 09:41:30 +0000 (10:41 +0100)]
targets: drop the old MEGADRIVERS & STATIC_TARGET... variables

No longer used/needed as of last commit.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/softpipe,llvmpipe: add automake target 'templates'
Emil Velikov [Sun, 21 Sep 2014 15:46:39 +0000 (16:46 +0100)]
gallium/softpipe,llvmpipe: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoconfigure: remove NEED_{SOFT,LLVM}PIPE_DRIVER variables
Emil Velikov [Sun, 21 Sep 2014 15:39:25 +0000 (16:39 +0100)]
configure: remove NEED_{SOFT,LLVM}PIPE_DRIVER variables

The respective HAVE_{SOFT,LLVM}PIPE are already descriptive
enough. Additionally the svga modules does not really use either
one, but the auxiliary draw & gallivm modules.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/vc4: add automake target 'templates'
Emil Velikov [Sun, 21 Sep 2014 15:31:14 +0000 (16:31 +0100)]
gallium/vc4: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/r300,r600,radeonsi: add automake target 'templates'
Emil Velikov [Tue, 23 Sep 2014 23:30:45 +0000 (00:30 +0100)]
gallium/r300,r600,radeonsi: add automake target 'templates'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Christian König <christian.koenig@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/svga: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:41:51 +0000 (15:41 +0100)]
gallium/svga: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/ilo: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:38:07 +0000 (15:38 +0100)]
gallium/ilo: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/i915: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:34:07 +0000 (15:34 +0100)]
gallium/i915: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/freedreno: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:30:53 +0000 (15:30 +0100)]
gallium/freedreno: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/nouveau: add automake target 'template'
Emil Velikov [Sun, 21 Sep 2014 14:20:11 +0000 (15:20 +0100)]
gallium/nouveau: add automake target 'template'

Rather than duplicating the libdeps, extra define... all over the
targets, define them only once and use when applicable.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agotargets/pipe-loader: drop unused authentication
Emil Velikov [Wed, 24 Sep 2014 09:39:20 +0000 (10:39 +0100)]
targets/pipe-loader: drop unused authentication

The dri, vdpau, omx, xvmc and gbm targets don't need any authentication
even the VL ones never used it. Either the respective loader or the
library itself (vl) is doing its auth prior to calling create_screen()

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agotargets/vl: fix hard-links when building shared pipe-drivers
Emil Velikov [Sun, 21 Sep 2014 02:08:47 +0000 (03:08 +0100)]
targets/vl: fix hard-links when building shared pipe-drivers

Make sure that MEGADRIVERS is set in order to create the hardlinks.
The variable name is not the most appropriate and will be sorted
out in upcoming commits.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agoconfigure: remove unused variable OSMESA_MESA_DEPS
Emil Velikov [Wed, 23 Jul 2014 15:51:19 +0000 (16:51 +0100)]
configure: remove unused variable OSMESA_MESA_DEPS

Leftover from the static Makefiles

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/freedreno: remove unused draw header
Emil Velikov [Sun, 21 Sep 2014 11:59:40 +0000 (12:59 +0100)]
gallium/freedreno: remove unused draw header

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agogallium/r300: remove obsolete declaration
Emil Velikov [Sun, 21 Sep 2014 03:00:07 +0000 (04:00 +0100)]
gallium/r300: remove obsolete declaration

The definition of rc_pair_regalloc_inputs_only() is no longer
around so drop the declaration.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Matt Turner <mattst88@gmail.com>
9 years agovc4: Drop maximum number of varyings down to 8.
Eric Anholt [Wed, 24 Sep 2014 00:25:43 +0000 (17:25 -0700)]
vc4: Drop maximum number of varyings down to 8.

There are only 32 bits in the flatshade flags (which are 1 bit per
component), the simulator crashes when you use more than about this many
varyings, and the original Broadcom code drop only exposed 8 as well.

Fixes 26 piglit tests in the varying-packing group, and makes many others
go from crash to fail (due to not checking their varying counts and
treating link failures as failures).  Regresses ARB_fp/minmax (due to 8
varyings instead of 10).

9 years agovc4: Add support for flat shading.
Eric Anholt [Tue, 23 Sep 2014 22:27:55 +0000 (15:27 -0700)]
vc4: Add support for flat shading.

This is just the GL 1.1 flat shading of colors -- we don't need to support
TGSI constant interpolation bits, because we don't do GLSL 1.30.

Fixes 7 piglit tests.

9 years agovc4: Drop stale comment.
Eric Anholt [Fri, 19 Sep 2014 23:53:16 +0000 (16:53 -0700)]
vc4: Drop stale comment.

This should have been in 001247d230f022fffac68f4578348087a53d3940.

9 years agoutil: fix SCons build
Brian Paul [Tue, 23 Sep 2014 22:31:57 +0000 (16:31 -0600)]
util: fix SCons build

after register_allocate.c was moved to util/ directory.

9 years agovc4: Put dead writes into the NOP register when generating code.
Eric Anholt [Tue, 23 Sep 2014 20:20:29 +0000 (13:20 -0700)]
vc4: Put dead writes into the NOP register when generating code.

They still provide register pressure since I haven't made a special class
for them, but since they're only live for one instruction it probably
doesn't matter.

This improves the readability of QPU assembly.

9 years agovc4: When possible, resolve raddr conflicts by swapping files on specials.
Eric Anholt [Tue, 23 Sep 2014 19:56:54 +0000 (12:56 -0700)]
vc4: When possible, resolve raddr conflicts by swapping files on specials.

Cleans up a bunch of ugliness in perspective interpolation.

9 years agovc4: Fix overzealous raddr conflict resolution.
Eric Anholt [Tue, 23 Sep 2014 19:50:05 +0000 (12:50 -0700)]
vc4: Fix overzealous raddr conflict resolution.

We only need to do the fixup when both args are in the same file, not just
when both are in physical registers.

9 years agovc4: Add support for 8-bit unorm/snorm vertex inputs.
Eric Anholt [Fri, 22 Aug 2014 22:02:52 +0000 (15:02 -0700)]
vc4: Add support for 8-bit unorm/snorm vertex inputs.

9 years agovc4: Add disasm for A-file unpack operations.
Eric Anholt [Fri, 22 Aug 2014 21:16:19 +0000 (14:16 -0700)]
vc4: Add disasm for A-file unpack operations.

The A-file unpack is just like R4 unpack, except that if you don't do a
floating-point operation it won't do float conversion (so int16 gets
scaled up to int32).

9 years agovc4: Switch to using Mesa's register allocator.
Eric Anholt [Mon, 22 Sep 2014 19:16:16 +0000 (12:16 -0700)]
vc4: Switch to using Mesa's register allocator.

This will let me more reliably allocate a-file registers, which are going
to be even more in demand when I start using a-file unpacks.

Also fixes a bug where the reservation of payload registers (FRAG_Z/W) was
off by one but just caused failure to register allocate at all if the
off-by-one was fixed.

9 years agovc4: Make a static list of all the registers.
Eric Anholt [Mon, 22 Sep 2014 18:42:22 +0000 (11:42 -0700)]
vc4: Make a static list of all the registers.

9 years agovc4: Switch the context struct to use ralloc.
Eric Anholt [Mon, 22 Sep 2014 19:38:24 +0000 (12:38 -0700)]
vc4: Switch the context struct to use ralloc.

I wanted to hang the ra_regs off it so I didn't have to free, but it
turned out it wasn't ralloced yet.

9 years agomesa: Move register_allocate.c to util.
Eric Anholt [Mon, 22 Sep 2014 19:24:21 +0000 (12:24 -0700)]
mesa: Move register_allocate.c to util.

The r300 gallium driver is using it outside of the Mesa tree, and I wanted
to do so for vc4 as well.  Rather than make the multiple-definitions
problem even more complicated, just move it to more-shared code.

v2: Don't forget to delete the symlink in r300 (review by Matt).
    Delete more r300-helper references (review by Emil)
    Don't prefix util/ header inclusion with "util/" (review by Emil)

Reviewed-by: Matt Turner <mattst88@gmail.com> (v1)
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com> (v1)
9 years agogallivm: fix idiv
Roland Scheidegger [Tue, 23 Sep 2014 17:29:33 +0000 (19:29 +0200)]
gallivm: fix idiv

ffeb77c7b0552a8624e46e65d6347240ac5ae84d had a typo which turned all signed
integer divisions into unsigned ones. Oops.
This gets us back the 51 little piglits
(all from glsl built-in-functions, fs/vs/gs-op-div-int-ivec2 and similar).

Cc: "10.2 10.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agoegl: extra null checks for get_xcb_screen() return values
Juha-Pekka Heikkila [Mon, 8 Sep 2014 12:03:35 +0000 (15:03 +0300)]
egl: extra null checks for get_xcb_screen() return values

verify get_xcb_screen() returned pointer before using it.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agometa: Fix error paths in meta_copy_image.c
Juha-Pekka Heikkila [Mon, 8 Sep 2014 10:59:50 +0000 (13:59 +0300)]
meta: Fix error paths in meta_copy_image.c

If _mesa_get_tex_image() return NULL there is already error
set in context. Other error pats free allocated texture.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agometa: Avoid null access on setup_glsl_msaa_blit_shader()
Juha-Pekka Heikkila [Mon, 8 Sep 2014 10:50:08 +0000 (13:50 +0300)]
meta: Avoid null access on setup_glsl_msaa_blit_shader()

On default fallback path there was null access on src_rb

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoi965: Add extra null check in intel_bufferobj_alloc()
Juha-Pekka Heikkila [Fri, 1 Aug 2014 11:38:17 +0000 (14:38 +0300)]
i965: Add extra null check in intel_bufferobj_alloc()

Check calloc returned requested memory.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agomesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()
Juha-Pekka Heikkila [Wed, 2 Jul 2014 17:50:42 +0000 (20:50 +0300)]
mesa/main: Check allocations success in _mesa_one_time_init_extension_overrides()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoglsl: Check realloc return value in ir_function::matching_signature()
Juha-Pekka Heikkila [Fri, 27 Jun 2014 13:16:20 +0000 (16:16 +0300)]
glsl: Check realloc return value in ir_function::matching_signature()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoloader: Check dlsym() did not fail in libudev_get_device_name_for_fd()
Juha-Pekka Heikkila [Fri, 27 Jun 2014 12:22:04 +0000 (15:22 +0300)]
loader: Check dlsym() did not fail in libudev_get_device_name_for_fd()

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoglsl: Check calloc return value in link_intrastage_shaders()
Juha-Pekka Heikkila [Wed, 7 May 2014 13:20:12 +0000 (16:20 +0300)]
glsl: Check calloc return value in link_intrastage_shaders()

Check calloc return value while adding build-in functions.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoi965: Avoid null access in intelMakeCurrent()
Juha-Pekka Heikkila [Fri, 25 Apr 2014 12:20:36 +0000 (15:20 +0300)]
i965: Avoid null access in intelMakeCurrent()

separate two null checks connected with && to their own if branches.

Signed-off-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>