platform/upstream/mesa.git
3 years agoanv/allocator: Use list->u64 in free_list_push
Jason Ekstrand [Tue, 13 Jul 2021 21:23:22 +0000 (16:23 -0500)]
anv/allocator: Use list->u64 in free_list_push

Since we always modify this structure with atomics on the u64, it seems
better to use the u64 here too.  I have no idea if this fixes a bug.

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

3 years agollvmpipe: Handle NULL views in llvmpipe_cleanup_stage_sampling
Joshua Ashton [Tue, 13 Jul 2021 21:09:24 +0000 (22:09 +0100)]
llvmpipe: Handle NULL views in llvmpipe_cleanup_stage_sampling

This is the only barrier to lavapipe fully working in RenderDoc.

Fixes: 21864bdaaef6 ("llvmpipe: unmap display target of shader image/sampler")

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11856>

3 years agofreedreno+turnip: Add a6xx gen4 support
Rob Clark [Thu, 8 Jul 2021 18:47:15 +0000 (11:47 -0700)]
freedreno+turnip: Add a6xx gen4 support

This adds support for a660 and a635.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno+turnip: Get device name from device-info table
Rob Clark [Thu, 8 Jul 2021 18:35:31 +0000 (11:35 -0700)]
freedreno+turnip: Get device name from device-info table

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno+turnip: Add has_8bpp_ubwc
Rob Clark [Thu, 8 Jul 2021 17:43:08 +0000 (10:43 -0700)]
freedreno+turnip: Add has_8bpp_ubwc

Newer a6xx devices seem to drop 8b/pixel UBWC support.

The turnip part was adapted from Jonathans patch on !10892

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno+turnip: Add has_cp_reg_write
Rob Clark [Thu, 8 Jul 2021 17:28:43 +0000 (10:28 -0700)]
freedreno+turnip: Add has_cp_reg_write

Newer a6xx devices drop this packet from the sqe firmware, and use
direct (pkt4) register writes instead for the few cases that previously
used CP_REG_WRITE.

The turnip part was adapted from Jonathans patch on !10892

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Get has_sample_locations from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:44:45 +0000 (09:44 -0700)]
turnip: Get has_sample_locations from fd_dev_info

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Get has_tex_filter_cubic from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:31:25 +0000 (09:31 -0700)]
turnip: Get has_tex_filter_cubic from fd_dev_info

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Get indirect_draw_wfm_quirk from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:25:20 +0000 (09:25 -0700)]
turnip: Get indirect_draw_wfm_quirk from fd_dev_info

At some point we might want to change this to minimum fw version, but
for now it can be a bool.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Get storage_16bit from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:01:12 +0000 (09:01 -0700)]
turnip: Get storage_16bit from fd_dev_info

Removing more gpu_id checks that will become bogus as we add more a6xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Drop unused vshs_workgroup param
Rob Clark [Thu, 8 Jul 2021 15:49:18 +0000 (08:49 -0700)]
turnip: Drop unused vshs_workgroup param

Unused since d968995c67f5e3a48e49015184f9ea1f143251ec, and this gets rid
of one more gpu_id check.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno/ir3: Get reg_size_vec4 from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 17:02:19 +0000 (10:02 -0700)]
freedreno/ir3: Get reg_size_vec4 from fd_dev_info

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno/ir3: Get tess_use_shared from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 15:37:55 +0000 (08:37 -0700)]
freedreno/ir3: Get tess_use_shared from fd_dev_info

A step towards getting rid of checks for gpu_id sprinkled around.
Checking major generation is ok, but checking for == or >= a specific
gpu_id is going to start getting messy as we add more a6xx.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoturnip: Convert fd_dev_info to const pointer
Rob Clark [Thu, 8 Jul 2021 01:46:49 +0000 (18:46 -0700)]
turnip: Convert fd_dev_info to const pointer

Split out from earlier patch to reduce churn.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno: Convert fd_dev_info to const pointer
Rob Clark [Thu, 8 Jul 2021 01:37:09 +0000 (18:37 -0700)]
freedreno: Convert fd_dev_info to const pointer

Split out from previous patch to reduce churn.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno: Generate device-info tables at build time
Rob Clark [Wed, 7 Jul 2021 21:47:02 +0000 (14:47 -0700)]
freedreno: Generate device-info tables at build time

This way we can make the tables const.  At the same time, for a6xx, this
introduces a "sub-generation template" to reduce the copy/paste for
parameters which are keyed to the sub-generation.  It also explicitly
lists every supported GPU, to get rid of duplicate lists of supported
gpus between the device-info and drivers.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno: Rename *_dev_info
Rob Clark [Wed, 7 Jul 2021 20:48:21 +0000 (13:48 -0700)]
freedreno: Rename *_dev_info

Everywhere else symbols/types/etc are shortend to "fd_*", so lets do the
same here for consistency.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno/common: unhardcode CCU color cache offset
Jonathan Marek [Thu, 20 May 2021 02:46:16 +0000 (22:46 -0400)]
freedreno/common: unhardcode CCU color cache offset

Replace it with a calculation which works for all current GPUs.

Duplicated the calculation in both drivers because freedreno_dev_info isn't
meant for derived parameters (and drivers might want to just calculate on
the fly instead).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno/a6xx: larger gmem_page_align from tile align instead of gpu id
Jonathan Marek [Thu, 20 May 2021 01:56:53 +0000 (21:56 -0400)]
freedreno/a6xx: larger gmem_page_align from tile align instead of gpu id

The larger page alignment is directly related to the 96 tile alignment,
so check for that instead of a specific gpu id.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agotu: remove workaround for conditional rendering + hw binning
Jonathan Marek [Wed, 19 May 2021 23:04:43 +0000 (19:04 -0400)]
tu: remove workaround for conditional rendering + hw binning

- It hurts users with newer firmware who don't need the workaround
- Kernel now rejects older firmware due to security issues, so this will
  prevent users from using older firmware anyway.
- Only whitelisting 650 enables the workaround by default for any new GPUs

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoiris: Use simple_mtx in the bufmgr.
Kenneth Graunke [Tue, 9 Jun 2020 19:05:07 +0000 (12:05 -0700)]
iris: Use simple_mtx in the bufmgr.

This avoids having to call out through the PLT just to lock/unlock.

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

3 years agopanfrost: Initialise the blend equation in create_blend_state
Icecream95 [Wed, 14 Jul 2021 00:04:42 +0000 (12:04 +1200)]
panfrost: Initialise the blend equation in create_blend_state

Valgrind still complains about uninitialised values, but tests don't
flake anymore.

Fixes flakes in dEQP-GLES3.functional.fragment_out.*

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

3 years agocrocus: use simple_mtx in the bufmgr
Dave Airlie [Tue, 13 Jul 2021 22:56:09 +0000 (08:56 +1000)]
crocus: use simple_mtx in the bufmgr

anything you can do I can do better^W^Wadapt for crocus

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11859>

3 years agoradv, aco, ac/nir: Tweak position export scheduling for NGG culling.
Timur Kristóf [Mon, 5 Jul 2021 13:26:18 +0000 (15:26 +0200)]
radv, aco, ac/nir: Tweak position export scheduling for NGG culling.

The result is about +5-ish fps in Doom Eternal.

It turns out that the location of position exports matters more
than we thought, and it's actually better to keep them at the bottom
for culling shaders rather than schedule it up to the top.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Reuse uniforms from top part of culling shaders.
Timur Kristóf [Mon, 5 Jul 2021 13:18:28 +0000 (15:18 +0200)]
ac/nir: Reuse uniforms from top part of culling shaders.

Uniforms have the same value in all invocations, therefore they
can safely be reused by invocations even after repacking.
This saves several instructions from culling shaders, mainly
UBO loads and such.

We exclude uniform floats, because those would harm the VGPR
usage of the shaders too much.

Fossil DB results on Sienna Cichlid (with NGG culling on):

Totals from 55379 (43.05% of 128647) affected shaders:
VGPRs: 1926472 -> 1925360 (-0.06%); split: -0.07%, +0.01%
SpillSGPRs: 139 -> 330 (+137.41%)
CodeSize: 159472988 -> 157462856 (-1.26%); split: -1.27%, +0.00%
MaxWaves: 1571492 -> 1571412 (-0.01%)
Instrs: 30665685 -> 30302076 (-1.19%); split: -1.21%, +0.02%
Latency: 127385148 -> 126723891 (-0.52%); split: -0.55%, +0.03%
InvThroughput: 21096298 -> 20773069 (-1.53%); split: -1.53%, +0.00%
VClause: 514792 -> 511231 (-0.69%); split: -0.83%, +0.13%
SClause: 713959 -> 679556 (-4.82%); split: -4.84%, +0.02%
Copies: 2975106 -> 2828185 (-4.94%); split: -5.39%, +0.45%
Branches: 1201921 -> 1152766 (-4.09%)
PreSGPRs: 1753786 -> 1892848 (+7.93%); split: -0.00%, +7.93%
PreVGPRs: 1590522 -> 1583574 (-0.44%); split: -0.44%, +0.00%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Analyze culling shaders to remember which inputs are used when.
Timur Kristóf [Mon, 5 Jul 2021 13:17:10 +0000 (15:17 +0200)]
ac/nir: Analyze culling shaders to remember which inputs are used when.

These will be useful for some optimizations.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Reuse the repacked output positions of culling shaders.
Timur Kristóf [Tue, 4 May 2021 09:36:02 +0000 (11:36 +0200)]
ac/nir: Reuse the repacked output positions of culling shaders.

The position outputs are stored into LDS and reloaded after
repacking, therefore the repacked position values can be
reused in the bottom part of the shader.

Fossil DB results on Sienna Cichlid (with NGG culling on):

Totals from 9016 (7.01% of 128647) affected shaders:
VGPRs: 372472 -> 347560 (-6.69%); split: -6.82%, +0.13%
SpillSGPRs: 437 -> 87 (-80.09%)
CodeSize: 32359340 -> 30441692 (-5.93%); split: -5.93%, +0.00%
MaxWaves: 222030 -> 238970 (+7.63%); split: +7.83%, -0.20%
Instrs: 6207833 -> 5834149 (-6.02%); split: -6.02%, +0.00%
Latency: 27626263 -> 27890632 (+0.96%); split: -5.34%, +6.29%
InvThroughput: 4792958 -> 4361336 (-9.01%); split: -9.01%, +0.00%
VClause: 144385 -> 139586 (-3.32%); split: -9.29%, +5.97%
SClause: 141350 -> 129875 (-8.12%); split: -8.57%, +0.45%
Copies: 580017 -> 568916 (-1.91%); split: -3.60%, +1.68%
Branches: 209067 -> 209154 (+0.04%); split: -0.24%, +0.28%
PreSGPRs: 281320 -> 277814 (-1.25%)
PreVGPRs: 290040 -> 273861 (-5.58%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: Run algebraic optimizations before NGG lowering.
Timur Kristóf [Tue, 6 Jul 2021 06:45:33 +0000 (08:45 +0200)]
radv: Run algebraic optimizations before NGG lowering.

This makes culling shaders more efficient because they split the
shader in two parts. It is better to optimize before this split
happens.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: Support NGG culling with new perftest environment variable.
Timur Kristóf [Tue, 8 Jun 2021 10:32:35 +0000 (12:32 +0200)]
radv: Support NGG culling with new perftest environment variable.

Currently we don't enable it on any chip by default, but
we plan to enable it soon on GFX10.3 when we are comfortable
with its performance.

RADV_PERFTEST=nggc environment variable enables it on GFX10+ GPUs.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoaco: Implement NGG culling related intrinsics.
Timur Kristóf [Thu, 29 Apr 2021 11:33:45 +0000 (13:33 +0200)]
aco: Implement NGG culling related intrinsics.

These are very straightforward as they just copy data from
the newly added shader arguments.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: New shader args for NGG culling settings and viewport.
Timur Kristóf [Mon, 7 Jun 2021 21:23:38 +0000 (23:23 +0200)]
radv: New shader args for NGG culling settings and viewport.

Add new shader arguments in RADV for:
- NGG culling settings
- Viewport transform

These will be used by NGG culling shaders.

Additionally, some tweaks are made to some config registers
in order to make culling shaders more efficient.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: Expose radv_get_viewport_xform in radv_private.h
Timur Kristóf [Mon, 7 Jun 2021 21:43:27 +0000 (23:43 +0200)]
radv: Expose radv_get_viewport_xform in radv_private.h

We need to emit viewport transform information for culling shaders.
This is used for small primitive culling.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Implement NGG deferred attribute culling in NIR.
Timur Kristóf [Mon, 26 Apr 2021 14:56:11 +0000 (16:56 +0200)]
ac/nir: Implement NGG deferred attribute culling in NIR.

Culling is traditionally done by the rasterizer, but that
can be a bottleneck when an app creates a large number
of primitives. Eg. a lot of tiny triangles reduce the
rasterziation efficiency.

NGG makes it possible for the shader to check primitives
and delete those that it can prove are not needed.

After this is done, we have to repack the surviving invocations
so they remain compact. This also saves bandwidth, because
some memory loads are only executed by those vertices that
survived the culling.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Use a ballot that matches the wave size during NGG lowering.
Timur Kristóf [Mon, 5 Jul 2021 09:19:14 +0000 (11:19 +0200)]
ac/nir: Use a ballot that matches the wave size during NGG lowering.

This generates slightly more efficient code in Wave32 mode.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Add a NIR port of ac_llvm_cull.
Timur Kristóf [Thu, 1 Apr 2021 10:43:31 +0000 (12:43 +0200)]
ac/nir: Add a NIR port of ac_llvm_cull.

The algorithms were originally implemented by Marek Olšák,
hence the copyright to AMD.

This commit just ports the LLVM based implementation to NIR,
using the new intrinsics added earlier.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agonir: Add AMD specific intrinsics for NGG shader based culling.
Timur Kristóf [Tue, 4 May 2021 11:41:14 +0000 (13:41 +0200)]
nir: Add AMD specific intrinsics for NGG shader based culling.

The new intrinsics fall into the following categories:

1. New viewport intrinsics:
For missing components that we need.
RADV will emit new SGPR arguments which will contain the
viewport information for culling shaders. These are used to
compute the screen space coordinates for small primitive culling.

2. load_cull_xxx:
Load the culling settings in runtime.
These will be a new SGPR argument in RADV.

3. overwrite_xxx:
These are needed because system values such as vertex and
instance ID are not writeable, but we need to change them
after repacking shader invocations of VS and TES.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoci: Enable testing of i915g in the the debian -Werror release build.
Emma Anholt [Tue, 13 Jul 2021 18:25:19 +0000 (11:25 -0700)]
ci: Enable testing of i915g in the the debian -Werror release build.

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11852>

3 years agoi915g: Fix release build compiler warnings.
Emma Anholt [Tue, 6 Jul 2021 23:03:52 +0000 (16:03 -0700)]
i915g: Fix release build compiler warnings.

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

3 years agofreedreno: Optimize duplicate obj-obj ring relocs.
Emma Anholt [Thu, 24 Jun 2021 23:11:59 +0000 (16:11 -0700)]
freedreno: Optimize duplicate obj-obj ring relocs.

No need to include the same BO multiple times in the long-lived ringbuffer
object's list of relocs to be added to the submit.

Improves non-TC drawoverhead -test 9 (8 tex updates) throughput by 1.4901%
+/- 0.8705% (n=20)

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

3 years agofreedreno/a6xx: Allocate just enough memory for SO state, only if we do SO.
Emma Anholt [Fri, 2 Jul 2021 22:41:01 +0000 (15:41 -0700)]
freedreno/a6xx: Allocate just enough memory for SO state, only if we do SO.

Continuing to improve our suballocation packing.

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

3 years agofreedrneo/a6xx: Reduce the size of the long-lived texture stateobj.
Emma Anholt [Fri, 2 Jul 2021 22:21:56 +0000 (15:21 -0700)]
freedrneo/a6xx: Reduce the size of the long-lived texture stateobj.

It's just a few commands to upload the sampler/texconst data.  Improves
the efficiency of suballocation.

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

3 years agofreedreno/a6xx: Reduce the size of the config stateobj allocation.
Emma Anholt [Fri, 2 Jul 2021 22:21:28 +0000 (15:21 -0700)]
freedreno/a6xx: Reduce the size of the config stateobj allocation.

Improves the efficiency of suballocation.

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

3 years agofreedreno: Suballocate our long-lived ring objects.
Emma Anholt [Fri, 2 Jul 2021 17:51:16 +0000 (10:51 -0700)]
freedreno: Suballocate our long-lived ring objects.

On drawoverhead -test 9 (8 texture changes), this saves us 172kb of
memory.  That's only ~1% of the GEM memory while the test is running, but
more importantly it saves us 29% of the gem BO allocations.

non-TC drawoverhead -test 9 (8 texture change) throughput 0.449019% +/-
0.336296% (n=100), but this gets better as we get better suballocation
density.

Note that this means that all fd_ringbuffer_new_object calls can now
return data aligned to 64 bytes, instead of 4k.  We may find that we need
to increase it if some of our objects (tex consts, sampler consts, etc.)
require more alignment than that.  But, this may help non-drawoverhead
perf if any of our RB objects have a cache in front of them (indirect
consts?) and we don't have most of our data in the same cache set any
more.

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

3 years agolima: Take offset in account when checking BO size
Paul Kocialkowski [Fri, 28 May 2021 21:06:49 +0000 (23:06 +0200)]
lima: Take offset in account when checking BO size

BO resources imported from a handle may have an offset provided, which
reduces the available size within the BO. Take this in account when
checking that the size is sufficient in lima.

Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Andreas Baierl <ichgeh@imkreisrum.de>
Signed-off-by: Paul Kocialkowski <paul.kocialkowski@bootlin.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11076>

3 years agodriconf: Add more workarounds for Teardown
Joshua Ashton [Sun, 11 Jul 2021 15:46:21 +0000 (16:46 +0100)]
driconf: Add more workarounds for Teardown

Enable radeonsi_no_infinite_interp for Teardown to fix hangs.

Based on comments from #3714.

Tested-by: Joshua Ashton <joshua@froggi.es>
Signed-off-by: Joshua Ashton <joshua@froggi.es>
Acked-by: Martin Peres <martin.peres@mupuf.org>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11814>

3 years agoanv: Implement VK_EXT_acquire_drm_display
Simon Zeni [Tue, 6 Jul 2021 17:04:09 +0000 (13:04 -0400)]
anv: Implement VK_EXT_acquire_drm_display

Signed-off-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Simon Ser <contact@emersion.fr>
Tested-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11735>

3 years agoaco: Remove deprecated Operand constructors
Tony Wasserka [Tue, 29 Jun 2021 17:32:00 +0000 (19:32 +0200)]
aco: Remove deprecated Operand constructors

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoaco: Clean up unneeded literal casts
Tony Wasserka [Tue, 29 Jun 2021 17:29:36 +0000 (19:29 +0200)]
aco: Clean up unneeded literal casts

These were only needed to select the appropriate Operand constructor before.

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoaco: Remove use of deprecated Operand constructors
Tony Wasserka [Tue, 13 Jul 2021 09:22:46 +0000 (11:22 +0200)]
aco: Remove use of deprecated Operand constructors

This migration was done with libclang-based automatic tooling, which
performed these replacements:
* Operand(uint8_t) -> Operand::c8
* Operand(uint16_t) -> Operand::c16
* Operand(uint32_t, false) -> Operand::c32
* Operand(uint32_t, bool) -> Operand::c32_or_c64
* Operand(uint64_t) -> Operand::c64
* Operand(0) -> Operand::zero(num_bytes)

Casts that were previously used for constructor selection have automatically
been removed (e.g. Operand((uint16_t)1) -> Operand::c16(1)).

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoaco: Remove use of deprecated Operand constructors in aco_builder.h
Tony Wasserka [Tue, 29 Jun 2021 16:51:41 +0000 (18:51 +0200)]
aco: Remove use of deprecated Operand constructors in aco_builder.h

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoaco: Remove use of deprecated Operand constructors in test_to_hw_instr.cpp
Tony Wasserka [Tue, 29 Jun 2021 16:53:36 +0000 (18:53 +0200)]
aco: Remove use of deprecated Operand constructors in test_to_hw_instr.cpp

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoaco: Replace Operand literal constructors with factory member functions
Tony Wasserka [Tue, 29 Jun 2021 17:24:16 +0000 (19:24 +0200)]
aco: Replace Operand literal constructors with factory member functions

Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11653>

3 years agoci: Make sure that we build the piglit dmabuf tests.
Emma Anholt [Mon, 12 Jul 2021 21:39:30 +0000 (14:39 -0700)]
ci: Make sure that we build the piglit dmabuf tests.

Force the option rather than relying on autodetection -- ARM runners were
apparently finding the necessary deps, but the x86 rootfs (radeonsi, iris)
and x86_test-gl container (i915g) were not.

Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11834>

3 years agozink: simplify modifier ifdefs
Mike Blumenkrantz [Tue, 13 Jul 2021 12:55:27 +0000 (08:55 -0400)]
zink: simplify modifier ifdefs

these are the only two defines referenced, so they can be defined to 0
for platforms that don't support modifiers in order to remove a ton of
ifdefs and make the code more readable

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

3 years agofreedreno/ir3: Add float immed "FLUT" support
Rob Clark [Mon, 25 Jan 2021 17:43:24 +0000 (09:43 -0800)]
freedreno/ir3: Add float immed "FLUT" support

We can encode a limited set of float immeds into cat2 instructions,
using hw's float lookup table (FLUT) feature.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/36
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8705>

3 years agofreedreno/computerator: Add script to probe FLUT values
Rob Clark [Sat, 10 Jul 2021 17:29:00 +0000 (10:29 -0700)]
freedreno/computerator: Add script to probe FLUT values

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8705>

3 years agoturnip: Split tu6_emit_xs()
Rob Clark [Mon, 12 Jul 2021 19:00:38 +0000 (12:00 -0700)]
turnip: Split tu6_emit_xs()

Emit all the state layout config (such as push-const CONSTLEN) first,
before emitting anything that depends on that state.  This fixes an
issue that was showing up when FLUT is enabled in ir3 (which results
in higher probability of not having any immediats lowered to push-
consts).

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8705>

3 years agoturnip: avoid some UB
Rob Clark [Sun, 11 Jul 2021 19:40:05 +0000 (12:40 -0700)]
turnip: avoid some UB

Reduce a bit of extra noise that makes diffing cmdstream traces more
annoying.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8705>

3 years agoglsl: Delete lower_texture_projection
Jason Ekstrand [Mon, 12 Jul 2021 16:50:04 +0000 (11:50 -0500)]
glsl: Delete lower_texture_projection

This is only used by i965 and we've been getting it through
nir_lower_tex since forever.  Get rid of the GLSL IR pass.

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11827>

3 years agoci: only trigger gallium_core_file_list jobs from dri and glx frontend changes
Mike Blumenkrantz [Mon, 12 Jul 2021 19:07:01 +0000 (15:07 -0400)]
ci: only trigger gallium_core_file_list jobs from dri and glx frontend changes

these are the only frontends which may be used by gallium drivers in ci,
so stop triggering all driver jobs when other frontends are changed since
those changes can never affect ci

<MrCooper> Not that simple unfortunately. E.g. the llvmpipe-piglit-cl job hits
           src/gallium/frontends/clover & possibly src/gallium/targets/opencl,
           many jobs hit src/gallium/{frontends,targets}/dri and probably
           src/gallium/targets/pipe-loader, lavapipe jobs hit src/gallium/{frontends,targets}/lavapipe.

Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11832>

3 years agoci: add vulkan files to lavapipe rules
Mike Blumenkrantz [Mon, 12 Jul 2021 19:26:04 +0000 (15:26 -0400)]
ci: add vulkan files to lavapipe rules

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11833>

3 years agopan/bi: Create a nop clause when the shader starts with ATEST
Icecream95 [Tue, 13 Jul 2021 08:01:07 +0000 (20:01 +1200)]
pan/bi: Create a nop clause when the shader starts with ATEST

Otherwise there would be no clause with the dependencies needed for
ATEST set, so the GPU would get stuck.

Not needed on v7, as there shader_wait_dependency in the RSD will wait
for the dependencies before the shader starts.

Explicitly create a NOP instruction, as it is assumed that clauses
have a non-zero count of instructions in various places.

Fixes GPU timeouts in many applications, such as SuperTuxKart and
GZDoom.

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

3 years agopanfrost: Fix full_threads calculation on v6
Icecream95 [Tue, 13 Jul 2021 06:29:13 +0000 (18:29 +1200)]
panfrost: Fix full_threads calculation on v6

Fixes: 8ba2f9f6985 ("panfrost: Create a blitter library to replace the existing preload helpers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11842>

3 years agogbm/dri: Fix leaking bo memory on failure path
Heinrich Fink [Tue, 13 Jul 2021 09:12:56 +0000 (11:12 +0200)]
gbm/dri: Fix leaking bo memory on failure path

In gbm_dri_bo_create, when modifiers are requested but not supported, do
not return NULL immediately, but first go to cleanup section to free
already allocated buffer object.

Fixes: cb9ae4273d68 ("dri: add loader_dri_create_image helper")
Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11844>

3 years agopps: Panfrost documentation
Antonio Caggiano [Thu, 6 May 2021 11:20:01 +0000 (13:20 +0200)]
pps: Panfrost documentation

Add documentation for the Panfrost Perfetto datasource.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10215>

3 years agopps: Panfrost pps driver
Antonio Caggiano [Thu, 18 Mar 2021 18:29:33 +0000 (19:29 +0100)]
pps: Panfrost pps driver

Add the Panfrost pps driver.

v2: Human readable names for counter blocks and use `unreachable`.
v3: Use libpanfrost_perf to collect counter values.

Signed-off-by: Antonio Caggiano <antonio.caggiano@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10215>

3 years agomesa: clear shader_info::is_lowered in prog_to_nir
Pierre-Eric Pelloux-Prayer [Tue, 29 Jun 2021 08:10:17 +0000 (10:10 +0200)]
mesa: clear shader_info::is_lowered in prog_to_nir

This needs to be resetted each time prog_to_nir is called because it
turns st_nir_assign_vs_in_locations into a no-op when set.

Fixes: 81d106d6eca ("radeonsi: lower IO intrinsics - complete rewrite of input/output scanning")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5001
Reviewed-by: Isaac Bosompem <mrisaacb@google.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11636>

3 years agov3dv: use defines for push constant offsets used by texel buffer copy shaders
Iago Toral Quiroga [Tue, 13 Jul 2021 07:47:53 +0000 (09:47 +0200)]
v3dv: use defines for push constant offsets used by texel buffer copy shaders

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11843>

3 years agov3dv: allow batching texel buffer copies for 3D images
Iago Toral Quiroga [Tue, 13 Jul 2021 07:23:13 +0000 (09:23 +0200)]
v3dv: allow batching texel buffer copies for 3D images

For these we only need to check that the depth extent we are
copying is the same across regions in the batch, since we use
that to specify the number of layers in the framebuffer used
for the copy.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11843>

3 years agov3dv: implement layered texel buffer copies using a geometry shader
Iago Toral Quiroga [Mon, 12 Jul 2021 11:16:06 +0000 (13:16 +0200)]
v3dv: implement layered texel buffer copies using a geometry shader

Instead of specifying a separate framebuffer per layer which is expected
to be much slower.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11843>

3 years agov3dv: fix push constant range for texel buffer copy pipelines
Iago Toral Quiroga [Mon, 12 Jul 2021 10:38:05 +0000 (12:38 +0200)]
v3dv: fix push constant range for texel buffer copy pipelines

As per get_texel_buffer_copy_fs(), we load 24 bytes of data.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11843>

3 years agozink: remove duplicate format-mapping on little-endian
Erik Faye-Lund [Wed, 16 Jun 2021 11:00:57 +0000 (13:00 +0200)]
zink: remove duplicate format-mapping on little-endian

Doing *both* of thse ends up rewriting the previous mapping. Since this
doesn't seem to have lead to issues, it seems like the new mapping works
just as well.

Fixes: a22a1c0324e ("zink: Fix VK_FORMAT_A8B8G8R8_SRGB_PACK32 mapping on big-endian")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11417>

3 years agoloader: Handle failure to load DRI driver library
James Jones [Fri, 9 Jul 2021 15:40:19 +0000 (08:40 -0700)]
loader: Handle failure to load DRI driver library

I factored out the chunk of loader code that dlopen()s
libraries from the rest of the DRI driver loader function
in this commit:

  commit bc343154f816b637b200933e1c1a35db19f478ef
  Author: James Jones <jajones@nvidia.com>
  Date:   Thu Apr 22 23:17:08 2021 -0700

  loader: Factor out driver library loading code

However, I failed to adjust the DRI loader function that
now uses the new helper function to handle the case where
the requested DRI library is not found.

This change restores the prior behavior, and also ensures
loader_open_driver() consistently returns NULL in the
out_driver_handle parameter on failure.

Fixes: bc343154f816 ("loader: Factor out driver library loading code")
Signed-off-by: James Jones <jajones@nvidia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11807>

3 years agoaco: fix extract_vector optimization
Daniel Schürmann [Thu, 8 Jul 2021 14:49:18 +0000 (16:49 +0200)]
aco: fix extract_vector optimization

If the allocated_vec map contains a different RegType
for the elements, ensure that the size matches exactly.

Otherwise, it could happen that extracting a dword
element matched with a subdword element.

No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11823>

3 years agoaco: fix self-intersecting register swaps
Daniel Schürmann [Wed, 7 Jul 2021 15:41:56 +0000 (17:41 +0200)]
aco: fix self-intersecting register swaps

Splitting self-intersecting register swaps into
3 sections was unnecessary and only worked because
the middle section was always empty for full dword
swaps.

No fossil-db changes.

Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11823>

3 years agolavapipe: add the separate depth/stencil layout enable.
Dave Airlie [Tue, 13 Jul 2021 02:09:02 +0000 (12:09 +1000)]
lavapipe: add the separate depth/stencil layout enable.

This was missing.

Fixes: ac07ad8414cd ("lavapipe: implement KHR_separate_depth_stencil_layouts")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11840>

3 years agopanfrost: Fix format swizzles on G72
Alyssa Rosenzweig [Tue, 13 Jul 2021 00:27:03 +0000 (20:27 -0400)]
panfrost: Fix format swizzles on G72

Careless typo. Cleaner fix suggested by Icecream95.

Reported-by: macc24
Tested-by: macc24
Fixes: 531d80de7c7 ("panfrost: Specialize blendable_formats for v6")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11837>

3 years agorelnotes: add some missing zink/lavapipe updates
Mike Blumenkrantz [Tue, 13 Jul 2021 00:38:17 +0000 (20:38 -0400)]
relnotes: add some missing zink/lavapipe updates

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

3 years agofeatures: mark off line rasterization for lavapipe
Mike Blumenkrantz [Tue, 13 Jul 2021 00:34:46 +0000 (20:34 -0400)]
features: mark off line rasterization for lavapipe

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

3 years agozink: add a pipe_screen::resource_create_with_modifiers hook
Mike Blumenkrantz [Fri, 9 Apr 2021 14:14:30 +0000 (10:14 -0400)]
zink: add a pipe_screen::resource_create_with_modifiers hook

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: add fallback for linear modifier use
Mike Blumenkrantz [Tue, 22 Jun 2021 12:33:04 +0000 (08:33 -0400)]
zink: add fallback for linear modifier use

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: don't pass modifier count to first image create
Mike Blumenkrantz [Wed, 14 Apr 2021 14:07:32 +0000 (10:07 -0400)]
zink: don't pass modifier count to first image create

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: explicitly disallow using the modifier image create for non-linear images
Mike Blumenkrantz [Wed, 14 Apr 2021 14:06:20 +0000 (10:06 -0400)]
zink: explicitly disallow using the modifier image create for non-linear images

the first call is just for the base image, the second call is the one that needs
modifiers

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: use VkImageDrmFormatModifierListCreateInfoEXT for creating from modifier array
Mike Blumenkrantz [Fri, 9 Apr 2021 14:13:53 +0000 (10:13 -0400)]
zink: use VkImageDrmFormatModifierListCreateInfoEXT for creating from modifier array

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: add a pipe_screen::resource_get_param hook
Mike Blumenkrantz [Fri, 9 Apr 2021 14:12:40 +0000 (10:12 -0400)]
zink: add a pipe_screen::resource_get_param hook

this is used for querying image properties

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: store modifier aspect to resource
Mike Blumenkrantz [Wed, 14 Apr 2021 12:29:16 +0000 (08:29 -0400)]
zink: store modifier aspect to resource

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: start storing modifiers to the base resource struct
Mike Blumenkrantz [Thu, 8 Apr 2021 20:24:51 +0000 (16:24 -0400)]
zink: start storing modifiers to the base resource struct

need these for rebinds

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: populate modifier props onto screen object during init
Mike Blumenkrantz [Thu, 8 Apr 2021 20:10:24 +0000 (16:10 -0400)]
zink: populate modifier props onto screen object during init

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agozink: implement support for non-planar DRM modifiers
Erik Faye-Lund [Mon, 19 Oct 2020 12:17:27 +0000 (14:17 +0200)]
zink: implement support for non-planar DRM modifiers

Planar DRM modifiers are a bit more tricky, so let's kick that ball down
the road. For now, this should help a bit.

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10782>

3 years agomailmap: Add two more lines for Alyssa Rosenzweig
Jason Ekstrand [Sun, 11 Jul 2021 14:44:24 +0000 (09:44 -0500)]
mailmap: Add two more lines for Alyssa Rosenzweig

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11788>

3 years agoConvert a few files to UTF-8
Jason Ekstrand [Sun, 11 Jul 2021 04:28:52 +0000 (23:28 -0500)]
Convert a few files to UTF-8

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11788>

3 years agomailmap: Update for Emma's new e-mail address
Jason Ekstrand [Thu, 8 Jul 2021 20:35:43 +0000 (15:35 -0500)]
mailmap: Update for Emma's new e-mail address

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11788>

3 years agopan/bi: Add a bundling heuristic
Alyssa Rosenzweig [Wed, 5 May 2021 21:38:02 +0000 (17:38 -0400)]
pan/bi: Add a bundling heuristic

Pick instructions locally that are likely to minimize nop's globally.
Note the obvious greedy solution is ineffective. Instead the principle
is to choose instructions which will increase _future_ scheduler
freedom, on the assumption that means fewer nop's overall will be
needed.

There is no concern about register pressure and little concern about
message timing, since this is post-RA and message ordering was fixed.

total tuples in shared programs: 125304 -> 123770 (-1.22%)
tuples in affected programs: 88301 -> 86767 (-1.74%)
helped: 548
HURT: 198
helped stats (abs) min: 1.0 max: 31.0 x̄: 3.43 x̃: 2
helped stats (rel) min: 0.33% max: 16.67% x̄: 3.09% x̃: 2.44%
HURT stats (abs)   min: 1.0 max: 12.0 x̄: 1.73 x̃: 1
HURT stats (rel)   min: 0.27% max: 11.11% x̄: 2.82% x̃: 2.35%
95% mean confidence interval for tuples value: -2.39 -1.72
95% mean confidence interval for tuples %-change: -1.77% -1.27%
Tuples are helped.

total clauses in shared programs: 26059 -> 25655 (-1.55%)
clauses in affected programs: 10821 -> 10417 (-3.73%)
helped: 311
HURT: 42
helped stats (abs) min: 1.0 max: 6.0 x̄: 1.44 x̃: 1
helped stats (rel) min: 0.48% max: 16.00% x̄: 5.26% x̃: 5.00%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.05 x̃: 1
HURT stats (rel)   min: 2.13% max: 33.33% x̄: 7.49% x̃: 6.25%
95% mean confidence interval for clauses value: -1.26 -1.02
95% mean confidence interval for clauses %-change: -4.28% -3.21%
Clauses are helped.

total cycles in shared programs: 12154.79 -> 12114.83 (-0.33%)
cycles in affected programs: 1907.63 -> 1867.67 (-2.09%)
helped: 227
HURT: 99
helped stats (abs) min: 0.041665999999999315 max: 1.2083360000000027 x̄: 0.22 x̃: 0
helped stats (rel) min: 0.36% max: 20.00% x̄: 4.14% x̃: 3.85%
HURT stats (abs)   min: 0.041665999999999315 max: 0.5 x̄: 0.09 x̃: 0
HURT stats (rel)   min: 0.28% max: 9.09% x̄: 2.75% x̃: 2.63%
95% mean confidence interval for cycles value: -0.15 -0.09
95% mean confidence interval for cycles %-change: -2.51% -1.59%
Cycles are helped.

total arith in shared programs: 4658.13 -> 4603.42 (-1.17%)
arith in affected programs: 3449.83 -> 3395.12 (-1.59%)
helped: 509
HURT: 249
helped stats (abs) min: 0.041665999999999315 max: 1.2083360000000027 x̄: 0.14 x̃: 0
helped stats (rel) min: 0.36% max: 20.00% x̄: 3.56% x̃: 2.63%
HURT stats (abs)   min: 0.041665999999999315 max: 0.5 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.28% max: 25.00% x̄: 3.32% x̃: 2.27%
95% mean confidence interval for arith value: -0.09 -0.06
95% mean confidence interval for arith %-change: -1.64% -0.97%
Arith are helped.

total quadwords in shared programs: 111394 -> 110114 (-1.15%)
quadwords in affected programs: 78074 -> 76794 (-1.64%)
helped: 503
HURT: 204
helped stats (abs) min: 1.0 max: 43.0 x̄: 3.33 x̃: 2
helped stats (rel) min: 0.41% max: 13.79% x̄: 3.02% x̃: 2.44%
HURT stats (abs)   min: 1.0 max: 26.0 x̄: 1.94 x̃: 1
HURT stats (rel)   min: 0.48% max: 7.55% x̄: 2.44% x̃: 2.22%
95% mean confidence interval for quadwords value: -2.16 -1.46
95% mean confidence interval for quadwords %-change: -1.67% -1.21%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Calculate dependency graph when bundling
Alyssa Rosenzweig [Thu, 21 Jan 2021 02:02:12 +0000 (21:02 -0500)]
pan/bi: Calculate dependency graph when bundling

Code is ported from Midgard, modified to be scalar, post-RA, and to put
the arrays on the worklist instead of the instruction to save memory.
This enables out-of-order scheduling.

total tuples in shared programs: 128691 -> 125304 (-2.63%)
tuples in affected programs: 114091 -> 110704 (-2.97%)
helped: 844
HURT: 377
helped stats (abs) min: 1.0 max: 150.0 x̄: 4.88 x̃: 3
helped stats (rel) min: 0.30% max: 26.42% x̄: 5.56% x̃: 4.35%
HURT stats (abs)   min: 1.0 max: 8.0 x̄: 1.94 x̃: 1
HURT stats (rel)   min: 0.20% max: 33.33% x̄: 6.84% x̃: 3.23%
95% mean confidence interval for tuples value: -3.16 -2.38
95% mean confidence interval for tuples %-change: -2.19% -1.27%
Tuples are helped.

total clauses in shared programs: 27579 -> 26059 (-5.51%)
clauses in affected programs: 20606 -> 19086 (-7.38%)
helped: 941
HURT: 39
helped stats (abs) min: 1.0 max: 21.0 x̄: 1.66 x̃: 1
helped stats (rel) min: 0.69% max: 44.44% x̄: 10.48% x̃: 9.09%
HURT stats (abs)   min: 1.0 max: 2.0 x̄: 1.15 x̃: 1
HURT stats (rel)   min: 1.89% max: 10.00% x̄: 4.73% x̃: 4.55%
95% mean confidence interval for clauses value: -1.63 -1.47
95% mean confidence interval for clauses %-change: -10.27% -9.48%
Clauses are helped.

total cycles in shared programs: 12262.54 -> 12154.79 (-0.88%)
cycles in affected programs: 2210.54 -> 2102.79 (-4.87%)
helped: 374
HURT: 56
helped stats (abs) min: 0.041665999999999315 max: 6.25 x̄: 0.30 x̃: 0
helped stats (rel) min: 0.42% max: 26.00% x̄: 6.90% x̃: 7.14%
HURT stats (abs)   min: 0.041665999999999315 max: 0.5833319999999986 x̄: 0.11 x̃: 0
HURT stats (rel)   min: 0.16% max: 100.00% x̄: 55.17% x̃: 50.00%
95% mean confidence interval for cycles value: -0.29 -0.21
95% mean confidence interval for cycles %-change: -1.37% 3.73%
Inconclusive result (%-change mean confidence interval includes 0).

total arith in shared programs: 4852.29 -> 4658.13 (-4.00%)
arith in affected programs: 4525.17 -> 4331 (-4.29%)
helped: 1112
HURT: 166
helped stats (abs) min: 0.041665999999999315 max: 6.25 x̄: 0.19 x̃: 0
helped stats (rel) min: 0.42% max: 33.33% x̄: 6.59% x̃: 5.36%
HURT stats (abs)   min: 0.041665999999999315 max: 0.5833319999999986 x̄: 0.07 x̃: 0
HURT stats (rel)   min: 0.16% max: 100.00% x̄: 25.05% x̃: 2.40%
95% mean confidence interval for arith value: -0.17 -0.14
95% mean confidence interval for arith %-change: -3.44% -1.51%
Arith are helped.

total quadwords in shared programs: 117141 -> 111394 (-4.91%)
quadwords in affected programs: 104390 -> 98643 (-5.51%)
helped: 1245
HURT: 76
helped stats (abs) min: 1.0 max: 69.0 x̄: 4.74 x̃: 4
helped stats (rel) min: 0.28% max: 35.00% x̄: 7.88% x̃: 6.45%
HURT stats (abs)   min: 1.0 max: 8.0 x̄: 2.01 x̃: 1
HURT stats (rel)   min: 0.20% max: 10.00% x̄: 3.52% x̃: 4.25%
95% mean confidence interval for quadwords value: -4.61 -4.09
95% mean confidence interval for quadwords %-change: -7.56% -6.88%
Quadwords are helped.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Handle 4-src instructions in scheduler
Alyssa Rosenzweig [Thu, 8 Jul 2021 21:32:28 +0000 (17:32 -0400)]
pan/bi: Handle 4-src instructions in scheduler

Spill to a move. This allows us to emit SHADDX and general CSEL.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Add bi_before_tuple convenience method
Alyssa Rosenzweig [Thu, 8 Jul 2021 21:31:05 +0000 (17:31 -0400)]
pan/bi: Add bi_before_tuple convenience method

For constructing instructions during scheduling.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Handle multiple destinations in scheduler
Alyssa Rosenzweig [Thu, 8 Jul 2021 21:30:32 +0000 (17:30 -0400)]
pan/bi: Handle multiple destinations in scheduler

Needed for correct handling of pseudo ops like SHADDX and CUBEFACE

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Do helper termination analysis on clauses
Alyssa Rosenzweig [Mon, 12 Jul 2021 15:11:27 +0000 (11:11 -0400)]
pan/bi: Do helper termination analysis on clauses

Unlike the dependency analysis for the skip bits which is a function of
the data flow graph, the thread termination analysis is dependent on the
actual sequence of instructions. As such, it must be done after
scheduling to be correct in the presence of out-of-order scheduling.

Furthermore it's specified in terms of clauses, not instructions.
Reflecting this in our code gets a nice simplification. As a side effect
this puts extra td flags on subsequent clauses, which matches the DDK's
behaviour. (Maybe td is just a hint?)

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Update ins->link after scheduling
Alyssa Rosenzweig [Mon, 12 Jul 2021 16:05:28 +0000 (12:05 -0400)]
pan/bi: Update ins->link after scheduling

Otherwise foreach_instr and friends will be subtly wrong. None of our
current passes rely on this but it's a footgun.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>

3 years agopan/bi: Make bi_foreach_instr_in_tuple safer
Alyssa Rosenzweig [Mon, 12 Jul 2021 16:00:44 +0000 (12:00 -0400)]
pan/bi: Make bi_foreach_instr_in_tuple safer

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10961>