Commit Graph

142143 Commits

Author SHA1 Message Date
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