mesa.git
6 years agor600: use build-id when available for disk cache
Timothy Arceri [Wed, 19 Sep 2018 01:59:09 +0000 (11:59 +1000)]
r600: use build-id when available for disk cache

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agonouveau: use build-id when available for disk cache
Timothy Arceri [Wed, 19 Sep 2018 01:56:37 +0000 (11:56 +1000)]
nouveau: use build-id when available for disk cache

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi: use build-id when available for disk cache
Timothy Arceri [Wed, 19 Sep 2018 01:07:22 +0000 (11:07 +1000)]
radeonsi: use build-id when available for disk cache

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoutil: add disk_cache_get_function_identifier()
Timothy Arceri [Wed, 19 Sep 2018 01:44:12 +0000 (11:44 +1000)]
util: add disk_cache_get_function_identifier()

This can be used as a drop in replacement for
disk_cache_get_function_timestamp().

Here we use build-id to generate a driver-id rather than build
timestamp if available. This should resolve issues such as
distros using reproducable builds and flatpak not having
real build timestamps.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoutil: rename timestamp param in disk_cache_create()
Timothy Arceri [Wed, 19 Sep 2018 00:21:05 +0000 (10:21 +1000)]
util: rename timestamp param in disk_cache_create()

Only some drivers use a timestamp here. Others use things such
as build-id, or even a combination of build-ids from Mesa and
LLVM.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradeonsi: avoid sending GS_EMIT in shaders without outputs
Józef Kucia [Sun, 23 Sep 2018 22:44:00 +0000 (00:44 +0200)]
radeonsi: avoid sending GS_EMIT in shaders without outputs

Fixes GPU hangs.

Cc: 18.1 18.2 <mesa-stable@lists.freedesktop.org>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107857
Signed-off-by: Józef Kucia <joseph.kucia@gmail.com>
Signed-off-by: Marek Olšák <marek.olsak@amd.com>
6 years agoi965: Replace checks for rb->Name with FlipY (v2)
Fritz Koenig [Mon, 17 Sep 2018 20:51:35 +0000 (13:51 -0700)]
i965: Replace checks for rb->Name with FlipY (v2)

In the GL_MESA_framebuffer_flip_y implementation
_mesa_is_winsys_fbo checks were replaced with
FlipY checks.  rb->Name is also used to determine
if a buffer is winsys.

v2: Fixes annotation [for emil]

Fixes: ab05dd183cc ("i965: implement GL_MESA_framebuffer_flip_y [v3]")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Chad Versace <chadversary@chromium.org>
6 years agoradeonsi: initialize ac_gpu_info::name when using SI_FORCE_FAMILY
Marek Olšák [Mon, 17 Sep 2018 01:18:47 +0000 (21:18 -0400)]
radeonsi: initialize ac_gpu_info::name when using SI_FORCE_FAMILY

so that it's not NULL when loading radeonsi and a GCN GPU is not
present in the system.

6 years agoradeonsi: don't set the VS prolog key for the blit VS
Marek Olšák [Sun, 23 Sep 2018 03:57:05 +0000 (23:57 -0400)]
radeonsi: don't set the VS prolog key for the blit VS

6 years agospirv: Move function call handling to vtn_cfg
Jason Ekstrand [Sat, 22 Sep 2018 15:33:51 +0000 (10:33 -0500)]
spirv: Move function call handling to vtn_cfg

It makes way more sense for it to live there with the rest of function
handling.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agonir/from_ssa: Don't rewrite derefs destinations to registers
Jason Ekstrand [Sat, 22 Sep 2018 11:59:22 +0000 (06:59 -0500)]
nir/from_ssa: Don't rewrite derefs destinations to registers

We already call nir_rematerialize_derefs_in_use_blocks_impl prior to
calling nir_lower_ssa_defs_to_regs_block so the assertion that all deref
uses in the block should hold.  This fixes the following CTS test when
SPIR-V optimization recipe 1:

dEQP-VK.glsl.struct.local.loop_nested_struct_array_vertex

Fixes: 606eb56ab9449b "intel/nir: Only lower load/store derefs"
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agonir/cf: Remove phi sources if needed in nir_handle_add_jump
Jason Ekstrand [Fri, 21 Sep 2018 14:27:48 +0000 (09:27 -0500)]
nir/cf: Remove phi sources if needed in nir_handle_add_jump

If the block in which the jump is inserted is the predecessor of a phi
then we need to remove phi sources otherwise the phi may end up with
things improperly connected.  This fixes the following CTS test when
dEQP is run with SPIR-V optimization recipe 1:

dEQP-VK.glsl.functions.control_flow.return_in_nested_loop_vertex

Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
6 years agoanv: suppress warning about unhandled image layout
Eric Engestrom [Tue, 2 Oct 2018 13:31:42 +0000 (14:31 +0100)]
anv: suppress warning about unhandled image layout

Let's just be explicit that VK_NV_shading_rate_image is not supported.

Suggested-by: Jason Ekstrand <jason.ekstrand@intel.com>
Fixes: 6ee17091708a41c4aa81a "vulkan: Update the XML and headers to 1.1.86"
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@intel.com>
6 years agofreedreno/a6xx: hwbinning
Rob Clark [Tue, 11 Sep 2018 19:59:22 +0000 (15:59 -0400)]
freedreno/a6xx: hwbinning

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: update generated headers
Rob Clark [Fri, 28 Sep 2018 18:13:28 +0000 (14:13 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agointel/fs: Fix a typo in need_matching_subreg_offset
Jason Ekstrand [Tue, 2 Oct 2018 01:17:24 +0000 (20:17 -0500)]
intel/fs: Fix a typo in need_matching_subreg_offset

This fixes a bunch of Vulkan subgroup tests on little core platforms.

Fixes: 4150920b95 "intel/fs: Add a helper for emitting scan operations"
Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Tested-by: Mark Janes <mark.a.janes@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
6 years agoutil: disable cache if we have no build-id and timestamp is zero
Timothy Arceri [Wed, 19 Sep 2018 22:54:32 +0000 (08:54 +1000)]
util: disable cache if we have no build-id and timestamp is zero

Timestamp can be zero for example when Flatpak is used. In this
case just disable the cache rather then segfaulting when
incompatible cache items are loaded.

V2: actually return false when mtime is 0.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoinclude: sync eglext.h from Khronos
Eric Engestrom [Sun, 10 Jun 2018 08:35:53 +0000 (09:35 +0100)]
include: sync eglext.h from Khronos

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
6 years agoradeonsi: add a workaround for bitfield_extract when count is 0
Timothy Arceri [Sat, 22 Sep 2018 02:38:11 +0000 (12:38 +1000)]
radeonsi: add a workaround for bitfield_extract when count is 0

This ports the fix from 3d41757788ac. Both LLVM 7 & 8 continue
to have this problem.

It fixes rendering issues in some menu and loading screens of
Civ VI which can be seen in the trace from bug 104602.

Note: This does not fix the black triangles on Vega for bug
104602.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=104602
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=107276

6 years agoanv: Implement VK_KHR_driver_properties
Jason Ekstrand [Wed, 20 Jun 2018 03:27:36 +0000 (20:27 -0700)]
anv: Implement VK_KHR_driver_properties

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agovulkan: Update the XML and headers to 1.1.86
Jason Ekstrand [Tue, 24 Apr 2018 15:30:24 +0000 (08:30 -0700)]
vulkan: Update the XML and headers to 1.1.86

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: do not try to set DCC_CONTROL when image doesn't use DCC
Samuel Pitoiset [Fri, 28 Sep 2018 12:35:52 +0000 (14:35 +0200)]
radv: do not try to set DCC_CONTROL when image doesn't use DCC

Unnecessary. While we are at it, remove the check for pre-VI
because it's already checked earlier.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add a sanity check for mutable formats and TC-compat HTILE
Samuel Pitoiset [Fri, 28 Sep 2018 13:05:24 +0000 (15:05 +0200)]
radv: add a sanity check for mutable formats and TC-compat HTILE

If apps use the MUTABLE bit and the same formats as the image one
in the list, we can still enable TC-compat HTILE. I don't think
this happens often but given the fact that TC-compat HTILE allows
a nice boost in some situations, it's worth checking.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: disable HTILE for very small depth surfaces
Samuel Pitoiset [Fri, 28 Sep 2018 14:28:50 +0000 (16:28 +0200)]
radv: disable HTILE for very small depth surfaces

Like we disable DCC/CMASK for small color surfaces as well.
Serious Sam 2017 creates a 1x1 depth surface and I think
it should be faster to do slow clears on the graphics queue
instead of fast clears on compute, and eventually a depth
expand if the surface isn't TC-compatible HTILE.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: add potential missing fields for DB_EQAA
Samuel Pitoiset [Fri, 28 Sep 2018 10:30:08 +0000 (12:30 +0200)]
radv: add potential missing fields for DB_EQAA

Other drivers set these two as well, just apply the same rule.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: disable complicated point clipping against user clip planes
Samuel Pitoiset [Fri, 28 Sep 2018 10:30:07 +0000 (12:30 +0200)]
radv: disable complicated point clipping against user clip planes

I don't think this is required by Vulkan too.

Ported from RadeonSI (AMDVLK doesn't set it either).

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agogallium/util: Clarify comment in util_init_thread_pinning
Michel Dänzer [Tue, 18 Sep 2018 15:23:04 +0000 (17:23 +0200)]
gallium/util: Clarify comment in util_init_thread_pinning

As discussed in the review of the patch which added the comment:

Nothing happens when a thread is created, because pthread_atfork doesn't
affect creating threads. However, spawning a child process will likely
crash.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agoradv: do not sync CP DMA when copying buffers
Samuel Pitoiset [Wed, 26 Sep 2018 09:21:06 +0000 (11:21 +0200)]
radv: do not sync CP DMA when copying buffers

We already track if the DMA engine is busy/idle with a flag,
and we emit a packet that waits for all CP DMA operations
to be complete. This is done at end of command buffer because
the kernel doesn't wait for them, and also when emitting
barriers, so it should be safe.

This improves small copies for both aligned and unaligned sizes.

Aligned sizes:
BEFORE:
1 KB: 59.840000 ms
2 KB: 71.200000 ms
AFTER:
1 KB: 31.200000 ms
2 KB: 31.040000 ms

Unaligned sizes:
BEFORE:
2 KB: 68.3200 ms
3 KB: 79.3600 ms
5 KB: 76.6400 ms
9 KB: 90.8800 ms
17 KB: 116.0000 ms
AFTER:
2 KB: 31.0400 ms
3 KB: 32.0000 ms
5 KB: 30.8800 ms
9 KB: 30.5600 ms
17 KB: 29.6000 ms

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: adjust the CmdUpdateBuffer threshold for optimal performance
Samuel Pitoiset [Wed, 26 Sep 2018 09:10:58 +0000 (11:10 +0200)]
radv: adjust the CmdUpdateBuffer threshold for optimal performance

According to my benchmark results, it appears that we should
reduce the threshold to 1024.

BEFORE:
1 KB: 68.656000 ms
2 KB: 118.368000 ms

AFTER:
1 KB: 31.760000 ms
2 KB: 29.840000 ms

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agoradv: do not use the availability bit for timestamp queries
Samuel Pitoiset [Tue, 25 Sep 2018 18:26:58 +0000 (20:26 +0200)]
radv: do not use the availability bit for timestamp queries

It's unnecessary because we can just check if the timestamp
is to different to the default value when a pool is created
or resetted. Instead of waiting for the availability bit to
be 1, we have to emit a not equal WAIT_REG_MEM for checking
if the timestamp is ready.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agofreedreno/a6xx: Build up draw dword0 outside visibilty if statement
Kristian H. Kristensen [Fri, 21 Sep 2018 19:24:47 +0000 (12:24 -0700)]
freedreno/a6xx: Build up draw dword0 outside visibilty if statement

Pulling this logic out means we can share the logic and avoid a couple
of temporary variables that helped make things clearer before. Note
that in either vismode case, we always program vismode 0.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Simplify draw_emit() branches a bit
Kristian H. Kristensen [Fri, 21 Sep 2018 19:07:22 +0000 (12:07 -0700)]
freedreno/a6xx: Simplify draw_emit() branches a bit

Now that we've copied the emit logic into each branch of the
if (info->index_size) statement, we can simplify the logic a bit
according to which case we're in.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Copy OUT_RING() part into each branch of the index if
Kristian H. Kristensen [Fri, 21 Sep 2018 19:02:34 +0000 (12:02 -0700)]
freedreno/a6xx: Copy OUT_RING() part into each branch of the index if

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Split fd6_draw_emit into direct and indirect paths
Kristian H. Kristensen [Fri, 21 Sep 2018 18:37:36 +0000 (11:37 -0700)]
freedreno/a6xx: Split fd6_draw_emit into direct and indirect paths

This splits the two code paths into separate functions and moves the
"if (info->indirect)" test into draw_impl().

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Inline fd6_draw()
Kristian H. Kristensen [Fri, 21 Sep 2018 04:25:27 +0000 (21:25 -0700)]
freedreno/a6xx: Inline fd6_draw()

Simplify the code a bit by inlining this helper.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Move emit_marker and wfi to draw_impl()
Kristian H. Kristensen [Fri, 21 Sep 2018 04:19:57 +0000 (21:19 -0700)]
freedreno/a6xx: Move emit_marker and wfi to draw_impl()

This way the markers clearly bracket the draw call and isn't
duplicated for both direct and indirect draw code.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno/a6xx: Move inline functions out of fd6_draw.h
Kristian H. Kristensen [Fri, 21 Sep 2018 04:09:04 +0000 (21:09 -0700)]
freedreno/a6xx: Move inline functions out of fd6_draw.h

Only used in fd6_draw.c so put them there.

Signed-off-by: Kristian H. Kristensen <hoegsberg@chromium.org>
6 years agofreedreno: fix a typo in launch_grid
Hyunjun Ko [Thu, 20 Sep 2018 02:39:49 +0000 (11:39 +0900)]
freedreno: fix a typo in launch_grid

6 years agofreedreno/ir3: fix the param order of cmpxchg
Hyunjun Ko [Fri, 7 Sep 2018 08:11:45 +0000 (17:11 +0900)]
freedreno/ir3: fix the param order of cmpxchg

According to the following definition,
int AtomicCompSwap(inout int mem, uint compare, uint data);

the preceding one in atomic_comp_swap of NIR is compare and data is
followed, while src0 for cmpxchg needs vec2(data, compare)
So for ssbo/image deref comp_swap, that should be reversed.

Fixes: dEQP-GLES31.functional.image_load_store.*.atomic.comp_swap*
6 years agofreedreno/a6xx: fix shaders w/ >= 24 regs
Rob Clark [Wed, 12 Sep 2018 19:54:47 +0000 (15:54 -0400)]
freedreno/a6xx: fix shaders w/ >= 24 regs

Possibly these bits mean something else now.  Blob always seems to use
FOUR_QUADS, and changing to TWO_QUADS seems to cause different threads
to overlap registers.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a6xx: fix gl_FragCoord.w
Rob Clark [Thu, 13 Sep 2018 22:35:22 +0000 (18:35 -0400)]
freedreno/a6xx: fix gl_FragCoord.w

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: handle invalidated buffers harder
Rob Clark [Tue, 11 Sep 2018 20:21:29 +0000 (16:21 -0400)]
freedreno: handle invalidated buffers harder

Do a better job of skipping mem2gmem/gmem2mem..

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a6xx: fix constlen
Rob Clark [Wed, 26 Sep 2018 20:29:46 +0000 (16:29 -0400)]
freedreno/a6xx: fix constlen

Fix a few bits of confusion, as with previous gen's constlen is aligned
to 4, and value in bitfield is left-shifted by 2 (ie. divided by 4).
But this is done by the CONSTLEN() accessor/builder fxn, so don't do it
twice.  Also HLSQ_FS_CNTL.CONSTLEN is not special.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fix inorder rendering case
Rob Clark [Tue, 25 Sep 2018 16:15:58 +0000 (12:15 -0400)]
freedreno: fix inorder rendering case

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a6xx: backface stencil state
Rob Clark [Fri, 14 Sep 2018 20:44:32 +0000 (16:44 -0400)]
freedreno/a6xx: backface stencil state

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a6xx: fix gpu crash with separate-stencil
Rob Clark [Fri, 14 Sep 2018 14:35:11 +0000 (10:35 -0400)]
freedreno/a6xx: fix gpu crash with separate-stencil

Fixes a crash in (of all things) dEQP-GLES2.info.vendor with
--deqp-surface-type=fbo..

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno/a6xx: fix MRT config
Rob Clark [Wed, 12 Sep 2018 18:48:44 +0000 (14:48 -0400)]
freedreno/a6xx: fix MRT config

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fix potential hang when destroying batch
Rob Clark [Tue, 11 Sep 2018 18:04:57 +0000 (14:04 -0400)]
freedreno: fix potential hang when destroying batch

batch_flush_reset_dependencies() expects to be called unlocked, and can
call fd_batch_reference() which can try to aquire the screen lock again.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fix corrupted fb state
Rob Clark [Mon, 10 Sep 2018 14:58:28 +0000 (10:58 -0400)]
freedreno: fix corrupted fb state

In c3d9f29b we allowed ctx->batch to be null, and started tracking the
current framebuffer state in fd_context.  But the existing logic in
fd_blitter_pipe_begin() would, if !ctx->batch, set null fb state to be
restored after blit.  Which broke the world of deqp (and probably other
things)

Fixes: c3d9f29b781 freedreno: allocate ctx's batch on demand
Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: simplify pctx->clear()
Rob Clark [Thu, 6 Sep 2018 12:44:52 +0000 (08:44 -0400)]
freedreno: simplify pctx->clear()

This is defined to always clear the entire surface(s) specified,
regardless of scissor state.. mesa/st will turn scissored clears
into a draw.  So rip about a bunch of unnecessary machinery.

Also remove a comment that was obsolete since using u_blitter to
turn clear into draw (for the cases where there isn't a hw blitter
fast-path).

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fix FD_MESA_DEBUG=flush
Rob Clark [Thu, 6 Sep 2018 11:52:01 +0000 (07:52 -0400)]
freedreno: fix FD_MESA_DEBUG=flush

The logic to force a flush every draw was short-circuited with newer
kernels.  Also it should apply to clears as well.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: fix scissor state emit
Rob Clark [Thu, 6 Sep 2018 11:50:50 +0000 (07:50 -0400)]
freedreno: fix scissor state emit

The effective scissor changes based on rasterizer->scissor flag, so we
need to re-emit scissor state when rasterizer state changes.

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agofreedreno: update generated headers
Rob Clark [Fri, 14 Sep 2018 13:07:09 +0000 (09:07 -0400)]
freedreno: update generated headers

Signed-off-by: Rob Clark <robdclark@gmail.com>
6 years agost/mesa: do not call update_framebuffer_size with NULL pointer
Erik Faye-Lund [Thu, 20 Sep 2018 08:21:38 +0000 (09:21 +0100)]
st/mesa: do not call update_framebuffer_size with NULL pointer

In st_renderbuffer_alloc_storage, we avoid allocating storage for
zero-sized buffers, leading to this pointer being NULL. We already
take care to avoid dereferencing these pointers for color-buffers,
but not for depth/stencil-buffers.

So let's thread a bit more carefully here.

This avoids a crash while running Piglit's glx/glx-visuals-stencil
test, both on virgl and r600g.

Signed-off-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Guillaume Charifi <guillaume.charifi@sfr.fr>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agovulkan: Disable randr lease for libxcb < 1.13
Maxime [Sun, 23 Sep 2018 22:46:22 +0000 (08:46 +1000)]
vulkan: Disable randr lease for libxcb < 1.13

Since the Randr lease code was added, compiling against libxcb 1.12 no
longer works.

CC: mesa-stable@lists.freedesktop.org
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=108024
Fixes: 7ab1fffcd2a504024b16e408de329f7a94553ecc
Tested-By: Maxime <berillions@gmail.com>
Fixes: 7ab1fffcd2a504024b16 "vulkan: Add EXT_acquire_xlib_display [v5]"
6 years agoradv: Remove garbage comment.
Bas Nieuwenhuizen [Tue, 25 Sep 2018 10:06:46 +0000 (12:06 +0200)]
radv: Remove garbage comment.

Trivial.

6 years agoradv: Do not use multiple draws for multisample copies.
Bas Nieuwenhuizen [Tue, 25 Sep 2018 10:00:41 +0000 (12:00 +0200)]
radv: Do not use multiple draws for multisample copies.

Use sample rate shading instead, should give better locality.

Makes Nier with 8x msaa on a Raven go 5 fps -> 7 fps in the menu.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
6 years agoanv: If softpin is supported, use it with the hiz clear value bo
Jordan Justen [Tue, 1 May 2018 23:14:06 +0000 (16:14 -0700)]
anv: If softpin is supported, use it with the hiz clear value bo

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
6 years agoanv: s/batch/value_bo/ on anv_device_init_hiz_clear_batch
Jordan Justen [Tue, 25 Sep 2018 23:04:33 +0000 (16:04 -0700)]
anv: s/batch/value_bo/ on anv_device_init_hiz_clear_batch

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
6 years agodocs: update calendar, add news and link release notes for 18.1.9
Dylan Baker [Wed, 26 Sep 2018 16:44:40 +0000 (09:44 -0700)]
docs: update calendar, add news and link release notes for 18.1.9

6 years agodocs: Add sha256 sums to 18.1.9
Dylan Baker [Wed, 26 Sep 2018 16:41:53 +0000 (09:41 -0700)]
docs: Add sha256 sums to 18.1.9

6 years agodocs: Add 18.1.9 release notes
Dylan Baker [Mon, 24 Sep 2018 15:43:25 +0000 (08:43 -0700)]
docs: Add 18.1.9 release notes

6 years agointel/isl: Add a unit suffixes to some struct fields and variables
Jason Ekstrand [Wed, 5 Sep 2018 19:02:12 +0000 (14:02 -0500)]
intel/isl: Add a unit suffixes to some struct fields and variables

I was about to make the claim to someone that every field in isl_surf
is either an enum or has explicit units.  Then I looked at isl_surf and
discovered this claim was wrong.  We should fix that.  This commit does
a few refactors:

 * Add _B suffixes to some struct fields
 * Add _B to some variables and parameters
 * Rename row_pitch_tiles -> row_pitch_tl

Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
6 years agoradeonsi: NaN should pass kill_if
Axel Davy [Sun, 23 Sep 2018 14:18:55 +0000 (16:18 +0200)]
radeonsi: NaN should pass kill_if

Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=105333
Fixes: https://github.com/iXit/Mesa-3D/issues/314
For this application, NaN is passed to KILL_IF and is expected to
pass.

v2: Explain in the code why UGE is used.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
CC: <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Do not mark both ff vs and ps updated
Axel Davy [Sat, 22 Sep 2018 09:09:11 +0000 (11:09 +0200)]
st/nine: Do not mark both ff vs and ps updated

Previously if only ff vs or only ff ps was used,
the constants for both were marked as updated,
while only the constants of the used ff shader
were updated.

Now that NINE_STATE_FF_VS and
NINE_STATE_FF_PS do not intersect anymore,
we can correctly mark the correct set of constant
as updated.

Fixes: https://github.com/iXit/Mesa-3D/issues/319
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Split NINE_STATE_FF_OTHER
Axel Davy [Sat, 22 Sep 2018 09:05:19 +0000 (11:05 +0200)]
st/nine: Split NINE_STATE_FF_OTHER

NINE_STATE_FF_OTHER was mostly ff vs states.

Rename it to NINE_STATE_FF_VS_OTHER and
move common states with ps to
NINE_STATE_FF_PS_CONSTS (renamed from
NINE_STATE_FF_PSSTAGES).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Add dummy ff shader state
Axel Davy [Sun, 23 Sep 2018 16:21:45 +0000 (18:21 +0200)]
st/nine: Add dummy ff shader state

Some states only affect the ff shader,
not its constants.
Currently we don't check anything and
always recompute the ff shader key.

However we do check for NINE_STATE_FF_OTHER
and if set we reupload some constants.

Thus for those states which had NINE_STATE_FF_OTHER
set but didn't need it,
replace by a dummy ff shader state (which is
easier to understand for an external reader than
just setting 0 and more future proof).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Mark pointsize states as ff states
Axel Davy [Sun, 23 Sep 2018 16:20:59 +0000 (18:20 +0200)]
st/nine: Mark pointsize states as ff states

The pointsize states were missing the ff
NINE_STATE_FF_OTHER flag, and thus might
miss state updates when using ff.

Fixes some wine tests.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Minor refactor of a few NINE_STATE_* flags
Axel Davy [Sun, 8 Apr 2018 12:33:45 +0000 (14:33 +0200)]
st/nine: Minor refactor of a few NINE_STATE_* flags

Rename NINE_STATE_FOG_SHADER,
NINE_STATE_POINTSIZE_SHADER and NINE_STATE_PS1X_SHADER
into
NINE_STATE_VS_PARAMS_MISC and NINE_STATE_PS_PARAMS_MISC.

The behaviour is unchanged, except one minor change:
D3DRS_FOGTABLEMODE doesn't need to affect VS.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Increase maximum number of temp registers
Axel Davy [Sun, 23 Sep 2018 16:24:18 +0000 (18:24 +0200)]
st/nine: Increase maximum number of temp registers

With some test app I hit the limit.
As we allocate on demand (up to the maximum),
it is free to increase the limit.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Lock the entire buffer in some cases.
Axel Davy [Sun, 16 Sep 2018 19:59:55 +0000 (21:59 +0200)]
st/nine: Lock the entire buffer in some cases.

Previously we had already found that for
MANAGED buffers the buffer started dirty
(which meant all writes out of bound
before the first draw call using the
buffer have to be taken into account).

Possibly it is the same for the other types of buffers.
For now always lock the entire buffer (starting from the offset)
for these (except for DYNAMIC buffers, which might hurt
performance too much).

Fixes: https://github.com/iXit/Mesa-3D/issues/301
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Don't call SetCursor until a cursor is set
Axel Davy [Sat, 15 Sep 2018 19:53:25 +0000 (21:53 +0200)]
st/nine: Don't call SetCursor until a cursor is set

The previous code was ignoring the input
until a cursor is set inside d3d
(with SetCursorProperties), as expected
by wine tests.

However it did still make a call to ID3DPresent_SetCursor,
which would result into a SetCursor(NULL) call, thus
hidding any cursor set outside d3d, which we shouldn't do.

Add comment about not avoiding redundant ID3DPresent_SetCursor
calls once a cursor has been set in d3d, as it has been tested to
cause regressions.

Fixes: https://github.com/iXit/Mesa-3D/issues/197
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Avoid redundant SetCursorPos calls
Axel Davy [Sat, 15 Sep 2018 19:32:53 +0000 (21:32 +0200)]
st/nine: Avoid redundant SetCursorPos calls

For some applications SetCursorPosition
is called when a cursor event is received.

Our SetCursorPosition was always calling
wine SetCursorPos which would trigger
a cursor event.

The infinite loop is avoided by not calling
SetCursorPos when the position hasn't changed.
Found thanks to wine tests.

Fixes irresponsive GUI for some applications.

Fixes: https://github.com/iXit/Mesa-3D/issues/173
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
6 years agost/nine: Init cursor position at device creation
Axel Davy [Sat, 15 Sep 2018 18:39:23 +0000 (20:39 +0200)]
st/nine: Init cursor position at device creation

This is only useful for software cursor,
but at least now we won't start it at (0, 0).

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Initialize manually cursor structure
Axel Davy [Sat, 15 Sep 2018 18:15:12 +0000 (20:15 +0200)]
st/nine: Initialize manually cursor structure

Initialize manually the cursor structure fields
for more clarity on its content.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Check if format is DS before retrieving flags
Axel Davy [Thu, 13 Sep 2018 18:56:55 +0000 (20:56 +0200)]
st/nine: Check if format is DS before retrieving flags

d3d9_get_pipe_depth_format_bindings assumes the input format
is a depth stencil format.
Previously the user could hit this function with an invalid format.
Protect the last non protected call with a depth_stencil_format check.

Another solution is to have d3d9_get_pipe_depth_format_bindings
support non depth stencil format, but we don't want the user
to create depth buffers with d3d formats that can't be one,
it's better to check if the format can be depth buffer with d3d.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Remove clamping when mul_zero_wins
Axel Davy [Wed, 12 Sep 2018 21:06:37 +0000 (23:06 +0200)]
st/nine: Remove clamping when mul_zero_wins

Tests show the clamping can be removed
when mul_zero_wins is supported.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Implement predicated instructions
Axel Davy [Mon, 10 Sep 2018 19:39:28 +0000 (21:39 +0200)]
st/nine: Implement predicated instructions

Most of the work was already there, just not implemented.

Fixes: https://github.com/iXit/Mesa-3D/issues/318
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Fix aliased read in ff
Axel Davy [Sat, 15 Sep 2018 12:00:09 +0000 (14:00 +0200)]
st/nine: Fix aliased read in ff

Fix aliasing of colorarg_b4 with
colorarg_b5.

Fixes: https://github.com/iXit/Mesa-3D/issues/302
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Fix ff assignment with aliasing
Axel Davy [Sat, 15 Sep 2018 11:51:55 +0000 (13:51 +0200)]
st/nine: Fix ff assignment with aliasing

"tex_stage[s][D3DTSS_COLORARG0] >> 4" could be a two bit
number, thus colorarg_b4 was incorrectly set.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Clarify some ff assignments
Axel Davy [Sat, 15 Sep 2018 11:48:45 +0000 (13:48 +0200)]
st/nine: Clarify some ff assignments

colorarg0, etc are 3 bits wide.
Make the code more readable by adding an & 0x7
to further indicate we only remember the first 3 bits only.

The 4th bit is always 0,
and colorarg_b4, colorarg_b5, etc are used to store
the 5th and 6th bits.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Print transform matrices in debug
Axel Davy [Sat, 22 Sep 2018 08:51:20 +0000 (10:51 +0200)]
st/nine: Print transform matrices in debug

This is useful to see the matrices content
in the log to debug.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Add ff key hash to help debug
Axel Davy [Sat, 15 Sep 2018 11:47:59 +0000 (13:47 +0200)]
st/nine: Add ff key hash to help debug

This is very useful to find in the log
the ff shader shource of a given call.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Avoid RefToBind calls in ff
Axel Davy [Sun, 9 Sep 2018 10:47:16 +0000 (12:47 +0200)]
st/nine: Avoid RefToBind calls in ff

When using csmt, ff shader creation happens on the csmt
thread. Creating the shaders, then calling RefToBind causes
the device ref to be increased then decreased.

However the device dtor assumes than no work pending on the
csmt thread could increase the device ref, leading to hang.

The issue is avoided by creating the shaders with a bind
count directly.

Fixes: https://github.com/iXit/Mesa-3D/issues/295
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Add new helper for object creation with bind
Axel Davy [Sun, 9 Sep 2018 10:39:10 +0000 (12:39 +0200)]
st/nine: Add new helper for object creation with bind

Add a new helper to create objects starting with a bind
count instead of a ref count.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Add parameter to start with bind
Axel Davy [Sun, 9 Sep 2018 10:36:28 +0000 (12:36 +0200)]
st/nine: Add parameter to start with bind

Add a parameter to start new object with a bind
instead of a refcount.

Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Use perspective correction for ps depth fog
Axel Davy [Thu, 16 Aug 2018 14:29:31 +0000 (16:29 +0200)]
st/nine: Use perspective correction for ps depth fog

Emulate perspective interpolation of depth for programmable ps fog

ff ps fog uses position z, or 1/w depending on the ff
projection matrix set. This is according to public documents
found describing the algorithm and tests we made.

In the case of programmable ps, we used position's z,
which was sufficient to pass wine tests (which test shaders
don't set w).

Issue https://github.com/iXit/Mesa-3D/issues/315 showed
that this calculation was wrong.
Using perspective interpolation on z, that is using z * 1/w
seems to satisfy both this application and wine tests.

Fixes: https://github.com/iXit/Mesa-3D/issues/315
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
6 years agost/nine: Clamp RCP when 0*inf!=0
Axel Davy [Fri, 27 Jan 2017 22:13:29 +0000 (23:13 +0100)]
st/nine: Clamp RCP when 0*inf!=0

Tests done on several devices of all 3 vendors and
of different generations showed that there are several
ways of handling infs and NaN for d3d9.

Tests showed Intel on windows does always clamp
RCP, RSQ and LOG (thus preventing inf/nan generation),
for all shader versions (some vendor behaviours vary
with shader versions).
Doing this in nine avoids 0*inf issues for drivers
that can't generate 0*inf=0 (which is controled by
TGSI's MUL_ZERO_WINS).

For now clamp for all drivers. An ulterior optimization
would be to avoid clamping for drivers with MUL_ZERO_WINS
for the specific shader versions where NV or AMD don't
clamp.

LOG and RSQ being already clamped, this patch only
clamps RCP.

Fixes: https://github.com/iXit/Mesa-3D/issues/316
Signed-off-by: Axel Davy <davyaxel0@gmail.com>
CC: <mesa-stable@lists.freedesktop.org>
6 years ago.travis: Drop note about Clover builds being slow
Jan Vesely [Wed, 12 Sep 2018 22:18:24 +0000 (18:18 -0400)]
.travis: Drop note about Clover builds being slow

SWR takes 17+ minutes to build. Clover builds take ~6-7 minutes.

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years ago.travis: Add LLVM-7 Clover build
Jan Vesely [Wed, 12 Sep 2018 21:52:18 +0000 (17:52 -0400)]
.travis: Add LLVM-7 Clover build

Signed-off-by: Jan Vesely <jan.vesely@rutgers.edu>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
6 years agointel/compiler: Export TCS passthrough creation
Caio Marcelo de Oliveira Filho [Fri, 21 Sep 2018 20:26:03 +0000 (13:26 -0700)]
intel/compiler: Export TCS passthrough creation

Move create_passthrough_tcs() from i965 so can be used in other
contexts.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
6 years agomesa/st: In the precense of integer buffers enable per buffer blending
Gert Wollny [Thu, 13 Sep 2018 08:06:45 +0000 (10:06 +0200)]
mesa/st: In the precense of integer buffers enable per buffer blending

Since blending will be disabled later for integer formats we have to
consider that in the case of a mixed set of integer/non-integer format
buffers blending must be handled on a per buffer basis.

Fixes on r600:
  dEQP-GLES31.functional.draw_buffers_indexed.random.
      max_required_draw_buffers.13

Fixes: 8fb966688bc1053a48e8ee7f7394ce030bcfd345
  st/mesa: Disable blending for integer formats.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
6 years agomeson+autotools: get rid of spammy GCC warning -Wformat-truncation
Eric Engestrom [Fri, 21 Sep 2018 10:42:38 +0000 (11:42 +0100)]
meson+autotools: get rid of spammy GCC warning -Wformat-truncation

That warning fires every time a string function takes an argument that
could possibly be longer than its max output, which triggers all over
the place, especially when working with file paths ("what if every file
path is MAX_PATH long?" is what GCC is saying, which is really annoying
when we *know* that "/dev/dri/cardN" is not gonna be 4096 char long and
it's safe to store it in a 32-char array).

Anyway, we either add a ton of dead code all over the place to make GCC
happy, or we get rid of its spam. I chose the latter.

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
6 years agomeson: make it trivial to add other -Wno-foo CFLAGS
Eric Engestrom [Fri, 21 Sep 2018 10:37:53 +0000 (11:37 +0100)]
meson: make it trivial to add other -Wno-foo CFLAGS

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agogallivm: ensure string is null-terminated instead of assert()ing
Eric Engestrom [Fri, 21 Sep 2018 11:00:33 +0000 (12:00 +0100)]
gallivm: ensure string is null-terminated instead of assert()ing

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
6 years agointel/compiler/icl: Use barrier id bits 24:30 instead of 24:27,31
Topi Pohjolainen [Thu, 20 Sep 2018 10:46:04 +0000 (06:46 -0400)]
intel/compiler/icl: Use barrier id bits 24:30 instead of 24:27,31

Fixes gpu hangs with Carchase and Manhattan.

Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Signed-off-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
6 years agoradv: only emit ZPASS_DONE for timestamp queries on gfx queues
Andres Rodriguez [Tue, 25 Sep 2018 06:30:34 +0000 (02:30 -0400)]
radv: only emit ZPASS_DONE for timestamp queries on gfx queues

A ZPASS_DONE packet doesn't make sense for the compute queue. It will
result in a gpu hang.

This change resolves a gpu hang for SteamVR+Vega.

Cc: mesa-stable@lists.freedesktop.org
Fixes: 1f616a840eac02241c585d28e9dac8f19a297f39 "radv: emit a dummy ..."
Signed-off-by: Andres Rodriguez <andresx7@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
6 years agoradv: make use of nir_lower_load_const_to_scalar()
Timothy Arceri [Mon, 24 Sep 2018 08:18:48 +0000 (18:18 +1000)]
radv: make use of nir_lower_load_const_to_scalar()

This allows NIR to CSE more operations. LLVM does this also so the
impact is limited, however doing this in NIR allows other opts to
make progress. For example in radeonsi more loops are unrolled in
Civilization Beyond Earth.

The actual pipeline-db stats are not overwhelming but even in the
negatively affected shaders the NIR is clearly better. It just
happens that the code shuffling and in some cases calls to max
rather than a flt result in the final output from LLVM not
giving as good numbers.

However this is an incremental opt that further passes build off
so the change should be made IMO.

Totals from affected shaders:
SGPRS: 20192 -> 20184 (-0.04 %)
VGPRS: 19516 -> 19524 (0.04 %)
Spilled SGPRs: 437 -> 444 (1.60 %)
Spilled VGPRs: 0 -> 0 (0.00 %)
Private memory VGPRs: 0 -> 0 (0.00 %)
Scratch size: 0 -> 0 (0.00 %) dwords per thread
Code Size: 1527444 -> 1522276 (-0.34 %) bytes
LDS: 6 -> 6 (0.00 %) blocks
Max Waves: 1018 -> 1016 (-0.20 %)
Wait states: 0 -> 0 (0.00 %)

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
6 years agomeson: de-duplicate LLVM check
Dylan Baker [Mon, 24 Sep 2018 16:32:56 +0000 (09:32 -0700)]
meson: de-duplicate LLVM check

By adding `_llvm == 'true'` to the required argument we can check the
'auto' and 'true' case in one path.

Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
6 years agovulkan/wsi/display: wsi_display_select_crtc() doesn' need to modify the connector
Eric Engestrom [Fri, 14 Sep 2018 13:43:57 +0000 (14:43 +0100)]
vulkan/wsi/display: wsi_display_select_crtc() doesn' need to modify the connector

Signed-off-by: Eric Engestrom <eric.engestrom@intel.com>