platform/upstream/mesa.git
5 years agoi965: add support for sampling from AYUV
Lionel Landwerlin [Thu, 8 Nov 2018 17:26:36 +0000 (17:26 +0000)]
i965: add support for sampling from AYUV

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodri: add AYUV format
Lionel Landwerlin [Thu, 8 Nov 2018 17:28:20 +0000 (17:28 +0000)]
dri: add AYUV format

v2: Add a AYUV entry android in the android backend (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agonir/lower_tex: Add AYUV lowering support
Lionel Landwerlin [Thu, 8 Nov 2018 16:28:20 +0000 (16:28 +0000)]
nir/lower_tex: Add AYUV lowering support

Byte ordering is :

0: V
1: U
2: Y
3: A

v2: Split refactoring of alpha channel (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com> (v1)
Acked-by: Eric Engestrom <eric.engestrom@intel.com> (v2)
5 years agonir/lower_tex: add alpha channel parameter for yuv lowering
Lionel Landwerlin [Fri, 9 Nov 2018 10:33:37 +0000 (10:33 +0000)]
nir/lower_tex: add alpha channel parameter for yuv lowering

We're about to introduce AYUV support which provides its own alpha
channel. So give alpha as a parameter and set it to 1 on exising
formats.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradv: make use of num_good_cu_per_sh in si_emit_graphics() too
Samuel Pitoiset [Thu, 8 Nov 2018 13:48:31 +0000 (14:48 +0100)]
radv: make use of num_good_cu_per_sh in si_emit_graphics() too

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: clean up setting partial_es_wave for distributed tess on VI
Samuel Pitoiset [Thu, 8 Nov 2018 13:00:36 +0000 (14:00 +0100)]
radv: clean up setting partial_es_wave for distributed tess on VI

Only needed when the pipeline actually uses tessellation. I don't
think that changes anything, except improving readability.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: cleanup and document a Hawaii bug with offchip buffers
Samuel Pitoiset [Thu, 8 Nov 2018 13:00:35 +0000 (14:00 +0100)]
radv: cleanup and document a Hawaii bug with offchip buffers

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoglsl/test: Fix use after free in test_optpass.
Hanno Böck [Wed, 7 Nov 2018 08:01:42 +0000 (09:01 +0100)]
glsl/test: Fix use after free in test_optpass.

The variable state is free'd and afterwards state->error is used
as the return value, resulting in a use after free bug detected
by memory safety tools like address sanitizer.

Signed-off-by: Hanno Böck <hanno@hboeck.de>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108636
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agonir: don't pack varyings ints with floats unless flat
Timothy Arceri [Mon, 12 Nov 2018 02:25:27 +0000 (13:25 +1100)]
nir: don't pack varyings ints with floats unless flat

Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agonir: add glsl_type_is_integer() helper
Timothy Arceri [Mon, 12 Nov 2018 02:24:42 +0000 (13:24 +1100)]
nir: add glsl_type_is_integer() helper

Fixes: 1c9c42d16b4c ("nir: add varying component packing helpers")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agointel/fs: Prevent emission of IR instructions not aligned to their own execution...
Francisco Jerez [Thu, 8 Nov 2018 22:03:24 +0000 (14:03 -0800)]
intel/fs: Prevent emission of IR instructions not aligned to their own execution size.

This can occur during payload setup of SIMD-split send message
instructions, which can lead to the emission of header setup
instructions with a non-zero channel group and fixed SIMD width.  Such
instructions could end up using undefined channel enable signals
except they don't care since they're always marked force_writemask_all.

Not known to affect correctness of any workload at this point, but it
would be trivial to back-port to stable if something comes up.

Reported-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
Tested-by: Sagar Ghuge <sagar.ghuge@intel.com>
5 years agost/mesa: make use of nir_link_constant_varyings()
Timothy Arceri [Fri, 9 Nov 2018 22:20:10 +0000 (09:20 +1100)]
st/mesa: make use of nir_link_constant_varyings()

Shader-db results radeonsi (VEGA):

Totals from affected shaders:
SGPRS: 161464 -> 161368 (-0.06 %)
VGPRS: 86904 -> 86292 (-0.70 %)
Spilled SGPRs: 296 -> 314 (6.08 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 3618596 -> 3573852 (-1.24 %) bytes
LDS: 0 -> 0 (0.00 %) blocks
Max Waves: 26189 -> 26276 (0.33 %)
Wait states: 0 -> 0 (0.00 %)

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agonir: add new linking opt nir_link_constant_varyings()
Timothy Arceri [Thu, 8 Nov 2018 22:24:11 +0000 (09:24 +1100)]
nir: add new linking opt nir_link_constant_varyings()

This pass moves constant outputs to the consuming shader stage
where possible.

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agost/nine: clean up thead shutdown sequence a bit
Andre Heider [Tue, 6 Nov 2018 08:27:14 +0000 (09:27 +0100)]
st/nine: clean up thead shutdown sequence a bit

Just break out of the loop instead, it does the same thing.

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
5 years agost/nine: plug thread related leaks
Andre Heider [Tue, 6 Nov 2018 08:27:13 +0000 (09:27 +0100)]
st/nine: plug thread related leaks

Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
5 years agost/nine: fix stack corruption due to ABI mismatch
Andre Heider [Tue, 6 Nov 2018 08:27:12 +0000 (09:27 +0100)]
st/nine: fix stack corruption due to ABI mismatch

This fixes various crashes and hangs when using nine's 'thread_submit'
feature.

On 64bit, the thread function's data argument would just be NULL.
On 32bit, the data argument would be garbage depending on the compiler
flags (in my case -march>=core2).

Fixes: f3fa7e3068512d ("st/nine: Use WINE thread for threadpool")
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Andre Heider <a.heider@gmail.com>
Reviewed-by: Axel Davy <davyaxel0@gmail.com>
5 years agoradeonsi: stop command submission with PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET only
Marek Olšák [Fri, 2 Nov 2018 20:09:13 +0000 (16:09 -0400)]
radeonsi: stop command submission with PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET only

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agogallium: add PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET
Marek Olšák [Fri, 2 Nov 2018 20:08:26 +0000 (16:08 -0400)]
gallium: add PIPE_CONTEXT_LOSE_CONTEXT_ON_RESET

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agoradeonsi: don't set the CB clear color registers for 0/1 clear colors on Raven2
Marek Olšák [Tue, 30 Oct 2018 00:48:33 +0000 (20:48 -0400)]
radeonsi: don't set the CB clear color registers for 0/1 clear colors on Raven2

and add has_dcc_constant_encode.

5 years agoradeonsi: use better DCC clear codes
Marek Olšák [Tue, 30 Oct 2018 00:46:48 +0000 (20:46 -0400)]
radeonsi: use better DCC clear codes

Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agoac/surface: remove the overallocation workaround for Vega12
Marek Olšák [Tue, 6 Nov 2018 22:11:55 +0000 (17:11 -0500)]
ac/surface: remove the overallocation workaround for Vega12

not needed anymore (probably since the tile_swizzle fix)

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agointel/aub_read: remove useless breaks
Lionel Landwerlin [Fri, 9 Nov 2018 16:49:09 +0000 (16:49 +0000)]
intel/aub_read: remove useless breaks

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoRevert "mesa: expose NV_conditional_render on GLES"
Erik Faye-Lund [Fri, 9 Nov 2018 16:39:25 +0000 (17:39 +0100)]
Revert "mesa: expose NV_conditional_render on GLES"

This reverts commit 5213be9fab72548c799b30e320dd1b257534f096.

5 years agoRevert "mesa/main: fixup make check after NV_conditional_render for gles"
Erik Faye-Lund [Fri, 9 Nov 2018 16:39:22 +0000 (17:39 +0100)]
Revert "mesa/main: fixup make check after NV_conditional_render for gles"

This reverts commit cccd7a253f9ed14ea748a222f58b0e5c895eb939.

5 years agomesa/main: fixup make check after NV_conditional_render for gles
Erik Faye-Lund [Fri, 9 Nov 2018 15:16:13 +0000 (16:16 +0100)]
mesa/main: fixup make check after NV_conditional_render for gles

It seems I missed some details when exposing NV_conditional_render
on GLES; this fixes up "make check".

Fixes: 5213be9fab7 ("mesa: expose NV_conditional_render on GLES")
Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-and-Tested-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradv: include LLVM IR in the VK_AMD_shader_info "disassembly"
Nicolai Hähnle [Wed, 7 Nov 2018 11:10:21 +0000 (12:10 +0100)]
radv: include LLVM IR in the VK_AMD_shader_info "disassembly"

Helpful for debugging compiler backend problems: this allows us to
easily retrieve the LLVM IR from RenderDoc.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agomesa: expose NV_conditional_render on GLES
Erik Faye-Lund [Thu, 1 Nov 2018 12:28:25 +0000 (13:28 +0100)]
mesa: expose NV_conditional_render on GLES

The extension spec has been updated to include GLES 2 support, so let's
enable it there.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agonir/constant_folding: fix incorrect bit-size check
Iago Toral Quiroga [Wed, 31 Oct 2018 11:18:34 +0000 (12:18 +0100)]
nir/constant_folding: fix incorrect bit-size check

nir_alu_type_get_type_size takes a type as parameter and we were
passing a bit-size instead, which did what we wanted by accident,
since a bit-size of zero matches nir_type_invalid, which has a
size of 0 too.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
5 years agointel/compiler: fix node interference of simd16 instructions
Iago Toral Quiroga [Wed, 17 Oct 2018 10:05:42 +0000 (12:05 +0200)]
intel/compiler: fix node interference of simd16 instructions

SIMD16 instructions need to have additional interferences to prevent
source / destination hazards when the source and destination registers
are off by one register.

While we already have code to handle this, it was only running for SIMD16
dispatches, however, we can have SIDM16 instructions in a SIMD8 dispatch.
An example of this are pull constant loads since commit b56fa830c6095,
but there are more cases.

This fixes a number of CTS test failures found in work-in-progress
tests that were hitting this situation for 16-wide pull constants
in a SIMD8 program.

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
5 years agogallivm: fix improper clamping of vertex index when fetching gs inputs
Roland Scheidegger [Thu, 8 Nov 2018 01:52:47 +0000 (02:52 +0100)]
gallivm: fix improper clamping of vertex index when fetching gs inputs

Because we only have one file_max for the (2d) gs input file, the value
actually represents the max of attrib and vertex index (although I'm
not entirely sure if we really want the max, since the max valid value
of the vertex dimension can be easily deduced from the input primitive).

Thus in cases where the number of inputs is higher than the number of
vertices per prim, we did not properly clamp the vertex index, which
would result in out-of-bound fetches, potentially causing segfaults
(the segfaults seemed actually difficult to trigger, but valgrind
certainly wasn't happy). This might have happened even if the shader
did not actually try to fetch bogus vertices, if the fetching happened
in non-active conditional clauses.

To fix simply use the correct max vertex index value (derived from
the input prim type) instead when clamping for this case.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
5 years agoi965: Lift restriction in external textures for EGLImage support
Aditya Swarup [Thu, 1 Nov 2018 00:12:40 +0000 (17:12 -0700)]
i965: Lift restriction in external textures for EGLImage support

Fixes Skqp's unitTest_EGLImageTest test.

For Intel platforms, we support external textures only for EGLImages
created with EGL_EXT_image_dma_buf_import. This restriction seems to
be Intel specific and not present for other platforms.

While running SKQP test - unitTest_EGLImageTest, GL_INVALID is sent
to the test because of this restriction.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=105301
Signed-off-by: Aditya Swarup <aditya.swarup@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Chad Versace <chadversary@chromium.org>
5 years agoglsl: Add pragma to disable all warnings
Ian Romanick [Thu, 1 Nov 2018 20:50:14 +0000 (13:50 -0700)]
glsl: Add pragma to disable all warnings

Use #pragma warning(off) and #pragma warning(on) to disable or enable
all warnings.  This is a big hammer.  If we ever need a smaller hammer,
we can enhance this functionality.

There is one lame thing about this.  Because we parse everything, create
an AST, then convert the AST to GLSL IR, we have to treat the #pragma
like a statment.  This means that you can't do something like

'    void
'    #pragma warning(off)
'    __foo
'    #pragma warning(on)
'    (float param0);

Fixing that would, as far as I can tell, require a huge amount of work.

I did try just handling the #pragma during parsing (like we do for
state for the whole shader.

v2: Fix the #pragma lines in the commit message that git-commit ate.

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agoglsl: Add warning tests for identifiers with __
Ian Romanick [Thu, 1 Nov 2018 20:47:58 +0000 (13:47 -0700)]
glsl: Add warning tests for identifiers with __

Signed-off-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
5 years agointel/fs: Add an assert to optimize_frontfacing_ternary
Jason Ekstrand [Wed, 7 Nov 2018 21:47:18 +0000 (15:47 -0600)]
intel/fs: Add an assert to optimize_frontfacing_ternary

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoanv: Use nir_src_is_const and friends in lowering code
Jason Ekstrand [Sat, 20 Oct 2018 17:25:31 +0000 (12:25 -0500)]
anv: Use nir_src_is_const and friends in lowering code

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/analyze_ubo_ranges: Use nir_src_is_const and friends
Jason Ekstrand [Sat, 20 Oct 2018 17:21:46 +0000 (12:21 -0500)]
intel/analyze_ubo_ranges: Use nir_src_is_const and friends

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/vec4: Use the new nir_src_is_const and friends
Jason Ekstrand [Sat, 20 Oct 2018 15:28:51 +0000 (10:28 -0500)]
intel/vec4: Use the new nir_src_is_const and friends

As of this commit, all uses of const sources either go through a
nir_src_as_<type> helper which handles bit sizes correctly or else are
accompanied by a nir_src_bit_size() == 32 assertion to assert that we
have the size we think we have.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agonir: Add a read_mask helper for ALU instructions
Jason Ekstrand [Wed, 7 Nov 2018 23:47:45 +0000 (17:47 -0600)]
nir: Add a read_mask helper for ALU instructions

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/fs: Use the new nir_src_is_const and friends
Jason Ekstrand [Sat, 20 Oct 2018 14:55:28 +0000 (09:55 -0500)]
intel/fs: Use the new nir_src_is_const and friends

As of this commit, all uses of const sources either go through a
nir_src_as_<type> helper which handles bit sizes correctly or else are
accompanied by a nir_src_bit_size() == 32 assertion to assert that we
have the size we think we have.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agointel/fs,vec4: Clean up a repeated pattern with SSBOs
Jason Ekstrand [Sat, 20 Oct 2018 15:05:33 +0000 (10:05 -0500)]
intel/fs,vec4: Clean up a repeated pattern with SSBOs

Everywhere we handle SSBO intrinsics, we have exactly the same pattern
for computing the index so we may as well make a helper for it.  We also
add a get_nir_src_imm to vec4 and use it for SSBO offsets.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoradv: fix GPU hangs when loading depth/stencil clear values on SI/CIK
Samuel Pitoiset [Thu, 8 Nov 2018 10:16:45 +0000 (11:16 +0100)]
radv: fix GPU hangs when loading depth/stencil clear values on SI/CIK

HTILE is supported on these chips, not sure how I missed that.
This restores using PFP_SYNC_ME when LOAD_CONTEXT_REG is not used.

Fixes: f425d9ee74 ("radv: use LOAD_CONTEXT_REG when loading fast clear values")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: use LOAD_CONTEXT_REG when loading fast clear values
Samuel Pitoiset [Wed, 7 Nov 2018 21:05:31 +0000 (22:05 +0100)]
radv: use LOAD_CONTEXT_REG when loading fast clear values

This avoids syncing the Micro Engine. This is only supported
for VI+ currently. There is probably a way for using
LOAD_CONTEXT_REG on previous chips but that could be done later.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agoradv: only expose VK_SUBGROUP_FEATURE_ARITHMETIC_BIT for VI+
Samuel Pitoiset [Wed, 7 Nov 2018 16:06:27 +0000 (17:06 +0100)]
radv: only expose VK_SUBGROUP_FEATURE_ARITHMETIC_BIT for VI+

Inclusive and exclusives scan are missing because older chips
don't have llvm.amdgcn.update.dpp.

This fixes crashes with dEQP-VK.subgroups.arithmetic.*.

CC: mesa-stable@lists.freedesktop.org
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agoglx: Demand success from CreateContext requests (v2)
Adam Jackson [Tue, 7 Aug 2018 20:55:37 +0000 (16:55 -0400)]
glx: Demand success from CreateContext requests (v2)

GLXCreate{,New}Context, like most X resource creation requests, does not
emit a reply and therefore is emitted into the X stream asynchronously.
However, unlike most resource creation requests, the GLXContext we
return is a handle to library state instead of an XID. So if context
creation fails for any reason - say, the server doesn't support indirect
contexts - then we will fail in strange places for strange reasons.

We could make every GLX entrypoint robust against half-created contexts,
or we could just verify that context creation worked. Reuse the
__glXIsDirect code to do this, as a cheap way of verifying that the
XID is real.

glXCreateContextAttribsARB solves this by using the _checked version of
the xcb command, so effectively this change makes the classic context
creation paths as robust as CreateContextAttribs.

v2: Better use of Bool, check that error != NULL first (Olivier Fourdan)

Signed-off-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agogm107/ir: fix compile time warning in getTEXSMask
Karol Herbst [Wed, 7 Nov 2018 12:34:29 +0000 (13:34 +0100)]
gm107/ir: fix compile time warning in getTEXSMask

In function 'uint8_t nv50_ir::getTEXSMask(uint8_t)':
warning: control reaches end of non-void function [-Wreturn-type]

Reported-by: Moiman@freenode
Fixes: f821e80213e38e93f96255b3deacb737a600ed40
       "gm107/ir: use scalar tex instructions where possible"
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agowinsys/amdgpu: Stop using amdgpu_bo_handle_type_kms_noimport
Michel Dänzer [Thu, 1 Nov 2018 11:30:42 +0000 (12:30 +0100)]
winsys/amdgpu: Stop using amdgpu_bo_handle_type_kms_noimport

It only behaves any different from amdgpu_bo_handle_type_kms with
libdrm 2.4.93, and it breaks if an older version is picked up.

Bugzilla: https://bugs.freedesktop.org/108096
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agointel/dump_gpu: add platform option
Lionel Landwerlin [Wed, 7 Nov 2018 10:55:05 +0000 (10:55 +0000)]
intel/dump_gpu: add platform option

Got tired of remembering the PCI ids.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agointel/dump_gpu: move output option together
Lionel Landwerlin [Wed, 7 Nov 2018 10:55:04 +0000 (10:55 +0000)]
intel/dump_gpu: move output option together

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradv: disable conditional rendering for vkCmdCopyQueryPoolResults()
Samuel Pitoiset [Mon, 5 Nov 2018 08:54:28 +0000 (09:54 +0100)]
radv: disable conditional rendering for vkCmdCopyQueryPoolResults()

VK_EXT_conditional_rendering says that copy commands should not be
affected by conditional rendering.

Cc: 18.2 18.3 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agoradv: allocate enough space in CS when copying query results with compute
Samuel Pitoiset [Mon, 5 Nov 2018 09:35:36 +0000 (10:35 +0100)]
radv: allocate enough space in CS when copying query results with compute

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agoac/nir_to_llvm: fix b2f for f64
Timothy Arceri [Fri, 2 Nov 2018 02:33:52 +0000 (13:33 +1100)]
ac/nir_to_llvm: fix b2f for f64

Fixes: d7e0d47b9de3 ("nir: Add a bunch of b2[if] optimizations")

Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agogm107/ir: use scalar tex instructions where possible
Karol Herbst [Sun, 5 Aug 2018 16:34:22 +0000 (18:34 +0200)]
gm107/ir: use scalar tex instructions where possible

TEXS, TLD4 and TLD4S are variants of tex instructions which are more
scalar, which gives RA more freedom and is less likely to insert silly
MOVs to satisfy quad registers.

shader-db changes:
total instructions in shared programs : 7687265 -> 7614782 (-0.94%)
total gprs used in shared programs    : 803620 -> 798045 (-0.69%)
total shared used in shared programs  : 639636 -> 639636 (0.00%)
total local used in shared programs   : 24648 -> 24648 (0.00%)
total bytes used in shared programs   : 82103400 -> 81330696 (-0.94%)

                local     shared        gpr       inst      bytes
    helped           0           0        3648       10647       10647
      hurt           0           0         464         205         205

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agonv50/ir: add scalar field to TexInstructions
Karol Herbst [Sun, 5 Aug 2018 17:12:48 +0000 (19:12 +0200)]
nv50/ir: add scalar field to TexInstructions

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agonv50/ra: add condenseDef overloads for partial condenses
Karol Herbst [Sun, 5 Aug 2018 18:41:49 +0000 (20:41 +0200)]
nv50/ra: add condenseDef overloads for partial condenses

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agonv50/ir: print color masks of tex instructions
Karol Herbst [Sun, 5 Aug 2018 17:12:32 +0000 (19:12 +0200)]
nv50/ir: print color masks of tex instructions

v2: print the mask for TXG as well
    make the mask to be printed more mask like

Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agovulkan: Update the XML and headers to 1.1.91
Jason Ekstrand [Tue, 6 Nov 2018 15:48:59 +0000 (09:48 -0600)]
vulkan: Update the XML and headers to 1.1.91

The biggest change here is the rename of VK_NVX_ray_tracing to
VK_NV_ray_tracing and the total removal of VK_KHR_mir_surface.

Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
5 years agor600: Add support for EXT_texture_sRGB_R8
Gert Wollny [Thu, 1 Nov 2018 11:59:27 +0000 (12:59 +0100)]
r600: Add support for EXT_texture_sRGB_R8

Enables on R600 and makes pass:
  dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.*
  dEQP-GLES31.functional.texture.filtering.cube_array.formats.sr8*

v2: remove chunk for dri/radeon (Emil)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
5 years agoanv/android: mark gralloc allocated BOs as external
Lionel Landwerlin [Tue, 6 Nov 2018 11:37:51 +0000 (11:37 +0000)]
anv/android: mark gralloc allocated BOs as external

Allocating through Gralloc implies buffers are going to be used
outside the driver. We have special MOCS settings for external BOs and
we probably want to use them here too.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: a1220e73116bad7 ("anv/android: Set the BO flags in bo_cache_import (v2)")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agoanv: stub internal android code
Lionel Landwerlin [Tue, 6 Nov 2018 11:37:50 +0000 (11:37 +0000)]
anv: stub internal android code

This reduces the amount of #ifdef ANDROID we'll have to have inside
the driver. Potentially offering better coverage of the android
extensions.

v2: Move anv_android.h include before anv_entrypoints.h (Tapani)
    Fix autotools android build (Lionel)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agofreedreno/a6xx: Clear z32 and separate stencil with blitter
Kristian H. Kristensen [Fri, 19 Oct 2018 04:41:21 +0000 (21:41 -0700)]
freedreno/a6xx: Clear z32 and separate stencil with blitter

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
5 years agofreedreno/a6xx: fix VSC bug with larger # of tiles
Rob Clark [Tue, 30 Oct 2018 12:41:58 +0000 (08:41 -0400)]
freedreno/a6xx: fix VSC bug with larger # of tiles

At higher resolutions with the addition of MSAA, the number of tiles
can increase to the point where we use more than one VSC pipe per
tile.  Which would cause us to calculate an out-of-bounds offset for
VSC_SIZE_ADDRESS.  So don't try to be clever, just always put it at
a fixed offset assuming the max 32 VSC pipes in use.

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno: update generated headers
Rob Clark [Mon, 29 Oct 2018 17:28:45 +0000 (13:28 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agowayland/egl: Resize EGL surface on update buffer for swrast
Olivier Fourdan [Thu, 25 Oct 2018 12:48:15 +0000 (14:48 +0200)]
wayland/egl: Resize EGL surface on update buffer for swrast

After commit a9fb331ea ("wayland/egl: update surface size on window
resize"), the surface size is updated as soon as the resize is done, and
`update_buffers()` would resize only if the surface size differs from
the attached size.

However, in the case of swrast, there is no resize callback and the
attached size is updated in `dri2_wl_swrast_commit_backbuffer()` prior
to the `swrast_update_buffers()` so the attached size is always up to
date when it reaches `swrast_update_buffers()` and the surface is never
resized.

This can be observed with "totem" using the GDK backend on Wayland (the
default) when running on software rendering:

  $ LIBGL_ALWAYS_SOFTWARE=true CLUTTER_BACKEND=gdk totem

Resizing the window would leave the EGL surface size unchanged.

To avoid the issue, partially revert the part of commit a9fb331ea for
`swrast_update_buffers()` and resize on the win size and not the
attached size.

Fixes: a9fb331ea - wayland/egl: update surface size on window resize
Signed-off-by: Olivier Fourdan <ofourdan@redhat.com>
CC: Daniel Stone <daniel@fooishbar.org>
CC: Juan A. Suarez Romero <jasuarez@igalia.com>
CC: mesa-stable@lists.freedesktop.org
Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
5 years agointel/decoders: fix instruction base address parsing
Lionel Landwerlin [Mon, 5 Nov 2018 20:42:40 +0000 (20:42 +0000)]
intel/decoders: fix instruction base address parsing

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 00103db04ab879 ("intel: Fix decoding for partial STATE_BASE_ADDRESS updates.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
5 years agoegl/glvnd: correctly report errors when vendor cannot be found
Emil Velikov [Fri, 2 Nov 2018 18:34:19 +0000 (18:34 +0000)]
egl/glvnd: correctly report errors when vendor cannot be found

If the user provides an invalid display or device the ToVendor lookup
will fail.

In this case, the local [Mesa vendor] error code will be set. Thus on
sequential eglGetError(), the error will be EGL_SUCCESS.

To be more specific, GLVND remembers the last vendor and calls back
into it's eglGetError, although there's no guarantee to ever have had
one.

v2:
 - Add _eglError call, so the debug callback is executed (Kyle)
 - Drop XXX comment.

Piglit: tests/egl/spec/egl_ext_device_query
Fixes: ce562f9e3fa ("EGL: Implement the libglvnd interface for EGL (v3)")
Cc: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Kyle Brenneman <kbrenneman@nvidia.com>
5 years agoegl: add EGL_EXT_device_base entrypoints
Emil Velikov [Fri, 2 Nov 2018 18:50:48 +0000 (18:50 +0000)]
egl: add EGL_EXT_device_base entrypoints

eglQueryDevicesEXT (unlike the other three functions) does not depend
on the display. It is implemented in GLVND, which calls into each
driver collecting the list of devices and presenting it to the user.

For the other entrypoints, GLVND acts as pass through stub calling into
the vendor library. The vendor implementation calls back into GLVND to
get the vendor dispatch. Then the driver proceeds to call itself via
the said dispatch.

This design makes is possible to keep using "old" GLVND with newer
vendor drivers. Since effectively all the extension code is within the
latter itself.

Without said entrypoints, any user will outright crash - as reported in
the bug report.

Note: there's a follow-up fix needed to our GLVND code, to make piglit
happy.

v2: add some beefy documentation in the commit message.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108635
Fixes: 7552fcb7b9b ("egl: add base EGL_EXT_device_base implementation")
Reported-by: kyle.devir@mykolab.com
Cc: kyle.devir@mykolab.com
Acked-by: Eric Engestrom <eric@engestrom.ch>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Tested-by: Emil Velikov <emil.velikov@collabora.com>
5 years agodocs: mention EXT_shader_implicit_conversions
Emil Velikov [Fri, 2 Nov 2018 15:48:26 +0000 (15:48 +0000)]
docs: mention EXT_shader_implicit_conversions

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
5 years agost/va: fix incorrect use of resource_destroy
Marek Olšák [Sat, 3 Nov 2018 00:56:42 +0000 (20:56 -0400)]
st/va: fix incorrect use of resource_destroy

Fixes: 4373dd32154 ("st/va: Support YUV formats in vaCreateSurfaces")
Cc: Drew Davenport <ddavenport@chromium.org>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agoi965/batch/debug: Allow log be dumped before assert
Sergii Romantsov [Mon, 5 Nov 2018 13:02:49 +0000 (15:02 +0200)]
i965/batch/debug: Allow log be dumped before assert

Message that may show the culprit of assert now will
be dumped before that for debug purposes.

Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Reviewed-by: Lionel G Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agointel/sanitize_gpu: add debug message on mmap fail
Lionel Landwerlin [Mon, 29 Oct 2018 18:14:47 +0000 (18:14 +0000)]
intel/sanitize_gpu: add debug message on mmap fail

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agointel/sanitize_gpu: deal with non page multiple buffer sizes
Lionel Landwerlin [Mon, 29 Oct 2018 18:14:46 +0000 (18:14 +0000)]
intel/sanitize_gpu: deal with non page multiple buffer sizes

We can only map at page aligned offsets. We got that wrong with buffer
size where (size % 4096) != 0 (anv has a WA buffer of 1024).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agointel/sanitize_gpu: add help/gdb options to wrapper
Lionel Landwerlin [Mon, 29 Oct 2018 18:14:45 +0000 (18:14 +0000)]
intel/sanitize_gpu: add help/gdb options to wrapper

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agointel/dump_gpu: add missing gdb option
Lionel Landwerlin [Mon, 29 Oct 2018 18:14:44 +0000 (18:14 +0000)]
intel/dump_gpu: add missing gdb option

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
6 years agowsi/wayland: only finish() a successfully init()ed display
Eric Engestrom [Mon, 5 Nov 2018 09:57:09 +0000 (09:57 +0000)]
wsi/wayland: only finish() a successfully init()ed display

Fixes: 43691024982b3ea734ad0 "vulkan/wsi/wayland: Stop caching Wayland displays"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
6 years agowsi/wayland: use proper VkResult type
Eric Engestrom [Mon, 5 Nov 2018 09:55:02 +0000 (09:55 +0000)]
wsi/wayland: use proper VkResult type

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoautotools: library-dependency when no sse and 32-bit
Sergii Romantsov [Thu, 1 Nov 2018 11:02:43 +0000 (13:02 +0200)]
autotools: library-dependency when no sse and 32-bit

Building of 32bit Mesa may fail if __SSE__ is not specified.
Added missed dependency from libm.

v2: avoided dependecy on any flag, just link

v3: meson doesn't fail, but have added dependency on libm

CC: Dylan Baker <dylan@pnwbakers.com>
CC: Lionel G Landwerlin <lionel.g.landwerlin@intel.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108560
Signed-off-by: Sergii Romantsov <sergii.romantsov@globallogic.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agoradv: more use of radv_cp_wait_mem()
Samuel Pitoiset [Wed, 31 Oct 2018 11:00:12 +0000 (12:00 +0100)]
radv: more use of radv_cp_wait_mem()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: replace si_emit_wait_fence() with radv_cp_wait_mem()
Samuel Pitoiset [Wed, 31 Oct 2018 11:00:11 +0000 (12:00 +0100)]
radv: replace si_emit_wait_fence() with radv_cp_wait_mem()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: add missing TFB queries support to CmdCopyQueryPoolsResults()
Samuel Pitoiset [Wed, 31 Oct 2018 10:43:34 +0000 (11:43 +0100)]
radv: add missing TFB queries support to CmdCopyQueryPoolsResults()

Cc: 18.3 <mesa-stable@lists.freedesktop.org>
Fixes: b4eb029062a ("radv: implement VK_EXT_transform_feedback")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: remove useless sync after copying query results with compute
Samuel Pitoiset [Fri, 2 Nov 2018 11:20:48 +0000 (12:20 +0100)]
radv: remove useless sync after copying query results with compute

The spec says:
   "vkCmdCopyQueryPoolResults is considered to be a transfer
    operation, and its writes to buffer memory must be synchronized
    using VK_PIPELINE_STAGE_TRANSFER_BIT and VK_ACCESS_TRANSFER_WRITE_BIT
    before using the results."

VK_PIPELINE_STAGE_TRANSFER_BIT will wait for compute to be idle,
while VK_ACCESS_TRANSFER_WRITE_BIT will invalidate both L1 vector
caches and L2. So, it's useless to set those flags internally.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agor600/sb: Fix constant logical operand in assert.
Vinson Lee [Wed, 31 Oct 2018 22:35:23 +0000 (15:35 -0700)]
r600/sb: Fix constant logical operand in assert.

Fixes: da977ad90747 ("r600/sb: start adding GDS support")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-By: Gert Wollny <gert.wollny@collabora.com>
6 years agost/mesa: Don't record garbage streamout information in the non-SSO case.
Kenneth Graunke [Thu, 25 Oct 2018 09:16:27 +0000 (02:16 -0700)]
st/mesa: Don't record garbage streamout information in the non-SSO case.

In the non-SSO case, where multiple shader stages are linked together,
we were recording garbage pipe_stream_output_info structures for all
but the last enabled geometry-processing stage.

Specifically, we were using the gl_transform_feedback_info from
shader_program->last_vert_prog (the stage whose outputs will be
recorded)...but were pairing it with the output varying mappings
from the current shader stage.  For example, a program with a VS and
GS, the VS's pipe_shader_state would have a pipe_stream_output_info
based on the GS transform feedback info, but the VS output mapping.

This generally worked out okay because only the pipe_stream_output_info
for the last stage really matters - the others can be ignored.  However,
we'd like to avoid confusing the pipe driver.  In particular, my new
driver translates the stream out information to hardware packets at
bind_{vs,tes,gs}_state() time...and was hitting asserts about garbage
varyings that didn't exist.

This patch changes st/mesa to record a blank pipe_stream_output_info
with num_outputs = 0 for all stages prior to last_vert_prog.  The last
one is captured as normal.

(In the fully-SSO case, nothing should change - each program contains
a single shader stage, so last_vert_prog *is* the current shader.)

Tested with llvmpipe (piglit's gpu profile), and freedreno (a3xx,
gpu profile with -t transform.feedback).  Fixes several hundred CTS
tests on my new driver.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
6 years agost/nir: Drop unused parameter from st_nir_assign_uniform_locations().
Kenneth Graunke [Thu, 25 Oct 2018 09:22:34 +0000 (02:22 -0700)]
st/nir: Drop unused parameter from st_nir_assign_uniform_locations().

ARB programs won't have one of these, and we don't use it anyway.

Reviewed-by: Rob Clark <robdclark@gmail.com>
6 years agost/mesa: Pull nir_lower_wpos_ytransform work into a helper function.
Kenneth Graunke [Thu, 25 Oct 2018 09:22:33 +0000 (02:22 -0700)]
st/mesa: Pull nir_lower_wpos_ytransform work into a helper function.

This will let me use it in the ARB program code as well.

Reviewed-by: Rob Clark <robdclark@gmail.com>
6 years agointel: Use a URB start offset of 0 for disabled stages.
Kenneth Graunke [Mon, 8 Oct 2018 21:54:00 +0000 (14:54 -0700)]
intel: Use a URB start offset of 0 for disabled stages.

There are some cases where the VS is the only stage enabled, it uses the
entire URB, and the URB is large enough that placing later stages after
the VS exceeds the number of bits for "URB Starting Address".

For example, on Icelake GT2, "varying-packing-simple mat2x4 array" from
Piglit is getting a starting offset of 128 for the GS/HS/DS.  But the
field is only large enough to hold an offset of 127.

i965 doesn't hit any genxml assertions because it's still using the old
OUT_BATCH mechanism.  128 << GEN7_URB_STARTING_ADDRESS_SHIFT (57) == 0,
with the extra bit falling off the end.  So we place the disabled stage
at the beginning of the URB (overlapping with push constants).  This is
likely okay since it's a zero size region (0 entries).

It seems like the Vulkan driver might hit this assertion, however, and
the situation seems harmless.  To work around this, always place
disabled stages at the start of the URB, so the last enabled stage can
fill the remaining space without overflowing the field.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
6 years agoandroid: radv: add libmesa_git_sha1 static dependency
Mauro Rossi [Tue, 30 Oct 2018 21:35:43 +0000 (22:35 +0100)]
android: radv: add libmesa_git_sha1 static dependency

libmesa_git_sha1 whole static dependency is added to get git_sha1.h header
and avoid following building error:

external/mesa/src/amd/vulkan/radv_device.c:46:10:
fatal error: 'git_sha1.h' file not found
         ^
1 error generated.

Fixes: 9d40ec2cf6 ("radv: Add support for VK_KHR_driver_properties.")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agovc4: Use the normal simulator ioctl path for CL submit as well.
Eric Anholt [Fri, 2 Nov 2018 19:33:04 +0000 (12:33 -0700)]
vc4: Use the normal simulator ioctl path for CL submit as well.

The simulator no longer needs to look back into the gallium structs.

6 years agovc4: Maintain a separate GEM mapping of BOs in the simulator.
Eric Anholt [Fri, 2 Nov 2018 19:03:36 +0000 (12:03 -0700)]
vc4: Maintain a separate GEM mapping of BOs in the simulator.

This will let us avoid looking back into the gallium driver's vc4_bo.

6 years agovc4: Take advantage of _mesa_hash_table_remove_key() in the simulator.
Eric Anholt [Fri, 2 Nov 2018 18:57:14 +0000 (11:57 -0700)]
vc4: Take advantage of _mesa_hash_table_remove_key() in the simulator.

6 years agov3d: Remove the special path for simulaton of the submit ioctl.
Eric Anholt [Fri, 2 Nov 2018 18:51:58 +0000 (11:51 -0700)]
v3d: Remove the special path for simulaton of the submit ioctl.

Now that it doesn't need to find the struct v3d_bos, it can just take the
normal v3d_ioctl() path.

6 years agov3d: Maintain a mapping of the GEM buffer in the simulator.
Eric Anholt [Fri, 2 Nov 2018 18:43:27 +0000 (11:43 -0700)]
v3d: Maintain a mapping of the GEM buffer in the simulator.

This way we don't need to reach back into the gallium driver code to get
the mapping.

6 years agomeson: link gallium nine with pthreads
Dylan Baker [Thu, 1 Nov 2018 21:12:57 +0000 (14:12 -0700)]
meson: link gallium nine with pthreads

In some cases (not building with llvm, which automatically pulls in
pthreads) nine needs to be directly linked with pthreads. Fixes building
on x86 (32 bit) without llvm.

Distro bug: https://bugs.gentoo.org/670094
Fixes: 6b4c7047d57178d3362a710ad503057c6a582ca3
       ("meson: build gallium nine state_tracker")
Tested-by: Rafal Lalik <rafallalik@gmail.com>
Reviewed-by: Matt Turner <mattst88@gmail.com>
6 years agoanv/icl: Disable prefetching of sampler state entries
Anuj Phogat [Wed, 24 Oct 2018 18:35:42 +0000 (11:35 -0700)]
anv/icl: Disable prefetching of sampler state entries

WA_1606682166:
Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes.
Disable the Sampler state prefetch functionality in the SARB by
programming 0xB000[30] to '1'. This is to be done at boot time and
the feature must remain disabled permanently.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoi965/icl: Disable prefetching of sampler state entries
Topi Pohjolainen [Wed, 24 Oct 2018 18:33:53 +0000 (11:33 -0700)]
i965/icl: Disable prefetching of sampler state entries

In the same spirit as commit a5889d70f2074201ceaeac4f96a9a0c0b1f68a31
"i965/icl: Disable binding table prefetching". Fixes some 110+
intermittent piglit failures with tex-miplevel-selection variants.

WA_1606682166:
Incorrect TDL's SSP address shift in SARB for 16:6 & 18:8 modes.
Disable the Sampler state prefetch functionality in the SARB by
programming 0xB000[30] to '1'. This is to be done at boot time and
the feature must remain disabled permanently.

Anuj: Set SamplerCount = 0 for vs, gs, hs, ds and wm units as well.

Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
6 years agoamd: Make vgpr-spilling depend on llvm version
Jan Vesely [Thu, 1 Nov 2018 18:30:08 +0000 (14:30 -0400)]
amd: Make vgpr-spilling depend on llvm version

The option was removed in LLVM r345763

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
6 years agonir: fix condition propagation when src has a swizzle
Timothy Arceri [Fri, 2 Nov 2018 11:10:36 +0000 (22:10 +1100)]
nir: fix condition propagation when src has a swizzle

We cannot use nir_build_alu() to create the new alu as it has no
way to know how many components of the src we will use. This
results in it guessing the max number of components from one of
its inputs.

Fixes the following CTS tests:

dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_frag
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_geom
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_tessc
dEQP-VK.spirv_assembly.instruction.graphics.selection_block_order.out_of_order_vert

Fixes: 2975422ceb6c ("nir: propagates if condition evaluation down some alu chains")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agoandroid: gallium/auxiliary: add include to get u_debug.h header
Mauro Rossi [Wed, 31 Oct 2018 14:53:21 +0000 (15:53 +0100)]
android: gallium/auxiliary: add include to get u_debug.h header

To avoid build error in u_debug_stack_android.cpp
due to now missing u_debug.h header:

external/mesa/src/gallium/auxiliary/util/u_debug_stack_android.cpp:26:10:
fatal error: 'u_debug.h' file not found
#include "u_debug.h"
         ^
1 error generated.

Fixes: 37db383abb ("util: Move u_debug to utils")
Signed-off-by: Mauro Rossi <issor.oruam@gmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agovirgl/vtest-winsys: Use virgl version of bind flags
Gert Wollny [Thu, 1 Nov 2018 09:49:58 +0000 (10:49 +0100)]
virgl/vtest-winsys: Use virgl version of bind flags

The bind flags defined by mesa/gallium might not always be in sync
with the ones copied to virglrenderer/gallium. Therefore, use the
flags defined in virgl like it is done for all the other calls to
create resources.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agomesa/st: Add support for EXT_texture_sRGB_R8
Gert Wollny [Thu, 1 Nov 2018 11:59:26 +0000 (12:59 +0100)]
mesa/st: Add support for EXT_texture_sRGB_R8

This only adds support on the Gallium core level, for the drivers
it is likely that additional changes are needed to support the
new texture format and thereby enabling the extension.

Enables on softpipe and makes pass:
  dEQP-GLES31.functional.srgb_texture_decode.skip_decode.sr8.*

v2: - add include for getting GL_SR8_EXT
v4: - since the extension is not required don't bother providing
      a fallback (Ilia Mirkin)
    - split patch (2/2) to separate Gallium and mesa/st parts
      (Roland Scheidegger)
    - trim commit message to only contain the history of the patch
      relevant to this part
v5: - don't include GLES headers (required enum has been added to glheader.h)
      (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
6 years agoGallium: Add format PIPE_FORMAT_R8_SRGB
Gert Wollny [Thu, 1 Nov 2018 11:59:25 +0000 (12:59 +0100)]
Gallium: Add format PIPE_FORMAT_R8_SRGB

This format is needed to support EXT_texture_sRGB_R8. THe patch adds a new
format enum, the format entries in Gallium and and svga, the mapping between
sRGB and linear formats, and tests.

  v2: - add mapping to linear format for PIPE_FORMATR_R8_SRGB
  v3: - Add texture format to svga format table since otherwise building
        mesa will fail when this driver is enabled. It was not tested
        whether the extension actually works.
  v4: - svga: remove the SVGA specific format definitions and table entries
        and only add correct the location of PIPE_FORMAT_R8_SRGB in the
        format_conversion_table (Ilia Mirkin)
      - Split patch (1/2) to separate Gallium part and mesa/st part.
        (Roland Scheidegger)
      - Trim the commit message to only contain the relevant parts from the
        split.
  v5: - svga: correct location of PIPE_FORMAT_SRGB_R8 (Ilia Mirkin)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>