Commit Graph

32228 Commits

Author SHA1 Message Date
Rob Clark 4f3c16ec05 freedreno: Add draw cost estimation
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9535>
2021-03-21 16:01:01 +00:00
Mike Blumenkrantz a1d80c6d96 zink: more accurately check samplecount caps for shader images
lavapipe can only do up to 4bits, so this isn't just a binary check

Fixes: 0daa61553d ("zink: check if multisample support exists for shader image formats")

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9713>
2021-03-21 10:15:13 -04:00
Rob Clark fd4a742cc3 freedreno/a6xx: Emit streamout state on every draw
If stream-output is active, we can't skip it's state-emit, even if the
SO buffer(s) have not changed.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 13:29:05 -07:00
Rob Clark 03cf083dba freedreno: Push multi-draw closer to backend
It will take some more extensive work to plumb this through the backends
(although that should increase the benefit further), but this is already
worth a nearly 4x speedup in piglit drawoverhead tests with no state
change, so this seems like a useful intermediate step.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 13:29:05 -07:00
Rob Clark 68e752652c freedreno: Handle multi-draw edge cases
Use the multi-draw emulation helper in the edge cases where we don't
handle multi-draw.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 13:29:05 -07:00
Rob Clark 5765932375 freedreno: Use multi-draw helper
In the normal case, we'll be pushing multi-draw (eventually) down into
the backend, but there are still a few remaining edge cases where we
can't deal with it.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 13:29:05 -07:00
Rob Clark 7b1505d165 freedreno: Drop u_trim_pipe_prim() from fast-paths
Not sure if we need this for a2xx.  For a3xx and a4xx we need it for sw
xfb which needs to know the trimmed # of vertices in the VS.  We do not
need it on a6xx, and unlikely need it for anything a5xx+.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 13:29:05 -07:00
Rob Clark 9947f950fb freedreno/a6xx/vsc: Be more tolerate of degenerate prims
Before we drop u_trim_pipe_prim(), we need to be more tolerant of the
edge cases it was protecting us from.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:14:34 -07:00
Rob Clark 4e82c5da73 freedreno: Only collect sw stats when required
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:14:34 -07:00
Rob Clark e9652630c7 freedreno: Split out helper for updating sw stats
And while we're at it, handle the num_draws > 1 case, to prepare for
plumbing num_draws further down.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:14:34 -07:00
Rob Clark 66985973aa freedreno: Don't ignore geom/tess stage resources
The draw resource-tracking logic looks like it never was updated to
account for HS/DS/GS stages.  Add it bitmask of bound stages so we only
have to loop over the bound stages.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:14:32 -07:00
Rob Clark 8cb51ba30e freedreno: Add dirty bit for state that needs rsc tracking
aa1ddb6fe3 skipped the tracking for the
!dirty case, but we can do a bit better and track at bind time whether
the state change is one that requires resource tracking.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark 66cbe66090 freedreno: Small dirty flag re-org
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark 9401d5bf1a freedreno/a6xx: Convert to dirty_groups
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4106
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark 32bc809a08 freedreno: Add mapping to generation specific dirty state
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark 0cb989d71f freedreno: Add helpers to mark dirty state
Doesn't change anything yet, but this will let us more easily add
mapping from dirty gallium state to dirty gen-specific state-groups.

Note that the mapping from shader-state to global state in
fd_context_dirty_shader() optimizes out for release builds.  This
is kind of important, in the next patch we'll want ffs(SOME_CONST)
to optimize away even more.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark 9aef029635 freedreno/ir3: Precompute whether we need driver-params
To save a bit of extra math in the draw-path.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Rob Clark b5e1e99da1 freedreno/drm: Inline iova calculation
The shift/or are frequently zero, so this lets the compiler optimize out
some draw-overhead hotpath.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9581>
2021-03-20 12:13:09 -07:00
Jose Fonseca 6e6cd7d93c scons: Remove.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9720>
2021-03-20 10:38:55 +00:00
Christian Gmeiner 09117357b7 etnaviv: rename struct members
As the structs are used for TE and NTE change the naming of the
struct members to be more generic.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8103>
2021-03-20 10:51:21 +01:00
Christian Gmeiner 53b51a1037 etnaviv: add support for NTE
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8103>
2021-03-20 10:51:15 +01:00
Christian Gmeiner a9494a8b9c etnaviv: factor out TS state emitting
Will be reused in NTE path.

Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8103>
2021-03-20 10:51:12 +01:00
Christian Gmeiner ec91456952 etnaviv: etnaviv: put sampler limit determination into own function
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8103>
2021-03-20 10:51:06 +01:00
Eric Anholt 25c002bae9 ci/freedreno: Mark glx-swap-copy as a flake on a630.
Just flaked on a post-merge pipeline.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9715>
2021-03-19 22:07:57 +00:00
Mike Blumenkrantz 60ea60ec4d zink: rewrite queue dispatch to use monotonic batch ids instead of hardcoded ones
historically zink has been bound to 4 gfx batches and then a separate compute batch
was added. this is not ideal for a number of reasons, the primary one being that if
an application performs 5 glFlush commands, the fifth one will force a gpu stall

this patch aims to do the following, all of which are necessarily done in the same patch
because they can't be added incrementally and still have the same function:
* rewrite batch tracking for resources/views/queries/descriptors/...
  |originally this was done with a single uint32_t as a bitmask, but that becomes cumbersome
   to track as batch counts increase, not to mention it becomes doubly-annoying
   when factoring in separate compute batches with their own ids. zink_batch_usage gives
   us separate tracking for gfx and compute batches along with a standardized api for
   managing usage
* flatten batch objects to a gfx batch and a compute batch
  |these are separate queues, so we can use an enum to choose between an array[2] of
   all batch-related objects
* switch to monotonic batch ids with batch "states"
  |with the flattened queues, we can just use monotonic uints to represent batch ids,
   thus freeing us from constantly using bitfield operations here and also enabling
   batch counts to scale dynamically by allocating/caching "states" that represent a batch
   for a given queue

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9547>
2021-03-19 20:16:02 +00:00
Mike Blumenkrantz a06958278f zink: split off a bunch of batch struct members to new batch state struct
this is just a cosmetic patch intended for review, skip this in bisects

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9547>
2021-03-19 20:16:02 +00:00
Mike Blumenkrantz 62335d7bc5 llvmpipe/setup: use bigger hammer to force fs constant updating correctly
this race condition between destroying ubo backing memory in lavapipe and
performing descriptor updates can be triggered from more than just queries,
so forcing the update just before the Problem Area seems like the best way to
permanently resolve the issue

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9711>
2021-03-19 16:04:39 -04:00
Mike Blumenkrantz 6cff8ec5a6 ci/lavapipe: split out lavapipe ci into lavapipe dir
there's no need to run llvmpipe jobs if only lavapipe has changed

Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9695>
2021-03-19 16:21:26 +00:00
Marek Olšák e5ea9a3baa radeonsi: add a fast path for MSAA resolving with RGB -> BGR swizzling
When we encounter a situation when we need to swizzle, which the CB can't
resolve in one pass, swap the channel order on the next clear, so that we
don't have to swizzle.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:03 +00:00
Marek Olšák 88e0e4f70e radeonsi: select the optimal micro tile mode at clear regardless of fast clear
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9615>
2021-03-19 16:05:03 +00:00
Mike Blumenkrantz 63bed3d55b zink: correctly clamp samplerview surface types
this fixes a bunch of cube stuff, e.g., spec@oes_texture_view@sampling-2d-array-as-cubemap-array

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Mike Blumenkrantz 3ab99ad14b zink: improve surface viewtype clamping
a cube array can still work with a nonzero first layer

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Mike Blumenkrantz 813a7e64bd zink: break out surface viewtype clamping into util function
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9685>
2021-03-19 15:31:45 +00:00
Jordan Justen 16d453da7f genxml/gen12: 3D_MODE bits 31:16 are no longer must-be-one
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Anuj Phogat <anuj.phogat@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9505>
2021-03-19 09:07:37 +00:00
Mike Blumenkrantz f0c8c6581c llvmpipe/setup: force fs constant updating upon beginning queries
this flushes any pending updates and avoids trying to access constant buffers
which have been unset (and are also potentially deleted)

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9692>
2021-03-18 23:15:53 -04:00
Mike Blumenkrantz f7597e7d4f zink: flatten 2d_array surfaces when necessary
same as cube types, if this is a single layer then it's not an array

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9684>
2021-03-18 16:29:09 -04:00
Icecream95 ae62fb3737 panfrost: Disable early-z when alpha test is used
Fixes rendering artefacts in Minetest on Midgard.

Fixes: 275277a2b4 ("panfrost: Implement alpha testing natively")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9676>
2021-03-18 20:22:55 +00:00
Lionel Landwerlin 33bc2977e5 intel/mi_builder: use device info to use the right CS prefetch size
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9679>
2021-03-18 20:08:45 +00:00
Vasily Khoruzhick e3f703e464 lima: update dEQP fails and skips lists
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9586>
2021-03-18 16:11:39 +00:00
Eric Anholt fc6a815401 freedreno/a5xx: Fix stream-output binning handling.
This makes it match (to the best I was able) a6xx's behavior, with the
exception of the XXX note in fd5_gmem.c highlighting what I think is an
issue on both a5xx and a6xx.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9295>
2021-03-18 08:47:48 -07:00
Mike Blumenkrantz 3419b16b6d zink: handle nir_intrinsic_image_deref_samples
same as the texop but for images

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9682>
2021-03-18 14:16:35 +00:00
Mike Blumenkrantz 861c6a86dc zink: enable spirv extension for post depth coverage
Fixes: 3c72c86742 ("zink: Wire up ARB_post_depth_coverage")

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9683>
2021-03-18 10:01:13 -04:00
Erik Faye-Lund 0b090d8e67 gallium/st: reserve space in default uniform block for lowered constants
If we don't reserve these, we risk these lowering passes eating up more
uniforms than we have available.

This fixes a crash due to an assert in Zink, because we end up trying to
use a too large UBO after lowering.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9631>
2021-03-18 11:17:05 +01:00
Mike Blumenkrantz 5d031d8f31 zink: clear framebuffer state on context destroy
ensure we don't leak surface references

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:29 -04:00
Mike Blumenkrantz 321a569656 zink: move fence reset to zink_fence_init()
fence stuff goes in fence file

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:29 -04:00
Mike Blumenkrantz bb90c8b926 zink: remove query batch-tracking init from begin_query()
this is always created on startup now

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:29 -04:00
Mike Blumenkrantz cb70132778 zink: use macro to streamline batch struct member init
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:29 -04:00
Mike Blumenkrantz 89dce254d8 zink: move other batch-tracking implementations to unified codepath
prep for monotonic batch ids

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:29 -04:00
Mike Blumenkrantz 57021b1d4a zink: also move batch destructor into zink_batch.c
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:28 -04:00
Mike Blumenkrantz 56452230ab zink: move batch init into zink_batch.c
this consolidates more batch code into the batch file

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9626>
2021-03-17 23:01:28 -04:00