We shouldn't reset errno when the allocation succeeds, otherwise we might
be overriding previous allocation failures.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31382>
panthor_kmod_vm_bind() is usually called with a single op and at most
one sync, so let's optimize the low-number-of-ops-or-syncs case to
avoid transient heap allocation.
This also fixes some dEQP-VK.api.object_management.alloc_callback_fail.*
crashes where panthor_kmod_vm_bind(UNBIND) is called and not expected
to fail.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31382>
Otherwise, we could end up with phis of derefs.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 6b4b044739 ("nir/opt_loop: add loop peeling optimization")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31324>
Rename it to SmallVec, make it more generic and switch NAK
to it.
Signed-off-by: Christian Gmeiner <cgmeiner@igalia.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31409>
While a resource entry indeed has an alignment requirement of 16 byte,
the resource table itself needs to be aligned on 64-byte. Given the
alignment is only used for allocation, make it 64 byte in the XML (as
done in v10.xml).
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31440>
Surface descriptors need to be aligned on 16-byte.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31440>
Those don't exist on Bifrost.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Reviewed-by: Mary Guillemard <mary.guillemard@collabora.com>
Reviewed-by: Eric R. Smith <eric.smith@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31440>
This also allows us to disable a workaround in ACO for GFX9, but it
can't be removed completely because RadeonSI needs to use it.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31385>
Add firmware for Gen10 Arm Mali GPUs directly to rootfs since
it is not available from debian package. For the panthor kernel
driver to be able to execute jobs on the GPU it needs this firmware.
Update the kernel, which contains a fix to build the panthor driver
as module and use HWCI_KERNEL_MODULES to load panthor module.
Signed-off-by: Vignesh Raman <vignesh.raman@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31342>
This reverts commit 36c81b5e88.
With
nir/opt_algebraic: Allow two-step lowering of ftrunc@64 to use ffract@64
it is no longer necessary to call nir_lower_doubles explicitely in r600/sfn.
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29281>
If ftrunc@64 is lowered by nir_lower_doubles it is turned into a
comparable long series of 32 bit operations. If the hardware
supports ffract@64 then nir_opt_algebraic can first lower ftrunc@64
to use some combinations with ffloor@64. They can then be turned
into a combination of fsub@64 and ffract@64 resulting in less
all-over instructions.
Fixes: 5218cff34b
nir/algebraic: avoid double lowering of some fp64 operations
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29281>
The workaround is already implemented by
batch_emit_pipe_control_write(), we don't need to do it here as well.
This was spotted by Lionel Landwerlin. The credits go to him, I just
wrote the patch.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31412>
Commit a603cc0633 ("anv: move some pc was to
batch_emit_pipe_control_write") moved some WAs from
emit_apply_pipe_flushes() to batch_emit_pipe_control_write(), but it
turns out one of them was already there since cf7e1f3817 ("anv,
iris: add missing CS_STALL bit for GPGPU texture invalidation").
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31412>
Doesn't work with half registers. For 16-bit operations, there is mad.x16.
Cc: mesa-stable
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Signed-off-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31334>
When alpha_to_coverage is enabled, the zs_update_operation field
must be set to force_late, according to (some of) the documentation.
Actually the docs are ambiguous; the main thrust is that late coverage
updates are only required when Z or S is written, or when occlusion
queries are enabled. But there is a side note in a table that indicates
force_late should be used for coverage updates even if Z or S is not
written.
Logically this shouldn't be necessary and the note is probably
just lazily written. But it turns out that we do seem to need the
force_late setting on valhall. It's currently unclear whether
there's a hardware issue on valhall, or some other issue.
Fixes piglit ext_framebuffer_multisample-*alpha-to-coverage* tests
on valhall.
Reviewed-by: Lars-Ivar Hesselberg Simonsen <lars-ivar.simonsen@arm.com>
Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31181>
There's good reasons to emulate compressed formats; mobile and desktop
HW generally have different ideas of what formats are worth the extra
silicon, so they support different formats based on the legacy they were
designed to support. This means we can get better application
compatibility by emulating these formats.
But, that comes at a price, namely that applications that supports
multiple formats don't really have a way to detect which ones are
natively supported and which ones are not. This means they might make
the wrong choice, and end up wasting memory and bandwidth when that
could have been avoided.
So let's make the emulation optional, by introducing a DRIconf variable
to disable it.
This intentionally still leaves in place transcoding support, because
that's still *probably* a win. Besides, those needs to be opted into
anyway.
Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: David Heidelberg <david@ixit.cz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31420>
We were unlocking the bo handles hash table right after removing the bo handle
and afterward closing it. This leads to race conditions where the handle could
have been re-acquired on another thread. As the kernel would return the same
bo handle and do not reference count them, this leads to it being used after
being closed.
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-by: Dmitry Osipenko <dmitry.osipenko@collabora.com>
cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31421>
Fixes `spec@glsl-1.10@execution@vs-loop-partial-unroll-multiple-breaks`.
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31427>
Changes required after commit 514df444e
dri_gbm module is installed as /vendor/lib{64}/dri_gbm.so
to avoid changes in system/linkerconfig AOSP project
gbm-backends-path option is set as /vendor/$(MESA3D_LIB_DIR)
MESA3D_GBM_BINS variable simplifies dependencies declarations
Test results: gbm_gralloc works again
Fixes: 514df444e ("gbm: split the DRI backend into a separate library and unify backend handling")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31428>
Only update cached adjustment when it is valid.
Reviewed-by: Roy Chan <roy.chan@amd.com>
Acked-by: Alan Liu <haoping.liu@amd.com>
Signed-off-by: Tomson Chang <tomson.chang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31274>