Commit Graph

131400 Commits

Author SHA1 Message Date
Mike Blumenkrantz 9bbe80accd lavapipe: implement EXT_separate_stencil_usage
this is a conformant implementation

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11738>
2021-07-06 17:09:31 -04:00
Alyssa Rosenzweig 7040051589 pan/decode: Handle IDVS jobs on Bifrost
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>
2021-07-06 15:50:28 -04:00
Alyssa Rosenzweig 73e80994d5 panfrost: Add secondary shader XML fields
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>
2021-07-06 15:50:28 -04:00
Daniel Stone f505d6f5de panfrost/genxml: Decode Bifrost index-driven vertex jobs
Bifrost has a new type of job called 'index-driven vertex', which takes
in two shaders. The primary shader, called for all values, performs
position shading to a cacheline-aligned attribute buffer. The secondary
shader, called for values still live after culling, performs varying
shading.

It is the responsiblilty of the implementation to ensure that vertices
from different instances do not share a cacheline.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11413>
2021-07-06 15:50:28 -04:00
Jason Ekstrand 60568d5dce iris: Use isl_surf_get_uncompressed_surf
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Jason Ekstrand 98faa09bb5 iris: Don't leak the surface if uncompressed re-interp fails
Fixes: a032a9665f "iris: Enable PIPE_CAP_SURFACE_REINTERPRET_BLOCKS"
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Jason Ekstrand 9946120d2b intel/isl: Add more cases to isl_surf_get_uncompressed_surf
We can actually create array surfaces instead of requiring single-slice
in a few cases.  This does require us to be very careful about our
checks, though.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Jason Ekstrand 2001a26309 intel/blorp: Use isl_surf_get_uncompressed_surf
Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Jason Ekstrand 20f075c270 intel/blorp: Adjust the compressed copy rectangle before convert_to_single_slice
It doesn't matter for the actual copy rectangle and this makes the
asserts a bit nicer as we don't need to bother with the intratile
offsets because there aren't any yet.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Jason Ekstrand 8f281be0ba intel/isl: Pull the uncompressed surface view code from anv
This adds a helper isl_surf_get_uncompressed_surf for creating a surface
which provides an uncompressed view into a compressed surface.  The code
is basically a direct port of the uncompressed surface code from the
Vulkan driver which, in turn, was a port from BLORP.

Reviewed-by: Topi Pohjolainen <topi.pohjolainen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11647>
2021-07-06 19:29:42 +00:00
Kenneth Graunke 4bf764d53d crocus: Reduce SSBO alignment requirements from 64B to 4B.
Mirroring a change in iris; see the previous commit for rationale.
One difference is that crocus does sometimes use CPU maps on Atoms
for *reads*...but writes don't go through CPU caches.  Should be OK.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11727>
2021-07-06 19:11:24 +00:00
Kenneth Graunke 96d8e48ed5 iris: Reduce SSBO alignment requirements from 64B to 4B
Back when SSBOs were first enabled in i965, we tried to work around
issues where the CPU and GPU were incoherently writing to the same
cacheline by forcing an alignment such that different sections of
data would fall in different cachelines.  This seems wrong.

On integrated GPUs with LLC, CPU and GPU writes should be coherent.
On integrated GPUs without LLC, we either enable snooping (so they
are again coherent), or we use WC maps (so the CPU cache isn't used).
Discrete GPUs always use WC maps (so the CPU cache isn't used).

This should work.  In other words, I think the increased alignment
was just working around coherency problems on atoms that have been
fixed in the intervening 6 year time period.

Untyped surface messages require 4B alignment.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5016
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11727>
2021-07-06 19:11:24 +00:00
Alyssa Rosenzweig 12c057315b panfrost: Eliminate redundant flushes with AFBC
We have all the information we need easily available.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Alyssa Rosenzweig 5100c42cbb panfrost: Split "flush writer" from "flush accessing"
Since writers are counted in the accessor set, the old implementation
had a redundant flush in the "flush accessing" case. To fix, split the
two modes into separate functions, removing the redundancy and offering
a much more ergonomic API.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Boris Brezillon cecb889481 panfrost: Do tracking of resources, not BOs
Squashed together with commits from Boris's original dependency tracking
cleanup series.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Alyssa Rosenzweig 9769696659 panfrost: Wrap occlusion query in pipe_resource
For proper tracking.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Alyssa Rosenzweig bef1074700 panfrost: Express dependencies as resources, not BOs
This is a more ergnomic API, and will allow further optimizations.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Boris Brezillon f56adf135a panfrost: Replace the batch->bos hashmap by a sparse array
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11077>
2021-07-06 18:50:38 +00:00
Emma Anholt 4118264643 nir: Free the instructions in a DCE instr removal.
No significant change in shader-db time (n=11), but should be a little win
for memory usage by the compiler.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>
2021-07-06 11:24:48 -07:00
Emma Anholt 5618445d45 nir: Use remove_and_dce for nir_shader_lower_instructions().
Reduces the work that other shader passes have to do to look at dead code,
and possibly extra rounds around the optimization loop if dce wasn't the
last pass in it.

shader-db runtime -1.12919% +/- 0.264337% (n=49) on SKL.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>
2021-07-06 11:24:45 -07:00
Emma Anholt 5251548572 nir: Add a nir_instr_remove that recursively removes dead code.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>
2021-07-06 11:24:43 -07:00
Emma Anholt d8d7d475aa anv: Fix unused var warning on release builds from an assertion.
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11628>
2021-07-06 11:24:37 -07:00
Mike Blumenkrantz fd2d463a98 zinK: tweak shader module update -> pipeline combined_dirty conditional
make this more explicit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz 0cf643db5d zink: remove shader_id
now that shaders are per-program, shader_id is no longer useful

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz 61f2667cf5 zink: remove gfx program slot mapping
if shaders aren't being shared between programs, they can instead directly
assign io between the shader stages such that only the producer and consumer
pair need to have their slots match up

this requires that each gfx program struct stores base nir for a given shader
in order to avoid breaking io for other programs which reuse shader states

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz a8448a91e6 zink: set gfx program shaders and generate internal tcs during program creation
the base shader states will never change for a program, and tcs will never
change its io, so there's no point in having this in the shader update hotpath

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz a92442225c zink: split up shader cache per-stage
this reduces overhead from lookups by ensuring that the number of entries
in a given table are minimized

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
Mike Blumenkrantz 49caf1a094 zink: make shader cache local to a single program
sharing caches makes things complicated and doesn't yield much benefit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11691>
2021-07-06 18:05:15 +00:00
James Jones 21ce1ca846 gbm: Load backend based on DRM device driver name
After attempting to use the GBM backend specified by the user
via an environment variable, if any, but before falling back
to the built-in GBM backends, attempt to dlopen
libg<DRM driver name>_gbm.so in the GBM backend library search
path (Defaults to "$libdir/gbm") and initialize a device using
it. This enables automatic backend discovery for devices that
do not provide a DRI driver.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:58:00 +00:00
James Jones 68902822d6 gbm: Support dynamically loading named backends
If the user specifies a backend name explicitly
via an environment variable and it is not in the
list of built-in backends, attempt to load it at
runtime.

runtime-loaded backends get a new gbm_backend_desc
struct instance for each device using them (A
small increase in memory usage to eliminate the
need for the locking and bookkeeping sharing them
would require), so these structures need to be
freed when destroying devices using runtime-loaded
backends.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 8c935464ad gbm: Put common device creation in a helper function
Subsequent changes will use this same logic to
instantiate devices with the correct version and
set up their backend reference.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 6d0c935846 gbm: Rename the DRI backend from gbm_dri.so to dri
A subsequent change will allow loading backends
from DSOs specified by the GBM_BACKEND environment
variable. The exact DSO name and path are derived
by the common loader code and will be of the form:

 <gbm_backend_path>/<GBM_BACKEND>_gbm.so

E.g., a user would set the environment variable to
"external" to load "external_gbm.so". Users will
also still be able to explicitly request any
builtin backends by name as well, so this change
helps keep the environment variable syntax
consistent between internal and external backends.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 7f615c66fb meson: Add a GBM backends search path build option
This is the list of locations where GBM will look
for alternate backend implementations based on the
DRM driver name. It defaults to $libdir/gbm.

On Android, this path is currently hard-coded to
/vendor/lib[64]/gbm.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones bc343154f8 loader: Factor out driver library loading code
Separate the path-building and dlopen() portion of
loader_open_driver() from the DRI extension
loading logic. The former will be shared by the
GBM backend loading logic in a subsequent change.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 49e56c3c0d gbm: Rename backend description list to builtin_backends
This just makes it clearer the array isn't a global
list of all backends in use.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 09bafb1f89 gbm: Add backend ABI-check test
This is based on the wayland EGL library ABI test
framework. The helper macros were copied from
there and expanded to support more than one
struct/type, and to additionally check member
type compatibility by default.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 5baa36f423 gbm: Version the GBM backend interface
Define a version number for the interface GBM uses
to offload work to its backends/drivers. Store the
version in the backend interface structs provided
to the loader by backends, as well as in the core
interface struct provided to backends by the GBM
loader code to backends.

The backend can create structures of any version
it supports, which can be greater or less than the
interface version specified by GBM in the core
interface structure. Hence, GBM will need to take
care to check the backend version before accessing
any members added to structs defined in
gbm_backend_abi.h after this change.

Similarly, the backend may need to check the
interface version supported by the GBM library
before passing back data in any structure members
that require the GBM library to interact with
them for correct operation. For example, if for
some reason a structure defined in
gbm_backend_abi.h gained a field which was a
pointer to memory allocated by the backend and
freed by GBM, the backend should avoid allocating
this memory if the GBM library did not specify an
interface version new enough to indicate that it
was aware of the new structure member.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 496ea1715e gbm: Move majority of gbmint.h to gbm_backend_abi.h
The content of gbm_backend_abi.h are nearly an
identical copy of the old gbmint.h. Only minimal
modifications have been made to ease history
tracking. Subsequent changes will further
formalize the ABI structures in gbm_backend_abi.h

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones f98bcd2f5b gbm: Add gbm_core struct to export code to backends
The GBM core/loader code defines one helper
function used by both itself and the built-in DRI
backend. Presumably, external backend authors
would want to use such functions as well, so
package them into a single struct that will be
passed explicitly to externally loaded backends in
subsequent changes.

Another option considered was to simply export
the gbm_format_canonicalize() function directly,
optionally renaming it to better indicate it is
intended only for "internal" use first. However,
even with a rename, this would expose it to
potential use by applications as well, which is
not ideal, as it is not intended to be part of
the application-facing GBM ABI.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 45bd17610c gbm: Give gbm_device a reference to its backend
This will be used for looking up the backend
again at destruction time to perform any backend-
agnostic cleanup.  To facilitate that, also
dispatch device destruction to the backend manager
code.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones ceb6c44fe4 gbm: Give getenv backend override its own function
Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones af1f517ab9 gbm: Consolidate env var and default backend loops
Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones 00b2a45edf gbm: Create device directly in find_backend
Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones b45cc75406 gbm: Inline load_backend function content
It was a functional no-op with the currently
available backends (Only DRI), and its implied
intended functionality is implemented elsewhere
in subsequent patches.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
James Jones c5e849bddf gbm: Remove stat and refcount fields from gbm_device
These were unused.

Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9902>
2021-07-06 16:57:59 +00:00
Mike Blumenkrantz 4077768f29 util/vbuf: check 3-component 16bit int formats for translation
some drivers don't support these

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11716>
2021-07-06 16:39:43 +00:00
Mike Blumenkrantz 95777ab419 lavapipe: handle null vertex buffers more gracefully
this should propagate down to be handled correctly in llvmpipe

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11723>
2021-07-06 16:10:10 +00:00
luc 937e813d23 panfrost: Only clear existing color buffers
in case that only one cbuf allocated but all clear bits set,
    the driver will crash due to null pointer dereference.

Signed-off-by: luc <onion0709@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11515>
2021-07-06 15:19:44 +00:00
Icecream95 0b2c79092c Revert "panfrost: Fix crc_valid condition"
This "fix" is no longer needed now we write CRC data correctly for
partial writes.

This reverts commit a78487f795.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11446>
2021-07-06 15:05:56 +00:00
Icecream95 8bc4ebb0f9 panfrost: Set bound dimensions to framebuffer size
Otherwise CRC calculation will miss the pixels outside the extent
bounds but still in a tile that is rendered.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11446>
2021-07-06 15:05:56 +00:00
Dave Airlie e5d158881b ac: fix win32 build
Fixes: e2e9dd44f4 ("ac/surface: Handle non-retiled displayable DCC correctly for modifiers.")
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11725>
2021-07-06 14:49:24 +00:00
Alyssa Rosenzweig 01174fcec8 asahi: Use XML for interpolation packet
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 5f6013e008 asahi: Enable primitive restart
Passes dEQP-GLES3.functional.primitive_restart.* except for a flake.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 3f685e9c96 asahi: Set data_valid for the depth buffer
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 4c99510d3b asahi: Identify attachment length field
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig b8bc5ed297 asahi: Use GenXML for main bind fragment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 19bb9d278f asahi: Extend IOGPU header to contain encoder
Let's squash together all the resulting zeroes. Trying to discern some structure out of this.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig c1d8ed1bc2 asahi: Move IOGPU header to XML
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 0b9e8181da asahi: Identify "command buffer" size field in map
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 7905207313 asahi: Parametrize software "command buffer" size
Will vary depending on # of attachments.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 99c52d98bd asahi: Sync attachment magic with asahi demo
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 8e3f81ccc4 asahi: Add XML for the attachment structure
We need a lot more control over these magic structures to get Z/S attachments working correctly. This is an early start.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 8d79fdea81 asahi: Skip over holes in the vbufs
Fixes dEQP-GLES2.functional.vertex_arrays.multiple_attributes.stride.3_float2_17_float2_17_float2_0

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 4c7a07e3b6 asahi: Comment on an embedded data structure
This file makes me sad :'(

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 668405de26 asahi: Flush for accesses to Z/S buffer
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 18a34dc47e asahi: Implement the stencil test
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig dc968a9bec asahi: Prepack rasterizer faces
A bit more efficient and will allow easy implementation of the stencil test.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Alyssa Rosenzweig 0266cf86e9 asahi: Fix meson dependency on packing in compiler
Closes: #5030
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Fixes: 6a657b17b9 ("agx: Remap fragment shader varyings explicitly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11730>
2021-07-06 13:44:50 +00:00
Mike Blumenkrantz a4713ddb56 radv: implement VK_EXT_multi_draw
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz ba30adce07 radv: add a gfx10 bug workaround for NOT_EOP
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz d9132fcb50 radv: split indexed draw cases based on whether drawid is used
fewer conditionals in the draw loop = less overhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz 5aaf45f5e1 radv: determine if hardware can emit NOT_EOP before emitting
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz d28329ed02 radv: emit drawid for multidraws
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz 00206b1664 radv: emit NOT_EOP for multi indexed draws
this is never emitted currently because drawCount is always 1

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Mike Blumenkrantz 72e75092a9 radv: use multidraw iteration for direct draws
there's still no arrays of draw info being passed, but this takes care of
all the work for it

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11532>
2021-07-06 13:16:56 +00:00
Rhys Perry 307a4bf4ab radv: use null vertex descriptor if num_records=0
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11642>
2021-07-06 13:00:35 +00:00
Rhys Perry a2ac660eb7 radv: adjust num_records when offset>stride
If an attribute's offset is larger than the stride, the compiler will
increase the vertex index and use offset%stride instead as the offset.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5007
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11642>
2021-07-06 13:00:35 +00:00
Rhys Perry e4fbb200fc radv: don't ever convert num_records to bytes if it's zero
If num_records==0, this conversion doesn't work. We should just keep it at
zero.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5007
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11642>
2021-07-06 13:00:35 +00:00
Dave Airlie b7302ecf11 crocus: enable threaded context support
Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Tested-by: Matti Hämäläinen <ccr@tnsp.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
2021-07-06 13:56:48 +10:00
Dave Airlie 86368a5fa2 crocus: add unsync transfer pool
Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
2021-07-06 13:56:48 +10:00
Dave Airlie 902eaa9382 crocus/tc: init/deinit threaded resource
Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
2021-07-06 13:56:48 +10:00
Dave Airlie a9df8f7b64 crocus: use threaded context base classes
should be a pretty non-functional change

Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
2021-07-06 13:56:48 +10:00
Dave Airlie db6042ea14 crocus: support rebinding streamout target buffers
Reviewed-by: Zoltán Böszörményi <zboszor@pr.hu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11710>
2021-07-06 13:56:44 +10:00
Bas Nieuwenhuizen e2e9dd44f4 ac/surface: Handle non-retiled displayable DCC correctly for modifiers.
There is some hardware with num_render_backends == 1, but the number
of render backends in GB_ADDR_CFG > 1. Turns out this can be turned
off by making them rb unaligned which is valid with only 1 render
backend.

Fixes: 0833dd7d12 ("amd/common: Add support for modifiers.")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10575>
2021-07-05 22:34:13 +00:00
Alyssa Rosenzweig 18995f13cb asahi: Handle nonzero first_level
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 2923aa6fe1 asahi: Wire in u_blitter
Fixes dEQP-GLES3.functional.fbo.color.repeated_clear.blit.tex2d.rgba8

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig dcd2d8ca50 asahi: Track more Gallium state
Needed to feed u_blitter.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 7a95b1f0fc asahi: Set vertex texture/sampler counts
Fixes

dEQP-GLES2.functional.shaders.texture_functions.vertex.texture2d

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig bee077f5e2 asahi: Identify vertex texture/sampler counts
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 30b6011cf7 asahi: Identify texture/sampler count fields
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig d45257b2be asahi: Fail on LOD clamps/bias
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 50f012542f agx: Handle txl
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 8361e24604 agx: Legalize LOD sources to be 16-bit only
I'm not convinced this is /right/ but it's a step.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 4891e51bf3 agx: Fix lod_mode shift
Was zero before so didn't notice the bug.

Fixes: 9f55538834 ("agx: Pack texture ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig edd30fa1bd agx: Pack LOD descriptors
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig e847bffbcc agx: Fix LOD_MIN enum
Fixes: 2470a080d2 ("agx: Stub NIR backend compiler")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig c99dfe6a0c agx: Fix 32-bit bitwise shifts
Fixes dEQP-GLES2.functional.shaders.functions.qualifiers.const_int_fragment

Fixes: e50bae00f4 ("agx: Add 32-bit bitwise shifts")
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 8ea262f508 asahi: Add ASAHI_MESA_DEBUG=no16 option
A lot of dEQP failures go away with 32-bit forced...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 5228be45b6 asahi: Generalize varying linking
Handles matrices now. Fixes

dEQP-GLES2.functional.shaders.matrix.add.dynamic_mediump_mat4_float_fragment

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 2e2270ff14 asahi: Remove spurious varying assignment
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig c946dcf25d asahi: Remove spurious assignment
Doesn't seem necessary.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 5049907ae1 asahi: Implement colour buffer reloads
Gets glmark2 -bdesktop working.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig b59dcf67b6 asahi: Set fragment key for non-U8NORM render targets
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 0e0448d8df asahi: Add internal (renderable) formats to the table
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 78610de496 asahi: Save zsbuf ptr
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 426d55ffad asahi: Add zsbuf to batch
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 2ad59fc9ec asahi: Handle Z16_UNORM textures
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 503742aa32 asahi: Always flush when setting framebuffer state
We don't have batch tracking yet.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 8c94742935 asahi: Guard for overflow when packing
I'm not convinced this is right.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 41d05ea49e asahi: Fix random *2
Accidentally committed at some point.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig b9789ae45a asahi: Wire in tgsi_to_nir
Gets GALLIUM_HUD working.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig a1f732e67b agx: Track logical control flow graph
Logic lifted from the Bifrost compiler, which was a copypaste of the Midgard
compiler, which was based on a faulty understanding of the v3d compiler,
which...

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig a207c77314 agx: Lift agx_block_add_successor from Panfrost
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 2e1ba82060 agx: Count write registers, not components
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 0ef93554e1 agx: Mark sources that kill
Trivially computed during liveness analysis (already a byproduct!) and required
for efficient register allocation.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 7972e74f40 agx: Add liveness analysis pass
Based on the Panfrost one, scalarized and with some silly things fixed.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig ec40620f86 agx: Add agx_exit_block helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig ebd25e7ee7 agx: Pull out agx_write_components
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig f49ba0874a asahi: Unify varying linking code with vertex shaders
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 6a657b17b9 agx: Remap fragment shader varyings explicitly
Needed to handle fragcoord.z correctly, for example. Step 1, at least.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 32f4be5dd7 agx: Rename agx_pack to agx_pack_binary
Conflicts with GenXML.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig bf8d1734fd agx: Implement ld_vary_flat
Not clear what any of this is for but let's be nice and match the blob.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:04 +00:00
Alyssa Rosenzweig 3eab648d6b agx: Implement nir_intrinsic_load_frag_coord
Depends on matching ABI.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig 8457524238 agx: Rename remap_varyings -> remap_varyings_vs
Want to do the same for fragment shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig eabcf9f31e asahi: Identify varying descriptor fields
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig 3d3e4928b2 agx: Add ld_vary_flat opcode
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig 10b8563966 agx: Update ld_vary encoding mask
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig 99b67ab355 agx: Add perspective bit to ld_var
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig ef808205c6 agx: Add agx_immediate_f helper
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Alyssa Rosenzweig be4d88a6ba agx: Mark components as ASSERTED
Prevents a release build warning.

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11718>
2021-07-05 20:56:03 +00:00
Thomas H.P. Andersen 8795501cef lavapipe: remove initialization override
These are duplicates from a few lines up

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11703>
2021-07-05 19:49:32 +00:00
Thomas H.P. Andersen 349f169756 zink: remove initialization override
These are duplicates from a few lines up

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11703>
2021-07-05 19:49:32 +00:00
Bas Nieuwenhuizen 406c87b779 radv: Support address capture and replay.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10570>
2021-07-05 17:27:51 +00:00
Bas Nieuwenhuizen f9cc94af7b radv/winsys: Add support for a fixed VA address for replay.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10570>
2021-07-05 17:27:51 +00:00
Bas Nieuwenhuizen 8025b4120f radv/winsys: Return vulkan errors for buffer creation.
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10570>
2021-07-05 17:27:51 +00:00
Danylo Piliaiev c0f623e62f glsl: Prohibit implicit conversion of mem parameter in atomicOP functions
Per OpenGL Shading Language, section 8.11. "Atomic Memory Functions"
first argument "mem" of all atomicOP functions is inout.
The same is true for ARB_shader_storage_buffer_object and
GL_INTEL_shader_atomic_float_minmax

For implicit conversion of inout parameters it is required for type
to support bi-directional conversion, since there is no such types
in glsl - implicit conversion is effectively prohibited.

Alternatively we could have marked atomic_var parameter of built-in
atomicOP functions as inout, however it opens another can of worms
during NIR lowerings.

Fixes: ea0a1f5beb
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2837
Signed-off-by: Danylo Piliaiev <danylo.piliaiev@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4887>
2021-07-05 18:29:51 +03:00
Mike Blumenkrantz 5c77f99c2e zink: ci updates for wideline fails
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11041>
2021-07-05 14:14:40 +00:00
Mike Blumenkrantz 3292a9d660 lavapipe: wideLines support
easy enough

Reviewed-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11041>
2021-07-05 14:14:40 +00:00
Tomeu Vizoso 1e23004600 panvk: Add vkEvents support
Use syncobjs to implement vkEvents (as suggested by Boris).

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11709>
2021-07-05 15:08:05 +02:00
Tomeu Vizoso 5defffaa4d panfrost: Specify alignment for the Job Header descriptor
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11709>
2021-07-05 15:08:05 +02:00
Tomeu Vizoso 5997f18d8a panvk: Make panvk_queue_transfer_sync more generic
Have it accept a syncobj so it can be used in a future commit.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11709>
2021-07-05 15:08:05 +02:00
Tomeu Vizoso 839eeaf306 panvk: Support calls to CreateDescriptorSetLayout without bindings
Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11709>
2021-07-05 15:08:05 +02:00
Samuel Pitoiset 585332caf8 ci: remove few CTS that are now skipped with RADV
Some expected list of failures were actually outdated.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11712>
2021-07-05 12:07:45 +02:00
Samuel Pitoiset 32e4552ca5 ci: update list of expected failures against CTS 1.2.6.2 for RADV
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11712>
2021-07-05 12:07:41 +02:00
Mike Blumenkrantz 9fbf6b2abf lavapipe: implement VK_EXT_line_rasterization
rectangular and strict lines aren't supported in this, and multisampling
must be disabled for correct line rasterization

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11066>
2021-07-05 07:14:29 +00:00
Mike Blumenkrantz 73ad0bcfd8 lavapipe: store the geometry shader prim type to render state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11066>
2021-07-05 07:14:29 +00:00
Mike Blumenkrantz fba6dafb9f lavapipe: store whether the geometry shader outputs GL_LINES
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11066>
2021-07-05 07:14:29 +00:00
Tomeu Vizoso 9a0e0af497 panvk: Add VkCommandPool support
Mostly just copied from turnip.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon d629debaca panvk: Support returning BOs allocated by panvk_pool to a 'free BO' pool
So all CommandBuffers in a given CommandPool can reuse BOs for their
memory pools.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Tomeu Vizoso d33a3fad64 panfrost: Fork pan_pool for Gallium and Vulkan
This commit adds the actual implementations, allowing to diverge while
still sharing code that depends on pool functionality.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Suggested-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon deb4074a54 panfrost: Start splitting the panfrost pool logic
The Gallium and Vulkan drivers will soon use different memory pool
implementation, but some pieces in libpanfrost depend on pan_pool. Let's
split the implementation so we have common bits still available while
letting the drivers implement what really matters: the allocation logic.

All the generic pieces are prefixed pan_pool, and what will become the
gallium implementation is prefixed panfrost_pool. We'll then duplicate
the panfrost_pool bits in panvk and prefix it with panvk_pool, and
implementations will start diverging from there.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon 4f0896ea4f panvk: Use the desc alloctor when we can
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon d873045b07 panfrost: Allocate WRITE_VALUE jobs with panfrost_pool_alloc_desc()
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon 55ec3596f5 panfrost: Add alignment info to write-value and cache-flush jobs
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon dea0c4ddd8 panfrost: Pass a memory pool to pan_blit_ctx_init()
Pass a memory pool to pan_blit_ctx_init() instead of creating a new pool.
Useful for Vulkan since the descriptor pool is at the command buffer
level and is thus shared by all blit batches. Doing this will save us a
BO ownership transfer.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Boris Brezillon 3cdbc1e8c0 panfrost: Don't add blit context BOs twice
The transient_bo has already been added to the BO list, no need to call
panfrost_batch_add_bo() a second time on the same BO.

Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11695>
2021-07-05 05:43:49 +00:00
Dave Airlie b4d87a34c7 crocus: restrict prim_restart on index buffer check to pre-hsw
This code has no use on hsw or chv

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie 6909b4a75a crocus: reorder version checks on indirect xfb
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie 063d7bfa1c crocus: inline group_index<->bti
this is on a fastpath for ubo emission

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie be5bb3146a crocus: optimise bo_unref path a little.
This just splits it into the atomic/non-atomic paths

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie a907e29a3e crocus: don't update draw parameters unless needed
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 15:03:48 +10:00
Dave Airlie 1d438c11c8 crocus: inline the d/s resource handling functions
These are pretty simple, so inlining is fine and helps drawoverhead

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11707>
2021-07-05 14:47:30 +10:00
Dave Airlie f19f3f5496 draw/tess: write correct primitive id into vertices
The code was using a prim assembler after the tess stage, however
tess prims aren't necessarily the output prim types, so just put
the prim ids into the vertices at tess stage, and skip prim assembly.

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11000>
2021-07-05 14:07:39 +10:00
Dave Airlie 45d9e8bb99 draw: fix tessellation output vertex size calculation
This ensures space for the extra outputs is calculated in the
tes vertex outputs.

dEQP-VK.pipeline.misc.primitive_id_from_tess

Fixes: dacf8f5f5c ("draw: hook up final bits of tessellation")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11000>
2021-07-05 14:07:34 +10:00
Dave Airlie 0aab06e6d3 crocus: fixup index buffer dirtying.
This fixes a possible problem if a non-indexed draw comes in first
in a new batch, then the batch might not emit the index buffer.

I'm unsure if we see this, I just spotted it trying to fix alacritty

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11705>
2021-07-05 12:45:13 +10:00
Dave Airlie 32b8d47306 crocus: fix crash on index buffer rebinding.
This was crashing in plasmashell.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11704>
2021-07-05 01:47:32 +00:00
Dave Airlie d41992c241 crocus/gen5: enable support for GL_EXT_gpu_shader4
There has been a few requests for this and I've got patches for glamor
to use this to speed up the paths that use GLSL 1.30 now.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>
2021-07-05 06:56:18 +10:00
Dave Airlie c71daec260 crocus: expose ARB_blend_func_extended on gen 45/50
In theory the docs say 965gm can support this but the original
965 can't, but we can't distinguish that yet.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>
2021-07-05 06:56:15 +10:00
Dave Airlie 64f65fe8a8 crocus: cleanup some deadcode in the gen5 blend emit
The rt->blend_enable is always 1 at this point, and the gen5
specific code isn't being used anymore, it just looked like it
was.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11693>
2021-07-05 06:56:11 +10:00
Thomas H.P. Andersen ffea622604 nir/ifind_msb_rev: fix input check
ifind_msb_rev was introduced in a5747f8ab3.

ifind_msb_rev guards against src0 being both 0 or -1 at the same time.
That is always true. This patch changes it to check for those values
individually.

Spotted from a compile warning.

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>

Fixes: a5747f8ab3 (\"nir: add opcodes for *find_msb_rev and lowering\")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11630>
2021-07-04 12:17:58 +00:00
Dave Airlie 4504fabed6 iris: make iris_bind_reserve_3d and Wa_1604061319 only check for dirty render bindings
+    9.31%  drawover:gdrv0  iris_dri.so      [.] iris_binder_reserve_3d

+    2.36%  drawover:gdrv0  iris_dri.so         [.] iris_binder_reserve_3d

If the app never uses compute, then the compute bindings bit will always
be dirty causing these two paths never get shortcuts.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11699>
2021-07-03 23:37:57 -07:00
Icecream95 c246af0dd8 panfrost: Only upload UBOs when needed
If all of the used values from a UBO are pushed, it doesn't need to be
uploaded.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Icecream95 b8a7355c03 pan/mdg: Create a mask of UBOs that need to be uploaded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Icecream95 aa11c0307a pan/bi: Create a mask of UBOs that need to be uploaded
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Icecream95 d0e90c336d panfrost: Don't set dirty_mask for constant buffers
It is unused.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11700>
2021-07-03 13:23:29 +00:00
Zoltán Böszörményi f94c796741 crocus: Make the driver loader use PCI IDs for crocus
Add PCI IDs based in pci_ids/i965_pci_ids.h and move crocus before
iris in driver_map[].

This allows Xorg to load the crocus driver since iris would claim
the devices handled by crocus (because the i915 kernel driver is
used for all Intel devices) then fail during initialization.

Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11694>
2021-07-03 06:34:33 +02:00
Zoltán Böszörményi e309d1a3a3 crocus: Add pipe loader driver
Signed-off-by: Zoltán Böszörményi <zboszor@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11694>
2021-07-03 06:34:20 +02:00
Kenneth Graunke 469875596a vulkan/wsi: Fix prime blits to use system memory for the destination
The intention here was to pass VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT to
select_memory_types() when requesting device local memory, or simply
pass 0 for the prime blit destination which should be in system memory.

Unfortunately, that meant we did (type.propertyFlags & 0) == 0 which
was vacuously true, causing us to not filter out device local types.

Fixes hybrid display of Vulkan apps on Intel TGL+DG1 systems.

Tested-by: Luis Felipe Strano Moraes <luis.strano@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11680>
2021-07-02 23:35:57 +00:00
Emma Anholt c656c5f055 i915g: Make sure the 1D texture Y channel is initialized.
Even with the wrap mode forced to REPEAT, we get undefined results in
CelShading when the Y channel is unwritten since the beginning of the
program.

I dropped the coords==0 case in the process, since that's not possible and
made the 1D case confusing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11457>
2021-07-02 21:18:07 +00:00
Emma Anholt d0ac174fda i915g: Force 1D textures to use wrap mode for the Y coordinate.
There are no 1D textures in HW, so we use 2D, but at the shader level
there no Y coordinate to 1D sampling, so we need that value to be ignored.
WRAP mode can get us that.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11457>
2021-07-02 21:18:07 +00:00
Adam Jackson 9cc4ce16fd meson: Make prefer-{crocus,iris} always take effect
As written this would require that the driver be built before we looked
at the option. This is wrong because it affects code outside of the
driver, it's in libGL's PCI ID table. This is sort of harmless for
crocus at the moment, but for iris you would need to build it in order
to remove it from the table; if you built just i965 and tried to run it
against gen9, the libGL you just built would direct the loader to the
iris driver you just didn't, and setup would fail, which is: goofy.

Reviewed-by: Zoltán Böszörményi <zboszor@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11655>
2021-07-02 19:18:42 +00:00
Kenneth Graunke 6e55890b6c iris: Delete unused bo->cache_coherent flag
This was used in the heuristics for deciding whether to CPU map,
but those have since been deleted, so this is now unused.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>
2021-07-02 19:06:01 +00:00
Kenneth Graunke a313bd7845 iris: Fail BO allocation if we can't enable snooping properly.
If the caller has asked for a coherent BO with snooping, and the kernel
fails to set it for whatever reason, we were happily returning them a
non-coherent buffer.  This isn't what they wanted and could lead to
surprising results.

Better to simply fail the allocation.  Probably.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>
2021-07-02 19:06:01 +00:00
Kenneth Graunke 803a2a9b3d iris: Stop calling I915_GEM_SET_CACHING on discrete GPUs
On integrated GPUs without LLC, we enable snooping when someone requests
coherency for a buffer.  (With LLC, it's already coherent.)

For discrete GPUs...if someone requests coherency, we allocate the
buffer in SMEM and resort to WC maps rather than WB maps with CPU
caches enabled.  There's no snooping to enable, and calling this ioctl
is nonsensical, and may fail.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11644>
2021-07-02 19:06:01 +00:00
Emma Anholt 5c55f59b13 i915g: whitespace fixup from the cube map fix.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>
2021-07-02 15:36:27 +00:00
Emma Anholt 487a493325 i915g: Add support for per-vertex point size.
Closes: #4973
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11668>
2021-07-02 15:36:27 +00:00
Samuel Pitoiset e58ab64223 radv: allow more fast clears for depth surfaces without TC-compat HTILE
With HTILE only, all values between 0.0 and 1.0 are fetchable.
This should allow more fast clears for depth surfaces where
TC-compat HTILE is disabled.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10035>
2021-07-02 13:23:38 +02:00
Samuel Pitoiset 269795c838 radv: prevent fast clearing HTILE depth for unrestricted ranges
VK_EXT_depth_range_unrestricted removes the restriction that the
clear value must be between 0.0 and 1.0.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10035>
2021-07-02 13:23:36 +02:00
Samuel Pitoiset 0cfeb93751 radv: add support for more HTILE clear codes
The HTILE clear code is now computed based on the floating point value.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10035>
2021-07-02 13:23:32 +02:00
Samuel Pitoiset 764960e16d radv: advertise VK_EXT_color_write_enable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11530>
2021-07-02 10:02:02 +00:00
Samuel Pitoiset 9a95aba377 radv: implement VK_EXT_color_write_enable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11530>
2021-07-02 10:02:02 +00:00
Jesse Natalie f8f2c3d835 nir_lower_readonly_images: Clear variable data when changing the type
For images, variable data includes the format. For samplers, variable
data is used for OpenCL inline samplers. When converting a variable
from one to the other, zero out the data so we don't accidentally
interpret a converted image as an inline sampler.

Fixes: fa677c86 ("nir_lower_readonly_images_to_tex: Support non-CL semantics")
Acked-by: Enrico Galli <enrico.galli@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11674>
2021-07-02 04:24:22 +00:00
Mike Blumenkrantz 25ad69968b zink: check last_finished before timeline waiting
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz fd633c2444 zink: add a screen function for waiting on a batch id
this is super hacky for the non-timeline case but whatever

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11686>
2021-07-02 03:40:45 +00:00
Mike Blumenkrantz 347163aec2 zink: stop screwing up buffer offsets during for maps
stop using the memory bind offset

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 97da7f635e zink: use 0 as the offset when mapping qbos
zink_resource_object::offset is the memory offset, which is unrelated to
the offset in a buffer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 9be640ff21 zink: use pipe_resource::width0 for clamping ssbo sizes
zink_resource_object::size is the size of the memory allocation, which
is effectively unrelated

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz 46695dd938 zink: don't add mem allocation offset when copying buf2image
this doesn't apply to any image/buffer operations, it's solely for memory
allocation/binding/mapping

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11687>
2021-07-02 03:29:04 +00:00
Mike Blumenkrantz f223ee9004 zink: only flag persistent resource maps for invalidation if they aren't coherent
coherent is already synchronized

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11688>
2021-07-02 03:18:19 +00:00
Mike Blumenkrantz b416b68ef3 zink: use vkresult helper for map return
consistency++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11689>
2021-07-02 03:10:12 +00:00
Daniel Stone d40f8a2fcb util/disk_cache: Don't leak when cache is empty
When we exit early having failed to find any candidate cache files to
evict, don't leak the list head whilst doing so.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Fixes: f58e6fee74 ("util/disk_cache: delete more cache items in one go when full")
Ref: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11523>

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11682>
2021-07-02 01:54:10 +00:00
Mike Blumenkrantz 19cf64aabd zink: add resource refs after last descriptor unbind
redundant at this point; no functional changes

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz f8bd5911ee zink: split samplerview/imageview usage/refcounting calls
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 6acd2e9de3 zink: split batch usage setting from refcounting
batch tracking has until now been the same as refcounting, but this
is inefficient and incurs additional overhead from constant atomic ops,
so make them separate

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz b302ab5167 zink: split out resource tracking into more incremental functions
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 72354df9c4 zink: remove stencil resource batch tracking
I think maybe I misunderstood how things worked, or there were issues
generally with resource lifetimes, or whatever, but this isn't needed anymore

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz ebbedb1c00 zink: don't add batch tracking during buffer rebinds if refs are dirty
this will be handled automatically

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11684>
2021-07-02 01:38:04 +00:00
Mike Blumenkrantz 539bdcd469 zink: add more explicit casts to draw code
this makes c++ happy

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:13:17 -04:00
Mike Blumenkrantz b432bdc035 zink: add c++ header guards
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:13:06 -04:00
Mike Blumenkrantz ccf6ea3070 zink: remove unnecessary return from zink_desc_type_from_vktype()
this doesn't compile in c++

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:12:19 -04:00
Mike Blumenkrantz 742805b1d7 zink: rename 'template' struct member
this is a c++ keyword

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:12:15 -04:00
Mike Blumenkrantz 48adc08b2d zink: make prim type a bitfield in pipeline info
match draw info here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11685>
2021-07-01 21:11:35 -04:00
Alyssa Rosenzweig 3da23a9c7e nir: Fix constant folding for irhadd/urhadd
This should be a subtract, not an add. The comment's proof is correct,
but the (wrong) expression we actually use isn't what it's in the
comment! Correct the discrepancy.

The lowering in nir_opt_algebraic was correctly typed.

Fixes: 272e927d0e ("nir/spirv: initial handling of OpenCL.std extension opcodes")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11671>
2021-07-02 00:21:22 +00:00
Mike Blumenkrantz ce90f73eb0 zink: rework pipeline cache implementation
this is now a screen-based queue which can be triggered to serialize
cache updates, ensuring synchronization

the cache is on the program object, enabling incremental updates as well as
variant loading for an entire pipeline collection at once

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11595>
2021-07-02 00:09:33 +00:00
Mike Blumenkrantz 8da06994cf zink: merge some streamout state emission into the same draw conditional
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11667>
2021-07-01 23:58:53 +00:00
Mike Blumenkrantz f97fa6f5f5 zink: move line width and depth bias updating into conditional during draw
only do calculations when needed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11667>
2021-07-01 23:58:53 +00:00
Mike Blumenkrantz 22530ad9f1 zink: unify fb surface unbinding
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11666>
2021-07-01 23:47:18 +00:00
Mike Blumenkrantz e58eb3f269 zink: add a ref for flush resource
the lifetime of this needs to always be preserved

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11665>
2021-07-01 23:04:34 +00:00
Mike Blumenkrantz 005262863f zink: break up ctx descriptor state updating to per-type functions
this is a bit easier to read/manage going forward

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11664>
2021-07-01 22:53:51 +00:00
Mike Blumenkrantz 6368f9453a zink: unify/consolidate some barrier queuing
this queuing is based on bind counts, and it's all the same, so it
can mostly be combined for better reuse

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11663>
2021-07-01 22:42:34 +00:00
Mike Blumenkrantz 2d32d123e5 zink: avoid unnecessarily rewriting gl_DrawID
with tc enabled, we get genuine multidraws with valid drawids, so we can
update this to reflect the new capabilities...which are the same as the old
ones except that potentially some drivers can now do direct multidraws

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11662>
2021-07-01 22:30:55 +00:00
Jesse Natalie 02efc5a099 microsoft/compiler: Change behavior for emitting inexpressible barriers
If the barrier tries to apply to memory that we can't express, just
don't apply the memory portion of the barrier. Similarly, if it tries
to apply a global memory barrier at invocation level, upgrade it to
thread-group.

Reviewed-by: Enrico Galli <enrico.galli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11670>
2021-07-01 21:05:14 +00:00
Georg Lehmann adbd63e24d lavapipe: Add a missing VKAPI_ATTR.
Signed-off-by: Georg Lehmann's avatarGeorg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>
2021-07-01 17:09:02 +00:00
Georg Lehmann 0556173918 lavapipe: Use common default allocator.
Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>
2021-07-01 17:09:02 +00:00
Luis Felipe Strano Moraes daf3d9e1eb overlay_layer: add missing undef
reviewed-by: Dylan Baker <dylan@pnwbakers.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11673>
2021-07-01 16:42:07 +00:00
Erik Faye-Lund 669b6889e4 gallium/u_threaded: do not apply start twice
We already apply start when setting the bits in writable_buffer, so
shifting the bits up by start just makes us apply the offset twice.

Caught by Coverity.

Fixes: 988d091720 ("gallium/u_threaded: clear valid buffer range only if it's not bound for write")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11635>
2021-07-01 11:57:49 +00:00
Samuel Pitoiset 28e1b02a6f radv: disable DCC for DOOM 2016 and Wolfenstein II
Both games perform two image layout transitions with the same image
in the same pipeline barrier with UNDEFINED and this re-initializes
DCC to the uncompressed state. No ideal solution sadly. Note that
both games declare all images as CONCURRENT.

This fixes rendering issues on GFX10+ because DCC for stores is
supported and this implicitly enables DCC for concurrent.

Fixes: da166f648f ("radv: enable DCC for concurrent images on GFX10")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4927
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4607
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11656>
2021-07-01 11:09:22 +00:00
Dave Airlie d9c0687a54 zink: drop getenv hacking now that gallium is fixed.
This drops the getenv hacks which cause problems testing multithread apps

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11643>
2021-07-01 10:27:44 +00:00
Dave Airlie 75a8246563 gallium/sw: add sw_vk bit to avoid having to futz with env vars for lavapipe
lavapipe really only currently works with llvmpipe, and likely for the forseeable
future.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11643>
2021-07-01 10:27:44 +00:00
Rhys Perry ed123a03be radv: enable VK_KHR_shader_subgroup_uniform_control_flow
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11626>
2021-07-01 10:01:52 +00:00
Rhys Perry a9c4a31d8d aco: handle NIR loops without breaks
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11626>
2021-07-01 10:01:52 +00:00
Juan A. Suarez Romero fd5c787958 ci: update VK-GL-CTS to 1.2.6.2
v1:
 - Fix typos (Emma)
 - Remove needless sort (Adam)

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11654>
2021-07-01 08:12:31 +00:00
Daniel Stone 0c09498fe9 Revert "CI: Disable LAVA devices for maintenance"
This actually came back a few hours ago.

This reverts commit b07dc014c44849af59f98afa3a1703c9d9d3cf27.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11669>
2021-07-01 06:59:07 +00:00
Hyunjun Ko 9507705693 turnip/kgsl: new flag TU_USE_KGSL
There are some cases using kgsl backend on linux that is still not usual
setup though, we need to consider too.

Regarding the timeline semaphore feature, we could implement it for
the kgsl backend in the future, and probalby it should be using the
existing code in tu_drm.

See #4738, #4907

Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11488>
2021-07-01 04:22:55 +00:00
Yiwei Zhang 73c71a37f4 venus: fix AHB VkBuffer memory requirement
Layering AHB on top of dma_buf_fd requires venus to combine the memory
type bits internally for VkBuffer.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>
2021-07-01 03:42:24 +00:00
Yiwei Zhang 4f2b98dc40 venus: handle ahb backed VkBuffer creation properly
Venus needs to override the external handle type from AHB to dma buf.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>
2021-07-01 03:42:24 +00:00
Yiwei Zhang 3527146a26 venus: prepare vn_CreateBuffer for AHB
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>
2021-07-01 03:42:24 +00:00
Yiwei Zhang 0ea726b5fd venus: add more logs for Android WSI debugging
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11661>
2021-07-01 03:42:24 +00:00
Mike Blumenkrantz 5951d2abac lavapipe: implement EXT_vertex_input_dynamic_state
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11231>
2021-07-01 00:37:08 +00:00
Mike Blumenkrantz 87b089c711 lavapipe: hook up some bits for handling dynamic line stipple state
this won't actually work, but it stubs out some (functional) placeholder
code for later code to build on

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11231>
2021-07-01 00:37:08 +00:00
Thomas H.P. Andersen 85de630273 anv: remove dead code
The unused bo_flags here is a leftover from the past. A similar
setup of bo_flags is now performed within anv_device_alloc_bo
via a call to anv_bo_alloc_flags_to_bo_flags.

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11645>
2021-06-30 22:34:42 +00:00
Emma Anholt 4300853edc freedreno: Flush the shadowed resource's write batch up front.
This simplifies my mental model of the swapping/blit process for resource
shadowing.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Emma Anholt 88161ced8d freedreno: Swap needs_ubwc_clear when shadowing.
The destination of the upcoming blit (the old rsc struct that houses the
fresh BO) wouldn't have its ubwc cleared first, which if it got
unfortunate data in a recycled BO could lead to blit failures.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Emma Anholt ed1f1dea28 freedreno: Stop manually marking blit dst buffers as valid.
fd_batch_resource_write() does this already.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Emma Anholt 514aa01853 freedreno/a5xx: Make sure to mark blit read/write access in the BC.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Emma Anholt f413b30ad4 freedreno: swap ->valid when shadowing resources.
The valid flag indicates whether the bo has had any data written to it.
Failure to swap it meant that if for some reason we fell back to SW
mappings during the blit from shadow, the PIPE_MAP_READ staging blit would
get dropped.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Emma Anholt 172082f235 freedreno: Update comments about PIPE_BUFFER shadowing.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11544>
2021-06-30 21:39:11 +00:00
Rhys Perry c094765a01 aco: remove resource flags
After disabling SMEM stores, nir_opt_access() now does the same analysis
and we don't need this anymore. Doing it in isel is also too late if we
want to lower descriptor loads in NIR.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11652>
2021-06-30 19:07:12 +01:00
Emma Anholt fcc41b0631 i915g: Set up the cube map texture wrap modes.
There are HW limits on what you're allowed to do.  No change on dEQP, but
one less thing for me to worry about with our busted cubes.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>
2021-06-30 17:42:56 +00:00
Emma Anholt 25ce136d23 i915g: Add curly braces for normal mesa style (and helps clang-format)
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11648>
2021-06-30 17:42:56 +00:00