platform/upstream/mesa.git
2 years agomesa: Remove unused Mesa IR PROGRAM_* register files.
Eric Anholt [Wed, 6 Jan 2021 22:40:18 +0000 (14:40 -0800)]
mesa: Remove unused Mesa IR PROGRAM_* register files.

Now that glsl-to-tgsi is gone, a bunch of this is dead.

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

2 years agoglsl: Remove UBO reference lowering.
Eric Anholt [Thu, 17 Dec 2020 18:22:18 +0000 (10:22 -0800)]
glsl: Remove UBO reference lowering.

All UBO-supporting drivers now go through the NIR path, which does a
better job of it.

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

2 years agotgsi_scan: Remove unused input_array_last/output_array_last.
Eric Anholt [Fri, 11 Dec 2020 23:31:53 +0000 (15:31 -0800)]
tgsi_scan: Remove unused input_array_last/output_array_last.

Last use removed in "radeonsi: remove TGSI" this year.

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

2 years agomesa/st: Remove TGSI-only shader lowering code.
Eric Anholt [Thu, 10 Dec 2020 19:45:39 +0000 (11:45 -0800)]
mesa/st: Remove TGSI-only shader lowering code.

These are no longer called.

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

2 years agomesa/st: Drop the attrib remapping in st_prepare_vertex_program().
Emma Anholt [Fri, 8 Apr 2022 18:07:13 +0000 (11:07 -0700)]
mesa/st: Drop the attrib remapping in st_prepare_vertex_program().

This was only used in the GLSL-to-TGSI path, which is no longer.

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

2 years agomesa/st: Remove TGSI shader program variant handling.
Emma Anholt [Fri, 8 Apr 2022 18:11:58 +0000 (11:11 -0700)]
mesa/st: Remove TGSI shader program variant handling.

We no longer have anything generating gl_programs with TGSI in them since
retiring GLSL-to-TGSI.

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

2 years agomesa/st: Remove st_glsl_to_tgsi.
Emma Anholt [Fri, 8 Apr 2022 17:56:17 +0000 (10:56 -0700)]
mesa/st: Remove st_glsl_to_tgsi.

It is no longer called, and can be retired.

Fixes: #1924, #822, #6073

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

2 years agomesa/st: Always generate NIR from GLSL, and use nir_to_tgsi for TGSI drivers.
Eric Anholt [Thu, 10 Dec 2020 19:45:39 +0000 (11:45 -0800)]
mesa/st: Always generate NIR from GLSL, and use nir_to_tgsi for TGSI drivers.

The NIR path through the frontend is effectively the only one maintained
for a quite a while now.  We can see that effect with !15540, where the
TGSI generation path was regressed to assertion fail on real-world
shaders, and nobody noticed until I came along trying to test the
NIR-to-TGSI transition.

We already have a nir_to_tgsi() call for translating NIR representation
for ARB programs into TGSI before handing them off to the driver.  This
change makes that path get taken for GLSL programs as well.

This is the minimum change to get all the drivers on NIR from GLSL, to
give a simple commit to bisect too.  The dead code removal comes next.

Now every driver benefits from shared NIR optimizations for GLSL, and we
can start retiring GLSL optimizations.

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

2 years agoci/iris: Add a bunch of APL and KBL flakes recently.
Emma Anholt [Thu, 5 May 2022 22:17:43 +0000 (15:17 -0700)]
ci/iris: Add a bunch of APL and KBL flakes recently.

I got hit by one of them trying to merge !8044.  Just update the list.

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

2 years agokopper: pass the current context to dri_flush
Mike Blumenkrantz [Thu, 5 May 2022 17:19:51 +0000 (13:19 -0400)]
kopper: pass the current context to dri_flush

passing the drawable's context leads to desync and crashing if the app
is using multiple threads and multiple contexts

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16351>

2 years agokopper: invalidate drawables when resizing textures in place
Mike Blumenkrantz [Thu, 5 May 2022 16:06:14 +0000 (12:06 -0400)]
kopper: invalidate drawables when resizing textures in place

this guarantees that swapchains shared between contexts will stay
in sync

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16351>

2 years agoaco: ensure that definitions fixed to operands have matching regclasses
Rhys Perry [Fri, 22 Apr 2022 15:46:21 +0000 (16:46 +0100)]
aco: ensure that definitions fixed to operands have matching regclasses

If the operand is not killed, the definition needs to be large enough so
that the new location for the operand does not intersect with the old
location.

Fixes with zink:
KHR-GL45.shader_image_load_store.basic-allTargets-atomicCS
KHR-GL45.shader_image_load_store.basic-allTargets-atomicGS
KHR-GL45.shader_image_load_store.basic-allTargets-atomicVS

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6276
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16106>

2 years agoci/iris: Demote APL deqp to manual-only for now.
Emma Anholt [Thu, 5 May 2022 16:40:37 +0000 (09:40 -0700)]
ci/iris: Demote APL deqp to manual-only for now.

it's been flaking with "2022-05-05 16:29:49.055151: [0m[31mERROR - Failure
getting run results: parsing results: Reading from dEQP: timed out waiting
for fd to be ready (See \"//results/c32.r1.log\")" and a pile of missings
since the brief "whoops, HW CI failed to listen to the test exit code"
regression.

The only ways I know of to hit this case would be:

1) The deqp binary abruptly wedges on its own.  This happens with NFS
failures sometimes, but the rest of the run went fine and we never got the
kernel complaining about NFS, so that seems unlikely.

2) The stderr pipe filled up before stdout was completed, and deqp got
wedged trying to output stderr (happens sometimes when you do like
NIR_DEBUG=print in your run).

Both of these seem unlikely, given that we've got a big .qpa file that
made it all the way to writing out test case durations at the end of the
run before abruptly terminating.  Why didn't we have at least some of the
test results parsed?

The next deqp-runner release we integrate will solve #2, and cleans up
these error paths a bunch, so I'm hoping we get more information soon.

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

2 years agopanfrost: Increase the maximum tiler heap size
Alyssa Rosenzweig [Wed, 4 May 2022 16:16:27 +0000 (12:16 -0400)]
panfrost: Increase the maximum tiler heap size

Required to avoid tiler heap out-of-memory condition on Valhall on tests
including:

dEQP-GLES31.functional.draw_indirect.compute_interop.large.drawelements_combined_grid_1200x1200_drawcount_8

This test passes on Bifrost without the fix because varyings are only allocated
from the tiler heap on Valhall.

Minimal perf or memory usage impacted is expected, as even old versions of
panfrost.ko support growable memory.

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

2 years agodocs/features: flag VK_KHR_timeline_semaphore as implemented
Iago Toral Quiroga [Thu, 5 May 2022 08:18:06 +0000 (10:18 +0200)]
docs/features: flag VK_KHR_timeline_semaphore as implemented

We got this implemented for v3dv when Jason ported the submit code
to the common submit framework.

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

2 years agov3dv: trivially implement VK_KHR_separate_depth_stencil_layouts
Iago Toral Quiroga [Thu, 5 May 2022 07:54:38 +0000 (09:54 +0200)]
v3dv: trivially implement VK_KHR_separate_depth_stencil_layouts

We don't currently benefit from seeing barriers and layout
transitions that affect just the depth or stencil aspects,
so we don't expose this feature.

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

2 years agov3dv: implement VK_EXT_separate_stencil_usage
Iago Toral Quiroga [Thu, 5 May 2022 06:58:54 +0000 (08:58 +0200)]
v3dv: implement VK_EXT_separate_stencil_usage

We don't care about the depth/stencil usage other than to determine
if an image format is supported for that usage.

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

2 years agov3dv: check input attachment usage as sampled usage
Iago Toral Quiroga [Thu, 5 May 2022 06:44:45 +0000 (08:44 +0200)]
v3dv: check input attachment usage as sampled usage

Since we implement input attachments as textures we should check
support for input attachment usage the same way we check support
for sampled images.

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

2 years agopvr: Update pvrsrvkm to fw 1.17 .
Karmjit Mahil [Fri, 8 Apr 2022 10:50:40 +0000 (11:50 +0100)]
pvr: Update pvrsrvkm to fw 1.17 .

Signed-off-by: Karmjit Mahil <Karmjit.Mahil@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16238>

2 years agov3dv: use wait stage for wait semaphores to decide about binning syncs
Iago Toral Quiroga [Wed, 4 May 2022 09:07:07 +0000 (11:07 +0200)]
v3dv: use wait stage for wait semaphores to decide about binning syncs

If the wait stage for a semaphore doesn't involve geometry stages we
don't need a binning sync.

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

2 years agov3dv: skip binning sync if binning shaders don't access external resources
Iago Toral Quiroga [Tue, 3 May 2022 07:05:19 +0000 (09:05 +0200)]
v3dv: skip binning sync if binning shaders don't access external resources

Until now we have been enabling binning sync if we found a barrier
involving geometry stages (a bcl barrier), however, if the actual
binning shaders involved with the job don't access any external
buffers or images there is no reason to sync at the binning stage.

In this patch we don't immediately consume the bcl barrier flag from
the command buffer state when we create a new job. Instead, we check
this state when we are about to emit a draw call by checking if the
shaders involved with binning may access external resources, such as
vertex buffers, UBOs, or textures. If none of the draw calls in the
job use binning shaders that access external resources then we never
enable binning sync for the job.

It is possible that a binning shader uses resources that are not
synchronized through a barrier though, so we keep track of the
access masks used with barriers for both buffers and images separately
to better identify if the binning shader is affected by the barrier.

If a serialized job never consumes the bcl barrier flag because none
of its draw calls ever required a bcl sync, then the flag will be
cleared when the job is finished.

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

2 years agov3dv: flag BCL barriers for all-graphics and all-commands stages
Iago Toral Quiroga [Tue, 3 May 2022 07:30:58 +0000 (09:30 +0200)]
v3dv: flag BCL barriers for all-graphics and all-commands stages

Since these also include geometry stages in the pipeline.

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

2 years agov3dv: drop default sampler states if not used
Iago Toral Quiroga [Mon, 2 May 2022 11:31:27 +0000 (13:31 +0200)]
v3dv: drop default sampler states if not used

If a shader doesn't use any samplers (including default sampler states),
make sure we drop them so other parts of the driver can recognize that
the program doesn't actually use any samplers at all.

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

2 years agoradv: disable instance packing to fix pipeline query stats
Samuel Pitoiset [Tue, 19 Apr 2022 11:46:12 +0000 (13:46 +0200)]
radv: disable instance packing to fix pipeline query stats

RDNA2 is affected by a hardware bug when instance packing is enabled
for adjacent primitive topologies and instance_count > 1, pipeline
stats generated by GE are incorrect. It needs to be applied for
indexed and non-indexed draws.

This is based on PAL waDisableInstancePacking.

This fixes KHR-GL46.pipeline_statistics_query_tests_ARB.* with Zink.

Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6257
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15877>

2 years agoci: Fix tests expectations
Guilherme Gallo [Wed, 4 May 2022 14:55:54 +0000 (11:55 -0300)]
ci: Fix tests expectations

For some days, the CI was bypassing LAVA and bare-metal jobs due to an
issue in the init-stage2.sh script. After the fix some tests
crashed/failed. This commit updates the expectations for them.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16325>

2 years agoci: Update trace after CI fix
Guilherme Gallo [Wed, 4 May 2022 15:02:59 +0000 (12:02 -0300)]
ci: Update trace after CI fix

For some days, the CI was bypassing LAVA and bare-metal jobs due to an
issue in the init-stage2.sh script. After the fix the neverball trace on
panfrost-t860 is producing a different image, due to a bugfix in
Mesa itself driver. This commit updates the neverball trace on that
device.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16325>

2 years agoci: Fix init-stage2 exit code
Guilherme Gallo [Wed, 4 May 2022 13:52:10 +0000 (10:52 -0300)]
ci: Fix init-stage2 exit code

After a LAVA job submitter rework, the init-stage2.sh was changed to be
compatible with new LAVA job definitions, but the result from the script
represented by `HWCI_TEST_SCRIPT` variable is obfuscated by the `set -e`
command. So when the test script fails, `set` will override the exit
code and the jobs will pass when they should fail.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16325>

2 years agodocs: Add sh256sum for mesa 20.0.3
Dylan Baker [Wed, 4 May 2022 22:51:13 +0000 (15:51 -0700)]
docs: Add sh256sum for mesa 20.0.3

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

2 years agodocs: add release notes for 22.0.3
Dylan Baker [Wed, 4 May 2022 22:17:44 +0000 (15:17 -0700)]
docs: add release notes for 22.0.3

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

2 years agodocs: update calendar for 22.1.0-rc4
Dylan Baker [Wed, 4 May 2022 22:54:23 +0000 (15:54 -0700)]
docs: update calendar for 22.1.0-rc4

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

2 years agodocs: update calendar for 22.1.0-rc3
Dylan Baker [Wed, 4 May 2022 22:54:20 +0000 (15:54 -0700)]
docs: update calendar for 22.1.0-rc3

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

2 years agodocs: Extend calendar entries for 22.1 by 1 releases.
Dylan Baker [Wed, 4 May 2022 22:54:01 +0000 (15:54 -0700)]
docs: Extend calendar entries for 22.1 by 1 releases.

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

2 years agodocs: update calendar and link releases notes for 22.0.3
Dylan Baker [Wed, 4 May 2022 22:53:22 +0000 (15:53 -0700)]
docs: update calendar and link releases notes for 22.0.3

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

2 years agodocs: Extend calendar entries for 22.0 by 1 releases.
Dylan Baker [Wed, 4 May 2022 22:51:51 +0000 (15:51 -0700)]
docs: Extend calendar entries for 22.0 by 1 releases.

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

2 years agozink: Fix memory leak on error path.
Vinson Lee [Sat, 30 Apr 2022 05:57:02 +0000 (22:57 -0700)]
zink: Fix memory leak on error path.

Fix defect reported by Coverity Scan.

Resource leak (RESOURCE_LEAK)
leaked_storage: Variable sampler_view going out of scope leaks the storage it points to.

Fixes: 625457caafb ("zink: handle swapchain acquire failures more directly")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16258>

2 years agovulkan/wsi: Add signal_fence/semaphore_for_image helpers
Jason Ekstrand [Mon, 15 Mar 2021 17:04:56 +0000 (12:04 -0500)]
vulkan/wsi: Add signal_fence/semaphore_for_image helpers

These operations are about to get a bit more complex so let's add a
couple nice helpers to keep things clean.

Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Set the right stage flags for semaphore waits
Jason Ekstrand [Fri, 21 May 2021 20:31:06 +0000 (15:31 -0500)]
vulkan/wsi: Set the right stage flags for semaphore waits

This is currently technically broken for compute.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable@lists.freedesktop.org
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Reset the image fence right before vkQueueSubmit
Jason Ekstrand [Tue, 3 Mar 2020 18:45:16 +0000 (12:45 -0600)]
vulkan/wsi: Reset the image fence right before vkQueueSubmit

Instead of resetting at the top of the loop, we create the fence in the
signaled state and then unconditionally reset it before vkQueueSubmit.
This gives us a bit more flexibility with how we handle the fence in the
case where the client provides zero semaphores.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Hang on to file descriptors
Jason Ekstrand [Mon, 2 Mar 2020 23:40:09 +0000 (17:40 -0600)]
vulkan/wsi: Hang on to file descriptors

Instead of closing the dma-buf file descriptors immediately after
handing them to the window system, hang on to them.  We want to be able
to use them for synchronization.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Only use a single fd per wsi_image
Jason Ekstrand [Mon, 2 Mar 2020 23:38:16 +0000 (17:38 -0600)]
vulkan/wsi: Only use a single fd per wsi_image

The only thing this was helping was X11 where the protocol requires that
we pass in an array of images.  We can move all the dup() code to the
X11 back-end and leave the others a bit cleaner.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agovulkan/wsi: Close file descriptors in wsi_destroy_image
Jason Ekstrand [Mon, 2 Mar 2020 23:16:33 +0000 (17:16 -0600)]
vulkan/wsi: Close file descriptors in wsi_destroy_image

Most of the time, this is a non-issue because the WSI back-end closes
them as part of handing them to the window-system and sets fds[*] to -1.
The one exception here was Wayland which was closing them but leaving
fds[*] pointing to bogus file descriptors.  Having wsi_destroy_image
close them makes clean-up easier and more reliable.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16333>

2 years agogallium: refactor a channel loop in draw_llvm.c
Mihai Preda [Wed, 20 Apr 2022 11:30:30 +0000 (14:30 +0300)]
gallium: refactor a channel loop in draw_llvm.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: LLVM opaque pointers small changes
Mihai Preda [Mon, 2 May 2022 13:11:07 +0000 (16:11 +0300)]
gallivm: LLVM opaque pointers small changes

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_tgsi_aos.c
Mihai Preda [Mon, 2 May 2022 13:10:19 +0000 (16:10 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_tgsi_aos.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_tgsi_soa.c
Mihai Preda [Mon, 2 May 2022 13:09:40 +0000 (16:09 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_tgsi_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_struct.c
Mihai Preda [Mon, 2 May 2022 13:08:16 +0000 (16:08 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_struct.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_sample_soa.c
Mihai Preda [Mon, 2 May 2022 13:06:06 +0000 (16:06 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_sample_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_sample.c
Mihai Preda [Mon, 2 May 2022 13:04:44 +0000 (16:04 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_sample.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_nir_soa.c
Mihai Preda [Mon, 2 May 2022 13:03:36 +0000 (16:03 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_nir_soa.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_gather.c
Mihai Preda [Mon, 2 May 2022 13:01:52 +0000 (16:01 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_gather.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_format_s3tc.c
Mihai Preda [Mon, 2 May 2022 12:59:55 +0000 (15:59 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_format_s3tc.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_intr.c
Mihai Preda [Mon, 2 May 2022 12:56:33 +0000 (15:56 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_intr.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_flow.c
Mihai Preda [Mon, 2 May 2022 12:54:57 +0000 (15:54 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_flow.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_printf.c
Mihai Preda [Mon, 2 May 2022 12:53:10 +0000 (15:53 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_printf.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_coro.c
Mihai Preda [Mon, 2 May 2022 12:51:30 +0000 (15:51 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_coro.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_conv.c
Mihai Preda [Mon, 2 May 2022 12:44:19 +0000 (15:44 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_conv.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_format_aos.c
Mihai Preda [Mon, 2 May 2022 12:41:12 +0000 (15:41 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_format_aos.c

Also extract lp_build_const_func_pointer_from_type() in lp_bld_const.h
taking explicit function type.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_assert.c
Mihai Preda [Mon, 2 May 2022 12:32:25 +0000 (15:32 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_assert.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallivm: use LLVM opaque pointers in lp_bld_arit.c
Mihai Preda [Mon, 2 May 2022 12:31:29 +0000 (15:31 +0300)]
gallivm: use LLVM opaque pointers in lp_bld_arit.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium/llvmpipe: use LLVM opaque pointers in lp_bld_depth.c
Mihai Preda [Mon, 2 May 2022 12:28:22 +0000 (15:28 +0300)]
gallium/llvmpipe: use LLVM opaque pointers in lp_bld_depth.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium/llvmpipe: use LLVM opaque pointers in lp_bld_interp.c
Mihai Preda [Mon, 2 May 2022 12:26:25 +0000 (15:26 +0300)]
gallium/llvmpipe: use LLVM opaque pointers in lp_bld_interp.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium: use LLVM opaque pointers in draw_llvm.c
Mihai Preda [Mon, 2 May 2022 12:20:01 +0000 (15:20 +0300)]
gallium: use LLVM opaque pointers in draw_llvm.c

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agogallium: add opaque pointers shim for LLVM < 8.0
Mihai Preda [Mon, 2 May 2022 12:14:48 +0000 (15:14 +0300)]
gallium: add opaque pointers shim for LLVM < 8.0

LLVM is transitioning to "opaque pointers", and as such deprecates
LLVMBuildGEP, LLVMBuildCall, LLVMBuildLoad, replacing them with
LLVMBuildGEP2, LLVMBuildCall2, LLVMBuildLoad2 respectivelly.
These new functions were added in LLVM 8.0; so for LLVM before 8.0 we
simply forward to the non-opaque-pointer variants.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15893>

2 years agowsi/x11: Hook up KHR_incremental_present
Adam Jackson [Thu, 28 Apr 2022 16:04:42 +0000 (12:04 -0400)]
wsi/x11: Hook up KHR_incremental_present

We create one XFIXES region per swapchain image. If the QueuePresent
comes in with a list of rectangles, we push them into the region and
pass it to xcb_present_pixmap.

The extension is technically just a hint. We still fall back to the
unhinted "update the whole image" path if the update region has more
than an arbitrary number of rects, or if we're stuck using plain
PutImage instead of ShmPutImage.

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

2 years agozink: add a ci flake
Mike Blumenkrantz [Wed, 4 May 2022 17:10:40 +0000 (13:10 -0400)]
zink: add a ci flake

weird that this is suddenly failing on two drivers lately...

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

2 years agolavapipe: lower quad_broadcast intrinsics
Mike Blumenkrantz [Tue, 3 May 2022 15:01:05 +0000 (11:01 -0400)]
lavapipe: lower quad_broadcast intrinsics

not supported by gallivm

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

2 years agosvga: Add support for requesting NIR and translating to TGSI.
Emma Anholt [Fri, 10 Dec 2021 23:17:01 +0000 (15:17 -0800)]
svga: Add support for requesting NIR and translating to TGSI.

I'm working on switching mesa/st to no longer produce TGSI on its own, and
so we need a way to test SVGA against that future.

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Reviewed-by: Charmaine Lee <charmainel@vmware.com>
Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14160>

2 years agointel/dev: add RPL-S pci ids from drm-intel-next
Jonathan Gray [Wed, 4 May 2022 10:30:13 +0000 (20:30 +1000)]
intel/dev: add RPL-S pci ids from drm-intel-next

from Tejas Upadhyay 'drm/i915: Add RPL-S PCI IDs' in drm-intel-next

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16320>

2 years agoradv: only init acceleration structure if RT is enabled
Samuel Pitoiset [Tue, 3 May 2022 16:22:36 +0000 (18:22 +0200)]
radv: only init acceleration structure if RT is enabled

This is to fix a LLVM crash with 13.0 because ATOMIC_FMAX is only
supported on 14.0+, so RADV_DEBUG=llvm was just completely broken.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16305>

2 years agoradv/sqtt: fix configuring AUTO_FLUSH_MODE on GFX10.3
Samuel Pitoiset [Tue, 3 May 2022 15:20:24 +0000 (17:20 +0200)]
radv/sqtt: fix configuring AUTO_FLUSH_MODE on GFX10.3

The polarity is inverted. Ported from RadeonSI and PAL.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16303>

2 years agoac,radeonsi: add has_sqtt_auto_flush_mode_bug
Samuel Pitoiset [Tue, 3 May 2022 15:18:09 +0000 (17:18 +0200)]
ac,radeonsi: add has_sqtt_auto_flush_mode_bug

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16303>

2 years agoegl/kopper: Hook up eglSwapInterval
Adam Jackson [Thu, 28 Apr 2022 21:38:17 +0000 (17:38 -0400)]
egl/kopper: Hook up eglSwapInterval

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

2 years agoglx/kopper: Enable GLX_EXT_swap_control etc.
Adam Jackson [Thu, 28 Apr 2022 21:19:13 +0000 (17:19 -0400)]
glx/kopper: Enable GLX_EXT_swap_control etc.

This requires newly tracking the max swap interval since kopper can't do
abs(interval) > 1 yet.

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

2 years agokopper: Grow a swap interval API
Adam Jackson [Thu, 28 Apr 2022 21:03:23 +0000 (17:03 -0400)]
kopper: Grow a swap interval API

We take a slight liberty here by allowing 0 to mean either MAILBOX or
IMMEDIATE, since Wayland (at least) doesn't have a true IMMEDIATE mode
at least MAILBOX won't throttle to vblank.

This only correctly handles intervals of 0 or 1 at the moment.

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

2 years agowsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes
Adam Jackson [Mon, 25 Apr 2022 19:24:08 +0000 (15:24 -0400)]
wsi/x11: Avoid using xcb_wait_for_special_event in FIFO modes

If the window is destroyed from underneath us while we happen to be in
xcb_wait_for_special_event, there's no recovery. The special event will
never match because the XID is no longer valid, and Present doesn't have
an in-band DestroyNotify. We're going to work around this by using the
poll API instead. If we get an event we short-circuit back to the top of
the "wait for available image" loop, so we drain the whole special event
queue before any other logic. Which means if we run out of special
events (and the connection and swapchain are still valid) that we
_don't_ have enough images available, so to hurry along any events that
the X server hasn't flushed out yet we call GetGeometry on the
swapchain's window. As a side effect this verifies that the window is
still alive.

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

2 years agoradv/radix: handle intentional allocation failures properly
Samuel Pitoiset [Tue, 3 May 2022 14:00:41 +0000 (16:00 +0200)]
radv/radix: handle intentional allocation failures properly

This test can intentionally make the alloc callback to return NULL, so
we have to handle object creation failures properly. The driver should
also avoid memleaks because the test checks that.

Fixes crashes with
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16298>

2 years agoradv: Use RADV_RT_STAGE_BITS more often
Konstantin Seurer [Wed, 4 May 2022 13:18:07 +0000 (15:18 +0200)]
radv: Use RADV_RT_STAGE_BITS more often

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: Treat rt stages like compute stages
Konstantin Seurer [Tue, 3 May 2022 17:15:53 +0000 (19:15 +0200)]
radv: Treat rt stages like compute stages

Fixes dEQP-VK.binding_model.descriptorset_random.sets4.noarray.ubolimitlow.sbolimitlow.sampledimglow.outimgtexlow.noiub.nouab.rgen.noia.0
and probably some other ones.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: Move RADV_RT_STAGE_BITS to radv_private.h
Konstantin Seurer [Wed, 4 May 2022 12:43:33 +0000 (14:43 +0200)]
radv: Move RADV_RT_STAGE_BITS to radv_private.h

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16306>

2 years agoradv: re-emit dynamic line stipple state if the primitive topology changed
Samuel Pitoiset [Tue, 3 May 2022 10:14:38 +0000 (12:14 +0200)]
radv: re-emit dynamic line stipple state if the primitive topology changed

The dynamic primitive topology could change from LINE_LIST to
LINE_STRIP for example and the stipple state depends on this.

Found by inspection.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16295>

2 years agopan/bi: Rework varying linking on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 16:31:01 +0000 (12:31 -0400)]
pan/bi: Rework varying linking on Valhall

Valhall introduces hardware-allocated varyings. Instead of allocating varying
descriptors on the CPU with a slot based interface, the driver just tells the
hardware how many bytes to allocate per vertex and loads/stores with byte
offsets. This is much nicer!

However, this requires us to rework our linking code to account for separable
shaders. With separable shaders, we can't rely on driver_location matching
between stages, and unlike on Midgard, we can't resolve the differences with
curated command stream descriptors. However, we *can* rely on slots matching. So
we should "just" determine the byte offsets based on the slot, and then
separable shaders work.

For GLES, it really is that easy.

For desktop GL, it's not -- desktop GL brings unpredictable extra varyings like
COL1 and TEX2. Allocating space for all of these unconditionally would hamper
performance. To cope, we key fragment shaders to the set of non-GLES varyings
written by the linked vertex shader. Then we may define an efficient ABI, where
only apps only pay for what they use.

Fixes various tests in dEQP-GLES31.functional.separate_shader.random.* on
Valhall.

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

2 years agopanvk: Don't use VARYING_SLOT_TEX0 internally
Alyssa Rosenzweig [Tue, 3 May 2022 16:30:19 +0000 (12:30 -0400)]
panvk: Don't use VARYING_SLOT_TEX0 internally

This is a legacy varying for desktop GL use. Don't use it in our meta shaders,
as it adds pointless complexity.

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

2 years agopanfrost: Don't use VARYING_SLOT_TEX0 internally
Alyssa Rosenzweig [Tue, 3 May 2022 16:29:35 +0000 (12:29 -0400)]
panfrost: Don't use VARYING_SLOT_TEX0 internally

This is a legacy varying for desktop GL use. Don't use it in our internal
shaders, as it adds pointless complexity.

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

2 years agopanfrost/ci: Smoke test spilling
Alyssa Rosenzweig [Tue, 3 May 2022 21:21:13 +0000 (17:21 -0400)]
panfrost/ci: Smoke test spilling

Spilling is tricky and doesn't get much testing in CI. Run
a subset of dEQP-GLES2.functional.shaders.* with spilling forced to get spilling
tested in CI.

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

2 years agopanfrost: Use packed TLS on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 20:34:52 +0000 (16:34 -0400)]
panfrost: Use packed TLS on Valhall

Packed TLS has cache-locality benefits on Valhall, compared to Bifrost's flat
TLS. Valhall does support flat TLS, but requires extra arithmetic in the shader
for correct results. At least until we get to generic pointers (and maybe even
then), we can use packed TLS. So just use packed TLS always for proper spilling.

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

2 years agopanfrost: Use emit_tls
Alyssa Rosenzweig [Tue, 3 May 2022 20:18:59 +0000 (16:18 -0400)]
panfrost: Use emit_tls

Instead of rolling our own, so it can pick up a Valhall fix.

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

2 years agopanfrost: Correct XML for TLS
Alyssa Rosenzweig [Tue, 3 May 2022 20:08:18 +0000 (16:08 -0400)]
panfrost: Correct XML for TLS

It was never updated for Valhall, from Midgard.

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

2 years agopan/bi: Assert that blend shaders may not spill
Alyssa Rosenzweig [Tue, 3 May 2022 21:14:20 +0000 (17:14 -0400)]
pan/bi: Assert that blend shaders may not spill

The set of blend shaders is closed. They are completely internal. As such, we
know that the registers we reserve for them suffice, and we don't permit
register spilling. Refusing to support spilling in blend shaders simplifies a
number of parts of the compiler. Add a check that we don't try to spill anyway,
which will silently fail.

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

2 years agopan/bi: Add option to test spilling
Alyssa Rosenzweig [Tue, 3 May 2022 21:05:57 +0000 (17:05 -0400)]
pan/bi: Add option to test spilling

BIFROST_MESA_DEBUG=spill now restricts the register file to 1/4 its usual size,
useful for testing register spilling (e.g. running CTS) as well as debugging
spilling on small shaders.

Note blend shaders are exempt, as we don't allow blend shaders to spill.

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

2 years agopan/bi: Align spilled registers on Valhall
Alyssa Rosenzweig [Tue, 3 May 2022 21:01:24 +0000 (17:01 -0400)]
pan/bi: Align spilled registers on Valhall

Required to support packed addressing correctly. Fixes (with spilling forced):

dEQP-GLES2.functional.shaders.random.trigonometric.vertex.20

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

2 years agopan/va: Serialize memory stores
Alyssa Rosenzweig [Tue, 3 May 2022 20:47:27 +0000 (16:47 -0400)]
pan/va: Serialize memory stores

We could do better :(

Fixes spilling.

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

2 years agopanfrost: Relax image check
Alyssa Rosenzweig [Tue, 3 May 2022 21:41:23 +0000 (17:41 -0400)]
panfrost: Relax image check

Shader images on Valhall don't allow nonzero "Minimum level". However,
pan_texture lowers away nonzero minimum levels anyway, so there's nothing to
check. Fixes:

KHR-GLES31.core.shader_image_load_store.advanced-allMips-cs

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

2 years agomeson: Tell glslang to be quiet.
Georg Lehmann [Tue, 3 May 2022 19:57:23 +0000 (21:57 +0200)]
meson: Tell glslang to be quiet.

Without --quiet glslang unconditionally prints the input file name to stdout.
Check if --quiet is supported because some distros only have ancient glslang
versions.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16312>

2 years agoaco/ra: fix vgpr_limit
Rhys Perry [Tue, 3 May 2022 11:13:55 +0000 (12:13 +0100)]
aco/ra: fix vgpr_limit

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: b98a4d4dd7e ("aco: refactor GPR limit calculation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16297>

2 years agoaco: Remove D16 zero components from image stores.
Georg Lehmann [Thu, 31 Mar 2022 13:40:53 +0000 (15:40 +0200)]
aco: Remove D16 zero components from image stores.

No foz-db changes.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoradv: Run copy_prop and dce after folding 16bit sampling/load/store.
Georg Lehmann [Mon, 7 Mar 2022 12:10:47 +0000 (13:10 +0100)]
radv: Run copy_prop and dce after folding 16bit sampling/load/store.

Totals from 10 (0.01% of 134913) affected shaders:
CodeSize: 53168 -> 54832 (+3.13%); split: -0.17%, +3.30%
Instrs: 9117 -> 9200 (+0.91%); split: -1.74%, +2.65%
Latency: 41595 -> 41787 (+0.46%); split: -0.95%, +1.41%
InvThroughput: 16412 -> 16424 (+0.07%); split: -1.95%, +2.02%
VClause: 107 -> 112 (+4.67%); split: -0.93%, +5.61%
Copies: 199 -> 535 (+168.84%); split: -3.02%, +171.86%
PreVGPRs: 520 -> 502 (-3.46%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoradv: Use nir_fold_16bit_image_load_store_conversions.
Georg Lehmann [Fri, 25 Feb 2022 17:55:42 +0000 (18:55 +0100)]
radv: Use nir_fold_16bit_image_load_store_conversions.

Totals from 10 (0.01% of 134913) affected shaders:
CodeSize: 53316 -> 53168 (-0.28%)
Instrs: 9219 -> 9117 (-1.11%)
Latency: 41744 -> 41595 (-0.36%)
InvThroughput: 16616 -> 16412 (-1.23%)

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoaco: Implement image_load d16.
Georg Lehmann [Fri, 25 Feb 2022 17:52:27 +0000 (18:52 +0100)]
aco: Implement image_load d16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agoaco: Implement image_store d16.
Georg Lehmann [Fri, 25 Feb 2022 17:21:00 +0000 (18:21 +0100)]
aco: Implement image_store d16.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>

2 years agonir/lower_mediump: Add a new pass to fold 16bit image load/store.
Georg Lehmann [Mon, 7 Feb 2022 20:43:13 +0000 (21:43 +0100)]
nir/lower_mediump: Add a new pass to fold 16bit image load/store.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15179>