mesa.git
9 years agovc4: Rework cl handling to be friendlier to the compiler.
Eric Anholt [Fri, 10 Jul 2015 05:51:06 +0000 (22:51 -0700)]
vc4: Rework cl handling to be friendlier to the compiler.

Drops 680 bytes of code, from avoiding a bunch of extra updates to the
next pointer in the struct.

9 years agovc4: Make a helper function for getting the current offset in the CL.
Eric Anholt [Fri, 10 Jul 2015 21:46:42 +0000 (14:46 -0700)]
vc4: Make a helper function for getting the current offset in the CL.

I needed to rewrite this a bit for safety checking in the next commit.
Despite being a static inline of the same thing that was being done, we
lose 36 bytes of code for some reason.

9 years agovc4: Drop separate cl*_reloc_hindex().
Eric Anholt [Fri, 10 Jul 2015 05:48:17 +0000 (22:48 -0700)]
vc4: Drop separate cl*_reloc_hindex().

Now that RCL generation is in the kernel, we don't have any other
callers.  Oddly, the compiler generates another 8 bytes of code for
this, but the simplification is worth it.

9 years agovc4: Store reloc pointers as pointers, not offsets.
Eric Anholt [Fri, 10 Jul 2015 05:42:22 +0000 (22:42 -0700)]
vc4: Store reloc pointers as pointers, not offsets.

Now that we don't resize the CL as we build (it's set up at the top by
vc4_start_draw()), we can store the pointers instead of offsets from
the base.  Saves a bit of math in emitting relocs (about 60 bytes of
code).

9 years agovc4: Add perf debug for when we wait on BOs.
Eric Anholt [Tue, 30 Jun 2015 05:32:03 +0000 (22:32 -0700)]
vc4: Add perf debug for when we wait on BOs.

9 years agoi965: Mark constant static data as const.
Matt Turner [Mon, 13 Jul 2015 22:40:41 +0000 (15:40 -0700)]
i965: Mark constant static data as const.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoglsl: Lower shader storage buffer object loads to GLSL IR instrinsics
Samuel Iglesias Gonsalvez [Wed, 8 Jul 2015 15:30:44 +0000 (17:30 +0200)]
glsl: Lower shader storage buffer object loads to GLSL IR instrinsics

Extend the existing lower_ubo_reference pass to also detect SSBO loads
and lower them to __intrinsic_load_ssbo intrinsics.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Lower shader storage buffer object writes to GLSL IR instrinsics
Samuel Iglesias Gonsalvez [Wed, 8 Jul 2015 15:03:06 +0000 (17:03 +0200)]
glsl: Lower shader storage buffer object writes to GLSL IR instrinsics

Extend the existing lower_ubo_reference pass to also detect SSBO writes
and lower them to __intrinsic_store_ssbo intrinsics.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Don't do copy propagation on buffer variables
Iago Toral Quiroga [Fri, 24 Apr 2015 09:17:15 +0000 (11:17 +0200)]
glsl: Don't do copy propagation on buffer variables

Since the backing storage for these is shared we cannot ensure that
the value won't change by writes from other threads. Normally SSBO
accesses are not guaranteed to be syncronized with other threads,
except when memoryBarrier is used. So, we might be able to optimize
some SSBO accesses, but for now we always take the safe path and emit
the SSBO access.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Don't do constant variable on buffer variables
Iago Toral Quiroga [Fri, 24 Apr 2015 09:15:48 +0000 (11:15 +0200)]
glsl: Don't do constant variable on buffer variables

Since the backing storage for these is shared we cannot ensure that
the value won't change by writes from other threads. Normally SSBO
accesses are not guaranteed to be syncronized with other threads,
except when memoryBarrier is used. So, we might be able to optimize
some SSBO accesses, but for now we always take the safe path and emit
the SSBO access.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Don't do constant propagation on buffer variables
Iago Toral Quiroga [Fri, 24 Apr 2015 09:14:17 +0000 (11:14 +0200)]
glsl: Don't do constant propagation on buffer variables

Since the backing storage for these is shared we cannot ensure that
the value won't change by writes from other threads. Normally SSBO
accesses are not guaranteed to be syncronized with other threads,
except when memoryBarrier is used. So, we might be able to optimize
some SSBO accesses, but for now we always take the safe path and emit
the SSBO access.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Do not kill dead assignments to buffer variables or SSBO declarations.
Iago Toral Quiroga [Mon, 6 Apr 2015 08:19:50 +0000 (10:19 +0200)]
glsl: Do not kill dead assignments to buffer variables or SSBO declarations.

If we kill dead assignments we lose the buffer writes.

Also, we never kill UBO declarations even if they are never referenced
by the shader, they are always considered active. Although the spec
does not seem say this specifically for SSBOs, it is probably implied
since SSBOs are pretty much the same as UBOs, only that you can write
to them.

v2:
- Fix the comment (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Don't do tree grafting on buffer variables
Iago Toral Quiroga [Mon, 6 Apr 2015 07:37:58 +0000 (09:37 +0200)]
glsl: Don't do tree grafting on buffer variables

Otherwise we can lose writes into the buffers backing the variables.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Implement _mesa_BindBufferRange for target GL_SHADER_STORAGE_BUFFER
Iago Toral Quiroga [Thu, 19 Mar 2015 10:42:33 +0000 (11:42 +0100)]
mesa: Implement _mesa_BindBufferRange for target GL_SHADER_STORAGE_BUFFER

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Implement _mesa_BindBufferBase for target GL_SHADER_STORAGE_BUFFER
Iago Toral Quiroga [Thu, 19 Mar 2015 10:37:43 +0000 (11:37 +0100)]
mesa: Implement _mesa_BindBufferBase for target GL_SHADER_STORAGE_BUFFER

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Implement _mesa_BindBuffersRange for target GL_SHADER_STORAGE_BUFFER
Iago Toral Quiroga [Thu, 19 Mar 2015 10:21:52 +0000 (11:21 +0100)]
mesa: Implement _mesa_BindBuffersRange for target GL_SHADER_STORAGE_BUFFER

v2:
- Fix error message (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Implement _mesa_BindBuffersBase for target GL_SHADER_STORAGE_BUFFER
Iago Toral Quiroga [Thu, 19 Mar 2015 09:47:17 +0000 (10:47 +0100)]
mesa: Implement _mesa_BindBuffersBase for target GL_SHADER_STORAGE_BUFFER

v2:
- Add space before const (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Implement _mesa_DeleteBuffers for target GL_SHADER_STORAGE_BUFFER
Iago Toral Quiroga [Thu, 19 Mar 2015 09:31:23 +0000 (10:31 +0100)]
mesa: Implement _mesa_DeleteBuffers for target GL_SHADER_STORAGE_BUFFER

v2:
- Remove the extra spaces (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Initialize and free shader storage buffers
Iago Toral Quiroga [Thu, 19 Mar 2015 10:50:51 +0000 (11:50 +0100)]
mesa: Initialize and free shader storage buffers

v2:
- Fix indention, used tabs instead of whitespaces. (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: fix error messages in invalid declarations of shader storage blocks
Samuel Iglesias Gonsalvez [Thu, 19 Mar 2015 09:22:00 +0000 (10:22 +0100)]
glsl: fix error messages in invalid declarations of shader storage blocks

Due to GL_ARB_shader_storage_buffer_object extension, shader storage blocks
have the same limitations as uniform blocks.

This patch fixes the corresponding error messages.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: buffer variables cannot be defined outside interface blocks
Samuel Iglesias Gonsalvez [Wed, 18 Mar 2015 09:52:53 +0000 (10:52 +0100)]
glsl: buffer variables cannot be defined outside interface blocks

Section 4.3.7 "Buffer Variables", GLSL 4.30 spec:

"Buffer variables may only be declared inside interface blocks
(section 4.3.9 “Interface Blocks”), which are then referred to as
shader storage blocks. It is a compile-time error to declare buffer
variables at global scope (outside a block)."

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: shader buffer variables cannot have initializers
Samuel Iglesias Gonsalvez [Wed, 18 Mar 2015 09:25:10 +0000 (10:25 +0100)]
glsl: shader buffer variables cannot have initializers

Section 4.3.7 "Buffer Variables" of the GLSL 4.30 spec:

    "Buffer variables cannot have initializers."

v2:
- Rewrite error message (Jordan)

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: enable binding layout qualifier usage for shader storage buffer objects
Samuel Iglesias Gonsalvez [Wed, 18 Mar 2015 08:02:51 +0000 (09:02 +0100)]
glsl: enable binding layout qualifier usage for shader storage buffer objects

See GLSL 4.30 spec, section 4.4.5 "Uniform and Shader Storage Block
Layout Qualifiers".

v2:
- Add whitespace in an error message. Delete period '.' at the end of that
error message (Jordan).

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: add MaxShaderStorageBlocks to struct gl_program_constants
Samuel Iglesias Gonsalvez [Thu, 14 May 2015 10:37:07 +0000 (12:37 +0200)]
mesa: add MaxShaderStorageBlocks to struct gl_program_constants

v2:
- Set MaxShaderStorageBlocks to 8.

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: Add shader storage buffer support to struct gl_context
Iago Toral Quiroga [Thu, 19 Mar 2015 09:15:30 +0000 (10:15 +0100)]
mesa: Add shader storage buffer support to struct gl_context

This includes the array of bindings, the current buffer bound to the
GL_SHADER_STORAGE_BUFFER target and a set of general limits and default
values for shader storage buffers.

v2:
- Use spec values for the new defined constants (Jordan)

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Identify active uniform blocks that are buffer blocks as such.
Iago Toral Quiroga [Mon, 23 Mar 2015 10:19:12 +0000 (11:19 +0100)]
glsl: Identify active uniform blocks that are buffer blocks as such.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: link buffer variables and shader storage buffer interface blocks
Kristian Høgsberg [Wed, 13 May 2015 09:17:23 +0000 (11:17 +0200)]
glsl: link buffer variables and shader storage buffer interface blocks

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Implement parser support for 'buffer' qualifier
Kristian Høgsberg [Wed, 13 May 2015 08:53:46 +0000 (10:53 +0200)]
glsl: Implement parser support for 'buffer' qualifier

This is used to identify shader storage buffer interface blocks where
buffer variables are declared.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agonir: add nir_var_shader_storage
Iago Toral Quiroga [Mon, 18 May 2015 13:47:18 +0000 (15:47 +0200)]
nir: add nir_var_shader_storage

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: rename is_in_uniform_block to is_in_buffer_block
Iago Toral Quiroga [Fri, 5 Jun 2015 07:11:53 +0000 (09:11 +0200)]
mesa: rename is_in_uniform_block to is_in_buffer_block

Since this now checks if a variable is inside a uniform or a shader
storage block.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: Add ir_var_shader_storage
Kristian Høgsberg [Wed, 13 May 2015 08:41:55 +0000 (10:41 +0200)]
glsl: Add ir_var_shader_storage

This will be used to identify buffer variables inside shader storage
buffer objects, which are very similar to uniforms except for a few
differences, most important of which is that they are writable.

Since buffer variables are so similar to uniforms, we will almost always
want them to go through the same paths as uniforms.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agomesa: define ARB_shader_storage_buffer_object extension
Samuel Iglesias Gonsalvez [Tue, 17 Mar 2015 11:17:27 +0000 (12:17 +0100)]
mesa: define ARB_shader_storage_buffer_object extension

Signed-off-by: Samuel Iglesias Gonsalvez <siglesias@igalia.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agoglsl: free interface_types
Timothy Arceri [Mon, 13 Jul 2015 21:41:26 +0000 (07:41 +1000)]
glsl: free interface_types

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoglsl: replace some more old hash_table uses
Timothy Arceri [Mon, 13 Jul 2015 21:37:59 +0000 (07:37 +1000)]
glsl: replace some more old hash_table uses

The util/hash_table was intended to be a fast hash table
replacement for the program/hash_table see 35fd61bd99c1 and 72e55bb6888ff.

This change replaces some more uses of the old hash table.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoauxiliary/vl: use the correct screen index
Emil Velikov [Fri, 10 Jul 2015 20:27:13 +0000 (21:27 +0100)]
auxiliary/vl: use the correct screen index

Inspired (copied) from Marek's commit for egl/x11
commit 0b56e23e7f3(egl/dri2: use the correct screen index)

v2: Fix copy/pasta errors.

Cc: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoradeon: remove dri_mirror state
Emil Velikov [Tue, 7 Jul 2015 13:44:11 +0000 (14:44 +0100)]
radeon: remove dri_mirror state

Most of the data stored(duplicated) was unused, and for the one that is
follow the approach set by other drivers.
This eliminates the use of legacy (dri1) types.

Cc: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
9 years agoi915: remove unused driFd variable
Emil Velikov [Tue, 7 Jul 2015 13:13:33 +0000 (14:13 +0100)]
i915: remove unused driFd variable

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965: bump libdrm requirement to 2.4.61 and drop in-tree workaround
Emil Velikov [Mon, 6 Jul 2015 08:42:01 +0000 (09:42 +0100)]
i965: bump libdrm requirement to 2.4.61 and drop in-tree workaround

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
9 years agobugzilla_mesa.sh: sort the bugs list by number
Emil Velikov [Mon, 13 Jul 2015 19:01:39 +0000 (20:01 +0100)]
bugzilla_mesa.sh: sort the bugs list by number

v2: Use change sed/sort based on Ilia's suggestion.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoradeonsi: directly include radeon/* headers
Emil Velikov [Tue, 30 Jun 2015 13:37:19 +0000 (14:37 +0100)]
radeonsi: directly include radeon/* headers

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoauxiliary/vl: use loader_open_device() over open()
Emil Velikov [Mon, 29 Jun 2015 13:03:22 +0000 (14:03 +0100)]
auxiliary/vl: use loader_open_device() over open()

The former handles O_CLOEXEC (and the lack of it) appropriately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agopipe-loader: use loader_open_device() rather than open()
Emil Velikov [Mon, 29 Jun 2015 13:01:39 +0000 (14:01 +0100)]
pipe-loader: use loader_open_device() rather than open()

The former handles O_CLOEXEC (and the lack of it) appropriately.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agopipe-loader: remove pipe_loader_sw_probe_xlib
Emil Velikov [Mon, 29 Jun 2015 12:28:33 +0000 (13:28 +0100)]
pipe-loader: remove pipe_loader_sw_probe_xlib

It was only useful for st/egl, although I've never got to merging the
pipe-loader and inline-helpers before it was removed. There are no users
for it ATM.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoautomake: remove empty GALLIUM_PIPE_LOADER_LIBS
Emil Velikov [Mon, 29 Jun 2015 12:08:06 +0000 (13:08 +0100)]
automake: remove empty GALLIUM_PIPE_LOADER_LIBS

Cc: Rob Clark <robclark@freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoautomake: pipe-loader: remove the 'client' pipe-loader
Emil Velikov [Mon, 29 Jun 2015 12:02:21 +0000 (13:02 +0100)]
automake: pipe-loader: remove the 'client' pipe-loader

Was only around as opencl's pipe-loader wanted to link against xcb in
some cases.

Cc: Rob Clark <robclark@freedesktop.org>
Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agopipe-loader: remove pipe_loader_drm_probe_fd() x_auth argument
Emil Velikov [Mon, 29 Jun 2015 11:44:44 +0000 (12:44 +0100)]
pipe-loader: remove pipe_loader_drm_probe_fd() x_auth argument

No longer used by anyone, as of last commit.

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agopipe-loader: simplify pipe_loader_drm_probe
Emil Velikov [Tue, 30 Jun 2015 14:53:27 +0000 (15:53 +0100)]
pipe-loader: simplify pipe_loader_drm_probe

Do not iterate and (attempt to) open the render device, if we're over
the requested number of devices.

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agopipe-loader: drop support for non-render node devices
Emil Velikov [Mon, 29 Jun 2015 11:36:45 +0000 (12:36 +0100)]
pipe-loader: drop support for non-render node devices

Render nodes have been around for quite some time. Removing support via
the master/primary node allows us to clean up the conditional
compilation and simplify the build greatly.

For example currently we the pipe-loader, which explicitly links against
xcb and friends (for X auth) if found at compile-time. That
would cause problems as one will be forced to use X/xcb, even if it's a
headless system that is used for opencl.

v2: Clarify the linking topic in the commit message.

Cc: Tom Stellard <thomas.stellard@amd.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
9 years agoradeonsi: direct emit intrinsic for DFRAC.
Dave Airlie [Mon, 13 Jul 2015 08:11:20 +0000 (09:11 +0100)]
radeonsi: direct emit intrinsic for DFRAC.

Michel reported this still failed, and this fixed it

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoradeonsi: ARB_gpu_shader_fp64 + ARB_vertex_attrib_64bit support.
Dave Airlie [Wed, 1 Jul 2015 03:58:24 +0000 (04:58 +0100)]
radeonsi: ARB_gpu_shader_fp64 + ARB_vertex_attrib_64bit support.

This adds the translation from TGSI to AMDGPU llvm backend, for the
64-bit opcodes. The backend pretty much handles everything for us
fine. There is one patch required for SI DFRAC support, that I know
off.

[airlied: fixed missing comma, updated relnotes]

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agoloader: don't leak udev_enumerate
Guillaume Desmottes [Fri, 17 Apr 2015 13:13:36 +0000 (15:13 +0200)]
loader: don't leak udev_enumerate

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90073
Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodri3_open: don't leak the reply
Guillaume Desmottes [Fri, 17 Apr 2015 13:13:35 +0000 (15:13 +0200)]
dri3_open: don't leak the reply

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90073
Signed-off-by: Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodoxygen: Remove doxygen_sqlite3.db with 'make clean'
Rhys Kidd [Sat, 27 Jun 2015 03:14:38 +0000 (13:14 +1000)]
doxygen: Remove doxygen_sqlite3.db with 'make clean'

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodoxygen: Add doxygen_sqlite3.db to .gitignore
Rhys Kidd [Sat, 27 Jun 2015 03:14:37 +0000 (13:14 +1000)]
doxygen: Add doxygen_sqlite3.db to .gitignore

Signed-off-by: Rhys Kidd <rhyskidd@gmail.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: add news item and link release notes for mesa 10.6.2
Emil Velikov [Sat, 11 Jul 2015 19:36:44 +0000 (20:36 +0100)]
docs: add news item and link release notes for mesa 10.6.2

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodocs: Add sha256 checksums for the 10.6.2 release
Emil Velikov [Sat, 11 Jul 2015 19:33:16 +0000 (20:33 +0100)]
docs: Add sha256 checksums for the 10.6.2 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 89cbd91b17989ec7eb1cb93ac427a84dca56cd79)

9 years agoAdd release notes for the 10.6.2 release
Emil Velikov [Sat, 11 Jul 2015 18:46:49 +0000 (19:46 +0100)]
Add release notes for the 10.6.2 release

Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
(cherry picked from commit 9643cce94c8a1938e3342fb83d025a1e5c2aa79b)

9 years agotgsi: add DFMA to the opcode infer functions.
Dave Airlie [Wed, 1 Jul 2015 05:31:13 +0000 (06:31 +0100)]
tgsi: add DFMA to the opcode infer functions.

Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agor600g: move sampler/ubo index registers before temp reg
Dave Airlie [Thu, 9 Jul 2015 05:49:56 +0000 (15:49 +1000)]
r600g: move sampler/ubo index registers before temp reg

temp_reg needs to be last, as we increment things
away from it, otherwise on cayman some tests were overwriting
the index regs.

Fixes 2 piglit with ARB_gpu_shader5 forced on cayman.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agor600g: fix sampler/ubo indexing on cayman
Dave Airlie [Thu, 9 Jul 2015 05:22:09 +0000 (15:22 +1000)]
r600g: fix sampler/ubo indexing on cayman

Cayman needs a different method to upload the CF IDX0/1

This fixes 31 piglits when ARB_gpu_shader5 is forced on
with cayman.

Reviewed-by: Glenn Kennard <glenn.kennard@gmail.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
9 years agonv50, nvc0: enable at least one color RT if alphatest is enabled
Ilia Mirkin [Fri, 10 Jul 2015 20:42:18 +0000 (16:42 -0400)]
nv50, nvc0: enable at least one color RT if alphatest is enabled

Fixes the following piglits:
  fbo-alphatest-nocolor
  fbo-alphatest-nocolor-ff

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: mesa-stable@lists.freedesktop.org
9 years agoi965: Remove special case for layered drawbuffer attachments.
Kenneth Graunke [Thu, 25 Jun 2015 17:08:06 +0000 (10:08 -0700)]
i965: Remove special case for layered drawbuffer attachments.

When binding a layered texture, the layer is already 0.  There's no need
to special case this.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
9 years agoi965/gen6: Set up layer constraints properly for depth buffers.
Kenneth Graunke [Thu, 25 Jun 2015 16:17:38 +0000 (09:17 -0700)]
i965/gen6: Set up layer constraints properly for depth buffers.

This ports over Chris Forbes' equivalent fixes in gen7_misc_state.c
from commit 77d55ef4819436ebbf9786a1e720ec00707bbb19.

No Piglit changes on Sandybridge.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Label the repclear shader "meta repclear" rather than "meta clear".
Kenneth Graunke [Thu, 23 Apr 2015 00:46:08 +0000 (17:46 -0700)]
i965: Label the repclear shader "meta repclear" rather than "meta clear".

Color clears can be performed via two separate shaders - one is the
generic "meta clear" shader (in meta.c); the other is the i965 specific
"repclear" shader (in brw_meta_fast_clear.c).

Giving them separate names makes them distinguishable when reading
INTEL_DEBUG=shader_time output.

v2: Call it "meta repclear", as suggested by Jason.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
9 years agoi965: Fix indentation in emit_control_data_bits().
Kenneth Graunke [Thu, 2 Jul 2015 00:01:54 +0000 (17:01 -0700)]
i965: Fix indentation in emit_control_data_bits().

The last patch left the code indented too far.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoi965/gs: Move vertex_count != 0 check up a level; skip one caller.
Kenneth Graunke [Thu, 2 Jul 2015 00:01:24 +0000 (17:01 -0700)]
i965/gs: Move vertex_count != 0 check up a level; skip one caller.

Paul's original code had emit_control_data_bits() skip the URB write if
vertex_count was 0.  This meant wrapping every control data write in a
conditional write.

We accumulate control data bits in a single UD (32-bit) register.  For
simple shaders that don't emit many vertices, the control data header
will be <= 32-bits long, so we only need to write it once at the end of
the shader.

For shaders with larger headers, we write out batches of control data
bits at EmitVertex(), when (vertex_count * bits_per_vertex) % 32 == 0.
On the first EmitVertex() call, the above expression will evaluate to
true simply because vertex_count == 0.  But we want to avoid emitting
the control data bits, because we haven't accumulated 32-bits worth yet.

In other words, the vertex_count != 0 check is really only necessary in
the EmitVertex() batching case, not the end-of-thread case.

This saves a CMP/IF/ENDIF in every shader that uses EndPrimitive() or
multiple streams.  The only downside is that a shader which emits no
vertices at all will execute an additional URB write---but such shaders
are pointless and not worth optimizing.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Matt Turner <mattst88@gmail.com>
9 years agoglsl: use set rather than old hash table for ir_validate
Timothy Arceri [Wed, 8 Jul 2015 11:26:02 +0000 (21:26 +1000)]
glsl: use set rather than old hash table for ir_validate

When the new hash table implementation was added to Mesa it claimed to be much
faster, see commits 35fd61bd99c1 and 72e55bb6888ff.

The set implementation follows the same implementation strategy so this should
be faster and there was no need to store a data field.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agomesa: Fix generation of git_sha1.h.tmp for gitlinks
Chad Versace [Fri, 10 Jul 2015 01:46:21 +0000 (18:46 -0700)]
mesa: Fix generation of git_sha1.h.tmp for gitlinks

Don't assume that $(top_srcdir)/.git is a directory. It may be a
gitlink file [1] if $(top_srcdir) is a submodule checkout or a linked
worktree [2].

[1] A "gitlink" is a text file that specifies the real location of
    the gitdir.
[2] Linked worktrees are a new feature in Git 2.5.

Cc: "10.6, 10.5" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agofreedreno/a4xx: occlusion query support
Rob Clark [Thu, 2 Jul 2015 22:07:27 +0000 (18:07 -0400)]
freedreno/a4xx: occlusion query support

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: update generated headers
Rob Clark [Thu, 9 Jul 2015 22:14:36 +0000 (18:14 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3/sched: fixup new instr's block
Rob Clark [Mon, 6 Jul 2015 00:17:56 +0000 (20:17 -0400)]
freedreno/ir3/sched: fixup new instr's block

If we split addr/pred, the original instruction could have originated
from a different block.  If we don't fixup the block ptr we hit asserts
later (in debug builds).

NOTE: perhaps we don't want to try to preserve addr/pred reg's across
block boundaries.. this at least needs some thought in case addr/pred
writes end up inside a conditional block..

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3/ra: fix failed assert for a0/p0
Rob Clark [Sun, 5 Jul 2015 23:53:10 +0000 (19:53 -0400)]
freedreno/ir3/ra: fix failed assert for a0/p0

The address and predicate register are special, they don't get assigned
in RA.  So do a better job of ignoring them rather than hitting later
asserts.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno/ir3: shader-db traces
Rob Clark [Sun, 5 Jul 2015 22:23:25 +0000 (18:23 -0400)]
freedreno/ir3: shader-db traces

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agofreedreno: fix crash in fd_invalidate_resource()
Rob Clark [Thu, 2 Jul 2015 22:15:43 +0000 (18:15 -0400)]
freedreno: fix crash in fd_invalidate_resource()

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agovc4: unref old fence
Rob Clark [Wed, 8 Jul 2015 18:51:46 +0000 (14:51 -0400)]
vc4: unref old fence

Some, but not all, state trackers will explicitly unref (and set to
NULL) the previous *fence before calling pipe->flush().  So driver
should use fence_ref() which will unref the old fence if not NULL.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Acked-by: Eric Anholt <eric@anholt.net>
9 years agoilo: unref old fence
Rob Clark [Wed, 8 Jul 2015 18:51:10 +0000 (14:51 -0400)]
ilo: unref old fence

Some, but not all, state trackers will explicitly unref (and set to
NULL) the previous *fence before calling pipe->flush().  So driver
should use fence_ref() which will unref the old fence if not NULL.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
9 years agofreedreno: unref old fence
Rob Clark [Wed, 8 Jul 2015 18:48:01 +0000 (14:48 -0400)]
freedreno: unref old fence

Some, but not all, state trackers will explicitly unref (and set to
NULL) the previous *fence before calling pipe->flush().  So driver
should use fence_ref() which will unref the old fence if not NULL.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agogallium: clarify reference counting for fence
Rob Clark [Wed, 8 Jul 2015 19:00:51 +0000 (15:00 -0400)]
gallium: clarify reference counting for fence

Nowhere was it spelled out that the state tracker may expect the pipe
driver to unref the old fence.

Signed-off-by: Rob Clark <robclark@freedesktop.org>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
9 years agoxa: don't leak fences
Rob Clark [Wed, 8 Jul 2015 17:30:22 +0000 (13:30 -0400)]
xa: don't leak fences

XA was never unref'ing last_fence in the various call paths to
pipe->flush().  Add this to xa_context_flush() and update the other
open-coded calls to pipe->flush() to use xa_context_flush() instead.

This fixes a memory leak reported with xf86-video-freedreno.

Reported-by: Nicolas Dechesne <nicolas.dechesne@linaro.org>
Cc: "10.5 10.6" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Rob Clark <robclark@freedesktop.org>
9 years agoi965/vs: Get rid of brw_vs_compile completely.
Kenneth Graunke [Mon, 29 Jun 2015 04:16:29 +0000 (21:16 -0700)]
i965/vs: Get rid of brw_vs_compile completely.

After tearing it out another level or two, and just passing the key and
vp directly, we can finally remove this struct.  It also eliminates a
pointless memcpy() of the key.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vs: Remove 'c'/vs_compile from vec4_vs_visitor.
Kenneth Graunke [Tue, 30 Jun 2015 05:07:37 +0000 (22:07 -0700)]
i965/vs: Remove 'c'/vs_compile from vec4_vs_visitor.

At this point, the brw_vs_compile structure only contains the key and
gl_vertex_program pointer.  We may as well pass and store them directly;
it's simpler and more convenient (key-> instead of vs_compile->key...).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Move c->last_scratch into vec4_visitor.
Kenneth Graunke [Mon, 29 Jun 2015 04:02:15 +0000 (21:02 -0700)]
i965/vec4: Move c->last_scratch into vec4_visitor.

Nothing outside of vec4_visitor uses it, so we may as well keep it
internal.

Commit db9c915abcc5ad78d2d11d0e732f04cc94631350 for the vec4 backend.

(The empty class will be going away soon.)

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Move total_scratch calculation into the visitor.
Kenneth Graunke [Mon, 29 Jun 2015 03:55:25 +0000 (20:55 -0700)]
i965/vec4: Move total_scratch calculation into the visitor.

This is more consistent with how we do it in the FS backend, and reduces
a tiny bit of duplication.  It'll also allow for a bit more tidying.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Move perf_debug about register spilling into the visitor.
Kenneth Graunke [Mon, 29 Jun 2015 03:45:47 +0000 (20:45 -0700)]
i965/vec4: Move perf_debug about register spilling into the visitor.

This patch makes us only issue the performance warning about register
spilling if we actually spilled registers.  We also use scratch space
for indirect addressing and the like.

This is basically commit c51163b0cf7aff0375b1a5ea4cb3da9d9e164044 for
the vec4 backend.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965/vec4: Plumb log_data through so the backend_shader field gets set.
Kenneth Graunke [Tue, 30 Jun 2015 04:58:47 +0000 (21:58 -0700)]
i965/vec4: Plumb log_data through so the backend_shader field gets set.

Jason plumbed this through a while back in the FS backend, but
apparently we were just passing NULL in the vec4 backend.

This patch passes brw in as intended.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
9 years agoi965: Switch on shader stage in nir_setup_outputs().
Kenneth Graunke [Thu, 12 Mar 2015 17:43:23 +0000 (10:43 -0700)]
i965: Switch on shader stage in nir_setup_outputs().

Adding new shader stages to a switch statement is less confusing than an
if-else-if ladder where all but the first case are fragment shader
specific (but don't claim to be).

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
9 years agotgsi: whitespace fixes in tgsi_parse.c
Brian Paul [Thu, 9 Jul 2015 22:58:04 +0000 (16:58 -0600)]
tgsi: whitespace fixes in tgsi_parse.c

Trivial.

9 years agogallium: fix comment typo in p_shader_tokens.h
Brian Paul [Thu, 9 Jul 2015 00:05:27 +0000 (18:05 -0600)]
gallium: fix comment typo in p_shader_tokens.h

9 years agogallium/docs: s/treaded/treated/ typo in tgsi.rst
Brian Paul [Wed, 8 Jul 2015 21:56:15 +0000 (15:56 -0600)]
gallium/docs: s/treaded/treated/ typo in tgsi.rst

Trivial.

9 years agoutil: Don't link to SHA1 library if shader-cache is disabled.
Matt Turner [Wed, 8 Jul 2015 06:33:57 +0000 (23:33 -0700)]
util: Don't link to SHA1 library if shader-cache is disabled.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agoi965: Set brw->batch.emit only #ifdef DEBUG.
Matt Turner [Wed, 8 Jul 2015 01:51:30 +0000 (18:51 -0700)]
i965: Set brw->batch.emit only #ifdef DEBUG.

It's only used inside #ifdef DEBUG. Cuts ~1.7k of .text, and more
importantly prevents a larger code size regression in the next commit
when the .used field is replaced and calculated on demand.

   text     data      bss      dec      hex  filename
4945468   195152    26192  5166812   4ed6dc  i965_dri.so before
4943740   195152    26192  5165084   4ed01c  i965_dri.so after

And surround the emit and total fields with #ifdef DEBUG to prevent
such mistakes from happening again.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
9 years agoi965/hsw: Implement end of batch workaround
Ben Widawsky [Thu, 9 Jul 2015 17:35:19 +0000 (10:35 -0700)]
i965/hsw: Implement end of batch workaround

This patch can cause an infinite recursion if the previous patch titled, "i965:
Track finished batch state" isn't present (backporters take notice).

v2: Sent out the wrong patch originally. This patches switches the order of
flushes, doing the generic flush before the CC_STATE, and the required
workaround flush afterwards

v3: Only perform workaround for render ring
Add text to the BATCH_RESERVE comments

v4 (By Ken): Rebase; update citation to mention PRM and Wa name; combine two
blocks.

http://otc-mesa-ci.jf.intel.com/job/bwidawsk/171/

Signed-off-by: Ben Widawsky <ben@bwidawsk.net>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
9 years agost/vdpau: fix mixer size checks
Christian König [Mon, 29 Jun 2015 08:19:36 +0000 (10:19 +0200)]
st/vdpau: fix mixer size checks

We need to check what the 3D pipe is able to handle for the mixer, not what
the decoder is able to decode. This fixes output of resolutions like 720x1280.

Signed-off-by: Christian König <christian.koenig@amd.com>
CC: mesa-stable@lists.freedesktop.org
9 years agovl: cleanup video buffer private when the decoder is destroyed
Christian König [Fri, 29 May 2015 13:10:31 +0000 (15:10 +0200)]
vl: cleanup video buffer private when the decoder is destroyed

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=90728
Signed-off-by: Christian König <christian.koenig@amd.com>
CC: mesa-stable@lists.freedesktop.org
9 years agonv50: avoid segfault with enabled but unbound vertex attrib
Samuel Pitoiset [Mon, 6 Jul 2015 21:34:23 +0000 (23:34 +0200)]
nv50: avoid segfault with enabled but unbound vertex attrib

Before validating vertex arrays we need to check if a VBO is present.
Checking if vb->buffer is not NULL fixes the issue.

Fixes the following piglit test:
  gl-3.1-vao-broken-attrib

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonvc0: fix wrong use of BLIT_SRC_Y_INT for 2D texture copy
Samuel Pitoiset [Mon, 6 Jul 2015 20:06:08 +0000 (22:06 +0200)]
nvc0: fix wrong use of BLIT_SRC_Y_INT for 2D texture copy

According to nv50, this should be src->ms_y instead of src->ms_x. This
code is here since 2012, so it's probably a typo error which has never
been detected since a long time. I didn't do a full piglit run to check
if it fixes some other weird issues.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
9 years agonir: Fix comment above nir_convert_from_ssa() prototype.
Kenneth Graunke [Wed, 8 Jul 2015 08:57:00 +0000 (01:57 -0700)]
nir: Fix comment above nir_convert_from_ssa() prototype.

Connor renamed the parameter, inverting the sense.
Update the comment accordingly.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
9 years agoegl/dri2: load libglapi.0.dylib on osx
Julien Isorce [Thu, 18 Jun 2015 05:53:52 +0000 (06:53 +0100)]
egl/dri2: load libglapi.0.dylib on osx

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=90903
Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agoegl: use unix defines on osx with clang
Julien Isorce [Thu, 2 Jul 2015 22:10:38 +0000 (23:10 +0100)]
egl: use unix defines on osx with clang

I also created an bug in Khronos 's bugzilla as you suggested:
https://www.khronos.org/bugzilla/show_bug.cgi?id=1356
I'll let you know if I get feedback from this bug or else where.

Patch with updated error messages:

[PATCH] eglplatform: treat __APPLE__ the same way as __unix__ to handle X11 types

  CC       eglapi.lo
./egldisplay.h:258:19: error: unknown type name 'Display'
_eglGetX11Display(Display *native_display, const EGLint *attrib_list);
eglapi.c:290:4: error: array size is negative
   STATIC_ASSERT(sizeof(void*) == sizeof(nativeDisplay));
eglapi.c:291:25: warning: cast to 'void *' from smaller integer type
   'EGLNativeDisplayType' (aka 'int') [-Wint-to-void-pointer-cast]
   native_display_ptr = (void*) nativeDisplay;
eglapi.c:307:32: error: use of undeclared identifier 'Display'
      dpy = _eglGetX11Display((Display*) native_display, attrib_list);
eglapi.c:776:35: error: use of undeclared identifier 'Window'
      native_window = (void*) (* (Window*) native_window);
eglapi.c:847:35: error: use of undeclared identifier 'Pixmap'
      native_pixmap = (void*) (* (Pixmap*) native_pixmap);

Bugzilla Mesa: https://bugs.freedesktop.org/show_bug.cgi?id=90249
Bugzilla Khronos: https://www.khronos.org/bugzilla/show_bug.cgi?id=1356
Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
9 years agodarwin: Suppress type conversion warnings for GLhandleARB
Julien Isorce [Tue, 30 Jun 2015 23:33:14 +0000 (00:33 +0100)]
darwin: Suppress type conversion warnings for GLhandleARB

This patch and its description are inspired from Jose Fonseca
explanations and suggestions.

With this patch the following logic applies and only if __APPLE__:

When building mesa, GLhandleARB is defined as unsigned long and
at some point casted to GLuint in gl fuction implementations.
These exact points are where these errors and warnings appear.

When building an application GLhandleARB is defined as void*.
Later when calling a gl function, for example glBindAttribLocationARB,
it will be dispatched to _mesa_BindAttribLocation. So internally
void* will be treated as unsigned long which has the same size.
So the same truncation happens when casting it to GLuint.

Same when GLhandleARB appears as return value.
For mesa it will be GLuint -> unsigned long.
For an application it will be GLuint -> unsigned long -> void*.
Note that the value will be preserved when casting back to GLuint.

When GLhandleARB appears as a pointer there are also separate
entry-points, i.e. _mesa_FuncNameARB. So the same logic can
be applied.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=66346
Signed-off-by: Julien Isorce <julien.isorce@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>