Commit Graph

141905 Commits

Author SHA1 Message Date
Enrico Galli aa7aa7c78f microsoft/compiler: Switch io sort to use nir_sort_variables_with_modes
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:13 +00:00
Enrico Galli 8a5333c105 nir: Add modes filter to nir_sort_variables
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:13 +00:00
Jason Ekstrand 81cb20bd17 nir: Add a function for sorting variables
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:13 +00:00
Enrico Galli cf385cf68c util: Add qsort_r/s args adapter for MSVC and BSD/macOS
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>
2021-06-24 20:05:12 +00:00
Enrico Galli 1df2acfbb8 util: Add simple test for util_qsort_r
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:12 +00:00
Jason Ekstrand bdd460fdcb util: Add an implementation of qsort_r for non-GNU platforms
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>
2021-06-24 20:05:12 +00:00
Enrico Galli e2e22720dc d3d12, microsoft/compiler: Moving driver_location allocation to compiler
Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:12 +00:00
Enrico Galli d0f1698a73 d3d12, microsoft/compiler: Switching semantic names to TEXCOORD
Switching from GENERIC/VARYING to TEXCOORD. This change better aligns
with other dxil generators (SPIRV-Cross, Tint).

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>
2021-06-24 20:05:12 +00:00
Enrico Galli b8e2374950 microsoft/compiler: Remove de-duplication of arbitrary semantic names
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>
2021-06-24 20:05:12 +00:00
Niklas Haas 83f8b19f9b vulkan/wsi/wayland: implement the full format table
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>
2021-06-24 19:37:51 +00:00
Alexey Nurmukhametov 8d0d2e82e7 tu/kgsl: Fix file descriptor double close
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>
2021-06-24 18:16:15 +00:00
Erik Faye-Lund a426d7c264 ci/windows: enable msvc builds of zink
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>
2021-06-24 17:51:48 +00:00
Erik Faye-Lund b437fb810a ci/windows: work around meson encoding issues
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>
2021-06-24 17:51:47 +00:00
Erik Faye-Lund f815026d36 zink: cast pointers to uintptr_t
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>
2021-06-24 17:51:47 +00:00
Erik Faye-Lund bae4dca8e4 aux/trace: fix bool argument
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>
2021-06-24 17:51:47 +00:00
Emma Anholt ea5707c52f turnip: Disable buffer texturing on 422 formats.
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>
2021-06-24 17:34:06 +00:00
Emma Anholt 6bc88c26b6 ci/turnip: Document create_instance_device_intentional_alloc_fail's fail.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
2021-06-24 17:34:06 +00:00
Emma Anholt 55000408f9 turnip: Use vk_startup_errorf() in more startup paths.
This does the logging for you.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
2021-06-24 17:34:06 +00:00
Emma Anholt 31f8b70481 turnip: Link more MRs and issues related to our xfails.
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
2021-06-24 17:34:06 +00:00
Emma Anholt 4b44e28526 freedreno/ir3: Report RA failure with mesa_loge().
This is a major failure that should never happen (if we had spilling
support), don't hide the log behind DEBUG builds.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>
2021-06-24 17:34:06 +00:00
Erik Faye-Lund 45b7b57a83 iris/ci: disable amly jobs
These runners are having stability issues, and is causing a lot of
merge-requests to fail without reason. Let's disable them until the
runners have gotten some stability fixes in place.

See this discussion for details:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/3437#note_971266

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11580>
2021-06-24 17:13:18 +00:00
Daniel Schürmann b14bd285f8 aco/ra: handle copies of copies better
Instead of adding a second copy, just redirect
the existing copy.

No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11571>
2021-06-24 16:53:10 +00:00
Daniel Schürmann 995e218993 aco/ra: handle copies of definition registers
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>
2021-06-24 16:53:10 +00:00
Jason Ekstrand d31dd81292 anv: Claim to be a discrete GPU if has_lmem
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
2021-06-24 16:14:38 +00:00
Jordan Justen b6a1063c2e intel/dev: Set has_local_mem for DG1
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>
2021-06-24 16:14:38 +00:00
Sagar Ghuge e505c221fa anv: Allocate scratch and workaround BO in local memory
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>
2021-06-24 16:14:38 +00:00
Sagar Ghuge 6352371ff6 anv: Allocate BO in appropriate region
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>
2021-06-24 16:14:38 +00:00
Sagar Ghuge 3f8eca7f82 anv: Wrapper around I915_GEM_CREATE_EXT_MEMORY_REGIONS
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>
2021-06-24 16:14:38 +00:00
Sagar Ghuge 65e8d72bc1 anv: Query memory region info
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>
2021-06-24 16:14:38 +00:00
Rafael Antognolli aa3775c8e4 iris: Map with WC on non-LLC platforms.
Reworks:
 * Jordan: Required rework following
   f62724ccac ("iris: Pick a single mmap mode (WB/WC) at BO allocation time")

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
2021-06-24 16:14:38 +00:00
Rafael Antognolli b6a7400dfd iris/bufmgr: Add flag to allocate from local memory.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
2021-06-24 16:14:38 +00:00
Rafael Antognolli 55be94dcab iris/bufmgr: Add new set of buckets for local memory.
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
2021-06-24 16:14:38 +00:00
Rafael Antognolli e60114b2ae iris/bufmgr: Query memory region info.
v2 (Jason Ekstrand):
 - Don't leak meminfo if the ioctl fails on the second pass

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5599>
2021-06-24 16:14:38 +00:00
Jordan Justen 84069acfd4 iris/bufmgr: Align vma addresses to 64K for local memory
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>
2021-06-24 16:14:38 +00:00
Jordan Justen cb6feae0b5 intel/devinfo: Add has_local_mem
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>
2021-06-24 16:14:38 +00:00
Jason Ekstrand 8dc3c91a5c include/drm-uapi: bump headers
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>
2021-06-24 16:14:38 +00:00
Simon Zeni 2fe2eb1911 radv: Implement VK_EXT_acquire_drm_display
Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11014>
2021-06-24 15:48:38 +00:00
Simon Zeni f9944899a7 vulkan/wsi: Implement VK_EXT_acquire_drm_display
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>
2021-06-24 15:48:38 +00:00
Simon Zeni fdf22aad73 vulkan/wsi: add drm_fd param to wsi_display_get_connector
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>
2021-06-24 15:48:38 +00:00
Jason Ekstrand 7fb70ee2d5 docs/isl: Improve the bit[6] swizzling section of the tiling chapter
Suggested-by: Luis Strano <luis.strano@intel.com>
Acked-by: Luis Strano <luis.strano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
2021-06-24 13:57:40 +00:00
Jason Ekstrand b8030ab1ea isl,docs: Add a chapter on AUX state tracking
We also update and improve the docs in isl.h which get pulled into this
new chapter.

Acked-by: Luis Strano <luis.strano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
2021-06-24 13:57:40 +00:00
Jason Ekstrand 94a52bc85c isl,iris: Move the extra_aux_surf logic into iris
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>
2021-06-24 13:57:40 +00:00
Jason Ekstrand 37f76aab1c isl: Take a hiz_or_mcs_surf in isl_surf_supports_ccs
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>
2021-06-24 13:57:40 +00:00
Jason Ekstrand 2d2590a879 isl: Assert some iris invariants in isl_surf_get_ccs_surf
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>
2021-06-24 13:57:40 +00:00
Vinson Lee 6fe82e6c1e asahi: Fix macOS macro.
Fixes: 26b19bda30 ("asahi: Add device abstraction")
Fixes: 55c0956fd0 ("asahi: Add (clean room) IOKit uABI header")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11569>
2021-06-24 13:49:40 +00:00
Erik Faye-Lund 9aff548ff4 libgl-gdi: add missing include
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>
2021-06-24 09:30:20 +00:00
Erik Faye-Lund fa784acbdf zink: remove some needless moltenvk details
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>
2021-06-24 10:47:00 +02:00
Erik Faye-Lund ccb9f8670e zink: do not store moltenvk functions in screen
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>
2021-06-24 10:46:55 +02:00
Erik Faye-Lund 95cbb560cf zink: remove unused moltenvk functions
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>
2021-06-24 10:46:52 +02:00
Erik Faye-Lund 7b220f8694 zink: unbreak moltenvk code
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>
2021-06-24 10:46:31 +02:00