Commit Graph

141287 Commits

Author SHA1 Message Date
Emma Anholt d4203bf7ab freedreno: Add perf_debug() for our software conditional rendering.
We could do it in hardware, and turnip does, but it hasn't bubbled up our
priorities yet.  At least make it more discoverable when you stumble over
it.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11452>
2021-06-17 22:47:51 +00:00
Rob Clark 6402dc17b3 freedreno: Defer freeing batch->key
We use the same key in autotune to track historical data about a given
framebuffer state, to inform the decision about using gmem vs sysmem
rendering.  Which means we need the key to stick around during the
flush, even if the batch is removed from the batch-cache before the
flush.

Fixes: 507f701d9e ("freedreno: Fix batch flush race condition")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11450>
2021-06-17 14:01:36 -07:00
Caio Marcelo de Oliveira Filho 64cb143b92 spirv: Fix handling of OpBranchConditional with same THEN and ELSE
When an OpBranchConditional that had two equal branches was parsed, we
were treating it as a regular OpBranch.  However this doesn't work
well when there's an associated OpSelectionMerge.  We ended up
skipping marking the merge block as such, and depending on what was
inside the construct we would end up trying to process the block
twice.

Fix this by keeping the vtn_if around, but when emitting NIR identify
the two equal branch case.

Fixes: 9c2a11430e ("spirv: Rewrite CFG construction")
Closes: #3786, #4580
Reviewed-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9297>
2021-06-17 20:05:39 +00:00
Icecream95 38e8d7afe3 pan/mdg: Fix reading a spilt register in the bundle it's written
Read directly from the instruction getting spilt. Otherwise a fill
will be inserted before the spill writing the value, so the
instruction reading the spilt value gets garbage data.

Use the bundle_id to check if the instructions are in the same bundle.

Insert a move instruction, as the spill needs the value in a LD/ST
register such as AL0, while the ALU instruction reading the value
needs it in a work register such as R0.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4857
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11212>
2021-06-17 19:53:14 +00:00
Icecream95 31d26ebf1b pan/mdg: Fill from TLS before spilling non-SSA nodes
Otherwise the data already written to the node will get overwritten.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11212>
2021-06-17 19:53:14 +00:00
Icecream95 ed9a9a09f2 pan/mdg: Reorder some code in mir_spill_register
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11212>
2021-06-17 19:53:14 +00:00
Icecream95 1490e7e622 pan/mdg: Add a bundle ID to instructions
So that it is possible to check if two instructions were scheduled
into the same bundle.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11212>
2021-06-17 19:53:14 +00:00
Rob Clark 3e3ec59895 freedreno/a6xx: Skip nv_copy_image tests
These look pretty redundant with arb_copy_image, so skip to keep CI
runtime reasonable.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:51 +00:00
Rob Clark fff2aa46a7 freedreno/a6xx: Flip on copy_image
Now that we have the rest of format "casting" sharp edges sorted, flip
on copy_image and gles32.

Unfortunately it adds back to piglit xfails (but at least that is more
than offset by my previous round of piglit fixes, and these are pretty
much all things we know had issues based on corresponding nv_copy_image
tests).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:51 +00:00
Rob Clark 6ca9f4f5ca freedreno: Fix for multi-draw blits
We have some logic to detect when u_blitter generated draws overwrite
the entire render-target, so we know we can discard anything previous.
But some blits (like multi-sample) do multiple draws.  We don't want to
discard the earlier draws from the same blit.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:51 +00:00
Rob Clark 9629f3aa46 freedreno/a6xx: Handle u/snorm vs u/sint validation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:51 +00:00
Rob Clark 678e4842cc freedreno/a6xx: Use UNORM for SNORM copy blits
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:51 +00:00
Rob Clark 70d571e558 freedreno/blitter: Flush before self-blits
In paths where we are handling blits on the 3d pipe, if src==dst we need
to flush to ensure what gets sampled by the blit shader reflects the
results of any previous blits.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:50 +00:00
Rob Clark 2f29425a0a freedreno: Fix flushes with NULL batch
Sequences that pctx->set_framebuffer_state() before pctx->flush() will
see ctx->batch being NULL.. but they still need to call fd_bc_flush(ctx)
to ensure pending batches associated with the context are flushed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11402>
2021-06-17 19:34:50 +00:00
Iván Briano 4c67924251 intel/nir: Fix txs for null surfaces
Closes: #4860
Fixes: 05a37e2422 ("intel/nir: Set lower txs with non-zero LOD")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11435>
2021-06-17 11:55:22 -07:00
Emma Anholt ac9ae97d30 freedreno: Flush batches upon destroying the ctx.
The invalidate would take it out of the bc tracking, so you could go
allocate a new batch->idx matching this one, while this one is still in
the bc using that idx.

You can't generate any new rendering with the ctx's old batches at this
point, anyway, so just flush for simplicity.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>
2021-06-17 09:11:57 -07:00
Emma Anholt 2a9225d05f freedreno: Remove broken back_blit optimization.
It wasn't checking that the transfer map would definitely overwrite all of
the data being initialized by the back blit, and if we knew that it
would then the caller would have provided PIPE_MAP_DISCARD_WHOLE_RESOURCE.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>
2021-06-17 09:11:02 -07:00
Emma Anholt 09e1fb2bce freedreno: Move the !MAP_WRITE write batch refcounting to the branch.
For MAP_WRITE, we flush all the batches referencing the BO, so the write
batch will get flushed anyway.  No need to take an extra ref.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>
2021-06-17 09:11:02 -07:00
Emma Anholt fd571565d2 freedreno: Fix batch reference handling in flush_resource().
We take references under the lock, but then accessed the lock-requiring
batch_cache structure without holding the lock.  The batches wouldn't get
freed and removed from their slots until the last ref goes away so it was
safe (other than the assert at the end), but writing the simple code is
shorter and requires fewer assumptions.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11439>
2021-06-17 09:11:02 -07:00
Iago Toral Quiroga cf2747e7ac v3dv: implement VK_EXT_index_type_uint8
Relevant CTS tests:
dEQP-VK.pipeline.input_assembly.*.index_type_uint8.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11444>
2021-06-17 12:26:44 +00:00
Charlie d9c53c50ad v3dv: enable ASTC formats
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11336>
2021-06-17 11:33:06 +00:00
Charlie 26a7afc94f v3dv: add ASTC formats to get_compatible_tlb_format
CTS doesn't seem to hit this, but they're all 128bit formats so this
should be right

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11336>
2021-06-17 11:33:06 +00:00
Charlie 56bf92ff0b v3dv: divide by block size in copy_image_blit
This handles compressed formats with non-4x4 blocks, like ASTC.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11336>
2021-06-17 11:33:06 +00:00
Charlie 6756f55c84 v3dv: add the unswizzled RGBA4444 format
If we're supporting the R/B swapped one we might as well support the one that
isn't.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11336>
2021-06-17 11:33:06 +00:00
Gert Wollny 8aaa08844f r600/sfn: Clean up some ALU lowering and move code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11348>
2021-06-17 10:53:52 +00:00
Gert Wollny 82c076d2c3 r600/sfn: Don't read return values of atomic ops that are not used
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11348>
2021-06-17 10:53:52 +00:00
Gert Wollny 800bfefde5 r600/sfn: Drop method for emit_atomic_add, it is handled in generic code
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11348>
2021-06-17 10:53:52 +00:00
Gert Wollny 2e8901a072 r600/sfn: don't read back unused image atomic result values
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11348>
2021-06-17 10:53:52 +00:00
Gert Wollny 5e1a703934 r600/sfn: don't designates initializers, since they are c++20
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11348>
2021-06-17 10:53:52 +00:00
Kai-Heng Feng f9d8d9acbb iris: Avoid abort() if kernel can't allocate memory
When the system doesn't have enough memory, GNOME Shell may be crashed
by iris:
gnome-shell[1161]: iris: Failed to submit batchbuffer: Cannot allocate memory
gnome-shell[1161]: GNOME Shell crashed with signal 6

So don't abort() when kernel can't allocate memory to avoid crashing the
entire desktop.

Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11178>
2021-06-17 09:04:17 +00:00
Iago Toral Quiroga d873e30d3b v3dv: expose VK_KHR_shader_non_semantic_info
This is entirely implemented in the SPIR-V frontend.

Relevant CTS tests:
dEQP-VK.spirv_assembly.instruction.compute.non_semantic_info.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11440>
2021-06-17 08:49:16 +00:00
Pierre-Eric Pelloux-Prayer 0fd152dab3 disk_cache: use UTIL_QUEUE_INIT_SCALE_THREADS
Instead of spawning 4 threads when the cache is created,
spawn 1 and let u_queue grow the number of threads if
needed.

I wrote this patch because when running piglit's quick_shader
profile I had lots of samples in disk cache threads - mostly
in native_queued_spin_lock_slowpath kernel function.

Since these tests shouldn't really stress the cache, I assumed
it was caused only by thread creations.

After writing the patch and redoing the measurement, I got an
improvement but I still more hits in the same function for
shader_runner:$disk0 thread so something was wrong.

After digging more, I found out that my shader cache index was
corrupted: the on-disk size was 29MB but the index reported it
was way more than 1GB. So each disk cache thread was spending
a lot of time trying to evict files. Given that my cache had
a really low count of files, the LRU method based on randomly
generating subfolder names failed, so evicting was very slow.

Now that my cache index is fixed, the disk cache threads are
mostly idle but I still think it makes sense to grow the
number of threads instead of spawning 4 at the program start.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:11:59 +02:00
Pierre-Eric Pelloux-Prayer 3713dc6b2a util/u_queue: add UTIL_QUEUE_INIT_SCALE_THREADS flag
This flag allow to create a single thread initially, but set
max_thread to the request thread count.

If the queue is full and num_threads is lower than max_threads,
we spawn a new thread to help process the queue faster.

This avoid creating N threads at queue creation time.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:11:59 +02:00
Pierre-Eric Pelloux-Prayer 0c88df1f6a util/u_queue: move function definition up
Will be used by the next commit.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:11:58 +02:00
Pierre-Eric Pelloux-Prayer edb77ec3c7 radeonsi: delay sample_pos_buffer creation until first use
And use pipe_buffer_create_with_data instead of doing it
manually.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:10:29 +02:00
Pierre-Eric Pelloux-Prayer 84dca32c51 vbo: delay vbo_exec_vtx_map call
Instead of doing vbo_exec_vtx_map during initialization,
defer it until the first actual user.

v2: move init to vbo_exec_wrap_upgrade_vertex (Emma Anholt)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11296>
2021-06-17 09:10:29 +02:00
Vinson Lee 3333a96b6f nvc0/ir: Initialize CodeEmitterNVC0 member progType in constructor.
Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member progType is not initialized
in this constructor nor in any functions that it calls.

Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11350>
2021-06-16 22:23:52 -07:00
Marek Olšák 849ab4ea0c mesa: execute glFlush asynchronously if no image has been imported/exported
This improves viewperf performance and it shouldn't break synchronization
with external clients when it's indirectly implied by glFlush.

This should not break the cases described in:
    https://gitlab.freedesktop.org/mesa/mesa/-/issues/4903

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Marek Olšák 0336b13e1e mesa: move _mesa_notifySwapBuffers into the x11 swrast driver
It has no other use and no relevance to DRI drivers despite the name.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Marek Olšák b7dc72380a mesa: add gallium flush_flags param into ctx->Driver.Flush
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Marek Olšák ee6929a779 st/mesa: move the st_flush_bitmap_cache call into st_flush
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Marek Olšák 37bf4184db st/mesa: fix an incorrect comment in st_context_flush
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Marek Olšák 3da170faae glthread: change when glFlush flushes asynchronously
This fixes the flushing with external textures.

We don't know if we need to flush synchronously with multiple contexts,
so I removed that.

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11341>
2021-06-17 02:24:22 +00:00
Kenneth Graunke 0510a947ba anv: Fix dynamic primitive topology for tess on Gfx7.x too
Commit 24342e499b changed how primitive
topology is handled on Gfx8+ but missed updating the Gfx7.x code.

As a result, tests which previously used topologies like PATCHLIST_3
instead started using bogus ones like LINESTRIP_ADJ.  This caused a
GPU hangs in a bunch of Vulkan conformance tests involving tessellation.

This fixes those hangs.

Fixes: 24342e499b ("anv: fix dynamic primitive topology for tess")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11434>
2021-06-17 02:00:32 +00:00
Zhaofeng Li 9908da1b7a Add default driver selections for RISC-V
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11346>
2021-06-17 01:29:38 +00:00
Mike Blumenkrantz 0ea8becff0 zink: always defer image descriptor barriers
this is simpler and guaranteed to be accurate

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11393>
2021-06-17 01:18:39 +00:00
Mike Blumenkrantz 5341b985e4 zink: use fake buffer barriers for descriptors
GL requires explicit glMemoryBarrier calls for shader synchronization
and only calls that map/copy buffers get implicit sync, so we don't actually
need barriers for any of these cases, only the state needs to be updated

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11393>
2021-06-17 01:18:39 +00:00
Mike Blumenkrantz 3c2f343618 zink: check actual mem props to determine if resource object is coherent
this was correct for what it has been used for until now, but it will no
longer be correct going forward

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11397>
2021-06-17 01:07:35 +00:00
Mike Blumenkrantz b1b6aecf9d zink: key alloc cache on heap index, not heap flags
this is a bit more sane

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11397>
2021-06-17 01:07:35 +00:00
Mike Blumenkrantz c56a100494 zink: avoid caching visible vram allocations
the visible vram heap is potentially going to be limited in size, so avoid
caching these allocations since that locks them to a given allocation size

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11397>
2021-06-17 01:07:35 +00:00