platform/upstream/mesa.git
3 years agoanv: unify some draw state vertex constant emission
Mike Blumenkrantz [Tue, 22 Jun 2021 18:42:48 +0000 (14:42 -0400)]
anv: unify some draw state vertex constant emission

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11531>

3 years agozink: repack zink_context struct a bit
Mike Blumenkrantz [Fri, 7 May 2021 13:41:45 +0000 (09:41 -0400)]
zink: repack zink_context struct a bit

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11593>

3 years agofreedreno, tu: Set SP_XS_PVT_MEM_HW_STACK_OFFSET
Connor Abbott [Thu, 24 Jun 2021 16:30:24 +0000 (18:30 +0200)]
freedreno, tu: Set SP_XS_PVT_MEM_HW_STACK_OFFSET

Theoretically this register should only be used when function calls in
the shader are used, which we don't support. But with the default value
of 0 it seems like pvtmem doesn't work on a650. Just set it to the total
per-SP size, effectively leaving no space for the return-address stack,
like the blob does.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4949
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11581>

3 years agofreedreno/a6xx: Make SP_XS_PVT_MEM_HW_STACK_OFFSET non-inline
Connor Abbott [Fri, 25 Jun 2021 13:06:12 +0000 (15:06 +0200)]
freedreno/a6xx: Make SP_XS_PVT_MEM_HW_STACK_OFFSET non-inline

Otherwise we can't use the helper to pack it as it collides with the
function in a6xx-pack.xml.h.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11581>

3 years agoir3: add ldg.a,stg.a which allow complex in-place offset calculation
Danylo Piliaiev [Wed, 16 Jun 2021 11:43:19 +0000 (14:43 +0300)]
ir3: add ldg.a,stg.a which allow complex in-place offset calculation

The full form for ldg.a/stg.a offset is:
 g[reg_address + reg_offset << (imm_shift + 2) + imm_offset << 2]

where imm_shift is in [0, 3] and imm_offset is in [0, 3]

a6xx blob was found to produce a bit simplier offset calculations
for TES/TCS shaders in GTA V:

 [c002000a_03c14215] ldg.a.f32 r2.z, g[r1.y+((r2.z+1)<<2)], 3;
 [c0020004_01c14609] ldg.a.f32 r1.x, g[r1.y+((r1.x+3)<<2)], 1;

Our new syntax:
 stg.a.u32 g[r2.x+(r1.x+1)<<2], r5.x, 1
 stg.a.u32 g[r2.x+r1.x<<4+3<<2], r5.x, 1
 ldg.a.f32 r1.w, g[r1.y+(r1.w+1)<<2], 3
 ldg.a.f32 r1.w, g[r1.y+r1.w<<5+2<<2], 3

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11431>

3 years agofreedreno/isa: add uoffset type to print positive-only offsets
Danylo Piliaiev [Fri, 18 Jun 2021 15:09:01 +0000 (18:09 +0300)]
freedreno/isa: add uoffset type to print positive-only offsets

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11431>

3 years agofreedreno/computerator: pass iova of buffer to const register
Danylo Piliaiev [Wed, 16 Jun 2021 18:31:03 +0000 (21:31 +0300)]
freedreno/computerator: pass iova of buffer to const register

The syntax is:
  @buf 32 (c2.x)
The "(c2.x)" is optional.

This makes possible to test stg, ldg, and global atomics.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11431>

3 years agoanv: do not dereference VkPipelineMultisampleStateCreateInfo always
Samuel Iglesias Gonsálvez [Fri, 25 Jun 2021 08:14:21 +0000 (10:14 +0200)]
anv: do not dereference VkPipelineMultisampleStateCreateInfo always

VkGraphicsPipelineCreateInfo.pMultisampleState is a pointer to a
VkPipelineMultisampleStateCreateInfo structure, and is ignored if the
pipeline has rasterization disabled.

Fixes a crash in one CTS tests that checks this.

Signed-off-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11601>

3 years agoturnip: early exit in tu6_draw_common to save cpu cycles
Danylo Piliaiev [Wed, 23 Jun 2021 10:55:06 +0000 (13:55 +0300)]
turnip: early exit in tu6_draw_common to save cpu cycles

Improves Zink + drawoverhead perf up to 4%

Before:
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 3981
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 3977

After:
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 4136
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 4163

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11556>

3 years agoturnip: do not re-emit same vs params
Danylo Piliaiev [Tue, 22 Jun 2021 14:24:43 +0000 (17:24 +0300)]
turnip: do not re-emit same vs params

Improves drawoverhead perf through Zink up to 260%

Before:
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 1518
After:
  1, DrawElements ( 1 VBO| 0 UBO|  0    ) w/ no state change, 3981

This brings it close to Freedreno, which has around 4300.

In vkQuake vs params re-emission now occurs in 0.23% of draw calls.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11556>

3 years agointel/genxml: Remove old scratch fields on GFX version 12.5
Jason Ekstrand [Tue, 20 Oct 2020 21:36:00 +0000 (16:36 -0500)]
intel/genxml: Remove old scratch fields on GFX version 12.5

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agoanv: Add support for scratch on XeHP
Jason Ekstrand [Tue, 20 Oct 2020 21:11:45 +0000 (16:11 -0500)]
anv: Add support for scratch on XeHP

Rework:
 * Jordan: Handle per_thread_scratch==0 in anv_scratch_pool_get_surf
 * Jordan: Update subslices in anv_scratch_pool_alloc
 * Jason: Clean up the patch a bit

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agoiris: Add support for scratch on XeHP
Jason Ekstrand [Tue, 20 Oct 2020 19:27:58 +0000 (14:27 -0500)]
iris: Add support for scratch on XeHP

Rework:
 * Jordan: Handle prog_data->total_scratch==0 in iris_upload_compute_walker
 * Jordan: Resolve iris_get_scratch_space conflict with e2c5ef6cd65
 * Jordan: Rebase on 4256f7ed584. broken
 * Ken: Mostly fixed the rebase
 * Jordan: Fix two small compilation issues
 * Jordan: Rebase on Ken's ("iris: Make a pin_scratch_space() helper")
 * Lionel: Fix a few bugs with scratch handles
 * Jason: Tidy the patch up a bit

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agoiris: Add a MEMZONE_BINDLESS and uploader
Jason Ekstrand [Wed, 21 Oct 2020 02:29:50 +0000 (21:29 -0500)]
iris: Add a MEMZONE_BINDLESS and uploader

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agointel/genxml: Add new ScratchSpaceBuffer fields on GFX version 12.5
Jason Ekstrand [Tue, 20 Oct 2020 21:34:25 +0000 (16:34 -0500)]
intel/genxml: Add new ScratchSpaceBuffer fields on GFX version 12.5

Rework:
 * Jordan: Fix MEMZONE_BINDER_START detection
 * Jordan: Bump the IRIS_BINDLESS_SIZE to 8M

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agointel/fs: Implement load/store_scratch on XeHP
Jason Ekstrand [Tue, 20 Oct 2020 22:47:17 +0000 (17:47 -0500)]
intel/fs: Implement load/store_scratch on XeHP

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agointel/fs: Implement spilling on XeHP
Jason Ekstrand [Tue, 20 Oct 2020 22:42:21 +0000 (17:42 -0500)]
intel/fs: Implement spilling on XeHP

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agointel/isl: Add support for scratch buffers
Jason Ekstrand [Tue, 20 Oct 2020 18:23:31 +0000 (13:23 -0500)]
intel/isl: Add support for scratch buffers

XeHP adds support for a new surface type for scratch.  It's similar to
SURFTYPE_STRBUF in that it's a 2D array-of-struct format but the one
key difference is that the U coordinate is computed automatically based
on the thread ID and only the V coordinate is provided in the dataport
message.

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agointel/genxml: Add SURFTYPE_SCRATCH on GFX version 12.5
Jason Ekstrand [Tue, 20 Oct 2020 18:09:23 +0000 (13:09 -0500)]
intel/genxml: Add SURFTYPE_SCRATCH on GFX version 12.5

Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11582>

3 years agoRevert "freedreno: Cooperate with tc to stop checking the BC for resource_busy()."
Emma Anholt [Thu, 24 Jun 2021 20:37:52 +0000 (13:37 -0700)]
Revert "freedreno: Cooperate with tc to stop checking the BC for resource_busy()."

This reverts commit 5cb043cf82af4af88dbfe83ce1eff4cc41e2a766.

While the numbers were impressive for drawoverhead, it comes at the cost
of additional flushes, which for gmem access (what we actually care about
most!) would greatly increase the actual cost to render.  Also, gl_driver2
overhead is increased, probably due to spending time in the kernel for the
flushes.

drawoverhead's win came from the increased flushing causing the GPU to
start processing the buffers sooner on everything but test 1, which
already had some incremental flushing happening.  That was certainly not
intended by the change.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11599>

3 years agozink: flush pending clears if a resource is bound as a descriptor
Mike Blumenkrantz [Sat, 24 Apr 2021 17:16:20 +0000 (13:16 -0400)]
zink: flush pending clears if a resource is bound as a descriptor

ensure that resource data is in sync with the expected command stream

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: only queue deferred descriptor layout change on first bind or change
Mike Blumenkrantz [Fri, 16 Apr 2021 14:27:54 +0000 (10:27 -0400)]
zink: only queue deferred descriptor layout change on first bind or change

otherwise, the layout is either already correct or already queued

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: improve automatic layout transitions for sampler+image descriptors
Mike Blumenkrantz [Fri, 16 Apr 2021 14:23:16 +0000 (10:23 -0400)]
zink: improve automatic layout transitions for sampler+image descriptors

binding new images may require auto-transitions for the other pipeline, and
unbinding an image requires that any persistent sampler binds have their layouts
updated

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: use bind counts to more accurately determine image descriptor's exact layout
Mike Blumenkrantz [Fri, 16 Apr 2021 14:21:39 +0000 (10:21 -0400)]
zink: use bind counts to more accurately determine image descriptor's exact layout

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: only do deferred image barriers if layout changes
Mike Blumenkrantz [Fri, 9 Apr 2021 14:30:49 +0000 (10:30 -0400)]
zink: only do deferred image barriers if layout changes

otherwise these should be handled by apps using glMemoryBarrier

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: split deferring of barriers to image and buffer functions
Mike Blumenkrantz [Mon, 10 May 2021 20:51:49 +0000 (16:51 -0400)]
zink: split deferring of barriers to image and buffer functions

make this more explicit

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agozink: break out image descriptor layout into util function
Mike Blumenkrantz [Wed, 7 Apr 2021 14:59:41 +0000 (10:59 -0400)]
zink: break out image descriptor layout into util function

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11590>

3 years agoci/windows: fix zink msvc build-rules
Erik Faye-Lund [Thu, 24 Jun 2021 20:45:20 +0000 (22:45 +0200)]
ci/windows: fix zink msvc build-rules

When I added the build-rules for zink to the windows build, I
accidentally added it to .windows-test-rules instead of
.windows-build-rules. This seems to trigger a build-error if we trigger
*just* a test due to a zink-change, but not a build.

Hopefully this fixes the problems Mike has had with Zink CI recently.

Fixes: a426d7c2643 ("ci/windows: enable msvc builds of zink")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11597>

3 years agomicrosoft/spirv_to_dxil: Add drive_location assignment
Enrico Galli [Tue, 25 May 2021 21:41:33 +0000 (14:41 -0700)]
microsoft/spirv_to_dxil: Add drive_location assignment

Acked-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10989>

3 years agomicrosoft/compiler: Switch io sort to use nir_sort_variables_with_modes
Enrico Galli [Tue, 8 Jun 2021 01:07:46 +0000 (18:07 -0700)]
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>

3 years agonir: Add modes filter to nir_sort_variables
Enrico Galli [Thu, 10 Jun 2021 20:46:15 +0000 (13:46 -0700)]
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>

3 years agonir: Add a function for sorting variables
Jason Ekstrand [Fri, 6 Nov 2020 23:19:53 +0000 (15:19 -0800)]
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>

3 years agoutil: Add qsort_r/s args adapter for MSVC and BSD/macOS
Enrico Galli [Mon, 7 Jun 2021 22:52:29 +0000 (15:52 -0700)]
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>

3 years agoutil: Add simple test for util_qsort_r
Enrico Galli [Tue, 15 Jun 2021 04:02:24 +0000 (21:02 -0700)]
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>

3 years agoutil: Add an implementation of qsort_r for non-GNU platforms
Jason Ekstrand [Tue, 10 Nov 2020 17:00:54 +0000 (11:00 -0600)]
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>

3 years agod3d12, microsoft/compiler: Moving driver_location allocation to compiler
Enrico Galli [Tue, 25 May 2021 21:40:09 +0000 (14:40 -0700)]
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>

3 years agod3d12, microsoft/compiler: Switching semantic names to TEXCOORD
Enrico Galli [Tue, 11 May 2021 01:00:57 +0000 (18:00 -0700)]
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>

3 years agomicrosoft/compiler: Remove de-duplication of arbitrary semantic names
Enrico Galli [Thu, 24 Jun 2021 02:25:14 +0000 (19:25 -0700)]
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>

3 years agovulkan/wsi/wayland: implement the full format table
Niklas Haas [Mon, 26 Apr 2021 11:40:38 +0000 (13:40 +0200)]
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>

3 years agotu/kgsl: Fix file descriptor double close
Alexey Nurmukhametov [Wed, 23 Jun 2021 16:38:06 +0000 (19:38 +0300)]
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>

3 years agoci/windows: enable msvc builds of zink
Erik Faye-Lund [Wed, 23 Jun 2021 04:40:21 +0000 (06:40 +0200)]
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>

3 years agoci/windows: work around meson encoding issues
Erik Faye-Lund [Tue, 22 Jun 2021 10:42:50 +0000 (12:42 +0200)]
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>

3 years agozink: cast pointers to uintptr_t
Erik Faye-Lund [Thu, 24 Jun 2021 11:30:20 +0000 (13:30 +0200)]
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: d80d9e1c935 ("zink: queue v3.0")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11424>

3 years agoaux/trace: fix bool argument
Erik Faye-Lund [Tue, 22 Jun 2021 14:01:49 +0000 (16:01 +0200)]
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: c1270d4845d ("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>

3 years agoturnip: Disable buffer texturing on 422 formats.
Emma Anholt [Wed, 23 Jun 2021 21:37:55 +0000 (14:37 -0700)]
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>

3 years agoci/turnip: Document create_instance_device_intentional_alloc_fail's fail.
Emma Anholt [Wed, 23 Jun 2021 18:06:49 +0000 (11:06 -0700)]
ci/turnip: Document create_instance_device_intentional_alloc_fail's fail.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>

3 years agoturnip: Use vk_startup_errorf() in more startup paths.
Emma Anholt [Mon, 21 Jun 2021 22:37:36 +0000 (15:37 -0700)]
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>

3 years agoturnip: Link more MRs and issues related to our xfails.
Emma Anholt [Mon, 21 Jun 2021 22:37:15 +0000 (15:37 -0700)]
turnip: Link more MRs and issues related to our xfails.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11562>

3 years agofreedreno/ir3: Report RA failure with mesa_loge().
Emma Anholt [Wed, 23 Jun 2021 19:15:02 +0000 (12:15 -0700)]
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>

3 years agoiris/ci: disable amly jobs
Erik Faye-Lund [Thu, 24 Jun 2021 15:56:08 +0000 (17:56 +0200)]
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>

3 years agoaco/ra: handle copies of copies better
Daniel Schürmann [Wed, 23 Jun 2021 14:29:21 +0000 (16:29 +0200)]
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>

3 years agoaco/ra: handle copies of definition registers
Daniel Schürmann [Wed, 23 Jun 2021 13:53:43 +0000 (15:53 +0200)]
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>

3 years agoanv: Claim to be a discrete GPU if has_lmem
Jason Ekstrand [Wed, 23 Jun 2021 20:15:03 +0000 (15:15 -0500)]
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>

3 years agointel/dev: Set has_local_mem for DG1
Jordan Justen [Thu, 3 Oct 2019 00:39:27 +0000 (17:39 -0700)]
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>

3 years agoanv: Allocate scratch and workaround BO in local memory
Sagar Ghuge [Fri, 17 Apr 2020 01:05:23 +0000 (18:05 -0700)]
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>

3 years agoanv: Allocate BO in appropriate region
Sagar Ghuge [Fri, 3 Apr 2020 03:16:08 +0000 (20:16 -0700)]
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>

3 years agoanv: Wrapper around I915_GEM_CREATE_EXT_MEMORY_REGIONS
Sagar Ghuge [Wed, 1 Apr 2020 01:26:20 +0000 (18:26 -0700)]
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>

3 years agoanv: Query memory region info
Sagar Ghuge [Wed, 1 Apr 2020 01:23:25 +0000 (18:23 -0700)]
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>

3 years agoiris: Map with WC on non-LLC platforms.
Rafael Antognolli [Fri, 3 Jan 2020 18:42:10 +0000 (10:42 -0800)]
iris: Map with WC on non-LLC platforms.

Reworks:
 * Jordan: Required rework following
   f62724ccacf ("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>

3 years agoiris/bufmgr: Add flag to allocate from local memory.
Rafael Antognolli [Mon, 29 Jul 2019 17:59:01 +0000 (10:59 -0700)]
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>

3 years agoiris/bufmgr: Add new set of buckets for local memory.
Rafael Antognolli [Mon, 29 Jul 2019 16:54:17 +0000 (09:54 -0700)]
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>

3 years agoiris/bufmgr: Query memory region info.
Rafael Antognolli [Thu, 6 Jun 2019 17:37:02 +0000 (10:37 -0700)]
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>

3 years agoiris/bufmgr: Align vma addresses to 64K for local memory
Jordan Justen [Wed, 31 Jul 2019 22:18:59 +0000 (15:18 -0700)]
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>

3 years agointel/devinfo: Add has_local_mem
Jordan Justen [Thu, 3 Oct 2019 00:37:33 +0000 (17:37 -0700)]
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>

3 years agoinclude/drm-uapi: bump headers
Jason Ekstrand [Wed, 23 Jun 2021 19:21:16 +0000 (14:21 -0500)]
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>

3 years agoradv: Implement VK_EXT_acquire_drm_display
Simon Zeni [Mon, 21 Jun 2021 15:56:35 +0000 (11:56 -0400)]
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>

3 years agovulkan/wsi: Implement VK_EXT_acquire_drm_display
Simon Zeni [Mon, 21 Jun 2021 15:55:14 +0000 (11:55 -0400)]
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>

3 years agovulkan/wsi: add drm_fd param to wsi_display_get_connector
Simon Zeni [Tue, 15 Jun 2021 15:05:05 +0000 (11:05 -0400)]
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>

3 years agodocs/isl: Improve the bit[6] swizzling section of the tiling chapter
Jason Ekstrand [Sat, 19 Jun 2021 02:55:08 +0000 (21:55 -0500)]
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>

3 years agoisl,docs: Add a chapter on AUX state tracking
Jason Ekstrand [Fri, 18 Jun 2021 21:34:44 +0000 (16:34 -0500)]
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>

3 years agoisl,iris: Move the extra_aux_surf logic into iris
Jason Ekstrand [Wed, 23 Jun 2021 21:48:36 +0000 (16:48 -0500)]
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>

3 years agoisl: Take a hiz_or_mcs_surf in isl_surf_supports_ccs
Jason Ekstrand [Fri, 18 Jun 2021 22:12:32 +0000 (17:12 -0500)]
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>

3 years agoisl: Assert some iris invariants in isl_surf_get_ccs_surf
Jason Ekstrand [Wed, 23 Jun 2021 22:03:06 +0000 (17:03 -0500)]
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>

3 years agoasahi: Fix macOS macro.
Vinson Lee [Thu, 24 Jun 2021 05:51:16 +0000 (22:51 -0700)]
asahi: Fix macOS macro.

Fixes: 26b19bda306 ("asahi: Add device abstraction")
Fixes: 55c0956fd00 ("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>

3 years agolibgl-gdi: add missing include
Erik Faye-Lund [Tue, 22 Jun 2021 17:37:18 +0000 (19:37 +0200)]
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: fdfe4a4d307 ("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>

3 years agozink: remove some needless moltenvk details
Erik Faye-Lund [Wed, 23 Jun 2021 07:51:28 +0000 (09:51 +0200)]
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>

3 years agozink: do not store moltenvk functions in screen
Erik Faye-Lund [Wed, 23 Jun 2021 07:46:15 +0000 (09:46 +0200)]
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>

3 years agozink: remove unused moltenvk functions
Erik Faye-Lund [Wed, 23 Jun 2021 07:40:44 +0000 (09:40 +0200)]
zink: remove unused moltenvk functions

These functions were added, but never used. Let's get rid of them.

Fixes: c2cb2dd3bc6 ("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>

3 years agozink: unbreak moltenvk code
Erik Faye-Lund [Wed, 23 Jun 2021 07:38:21 +0000 (09:38 +0200)]
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: 55748681032 ("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>

3 years agozink: remove unused function-pointers
Erik Faye-Lund [Wed, 23 Jun 2021 08:08:03 +0000 (10:08 +0200)]
zink: remove unused function-pointers

We also forgot to remove these when we stoped using them, more stuff to
delete, yeah!

Fixes: 55748681032 ("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>

3 years agozink: drop unused macros
Erik Faye-Lund [Wed, 23 Jun 2021 07:04:31 +0000 (09:04 +0200)]
zink: drop unused macros

We stopped using these without removing them, let's tidy that bit up.

Fixes: 55748681032 ("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>

3 years agocrocus: fix another printf specifier.
Dave Airlie [Thu, 24 Jun 2021 06:52:01 +0000 (16:52 +1000)]
crocus: fix another printf specifier.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11570>

3 years agocrocus/gfx6: always be dirtying gs attachments for xfb
Dave Airlie [Thu, 24 Jun 2021 06:43:16 +0000 (16:43 +1000)]
crocus/gfx6: always be dirtying gs attachments for xfb

This fixes hangs seen with xfb and the deqp test

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agocrocus: Avoid replacing backing storage for buffers with no contents
Dave Airlie [Thu, 24 Jun 2021 04:48:32 +0000 (14:48 +1000)]
crocus: Avoid replacing backing storage for buffers with no contents

Ported 97e9de17952d1382512007e4745c25b9c9106a46 from iris

    We might get asked to pitch the storage on a buffer that already has
    no meaningful contents.  In this case, the existing buffer is as good
    as a new one.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agocrocus: dirty blend state more often.
Dave Airlie [Thu, 24 Jun 2021 04:20:25 +0000 (14:20 +1000)]
crocus: dirty blend state more often.

The blend state depends on wm_prog_data dual_src and it also
depends on the cbuf formats in can_emit_logic_op.

Dirty it in the correct places.

Fixes:
dEQP-GLES3.functional.fbo.invalidate*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agocrocus/gfx6: fix sampler view first level.
Dave Airlie [Thu, 24 Jun 2021 03:19:31 +0000 (13:19 +1000)]
crocus/gfx6: fix sampler view first level.

The gfx6 state needs to dirty sampler state so that BaseMipLevel
gets updated properly.

Fixes:
dEQP-GLES3.functional.texture.mipmap.cube.base_level.*

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agointel/genxml: fix gfx6 GS SVB_INDEX encoding
Dave Airlie [Wed, 23 Jun 2021 23:06:09 +0000 (09:06 +1000)]
intel/genxml: fix gfx6 GS SVB_INDEX encoding

This seems to match what the docs + 965 traces say

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agocrocus/query: poll the syncobj in the no wait situation
Dave Airlie [Thu, 17 Jun 2021 19:07:26 +0000 (05:07 +1000)]
crocus/query: poll the syncobj in the no wait situation

In the no wait, poll the syncobj and bail if it's hasn't signalled.
This fixes a bunch of deqp xfb tests on sandybridge

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11567>

3 years agovl/dri3: Don't leak regions on the X server
Adam Jackson [Fri, 18 Jun 2021 13:36:13 +0000 (09:36 -0400)]
vl/dri3: Don't leak regions on the X server

I can't tell from a quick read whether this clip region is actually just
the bounding box so could be skipped entirely. But the old code never
destroyed it, which means we'd leak a couple hundred bytes on the X
server side for every SwapBuffers until the client dies of XID
exhaustion, which is somewhere north of 2GB for typical systems so you
may or may not just run out of memory first.

Create the region at swap time and stash it in the drawable state.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11461>

3 years agoloader/dri3: Don't churn through xfixes regions in SwapBuffers
Adam Jackson [Wed, 23 Jun 2021 15:05:44 +0000 (11:05 -0400)]
loader/dri3: Don't churn through xfixes regions in SwapBuffers

Regions are not expensive objects on the server side, it's very slightly
cheaper to update an existing one than to create a new one, and we can
garbage collect them when the drawable is destroyed. Worse, XID reuse
bugs exist, so the more we can do to not churn through XIDs the better.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11461>

3 years agoloader/dri3: Properly initialize the XFIXES extension
Adam Jackson [Wed, 23 Jun 2021 13:59:22 +0000 (09:59 -0400)]
loader/dri3: Properly initialize the XFIXES extension

The server starts off assuming the only XFIXES request the client might
known is FixesQueryVersion, and based on the version number the client
supplies it unlocks additional requests. If you forget to do this then
xcb_xfixes_create_region will throw BadRequest and you will be very
confused. libXfixes would hide this for you in extension setup but xcb
is not so forgiving.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11461>

3 years agoradeonsi: optimize set_inlinable_constants when they don't change
Marek Olšák [Mon, 21 Jun 2021 23:25:08 +0000 (19:25 -0400)]
radeonsi: optimize set_inlinable_constants when they don't change

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agoac/gpu_info: adjust the condition for use_late_alloc
Marek Olšák [Sun, 20 Jun 2021 05:50:25 +0000 (01:50 -0400)]
ac/gpu_info: adjust the condition for use_late_alloc

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agoradeonsi: don't use NGG culling on 1 RB chips
Marek Olšák [Sun, 20 Jun 2021 05:42:18 +0000 (01:42 -0400)]
radeonsi: don't use NGG culling on 1 RB chips

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agoradeonsi: remove incorrect comment about hangs in gfx10_ngg_gs_emit_epilogue
Marek Olšák [Thu, 17 Jun 2021 15:26:25 +0000 (11:26 -0400)]
radeonsi: remove incorrect comment about hangs in gfx10_ngg_gs_emit_epilogue

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agoradeonsi: if shader culling culls all vertices, cull the primitive exports too
Marek Olšák [Wed, 16 Jun 2021 23:31:22 +0000 (19:31 -0400)]
radeonsi: if shader culling culls all vertices, cull the primitive exports too

This was overlooked. It benefits triangle strips the most due to
GS fast launch.

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agoradeonsi: document why VBO descriptors in user SGPRs are beneficial
Marek Olšák [Wed, 16 Jun 2021 23:30:52 +0000 (19:30 -0400)]
radeonsi: document why VBO descriptors in user SGPRs are beneficial

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11509>

3 years agolavapipe: implement multidraw ext
Mike Blumenkrantz [Thu, 25 Mar 2021 18:06:41 +0000 (14:06 -0400)]
lavapipe: implement multidraw ext

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11533>

3 years agozink: use depth/stencil-only layouts for depth/stencil-only formats
Mike Blumenkrantz [Wed, 31 Mar 2021 20:22:54 +0000 (16:22 -0400)]
zink: use depth/stencil-only layouts for depth/stencil-only formats

just kidding, this is banned by spec

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11389>

3 years agoutil: add work around for the game We Happy Few
Timothy Arceri [Wed, 23 Jun 2021 13:42:53 +0000 (23:42 +1000)]
util: add work around for the game We Happy Few

This is another Unreal engine game that requires the
allow_glsl_cross_stage_interpolation_mismatch workaround.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/4966

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11558>