platform/upstream/mesa.git
9 years agoi965/vec4: Move type_size() method to brw_vec4_visitor class
Eduardo Lima Mitev [Tue, 16 Jun 2015 11:39:48 +0000 (13:39 +0200)]
i965/vec4: Move type_size() method to brw_vec4_visitor class

The type_size() method is currently accessible only in the implementation
of vec4_visitor. Since we need to reuse it in the upcoming NIR->vec4 pass,
lets make it a method of the class instead.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/vec4: Select between new nir_vec4 or current vec4_visitor code-paths
Eduardo Lima Mitev [Tue, 16 Jun 2015 10:26:39 +0000 (12:26 +0200)]
i965/nir/vec4: Select between new nir_vec4 or current vec4_visitor code-paths

The NIR->vec4 pass will be activated if both the following conditions are met:

* INTEL_USE_NIR environment variable is defined and is positive (1 or true)
* The stage is vertex shader (support for geometry shaders and
  ARB_vertex_program will be added later).

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965/nir/vec4: Add implementation placeholders for a new NIR->vec4 pass
Eduardo Lima Mitev [Tue, 16 Jun 2015 10:08:09 +0000 (12:08 +0200)]
i965/nir/vec4: Add implementation placeholders for a new NIR->vec4 pass

This patch will add a brw_vec4_nir.cpp file filled with entry point methods to
the main functionality, following a structure similar to brw_fs_nir.cpp.

Subsequent patches in this series will be adding the implementations for these
methods, incrementally.

Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agomesa: Replace F_TO_I() with _mesa_lroundevenf().
Matt Turner [Thu, 25 Jun 2015 23:47:52 +0000 (16:47 -0700)]
mesa: Replace F_TO_I() with _mesa_lroundevenf().

I'm not sure what the true meaning of "The rounding mode may vary." is,
but it is the case that the IROUND() path rounds differently than the
other paths (and does it wrong, at that).

Like _mesa_roundeven{f,}(), just add an use _mesa_lroundeven{f,}() that
has known semantics.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: Add -fno-trapping-math to CFLAGS.
Matt Turner [Fri, 31 Jul 2015 19:19:46 +0000 (12:19 -0700)]
mesa: Add -fno-trapping-math to CFLAGS.

Cuts about 1k of .text size.

   text    data     bss     dec     hex filename
4983676  197808   26328 5207812  4f7704 i965_dri.so before
4982522  197800   26328 5206650  4f727a i965_dri.so after

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agomesa: Add -fno-math-errno to CFLAGS.
Matt Turner [Fri, 31 Jul 2015 19:18:37 +0000 (12:18 -0700)]
mesa: Add -fno-math-errno to CFLAGS.

Cuts about 9k of .text size.

   text    data     bss     dec     hex filename
4992804  197808   26328 5216940  4f9aac i965_dri.so before
4983676  197808   26328 5207812  4f7704 i965_dri.so after

Also, Darwin's libm does not ever set errno, so if we care about those
systems we shouldn't rely on errno anyway.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
9 years agor600,compute: force tiling on 2D and 3D texture compute resources
Zoltan Gilian [Thu, 30 Jul 2015 18:11:51 +0000 (20:11 +0200)]
r600,compute: force tiling on 2D and 3D texture compute resources

To circumvent a problem occuring when LINEAR_ALIGNED array mode is
selected on a TEXTURE_2D RAT.
This configuration causes MEM_RAT STORE_TYPED to write to incorrect
locations.

9 years agoclover: handle setKernelArg errors
Zoltan Gilian [Thu, 30 Jul 2015 21:35:09 +0000 (23:35 +0200)]
clover: handle setKernelArg errors

9 years agoclover: fix image resource depth and array_size
Zoltan Gilian [Mon, 27 Jul 2015 09:27:12 +0000 (11:27 +0200)]
clover: fix image resource depth and array_size

9 years agonir: Use a single bit for the dual-source blend index
Timothy Arceri [Sun, 2 Aug 2015 04:57:38 +0000 (14:57 +1000)]
nir: Use a single bit for the dual-source blend index

The only values allowed are 0 and 1, and the value is checked before
assigning.

This is a copy of 8eeca7a56c that seems to have been made to the glsl
ir type after it was copied for use in nir but before nir landed.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agoclover: pass image attributes to the kernel
Zoltan Gilian [Mon, 27 Jul 2015 09:34:07 +0000 (11:34 +0200)]
clover: pass image attributes to the kernel

Read-only and write-only image arguments are recognized and
distinguished.
Attributes of the image arguments are passed to the kernel as implicit
arguments.

9 years agoclover: move find_kernels to functions
Zoltan Gilian [Mon, 27 Jul 2015 09:21:07 +0000 (11:21 +0200)]
clover: move find_kernels to functions

9 years agomesa: fix type for array indexing validation
Timothy Arceri [Sun, 2 Aug 2015 01:40:26 +0000 (11:40 +1000)]
mesa: fix type for array indexing validation

parse_program_resource_name returns -1 when the index is invalid this needs to
be tested before assigning the value to the unsigned array_index.

In link_varyings.cpp (the other place parse_program_resource_name is used) after
the -1 check is done the value is just assigned to an unsigned variable so it
seems long is just used so we can return the -1 rather than actually expecting
index values to be ridiculously large.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow multisampled textures for GLES 3.1
Marta Lofstedt [Mon, 11 May 2015 13:03:56 +0000 (15:03 +0200)]
mesa/es3.1: Allow multisampled textures for GLES 3.1

GLES 3.1 must be allowed to create multisampled textures.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow query of GL_TEXTURE_MULTISAMPLE
Marta Lofstedt [Mon, 11 May 2015 13:03:55 +0000 (15:03 +0200)]
mesa/es3.1: Allow query of GL_TEXTURE_MULTISAMPLE

GLES 3.1 must allow a query for GL_TEXTURE_MULTISAMPLE.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow enable of GL_SAMPLE_MASK
Marta Lofstedt [Mon, 11 May 2015 13:03:53 +0000 (15:03 +0200)]
mesa/es3.1: Allow enable of GL_SAMPLE_MASK

GLES 3.1 must be able to enable GL_SAMPLE_MASK.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow textures with target GL_TEXTURE_2D_MULTISAMPLE
Marta Lofstedt [Mon, 11 May 2015 13:03:52 +0000 (15:03 +0200)]
mesa/es3.1: Allow textures with target GL_TEXTURE_2D_MULTISAMPLE

GLES 3.1 should be able to bind a texture with the target
GL_TEXTURE_2D_MULTISAMPLE.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow GL_DEPTH_STENCIL_TEXTURE_MODE
Marta Lofstedt [Mon, 11 May 2015 13:03:51 +0000 (15:03 +0200)]
mesa/es3.1: Allow GL_DEPTH_STENCIL_TEXTURE_MODE

GLES 3.1 must support the parameter GL_DEPTH_STENCIL_TEXTURE_MODE.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow GL_SAMPLE_MASK
Marta Lofstedt [Mon, 11 May 2015 13:03:50 +0000 (15:03 +0200)]
mesa/es3.1: Allow GL_SAMPLE_MASK

GLES 3.1 should be allowed to enable GL_SAMPLE_MASK.

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa/es3.1: Allow binding GL_DRAW_INDIRECT_BUFFER with gles 3.1
Marta Lofstedt [Mon, 11 May 2015 13:03:49 +0000 (15:03 +0200)]
mesa/es3.1: Allow binding GL_DRAW_INDIRECT_BUFFER with gles 3.1

Signed-off-by: Marta Lofstedt <marta.lofstedt@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agor600g: re-enable single-sample fast clear
Marek Olšák [Sun, 2 Aug 2015 13:19:19 +0000 (15:19 +0200)]
r600g: re-enable single-sample fast clear

Fixed by the CB_SHADER_MASK fix.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agor600g: fix the CB_SHADER_MASK setup
Marek Olšák [Sun, 2 Aug 2015 13:18:36 +0000 (15:18 +0200)]
r600g: fix the CB_SHADER_MASK setup

This fixes the single-sample fast clear hang.

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agor600g: fix the single-sample fast clear setup
Marek Olšák [Sun, 2 Aug 2015 13:17:30 +0000 (15:17 +0200)]
r600g: fix the single-sample fast clear setup

No effect, but this is what we should be doing.

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: flush if the memory usage for an IB is too high
Marek Olšák [Thu, 16 Jul 2015 17:55:42 +0000 (19:55 +0200)]
radeonsi: flush if the memory usage for an IB is too high

Picked from the amdgpu branch.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
9 years agoopencl: use versioned .so in mesa.icd
Igor Gnatenko [Tue, 7 Jul 2015 10:05:04 +0000 (13:05 +0300)]
opencl: use versioned .so in mesa.icd

We must have versioned library in mesa.icd, because ICD loader would
fail if the mesa-devel package wasn't installed.

Cc: "10.6" <mesa-stable@lists.freedesktop.org>
Reported-by: Fabian Deutsch <fabian.deutsch@gmx.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=73512
Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoincludes/GL: remove duplicated extension declarations from glx.h
Emil Velikov [Thu, 30 Jul 2015 14:18:54 +0000 (15:18 +0100)]
includes/GL: remove duplicated extension declarations from glx.h

All three of GLX_NV_float_buffer, GLX_EXT_texture_from_pixmap and
GLX_MESA_query_renderer have been in glxext.h for a while now.

As such we can drop this workaround/hack from the header.

v2: Remove the comment about GLX_NV_float_buffer.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com> (v1)
9 years agodocs: rename/bump 10.7.0 release notes to 11.0.0
Emil Velikov [Wed, 29 Jul 2015 17:13:50 +0000 (18:13 +0100)]
docs: rename/bump 10.7.0 release notes to 11.0.0

Recently a few drivers have grown OpenGL 4+ support so we might as
well go all the way to... 11 ;-)

v2: Don't forget to update the version file (Ilia)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agowinsys/radeon: don't leak the fd when it is 0
Emil Velikov [Wed, 29 Jul 2015 14:44:32 +0000 (15:44 +0100)]
winsys/radeon: don't leak the fd when it is 0

Earlier commit added an extra dup(fd) to fix a ZaphodHeads issue.
Although it did not consider the (very unlikely) case where we might end
up with the valid fd == 0.

Fixes: 28dda47ae4d(winsys/radeon: Use dup fd as key in drm-winsys hash
table to fix ZaphodHeads.)

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
9 years agoconfigure.ac: check for mkostemp()
Emil Velikov [Fri, 10 Jul 2015 11:28:23 +0000 (12:28 +0100)]
configure.ac: check for mkostemp()

We can make use of it over mkstemp + fcntl in the egl/wayland code.

Cc: Axel Davy <axel.davy@ens.fr>
Suggested-by: Matt Turner <mattst88@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl/wayland: use drmGetNodeTypeFromFd helper instead of opencoding it
Emil Velikov [Fri, 10 Jul 2015 11:27:06 +0000 (12:27 +0100)]
egl/wayland: use drmGetNodeTypeFromFd helper instead of opencoding it

Cc: Axel Davy <axel.davy@ens.fr>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Acked-by: Boyan Ding <boyan.j.ding@gmail.com>
9 years agoegl/wayland: use designated initializers
Emil Velikov [Fri, 10 Jul 2015 11:24:11 +0000 (12:24 +0100)]
egl/wayland: use designated initializers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
9 years agoegl: remove ifdef $(egl_extension) compile guards
Emil Velikov [Fri, 10 Jul 2015 10:22:13 +0000 (11:22 +0100)]
egl: remove ifdef $(egl_extension) compile guards

All of these are already defined in the headers provided.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl/wayland: libdrm is a hard requirement, treat it as such
Emil Velikov [Fri, 10 Jul 2015 10:01:55 +0000 (11:01 +0100)]
egl/wayland: libdrm is a hard requirement, treat it as such

Prompt at configure time if it's missing otherwise we'll fail later on
in the build. Remove ambiguous HAVE_LIBDRM guard.

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl: consolidate ifdef HAVE_LIBDRM blocks
Emil Velikov [Fri, 10 Jul 2015 10:01:35 +0000 (11:01 +0100)]
egl: consolidate ifdef HAVE_LIBDRM blocks

Move the code around rather than having it scattered. No functional
change.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
9 years agoconfigure.ac: null,android,gdi are not valid egl-platforms
Emil Velikov [Thu, 9 Jul 2015 23:16:21 +0000 (00:16 +0100)]
configure.ac: null,android,gdi are not valid egl-platforms

... and update the documentation to reflect reality.
null and gdi are gone, and surfaceless is a recent addition.

v2: s/platforms/platform/ (spotted by Thomas)

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Thomas Helland <thomashelland90@gmail.com>
9 years agoRevert "gallium/radeon: re-enable unsafe math for graphics shaders"
Marek Olšák [Fri, 31 Jul 2015 22:51:00 +0000 (00:51 +0200)]
Revert "gallium/radeon: re-enable unsafe math for graphics shaders"

This reverts commit 8559f6ce62a9d5b52fa8189ba2352cd48bdabccf.

It causes hangs in DOTA 2 Reborn.

9 years agoclover: make dispatch matches functions def
EdB [Fri, 31 Jul 2015 17:14:45 +0000 (19:14 +0200)]
clover: make dispatch matches functions def

Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agogallivm: Fix GCC unused-variable warning.
Vinson Lee [Thu, 30 Jul 2015 03:17:36 +0000 (20:17 -0700)]
gallivm: Fix GCC unused-variable warning.

lp_bld_tgsi_soa.c: In function 'lp_emit_immediate_soa':
lp_bld_tgsi_soa.c:3065:18: warning: unused variable 'size' [-Wunused-variable]
       const uint size = imm->Immediate.NrTokens - 1;
                  ^

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
9 years agoglx: Fix missing bit decl for EXT_texture_integer
Adam Jackson [Fri, 31 Jul 2015 17:36:21 +0000 (13:36 -0400)]
glx: Fix missing bit decl for EXT_texture_integer

Missing from:

    commit b15aba940a3b6fc7c9bebc692968e7e9b72b9f29
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Tue Jul 21 11:43:42 2015 -0400

glx: Fix image size computation for EXT_texture_integer (v2)

Signed-off-by: Adam Jackson <ajax@redhat.com>
9 years agoglsl: Initialize parse-state in constructor of lower_subroutine.
Matt Turner [Wed, 29 Jul 2015 17:47:51 +0000 (10:47 -0700)]
glsl: Initialize parse-state in constructor of lower_subroutine.

Static analysis tools don't like partial object initializations.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
9 years agoglx: Fix image size computation for EXT_texture_integer (v2)
Adam Jackson [Tue, 21 Jul 2015 15:43:42 +0000 (11:43 -0400)]
glx: Fix image size computation for EXT_texture_integer (v2)

Without this this extension basically can't work in indirect contexts,
TexImage2D will compute the image size as 0 and we'll send no image data
to the server.

v2: Add EXT_texture_integer to the client extension list too (Ian)

Reviewed-by: Eric Anholt <eric@anholt.net>
Signed-off-by: Adam Jackson <ajax@redhat.com>
9 years agoradeonsi: copy *8_SNORM bits exactly in resource_copy_region
Marek Olšák [Thu, 30 Jul 2015 15:38:44 +0000 (17:38 +0200)]
radeonsi: copy *8_SNORM bits exactly in resource_copy_region

Disabling the FP16 mode didn't help.

If needed, we can use this trick for blits too, but not for scaled blits.

+ 4 piglits

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agor600g: early exit in r600_clear if there's nothing to do
Marek Olšák [Tue, 28 Jul 2015 09:39:35 +0000 (11:39 +0200)]
r600g: early exit in r600_clear if there's nothing to do

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: early exit in si_clear if there's nothing to do
Marek Olšák [Tue, 28 Jul 2015 09:39:35 +0000 (11:39 +0200)]
radeonsi: early exit in si_clear if there's nothing to do

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: fix a regression since the resource_copy_region cleanup
Marek Olšák [Mon, 27 Jul 2015 17:01:21 +0000 (19:01 +0200)]
radeonsi: fix a regression since the resource_copy_region cleanup

Broken since:
    46b2b3b - radeonsi: don't change pipe_resource in resource_copy_region

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

Reviewed-and-Tested-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: fix broken st/nine from merging tessellation
Marek Olšák [Sun, 26 Jul 2015 19:08:18 +0000 (21:08 +0200)]
radeonsi: fix broken st/nine from merging tessellation

st/nine uses GENERIC slots greater than 60.

9 years agoradeonsi: move CP DMA functions to their own file
Marek Olšák [Fri, 24 Jul 2015 23:25:07 +0000 (01:25 +0200)]
radeonsi: move CP DMA functions to their own file

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoradeonsi: add a debug flag that disables printing ISA in shader dumps
Marek Olšák [Sat, 25 Jul 2015 14:15:48 +0000 (16:15 +0200)]
radeonsi: add a debug flag that disables printing ISA in shader dumps

9 years agoradeonsi: add a debug flag that disables printing TGSI in shader dumps
Marek Olšák [Sat, 25 Jul 2015 14:15:48 +0000 (16:15 +0200)]
radeonsi: add a debug flag that disables printing TGSI in shader dumps

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: add a debug flag that disables printing the LLVM IR in shader dumps
Marek Olšák [Sat, 25 Jul 2015 14:15:48 +0000 (16:15 +0200)]
radeonsi: add a debug flag that disables printing the LLVM IR in shader dumps

This is for shader-db and should reduce size of shader dumps.

9 years agoradeonsi: store shader disassemblies in memory for future users
Marek Olšák [Fri, 10 Jul 2015 22:17:48 +0000 (00:17 +0200)]
radeonsi: store shader disassemblies in memory for future users

This will be used by the new ddebug pipe. I'm including it now to avoid
conflicts with other patches.

9 years agoradeonsi: don't use llvm.AMDIL.fraction for FRC and DFRAC
Marek Olšák [Sat, 25 Jul 2015 10:17:19 +0000 (12:17 +0200)]
radeonsi: don't use llvm.AMDIL.fraction for FRC and DFRAC

There are 2 reasons for this:
- LLVM optimization passes can work with floor
- there are patterns to select v_fract from floor anyway

There is no change in the generated code.

9 years agogallium/radeon: re-enable unsafe math for graphics shaders
Marek Olšák [Sat, 25 Jul 2015 10:01:07 +0000 (12:01 +0200)]
gallium/radeon: re-enable unsafe math for graphics shaders

This reverts commit 4db985a5fa9ea985616a726b1770727309502d81.

The grass no longer disappears, which was the reason the commit was reverted.
This might affect tessellation. We'll see.

Totals from affected shaders:
SGPRS: 151672 -> 150232 (-0.95 %)
VGPRS: 90620 -> 89776 (-0.93 %)
Code Size: 3980472 -> 3920836 (-1.50 %) bytes
LDS: 67 -> 67 (0.00 %) blocks
Scratch: 1357824 -> 1202176 (-11.46 %) bytes per wave

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agogallium/radeon: don't use rsq_action
Marek Olšák [Sat, 25 Jul 2015 15:24:08 +0000 (17:24 +0200)]
gallium/radeon: don't use rsq_action

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agogallium/radeon: move r600-specific code to r600g
Marek Olšák [Sat, 25 Jul 2015 15:12:39 +0000 (17:12 +0200)]
gallium/radeon: move r600-specific code to r600g

Reviewed-by: Tom Stellard <thomas.stellard@amd.com>
9 years agogallium/radeon: remove unused variables and old comments
Marek Olšák [Sat, 25 Jul 2015 14:53:29 +0000 (16:53 +0200)]
gallium/radeon: remove unused variables and old comments

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agogallium/radeon: remove build_intrinsic and build_tgsi_intrinsic
Marek Olšák [Sat, 25 Jul 2015 09:26:18 +0000 (11:26 +0200)]
gallium/radeon: remove build_intrinsic and build_tgsi_intrinsic

duplicated now

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agogallivm: add LLVMAttribute parameter to lp_build_intrinsic
Marek Olšák [Sat, 25 Jul 2015 09:17:48 +0000 (11:17 +0200)]
gallivm: add LLVMAttribute parameter to lp_build_intrinsic

This will help remove some duplicated code from radeon.

Reviewed-by: Dave Airlie <airlied@redhat.com>
9 years agogallium/util: clear up that debug_get_flags_option returns a 64-bit mask
Marek Olšák [Sat, 25 Jul 2015 13:55:45 +0000 (15:55 +0200)]
gallium/util: clear up that debug_get_flags_option returns a 64-bit mask

Reviewed-by: Kai Wasserbäch <kai@dev.carbon-project.org>
9 years agoradeonsi: completely rework updating descriptors without CP DMA
Marek Olšák [Fri, 24 Jul 2015 22:53:16 +0000 (00:53 +0200)]
radeonsi: completely rework updating descriptors without CP DMA

The patch has a better explanation. Just a summary here:
- The CPU always uploads a whole descriptor array to previously-unused memory.
- CP DMA isn't used.
- No caches need to be flushed.
- All descriptors are always up-to-date in memory even after a hang, because
  CP DMA doesn't serve as a middle man to update them.

This should bring:
- better hang recovery (descriptors are always up-to-date)
- better GPU performance (no KCACHE and TC flushes)
- worse CPU performance for partial updates (only whole arrays are uploaded)
- less used IB space (no CP_DMA and WRITE_DATA packets)
- simpler code
- hopefully, some of the corruption issues with SI cards will go away.
  If not, we'll know the issue is not here.

Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
9 years agoi965/fs: Fix regression with SIMD8 VS since b5f1a48e234d47b24df38cb562cffb8941d43795.
Francisco Jerez [Thu, 30 Jul 2015 11:45:57 +0000 (14:45 +0300)]
i965/fs: Fix regression with SIMD8 VS since b5f1a48e234d47b24df38cb562cffb8941d43795.

With num_direct_uniforms == 0 there's no space allocated in the
param_size array for the one block of direct uniforms -- On the FS
stage this would be a harmless no-op because it would simply re-set
one of the param_size entries allocated for the sampler units to zero,
but on the VS stage it has been reported to cause memory corruption
followed by a crash -- Surprising how a full piglit run on Gen8 didn't
catch it.

Reported-and-reviewed-by: "Lofstedt, Marta" <marta.lofstedt@intel.com>
9 years agoi965/gen9: Add hs, ds, and cs thread + urb info
Ben Widawsky [Fri, 31 Jul 2015 02:16:32 +0000 (19:16 -0700)]
i965/gen9: Add hs, ds, and cs thread + urb info

For SKL: These are the production values.

For BXT: These are low estimates to enable platforms.

This patch was originally part of
i965/skl: Add production thread counts and URB size
but was split out at Jordan's request (which I found to be reasonable).

Note on stable inclusion: 10.6 does not care about hs, and ds. It does care
about cs, but since Jordan was the one that asked me to extract it, I'll leave
it up to him to deal with a backport to stable is required.

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/bxt: Use more conservative thread counts
Ben Widawsky [Fri, 31 Jul 2015 02:12:15 +0000 (19:12 -0700)]
i965/bxt: Use more conservative thread counts

Since we really do not know what may occur in the future, pick a more
conservative value for thread counts until we know better what values are
correct. As far as I can tell, the old values will work fine, but some of the
registers seem to indicate that going even lower is possible and the purpose of
having early support is to enable as many configurations that can possibly
exist (we can trim things down after platforms begin shipping later).

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoi965/skl: Add production thread counts and URB size
Ben Widawsky [Wed, 29 Jul 2015 19:35:24 +0000 (12:35 -0700)]
i965/skl: Add production thread counts and URB size

This patch adjusts the SKL values to the best known values we have.

v2: Remove HS/DS/CS fields. Adding this makes most sense to add to the
GEN9_FEATURES macro, however, doing that would require updating BXT values, and
Jordan requested I not do that. Conveniently, this request makes a lot of sense
wrt to stable backport as HS, and DS do not even exist there.

Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agovc4: Lower uniform loads to scalar in NIR.
Eric Anholt [Thu, 30 Jul 2015 18:16:13 +0000 (11:16 -0700)]
vc4: Lower uniform loads to scalar in NIR.

This also moves the vec4-to-byte-addressing math into NIR, so that
algebraic has a chance at it.

9 years agovc4: Move some FS input lowering into NIR.
Eric Anholt [Thu, 30 Jul 2015 00:27:54 +0000 (17:27 -0700)]
vc4: Move some FS input lowering into NIR.

9 years agovc4: Move program keys to the header file.
Eric Anholt [Thu, 30 Jul 2015 00:29:39 +0000 (17:29 -0700)]
vc4: Move program keys to the header file.

I want to be able to inspect them from other files for lowering passes in
NIR.

9 years agovc4: Lower NIR inputs to scalar as well.
Eric Anholt [Thu, 30 Jul 2015 00:16:26 +0000 (17:16 -0700)]
vc4: Lower NIR inputs to scalar as well.

For now this is just scalarizing, but it also means we'll get to dump a
bunch of QIR-based lowering in a moment.

9 years agovc4: Start adding a NIR-based output lowering pass.
Eric Anholt [Wed, 29 Jul 2015 22:52:18 +0000 (15:52 -0700)]
vc4: Start adding a NIR-based output lowering pass.

For now, this just splits up store_output intrinsics to be scalars, and
drops unused outputs in the coordinate shader.  My goal is to be able to
drop a bunch of my VC4-specific optimization by letting NIR handle it.

9 years agovc4: Mark our shaders as single-threaded.
Eric Anholt [Wed, 29 Jul 2015 19:16:50 +0000 (12:16 -0700)]
vc4: Mark our shaders as single-threaded.

I had my understanding of this bit flipped.  We're using the full register
space, so we need to say so.

9 years agovc4: Avoid leaking indirect array access UBOs.
Eric Anholt [Wed, 29 Jul 2015 21:41:22 +0000 (14:41 -0700)]
vc4: Avoid leaking indirect array access UBOs.

9 years agovc4: Avoid overflowing various static tables.
Eric Anholt [Wed, 29 Jul 2015 21:40:10 +0000 (14:40 -0700)]
vc4: Avoid overflowing various static tables.

9 years agovc4: Fix return values from recent validation changes.
Eric Anholt [Wed, 29 Jul 2015 19:20:33 +0000 (12:20 -0700)]
vc4: Fix return values from recent validation changes.

9 years agodocs: trivial cleanup of GL3.txt, remove redundant radeonsi entries.
Kai Wasserbäch [Thu, 30 Jul 2015 18:32:36 +0000 (20:32 +0200)]
docs: trivial cleanup of GL3.txt, remove redundant radeonsi entries.

Follow-up to 1b2b0e42ce47bfd1fcb5513ed2c23b9bb7a5a5b8

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agost/mesa: don't draw instead of asserting in transform feedback
Dave Airlie [Thu, 30 Jul 2015 10:44:50 +0000 (20:44 +1000)]
st/mesa: don't draw instead of asserting in transform feedback

if we get a request to take the count from feedback, but there
is no buffer to take it from, just draw as if we got 0 vertices
so nothing.

This fixes this assert killing the ogl conform, and a piglit
test I've sent.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agomesa: remove now unused _mesa_get_uniform_location
Timothy Arceri [Fri, 3 Jul 2015 22:35:35 +0000 (08:35 +1000)]
mesa: remove now unused _mesa_get_uniform_location

Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa: remove now unused subscript validations
Timothy Arceri [Sat, 25 Jul 2015 02:39:43 +0000 (12:39 +1000)]
mesa: remove now unused subscript validations

Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agomesa: fix and simplify resource query for arrays
Timothy Arceri [Sat, 25 Jul 2015 02:33:53 +0000 (12:33 +1000)]
mesa: fix and simplify resource query for arrays

This removes the need for multiple functions designed to validate an array
subscript and replaces them with a call to a single function.

The change also means that validation is now only done once and the index
is retrived at the same time, as a result the getUniformLocation code can
be simplified saving an extra hash table lookup (and yet another
validation call).

This chage also fixes some tests in:
ES31-CTS.program_interface_query.uniform

V3: rebase on subroutines, and move the resource index array == 0
check into _mesa_GetProgramResourceIndex() to simplify things further

V2: Fix bounds checks for program input/output, split unrelated comment fix
and _mesa_get_uniform_location() removal into their own patch.

Cc: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agoi965/bxt: Don't use brw_device_info_skl_early on BXT
Neil Roberts [Wed, 29 Jul 2015 16:40:37 +0000 (17:40 +0100)]
i965/bxt: Don't use brw_device_info_skl_early on BXT

Previously it could end up using the “SKL early” device on BXT
depending on the revision number. This would probably break things
because for example has_llc would be wrong.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoglsl: set stage flag for structs and arrays in resource list
Timothy Arceri [Sat, 4 Jul 2015 05:43:15 +0000 (15:43 +1000)]
glsl: set stage flag for structs and arrays in resource list

This fixes the remaining failing tests in:
ES31-CTS.program_interface_query.uniform-types

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agodocs: consolidate radeonsi in GL3.txt
Dave Airlie [Wed, 29 Jul 2015 09:51:46 +0000 (10:51 +0100)]
docs: consolidate radeonsi in GL3.txt

move into DONE for GL4.0 and GL4.1

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: enable GL4.1 and update documentation (v2)
Dave Airlie [Wed, 22 Jul 2015 00:24:39 +0000 (01:24 +0100)]
radeonsi: enable GL4.1 and update documentation (v2)

This enables GL4.1 for radeonsi, and updates the
docs in the correct places.

v2: enable only for llvm 3.7 which has fixes in place.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: add GS multiple streams support (v2)
Dave Airlie [Mon, 20 Jul 2015 01:37:14 +0000 (02:37 +0100)]
radeonsi: add GS multiple streams support (v2)

This is the final piece for ARB_gpu_shader5,

The code is based on the r600 code from Glenn Kennard,
and myself.

While developing this, I'm not 100% sure of all the calculations
made in the GS registers, this is why the max_stream is worked
out there and used to limit the changes in registers. Otherwise
my initial attempts either regressed GS texelFetch tests
or primitive-id-restart. The current code has no regressions
in piglit.

This commit doesn't enable ARB_gpu_shader5, since that just
bumps the glsl level to 4.00, so I'll just do a separate patch
for 4.10.

v1.1: fix bug introduced in rebase.
v2: Address Marek's review comments,
remove my llvm stream code for simpler C,
move gsvs_ring and gs_next_vertex to arrays.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoDelete unused functions in format parser
Anuj Phogat [Wed, 29 Jul 2015 17:15:03 +0000 (10:15 -0700)]
Delete unused functions in format parser

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Neil Roberts <neil@linux.intel.com>
9 years agoi965: Change the type of max_{vs, hs, ...}_threads variables to unsigned
Anuj Phogat [Wed, 29 Jul 2015 16:57:26 +0000 (09:57 -0700)]
i965: Change the type of max_{vs, hs, ...}_threads variables to unsigned

Fixes following compiler warning:
brw_cs.cpp:386:27: warning: comparison between signed and unsigned
integer expressions [-Wsign-compare]

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoDelete duplicate function is_power_of_two() and use _mesa_is_pow_two()
Anuj Phogat [Wed, 29 Jul 2015 16:41:18 +0000 (09:41 -0700)]
Delete duplicate function is_power_of_two() and use _mesa_is_pow_two()

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
9 years agogallium/auxiliary: Ensure c99_math.h is included.
Jose Fonseca [Wed, 29 Jul 2015 19:45:09 +0000 (20:45 +0100)]
gallium/auxiliary: Ensure c99_math.h is included.

As it is needed for exp2.

Trivial.

9 years agoc99_math: (trivial) implement exp2 for MSVC too
Roland Scheidegger [Wed, 29 Jul 2015 20:20:04 +0000 (22:20 +0200)]
c99_math: (trivial) implement exp2 for MSVC too

Unsurprisingly doesn't build otherwise with old msvc.

9 years agoi965/bxt: Support 3src simd16 instructions
Ben Widawsky [Wed, 29 Jul 2015 02:52:49 +0000 (19:52 -0700)]
i965/bxt: Support 3src simd16 instructions

This is easily accomplished by moving simd16 3src to GEN9_FEATURES.

v2: small cleanup to make it more similar to GEN8_FEATURES

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agotargets/dri: scons: add missing link against libdrm
Emil Velikov [Wed, 22 Jul 2015 15:04:28 +0000 (16:04 +0100)]
targets/dri: scons: add missing link against libdrm

Otherwise the final dri module will have (additional) unresolved
symbols.

Cc: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviwed-by: Jose Fonseca <jfonseca@vmware.com>
9 years agosvga: scons: remove unused HAVE_SYS_TYPES_H define
Emil Velikov [Fri, 17 Jul 2015 17:18:20 +0000 (18:18 +0100)]
svga: scons: remove unused HAVE_SYS_TYPES_H define

There isn't a single instance in mesa that
mentions HAVE_SYS_TYPES_H, other than this file.

Cc: Jose Fonseca <jfonseca@vmware.com>
Acked-by: Brian Paul <brianp@vmware.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoglsl: Avoid double promotion.
Matt Turner [Thu, 16 Jul 2015 04:29:21 +0000 (21:29 -0700)]
glsl: Avoid double promotion.

9 years agomesa: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:15:42 +0000 (23:15 -0700)]
mesa: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa/math: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:15:32 +0000 (23:15 -0700)]
mesa/math: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoprogram: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:15:19 +0000 (23:15 -0700)]
program: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoswrast: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:15:10 +0000 (23:15 -0700)]
swrast: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agotnl: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:15:01 +0000 (23:15 -0700)]
tnl: Avoid double promotion.

There are a couple of unrelated changes in t_vb_lighttmp.h that I hope
you'll excuse -- there's a block of code that's duplicated modulo a few
trivial differences that I took the liberty of fixing.

9 years agovbo: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 06:14:54 +0000 (23:14 -0700)]
vbo: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoutil: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 01:01:54 +0000 (18:01 -0700)]
util: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agogallium/auxiliary: Avoid double promotion.
Matt Turner [Mon, 13 Jul 2015 01:01:42 +0000 (18:01 -0700)]
gallium/auxiliary: Avoid double promotion.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Eric Anholt <eric@anholt.net>