mesa.git
5 years agogallium/hud: add frametime graph (v2)
Matthias Groß [Tue, 15 May 2018 21:09:05 +0000 (23:09 +0200)]
gallium/hud: add frametime graph (v2)

Thanks for your comment. This version has an additional boolean in the
fps_info struct to distinguish between fps and frame time calculation.
The struct is initialised in the respecting install functions for this
purpose.

Signed-off-by: Marek Olšák <marek.olsak@amd.com>
5 years agoeg/compute: Use reference counting to handle compute memory pool.
Jan Vesely [Thu, 3 May 2018 23:26:29 +0000 (19:26 -0400)]
eg/compute: Use reference counting to handle compute memory pool.

Use pipe_reference to release old RAT surfaces.
RAT surface adds a reference to pool bo, so use reference counting for pool->bo
as well.

v2: Use the same pattern for both defrag paths
    Drop confusing comment

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Dave Airlie <airlied@redhat.com>
5 years agogallivm: Use alloca_undef with array type instead of alloca_array
Roland Scheidegger [Tue, 15 May 2018 02:35:50 +0000 (04:35 +0200)]
gallivm: Use alloca_undef with array type instead of alloca_array

Use a single allocation of array type instead of the old-style array
allocation for the temp and immediate arrays.
Probably only makes a difference if they aren't used indirectly (so,
if we used them solely because there's too many temps or immediates).
In this case the sroa and early-cse passes can sometimes do some
optimizations which they otherwise cannot.
(As a side note, for the temp reg array, we actually really should
use one allocation per array id, not just one for everything.)
Note that the instcombine pass would actually promote such
allocations to single alloc of array type as well, but it's too late
for some artificial shaders we've seen to help (we don't want to run
instcombine at the beginning due to its cost, hence would need
another sroa/cse pass after instcombine). sroa/early-cse help there
because they can actually eliminate all of the huge shader, reducing
it to a single const output (don't ask...).
(Interestingly, instcombine also removes all the bitcasts we do on that
allocation for single-value gathering, and in the end directly indexes
into the single vector elements, which according to spec is only
semi-valid, but this happens regardless. Another thing instcombine also
does is use inbound GEPs, which is probably something we should do
manually as well - for indirectly indexed reg files llvm may not be
able to figure it out on its own, but we should be able to guarantee
all pointers are always inbound. In any case, by the looks of it
using single allocation with array type seems to be the right thing
to do even for ordinary shaders.)
No piglit change.

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
5 years agoradv: add generated files to .gitignore(s)
Dieter Nützel [Sun, 13 May 2018 21:10:07 +0000 (23:10 +0200)]
radv: add generated files to .gitignore(s)

Signed-off-by: Dieter Nützel <Dieter@nuetzel-hh.de>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agospirv: fix visiting inner loops with same break/continue block
Samuel Pitoiset [Tue, 15 May 2018 10:00:30 +0000 (12:00 +0200)]
spirv: fix visiting inner loops with same break/continue block

We should stop walking through the CFG when the inner loop's
break block ends up as the same block as the outer loop's
continue block because we are already going to visit it.

This fixes the following assertion which ends up by crashing
in RADV or ANV:

SPIR-V parsing FAILED:
In file ../src/compiler/spirv/vtn_cfg.c:381
block->node.link.next == NULL
0 bytes into the SPIR-V binary

This also fixes a crash with a camera shader from SteamVR.

v2: make use of vtn_get_branch_type() and add an assertion

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106090
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106504
CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agomesa/st: handle vert_attrib_mask in nir case too
Rob Clark [Tue, 15 May 2018 18:29:46 +0000 (14:29 -0400)]
mesa/st: handle vert_attrib_mask in nir case too

Note, actually fixes 9987a072cb, but the problems don't show up until
19a91841c3.

Fixes: 19a91841c3 st/mesa: Use Array._DrawVAO in st_atom_array.c.
Fixes: 9987a072cb st/mesa: Make the input_to_index array available.
Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Mathias Fröhlich <mathias.froehlich@web.de>
5 years agocso: check count == 0 in cso_set_vertex_buffers
Marek Olšák [Tue, 15 May 2018 02:32:33 +0000 (22:32 -0400)]
cso: check count == 0 in cso_set_vertex_buffers

The code didn't expect that, leading to crashes.

Fixes: 86d63b53a20a747e "gallium: remove aux_vertex_buffer_slot code"
Tested-by: Michel Dänzer <michel.daenzer@amd.com>
5 years agovc5: use util_copy_framebuffer_state
Rob Clark [Mon, 14 May 2018 13:09:17 +0000 (09:09 -0400)]
vc5: use util_copy_framebuffer_state

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agovc4: use util_copy_framebuffer_state
Rob Clark [Mon, 14 May 2018 13:08:43 +0000 (09:08 -0400)]
vc4: use util_copy_framebuffer_state

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agofreedreno/a5xx: remove fd5_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:19:22 +0000 (08:19 -0400)]
freedreno/a5xx: remove fd5_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/a4xx: remove fd4_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:16:37 +0000 (08:16 -0400)]
freedreno/a4xx: remove fd4_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno/a3xx: remove fd3_shader_stateobj
Rob Clark [Fri, 11 May 2018 12:11:01 +0000 (08:11 -0400)]
freedreno/a3xx: remove fd3_shader_stateobj

Extra level of indirection that serves no purpose.

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno: fence should hold a ref to pipe
Rob Clark [Wed, 9 May 2018 11:52:53 +0000 (07:52 -0400)]
freedreno: fence should hold a ref to pipe

Since the fence can outlive the context, and all it really needs to wait
on a fence is the pipe, use the new fd_pipe reference counting to hold a
ref to the pipe and drop the ctx pointer.

This fixes a crash seen with (for example) glmark2:

  #0  fd_pipe_wait_timeout (pipe=0xbf48678b3cd7b32b, timestamp=0, timeout=18446744073709551615) at freedreno_pipe.c:101
  #1  0x0000ffffbdf75914 in fd_fence_finish (pscreen=0x561110, ctx=0x0, fence=0xc55c10, timeout=18446744073709551615) at ../src/gallium/drivers/freedreno/freedreno_fence.c:96
  #2  0x0000ffffbde154e4 in dri_flush (cPriv=0xb1ff80, dPriv=0x556660, flags=3, reason=__DRI2_THROTTLE_SWAPBUFFER) at ../src/gallium/state_trackers/dri/dri_drawable.c:569
  #3  0x0000ffffbecd8b44 in loader_dri3_flush (draw=0x558a28, flags=3, throttle_reason=__DRI2_THROTTLE_SWAPBUFFER) at ../src/loader/loader_dri3_helper.c:656
  #4  0x0000ffffbecbc36c in glx_dri3_flush_drawable (draw=0x558a28, flags=3) at ../src/glx/dri3_glx.c:132
  #5  0x0000ffffbecd91e8 in loader_dri3_swap_buffers_msc (draw=0x558a28, target_msc=0, divisor=0, remainder=0, flush_flags=3, force_copy=false) at ../src/loader/loader_dri3_helper.c:827
  #6  0x0000ffffbecbcfc4 in dri3_swap_buffers (pdraw=0x5589f0, target_msc=0, divisor=0, remainder=0, flush=1) at ../src/glx/dri3_glx.c:587
  #7  0x0000ffffbec98218 in glXSwapBuffers (dpy=0x502bb0, drawable=2097154) at ../src/glx/glxcmds.c:840
  #8  0x000000000040994c in CanvasGeneric::update (this=0xfffffffff400) at ../src/canvas-generic.cpp:114
  #9  0x0000000000411594 in MainLoop::step (this=this@entry=0x5728f0) at ../src/main-loop.cpp:108
  #10 0x0000000000409498 in do_benchmark (canvas=...) at ../src/main.cpp:117
  #11 0x00000000004071b0 in main (argc=<optimized out>, argv=<optimized out>) at ../src/main.cpp:210

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agofreedreno: batch cache doesn't hold a ref to batch
Rob Clark [Tue, 8 May 2018 17:38:18 +0000 (13:38 -0400)]
freedreno: batch cache doesn't hold a ref to batch

The cache doesn't hold a (strong) reference to the batch.  So we
shouldn't be trying to drop a reference, as that leads to:

   #0  0x0000ffffbecb37a0 in raise () from /lib64/libc.so.6
   #1  0x0000ffffbeca159c in abort () from /lib64/libc.so.6
   #2  0x0000ffffbecacf48 in __assert_fail_base () from /lib64/libc.so.6
   #3  0x0000ffffbecacfa8 in __assert_fail () from /lib64/libc.so.6
   #4  0x0000ffffbd28def0 in pipe_reference_described (ptr=0x4f47130, reference=0x0, get_desc=0xffffbd2e0f08 <__fd_batch_describe>) at ../src/gallium/auxiliary/util/u_inlines.h:88
   #5  0x0000ffffbd28e188 in fd_batch_reference_locked (ptr=0x4f40de0, batch=0x0) at ../src/gallium/drivers/freedreno/freedreno_batch.h:258
   #6  0x0000ffffbd28e9a8 in fd_bc_invalidate_resource (rsc=0x4f40ca0, destroy=true) at ../src/gallium/drivers/freedreno/freedreno_batch_cache.c:244
   #7  0x0000ffffbd293778 in fd_resource_destroy (pscreen=0xedc170, prsc=0x4f40ca0) at ../src/gallium/drivers/freedreno/freedreno_resource.c:644
   #8  0x0000ffffbd922674 in u_transfer_helper_resource_destroy (pscreen=0xedc170, prsc=0x4f40ca0) at ../src/gallium/auxiliary/util/u_transfer_helper.c:144
   #9  0x0000ffffbd29527c in pipe_resource_reference (ptr=0x4f455d8, tex=0x0) at ../src/gallium/auxiliary/util/u_inlines.h:144
   #10 0x0000ffffbd29548c in fd_surface_destroy (pctx=0x1012720, psurf=0x4f455d0) at ../src/gallium/drivers/freedreno/freedreno_surface.c:78
   #11 0x0000ffffbd1f9c48 in pipe_surface_reference (ptr=0x4f471d0, surf=0x0) at ../src/gallium/auxiliary/util/u_inlines.h:113
   #12 0x0000ffffbd1f9ef4 in util_copy_framebuffer_state (dst=0x4f471c8, src=0x0) at ../src/gallium/auxiliary/util/u_framebuffer.c:114
   #13 0x0000ffffbd2e0e30 in __fd_batch_destroy (batch=0x4f47130) at ../src/gallium/drivers/freedreno/freedreno_batch.c:225
   #14 0x0000ffffbd28e1b0 in fd_batch_reference_locked (ptr=0xfffffffff010, batch=0x0) at ../src/gallium/drivers/freedreno/freedreno_batch.h:262
   #15 0x0000ffffbd28e6b0 in fd_bc_invalidate_context (ctx=0x1012720) at ../src/gallium/drivers/freedreno/freedreno_batch_cache.c:190
   #16 0x0000ffffbd2e2b6c in fd_context_destroy (pctx=0x1012720) at ../src/gallium/drivers/freedreno/freedreno_context.c:139
   #17 0x0000ffffbd2c3280 in fd5_context_destroy (pctx=0x1012720) at ../src/gallium/drivers/freedreno/a5xx/fd5_context.c:56
   #18 0x0000ffffbd5b7a8c in st_destroy_context_priv (st=0xfd72f0, destroy_pipe=true) at ../src/mesa/state_tracker/st_context.c:281

Signed-off-by: Rob Clark <robdclark@gmail.com>
5 years agodocs/meson: mark code/commands as <code>
Eric Engestrom [Mon, 14 May 2018 15:47:57 +0000 (16:47 +0100)]
docs/meson: mark code/commands as <code>

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodocs/meson: replace plaintext url with a link
Eric Engestrom [Mon, 14 May 2018 15:47:18 +0000 (16:47 +0100)]
docs/meson: replace plaintext url with a link

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodocs/meson: fix various html issues
Eric Engestrom [Mon, 14 May 2018 15:45:31 +0000 (16:45 +0100)]
docs/meson: fix various html issues

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agodocs/meson: fix various typos
Eric Engestrom [Mon, 14 May 2018 15:44:08 +0000 (16:44 +0100)]
docs/meson: fix various typos

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agomeson: fix copyright symbol
Eric Engestrom [Tue, 15 May 2018 09:29:36 +0000 (10:29 +0100)]
meson: fix copyright symbol

Fixes: bd68f1013cea8742390c "autotools, meson: add tileset.h"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoautotools, meson: add tileset.h
Juan A. Suarez Romero [Mon, 14 May 2018 11:32:54 +0000 (13:32 +0200)]
autotools, meson: add tileset.h

Fixes: 4e52cb51b5 ("swr/rast: Thread locked tiles improvement")
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agost/xa: Bump minor
Thomas Hellstrom [Thu, 8 Mar 2018 07:56:47 +0000 (08:56 +0100)]
st/xa: Bump minor

Bump xa minor to signal that the underlying mesa version is suitable for dri3.

This is a bit ugly since it doesn't relate to a specific xa interface change.
Recently there has been a number of fixes in mesa that helps enabling dri3
without any significant regressions in automated testing and common desktop
usage latency. However, the xf86-video-vmware driver has no other way to tell
but inspecting the xa version.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agovirgl: enable vertex streams when glsl level is high enough.
Dave Airlie [Mon, 21 Dec 2015 06:59:58 +0000 (16:59 +1000)]
virgl: enable vertex streams when glsl level is high enough.

This enabled the vertex streams out when the host supports
GL4.0.

5 years agoopencl: autotools: Fix linking order for OpenCL target
Kai Wasserbäch [Tue, 1 May 2018 12:14:46 +0000 (14:14 +0200)]
opencl: autotools: Fix linking order for OpenCL target

Otherwise the build fails with an undefined reference to
clang::FrontendTimesIsEnabled.

Bugzilla: https://bugs.freedesktop.org/106209
Cc: Jan Vesely <jan.vesely@rutgers.edu>
Cc: mesa-stable@lists.freedesktop.org
Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Acked-by: Jan Vesely <jan.vesely@rutgers.edu>
Tested-by: Aaron Watry <awatry@gmail.com>
Tested-by: Dieter Nützel <Dieter@nuetzel-hh.de>
5 years agoradv: reduce the number of parameters export by the GS copy shader
Samuel Pitoiset [Mon, 14 May 2018 14:04:36 +0000 (16:04 +0200)]
radv: reduce the number of parameters export by the GS copy shader

By using the geometry shader output usage mask.

This improves all Vulkan demos that use a geometry shader
(ie. geometryshader, deferredshadows, viewportarray).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: scan the geometry shader output usage mask
Samuel Pitoiset [Mon, 14 May 2018 14:04:35 +0000 (16:04 +0200)]
radv: scan the geometry shader output usage mask

For reducing the number of parameters that are exported by
the GS copy shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: run the shader info pass before emitting the GS copy shader
Samuel Pitoiset [Mon, 14 May 2018 14:04:34 +0000 (16:04 +0200)]
radv: run the shader info pass before emitting the GS copy shader

For further optimizations.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agoradv: check that layout isn't NULL in radv_nir_shader_info_pass()
Samuel Pitoiset [Mon, 14 May 2018 14:04:33 +0000 (16:04 +0200)]
radv: check that layout isn't NULL in radv_nir_shader_info_pass()

An upcoming patch will run the shader info pass on the
geometry shader just before emitting the GS copy shader.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
5 years agointel/blorp: Use linear formats for CCS_E clear colors in copies
Jason Ekstrand [Fri, 11 May 2018 22:02:13 +0000 (15:02 -0700)]
intel/blorp: Use linear formats for CCS_E clear colors in copies

It's clear that the original code meant to do this and there is even a
10-line comment explaining why.  Originally, we had a simple function
for packing the clear colors which was unaware of sRGB.  However, in
a6b66a7b26ae1, when we started using ISL to do the packing, the wrong
format was used.

Fixes: a6b66a7b26 "intel/blorp: Use ISL instead of bitcast_color..."
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
5 years agoradv: Disable texel buffers with A2 SNORM/SSCALED/SINT for pre-vega.
Bas Nieuwenhuizen [Sat, 12 May 2018 21:56:56 +0000 (23:56 +0200)]
radv: Disable texel buffers with A2 SNORM/SSCALED/SINT for pre-vega.

The hardware always interprets the alpha as unsigned and fixing it
in the shader is going to add unacceptable overheads.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106480
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Fix up 2_10_10_10 alpha sign.
Bas Nieuwenhuizen [Sat, 12 May 2018 21:50:04 +0000 (23:50 +0200)]
radv: Fix up 2_10_10_10 alpha sign.

Pre-Vega HW always interprets the alpha for this format as unsigned,
so we have to implement a fixup to do the sign correctly for signed
formats.

v2: Improve indexing mess.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106480
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Add support for IMG_DATA_FORMAT_32_32_32.
Bas Nieuwenhuizen [Tue, 1 May 2018 02:03:34 +0000 (04:03 +0200)]
radv: Add support for IMG_DATA_FORMAT_32_32_32.

Basic sampling support for linear tiling.

No CTS regressions, but it seems the blitting coverage is not very
extensive.

https://bugs.freedesktop.org/show_bug.cgi?id=106331
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Translate logic ops.
Bas Nieuwenhuizen [Mon, 14 May 2018 01:01:21 +0000 (03:01 +0200)]
radv: Translate logic ops.

radeonsi could pass them through but the enum changed between
Gallium and Vulkan, so we have to translate.

In progress I made the register defines a bit more readable.

CC: 18.0 18.1 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=100430
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agoradv: Fix multiview queries.
Bas Nieuwenhuizen [Sun, 13 May 2018 20:01:44 +0000 (22:01 +0200)]
radv: Fix multiview queries.

This moves the extra queries to after the main query ended, instead
of doing it after the begin and hence doing nesting.

We also emit only (view count - 1) extra queries, as the main query
is already there for the first view.

This fixes the CTS occasionally getting stuck in
dEQP-VK.multiview.queries* waiting on results.

Fixes: 32b4f3c38dc "radv/query: handle multiview queries properly. (v3)"
CC: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
5 years agomeson: remove dependency antipattern
Eric Engestrom [Tue, 8 May 2018 15:40:24 +0000 (16:40 +0100)]
meson: remove dependency antipattern

`dep_valgrind != []` now (0.45) produces a warning that is quite explicit:
  WARNING: Trying to compare values of different types (DependencyHolder, list) using !=.
  The result of this is undefined and will become a hard error in a future Meson release.

`dep_valgrind = []` used to be the recommended way to deal with
non-existant dependency, but these don't work with `.found()`, so now
the recommended way is to declare a impossible dependency, which
null_dep does for us in Mesa.

In short, we don't need and shouldn't check for `!= []` anywhere anymore.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
5 years agoradv: remove useless check in radv_create_shaders()
Samuel Pitoiset [Fri, 11 May 2018 14:36:52 +0000 (16:36 +0200)]
radv: remove useless check in radv_create_shaders()

radv_can_dump_shader() already handles if module is NULL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradv: allow to dump the GS copy shader with RADV_DEBUG="shaders"
Samuel Pitoiset [Fri, 11 May 2018 14:36:02 +0000 (16:36 +0200)]
radv: allow to dump the GS copy shader with RADV_DEBUG="shaders"

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradv: move {load,store}_var intrinsics scanning in different functions
Samuel Pitoiset [Thu, 10 May 2018 15:15:41 +0000 (17:15 +0200)]
radv: move {load,store}_var intrinsics scanning in different functions

These are going to be crazy and we are probably going to add
more scan stuff in the future. Also use switch cases instead.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoandroid: change include "cutils/log.h" to "log/log.h" on Android API >=26
jenny.q.cao [Fri, 27 Apr 2018 02:11:36 +0000 (10:11 +0800)]
android: change include "cutils/log.h" to "log/log.h" on Android API >=26

There is a compile warning from Android 8 (API version 26) from "include cutils/log.h"
warning: "Deprecated: don't include cutils/log.h, use either android/log.h or log/log.h"-W#warnings,
Change to include "log/log.h" on Android 8 or later major version to avoid this warning

Signed-off-by: jenny.q.cao <jenny.q.cao@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
5 years agollvmpipe: Fix random number generation for unit tests
Roland Scheidegger [Mon, 7 May 2018 19:04:27 +0000 (21:04 +0200)]
llvmpipe: Fix random number generation for unit tests

We were never producing negative numbers for signed types.
Also fix only producing half the valid range for uint32, and
properly clamp signed values.

Because this now also properly tests snorm with actually negative
values, need to increase eps for such conversions. I believe these
cannot actually be hit in ordinary operation (e.g. if a snorm texture
is sampled and output to snorm RT, it will still go through snorm->float
and float->snorm conversion), so don't bother to do anything to fix
the bad accuracy (might be quite complex).
Basically, the issue is for something like snorm16->snorm8 that in the
end this will just use a 8 bit arithmetic right shift.
But the math behind it says we should actually do a division by 32767 / 127, which
is ~258, not 256. So the result can be one bit off (values have too large
magnitude), and furthermore, the shift has incorrect rounding (always rounds
down). For positive numbers, these errors have different direction, but
for negative ones they have the same, hence for some values the error will
be 2 bit in the end.

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=106232
5 years agoradv: use compute path for multi-layer images.
Dave Airlie [Fri, 11 May 2018 04:55:29 +0000 (14:55 +1000)]
radv: use compute path for multi-layer images.

I don't think the hw resolve path can't handle multi-layer images.

This fixes all the:
dEQP-VK.renderpass.multisample_resolve.layers_*
tests on my VI card.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: <mesa-stable@lists.freedesktop.org>
5 years agoradv: resolve all layers in compute resolve path.
Dave Airlie [Fri, 11 May 2018 04:54:21 +0000 (14:54 +1000)]
radv: resolve all layers in compute resolve path.

This path should iterate across all layers, I've some ideas
for doing this in a single pass, but this is simpler for now.

This passes the tests because we don't use the fragment path
unless we have DCC, and we don't have DCC on layered images.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: <mesa-stable@lists.freedesktop.org>
5 years agoradv/resolve: do fmask decompress on all layers.
Dave Airlie [Fri, 11 May 2018 04:53:28 +0000 (14:53 +1000)]
radv/resolve: do fmask decompress on all layers.

For a multi-layer subpass resolve we want to make sure we flush all
the layers.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Cc: <mesa-stable@lists.freedesktop.org>
5 years agonvc0: fix setting of subpixel precision during conservative rasterization
Rhys Perry [Fri, 11 May 2018 12:03:28 +0000 (13:03 +0100)]
nvc0: fix setting of subpixel precision during conservative rasterization

Fixes: 07dac3e040 ("nvc0: add conservative rasterization support")
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
5 years agoanv,nir: add generated files to .gitignore(s)
Rhys Perry [Fri, 11 May 2018 12:12:05 +0000 (13:12 +0100)]
anv,nir: add generated files to .gitignore(s)

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
5 years agogallium: remove aux_vertex_buffer_slot code
Marek Olšák [Tue, 8 May 2018 21:31:46 +0000 (17:31 -0400)]
gallium: remove aux_vertex_buffer_slot code

The slot index is always 0, and is pretty unlikely to change in the future.

Reviewed-by: Brian Paul <brianp@vmware.com>
5 years agoradv: add initial support for VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT
Timothy Arceri [Tue, 8 May 2018 04:57:55 +0000 (14:57 +1000)]
radv: add initial support for VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT

When VK_PIPELINE_CREATE_DISABLE_OPTIMIZATION_BIT is set we skip NIR
linking optimisations and only run over the NIR optimisation loop
once similar to the GLSLOptimizeConservatively constant used by
some GL drivers.

We need to run over the opts at least once to avoid errors in LLVM
(e.g. dead vars it can't handle) and also to reduce the time spent
compiling the IR in LLVM.

With this change the Blacksmith Unity demos compilation times
go from 329760 ms -> 299881 ms when using Wine and DXVK.

V2: add bit to radv_pipeline_key

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106246

5 years agoscons: Add PROGRAM_NIR_FILES.
Vinson Lee [Sat, 12 May 2018 07:27:52 +0000 (00:27 -0700)]
scons: Add PROGRAM_NIR_FILES.

Fix SCons build error.

  Linking build/linux-x86_64-debug/gallium/targets/libgl-xlib/libGL.so.1.5 ...
build/linux-x86_64-debug/mesa/libmesa.a(st_program.os): In function `st_translate_prog_to_nir':
src/mesa/state_tracker/st_program.c:392: undefined reference to `prog_to_nir'

Fixes: 5c33e8c7729e ("st/nir: use NIR for asm programs")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
5 years agost/nir: use NIR for asm programs
Timothy Arceri [Wed, 9 May 2018 03:28:05 +0000 (13:28 +1000)]
st/nir: use NIR for asm programs

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agost/nir: make st_nir_opts() available externally
Timothy Arceri [Wed, 9 May 2018 03:25:46 +0000 (13:25 +1000)]
st/nir: make st_nir_opts() available externally

The following patch will make use of this for asm style programs.

Reviewed-by: Eric Anholt <eric@anholt.net>
5 years agoradeon/vce: add firmware support for ver 53 and up
Boyuan Zhang [Tue, 8 May 2018 18:35:06 +0000 (14:35 -0400)]
radeon/vce: add firmware support for ver 53 and up

All vce firmwares with major version greater than or equal to 53 are supported

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
5 years agoetnaviv: remove pipe_fence_handle::ctx
Rob Clark [Wed, 9 May 2018 01:00:18 +0000 (21:00 -0400)]
etnaviv: remove pipe_fence_handle::ctx

A fence can outlive the ctx it was created from (see glmark2).. etnaviv
doesn't actually need fence->ctx so lets remove it before someone makes
the mistake of assuming it is a valid pointer.

Signed-off-by: Rob Clark <robdclark@gmail.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
5 years agoswr/rast: Thread locked tiles improvement
George Kyriazis [Wed, 2 May 2018 00:33:38 +0000 (19:33 -0500)]
swr/rast: Thread locked tiles improvement

- Change tilemgr TILE_ID encoding to use Morton-order (Z-order).
- Change locked tiles set to bitset.  Makes clear, set, get much faster.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Add Builder::GetVectorType()
George Kyriazis [Tue, 1 May 2018 21:33:19 +0000 (16:33 -0500)]
swr/rast: Add Builder::GetVectorType()

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Prepend the console output with a newline
George Kyriazis [Mon, 30 Apr 2018 22:45:55 +0000 (17:45 -0500)]
swr/rast: Prepend the console output with a newline

It can get jumbled with output from other threads.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Add ConcatLists()
George Kyriazis [Fri, 27 Apr 2018 23:05:00 +0000 (18:05 -0500)]
swr/rast: Add ConcatLists()

for concatenating lists

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Add constant initializer for uint64_t
George Kyriazis [Fri, 27 Apr 2018 00:29:40 +0000 (19:29 -0500)]
swr/rast: Add constant initializer for uint64_t

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Use binner topology to assemble backend attributes
George Kyriazis [Thu, 26 Apr 2018 21:12:24 +0000 (16:12 -0500)]
swr/rast: Use binner topology to assemble backend attributes

Previously was using the draw topology, which may change if GS or Tess
are active. Only affected attributes marked with constant interpolation,
which limited the impact.

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agoswr/rast: Change formatting
George Kyriazis [Thu, 26 Apr 2018 03:20:01 +0000 (22:20 -0500)]
swr/rast: Change formatting

Reviewed-by: Bruce Cherniak <bruce.cherniak@intel.com>
5 years agomeson: Fix build for egl platform_x11 with dri3
Ville Syrjälä [Mon, 7 May 2018 16:20:23 +0000 (19:20 +0300)]
meson: Fix build for egl platform_x11 with dri3

platform_x11 with dri3 needs inc_loader.

In file included from ../src/egl/drivers/dri2/platform_x11_dri3.c:35:0:
../src/egl/drivers/dri2/egl_dri2.h:41:32: fatal error: loader_dri3_helper.h: No such file or directory
In file included from ../src/egl/drivers/dri2/platform_x11.c:46:0:
../src/egl/drivers/dri2/egl_dri2.h:41:32: fatal error: loader_dri3_helper.h: No such file or directory
In file included from ../src/egl/drivers/dri2/egl_dri2.c:61:0:
../src/egl/drivers/dri2/egl_dri2.h:41:32: fatal error: loader_dri3_helper.h: No such file or directory

Cc: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
5 years agoradv: move ac_build_if_state on top of radv_nir_to_llvm.c
Samuel Pitoiset [Fri, 11 May 2018 07:37:11 +0000 (09:37 +0200)]
radv: move ac_build_if_state on top of radv_nir_to_llvm.c

These helpers will be needed for future work.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agoradv: minor cleanups in radv_fill_shader_variant()
Samuel Pitoiset [Fri, 11 May 2018 07:46:46 +0000 (09:46 +0200)]
radv: minor cleanups in radv_fill_shader_variant()

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
5 years agowinsys/amdgpu: Destroy dev_hash table when the last winsys is removed.
Jan Vesely [Thu, 10 May 2018 22:29:13 +0000 (18:29 -0400)]
winsys/amdgpu: Destroy dev_hash table when the last winsys is removed.

Fixes memory leak on module unload.

CC: <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
5 years agoac/gpu_info: add has_read_registers_query
Marek Olšák [Thu, 3 May 2018 00:01:39 +0000 (20:01 -0400)]
ac/gpu_info: add has_read_registers_query

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_2d_tiling
Marek Olšák [Wed, 2 May 2018 23:54:35 +0000 (19:54 -0400)]
ac/gpu_info: add has_2d_tiling

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_sparse_vm_mappings
Marek Olšák [Wed, 2 May 2018 23:48:37 +0000 (19:48 -0400)]
ac/gpu_info: add has_sparse_vm_mappings

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_unaligned_shader_loads
Marek Olšák [Wed, 2 May 2018 23:39:08 +0000 (19:39 -0400)]
ac/gpu_info: add has_unaligned_shader_loads

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: expose ARB_query_buffer_object on ancient kernels too
Marek Olšák [Wed, 2 May 2018 23:29:29 +0000 (19:29 -0400)]
radeonsi: expose ARB_query_buffer_object on ancient kernels too

It doesn't use indirect dispatches.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_indirect_compute_dispatch
Marek Olšák [Wed, 2 May 2018 23:28:44 +0000 (19:28 -0400)]
ac/gpu_info: add has_indirect_compute_dispatch

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add kernel_flushes_tc_l2_after_ib
Marek Olšák [Wed, 2 May 2018 23:11:37 +0000 (19:11 -0400)]
ac/gpu_info: add kernel_flushes_tc_l2_after_ib

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_format_bc1_through_bc7
Marek Olšák [Wed, 2 May 2018 23:04:10 +0000 (19:04 -0400)]
ac/gpu_info: add has_format_bc1_through_bc7

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_eqaa_surface_allocator
Marek Olšák [Wed, 2 May 2018 22:59:54 +0000 (18:59 -0400)]
ac/gpu_info: add has_eqaa_surface_allocator

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: clean up the reset status query implementation
Marek Olšák [Wed, 2 May 2018 22:53:24 +0000 (18:53 -0400)]
radeonsi: clean up the reset status query implementation

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add has_bo_metadata
Marek Olšák [Wed, 2 May 2018 22:44:08 +0000 (18:44 -0400)]
ac/gpu_info: add has_bo_metadata

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add si_TA_CS_BC_BASE_ADDR_allowed
Marek Olšák [Wed, 2 May 2018 22:39:04 +0000 (18:39 -0400)]
ac/gpu_info: add si_TA_CS_BC_BASE_ADDR_allowed

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add htile_cmask_support_1d_tiling
Marek Olšák [Wed, 2 May 2018 22:35:27 +0000 (18:35 -0400)]
ac/gpu_info: add htile_cmask_support_1d_tiling

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/gpu_info: add kernel_flushes_hdp_before_ib
Marek Olšák [Wed, 2 May 2018 22:27:18 +0000 (18:27 -0400)]
ac/gpu_info: add kernel_flushes_hdp_before_ib

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: add an environment variable that forces EQAA for MSAA allocations
Marek Olšák [Tue, 1 May 2018 04:44:36 +0000 (00:44 -0400)]
radeonsi: add an environment variable that forces EQAA for MSAA allocations

This is for testing and experiments.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: set up EQAA image descriptors properly
Marek Olšák [Sat, 28 Apr 2018 02:20:39 +0000 (22:20 -0400)]
radeonsi: set up EQAA image descriptors properly

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: add EQAA SC,DB,CB register programming
Marek Olšák [Fri, 27 Apr 2018 04:55:56 +0000 (00:55 -0400)]
radeonsi: add EQAA SC,DB,CB register programming

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: support creating EQAA color textures
Marek Olšák [Tue, 1 May 2018 03:55:31 +0000 (23:55 -0400)]
radeonsi: support creating EQAA color textures

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/surface: add EQAA support
Marek Olšák [Tue, 1 May 2018 02:29:14 +0000 (22:29 -0400)]
ac/surface: add EQAA support

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: use better sample locations for 8x EQAA
Marek Olšák [Wed, 2 May 2018 03:43:45 +0000 (23:43 -0400)]
radeonsi: use better sample locations for 8x EQAA

Verified with the piglit MSAA accuracy test.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: improve quality of 16 sample locations
Marek Olšák [Wed, 2 May 2018 03:17:07 +0000 (23:17 -0400)]
radeonsi: improve quality of 16 sample locations

This results in better 16x and 8x quality when using these locations.
Verified with the piglit MSAA accuracy test.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: use better sample locations for 4x MSAA
Marek Olšák [Wed, 2 May 2018 02:45:24 +0000 (22:45 -0400)]
radeonsi: use better sample locations for 4x MSAA

Discovered by luck. Verified with the piglit MSAA accuracy test.
It also shows that the worst case EQAA 16s4f results in very good 4x MSAA
in the worst case.

Nine might not like these positions, but they are prettier to the eye and
GL doesn't care.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: reorder sample locations as required by EQAA
Marek Olšák [Sat, 28 Apr 2018 01:35:33 +0000 (21:35 -0400)]
radeonsi: reorder sample locations as required by EQAA

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: simplify si_get_sample_position
Marek Olšák [Sat, 28 Apr 2018 02:02:04 +0000 (22:02 -0400)]
radeonsi: simplify si_get_sample_position

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: simplify arrays of sample locations
Marek Olšák [Fri, 27 Apr 2018 01:53:33 +0000 (21:53 -0400)]
radeonsi: simplify arrays of sample locations

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: set DB_EQAA the same as Vulkan
Marek Olšák [Fri, 27 Apr 2018 03:18:41 +0000 (23:18 -0400)]
radeonsi: set DB_EQAA the same as Vulkan

These never change, but they only affect EQAA, which isn't implemented.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: remove CM_ prefixes
Marek Olšák [Fri, 27 Apr 2018 02:54:54 +0000 (22:54 -0400)]
radeonsi: remove CM_ prefixes

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: don't update clear color registers if they don't change
Marek Olšák [Thu, 26 Apr 2018 20:21:19 +0000 (16:21 -0400)]
radeonsi: don't update clear color registers if they don't change

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi: remove r600_fmask_info
Marek Olšák [Tue, 1 May 2018 02:48:00 +0000 (22:48 -0400)]
radeonsi: remove r600_fmask_info

radeon_surf contains almost everything.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/surface: unify common legacy and gfx9 fmask fields
Marek Olšák [Tue, 1 May 2018 02:35:51 +0000 (22:35 -0400)]
ac/surface: unify common legacy and gfx9 fmask fields

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/surface/gfx6: compute FMASK together with the color surface
Marek Olšák [Tue, 1 May 2018 00:54:06 +0000 (20:54 -0400)]
ac/surface/gfx6: compute FMASK together with the color surface

instead of invoking FMASK computation separately.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac/surface/gfx9: fix a typo in CMASK RB/pipe alignment
Marek Olšák [Tue, 1 May 2018 00:20:55 +0000 (20:20 -0400)]
ac/surface/gfx9: fix a typo in CMASK RB/pipe alignment

No change in behavior because it's always aligned.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac: set correct LLVM processor names for Raven & Vega12
Marek Olšák [Mon, 30 Apr 2018 22:10:50 +0000 (18:10 -0400)]
ac: set correct LLVM processor names for Raven & Vega12

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac: sort raster configs
Marek Olšák [Tue, 1 May 2018 17:44:21 +0000 (13:44 -0400)]
ac: sort raster configs

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac: remove 1 RB raster config for Iceland
Marek Olšák [Tue, 1 May 2018 17:08:44 +0000 (13:08 -0400)]
ac: remove 1 RB raster config for Iceland

Iceland always reports 2 RBs.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac: move the Fiji kernel workaround for raster config out of the switch
Marek Olšák [Tue, 1 May 2018 17:08:44 +0000 (13:08 -0400)]
ac: move the Fiji kernel workaround for raster config out of the switch

Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoac: enable both RBs on Kaveri
Marek Olšák [Tue, 1 May 2018 16:48:05 +0000 (12:48 -0400)]
ac: enable both RBs on Kaveri

This can result in 2x increase in performance on non-harvested Kaveris.

v2: don't do it on radeon

Tested-by: Michel Dänzer <michel.daenzer@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
5 years agoradeonsi/gfx9: work around a GPU hang due to broken indirect indexing in LLVM
Marek Olšák [Wed, 2 May 2018 00:16:19 +0000 (20:16 -0400)]
radeonsi/gfx9: work around a GPU hang due to broken indirect indexing in LLVM

Fixes: 6d19120da85 "radeonsi/gfx9: workaround for INTERP with indirect indexing"
Cc: 18.1 <mesa-stable@lists.freedesktop.org>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>