Marek Olšák [Fri, 18 Feb 2022 02:25:21 +0000 (21:25 -0500)]
ac/llvm: replace structured by vindex != NULL in ac_build_buffer_store_common
"raw" (IDXEN=0) and "structured" (IDXEN=1) do bounds checking differently.
From `si_make_buffer_descriptor`:
* - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
* - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.
so there is a difference between setting vindex = i32_0 and vindex = NULL.
Instead of having the `structured` flag, we can just check if vindex is NULL.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Fri, 18 Feb 2022 02:25:21 +0000 (21:25 -0500)]
ac/llvm: replace structured by vindex != NULL in ac_build_tbuffer_store
"raw" (IDXEN=0) and "structured" (IDXEN=1) do bounds checking differently.
From `si_make_buffer_descriptor`:
* - For VMEM and inst.IDXEN == 0 or STRIDE == 0, it's in byte units.
* - For VMEM and inst.IDXEN == 1 and STRIDE != 0, it's in units of STRIDE.
so there is a difference between setting vindex = i32_0 and vindex = NULL.
Instead of having the `structured` flag, we can just check if vindex is NULL.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Tue, 22 Feb 2022 08:05:35 +0000 (03:05 -0500)]
radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN
This matches PAL and RADV behavior. It's for preemption.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Tue, 22 Feb 2022 04:25:06 +0000 (23:25 -0500)]
ac/surface: add more elements to meta equations because HTILE can use them
according to gfx10SwizzlePattern.h
Fixes:
9fabbf2150253d06d - ac/surface: copy the HTILE equations to the surface
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Mon, 21 Feb 2022 01:22:16 +0000 (20:22 -0500)]
ac/surface/tests: fix missing NUM_PKRS extraction in test_modifier
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sun, 20 Feb 2022 07:10:27 +0000 (02:10 -0500)]
radeonsi: apply the LLVM discard bug workaround to LLVM 13 only
It was fixed in LLVM 14.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Thu, 27 Jan 2022 00:38:26 +0000 (19:38 -0500)]
ac,radeonsi: rework and optimize how TMPRING_SIZE is set
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Yogesh Mohan Marimuthu [Thu, 10 Feb 2022 19:42:07 +0000 (01:12 +0530)]
radeonsi: prepare clamp, alpha test before mrtz prepare
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Yogesh Mohan Marimuthu [Thu, 10 Feb 2022 19:34:46 +0000 (01:04 +0530)]
radeonsi: move clamp, alpha test from si_export_mrt_color() to new function
Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Thu, 27 Jan 2022 00:31:32 +0000 (19:31 -0500)]
radeonsi: fix the unaligned clear_buffer fallback with TC
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 17:27:06 +0000 (12:27 -0500)]
radeonsi: increase the tesselation factor ring size
based on PAL
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 16:26:25 +0000 (11:26 -0500)]
radeonsi: remove bit gaps in SI_RESOURCE_FLAG_*
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 16:25:27 +0000 (11:25 -0500)]
radeonsi: replace SI_RESOURCE_FLAG_UNMAPPABLE with PIPE_RESOURCE_FLAG_UNMAPPABLE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 16:11:43 +0000 (11:11 -0500)]
radeonsi: don't map buffers that VK made unmappable
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 16:04:21 +0000 (11:04 -0500)]
radeonsi: more fixes for si_buffer_from_winsys_buffer for GL-VK interop
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
jiadozhu [Tue, 30 Jul 2019 09:21:02 +0000 (05:21 -0400)]
radeonsi: fix crash in flush_resource when used with buffers
glWaitSemaphoreEXT triggers si_flush_resource callback
on pipe buffer resources, which may cause segmentation fault.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 15:21:01 +0000 (10:21 -0500)]
radeonsi: reduce the max TBO/SSBO binding size to 512 MB to help 32-bit builds
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 15:02:19 +0000 (10:02 -0500)]
radeonsi: document an unexpected behavior of PS_DONE
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 10:25:34 +0000 (05:25 -0500)]
radeonsi: change ACCUM_ISOLINE to 12
based on PAL
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 10:04:22 +0000 (05:04 -0500)]
radeonsi: program SQ_THREAD_TRACE_CTRL.AUTO_FLUSH_MODE on gfx10.3
discovered internally
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Fri, 21 Jan 2022 12:14:26 +0000 (07:14 -0500)]
radeonsi: always set FLUSH_ON_BINNING_TRANSITION
The hardware does the right thing automatically.
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Fri, 21 Jan 2022 09:03:09 +0000 (04:03 -0500)]
radeonsi: add assertions to check if buffer_map/texture_map calls are valid
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 15:17:47 +0000 (10:17 -0500)]
winsys/amdgpu: fix a warning of defining radeon_screen_create_t twice
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 15:17:30 +0000 (10:17 -0500)]
ac/llvm: remove unused function dpp_row_sl
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 15:15:51 +0000 (10:15 -0500)]
ac/surface: don't set the display flag for 1D textures
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Fri, 18 Feb 2022 00:04:43 +0000 (19:04 -0500)]
ac/gpu_info: print units for some radeon_info fields
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 14:55:15 +0000 (09:55 -0500)]
ac: add a gfx9 workaround for high priority compute
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Tue, 1 Feb 2022 16:34:13 +0000 (11:34 -0500)]
amd: add a workaround for an SQ perf counter bug
Cc: mesa-stable@lists.freedesktop.org
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 22 Jan 2022 09:13:23 +0000 (04:13 -0500)]
amd: remove the _UMD suffix from register definitions
It was mistakenly added to indicate it's for a User-Mode Driver,
but all defined registers in Mesa are.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Marek Olšák [Sat, 19 Feb 2022 03:23:55 +0000 (22:23 -0500)]
winsys/radeon: fix a hang due to introducing spi_cu_en
Fixes:
5406ad93 "radeonsi: set COMPUTE_DESTINATION_EN_SEn to spi_cu_en"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5989
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15098>
Iago Toral Quiroga [Tue, 22 Feb 2022 09:27:00 +0000 (10:27 +0100)]
broadcom/compiler: fix register class patching for postponed spills
If we have a postponed spill, the temp we create at ip is no longer
the spilled temp and therefore is affected by the thrsw injection.
Fixes corruption in the additive blending animation demo from
Three.js.
Fixes:
f3c3228522 ('broadcom/compiler: do not rebuild the interference graph after each spill')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15112>
Tapani Pälli [Thu, 3 Feb 2022 12:02:42 +0000 (14:02 +0200)]
iris: setup internal_format for memory object resources
We need to setup internal_format for resource in case main surface was
not configured (iris_resource_configure_main) which is the case with
vertex buffer objects, otherwise transfer helper will make wrong
decisions when copying such a resource.
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14925>
Erik Faye-Lund [Mon, 19 Jul 2021 13:34:01 +0000 (15:34 +0200)]
vulkan/wsi: use buffer-image code-path on Windows
This means we no longer map optimal-tiling images in order to display
them on screen, but instead copy via a buffer, which is guaranteed to
linearize.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Erik Faye-Lund [Mon, 19 Jul 2021 13:32:19 +0000 (15:32 +0200)]
vulkan/wsi: add transition to/from transfer-src state
Without these barriers, we'll try to blit from the image when it's in
the incorrect layout, which is illegal.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Erik Faye-Lund [Thu, 3 Feb 2022 09:57:16 +0000 (10:57 +0100)]
vulkan/wsi: untangle buffer-images from prime
Not all Vulkan implementations allows rendering to linear images, so in
order to support scanning out from these on Windows we might have to copy
through a buffer like we do in the PRIME path.
To avoid reimplementing the same, let's instead generalize the code a
bit so it doesn't have to specfy any PRIME-specific details.
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Boris Brezillon [Fri, 18 Feb 2022 08:28:49 +0000 (09:28 +0100)]
vulkan/wsi: Don't open-code vk_format_get_blocksize()
We already have a standard helper to retrieve the texel block size from
a VkFormat, let's use it instead of adding a new helper.
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Boris Brezillon [Fri, 18 Feb 2022 08:25:05 +0000 (09:25 +0100)]
vulkan/wsi: Use ALIGN_POT() instead of open-coding it
align_u32() and ALIGN_POT() are doing the same thing.
Replace align_u32() calls by ALIGN_POT() ones and get rid
of align_u32().
Signed-off-by: Boris Brezillon <boris.brezillon@collabora.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Erik Faye-Lund [Mon, 19 Jul 2021 10:21:04 +0000 (12:21 +0200)]
vulkan/wsi: pass win32-swapchain directly
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12210>
Marcin Ślusarz [Fri, 18 Feb 2022 13:31:00 +0000 (14:31 +0100)]
anv: cleanup begin_subpass & end_subpass
Share values of some expressions instead of duplicating the same logic.
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15079>
Marcin Ślusarz [Fri, 18 Feb 2022 12:16:07 +0000 (13:16 +0100)]
intel/compiler: remove redundant code from fs_visitor::run_*
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15079>
Gert Wollny [Tue, 15 Feb 2022 09:48:41 +0000 (10:48 +0100)]
virgl: Enable PIPE_CAP_TGSI_TEXCOORD when the host supports it
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Italo Nicola <italonicola@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15025>
Juan A. Suarez Romero [Fri, 18 Feb 2022 12:53:30 +0000 (13:53 +0100)]
vc4: remove redundant initialization
These assignments are not required.
Partially fixes https://gitlab.freedesktop.org/mesa/mesa/-/issues/3966
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15080>
Samuel Pitoiset [Wed, 16 Feb 2022 09:07:08 +0000 (10:07 +0100)]
radv,aco,llvm: lower adjusting vertex alpha in NIR
Instead of duplicating the same lowering in both compiler backends.
This pass will be used to do more VS input lowering.
fossils-db (Polaris10):
Totals from 48 (0.04% of 135960) affected shaders:
VGPRs: 1692 -> 1684 (-0.47%)
CodeSize: 54016 -> 53964 (-0.10%); split: -0.11%, +0.01%
MaxWaves: 339 -> 341 (+0.59%)
Instrs: 11260 -> 11247 (-0.12%); split: -0.13%, +0.02%
Latency: 88165 -> 88113 (-0.06%); split: -0.07%, +0.01%
InvThroughput: 36153 -> 36093 (-0.17%)
Copies: 583 -> 568 (-2.57%)
fossils-db (Pitcairn):
Totals from 43 (0.03% of 135960) affected shaders:
VGPRs: 1548 -> 1552 (+0.26%)
CodeSize: 47900 -> 47820 (-0.17%)
Instrs: 10751 -> 10731 (-0.19%)
Latency: 83029 -> 82873 (-0.19%)
VClause: 168 -> 164 (-2.38%)
SClause: 393 -> 391 (-0.51%)
Copies: 705 -> 685 (-2.84%)
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15076>
Qiang Yu [Tue, 8 Feb 2022 09:49:28 +0000 (17:49 +0800)]
util/util_vertex_state_cache: remove error check when deinit
Application may exit without freeing created display list, this
may leave the cache not empty.
This is triggered by Abaqus which just close X11 display without
calling any of GLX cleanup functions like glXDestroyContext. But
GLX hook to X11 display close function to free GLX screen resource.
So display list as a context resource has not been freed, but
cache as a screen resource is freed.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
Qiang Yu [Tue, 8 Feb 2022 02:14:15 +0000 (10:14 +0800)]
driconf: add Abaqus configs
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
Qiang Yu [Mon, 7 Feb 2022 09:54:57 +0000 (17:54 +0800)]
glx: keep native window glx drawable by driconf option
DRI3 window back buffer is a client resource, so it's destroyed
when context switch drawable for native window.
But some application like Abaqus may leave a dirty back buffer
and reuse it when switch back. So add a driconf option for these
kind of app to keep the entire GLX drawable for native window.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
Qiang Yu [Mon, 7 Feb 2022 07:00:03 +0000 (15:00 +0800)]
glx: merge drawable release to the same function
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
Qiang Yu [Wed, 9 Feb 2022 08:00:30 +0000 (16:00 +0800)]
glx: fix pbuffer refcount init
glXMakeCurrent* may miss release pbuffer if pbuffer is created
with refcount=0. This won't happen when pbuffer had different
GLX id and X pixmap id.
cc: mesa-stable
Fixes:
bc8a51a79a5 ("glx: no need to create extra pixmap for pbuffer")
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14926>
Iago Toral Quiroga [Mon, 21 Feb 2022 13:09:33 +0000 (14:09 +0100)]
broadcom/compiler: only patch temps that existed before the current spill
When we spill we add new temps. We should be careful not to access
liveness for these until we have re-computed it after all spills and
fill for that the spilled temp have been processed so as to avoid
out-of-bounds accesses to the c->temp_start and c->temp_end arrays.
This fixes a crash in a Three.js demo when we try to patch register
classes after a TMU spill that was caused because we would incorrectly
try to patch the same temps we had just added for the spill itself,
which is not only unnecessary but also incorrect since we these temps
would not have liveness information available yet and thus would
cause out of bounds accesses.
Fixes:
f3c3228522 ('broadcom/compiler: do not rebuild the interference graph after each spill')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15107>
Marek Olšák [Sat, 12 Feb 2022 01:20:35 +0000 (20:20 -0500)]
gallivm: fix build with LLVM 15
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15095>
Marek Olšák [Sat, 19 Feb 2022 17:58:18 +0000 (12:58 -0500)]
ci: bump piglit version
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
Marek Olšák [Sat, 22 Jan 2022 16:22:40 +0000 (11:22 -0500)]
gallium: add PIPE_RESOURCE_FLAG_UNMAPPABLE for shared unmappable buffers
We need to handle this in u_threaded_context for GL-VK interop.
Drivers should set this when importing buffers if needed.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
Jiadong Zhu [Tue, 30 Jul 2019 08:48:53 +0000 (04:48 -0400)]
st/mesa: set GL_DYNAMIC_STORAGE_BIT for GL-VK interop buffers
GL_DYNAMIC_STORAGE_BIT needs to be set to make glBufferSubData work.
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14750>
Erik Faye-Lund [Fri, 18 Feb 2022 17:29:34 +0000 (18:29 +0100)]
nir/spirv: guard macros in case of redefinition
On some systems, these macros are already defined, and being defined
slightly differently causes them to emit redefinition-warnings.
Let's wrap them in ifdefs to avoid the warnings.
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15084>
Alyssa Rosenzweig [Mon, 21 Feb 2022 16:50:59 +0000 (11:50 -0500)]
asahi: Fix use-after-free in shader key
We need to take ownership of shader keys before we can insert them into
the hash table. Caught by ASan.
==6343==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x00016bc51410 at pc 0x00010498d6cc bp 0x00016bc50240 sp 0x00016bc4f9d0
READ of size 592 at 0x00016bc51410 thread T0
#0 0x10498d6c8 in MemcmpInterceptorCommon(void*, int (*)(void const*, void const*, unsigned long), void const*, void const*, unsigned long)+0x208 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x196c8)
#1 0x10498da08 in wrap_memcmp+0x98 (libclang_rt.asan_osx_dynamic.dylib:arm64e+0x19a08)
#2 0x10b7f3f18 in asahi_shader_key_equal agx_state.c:867
#3 0x10a482e7c in hash_table_search hash_table.c:325
#4 0x10b7f4e94 in agx_update_shader agx_state.c:899
#5 0x10b7f0dc4 in agx_draw_vbo agx_state.c:1590
#6 0x10a7c28c4 in u_vbuf_draw_vbo u_vbuf.c:1498
#7 0x10a5db03c in cso_multi_draw cso_context.c:1639
#8 0x10aed03d0 in _mesa_validated_drawrangeelements draw.c:1812
#9 0x10aed08d4 in _mesa_DrawElements draw.c:1945
Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15109>
Michel Dänzer [Thu, 16 Dec 2021 11:23:08 +0000 (12:23 +0100)]
ci: Remove unused is-for-marge YAML anchor
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
Michel Dänzer [Thu, 16 Dec 2021 11:09:10 +0000 (12:09 +0100)]
ci: Use $CI_PIPELINE_SOURCE
Instead of $CI_MERGE_REQUEST_SOURCE_BRANCH_NAME. Shorter and clearer.
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
Michel Dänzer [Thu, 16 Dec 2021 11:03:18 +0000 (12:03 +0100)]
ci: Use $CI_COMMIT_BRANCH
This was recently added to indicate pipelines for branches.
v2:
* Modify .gitlab-ci/test-source-dep.yml as well.
Acked-by: Emma Anholt <emma@anholt.net> # v1
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14225>
Rhys Perry [Wed, 24 Nov 2021 14:17:40 +0000 (14:17 +0000)]
nir/validate: don't add instrs not present in shader to shader_gc_list
This makes the set smaller and GC list validation faster.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13547>
Rhys Perry [Wed, 27 Oct 2021 10:25:27 +0000 (11:25 +0100)]
nir/validate: don't validate the GC list by default
This seems really slow.
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13547>
Samuel Pitoiset [Fri, 3 Dec 2021 08:23:51 +0000 (09:23 +0100)]
radv: set profile_peak when capturing with SQTT
Using new CTX OP to set/get stable pstates.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Samuel Pitoiset [Fri, 3 Dec 2021 08:03:31 +0000 (09:03 +0100)]
radv/winsys: add support for new CTX OP to set/get stable pstates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Samuel Pitoiset [Fri, 3 Dec 2021 07:47:36 +0000 (08:47 +0100)]
ac: add ac_gpu_info::has_stable_pstate
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Samuel Pitoiset [Fri, 3 Dec 2021 07:52:39 +0000 (08:52 +0100)]
include/drm-uapi: update amdgpu_drm.h for new CTX OP to set/get stable pstates
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Samuel Pitoiset [Wed, 16 Feb 2022 11:16:42 +0000 (12:16 +0100)]
meson: bump libdrm_amdgpu version to 2.4.110
For the new AMDGPU CTX OP stable pstates.
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Samuel Pitoiset [Wed, 16 Feb 2022 11:32:13 +0000 (12:32 +0100)]
ci: upgrade to libdrm 2.4.110
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14038>
Mihai Preda [Fri, 18 Feb 2022 10:00:53 +0000 (12:00 +0200)]
radeonsi/tests: update glcts baseline on vega20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15075>
Mihai Preda [Fri, 18 Feb 2022 09:33:53 +0000 (11:33 +0200)]
radeonsi/tests: update piglit baseline on vega20
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15075>
Mihai Preda [Wed, 16 Feb 2022 11:36:14 +0000 (13:36 +0200)]
radeonsi/tests: print PCI-id of GPU device under test
Allows to identify GPUs in a system with multiple devices of the same model.
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15044>
Marcin Ślusarz [Tue, 1 Feb 2022 13:39:39 +0000 (14:39 +0100)]
anv: don't set color state when input state was requested
Fixes:
814dc669359 ("anv: Allocate surface states per-subpass")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15081>
Dave Airlie [Tue, 8 Feb 2022 07:01:43 +0000 (17:01 +1000)]
ci/lavapipe: fixup results after proper reference counting.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 06:02:08 +0000 (16:02 +1000)]
llvmpipe: allow vertex processing and fragment processing in parallel
This removes the block at the end of fragment processing and allow
multiple scenes to be queued to the rasterizer up to MAX_SCENES.
Running heaven with this shows up to 39 scenes been allocated in the
first few renders, but it also removes all stalls in rendering until
the present stalls for completion. It reduces frame rendering times
(not enough to make it > 1 fps) but looks to be about 10% increase.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 16 Feb 2022 01:30:45 +0000 (11:30 +1000)]
llvmpipe: add support for fence_server_sync.
This fixes multi-context flushes with async fs processing.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Sun, 13 Feb 2022 19:21:15 +0000 (05:21 +1000)]
lavapipe: pass partial results flags through.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Fri, 11 Feb 2022 05:01:06 +0000 (15:01 +1000)]
llvmpipe/query: add support for partial query waits.
Without overlap, the fence should always be signalled so this
won't be hit, but once overlap is enabled, then cases will start
to fail due to missing this.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Sun, 13 Feb 2022 19:17:46 +0000 (05:17 +1000)]
gallium: add partial bit to the query flags.
This is to match the vulkan partial bit so lavapipe can work
with new llvmpipe changes.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 05:41:21 +0000 (15:41 +1000)]
llvmpipe: check framebuffer resources for all scenes for references.
Some inflight scenes might be using the framebuffers as a dest,
make sure to get flushing correct.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 05:39:57 +0000 (15:39 +1000)]
llvmpipe: add images to the scene resource tracker.
This adds all the images to the scene resource tracker.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 05:37:40 +0000 (15:37 +1000)]
llvmpipe: add ssbo to resources reference by scenes.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 05:34:06 +0000 (15:34 +1000)]
llvmpipe: pass ssbo write mask down into setup.
this will be used to keep track of ssbo buffer references.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 05:07:53 +0000 (15:07 +1000)]
llvmpipe: add writeable resource tracking to the scene.
The scene tracks resource, but only currently tracks textures,
in order for scene overlap to work properly, it needs to track
fb, ssbo and image resources as well.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 05:57:19 +0000 (15:57 +1000)]
llvmpipe: size initial allocation and free scenes
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 05:49:16 +0000 (15:49 +1000)]
llvmpipe: handle dynamically creating scenes when needed
This will create scenes from the slab allocator up the to max
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 05:48:51 +0000 (15:48 +1000)]
llvmpipe: base the scene queue size of the max number of scenes.
If the max scenes increases then the queue will get resized.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 05:26:18 +0000 (15:26 +1000)]
llvmpipe/scene: move to slab allocated objects for scenes.
Currently we only allocate one scene, but I'd like to increase that
so move it to a slab allocator.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Fri, 11 Feb 2022 05:45:34 +0000 (15:45 +1000)]
llvmpipe/flush: always finish whether for cpu/gpu access.
Subsequent GPU access to resources for reading in the vertex
shader may rely on previous fragment shaders being flushed out.
Always finish here.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Wed, 9 Feb 2022 01:13:10 +0000 (11:13 +1000)]
llvmpipe: convert texture barrier to a finish.
Need to flush the rasterizer and wait for everything to finish,
with new overlap flush isn't enough.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Mon, 7 Feb 2022 00:08:02 +0000 (10:08 +1000)]
lavapipe: handle non-timeline semaphores wait/signal.
When llvmpipe is allowed execute fragment shaders overlapping
with other stuff, we have to start using the pipe fences.
With presentation, the acquire path needs to signal a semaphore
that can be waited on by the user, so add support for passing
signal/wait semaphores for non-timeline in, and just put a
fence pointer in the semaphore for that case.
This fixes rendering once we allow overlapping rasterization.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Sun, 13 Feb 2022 23:35:25 +0000 (09:35 +1000)]
lavapipe: don't flush on transfer operations.
The pipeline barrier/wait event code should handle this.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Mon, 16 Nov 2020 05:44:06 +0000 (15:44 +1000)]
lavapipe: execute a finish in pipeline barrier and event waiting.
Refactor out the code for finishing a fence and used it in
pipeline barrier and event waiting.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Mon, 7 Feb 2022 07:41:04 +0000 (17:41 +1000)]
lavapipe: handle endless fence timeout properly.
If the users ask for an infinte timeout, just pass it through
to gallium.
When llvmpipe ends up allowing async fragment shaders, it's important
to get this right for lots of CTS tests.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 8 Feb 2022 07:26:40 +0000 (17:26 +1000)]
lavapipe: fix pipeline statistic query results with availability.
The availability is meant to be the last integer value written,
but for pipeline stats this was being done wrong. calculate
the availability position properly.
With the old non-overlapping execution model queries never
were unavailable.
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Dave Airlie [Tue, 31 Mar 2020 05:30:34 +0000 (15:30 +1000)]
drisw: fence drawing to the swap/copy buffers.
Currently neither llvmpipe or softpipe ever leave any drawing in
the pipeline, but I'd like to change that for llvmpipe.
This makes drisw block for completed rendering before sending
data to the X server.
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
Ilia Mirkin [Mon, 29 Nov 2021 07:20:36 +0000 (02:20 -0500)]
freedreno/ir3: document GETINFO's x/y results
The zw were already known, but throw them in here too. I'm not extremely
happy with the description of "y", feels like there's a simpler
explanation there, but I couldn't find it.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14672>
Qiang Yu [Fri, 11 Feb 2022 07:01:25 +0000 (15:01 +0800)]
radeonsi: fix depth stencil multi sample texture blit
This causes the flushed_depth_texture is allocated without
multi sample. So the blit will cause VM fault.
cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14990>
Dave Airlie [Sun, 20 Feb 2022 23:35:00 +0000 (09:35 +1000)]
crocus: fix leak on gen4/5 stencil fallback blit path.
Noticed by Ilia.
Fixes:
f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15100>
Ilia Mirkin [Sat, 19 Feb 2022 17:19:58 +0000 (12:19 -0500)]
freedreno/a4xx: make luminance formats renderable, add missing L8A8_SNORM
If the luminance formats aren't renderable, they back out to R*
formats, but those will end up with a 1 in alpha rather than 0 when
textured. So instead make them explicitly renderable, which will cause
the correct texture format swizzle to be applied.
Fixes query-rgba-signed-components and probably others.
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15097>
Ilia Mirkin [Sat, 19 Feb 2022 17:16:27 +0000 (12:16 -0500)]
freedreno/a4xx: use correct macro for color
Doesn't actually matter since all the colors are encoded the same. But
for consistency...
Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15097>
Danylo Piliaiev [Wed, 2 Feb 2022 17:29:34 +0000 (19:29 +0200)]
turnip: Add a refcount mechanism to BOs
Until now we have lived without a refcount mechanism in the driver
because in Vulkan the user is responsible for handling the life
span of memory allocations for all Vulkan objects, however,
imported BOs are tricky because the kernel doesn't refcount
so user-space needs to make sure that:
1. When importing a BO into the same device used to create it
(self-importing) it does not double free the same BO.
2. Frees imported BOs that were not allocated through the same
device.
Our initial implementation always freed BOs when requested,
so we handled 2) correctly but not 1) on drm and we would
double-free self-imported BOs because kernel doesn't return
a unique gem_handle on each import.
Beside this the submit ioctl checks for duplicates in the
BO list and returns an error if there is one.
This fixes the problem for good by adding refcounts to BOs
so that self-imported BOs have a refcnt > 1 and are only freed
when all references are freed.
KGSL on the other hand does not have the same problems,
at least not with ION buffers which are used for exportable
BOs on pre 5.10 android kernels.
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5936
Fixes CTS tests: dEQP-VK.drm_format_modifiers.export_import.*
Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15031>
Lionel Landwerlin [Mon, 31 Jan 2022 12:43:04 +0000 (12:43 +0000)]
anv/genxml/intel/fs: fix binding shader record entry
Bit is flipped compared to all the other packets.
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes:
705395344d25 ("intel/fs: Add support for compiling bindless shaders with resume shaders")
Fixes:
c3ac9afca389 ("anv: Create and return ray-tracing pipeline SBT handles")
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15078>