Commit Graph

145007 Commits

Author SHA1 Message Date
Kenneth Graunke 1cd868f105 iris: Add some accessor wrappers for a few fields.
In the future, we're going to have "real" BOs representing GEM objects,
and "slab allocated" BOs suballocated out of a larger BO.  Many fields
are properties of the real underlying BO, but we may still want to ask
about an arbitrary BO, and have the accessor chase answers down as
necessary.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12848>
2021-09-14 07:36:44 +00:00
Kenneth Graunke e4c3d3efc7 iris: Defer construction of the validation (exec_object2) list
When I wrote this code originally, I decided to try and construct the
validation list up front, rather than at submission time.  That worked
okay, but it's not really necessary.  It's a fair amount of data to
store (struct drm_i915_gem_exec_object2 is 56 bytes per object), when
we can easily construct it on the fly.

More importantly, with suballocation, batch->exec_bos[i] may have
multiple entries corresponding to a single validation list entry.
Rather than tracking two lists with an awkward mapping between them,
we choose to just store the BO list and generate the other on the fly.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12848>
2021-09-14 07:36:44 +00:00
Kenneth Graunke 2f0eccf647 iris: Track written BOs via a bitfield rather than exec_object2 entries
When we start suballocating BOs, multiple logical BOs may map to the
same GEM object, and thus share a validation list entry.  However, we
want to track whether logical BOs are written, to avoid unnecessary
cross-batch data dependencies.

Just track that in a bitfield instead, where bit i corresponds to
batch->exec_bos[i].

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12848>
2021-09-14 07:36:44 +00:00
Kenneth Graunke 795b14aaa3 iris: Rewrite bo->index comment to refer to exec_bos[]
batch->validation_list[] will be going away shortly, but exec_bos[]
will live on.  bo->index is the index into both lists, so we can just
refer to the one we're not about to delete.

Reviewed-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12848>
2021-09-14 07:36:44 +00:00
Dave Airlie 4149a60209 crocus/gen7: add missing IVB/GT2 geom shader workaround.
Noticed this in passing.

Fixes: f3630548f1 ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12847>
2021-09-14 07:03:36 +00:00
Mike Blumenkrantz be35fdae5f zink: add some debug asserts to validate imageless framebuffer correctness
not sure if these matter enough to assert on but they're annoying to track down

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz 0734484058 zink: update surface info when rebinding to storage
fixes some validation for imageless framebuffer usage

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz ad57bb1b7d zink: force imageless fb rebind if rebinding an attachment
ensure that the STORAGE usage gets picked up here

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz 372f7d4726 zink: be smarter about fb surface rebinds
the aspect info lets us avoid unnecessary comparisons

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz 46a262dc1e zink: wrap framebuffer surfaces to preserve gallium expectations
gallium needs pipe_surface::context to reflect the context used to create
the surface, but zink caches surfaces, so instead return a wrapper object
that can be destroyed without blowing up the stack

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz 01f00eb90d zink: move surface and bufferview caches onto resources
this makes the locking smaller in scope and also make the lookups faster
due to having smaller populations in the hash tables

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz e28df76c3a zink: add a resource reference for bufferviews
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Mike Blumenkrantz 32cf036cb7 zink: assert surface geometry
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12843>
2021-09-14 05:47:47 +00:00
Jordan Justen 333b2185d8 intel/isl: Enable MOCS 61 for external surfaces on TGL
Reworks:
 * Lionel/Francisco: Add comment

Cc: mesa-stable
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by:  Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12292>
2021-09-14 05:33:53 +00:00
Mike Blumenkrantz 0f812e1295 zink: unset src access in barriers if there's no src pipeline stages
this is a partial barrier, so having access of any kind is invalid

VUID-vkCmdPipelineBarrier-srcAccessMask-02815(ERROR / SPEC): msgNum: 618171435 - Validation Error: [ VUID-vkCmdPipelineBarrier-srcAccessMask-02815 ] Object 0: handle = 0x2834530, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x24d88c2b | vkCmdPipelineBarrier(): .pImageMemoryBarriers[0].srcAccessMask bit VK_ACCESS_TRANSFER_READ_BIT is not supported by stage mask (VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT). The Vulkan spec states: The srcAccessMask member of each element of pMemoryBarriers must only include access flags that are supported by one or more of the pipeline stages in srcStageMask, as specified in the table of supported access types (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcAccessMask-02815)
    Objects: 1
        [0] 0x2834530, type: 6, name: NULL
zink DEBUG: ERR: 'Validation Error: [ VUID-vkCmdPipelineBarrier-srcAccessMask-02815 ] Object 0: handle = 0x2834530, type = VK_OBJECT_TYPE_COMMAND_BUFFER; | MessageID = 0x24d88c2b | vkCmdPipelineBarrier(): .pImageMemoryBarriers[0].srcAccessMask bit VK_ACCESS_TRANSFER_READ_BIT is not supported by stage mask (VK_PIPELINE_STAGE_TOP_OF_PIPE_BIT). The Vulkan spec states: The srcAccessMask member of each element of pMemoryBarriers must only include access flags that are supported by one or more of the pipeline stages in srcStageMask, as specified in the table of supported access types (https://www.khronos.org/registry/vulkan/specs/1.2-extensions/html/vkspec.html#VUID-vkCmdPipelineBarrier-srcAccessMask-02815)'

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12845>
2021-09-14 04:19:13 +00:00
Mike Blumenkrantz 904261b985 zink: unset barrier info if resource object no longer has usage after reset
this avoids spurious barriers

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12845>
2021-09-14 04:19:13 +00:00
Mike Blumenkrantz ecf5d706ef zink: move barrier info to resource object struct
this is a bit more accurate

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12845>
2021-09-14 04:19:13 +00:00
Mike Blumenkrantz cb65ac9bdf zink: add return values for resource usage unsetting
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12845>
2021-09-14 04:19:13 +00:00
Kenneth Graunke d3b72d49cb glsl: Assert that lower_blend_equation_advanced is only called for FS
It only makes sense to call this pass for fragment shaders, and the
first thing the pass does is read a FS-specific field out of a union,
so it isn't safe to call it for other shader stages.

We could make it early return, but instead we just assert, so that
drivers know to only call it when appropriate.

(A previous version of this patch, which early returned instead of
asserting, was Reviewed-by: Emma Anholt <emma@anholt.net> as well.)

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12839>
2021-09-14 03:55:05 +00:00
Kenneth Graunke bec8f8fde8 i965: Only call lower_blend_equation_advanced for fragment shaders
i965 called this pass unconditionally, while st/mesa only calls it for
fragment shaders.  It only makes sense to run for fragment shaders, and
the first thing the pass does is read a FS-specific field out of a
union.  This isn't safe for other stages.

Fixes about 20,630 test failures on i965 since 91dc863921, which moved
the advanced_blend_modes field.  The field had previously been in a
union with no other fields, so it never aliased anything, and thus
worked, even if it was wrong.  That commit moved it to a union that had
fields for other stages, so it started reading garbage and trying to
lower advanced blending for other stages on i965.

Fixes: 91dc863921 ("mesa: Move the advanced blend bitmask to shader_info.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12839>
2021-09-14 03:55:05 +00:00
Mike Blumenkrantz ca92a0d1ae zink: fix some return values
the function used to return the layout directly

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12844>
2021-09-14 03:43:36 +00:00
Mike Blumenkrantz 28386d0db5 zink: unconditionally support conditional rendering
this lets drivers that don't support the vk ext provide support

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12801>
2021-09-14 03:30:49 +00:00
Mike Blumenkrantz f54cde75d7 zink: fix dmabuf cap export
this requires a lot more than just one extension

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 9ec9289385 zink: add dmabuf fd handling
just gotta get it out of the underlying graphics layer

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 651def5896 zink: use foreign queue import for dmabufs
this is required to get image data

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 7d2de96847 zink: fix import pNext attachment during image creation
there's better checks for this now, so the weird pNext handling here
can be simplified

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 5b827b0a39 zink: handle image creation for dmabufs
these use PREINIT layout

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 2a63f38cb1 zink: set a flag for dmabuf init
this will be useful for barrier handling

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 3bd98d4bf6 zink: split import and export fd handle types
these can maybe be different

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 6f7fe12fd4 zink: hook up VK_EXT_queue_family_foreign
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz 2b98fba806 zink: add dmabuf modifier query hooks for screen
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Mike Blumenkrantz b359950b0f zink: hook up dmabuf ext
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11967>
2021-09-14 03:14:12 +00:00
Anuj Phogat 18477f60e2 intel/dg2: Add L3 configuration
Rework:
 * Jordan: Merge dg1/dg2 into empty_l3_list

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12711>
2021-09-14 02:51:03 +00:00
Jordan Justen 4620f8334f intel/dev: Add is_dg2 to devinfo
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12711>
2021-09-14 02:51:03 +00:00
Mike Blumenkrantz 727e10d290 zink: use smallest int type possible for decompose shader key
this reduces the component key size for decomposition by up to 75%, down
to as low as 2 bytes, which is more optimal for both hashing and memcmp of
the key

it will become more useful as further changes are added to improve vertex format
support, enabling the keysize to remain relatively small

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Mike Blumenkrantz 1542f3eb47 zink: decompose vertex attribs into single components when not supported
this avoids vbuf in a lot more cases on radv where 3component attribs aren't supported

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Mike Blumenkrantz c106c45a99 zink: add function for decomposing vertex format to single component
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12771>
2021-09-14 01:55:56 +00:00
Marek Olšák 9df5ebe5bf radeonsi: fix DCC image stores with image descriptors in user SGPRs
The bug workaround was not applied there.

Fixes: 34a2c75310 - radeonsi: enable DCC stores on gfx10.3 APUs for better performance

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12809>
2021-09-13 22:23:27 +00:00
Marek Olšák 921c770d49 driconf: remove leftover code for allow_incorrect_primitive_id
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12809>
2021-09-13 22:23:27 +00:00
Marek Olšák a5ea2ef93e radeonsi: copy a few nir_shader_compiler_options from RADV
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12809>
2021-09-13 22:23:27 +00:00
Marek Olšák 3d1ca01e41 radeonsi: fix DCC image stores with display DCC
Fixes: 34a2c75310 - radeonsi: enable DCC stores on gfx10.3 APUs for better performance

Tested-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12809>
2021-09-13 22:23:27 +00:00
Kai Wasserbäch d4f7337d14 fix(clover/llvm): update code to build with recent versions of LLVM 14 (Git)
`hasAttribute()` in `llvm::AttributeList` is gone, use `hasParamAttr()` instead.

This fixes an FTBFS.

Signed-off-by: Kai Wasserbäch <kai@dev.carbon-project.org>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12826>
2021-09-13 22:10:49 +00:00
Jordan Justen c7d8a69249 intel/devinfo: Add devinfo->max_scratch_ids
This consolidates several duplicated pieces of code into devinfo.
max_scratch_ids is an array that provides the max number of threads
for the rendering and compute stages.

This fixes some exceptions missed by crocus for scratch ids on haswell
and cherryview.

It also fills out devinfo->max_scratch_ids properly for stages VS
through CS on Gfx12.5. But, functionally this should not make a
difference as Gfx12.5 already uses COMPUTE for all stages.

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12799>
2021-09-13 13:26:51 -07:00
Jordan Justen 32e848aeaa intel: Move subslice_total into devinfo
Reworks:
 * Move asserts for subslice_total into intel_device_info.c (s-b Ken)
 * Drop now unused intel_device_info_subslice_total (s-b Ken)
 * Add comment for subslice_total (Ken)

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12799>
2021-09-13 13:26:23 -07:00
Simon Ser 3c18e69078 vulkan/wsi/x11: add driconf option to not wait under Xwayland
By default, Mesa's X11 Vulkan WSI will wait for buffers to be ready
before submitting them to Xwayland when the swapchain is created
with the IMMEDIATE mode.

This is undesirable when the Wayland compositor already monitors
fences. A Wayland compositor may want to know the delay between
the buffer submition and the end of the GPU work, this is impossible
to measure if the WSI waits for the buffer to be ready before
submission.

Since most compositors don't monitor fences, let's introduce a driconf
option for this for now. We can reconsider once more compositors
have better support for fences.

Signed-off-by: Simon Ser <contact@emersion.fr>
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11290>
2021-09-13 19:38:13 +00:00
Emma Anholt 91dc863921 mesa: Move the advanced blend bitmask to shader_info.
For drivers that don't lower advanced blend to FBFETCH, we need the
bitmask to be in the NIR shader so that it gets carried over to TGSI
successfully.

Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12813>
2021-09-13 18:36:58 +00:00
Mike Blumenkrantz a45c84f226 zink: fix ZINK_MAX_DESCRIPTORS_PER_TYPE to stop exploding the stack
this isn't the max per type, it's the max that can be used for a type,
which is the max used by a shader stage * the number of shader stages

Cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12829>
2021-09-13 17:46:11 +00:00
Rob Clark a601cae51c freedreno: Move a6xx specific screen init
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12820>
2021-09-13 17:21:14 +00:00
Rob Clark 0ee0972a0d freedreno: Cleanup primtypes/primtypes_mask
Move primtypes/primtypes_mask to screen to remove duplicated introduced
by 744ef862b8.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5299
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12820>
2021-09-13 17:21:14 +00:00
Rob Clark 1e5730102a freedreno: Remove unused function
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12820>
2021-09-13 17:21:14 +00:00