mesa.git
8 years agomesa: use native types when possible
Emil Velikov [Tue, 7 Jun 2016 16:33:40 +0000 (17:33 +0100)]
mesa: use native types when possible

All of the functions and related data is internal, so there's no point
if using the GL types.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: make _mesa_map_function_spec() static
Emil Velikov [Tue, 7 Jun 2016 16:33:39 +0000 (17:33 +0100)]
mesa: make _mesa_map_function_spec() static

Used only locally.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: remove used _mesa_get_function_spec() and gl_function_remap
Emil Velikov [Tue, 7 Jun 2016 16:33:38 +0000 (17:33 +0100)]
mesa: remove used _mesa_get_function_spec() and gl_function_remap

Final user was killed with last commit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: remove unused _mesa_map_function_array()
Emil Velikov [Tue, 7 Jun 2016 16:33:37 +0000 (17:33 +0100)]
mesa: remove unused _mesa_map_function_array()

Unused as of commit 5a175127f38 ("dri: Remove all extension enabling
utility functions") and the patch before the previous patch.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agoglapi: remap_helper.py: remove MESA_alt_functions
Emil Velikov [Tue, 7 Jun 2016 16:33:36 +0000 (17:33 +0100)]
glapi: remap_helper.py: remove MESA_alt_functions

The final user was nuked with last commit.

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agomesa: remove unused function _mesa_map_static_functions()
Emil Velikov [Tue, 7 Jun 2016 16:33:35 +0000 (17:33 +0100)]
mesa: remove unused function _mesa_map_static_functions()

Unused as of commit 5a175127f38 ("dri: Remove all extension enabling
utility functions")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
8 years agodri/common: remove unused libdri_test_stubs.la
Emil Velikov [Tue, 7 Jun 2016 16:33:34 +0000 (17:33 +0100)]
dri/common: remove unused libdri_test_stubs.la

... and associated file(s).

No longer needed since commit 057259655e7 ("i965: Don't link libmesa or
libdri_test_stubs into tests")

Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
8 years agoswr: automake: add missing -I flag
Emil Velikov [Fri, 10 Jun 2016 19:45:01 +0000 (20:45 +0100)]
swr: automake: add missing -I flag

When building from a release tarball (where the generated/built files
are in srcdir) in an OOT fashion we need to have both builddir and
srcdir in the includes list.

Otherwise we'll error out, as the file (header gen_knobs.h in this case)
won't be in the location where we are looking.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: add SWR to `make distcheck' gallium drivers
Emil Velikov [Fri, 10 Jun 2016 17:47:32 +0000 (18:47 +0100)]
automake: add SWR to `make distcheck' gallium drivers

Will allows us to catch missing files and build issues before getting
the tarball out for general consumption.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoconfigure.ac: strip out the llvm-config -march/mtune flags
Emil Velikov [Fri, 10 Jun 2016 16:46:24 +0000 (17:46 +0100)]
configure.ac: strip out the llvm-config -march/mtune flags

Otherwise drivers such as SWR that depend on providing their own values
will fail to build.

v2: Add -mcpu for good measure (Chuck)

Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
Cc: Tim Rowley <timothy.o.rowley@intel.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Chuck Atkins <chuck.atkins@kitware.com>
Tested-by: Chuck Atkins <chuck.atkins@kitware.com>
8 years agoswr: Add missing headers for package inclusion
Chuck Atkins [Fri, 10 Jun 2016 14:44:28 +0000 (10:44 -0400)]
swr: Add missing headers for package inclusion

CC: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
8 years agoautomake: get in-tree `make distclean' working again.
Emil Velikov [Wed, 8 Jun 2016 14:36:18 +0000 (15:36 +0100)]
automake: get in-tree `make distclean' working again.

With earlier commit we've handled the `make distclean' out of tree
build, yet we failed to attribute that for in-tree builds the test
condition will return 1. Thus effectively the target will be considered
as "failed".

Fixes: b7f7ec78435 ("mesa: automake: distclean git_sha1.h when building
OOT")
Cc: <mesa-stable@lists.freedesktop.org>
Tested-by: Andy Furniss <adf.lists@gmail.com>
Reported-by: Andy Furniss <adf.lists@gmail.com>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
8 years agogallivm: Fix trivial sign warnings
Jan Vesely [Fri, 3 Jun 2016 00:03:14 +0000 (20:03 -0400)]
gallivm: Fix trivial sign warnings

v2: include whitespace fixes

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
8 years agost/va: use proper temp pipe_video_buffer template
Julien Isorce [Thu, 2 Jun 2016 14:03:34 +0000 (15:03 +0100)]
st/va: use proper temp pipe_video_buffer template

Instead of changing the format on the existing template
which makes error handling not nice and confuses coverity.

CoverityID: 1337953

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agost/va: it is valid to release the VABuffer of an exported resource
Julien Isorce [Thu, 2 Jun 2016 14:03:01 +0000 (15:03 +0100)]
st/va: it is valid to release the VABuffer of an exported resource

pipe_resource_reference(&res, NULL) will decrement reference counting,
i.e. p_atomic_dec(res->count). But the va surface still has the initial
reference since it has created the resource. So calling vaDestroyImage
on a derived image calls VaDestroyBuffer but the decrementation won't
reach 0. It is just wrong for vlVaDestroyBuffer to rely on the
export_refcount flag. Finally the vaapi intel driver has the same logic.

Signed-off-by: Julien Isorce <j.isorce@samsung.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoglsl: fix component overlap validation for doubles
Timothy Arceri [Fri, 10 Jun 2016 05:12:34 +0000 (15:12 +1000)]
glsl: fix component overlap validation for doubles

This change makes sure to remove arrays when checking if type
is a double.

The check for the end of the first slot of a multi-slot double
is also fixed by bumping the check to 4 rather than 3.
Previously we were we not reserving the last component.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoglsl: fix max varyings count for ARB_enhanced_layouts
Timothy Arceri [Thu, 9 Jun 2016 03:43:23 +0000 (13:43 +1000)]
glsl: fix max varyings count for ARB_enhanced_layouts

Since this extension allows more than one varying to share a single
location we can't just count the number of slots a varying takes and
add it to the total.

Instead we now reuse the reserved varyings bitfield to determine how
many slots are reserved for explicit locations instead.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
8 years agoi965: Use the correct number of threads for compute shaders.
Kenneth Graunke [Tue, 7 Jun 2016 04:37:34 +0000 (21:37 -0700)]
i965: Use the correct number of threads for compute shaders.

We were programming the number of threads per subslice, when we should
have been programming the total number of threads on the GPU as a whole.

Thanks to Curro and Jordan for helping track this down!

On Skylake GT3e:
- Improves performance in Unreal's Elemental Demo by roughly 1.5-1.7x.
- Improves performance in Synmark's Gl43CSDof by roughly 3.7x.
- Improves performance in Synmark's Gl43GSCloth by roughly 1.18x.

On Broadwell GT2:
- Improves performance in Unreal's Elemental Demo by roughly 1.2-1.5x.
- Improves performance in Synmark's Gl43CSDof by roughly 2.0x.
- Improves performance in Synmark's Gl43GSCloth by 1.47035% +/-
  0.255654% (n=25).

On Haswell GT3e:
- Improves performance in Unreal's Elemental Demo (in GL 4.3 mode)
  by roughly 1.10x.
- Improves performance in Synmark's Gl43CSDof by roughly 1.18x.
- Decreases performance in Synmark's Gl43CSCloth by -1.99484% +/-
  0.432771% (n=64).

On Ivybridge GT2:
- Improves performance in Unreal's Elemental Demo (in GL 4.2 mode)
  by roughly 1.03x.
- Improves performance in Synmark's G/43CSDof by roughly 1.25x.
- No change in Synmark's Gl43CSCloth (n=28).

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Assert that the scratch spaces are in range.
Kenneth Graunke [Fri, 10 Jun 2016 01:13:26 +0000 (18:13 -0700)]
i965: Assert that the scratch spaces are in range.

I don't know that anything actually guarantees this, but if we exceed
the limits, we may end up overflowing and trashing random buffers that
happen to be nearby in the VMA space, leading to rendering corruption,
hangs, or worse.

We should really fix this properly.  However, the pitfall has existed
for ages, so for now we should at least detect it.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Fix CS scratch size calculations on Ivybridge and Baytrail.
Kenneth Graunke [Fri, 10 Jun 2016 00:30:40 +0000 (17:30 -0700)]
i965: Fix CS scratch size calculations on Ivybridge and Baytrail.

These are linear, not powers of two, and much more limited.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Fix Haswell CS per-thread scratch space encoding.
Kenneth Graunke [Thu, 9 Jun 2016 23:56:31 +0000 (16:56 -0700)]
i965: Fix Haswell CS per-thread scratch space encoding.

Most scratch stages use power of two sizes, in kilobytes, where
0 means 1kB.  But compute shaders on Haswell have a minimum of 2kB,
and use a representation where 0 = 2kB.

This meant that we were effectively telling the hardware to allocate
each thread twice as much space as we meant to, while simultaneously
not allocating that much space in the buffer, leading to overflows.

Note that the existing code is completely wrong for Ivybridge,
but that will take additional work to sort out, so I've left it
as is for now.  A subsequent commit will take care of that.

Together with the previous patches, this fixes rendering corruption
on Synmark's Gl43CSDof on Haswell.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Account for poor address calculations in Haswell CS scratch size.
Kenneth Graunke [Thu, 9 Jun 2016 23:11:46 +0000 (16:11 -0700)]
i965: Account for poor address calculations in Haswell CS scratch size.

Curro figured this out by investigating the simulator.  Apparently
there's also a workaround in the Windows driver.  I'm not sure it's
actually documented anywhere.

We were underallocating the scratch buffer by a factor of 128/70.

v2: Rename threads_per_subslice to scratch_ids_per_subslice
    (suggested by Jordan Justen).

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Allocate scratch space for the maximum number of compute threads.
Kenneth Graunke [Tue, 7 Jun 2016 04:37:34 +0000 (21:37 -0700)]
i965: Allocate scratch space for the maximum number of compute threads.

We were allocating enough space for the number of threads per subslice,
when we should have been allocating space for the number of threads in
the entire GPU.

Even though we currently run with a reduced thread count (due to a bug),
we might still overflow the scratch buffer because the address
calculation is based on the FFTID, which can depend on exactly which
threads, EUs, and threads are executing.  We need to allocate enough
for every possible thread that could run.

Fixes rendering corruption in Synmark's Gl43CSDof on Gen8+.
Earlier platforms need additional bug fixes.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Set subslice_total on Gen7/7.5 platforms.
Kenneth Graunke [Thu, 9 Jun 2016 06:36:16 +0000 (23:36 -0700)]
i965: Set subslice_total on Gen7/7.5 platforms.

We'll use this for compute shader thread counts and scratch space
calculations shortly.

Note that subslices are referred to as "half slices" on Ivybridge.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agoi965: Fix shared local memory size for Gen9+.
Kenneth Graunke [Thu, 9 Jun 2016 05:21:22 +0000 (22:21 -0700)]
i965: Fix shared local memory size for Gen9+.

Skylake changes the representation of shared local memory size:

 Size   | 0 kB | 1 kB | 2 kB | 4 kB | 8 kB | 16 kB | 32 kB | 64 kB |
 -------------------------------------------------------------------
 Gen7-8 |    0 | none | none |    1 |    2 |     4 |     8 |    16 |
 -------------------------------------------------------------------
 Gen9+  |    0 |    1 |    2 |    3 |    4 |     5 |     6 |     7 |

The old formula would substantially underallocate the amount of space.
This fixes GPU hangs on Skylake when running with full thread counts.

v2: Fix the Vulkan driver too, use a helper function, and fix the table
    in the comments and commit message.

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
8 years agonv50: reinstate dedicated constbuf push path
Ilia Mirkin [Sun, 5 Jun 2016 23:02:29 +0000 (19:02 -0400)]
nv50: reinstate dedicated constbuf push path

This was disabled due to occasionally incorrect behavior when trying to
upload data. It later became apparent that nvc0 also had a similar but
slightly different issue, which was resolved in commit e50c01d5. This
takes the same logic as nvc0 and applies it to nv50 (which has somewhat
different interfaces).

Unfortunately I did not note down precisely what was broken with UBOs
when removing the support from nv50, but I've tested a bunch of local
traces, and none of them appear to regress. This should hopefully
improve performance when UBOs are used, but this was not directly
verified.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
8 years agonv50: enable indirect addressing of fragment shader inputs
Ilia Mirkin [Sat, 11 Jun 2016 15:50:15 +0000 (11:50 -0400)]
nv50: enable indirect addressing of fragment shader inputs

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agomesa: add drawbuffer argument to ClearNamedFramebufferfi
Ilia Mirkin [Fri, 10 Jun 2016 03:45:22 +0000 (23:45 -0400)]
mesa: add drawbuffer argument to ClearNamedFramebufferfi

This was fixed in revision 47 of the ARB_dsa spec in Oct 22, 2015. Since
it's horrible to have differing APIs across library versions, we should
attempt to minimize the impact by backporting it as far as possible and
hope no one notices.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agoGL: update glcorearb.h to svn 32433
Ilia Mirkin [Fri, 10 Jun 2016 04:43:13 +0000 (00:43 -0400)]
GL: update glcorearb.h to svn 32433

This brings in the fixed glClearNamedFramebufferfi definition, as well
as a lot of GLsizei -> GLsizeiptr changes.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agoGL: update glext to svn 32957
Ilia Mirkin [Fri, 10 Jun 2016 02:55:18 +0000 (22:55 -0400)]
GL: update glext to svn 32957

This brings in defines from GL_EXT_window_rectangles and fixes the
glClearNamedFramebufferfi definition.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Cc: "11.2 12.0" <mesa-stable@lists.freedesktop.org>
8 years agodocs: GL_ARB_copy_image done for softpipe, llvmpipe
Brian Paul [Fri, 10 Jun 2016 21:50:51 +0000 (15:50 -0600)]
docs: GL_ARB_copy_image done for softpipe, llvmpipe

Signed-off-by: Brian Paul <brianp@vmware.com>
8 years agollvmpipe: turn on pipe cap for GL_ARB_copy_image support
Brian Paul [Fri, 3 Jun 2016 20:55:47 +0000 (14:55 -0600)]
llvmpipe: turn on pipe cap for GL_ARB_copy_image support

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agollvmpipe: don't use 3-component formats, except 32-bit x 3 formats
Brian Paul [Fri, 3 Jun 2016 21:06:28 +0000 (15:06 -0600)]
llvmpipe: don't use 3-component formats, except 32-bit x 3 formats

This basically disallows all 8-bit x 3 and 16-bit x 3 formats for
textures and render targets.  Some 3-component formats were already
disallowed before.  This avoids problems with GL_ARB_copy_image.

v2: the previous version of this patch disallowed all 3-component formats

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agosoftpipe: turn on pipe cap for GL_ARB_copy_image support
Brian Paul [Fri, 3 Jun 2016 20:55:06 +0000 (14:55 -0600)]
softpipe: turn on pipe cap for GL_ARB_copy_image support

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agosoftpipe: don't use 3-component formats
Brian Paul [Tue, 28 Jul 2015 21:59:36 +0000 (15:59 -0600)]
softpipe: don't use 3-component formats

Mesa and gallium don't have a complete set of matching 3-component
texture formats.  For example, 8-bit sRGB unorm.  To fully support
the GL_ARB_copy_image extension we need to have support for all of
these formats: RGB8_UNORM, RGB8_SNORM, RGB8_SRGB, RGB8_UINT, and
RGB8_SINT using the same component order.  Since we don't have that,
disable the 3-component formats for now.

v2: Simplify 3-component format check, per Marek.
Also check that target != PIPE_BUFFER.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agost/mesa: tweak surface format mapping table
Brian Paul [Tue, 28 Jul 2015 21:57:23 +0000 (15:57 -0600)]
st/mesa: tweak surface format mapping table

1. Try to choose R8G8B8A8 unorm/srgb formats before others in an
effort to try to match component ordering for UINT/SINT/etc.

2. If we can't get a format such as PIPE_FORMAT_A16_UNORM, try
PIPE_FORMAT_R16G16B16A16_UNORM before shallower formats.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agoutil: update util_resource_copy_region() for GL_ARB_copy_image
Brian Paul [Fri, 3 Jun 2016 20:52:27 +0000 (14:52 -0600)]
util: update util_resource_copy_region() for GL_ARB_copy_image

This primarily means added support for copying between compressed
and uncompressed formats.

Reviewed-by: Charmaine Lee <charmainel@vmware.com>
8 years agogallium: Fix region overlap conditions for rectangles with a shared edge
Anuj Phogat [Fri, 11 Dec 2015 22:41:31 +0000 (14:41 -0800)]
gallium: Fix region overlap conditions for rectangles with a shared edge

>From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels":
"The pixels corresponding to these buffers are copied from the source
rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1)
to the destination rectangle bounded by the locations (dstX0, dstY 0)
and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive,
while the upper bounds are exclusive."

So, the rectangles sharing just an edge shouldn't overlap.
 -----------
|           |
 ------- ---
|       |   |
|       |   |
 ------- ---

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agomesa: Fix region overlap conditions for rectangles with a shared edge
Anuj Phogat [Fri, 11 Dec 2015 22:41:30 +0000 (14:41 -0800)]
mesa: Fix region overlap conditions for rectangles with a shared edge

>From OpenGL 4.0 spec, section 4.3.2 "Copying Pixels":
"The pixels corresponding to these buffers are copied from the source
 rectangle bounded by the locations (srcX0, srcY 0) and (srcX1, srcY 1)
 to the destination rectangle bounded by the locations (dstX0, dstY 0)
 and (dstX1, dstY 1). The lower bounds of the rectangle are inclusive,
 while the upper bounds are exclusive."

So, the rectangles sharing just an edge shouldn't overlap.
     -----------
    |           |
     ------- ---
    |       |   |
    |       |   |
     ------- ---

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallivm: more 64-bit integer prep work.
Dave Airlie [Fri, 10 Jun 2016 01:25:29 +0000 (11:25 +1000)]
gallivm: more 64-bit integer prep work.

This converts one other place to using the new helper.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoradeonsi: convert to 64-bitness checks instead of doubles.
Dave Airlie [Fri, 10 Jun 2016 01:05:51 +0000 (11:05 +1000)]
radeonsi: convert to 64-bitness checks instead of doubles.

This converts to testing for 64-bit types and renames some things
in anticipation of 64-bit integer support.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogallivm: make non-float return code bitcast consistent.
Dave Airlie [Fri, 10 Jun 2016 00:55:59 +0000 (10:55 +1000)]
gallivm: make non-float return code bitcast consistent.

This just uses the same form across the fetches.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogallium/gallivm: use 64-bit test instead of doubles.
Dave Airlie [Fri, 10 Jun 2016 00:49:25 +0000 (10:49 +1000)]
gallium/gallivm: use 64-bit test instead of doubles.

This just makes some generic code that currently emits double
suitable for emitting 64-bit values.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agogallium/tgsi: add 64-bitness type check function.
Dave Airlie [Fri, 10 Jun 2016 00:48:35 +0000 (10:48 +1000)]
gallium/tgsi: add 64-bitness type check function.

Currently this just doubles, but we'll convert users to this
so making adding 64-bit integers easier.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoanv/entrypoints: Rework #if guards
Jason Ekstrand [Fri, 10 Jun 2016 19:42:52 +0000 (12:42 -0700)]
anv/entrypoints: Rework #if guards

This reworks the #if guards a bit.  When Emil originally wrote them, he
just guarded everything.  However, part of what anv_entrypoints_gen.py
generates is a hash table for looking up entrypoints based on their name.
This table *cannot* get out of sync between C and python regardless of
preprocessor flags.  In order to prevent this, this commit makes us use
void pointers in the dispatch table for those entrypoints which aren't
available.  This means that the dispatch table size and entry order is
constant and it should never get out-of-sync with the python.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/entrypoints: Use the function pointer types provided by vulkan.h
Jason Ekstrand [Fri, 10 Jun 2016 19:30:05 +0000 (12:30 -0700)]
anv/entrypoints: Use the function pointer types provided by vulkan.h

This is a bit cleaner than generating the types ourselves when making the
table.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agost/mesa: use base level size as "guess" when available
Nicolai Hähnle [Mon, 6 Jun 2016 21:15:10 +0000 (23:15 +0200)]
st/mesa: use base level size as "guess" when available

When an applications specifies mip levels _before_ setting a mipmap texture
filter, we will initially guess a single texture level. When the second level
image is created, we try to allocate the full texture -- however, we get the
base level size guess wrong if that size is odd. This leads to yet another
re-allocation of the texture later during st_finalize_texture.

Even worse, this re-allocation breaks a (reasonable) assumption made by
st_generate_mipmaps, because the re-allocation in the finalization call will
again allocate a single-level pipe texture (based on the non-mipmap texture
filter!). As a result, mipmap generation fails in interesting ways.

All of this can be avoided by just using the fact that we already know the
size of the base level.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=95529
Cc: 12.0 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoanv: Remove the PhysicalDeviceLimits FINISHME
Jason Ekstrand [Fri, 10 Jun 2016 16:43:45 +0000 (09:43 -0700)]
anv: Remove the PhysicalDeviceLimits FINISHME

At this point, the limits are probably more-or-less correct.  If there is
an invalid limit, that's a bug not a FINSHME.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/pipeline_cache: Allow for an zero-sized cache
Jason Ekstrand [Mon, 6 Jun 2016 18:20:44 +0000 (11:20 -0700)]
anv/pipeline_cache: Allow for an zero-sized cache

This gets ANV_ENABLE_PIPELINE_CACHE=false working again.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/pipeline: Store the (set, binding, index) tripple in the bind map
Jason Ekstrand [Mon, 6 Jun 2016 18:12:27 +0000 (11:12 -0700)]
anv/pipeline: Store the (set, binding, index) tripple in the bind map

This way the the bind map (which we're caching) is mostly independent of
the pipeline layout.  The only coupling remaining is that we pull the array
size of a binding out of the layout.  However, that size is also specified
in the shader and should always match so it's not really coupled.  This
rendering issues in Dota 2.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/descriptor_set: Ensure that bindings are always in increasing order
Jason Ekstrand [Mon, 6 Jun 2016 16:15:03 +0000 (09:15 -0700)]
anv/descriptor_set: Ensure that bindings are always in increasing order

Since applications are allowed to specify some set of bindings which need
not be dense they also need not be in order.  For most things, this doesn't
matter, but it could result getting the wrong dynamic offsets. This adds a
quick-and-dirty sort to ensure that everything is always in increasing
order of binding index.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/descriptor_set: Add a type field in debug builds
Jason Ekstrand [Mon, 6 Jun 2016 16:12:50 +0000 (09:12 -0700)]
anv/descriptor_set: Add a type field in debug builds

This allows for some extra validation and makes it easier to see what's
going on when poking around in gdb.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoanv/descriptor_set: Set array_size to zero for non-existant descriptors
Jason Ekstrand [Mon, 6 Jun 2016 16:12:20 +0000 (09:12 -0700)]
anv/descriptor_set: Set array_size to zero for non-existant descriptors

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agovl/dri3: support receiving new pixmap for front buffer
Leo Liu [Thu, 9 Jun 2016 16:53:54 +0000 (12:53 -0400)]
vl/dri3: support receiving new pixmap for front buffer

With glx of gstreamer-vaapi, the temporary pixmap for front buffer gets
renewed in each frame, so when we receive a new pixmap, should get a new
front buffer for it.

This also fixes Totem player playback corruption.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agovl/dri3: get Makefile properly
Leo Liu [Thu, 9 Jun 2016 17:11:52 +0000 (13:11 -0400)]
vl/dri3: get Makefile properly

From original commit, the macro "if HAVE_DRI3" was in Makefile.sources,
this file is shared with SCons, SCons is not able to parse this marco,
the SCons build failed. Jose quickly gave two approaches and quick fix
with his second approach, thanks Jose for the solutions and fixes.

This patch is Jose's first approach, and it's more proper, because the
dri3 c file should not be included to build when DRI3 is not enabled.

Signed-off-by: Leo Liu <leo.liu@amd.com>
Acked-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agogallivm: Never emit llvm.fmuladd on LLVM 3.3.
Jose Fonseca [Fri, 10 Jun 2016 14:42:55 +0000 (15:42 +0100)]
gallivm: Never emit llvm.fmuladd on LLVM 3.3.

Besides the old JIT bug, it seems the X86 backend on LLVM 3.3 doesn't
handle llvm.fmuladd and instead it fall backs to a C function.  Which in
turn causes a segfault on Windows.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agogallivm: Use llvm.fmuladd.*.
Jose Fonseca [Sun, 3 Apr 2016 23:05:33 +0000 (00:05 +0100)]
gallivm: Use llvm.fmuladd.*.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agoutil,gallivm: Explicitly enable/disable fma attribute.
Jose Fonseca [Tue, 24 May 2016 13:36:28 +0000 (22:36 +0900)]
util,gallivm: Explicitly enable/disable fma attribute.

As suggested by Roland Scheidegger.

Use the same logic as f16c, since fma requires VEX encoding.

But disable FMA on LLVM 3.3 without MCJIT.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
8 years agoradeonsi: Reinitialize all descriptors in CE preamble.
Bas Nieuwenhuizen [Mon, 6 Jun 2016 20:36:35 +0000 (22:36 +0200)]
radeonsi: Reinitialize all descriptors in CE preamble.

This fixes a problem with the CE preamble and restoring only stuff in the
preamble when needed.

To illustrate suppose we have two graphics IB's 1 and 2, which  are submitted in
that order. Furthermore suppose IB 1 does not use CE ram, but IB 2 does, and we
have a context switch at the start of IB 1, but not between IB 1 and IB 2.

The old code put the CE RAM loads in the preamble of IB 2. As the preamble of
IB 1 does not have the loads and the preamble of IB 2 does not get executed, the
old values are not load into CE RAM.

Fix this by always restoring the entire CE RAM.

v2: - Just load all descriptor set buffers instead of load and store the entire
      CE RAM.
    - Leave the ce_ram_dirty tracking in place for the non-preamble case.

v3: - Fixed parameter alignment.
    - Rebased to master (Nicolai's descriptor series).

Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agomesa: Wrap extensions.h declarations with extern "C".
Jose Fonseca [Fri, 10 Jun 2016 10:00:42 +0000 (11:00 +0100)]
mesa: Wrap extensions.h declarations with extern "C".

This should fix the MSVC linker failures that arose with commit
5e2d25894b962aae9158261897e13843377e3b95.

Trivial.

8 years agost/mesa: fix type confusion with reladdrs
Ilia Mirkin [Wed, 8 Jun 2016 15:32:54 +0000 (11:32 -0400)]
st/mesa: fix type confusion with reladdrs

The reality is that this doesn't matter, because we manually emit the
ARL to the sampler reladdr, and those arguments don't get an extra load
later, so it's effectively just a boolean. However having the types be
wrong is confusing and could trigger very odd bugs should usage change
down the line.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoglsl/ir: remove TABs in ir_constant_expression.cpp
Dave Airlie [Fri, 10 Jun 2016 00:00:14 +0000 (10:00 +1000)]
glsl/ir: remove TABs in ir_constant_expression.cpp

Adding 64-bit integers support was going to make this file worse,
just remove the tabs from it now.

Acked-by: Timothy Arceri <timothy.arceri@collabora.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoi965/gen9: Don't change halign and valign to fit in fast copy blit
Anuj Phogat [Wed, 8 Jun 2016 18:28:12 +0000 (11:28 -0700)]
i965/gen9: Don't change halign and valign to fit in fast copy blit

An update in graphics specs has deleted the halign and valign fields
from XY_FAST_COPY_BLT command. See mesa commit 97f0f91.

Cc: Ben Widawsky <ben@bwidawsk.net>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Ben Widawsky <ben@bwidawsk.net>
8 years agomesa: Add a helper function for shared code in get_tex_rgba_{un}compressed
Anuj Phogat [Mon, 28 Dec 2015 18:46:51 +0000 (10:46 -0800)]
mesa: Add a helper function for shared code in get_tex_rgba_{un}compressed

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agomesa: Let compute shaders work in compatibility profiles
Samuel Pitoiset [Wed, 25 May 2016 19:17:24 +0000 (21:17 +0200)]
mesa: Let compute shaders work in compatibility profiles

The extension is already advertised in compatibility profile, but
the _mesa_has_compute_shaders only returns true in core profile.
If we advertise it, we should allow it to work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
8 years agoswr: implement clipPlanes/clipVertex/clipDistance/cullDistance
Tim Rowley [Wed, 25 May 2016 23:49:34 +0000 (18:49 -0500)]
swr: implement clipPlanes/clipVertex/clipDistance/cullDistance

v2: only load the clip vertex once

v3: fix clip enable logic, add cullDistance

v4: remove duplicate fields in vs jit key, fix test of clip fixup needed

v5: fix clipdistance linkage for slot!=0,4

v6: support clip+cull; passes most piglit clip (failures understood)

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
8 years agoglx: fix crash with bad fbconfig
Daniel Czarnowski [Wed, 10 Feb 2016 17:36:05 +0000 (09:36 -0800)]
glx: fix crash with bad fbconfig

GLX documentation states:
glXCreateNewContext can generate the following errors: (...)
GLXBadFBConfig if config is not a valid GLXFBConfig

Function checks if the given config is a valid config and sets proper
error code.

Fixes currently crashing glx-fbconfig-bad Piglit test.

v2: coding style cleanups (Emil, Topi)
    use DefaultScreen macro (Emil)

Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Cc: "11.2" <mesa-stable@lists.freedesktop.org>
8 years agost/vdpau: implement luma keying
Nayan Deshmukh [Wed, 8 Jun 2016 09:36:25 +0000 (15:06 +0530)]
st/vdpau: implement luma keying

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agovl: Apply luma key filter before CSC conversion
Nayan Deshmukh [Wed, 8 Jun 2016 09:22:48 +0000 (14:52 +0530)]
vl: Apply luma key filter before CSC conversion

    Apply the luma key filter to the YCbCr values during the CSC conversion
    in video buffer shader. The initial values of max and min luma are set
    to opposite values to disable the filter initially and will be set when
    enabling it.

    Add extra parmeters min and max luma for the luma key filter in
    vl_compositor_set_csc_matrix in va, xvmc. Setting them
    to opposite value 1.f and 0.f respectively won't effect the CSC
    conversion

    v2: -Squash 1,2 and 3 into one patch to avoid breaking build of
        other components. (Christian)
        -use ureg_swizzle. (Christian)
        -change name of the variables. (Christian)

    v3: -Squash all patches in one to avoid breaking of build. (Emil)
        -wrap functions properly. (Emil)
        -use 0.0f and 1.0f instead of 0.f and 1.f respectively. (Emil)

    v4: -Divide it in two patches one which introduces the functionality
 and assigs dummy values to the changed functions and second which
 implements the lumakey filter. (Christian)
-use ureg_scalar instead ureg_swizzle. (Christian)

Signed-off-by: Nayan Deshmukh <nayan26deshmukh@gmail.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
8 years agoi965: Emit surface states for extra planes prior to gen8
Jason Ekstrand [Thu, 9 Jun 2016 02:56:46 +0000 (19:56 -0700)]
i965: Emit surface states for extra planes prior to gen8

When Kristian implemented GL_TEXTURE_EXTERNAL_OES, he hooked it up for gen8
but not for gen7 or earlier.  It all works, we just need to emit the states
for the extra planes.

Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agovirgl: fix checking fences
Marc-André Lureau [Tue, 7 Jun 2016 12:54:34 +0000 (14:54 +0200)]
virgl: fix checking fences

When calling virgl_fence_wait() with timeout=0,
virgl_{drm,vtest}_resource_is_busy() is called. However, it returns TRUE
for a busy resource, whereace virgl_fence_wait() should return TRUE for
a completed (non-busy) resource.

This fixes running supertuxkart in a VM (I could not reproduce locally
with vtest though there is a similar fix)

Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Cc: "11.1 11.2 12.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl/types: rename is_dual_slot_double to is_dual_slot_64bit.
Dave Airlie [Wed, 8 Jun 2016 21:50:43 +0000 (07:50 +1000)]
glsl/types: rename is_dual_slot_double to is_dual_slot_64bit.

In the future int64 support will have the same requirements.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agost/glsl_to_tgsi: move to checking 64-bitness instead of double
Dave Airlie [Wed, 8 Jun 2016 20:57:35 +0000 (06:57 +1000)]
st/glsl_to_tgsi: move to checking 64-bitness instead of double

This uses the new types interfaces to check for 64-bit types,
as futureproofing against int64 support.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agost/glsl_to_tgsi: use enum glsl_base_type instead of unsigned
Dave Airlie [Wed, 8 Jun 2016 20:48:33 +0000 (06:48 +1000)]
st/glsl_to_tgsi: use enum glsl_base_type instead of unsigned

This is just some better type safety that I noticed while working
on 64-bit integer support.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agomesa: use new 64-bit checks instead of explicit double checks.
Dave Airlie [Wed, 8 Jun 2016 21:07:42 +0000 (07:07 +1000)]
mesa: use new 64-bit checks instead of explicit double checks.

This just moves to the new interfaces in advance of int64.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl/link_varyings: switch to 64bit check instead of double.
Dave Airlie [Wed, 8 Jun 2016 21:02:36 +0000 (07:02 +1000)]
glsl/link_varyings: switch to 64bit check instead of double.

This is prep work for int64 support.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglsl: use new interfaces for 64-bit checks.
Dave Airlie [Wed, 8 Jun 2016 21:02:07 +0000 (07:02 +1000)]
glsl: use new interfaces for 64-bit checks.

This is just prep work for int64 support, changing
places where 64-bit matters no doubles.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agocompiler: use 64bit check for sizing instead of double check.
Dave Airlie [Wed, 8 Jun 2016 21:07:06 +0000 (07:07 +1000)]
compiler: use 64bit check for sizing instead of double check.

This just moves code to the new check in advance of int64 support.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agocompiler/types: add 64-bitness queries.
Dave Airlie [Wed, 8 Jun 2016 20:52:15 +0000 (06:52 +1000)]
compiler/types: add 64-bitness queries.

This adds an inline and type query for if a type is 64-bit.

Fow now this is equivalent to double, but int64 will change
this.

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Signed-off-by: Dave Airlie <airlied@redhat.com>
8 years agoglapi/glx: Add overflow checks to the client-side indirect code
Adam Jackson [Tue, 24 May 2016 19:45:11 +0000 (15:45 -0400)]
glapi/glx: Add overflow checks to the client-side indirect code

Coverity complains that the computed sizes can lead to negative lengths
passed to memcpy. If that happens we've been handed invalid arguments
anyway, so just bomb out.

The funky "0%s" is because the size string for the variable-length part
of the request is of the form "+ safe_pad() ...", and a unary + would
coerce the result to always be positive, defeating the overflow check.

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
8 years agoradeonsi: improve the computation and comment of scratch_waves
Marek Olšák [Wed, 8 Jun 2016 12:34:11 +0000 (14:34 +0200)]
radeonsi: improve the computation and comment of scratch_waves

2% isn't much. If you think the number should be decreased, please speak up.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: print the number of spilled VGPRs
Marek Olšák [Wed, 8 Jun 2016 11:51:04 +0000 (13:51 +0200)]
radeonsi: print the number of spilled VGPRs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agogallium/radeon: remove dead code creating LLVMTargetMachine
Marek Olšák [Tue, 7 Jun 2016 22:42:01 +0000 (00:42 +0200)]
gallium/radeon: remove dead code creating LLVMTargetMachine

This was for some old unsupported LLVM version.
Only si_create_context creates the target machine now.
r600g doesn't use this function.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: don't enable scratch just for SGPR spills
Marek Olšák [Tue, 7 Jun 2016 22:14:58 +0000 (00:14 +0200)]
radeonsi: don't enable scratch just for SGPR spills

Diff from shader-db:
  Scratch: 3221504 -> 17408 (-99.46 %) bytes per wave

v2: add "break;"

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agost/mesa: try not to compile compute shader on the first use
Marek Olšák [Tue, 7 Jun 2016 21:03:38 +0000 (23:03 +0200)]
st/mesa: try not to compile compute shader on the first use

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
8 years agoRevert "radeonsi: allow direct hw MSAA resolve for scanout surfaces"
Marek Olšák [Wed, 8 Jun 2016 16:52:25 +0000 (18:52 +0200)]
Revert "radeonsi: allow direct hw MSAA resolve for scanout surfaces"

This reverts commit ffd54d1936fcd07424265b780e1d049222a01e94.

No, it doesn't work. The test case is "glxgears -samples 2".

8 years agost/mesa: directly compute level=0 texture size in st_finalize_texture
Nicolai Hähnle [Tue, 7 Jun 2016 20:40:49 +0000 (22:40 +0200)]
st/mesa: directly compute level=0 texture size in st_finalize_texture

The width0/height0/depth0 on stObj may not have been set at this point.
Observed in a trace that set up levels 2..9 of a 2d texture, and set the base
level to 2, with height 1. This made the guess logic always bail.

Originally investigated by Ilia Mirkin, this patch gets rid of the somewhat
redundant storage of width0/height0/depth0 and makes sure we always compute
pipe texture sizes that are compatible with the base level image of the
GL texture.

Fixes the gl-1.2-texture-base-level piglit test provided by Brian Paul.

v2:
- try to re-use an existing pipe texture when possible
- handle a corner case where the base level is not level 0 and it is of
  size 1x1x1

v3:
- ptHeight = ptWidth in cube map 1x1 case (suggested by Brian)

Cc: "12.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Brian Paul <brianp@vmware.com>
8 years agoglsl: stop allocating memory for SSBOs and builtins
Timothy Arceri [Thu, 2 Jun 2016 05:32:14 +0000 (15:32 +1000)]
glsl: stop allocating memory for SSBOs and builtins

This just stops counting and assigning a storage location for
these uniforms, the count is only used to create the uniform storage.

These uniform types don't use this storage.

Reviewed-by: Dave Airlie <airlied@redhat.com>
8 years agost/mesa: use buffer usage history to set dirty flags for revalidation
Ilia Mirkin [Sat, 4 Jun 2016 17:26:46 +0000 (13:26 -0400)]
st/mesa: use buffer usage history to set dirty flags for revalidation

We were previously unconditionally doing this for arrays and ubo's, and
ignoring texture/storage/atomic buffers. Instead use the usage history
to determine which atoms need to be revalidated.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Cc: "12.0" <mesa-stable@lists.freedesktop.org>
8 years agoi965: Integrate precise trig into configuration infrastructure
Gurchetan Singh [Wed, 11 May 2016 20:32:09 +0000 (13:32 -0700)]
i965: Integrate precise trig into configuration infrastructure

With this change, to enable precise SIN and COS instructions
on Intel hardware, one can put

<option name="precise_trig" value="true"/>

in the proper drirc file.

V2: Make option name more generic

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Stephane Marchesin <stephane.marchesin@gmail.com>
8 years agoradeonsi: re-enable PBO ReadPixels acceleration
Marek Olšák [Tue, 7 Jun 2016 19:34:31 +0000 (21:34 +0200)]
radeonsi: re-enable PBO ReadPixels acceleration

disabled by 4f1cccf570112f93265a4cace504eb763fa8f73e

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
8 years agoradeonsi: allow MSAA resolving into a texture that has DCC enabled
Marek Olšák [Mon, 6 Jun 2016 00:01:36 +0000 (02:01 +0200)]
radeonsi: allow MSAA resolving into a texture that has DCC enabled

Since DCC is enabled almost everywhere now, it's important not to disable
this fast path.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agogallium/radeon: move DCC clearing into a separate function
Marek Olšák [Sun, 5 Jun 2016 23:54:20 +0000 (01:54 +0200)]
gallium/radeon: move DCC clearing into a separate function

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: allow direct hw MSAA resolve for scanout surfaces
Marek Olšák [Sun, 5 Jun 2016 15:43:43 +0000 (17:43 +0200)]
radeonsi: allow direct hw MSAA resolve for scanout surfaces

No idea why this was disabled, but it works fine.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: don't allocate DCC for the temporary MSAA resolve surface
Marek Olšák [Sun, 5 Jun 2016 23:42:46 +0000 (01:42 +0200)]
radeonsi: don't allocate DCC for the temporary MSAA resolve surface

Allocating it has no effect, but it adds overhead (useless DCC clear).

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: don't enable DCC in the sampler if first_level doesn't have it
Marek Olšák [Mon, 6 Jun 2016 15:33:42 +0000 (17:33 +0200)]
radeonsi: don't enable DCC in the sampler if first_level doesn't have it

If first_level > 0 and DCC is disabled for that level, let's skip DCC
reads entirely.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agowinsys/amdgpu: enable DCC for mipmapped textures
Marek Olšák [Fri, 3 Jun 2016 18:48:01 +0000 (20:48 +0200)]
winsys/amdgpu: enable DCC for mipmapped textures

Also add dcc_fast_clear_size for clearing only the necessary subset
of DCC. For no AA, it's equal to the size of the whole DCC level.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agogallium/radeon: don't disable DCC because of SDMA
Marek Olšák [Sun, 5 Jun 2016 13:45:30 +0000 (15:45 +0200)]
gallium/radeon: don't disable DCC because of SDMA

We want to keep DCC enabled to save bandwidth. It was a bad idea to disable
it here.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: don't flag renderbuffer feedback loop if DCC has just been disabled
Marek Olšák [Fri, 3 Jun 2016 18:51:47 +0000 (20:51 +0200)]
radeonsi: don't flag renderbuffer feedback loop if DCC has just been disabled

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
8 years agoradeonsi: add per-level dcc_enabled flags
Marek Olšák [Fri, 3 Jun 2016 18:40:30 +0000 (20:40 +0200)]
radeonsi: add per-level dcc_enabled flags

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>