platform/upstream/mesa.git
20 months agolavapipe: fix one more descriptor set reference issue
Dave Airlie [Thu, 12 Jan 2023 03:12:17 +0000 (13:12 +1000)]
lavapipe: fix one more descriptor set reference issue

I thought I'd fixed this already, must have gotten lost in a rebase.

fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1010

Fixes: 20902d1ed685 ("lavapipe: fix descriptor set layout reference counting in layout merge")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20662>

20 months agoci/lvp: cleanup asan fails
Dave Airlie [Wed, 11 Jan 2023 08:04:50 +0000 (18:04 +1000)]
ci/lvp: cleanup asan fails

cleanup the remaining file for what actually fails in CI now.

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

20 months agovk_cmd_queue: add a callback to free push descriptors set khr
Dave Airlie [Wed, 11 Jan 2023 06:19:04 +0000 (16:19 +1000)]
vk_cmd_queue: add a callback to free push descriptors set khr

This should clean this up properly.

Fixes: eb7eccc76f0a ("lavapipe: Use generated command queue code")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>

20 months agollvmpipe: unref images correctly in the fragment shader path
Dave Airlie [Wed, 11 Jan 2023 05:51:08 +0000 (15:51 +1000)]
llvmpipe: unref images correctly in the fragment shader path

fixes a memory leak seen in lavapipe asan tests
dEQP-VK.robustness.robustness2.bind.template.rg32f.unroll.nonvolatile.storage_buffer.readwrite.no_fmt_qual.null_descriptor.samples_1.1d.frag

Fixes: 2909c654b014 ("llvmpipe: add fragment shader image support")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>

20 months agolavapipe: fix merged layout ref counting
Dave Airlie [Wed, 11 Jan 2023 04:10:11 +0000 (14:10 +1000)]
lavapipe: fix merged layout ref counting

When creating a merged layout, don't use ralloc, just use the
correct reference counting, also only reference a layout if the
pipeline uses it.

Fixes: d4d5a7abba7a ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>

20 months agolavapipe: fix descriptor set layout reference counting in layout merge
Dave Airlie [Wed, 11 Jan 2023 20:44:19 +0000 (06:44 +1000)]
lavapipe: fix descriptor set layout reference counting in layout merge

When taking the descriptor set layouts from the pipeline layout, make
sure to take references

Fixes: d4d5a7abba7a ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>

20 months agolavapipe: drop unused macro
Dave Airlie [Wed, 11 Jan 2023 20:43:46 +0000 (06:43 +1000)]
lavapipe: drop unused macro

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

20 months agogallium: Allow copy_region blits with matching formats.
Emma Anholt [Mon, 9 Jan 2023 18:29:28 +0000 (10:29 -0800)]
gallium: Allow copy_region blits with matching formats.

If the blit formats match and the resource formats match, then that's a
memcpy whether or not the blit's view of the resource matches the
resource's format.

Improves perf of portal-2-v2's last frame on zink+anv by 1.33212% +/-
0.302829% (n=5), where there's a blit that is viewing the RGBA8_UNORM
src/dst resources as RGBA8_SRGB.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20594>

20 months agogallium: Add a unit test for util_can_blit_via_copy_region().
Emma Anholt [Mon, 9 Jan 2023 21:29:13 +0000 (13:29 -0800)]
gallium: Add a unit test for util_can_blit_via_copy_region().

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20594>

20 months agoRevert "intel/compiler: fine-grained control of dispatch widths"
Nico Cortes [Wed, 11 Jan 2023 20:36:40 +0000 (12:36 -0800)]
Revert "intel/compiler: fine-grained control of dispatch widths"

This reverts commit bed18ab3e2f3fb7f84568a7965becebbbcee9afb.

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

20 months agoci: make wget even more robust
David Heidelberg [Tue, 10 Jan 2023 22:45:08 +0000 (23:45 +0100)]
ci: make wget even more robust

The future is the curl or wget2, but today we have some issues to kill.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>

20 months agoci: propagete robust wgetrc into lava rootfs
David Heidelberg [Tue, 10 Jan 2023 23:14:02 +0000 (00:14 +0100)]
ci: propagete robust wgetrc into lava rootfs

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>

20 months agoci: when downgrading from Alpine 3.17 to 3.16, the tag was kept on 3.17
David Heidelberg [Tue, 10 Jan 2023 22:50:34 +0000 (23:50 +0100)]
ci: when downgrading from Alpine 3.17 to 3.16, the tag was kept on 3.17

Fixes: 09d5c55836f3 ("ci: restore reliable Alpine 3.16")

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>

20 months agoci/amd: increase number of stoney runners
David Heidelberg [Tue, 10 Jan 2023 22:59:41 +0000 (23:59 +0100)]
ci/amd: increase number of stoney runners

Everything up and running.

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20626>

20 months agodocs: update calendar for 22.3.3
Eric Engestrom [Wed, 11 Jan 2023 17:49:42 +0000 (17:49 +0000)]
docs: update calendar for 22.3.3

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

20 months agodocs: add release notes for 22.3.3
Eric Engestrom [Wed, 11 Jan 2023 17:44:47 +0000 (17:44 +0000)]
docs: add release notes for 22.3.3

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

20 months agovulkan/wsi: Use the newly imported dma-buf.h
Jason Ekstrand [Sat, 11 Jun 2022 01:43:51 +0000 (20:43 -0500)]
vulkan/wsi: Use the newly imported dma-buf.h

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>

20 months agodrm-uapi/dma-buf.h: unbreak on non-Linux via local typedefs
Jan Beich [Thu, 16 Jun 2022 00:21:28 +0000 (00:21 +0000)]
drm-uapi/dma-buf.h: unbreak on non-Linux via local typedefs

In file included from src/vulkan/wsi/wsi_common_drm.c:34:
include/drm-uapi/dma-buf.h:23:10: fatal error: 'linux/types.h' file not found
 #include <linux/types.h>
          ^~~~~~~~~~~~~~~

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>

20 months agodrm-uapi/dma-buf.h: Update from drm-misc-next (2022-06-10)
Jason Ekstrand [Sat, 11 Jun 2022 01:39:47 +0000 (20:39 -0500)]
drm-uapi/dma-buf.h: Update from drm-misc-next (2022-06-10)

From https://cgit.freedesktop.org/drm-misc/

    9cc4853e4781bf0dd0f35355dc92d97c9da02f5d
    Author: Antonio Borneo <antonio.borneo@foss.st.com>
    Date:   Tue Jun 7 23:31:44 2022 +0200

        drm: adv7511: override i2c address of cec before accessing it

This version has the new sync_file import/export ioctls.

Acked-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16987>

20 months agoagx: Don't crash trying to encoding minifloats
Alyssa Rosenzweig [Fri, 6 Jan 2023 01:52:09 +0000 (20:52 -0500)]
agx: Don't crash trying to encoding minifloats

Fixes assertion fails in piglit isinf-and-isnan, which uses a constant infinity,
which has an out-of-bounds mantissa (but the function contract says that's
fine and we just return something undefined.)

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

20 months agoagx: Use BITFIELD64_BIT for outputs_written
Alyssa Rosenzweig [Sat, 7 Jan 2023 19:45:59 +0000 (14:45 -0500)]
agx: Use BITFIELD64_BIT for outputs_written

Fix by inspection.

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

20 months agonir/gather_info: Handle store_zs_agx
Alyssa Rosenzweig [Sat, 7 Jan 2023 19:46:18 +0000 (14:46 -0500)]
nir/gather_info: Handle store_zs_agx

This acts as a depth/stencil write. The AGX compiler checks outputs_written to
determine what conservative depth settings the driver needs. Nominally, this
should work: the original store_output(FRAG_RESULT_DEPTH) intrinsic causes the
DEPTH outputs_written bit to be set, so the metadata is still correct after
lowering store_output to store_zs_agx. However, there are a handful of places
that call nir_gather_info late, which *resets* the existing outputs_written
value and regathers, causing Asahi to use the wrong conservative depth settings
when shuffling NIR pass order and breaking gl_FragDepth.

To fix, handle store_zs_agx conservatively when gathering info so we don't have
to play games with the pass order or stashing info in a sideband.

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

20 months agoagx: Wire up nir_intrinsic_store_agx
Alyssa Rosenzweig [Sat, 3 Dec 2022 02:41:29 +0000 (21:41 -0500)]
agx: Wire up nir_intrinsic_store_agx

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

20 months agoagx: Remove load_global(_constant) support
Alyssa Rosenzweig [Sat, 3 Dec 2022 22:26:15 +0000 (17:26 -0500)]
agx: Remove load_global(_constant) support

Now lowered in NIR to better instructions than we were selecting.

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

20 months agoagx: Use load_global_constant for UBO lowering
Alyssa Rosenzweig [Sat, 3 Dec 2022 22:20:54 +0000 (17:20 -0500)]
agx: Use load_global_constant for UBO lowering

Rely on the common address arithmetic optimizations. We don't need the
special formats for UBO loads anyway, so this is simpler and optimizes
out the ushr.

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

20 months agoagx: Lower global loads/stores to AGX versions
Alyssa Rosenzweig [Sat, 3 Dec 2022 21:54:32 +0000 (16:54 -0500)]
agx: Lower global loads/stores to AGX versions

This lets us do all the needed address arithmetic in a central place.

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

20 months agonir: Add store_agx intrinsic
Alyssa Rosenzweig [Sat, 3 Dec 2022 22:10:13 +0000 (17:10 -0500)]
nir: Add store_agx intrinsic

This works like store_global, but lets us optimize address arithmetic. Like
load_agx, it is formatted to match the hardware semantic. We don't make use of
any clever formats in this series, though.

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

20 months agofreedreno/a6xx: Demote coherent img access to uncompressed
Rob Clark [Mon, 9 Jan 2023 19:53:11 +0000 (11:53 -0800)]
freedreno/a6xx: Demote coherent img access to uncompressed

We cannot use UBWC for coherent access across shader stages.

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

20 months agogallium: Add image volatile/coherent flags
Rob Clark [Mon, 9 Jan 2023 19:34:04 +0000 (11:34 -0800)]
gallium: Add image volatile/coherent flags

Freedreno needs to know when an image has volatile or coherent access
flags in the shader.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>

20 months agomesa/st: Track complete access qualifier for images
Rob Clark [Mon, 9 Jan 2023 19:23:39 +0000 (11:23 -0800)]
mesa/st: Track complete access qualifier for images

Don't turn gl_access_qualifier coming from NIR back into GL enums,
losing information in the process.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20612>

20 months agod3d12: implement the get_decoder_fence vfunc
Sil Vilerino [Sun, 4 Dec 2022 12:39:09 +0000 (09:39 -0300)]
d3d12: implement the get_decoder_fence vfunc

Implement the get_decoder_fence vfunc. Note that the waiting for
completion in this driver happens in the end_frame vfunc itself.

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agoradeonsi: vcn: implement the get_decoder_fence vfunc
Daniel Almeida [Sun, 4 Dec 2022 12:28:23 +0000 (09:28 -0300)]
radeonsi: vcn: implement the get_decoder_fence vfunc

Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agoradeonsi: uvd: implement the get_decoder_fence vfunc
Daniel Almeida [Sun, 4 Dec 2022 12:27:33 +0000 (09:27 -0300)]
radeonsi: uvd: implement the get_decoder_fence vfunc

Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agor600: uvd: implement the get_decoder_fence vfunc
Daniel Almeida [Sun, 4 Dec 2022 12:25:45 +0000 (09:25 -0300)]
r600: uvd: implement the get_decoder_fence vfunc

Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in picture->fence in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agovirgl: video: implement the get_decoder_fence vfunc
Daniel Almeida [Sun, 4 Dec 2022 12:20:48 +0000 (09:20 -0300)]
virgl: video: implement the get_decoder_fence vfunc

Implement the get_decoder_fence vfunc by waiting on the fence
previously passed in picture->fence in the end_frame vfunc.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agofrontends: va: fix vaQuerySurfaceStatus and vaSyncSurface for decode
Daniel Almeida [Sun, 4 Dec 2022 12:18:52 +0000 (09:18 -0300)]
frontends: va: fix vaQuerySurfaceStatus and vaSyncSurface for decode

Use the new get_decoder_fence vfunc to  implement
vaQuerySurfaceStatus and vaSyncSurface in the va state tracker.

A pointer to the surface's fence is passed to the codecs before the
end_frame vfunc and the codec is responsible for allocating a fence on
command stream submission.

This fence is then queried on vaQuerySurfaceStatus and waited on in
vaSyncSurface.

Notably both functions were not implemented as per the VA-API docs for
PIPE_VIDEO_ENTRYPOINT_BITSTREAM.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agogallium: pipe: add PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS
Daniel Almeida [Mon, 5 Dec 2022 17:17:54 +0000 (14:17 -0300)]
gallium: pipe: add PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS

Add PIPE_DEFAULT_DECODER_FEEDBACK_TIMEOUT_NS as a way to control
how much to wait for decoders if this is supported.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agogallium: pipe: add get_decoder_fence vfunc
Daniel Almeida [Sun, 4 Dec 2022 12:12:09 +0000 (09:12 -0300)]
gallium: pipe: add get_decoder_fence vfunc

Add a get_decoder_fence vfunc that can be used to query the status
of the previous decode job denoted by 'fence' given 'timeout'.

A pointer to a fence pointer can be  passed to the codecs before the
end_frame vfunc and the codec should then be responsible for allocating
a fence on command stream submission.

Signed-off-by: Daniel Almeida <daniel.almeida@collabora.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20133>

20 months agofreedreno/a6xx: Remove shader key from fd6_emit
Rob Clark [Mon, 2 Jan 2023 21:36:55 +0000 (13:36 -0800)]
freedreno/a6xx: Remove shader key from fd6_emit

Only construct the key on-demand if the PROG state is dirty.  The newly
added "virtual" PROG_KEY state is used to know when other state that the
shader key depends on changes.  Worth ~13% at drawoverhead test 0.

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

20 months agofreedreno/a6xx: Avoid zero-init fd6_emit
Rob Clark [Mon, 2 Jan 2023 20:38:19 +0000 (12:38 -0800)]
freedreno/a6xx: Avoid zero-init fd6_emit

A pretty significant amount of time spent in fd6_draw_vbo is calling
memset to zero init the on-stack struct.  And a big part of the size
of the struct is fd6_state, of which we only need to initialize
num_groups to zero.  This is worth a 15% improvement in drawoverhead
test 0 ("no state change").

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

20 months agofreedreno/a6xx: Tighten up fd6_emit
Rob Clark [Mon, 2 Jan 2023 20:14:06 +0000 (12:14 -0800)]
freedreno/a6xx: Tighten up fd6_emit

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

20 months agofreedreno/a6xx: Move fb_read descriptor to fd6_gmem
Rob Clark [Sun, 1 Jan 2023 19:29:12 +0000 (11:29 -0800)]
freedreno/a6xx: Move fb_read descriptor to fd6_gmem

We already overwrote the entire descriptor in patch_fb_read_sysmem().
Doing the same in patch_fb_read_gmem() will simplify things for moving
the fb_read descriptor to the FS's bindless descriptor set.

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

20 months agofreedreno/a6xx: Split out fd6_state
Rob Clark [Sun, 1 Jan 2023 16:15:32 +0000 (08:15 -0800)]
freedreno/a6xx: Split out fd6_state

Split out the build-up of CP_SET_DRAW_STATE packet, as we are going to
want to re-use this for compute state later when we switch to bindless
IBO descriptors.

While we are at it, drop the enable_mask param, as this is determined
solely by the group_id, and it is easier to maintain a table for the
handful of exceptions to ENABLE_ALL.  The compiler should be able to
optimize away the table lookup.

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

20 months agofreedreno/a6xx: Rename fd6_emit_3d_state()
Rob Clark [Sun, 1 Jan 2023 15:31:56 +0000 (07:31 -0800)]
freedreno/a6xx: Rename fd6_emit_3d_state()

To better reflect this is emitting 3d state, and to avoid a name
conflict in the next patch.

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

20 months agowsi/meson: add missing dep
Eric Engestrom [Wed, 11 Jan 2023 12:31:29 +0000 (12:31 +0000)]
wsi/meson: add missing dep

Same thing as https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20530:
newly added `src/vulkan/util/rmv/vk_rmv_tokens.h` (see !17331) includes
`src/util/` files, so anything that includes it needs `idep_mesautil`.

    In file included from ../src/vulkan/util/rmv/vk_rmv_common.h:29,
                     from ../src/vulkan/runtime/vk_device.h:26,
                     from ../src/vulkan/wsi/wsi_common.c:31:
    ../src/util/simple_mtx.h:34:12: fatal error: valgrind.h: No such file or directory
       34 | #  include <valgrind.h>
          |            ^~~~~~~~~~~~
    compilation terminated.

Fixes: 5f30a7538befb00e7989 ("vulkan: Add RMV token definitions")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20642>

20 months agoradv,aco: fix enable_mrt_output_nan_fixup for RAGE2 again
Samuel Pitoiset [Wed, 11 Jan 2023 09:28:24 +0000 (10:28 +0100)]
radv,aco: fix enable_mrt_output_nan_fixup for RAGE2 again

Driver workarounds for game bugs can be easily broken. This one
shouldn't be applied to meta shaders and this restores previous logic.

Fixes: da32cbb5c69 ("aco: fix missing uses of MRT output flags")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20637>

20 months agoci: debian-build-testing, build only the LTO variant
David Heidelberg [Tue, 10 Jan 2023 19:44:19 +0000 (20:44 +0100)]
ci: debian-build-testing, build only the LTO variant

The chance we'll miss anything from non-LTO is minimal, and having
both builds in one is too slow (usually the latest job to finish).

Acked-by: Martin Roukala <martin.roukala@mupuf.org>
Acked-by: Eric Engestrom <eric@igalia.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20623>

20 months agodocs: fixup envvar-directive syntax
Erik Faye-Lund [Wed, 11 Jan 2023 12:15:38 +0000 (13:15 +0100)]
docs: fixup envvar-directive syntax

This directive needs a newline following it to render correctly.

While we're at it, fixup the incorrect indent for one of the
descriptions.

Fixes: 0c58ad3e321 ("docs: use envvar directive more")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20640>

20 months agodocs: use envvar directive more
Marcin Ślusarz [Wed, 11 Jan 2023 10:40:43 +0000 (11:40 +0100)]
docs: use envvar directive more

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

20 months agov3dv: expose VK_KHR_shader_integer_dot_product
Iago Toral Quiroga [Wed, 11 Jan 2023 10:25:59 +0000 (11:25 +0100)]
v3dv: expose VK_KHR_shader_integer_dot_product

NIR will automatically lower all of these opcodes unless the driver
specifies that it can handle them natively. We don't have any hardware
support for any of these opcodes though, so we just let NIR lower
all of them.

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

20 months agov3d/compiler: remove unused sample_coverage field from fs key.
Iago Toral Quiroga [Wed, 11 Jan 2023 08:31:06 +0000 (09:31 +0100)]
v3d/compiler: remove unused sample_coverage field from fs key.

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

20 months agov3dv: fix alpha-to-one for single sample setup
Iago Toral Quiroga [Wed, 11 Jan 2023 08:08:11 +0000 (09:08 +0100)]
v3dv: fix alpha-to-one for single sample setup

In Vulkan this is expected to work with single sample scenarios too.

Fixes new test in CTS main:
dEQP-VK.pipeline.monolithic.multisample.alpha_to_one.samples_1

cc: mesa-stable

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

20 months agov3d: add a debug option to optimize shader compile times
Iago Toral Quiroga [Mon, 9 Jan 2023 07:13:06 +0000 (08:13 +0100)]
v3d: add a debug option to optimize shader compile times

Particularly, this makes compilation stop as soon as we get a
valid shader and doesn't try to optimize spilling by trying
fallback strategies.

Might come in handy to reduce CTS execution time, for example,
dEQP-VK.ssbo.layout.random.8bit.all_per_block_buffers.6 goes from
43m46.715s down to 15m15.068s.

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

20 months agodzn: Allow multiple graphics queues
Jesse Natalie [Thu, 17 Nov 2022 17:58:58 +0000 (09:58 -0800)]
dzn: Allow multiple graphics queues

There's no real reason not to, WDDM supports it. It's not really that
useful, but I don't expect most apps to really want to do it anyway.
It does enable some useful synchronization scenarios sometimes.

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agodzn: Use DXGI swapchains
Boris Brezillon [Wed, 27 Apr 2022 17:34:57 +0000 (19:34 +0200)]
dzn: Use DXGI swapchains

Makes things so much faster than doing CPU copies using StretchBlt().

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Hook-up DXGI swapchains and DComp
Boris Brezillon [Wed, 27 Apr 2022 17:32:34 +0000 (19:32 +0200)]
vulkan/wsi: Hook-up DXGI swapchains and DComp

The CPU copy is horribly slow, so let's hook-up DXGI swapchains. Note
that we're still limited in term of features. For instance, we can't
support more than 2 images per swapchain because of the DXGI present
ordering constraint. We also have to do an extra copy, because DXGI
only allows rendering to a resource on the queue that the swapchain
was created against, but swapchains in Vulkan don't have a queue.

The swapchain is bound to the window using DirectComposition aka
DComp. The DComp infrastructure is set up in the surface, and is
transitioned from one swapchain to the next when the new swapchain
begins presenting.

Unlike Wayland and X, there's no requirement that the compositor has
to release a surface before you can start rendering against it. However,
since we're now supporting the non-sw path, we do need to prevent apps
from rendering to a resource *while* the blit is occurring. We do this
by blocking for a fence while acquiring an image.

Co-authored-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Port Win32 WSI to C++
Jesse Natalie [Wed, 16 Nov 2022 15:54:44 +0000 (07:54 -0800)]
vulkan/wsi: Port Win32 WSI to C++

In a future commit we'll want to be able to use DirectComposition
in the Win32 WSI layer, and unfortunately DComp doesn't have a C-
compatible header (despite being COM, it uses function overloads
and has references instead of pointers for some functions).

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Allow platform code to define extra dependencies
Boris Brezillon [Wed, 27 Apr 2022 16:03:11 +0000 (18:03 +0200)]
vulkan/wsi: Allow platform code to define extra dependencies

Needed for the windows platform if we want to hook up DXGI swapchains.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Add support for image -> image blits
Boris Brezillon [Wed, 27 Apr 2022 16:25:34 +0000 (18:25 +0200)]
vulkan/wsi: Add support for image -> image blits

The win32 swapchain can be backed by a DXGI swapchain, but such swapchains
are incompatible with STORAGE images (AKA UNORDERED_ACCESS usage in
DXGI). So, we need to allocate an intermediate image that will serve as
a render-target, and copy this image to the WSI image when QueuePresent()
is called. That's pretty similar to what we do for the buffer blit case,
except the image -> buffer copy is replaced by an image -> image copy.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Dissociate the blit context and image configuration steps
Boris Brezillon [Wed, 27 Apr 2022 16:19:40 +0000 (18:19 +0200)]
vulkan/wsi: Dissociate the blit context and image configuration steps

Even if all implementations wsi_configure_buffer_image() will need to
configure the image as well, it feels a bit weird to call
wsi_configure_image() from there, so let's the
wsi_configure_buffer_image() users call wsi_configure_image() too.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Prepare things for image to image blits
Boris Brezillon [Wed, 27 Apr 2022 16:17:06 +0000 (18:17 +0200)]
vulkan/wsi: Prepare things for image to image blits

Right now, the WSI core supports copying WSI images to a linear buffer
for implementations that want the result in this form. This being said,
most of the blit logic can be re-used for image to image copies, and that's
exactly what we'll need if we want to hook-up DXGI swapchains in the
win32 WSI implementation. So let's rename a few fields so we no longer
imply that images are copied to a buffer, and the use_buffer_blit boolean
an enum so we can extend the implementation to support image -> image
copies.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Don't set use_buffer_blit manually in the win32 WSI logic
Boris Brezillon [Wed, 27 Apr 2022 18:07:50 +0000 (20:07 +0200)]
vulkan/wsi: Don't set use_buffer_blit manually in the win32 WSI logic

We can simply pass use_buffer_blit=true to wsi_swapchain_init().

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Simplify wsi_win32_surface_create_swapchain() error path
Boris Brezillon [Thu, 28 Apr 2022 07:03:04 +0000 (00:03 -0700)]
vulkan/wsi: Simplify wsi_win32_surface_create_swapchain() error path

We are about to add more to this function, so let's try to automate
the cleanup steps in the error path. Incrementing image_count as
we add new images to the swapchain allows us to call
wsi_win32_swapchain_destroy() even if not all images were initialized.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agovulkan/wsi: Indent fixes in ws_common_win32.c
Boris Brezillon [Thu, 28 Apr 2022 06:57:35 +0000 (23:57 -0700)]
vulkan/wsi: Indent fixes in ws_common_win32.c

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agomeson: Define VK_USE_PLATFORM_WIN32_KHR for C++
Jesse Natalie [Wed, 16 Nov 2022 15:37:02 +0000 (07:37 -0800)]
meson: Define VK_USE_PLATFORM_WIN32_KHR for C++

Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16200>

20 months agodocs: update new_features.txt for additional work with RADV
Samuel Pitoiset [Tue, 10 Jan 2023 13:01:25 +0000 (14:01 +0100)]
docs: update new_features.txt for additional work with RADV

This release (23.0) contains less features than usual but the last
branchpoint was delayed and we had end of year holidays.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20609>

20 months agointel/compiler: fine-grained control of dispatch widths
Marcin Ślusarz [Thu, 5 Jan 2023 14:39:28 +0000 (15:39 +0100)]
intel/compiler: fine-grained control of dispatch widths

Reviewed-by: Matt Turner <mattst88@gmail.com> [v1]
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20535>

20 months agoci/venus: re-enable venus-lavapipe
Yiwei Zhang [Tue, 10 Jan 2023 21:12:08 +0000 (13:12 -0800)]
ci/venus: re-enable venus-lavapipe

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>

20 months agoci/venus: specify render server path to enable server config
Yiwei Zhang [Sat, 5 Nov 2022 06:58:13 +0000 (23:58 -0700)]
ci/venus: specify render server path to enable server config

The render server path is required by crosvm to enable render server.

v2: updated script to package server binary properly

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com> (v1)
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>

20 months agoci: uprev virglrenderer
Yiwei Zhang [Tue, 10 Jan 2023 01:27:06 +0000 (17:27 -0800)]
ci: uprev virglrenderer

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19542>

20 months agoFix incorrect stage reference
Giancarlo Devich [Tue, 10 Jan 2023 23:33:27 +0000 (15:33 -0800)]
Fix incorrect stage reference

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

20 months agod3d12: Unionize shader variables in d3d12_shader_key to reduce size
Giancarlo Devich [Mon, 9 Jan 2023 20:35:08 +0000 (12:35 -0800)]
d3d12: Unionize shader variables in d3d12_shader_key to reduce size

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

20 months agodocs: Add short documentation about RMV tracing variables
Friedrich Vock [Fri, 1 Jul 2022 02:10:04 +0000 (04:10 +0200)]
docs: Add short documentation about RMV tracing variables

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

20 months agoradv: Enable RMV tracing
Friedrich Vock [Mon, 15 Aug 2022 14:25:43 +0000 (16:25 +0200)]
radv: Enable RMV tracing

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

20 months agoradv: Add RMV resource tracking
Friedrich Vock [Wed, 7 Dec 2022 15:11:38 +0000 (16:11 +0100)]
radv: Add RMV resource tracking

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

20 months agoradv: Add RMV tracing layer
Friedrich Vock [Sat, 16 Jul 2022 21:56:57 +0000 (23:56 +0200)]
radv: Add RMV tracing layer

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

20 months agoradv: Add RMV tracing utilities
Friedrich Vock [Sat, 16 Jul 2022 21:52:45 +0000 (23:52 +0200)]
radv: Add RMV tracing utilities

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

20 months agoradv: Use internal allocation helpers for internal allocations
Friedrich Vock [Wed, 7 Dec 2022 12:12:44 +0000 (13:12 +0100)]
radv: Use internal allocation helpers for internal allocations

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

20 months agovulkan: Add RMV file exporter
Friedrich Vock [Sat, 16 Jul 2022 21:42:56 +0000 (23:42 +0200)]
vulkan: Add RMV file exporter

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

20 months agovulkan: Add common RMV tracing infrastructure
Friedrich Vock [Sat, 16 Jul 2022 21:38:30 +0000 (23:38 +0200)]
vulkan: Add common RMV tracing infrastructure

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

20 months agovulkan: Add RMV token definitions
Friedrich Vock [Sat, 16 Jul 2022 21:42:09 +0000 (23:42 +0200)]
vulkan: Add RMV token definitions

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

20 months agozink: set surface->dt when updating swapchain
Mike Blumenkrantz [Tue, 10 Jan 2023 15:51:06 +0000 (10:51 -0500)]
zink: set surface->dt when updating swapchain

this otherwise re-creates swapchain surfaces on every frame and has
a significant perf hit for no reason

cc: mesa-stable

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

20 months agod3d12: Reuse sampler tables inside of a batch
Giancarlo Devich [Tue, 10 Jan 2023 17:35:39 +0000 (09:35 -0800)]
d3d12: Reuse sampler tables inside of a batch

If a shader's sampler state is dirty often, the sampler descriptor heap
can get used up quickly, forcing flushing. If that happens quickly, we
run out of batches and have to wait for batches to finish on the GPU.

When this happens, it is often because the sampler state is switching,
not because it's truly unique. This change hashes and saves sampler
descriptor tables that can be reused in subsequent draws in the same
batch, instead of re-copying the same descriptors and consuming the
heap.

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

20 months agosvga: fix max number of texture cube levels
Charmaine Lee [Tue, 10 Jan 2023 04:46:33 +0000 (20:46 -0800)]
svga: fix max number of texture cube levels

The maximum number of mipmap levels supported for cubemap can be
determined from the maximum 2D texture size. There is no need
to limit the max to 12.

This fixes a regression in creating GL4.1 and up context since
commit 2658d025166c is now explicitly checking for
MaxCubeTextureLevels >= 15 for GL4.1 context.

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20600>

20 months agoanv: Print the BO sizes in KB instead of hex bytes.
Emma Anholt [Thu, 5 Jan 2023 21:34:25 +0000 (13:34 -0800)]
anv: Print the BO sizes in KB instead of hex bytes.

We already show the address range, which is most of why I'd think you'd be
looking at hex values.  I find a more human-readable number nice for
debugging, instead of counting zeroes to decide if it's 1.5MB or 96kb.

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

20 months agoanv: Fix the size/aperture space debug printouts to consider _ccs_size.
Emma Anholt [Mon, 9 Jan 2023 17:32:01 +0000 (09:32 -0800)]
anv: Fix the size/aperture space debug printouts to consider _ccs_size.

It's added in at anv_bo_vma_alloc_or_close(), so count it here too.

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

20 months agoanv: Add an aperture space summary to INTEL_DEBUG=submit.
Emma Anholt [Thu, 5 Jan 2023 21:32:04 +0000 (13:32 -0800)]
anv: Add an aperture space summary to INTEL_DEBUG=submit.

Same as on iris, this is nice for tracking at a high level how much memory
is being used.

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

20 months agor300: allow more copy propagation with relative addressing
Pavel Ondračka [Mon, 21 Nov 2022 10:20:28 +0000 (11:20 +0100)]
r300: allow more copy propagation with relative addressing

We are now extremelly careful when copy propagating a mov that uses
relative addressing. The search for readers will trigger abort when it
sees any other instruction using a relative addressing, irrespective of
the actual used registers or whether an address register load was seen.

Additionally, since ntt switch all movs using the relative addressing are
actually used only once right on the next line, and are result of ntt converting

vec4 32 ssa_10 = intrinsic load_ubo_vec4 (ssa_0, ssa_9) (access=0, base=11, component=0)

into

  5: ARL ADDR[0].x, TEMP[0].xxxx
  6: MOV TEMP[2], CONST[0][ADDR[0].x+11]

RV530 shader-db:
total instructions in shared programs: 132966 -> 131904 (-0.80%)
instructions in affected programs: 29896 -> 28834 (-3.55%)
helped: 234
HURT: 2
total temps in shared programs: 16969 -> 16905 (-0.38%)
temps in affected programs: 604 -> 540 (-10.60%)
helped: 68
HURT: 12

Partial fix for: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7723

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20577>

20 months agoaco: Use NSA on GFX11 with more than 5 vaddr registers.
Georg Lehmann [Sat, 17 Dec 2022 11:40:17 +0000 (12:40 +0100)]
aco: Use NSA on GFX11 with more than 5 vaddr registers.

On GFX11 the first 4 vaddr are single registers and the last contains the remaining vector.
image_bvh64_intersect_ray has a special NSA layout.

Foz-DB GFX1100:
Totals from 2763 (2.05% of 134913) affected shaders:
VGPRs: 145884 -> 145056 (-0.57%); split: -1.03%, +0.46%
CodeSize: 18406864 -> 18326136 (-0.44%); split: -0.47%, +0.04%
MaxWaves: 76030 -> 76146 (+0.15%)
Instrs: 3559785 -> 3525287 (-0.97%); split: -0.97%, +0.00%
Latency: 44278460 -> 43303419 (-2.20%); split: -2.33%, +0.13%
InvThroughput: 4966295 -> 4914927 (-1.03%); split: -1.04%, +0.01%
VClause: 51755 -> 51991 (+0.46%); split: -0.05%, +0.50%
SClause: 105241 -> 105267 (+0.02%); split: -0.08%, +0.10%
Copies: 214141 -> 182419 (-14.81%); split: -14.82%, +0.01%
Branches: 69525 -> 69521 (-0.01%)
PreVGPRs: 120910 -> 120256 (-0.54%); split: -0.56%, +0.02%

No changes on Navi21.

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

20 months agoaco: Validate GFX11 NSA correctly.
Georg Lehmann [Sat, 17 Dec 2022 11:39:25 +0000 (12:39 +0100)]
aco: Validate GFX11 NSA correctly.

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

20 months agoaco: Handle NSA with vectors in get_mimg_nsa_dwords.
Georg Lehmann [Sat, 17 Dec 2022 11:32:49 +0000 (12:32 +0100)]
aco: Handle NSA with vectors in get_mimg_nsa_dwords.

No Foz-DB changes.

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

20 months agomesa: add missing count_scale attributes
Pierre-Eric Pelloux-Prayer [Tue, 10 Jan 2023 09:04:40 +0000 (10:04 +0100)]
mesa: add missing count_scale attributes

The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

for both functions.

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

20 months agomesa: add missing count_scale attribute
Pierre-Eric Pelloux-Prayer [Tue, 10 Jan 2023 09:01:06 +0000 (10:01 +0100)]
mesa: add missing count_scale attribute

The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

Fixes: a4e935f2d70 ("mesa: add EXT_dsa + EXT_gpu_program_parameters functions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7943
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8025
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>

20 months agozink: lower stipple + smooth
Erik Faye-Lund [Fri, 2 Dec 2022 12:39:10 +0000 (13:39 +0100)]
zink: lower stipple + smooth

We can use the new functionality in the draw-helper to implement
stippled smooth lines instead of what we currently do, which is aliased
stipping on smooth lines.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20134>

20 months agogallium/draw: support lowering stipple + smooth
Erik Faye-Lund [Fri, 2 Dec 2022 12:33:48 +0000 (13:33 +0100)]
gallium/draw: support lowering stipple + smooth

When computing line smoothing, we can also do something similar to
compute the line stippling. This can be useful for some drivers, who
can't easily split the lines before rasterizing them.

This does lead to slightly inaccurate stippling, because the
line-smoothing extends the line-length by a small amount. That leads to
the line-stippling pattern being over-stretched over the line-segment by
a fraction of a pixel in lenght. For short lines, this can be quite a
lot of error.

Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20134>

20 months agoegl: const display & config pointers in eglGetConfigAttrib()
Eric Engestrom [Mon, 8 Nov 2021 15:02:01 +0000 (15:02 +0000)]
egl: const display & config pointers in eglGetConfigAttrib()

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20567>

20 months agoegl: inline _eglReportError(), and drop this and all the other unused defines
Eric Engestrom [Mon, 8 Nov 2021 15:01:40 +0000 (15:01 +0000)]
egl: inline _eglReportError(), and drop this and all the other unused defines

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Marek Olšák <maraeo@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20565>

20 months agoradeonsi: rewrite si_update_ps_colorbuf0_slot to fix crashes and recursions
Marek Olšák [Tue, 13 Dec 2022 19:10:29 +0000 (14:10 -0500)]
radeonsi: rewrite si_update_ps_colorbuf0_slot to fix crashes and recursions

I'm convinced that u_blitter interactions with fbfetch can't be handled
in si_update_ps_colorbuf0_slot alone, so it has to be force-disabled
by si_blitter_begin. Another reason why it has to be disabled for u_blitter
and not ignored is because FBFETCH with MSAA enables sample shading
regardless of context states, and we don't want that for u_blitter.

Also, si_update_ps_colorbuf0_slot now disables FBFETCH explicitly before
its own DCC and CMASK decompression because even though u_blitter can't do
anything (due to blitter_running), si_blitter_end calls it too.

The result is that no recursion can occur thanks to the blitter_running
and suppress_update_ps_colorbuf0_slot flags, and FBFETCH is always
force-disabled before those flags are set, which is the state we want
to be in.

Fixes: bc6d22b9200 ("radeonsi: fix ps_uses_fbfetch value")

Acked-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20318>

20 months agoci/lava: Tweak LAVA jobs timeouts
Guilherme Gallo [Mon, 9 Jan 2023 20:43:38 +0000 (17:43 -0300)]
ci/lava: Tweak LAVA jobs timeouts

The Mesa CI LAVA job submitter was suffering from a bug in the LAVA
software that made their timeouts related to sub-actions unreliable,
such as waiting for the user login prompt automatic response.

The following MR
https://git.lavasoftware.org/lava/lava/-/merge_requests/1900 fixed this
issue. So we can now better control job timeouts granularity, failing
the job faster when there is something weird hanging the boot stage.

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

20 months agoci/lava: Update lavacli version
Guilherme Gallo [Mon, 9 Jan 2023 19:46:28 +0000 (16:46 -0300)]
ci/lava: Update lavacli version

- Use new YAML loader derived from ruamel.yaml
- Remove PyYAML dependency from LAVA job submitter package

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