Commit Graph

141802 Commits

Author SHA1 Message Date
Tapani Pälli 2d87ea3166 iris: take a reference to memobj bo in iris_resource_from_memobj
v2: and remove it from iris_memobj_create_from_handle ... (Nanley)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4969
Fixes: 772dc50d16 ("iris: hook up resource creation from memory object")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11552>
2021-06-23 10:46:09 +00:00
Pierre-Eric Pelloux-Prayer 52547cfbd0 radeonsi: disable ngg culling on llvm < 12
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4874
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11362>
2021-06-23 08:42:46 +00:00
Lionel Landwerlin 9b7cba7724 anv: bound checks buffer memory binding in debug builds
Validation layers should warn you about this
(VUID-VkBindBufferMemoryInfo-size-01037) but this would be useful for
zink debugging.

Requested by Zmike.

v2: Also check memoryOffset (Jason)

Signed-off-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/11542>
2021-06-23 08:16:57 +00:00
Francisco Jerez 4dc4284342 intel/fs: Implement Wa_14013745556 on TGL+.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez c19cfa9dc2 intel/fs: Fix synchronization of accumulator-clearing W/A move on TGL+.
Right now the accumulator-clearing move emitted by the generator for
Wa_14010017096 inherits the SWSB field from the previous instruction.
This can lead to redundant synchronization, or possibly more serious
issues if the previous instruction had a TGL_SBID_SET SWSB
synchronization mode.  Take the SWSB synchronization information from
the IR.

Fixes: a27542c5dd ("intel/compiler: Clear accumulator register before EOT")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez 63abc083ce intel/fs: Teach IR about EOT instruction writing the accumulator implicitly on TGL+.
This is unlikely to have had any negative side effect on the original
TGL, but will lead to issues on XeHP+ if the software scoreboard pass
isn't able to synchronize the accumulator writes.

Fixes: a27542c5dd ("intel/compiler: Clear accumulator register before EOT")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez 5e7f443de0 intel/fs: Add SWSB dependency annotations for cross-pipeline WaR data hazards on XeHP+.
In cases where an in-order instruction is overwriting a register
previously read by another in-order instruction, drop the dependency
iff the previous read is guaranteed to have occurred from the same
in-order pipeline.  This should only have an effect on XeHP+ since
previous Xe platforms only had one in-order FPU pipeline.

The previous workaround we were using for this treated all ordered
read dependencies as write dependencies to avoid noise from our
simulation environment.  Relative to our previous workaround this
improves performance of GFXBench5 gl_tess by ~7% on a DG2 system
among other single-digit percentual FPS improvements.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez d46bb14d14 intel/fs: Implement Wa_22012725308 for cross-pipe accumulator data hazard.
The hardware fails to provide the expected data coherency guarantees
for accumulator registers when accessed from multiple FPU pipelines.
Fix this by tracking implicit accumulator accesses just like we do for
regular GRF registers, but instead of adding synchronization
annotations for any dependency we only do it for dependencies with a
pipeline mismatch, since the hardware should be able to guarantee
proper synchronization for matching pipelines.

Note that this workaround handles RaW and WaW dependencies in addition
to the WaR dependencies described in the hardware bug report even
though cross-pipeline RaW accumulator dependencies should be extremely
rare, since chances are the hardware will also hang if we ever hit
such a condition.  This only affects XeHP+, since all FPU instructions
are executed as a single in-order pipeline on earlier Xe platforms.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez 385da1fe36 intel/fs: Track single accumulator in scoreboard lowering pass.
This change reduces the precision of the scoreboard data structure for
accumulator registers, because the rules determining the aliasing of
accumulator registers are non-trivial and poorly documented (e.g. acc0
overlaps the storage of acc1 when the former is accessed with an
integer type).  We could implement those rules but it wouldn't have
any practical benefit since we currently only use acc0-1, and for the
most part we can rely on the hardware's accumulator dependency
tracking.  Instead make our lives easier by representing it as a
single register.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Francisco Jerez 231337a13a intel/fs/xehp: Assert that the compiler is sending all 3 coords for cubemaps.
As required by HSDES:14013363432.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11433>
2021-06-23 07:34:22 +00:00
Matt Turner 85315f5fb1 freedreno/ci: Use TU_IGNORE_CONFORMANCE_WARNING to reduce warnings
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11543>
2021-06-23 07:07:42 +00:00
Matt Turner 205d6e582c tu: Provide a toggle to avoid warnings about unsupported devices
In the CI, we have such devices, and this message is printed many
hundreds of times. This results in a useless spam which makes it
difficult to see real issues.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11543>
2021-06-23 07:07:42 +00:00
Dave Airlie 17a1cc6163 meson/crocus: add prefer-crocus option.
This just allows picking crocus without having to set the env var.

Acked-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11353>
2021-06-23 06:42:24 +00:00
Marek Olšák ec7e262349 mesa: unreference zombie buffers when creating buffers to lower memory usage
This fixes an issue where one context only creates buffers while another
context only destroys buffers. Only the creating context can release its
buffers and the destroying context only turns them into zombie buffers.

This fix makes the creating context release its zombie buffers.
It's not a plot from an apocalyptic movie.

Fixes: e014e3b6be "mesa: don't count buffer references for the context that created them"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4840

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11514>
2021-06-23 06:06:04 +00:00
Dave Airlie 29d272f144 crocus: fix batch state bo leak
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11547>
2021-06-23 05:31:59 +00:00
Dave Airlie 9027aae546 crocus: fix vertex buffer leak on screen end.
this was stopping the screen from being cleaned up as well

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11547>
2021-06-23 05:31:59 +00:00
Dave Airlie 6036121a55 crocus: free context state properly.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11547>
2021-06-23 05:31:59 +00:00
Mike Blumenkrantz c9bc5e3a86 zink: ci updates
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz a784713080 zink: remove primconvert
this is no longer used

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz c032c9e32d zink: export supported primitive restart types
this is now handled by gallium, so the codepath can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 2953d70994 zink: export supported prim types
this is now handled by gallium, so the related codepaths can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 8ac4be916e zink: export 8bit index buffer support based on extension presence
this is now handled by gallium, so the codepath can be dropped

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:42 +00:00
Mike Blumenkrantz 09c28a35a5 zink: export PIPE_CAP_EMULATE_NONFIXED_PRIMITIVE_RESTART
gallium will now handle unsupported restart index rewriting, so
this codepath can be removed

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 3fc651110c gallium: add a pipe cap for determining driver support for prim type in restarts
this is another prim type bitmask which will trigger automatic draw rewriting
to a direct draw any time a prim-restart draw occurs with a prim type that is
not supported by the driver for prim restart, even if that prim type is supported
for normal drawing

the default is set to all prim types to preserve existing functionality, and PrimitiveRestartForPatches
is now explicitly set to false because no driver supports it

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz f8ff6eb78b gallium: add a pipe cap for performing automatic prim type conversion
drivers can now export a bitmask of the primitive types they support,
and all others will be automatically be rewritten

the default value is set to all primitive types supported to preserve
existing behavior

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz c8e674d4e3 gallium: handle automatic 8bit -> 16bit index buffer rewrites
this is based on PIPE_FORMAT_R8_UINT format support

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz c9a65e5f77 gallium: add a pipe cap to rewrite index buffers for draws using a non-fixed restart index
for drivers that set it, this now automatically handles restart index rewriting
by running draws through primconvert when necessary

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 99a60ed378 util/primconvert: handle multidraws in primconvert
once a draw reaches primconvert, it should never be able to reach the driver
until all draw operations have been converted as necessary

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 583070748c util/primconvert: handle rewriting of prim-restart draws with unsupported primtype
this is a bit more work, as the primitive restart needs to be rewritten into a multidraw,
then the multidraw converted to the new primitive type and serialized back into a
single draw

detection is handled using a new primconvert config member, which is set to the full
primtype mask by default for compatibility with existing drivers

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz f3fe70f10e util/primconvert: map index buffer before getting index translator function
also set other local values on init using new util functions

no functional changes

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 26e718fb37 util/primconvert: handle indirect draws
this avoids ping-ponging to the driver, which would have to call back
to here anyway with the unwrapped indirect draw

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 4673febf91 util/prim_restart: break out draw rewriting into separate function
this enables doing the draw rewrites without calling draw_vbo

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 3eb9932317 aux/draw: add a util function for reading back indirect draw params
the return type of this is a bit clunky because instance values can change,
but it's simpler to just return the full draw info struct than to force the
caller to keep pulling from arrays or whatever

Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10973>
2021-06-23 03:13:41 +00:00
Mike Blumenkrantz 854d93f73d ci: disable panfrost t760 jobs
these are timing out

Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11548>
2021-06-22 22:58:02 -04:00
Dave Airlie fd09727a7d crocus: Explicitly cast value to uint64_t
Ports 565a80450d from iris.

Acked-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11546>
2021-06-23 02:22:40 +00:00
Simon Ser 17f0d7ef83 amd/addrlib: remove Meson debug message()
This message pops up in the Meson build logs, but has no context
and doesn't seem to be directed at end-users. Sounds like a leftover
from a debugging session.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: d0767fc045 ("amd/addrlib: use cpp.has_argument() to filter compiler arguments")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11524>
2021-06-22 23:47:19 +00:00
Thong Thai d977e7fbe1 radeon/vcn/enc: Add missing line to HEVC SPS header code
Add previously missing line in HEVC SPS header generation on VCN 1.0
devices, for when an image does not need to be cropped.

Fixes: e62c7e7c6c ("radeon: Add cropping to encoded H.265 when padding is used")
Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11535>
2021-06-22 23:36:29 +00:00
Marek Olšák d3fddf63ec ac/llvm: don't set skip-uniform-regions to fix atomic.cmpswap
This fixes SSBO atomic cmpswap tests and transform feedback order piglit tests.

Fixes: 3bb65c0670 - ac: force enable -structurizecfg-skip-uniform-regions for LLVM 11
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3884

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11517>
2021-06-22 22:13:07 +00:00
Paul Gofman bdd8646306 util: add force_gl_names_reuse for SWKOTOR.
SWKOTOR is expecting texture names generated by glGenTextures() to
be small enough and crashes otherwise.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11527>
2021-06-22 21:43:33 +00:00
Emma Anholt a9e3ddfc63 i915g: Fix GL_ARB_copy_buffer assertion fails.
The i915_texture() asserts that the resource is not a buffer, so check for
the buffer fallback first.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11540>
2021-06-22 21:32:36 +00:00
Lionel Landwerlin 7ed0aaced7 nir: use a more fitting index for btd_stack_push_intel
Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin 423c47de99 nir: drop the btd_resume_intel intrinsic
This is now 100% equivalent to the new rt_resume intrinsic.

Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin 4d9fcf2799 intel/rt: switch to common pass for shader calls lowering
v2: rename for new indices

Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin 1dacea10f3 anv: implement caching for ray tracing pipelines
v2: Turn a bunch of pointer checks into checks against NULL (Jason)

Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin fed7ac932f anv: move trivial return shader to device
Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin 7c852f78c4 anv: store more RT shader data in pipeline_stage object
Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin 045f4600b1 anv: cache raytracing trampoline shader
Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Lionel Landwerlin ab77aeb488 blorp: add blorp string in shader keys
Upon looking at caching the raytracing shader (in particular the
trampoline one) I kind of got afraid that some of the keys used for
blorp would end up matching other keys. This is because blorp keys are
fairly simple. There is no SPIRV module hash included.

This change includes a "blorp" string at the beginning of the queue to
ensure we don't collide with other keys.

Signed-off-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/8637>
2021-06-22 21:09:25 +00:00
Jason Ekstrand 7479fe6ae0 anv: Implement vkCmdTraceRays and vkCmdTraceRaysIndirect
v2: Fix anv_cmd_state::binding_tables array size (Lionel)

v2: Fix anv_cmd_state::samplers array size (Lionel)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>
2021-06-22 21:09:25 +00:00
Jason Ekstrand ac6d7a1758 anv: Make anv_address::offset 64-bit
This allows us to convert a 64-bit address to an anv_address which is
useful for working with device addresses.

v2: switch to int64_t to keep state pool relative relocation working
    on non-softpin platforms

v3: Update assert to reflect relative offsets (Jason)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8637>
2021-06-22 21:09:25 +00:00