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