MSVC's qsort_s behaves similarly to sort_r. Unfortunately, qsort_s's
compare function has the "context"/"args" as its first argument. BSD's
qsort_r has a different order than GNU's qsort_r. Finally, C11 added
qsort_s's which look like GNU's gsort_r.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
Android and MSVC don't have qsort_r() so let's provide a util wrapper
that uses the old qsort and thread-local storage. We use C++ for this
because thread_local is built into C++11 and we can't rely on C11
everywhere.
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
Since DXC doesn't perform de-duplication for arbitrary semantic names,
and the DXIL validator checks against this behavior. We need to remove
the de-duplication.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
This code was written but (rightfully) commented out, because it
referenced non-existing vulkan formats.
The correct vulkan analogs come in the form _PACK16 and _PACK32,
respectively, which have their component ordering in high->low bit
order. This is compatible with the DRM format ordering on little endian
systems, so we can just implement them all in the obvious way. On big
endian systems, the _PACKN formats have no analogs, because the
corresponding DRM formats are specified as always being little endian.
I implemented all of the formats I could, while excluding those that
don't map to vulkan at all (e.g. BGRA1010102), and commenting out the
ones that require an extra extension (e.g. ARGB4444) because they
probably need to be checked for extension presence first.
List slightly re-ordered to make it more neatly organized. Tested
working with the 2101010 and 565 variants. Was not able to test the 4444
or 1555 formats, but I verified the channel order was correct so they
should be working in theory.
Signed-off-by: Niklas Haas <git@haasn.xyz>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9737>
tu_kgsl.c: tu_enumerate_devices closed fd previously closed by
tu_physical_device_init function.
Move out the fd closing from tu_physical_device_init function because
they do not belong to it.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11561>
This depends on both the Vulkan SDK and the Vulkan Runtime, so let's
install those first.
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>
It turns out, some combinations of Meson and MSVC doesn't handle UTF-8
symbols in source-files as gracefully as we'd like. Luckily, there's a
work-around; forcing UTF-8 as the default-encoding.
Please see this Meson ticket for details:
https://github.com/mesonbuild/meson/issues/8263
Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>
The way p_atomic_cmpxchg is implemented on Windows really wants us to
use integers instead of things like pointers. So let's use uintptr_t
here. It seems cleaner to use that than the value zero for the last
argument, because it shows the intent of the code more clearly.
Fixes: d80d9e1c93 ("zink: queue v3.0")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>
The second argument to debug_get_bool_option is a boolean, not a
pointer. Passing a NULL-pointer there triggers a warning, which we treat
as an error on MSVC:
---8<---
../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): error C2220:
the following warning is treated as an error
../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): warning C4047:
'function': 'bool' differs in levels of indirection from 'void *'
../src/gallium/auxiliary/driver_trace/tr_screen.c(1071): error C4024:
'debug_get_bool_option': different types for formal and actual parameter 2
---8<---
Fixes: c1270d4845 ("aux/trace: add screen deduplication for zink+lavapipe tracing")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>
Fixes:
dEQP-VK.api.info.format_properties.g8b8g8r8_422_unorm
dEQP-VK.api.info.format_properties.b8g8r8g8_422_unorm
and part of:
dEQP-VK.api.info.format_properties.g8_b8_r8_3plane_420_unorm
dEQP-VK.api.info.format_properties.g8_b8r8_2plane_420_unorm
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
Previously, it could happen that a parallelcopy of
a definition was inserted before the instruction.
Fixes Rage 2 with GFX7.
No fossil-db changes.
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11571>
v2 (Jordan Justin):
- add anv_gem_stubs.c impl
v3 (Jason Ekstrand):
- Use the upstream uAPI
- Rework the interface a bit
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
Create additional memory type with DEVICE_LOCAL_BIT if we have local
memory region aviable.
v2 (Jason Ekstrand):
- Don't leak mem_regions if the second ioctl fails
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
From drm-next at the following commit:
commit 2a7005c8a3982ba27fab237d85c27da446484e9c (HEAD)
Merge: 0666cba1f5b2b 47c65b3853f88
Author: Dave Airlie <airlied@redhat.com>
Date: Fri Jun 11 13:34:42 2021 +1000
Merge tag 'drm-intel-gt-next-2021-06-10' of...
Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
Implements the two functions defined in the extension
VK_EXT_acquire_drm_display, vkAcquireDrmDisplayEXT and vkGetDrmDisplayEXT.
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11014>
Modifies the signature on `wsi_display_get_connector` to retrieve the
connector of an arbitrary DRM FD instead of the one taken from the
wsi_display.
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11014>
This gets rid of the awkward interface for isl_surf_get_ccs_surf where
we passed it two aux surfaces and it was supposed to fill out the second
one based on whether or not the first one already had stuff in it.
Instead, we now pass it three well-labled surfaces: surf,
hiz_or_mcs_surf, and ccs_surf which have obvious meanings. This does
mean that iris has to carry a bit of logic and we have to flip
parameters around in all the callers. But the resulting interface is
much cleaner.
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
Whether or not a surface supports CCS on Tigerlake and later is
dependent not only on the main surface but also on the MCS or HiZ
surface, if any. We were doing some of these checks in
isl_get_ccs_surf based on the extra_aux parameter but not as many as we
probably should. In particular, we were really only checking HiZ
conditions and nothing for MCS. It also meant that, in spite of the
symmetry in names, the checks in isl_surf_get_ccs_surf were more
complete than in isl_surf_supports_ccs.
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
The only driver which calls isl_surf_get_ccs_surf with extra_aux != NULL
is iris and it always calls it with two aux surfaces and never calls it
for CCS twice. We can turn those checks into asserts.
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
Without this, I get the following error if I try to compile Zink without
any other drivers:
src/gallium/targets/libgl-gdi/libgl_gdi.c(210): error C2037: left of
'flush_frontbuffer' specifies undefined struct/union 'pipe_screen'
Fixes: fdfe4a4d30 ("libgl-gdi: add zink support")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11536>
This removes a macro that we don't need, and removes a comment about a
detail that we don't care about in that location.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
These functions are only used once anyway, no need to store them and
make the rest of Zink care.
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
These functions were added, but never used. Let's get rid of them.
Fixes: c2cb2dd3bc ("zink: Added support for MacOS MoltenVK APIs.")
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
These functions don't exist in the Khronos XML, so we don't generate
dispatch-table entries for them. So let's not try to call them in that
way.
Fixes: 5574868103 ("zink: use the dispatch tables")
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
We also forgot to remove these when we stoped using them, more stuff to
delete, yeah!
Fixes: 5574868103 ("zink: use the dispatch tables")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>
We stopped using these without removing them, let's tidy that bit up.
Fixes: 5574868103 ("zink: use the dispatch tables")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11554>