platform/upstream/mesa.git
19 months agopanfrost: Note glDrawRangeElements underflow
Alyssa Rosenzweig [Tue, 14 Mar 2023 18:11:33 +0000 (14:11 -0400)]
panfrost: Note glDrawRangeElements underflow

Hopefully this helps someone wiring up robustness later on.

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

19 months agopanfrost/ci: Remove fbo-mrt-new-bind fail+flake
Alyssa Rosenzweig [Tue, 14 Mar 2023 03:15:35 +0000 (23:15 -0400)]
panfrost/ci: Remove fbo-mrt-new-bind fail+flake

Seems to pass reliably now.

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

19 months agopanfrost/ci: Add some Piglit skips
Alyssa Rosenzweig [Tue, 14 Mar 2023 00:48:53 +0000 (20:48 -0400)]
panfrost/ci: Add some Piglit skips

Skip heavyweight crashing tests that have the potential to take down not just
themselves but also other Piglit tests running concurrently via piglit-runner
(which would otherwise become piglit-runner level flakes).

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

19 months agopanfrost/ci: Identify some Piglit flakes
Alyssa Rosenzweig [Tue, 14 Mar 2023 00:48:47 +0000 (20:48 -0400)]
panfrost/ci: Identify some Piglit flakes

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

19 months agopanfrost/ci: Skip draw_buffers_indexed.random.* on Midgard
Alyssa Rosenzweig [Tue, 14 Mar 2023 01:28:21 +0000 (21:28 -0400)]
panfrost/ci: Skip draw_buffers_indexed.random.* on Midgard

These are (have always been) quite broken. Given that the whole section is
already in the flakes.txt, and there's no plan for improving this (I've tried
and fails), I'd rather just skip the section and reduce the noise in
the #panfrost-ci channel.

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

19 months agopanfrost: Handle null textures robustly
Alyssa Rosenzweig [Tue, 14 Mar 2023 02:58:56 +0000 (22:58 -0400)]
panfrost: Handle null textures robustly

This is really dumb.

But this fixes arb_shader_language_420pack-active-sampler-conflict on v7 which
otherwise dereferences a null pointer trying to access the nonexistant texture
arrays, or DATA_INVALID_FAULTs if you give it a texture array filled with
zeroes. But it seems happy if you bind in null textures. This is dumb but less
faults in Piglit is good for reducing flakes.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

19 months agopanfrost: Defeature 24-bit textures
Alyssa Rosenzweig [Tue, 14 Mar 2023 02:15:36 +0000 (22:15 -0400)]
panfrost: Defeature 24-bit textures

mesa/st doesn't like to use 24-bit textures, preferring RGBX over true RGB even
for texture views where this isn't valid. Given how silly true RGB is in
practice, I'd rather drop support and fix texture views than go against the
grain and risk more issues down the line since nobody else in tree is testing
these paths and apps really shouldn't be caring.

Fixes page faults in arb_texture_view-rendering-formats_gles3 which tries to
sample an R8G8B8_UINT texture with a R8G8B8X8_UNORM view in one subcase. That
test is now passing reliably.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

19 months agopanfrost: Assert that we don't see unsupported vertex formats
Alyssa Rosenzweig [Tue, 14 Mar 2023 02:12:46 +0000 (22:12 -0400)]
panfrost: Assert that we don't see unsupported vertex formats

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

19 months agopanfrost: Identify "Base vertex offset" signedness
Alyssa Rosenzweig [Tue, 14 Mar 2023 01:22:20 +0000 (21:22 -0400)]
panfrost: Identify "Base vertex offset" signedness

This is signed, not unsigned. We were already passing negatives and silently
relying on 2's complement and C to do the right thing. But that's silly. We
should just, actually do the right thing.

Found while struggling to debug primitive-restart-draw-mode.

v2: Update the other architectures too, including a decode_csf.c change for the
v10 incarnation of this v4-era field.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net> [v1]
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com> [v1]
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

19 months agopan/bi: Ignore signedness in vertex fetch
Alyssa Rosenzweig [Tue, 14 Mar 2023 02:31:28 +0000 (22:31 -0400)]
pan/bi: Ignore signedness in vertex fetch

We just want a bit-exact transfer for integers. Using .auto32 accomplishes this
without any clamping shenanigans. Fixes gl-3.0-vertexattribipointer.

Note we can't use .auto32 unconditionally, since reading a uint vertex as float
is supposed to convert (or something like that, gl-2.0-vertexattribpointer tests
the bad case at any rate).

Fixes: 482cc273af5 ("pan/bi: Implement load attribute with the builder")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

19 months agoutil/prim_convert: Don't set index_bounds_valid
Alyssa Rosenzweig [Tue, 14 Mar 2023 03:16:43 +0000 (23:16 -0400)]
util/prim_convert: Don't set index_bounds_valid

draw->index_bounds_valid tells drivers that the values of min_index/max_index
are set correctly and can be used e.g. to allocate memory for varyings. If set
incorrectly, the GL promises badness.

But, with primconvert, we go mucking with index buffers and then never update
the bounds. So it doesn't matter if the original index bounds were valid, we
can't promise the original bounds are *still* valid. If we were trying to
optimize CPU overhead, we could try to preserve the new min/max index but seeing
as only older Mali cares about this flag, and if you're using primconvert you're
already screwed, I'm not too inclined to go rework primconvert.

Fixes* page faults in primitive-restart-draw-mode on Mali-G52 for GL_QUAD_STRIPS
and GL_POLYGON, which hit the primconvert path. The full dmesg splat looks like:

[ 5438.811727] panfrost ffe40000.gpu: Unhandled Page fault in AS0 at VA 0x000000100A16BAC0
             Reason: TODO
             raw fault status: 0x25002C1
             decoded fault status: SLAVE FAULT
             exception type 0xC1: TRANSLATION_FAULT_1
             access type 0x2: READ
             source id 0x250

Notice that a high bit is randomly set in the address, this is trying to read
a varying from the actual varying buffer in the vicinity of 0xa16bac0. What's
actually happening is that we're trying to read index #0 despite promising the
driver a minimum index of 2, causing an integer underflow as we try to read
index -2, or as the hardware sees, 4294967294.

As long as we stop lying to panfrost about the bounds being correct, panfrost is
able to calculate the real (post-primconverted) bounds on its own, fixing the
test.

* Alternatively, maybe Panfrost should just ignore this bit, in which I don't
  know why we have it in Gallium, since it's probably not conformant to fault on
  out-of-range glDrawRangeElements.

Fixes: 72ff53098c6 ("gallium: add pipe_draw_info::index_bounds_valid")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21891>

19 months agozink: fix copy box iteration
Mike Blumenkrantz [Tue, 14 Mar 2023 17:32:49 +0000 (13:32 -0400)]
zink: fix copy box iteration

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

19 months agotu: don't set startup debug on debug builds
Mike Blumenkrantz [Thu, 9 Mar 2023 12:07:32 +0000 (07:07 -0500)]
tu: don't set startup debug on debug builds

this is incredibly annoying on normal linux systems

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

19 months agopvr: Fix segfaults when pDepthStencilAttachment is NULL
Jarred Davies [Tue, 31 Jan 2023 19:24:30 +0000 (19:24 +0000)]
pvr: Fix segfaults when pDepthStencilAttachment is NULL

depth_stencil_attachment has been changed from a pointer to the attachment idx
to just the attachment idx, as this avoids the driver having to check for NULL
when comparing attachments indexes with depth_stencil_attachment.

Anyplace that relies on depth_stencil_attachment being a valid index must
already check that depth_stencil_attachment is not VK_ATTACHMENT_UNUSED, so
this change avoids having to check both the pointer and the index for the same
information.

Noticed when running dEQP-VK.api.smoke.triangle

Signed-off-by: Jarred Davies <jarred.davies@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21690>

19 months agoci: group RESULT logic in a single place
Eric Engestrom [Mon, 6 Mar 2023 16:16:12 +0000 (16:16 +0000)]
ci: group RESULT logic in a single place

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

19 months agoci/rustfmt: print which files are checked
Eric Engestrom [Mon, 13 Mar 2023 19:32:29 +0000 (19:32 +0000)]
ci/rustfmt: print which files are checked

And how long that took, in case it ever becomes a problem.

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

19 months agoci/rustfmt: simplify getting all the rust files
Eric Engestrom [Mon, 13 Mar 2023 19:32:29 +0000 (19:32 +0000)]
ci/rustfmt: simplify getting all the rust files

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

19 months agoci: drop redundant .no_scheduled_pipelines-rules + .core-rules since the latter alrea...
Eric Engestrom [Mon, 13 Mar 2023 19:31:36 +0000 (19:31 +0000)]
ci: drop redundant .no_scheduled_pipelines-rules + .core-rules since the latter already includes it

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

19 months agoci/broadcom: move rare failure to the flakes
Eric Engestrom [Tue, 14 Mar 2023 14:38:09 +0000 (14:38 +0000)]
ci/broadcom: move rare failure to the flakes

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

19 months agovenus: make external fence and semaphore export async
Yiwei Zhang [Wed, 8 Mar 2023 03:49:31 +0000 (19:49 -0800)]
venus: make external fence and semaphore export async

This also makes vn_QueueSignalReleaseImageANDROID async since it makes
use of a queue submit followed by an external fence export internally.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: refactor to add vn_sync_payload_external
Yiwei Zhang [Wed, 8 Mar 2023 01:53:28 +0000 (17:53 -0800)]
venus: refactor to add vn_sync_payload_external

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: make common wsi bo submission async
Yiwei Zhang [Sun, 5 Mar 2023 05:24:34 +0000 (21:24 -0800)]
venus: make common wsi bo submission async

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: let vn_instance_submit_command track ring seqno
Yiwei Zhang [Fri, 3 Mar 2023 01:13:55 +0000 (17:13 -0800)]
venus: let vn_instance_submit_command track ring seqno

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: make vn_instance_wait_roundtrip asynchronous
Yiwei Zhang [Fri, 3 Mar 2023 07:33:00 +0000 (23:33 -0800)]
venus: make vn_instance_wait_roundtrip asynchronous

vn_instance_roundtrip does 2 things:
1. vn_instance_submit_roundtrip
   - before: encode a cmd to write vq seqno to ring extra field
   - after: encode a cmd to update vq seqno against a ring
   - submit the encoded cmd via vq
2. vn_instance_wait_roundtrip
   - before: wait until ring extra field has the vq seqno
   - after: let renderer ring thread wait for the vq seqno

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: switch to use 64bit roundtrip seqno
Yiwei Zhang [Mon, 13 Mar 2023 03:24:55 +0000 (20:24 -0700)]
venus: switch to use 64bit roundtrip seqno

This is to prepare for later async roundtrip waiting while seamlessly
compatible with legacy way.

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agovenus: sync to latest protocol for asyncRoundtrip
Yiwei Zhang [Wed, 8 Mar 2023 08:19:35 +0000 (00:19 -0800)]
venus: sync to latest protocol for asyncRoundtrip

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21716>

19 months agoci/valve-farm-rules: allow running jobs from outside the mesa namespace
Martin Roukala (né Peres) [Tue, 14 Mar 2023 09:36:15 +0000 (11:36 +0200)]
ci/valve-farm-rules: allow running jobs from outside the mesa namespace

This has been requested as it breaks the stress and uprev tools, so
the requirement was dropped in the Valve farms. This commit mirrors
the change in Mesa.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>

19 months agoci: bring back the valve farm online
Martin Roukala (né Peres) [Mon, 13 Mar 2023 12:36:06 +0000 (14:36 +0200)]
ci: bring back the valve farm online

All the farms have been updated, and the `out of files` error has been
fixed, and I also believe that the vast majority of the
`file could not be opened successfully` should also be fixed with this
update.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>

19 months agoci/b2c: move away from the hand-rolled initscript
Martin Roukala (né Peres) [Tue, 14 Mar 2023 07:51:20 +0000 (09:51 +0200)]
ci/b2c: move away from the hand-rolled initscript

Up until now, we have been handrolling part of the init-stage2.sh in
the b2c command line. Let's stop doing that and instead use the same
script as every other HW farms.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>

19 months agoci/init-stage2: always set XDG_RUNTIME_DIR
Martin Roukala (né Peres) [Tue, 14 Mar 2023 08:48:41 +0000 (10:48 +0200)]
ci/init-stage2: always set XDG_RUNTIME_DIR

This seems to be needed now that we compile mesa with wayland support.

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

19 months agoci/init-stage2: allow sourcing the job env vars from the CWD
Martin Roukala (né Peres) [Tue, 14 Mar 2023 08:17:48 +0000 (10:17 +0200)]
ci/init-stage2: allow sourcing the job env vars from the CWD

This will make it easier for the b2c jobs to use this script, as I
don't think I should extract the job folder to /.

Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21872>

19 months agozink: rename shadow key to zs swizzle
SoroushIMG [Mon, 27 Feb 2023 13:23:59 +0000 (13:23 +0000)]
zink: rename shadow key to zs swizzle

No functional change.

The shadow shader swizzle pass has been extended to optionally
include all z/s textures.
Rename the structs/variables to reflect this now.

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

19 months agozink: workaround undefined swizzle 1 for z/s textures
SoroushIMG [Sat, 25 Feb 2023 22:24:00 +0000 (22:24 +0000)]
zink: workaround undefined swizzle 1 for z/s textures

using swizzle 1 with z/s textures returns undefined data
on some Imagination hardware.
Work around this by using the same shader swizzling used for
shadow samplers.

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

19 months agozink: add depth/stencil needs shader swizzle workaround field
SoroushIMG [Fri, 24 Feb 2023 10:04:39 +0000 (10:04 +0000)]
zink: add depth/stencil needs shader swizzle workaround field

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

19 months agozink: extend shadow swizzle pass to all zs textures
SoroushIMG [Sun, 26 Feb 2023 17:48:53 +0000 (17:48 +0000)]
zink: extend shadow swizzle pass to all zs textures

if needs_zs_shader_swizzle is used, apply constant swizzles to all
depth/stencil textures and not just shadow samplers.

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

19 months agozink: add needs_zs_shader_swizzle shader key
SoroushIMG [Fri, 24 Feb 2023 13:55:12 +0000 (13:55 +0000)]
zink: add needs_zs_shader_swizzle shader key

This will be used later, but for now it should always be disabled.

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

19 months agozink: minor formatting change
SoroushIMG [Tue, 28 Feb 2023 10:09:46 +0000 (10:09 +0000)]
zink: minor formatting change

that line was becoming too long.

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

19 months agozink: track shadow swizzle for all shader stages
SoroushIMG [Sat, 25 Feb 2023 22:27:30 +0000 (22:27 +0000)]
zink: track shadow swizzle for all shader stages

this will be used later on to enable the pass in all
shader stages.

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

19 months agozink: fix shadow mask change logic when binding sampler views
SoroushIMG [Sat, 25 Feb 2023 22:19:49 +0000 (22:19 +0000)]
zink: fix shadow mask change logic when binding sampler views

First make sure shadow mask change sets dirty state.
Second move shadow mask bit removal to unbind_samplerview which
is cleaner and correctly clears the shadow bit when binding buffer texture.

Fixes: 5193f4f712b ("zink: add a fs shader key member to indicate depth texturing mode")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21571>

19 months agozink: fix stale point sprite mode state
SoroushIMG [Fri, 10 Mar 2023 16:24:46 +0000 (16:24 +0000)]
zink: fix stale point sprite mode state

Fixes: cf8ca77be10 ("zink: handle point sprite")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21840>

19 months agozink: super reorder buffer copies
Mike Blumenkrantz [Mon, 27 Feb 2023 22:56:09 +0000 (17:56 -0500)]
zink: super reorder buffer copies

usually zink_get_cmdbuf() is enough for reordering operations, but
with new technology, it becomes possible to promote even the most stubborn
buffers to the unordered cmdbuf

first, check the src buffer to ensure that there's no pending writes in
the main cmdbuf that would prohibit reordering

second, apply a TRANSFER_DST to the dst buffer using the util function
to determine whether it can be reordered

if both the src and dst can be reordered for their respective regions
and read/write usage, then the entire op can be promoted regardless of
the unordered_read/unordered_write flags

this optimizes out patterns like
upload index buffer (offset=0)
draw
upload index buffer (offset=128)
draw
upload index buffer (offset=256)
draw
...

so that the uploads and draws can be separated and batched

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

19 months agozink: rename zink_check_transfer_dst_barrier()
Mike Blumenkrantz [Thu, 9 Mar 2023 12:11:07 +0000 (07:11 -0500)]
zink: rename zink_check_transfer_dst_barrier()

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

19 months agozink: unify image TRANSFER_DST barrier checks
Mike Blumenkrantz [Tue, 28 Feb 2023 18:19:36 +0000 (13:19 -0500)]
zink: unify image TRANSFER_DST barrier checks

this should be consistent with buffers

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

19 months agozink: return the unordered state from zink_resource_buffer_transfer_dst_barrier()
Mike Blumenkrantz [Mon, 27 Feb 2023 22:52:16 +0000 (17:52 -0500)]
zink: return the unordered state from zink_resource_buffer_transfer_dst_barrier()

convenience usage

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

19 months agozink: rework zink_resource::valid_buffer_range
Mike Blumenkrantz [Tue, 28 Feb 2023 00:39:48 +0000 (19:39 -0500)]
zink: rework zink_resource::valid_buffer_range

this is now the valid buffer region for the "main" command buffer,
and all transfer ops store their regions in the copy boxes

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

19 months agoci: fix LVP_POISON_MEMORY usage
Mike Blumenkrantz [Fri, 10 Mar 2023 19:20:10 +0000 (14:20 -0500)]
ci: fix LVP_POISON_MEMORY usage

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

19 months agolavapipe: beef up LVP_POISON_MEMORY
Mike Blumenkrantz [Thu, 9 Mar 2023 15:29:42 +0000 (10:29 -0500)]
lavapipe: beef up LVP_POISON_MEMORY

this makes lavapipe behave more like a tiler and completely annihilate
any existing data for DONTCARE load/store ops

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

19 months agovulkan/wsi: add a headless swapchain implementation/option
Lionel Landwerlin [Mon, 3 Aug 2020 10:05:09 +0000 (13:05 +0300)]
vulkan/wsi: add a headless swapchain implementation/option

I wanted to find slow pieces of code in our Anv driver using our
drm-shim stub.

The last bit of code still talking to the compositor was the WSI
swapchain code and failing because none of the submissions are taking
place (because of the stub).

This change introduces a new variable MESA_VK_WSI_HEADLESS_SWAPCHAIN
which when set turns every swapchain creation into a headless
swapchain. This swapchain does not present anything, allowing the
application to spin as many frames as possible. Thus helping to
identify slow spots in command buffer building path.

Signed-off-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/6156>

19 months agoanv: fix image height for field pictures.
Dave Airlie [Thu, 9 Mar 2023 05:23:04 +0000 (15:23 +1000)]
anv: fix image height for field pictures.

Fixes: 98c58a16ef1ab2 ("anv: add initial video decode support for h264.)
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21807>

19 months agointel/fs: fix subgroup invocation read bounds checking
Lionel Landwerlin [Fri, 10 Mar 2023 20:57:36 +0000 (22:57 +0200)]
intel/fs: fix subgroup invocation read bounds checking

nir->info.subgroup_size can be set to an enum :
  SUBGROUP_SIZE_VARYING = 0
  SUBGROUP_SIZE_UNIFORM = 1
  SUBGROUP_SIZE_API_CONSTANT = 2
  SUBGROUP_SIZE_FULL_SUBGROUPS = 3

So compute the API subgroup size value and compare it to the dispatch
size to determine whether we need some bound checking.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9ac192d79d ("intel/fs: bound subgroup invocation read to dispatch size")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21856>

19 months agoradv/rt: Fix any_hit scratch variables.
Daniel Schürmann [Mon, 13 Mar 2023 15:59:16 +0000 (16:59 +0100)]
radv/rt: Fix any_hit scratch variables.

We have to make sure not to change call_data locations as well.

Fixes: 481f78ab93e2f2169c53a7c8494b488d45b60def ('radv/rt: place any-hit scratch vars after intersection scratch vars')
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21876>

19 months agoci: Re-enable some swrast testing using fd.o's shared runners for now.
Emma Anholt [Mon, 13 Mar 2023 17:59:25 +0000 (10:59 -0700)]
ci: Re-enable some swrast testing using fd.o's shared runners for now.

I'm not planning to stand mesa-swrast back up until we get Kata set up, so
turn the testing back on at a reduced fraction on so that
venus/llvmpipe/etc. dev can still get some coverage.

I haven't turned lavapipe back on, because it is now unstable in memory
model / atomics tests.

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

19 months agointel/fs: prevent large vector ops generated by peephole_ffma
Lionel Landwerlin [Thu, 9 Mar 2023 10:12:54 +0000 (12:12 +0200)]
intel/fs: prevent large vector ops generated by peephole_ffma

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>

19 months agointel/fs: add MOV source count validation
Lionel Landwerlin [Tue, 7 Mar 2023 16:02:03 +0000 (18:02 +0200)]
intel/fs: add MOV source count validation

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>

19 months agointel/fs: fixup sources number from opt_algebraic
Lionel Landwerlin [Tue, 7 Mar 2023 15:54:16 +0000 (17:54 +0200)]
intel/fs: fixup sources number from opt_algebraic

Fixes issues with register_coalesce :

fossilize-replay: brw_fs_register_coalesce.cpp:297: bool fs_visitor::register_coalesce(): Assertion `mov[i]->sources == 1' failed.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>

19 months agointel/fs: fix nir_opt_peephole_ffma max vec assumption
Lionel Landwerlin [Tue, 7 Mar 2023 11:08:36 +0000 (13:08 +0200)]
intel/fs: fix nir_opt_peephole_ffma max vec assumption

There can be larger vec than vec4.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21782>

19 months agointel/fs: don't SEND messages as partial writes
Lionel Landwerlin [Fri, 10 Mar 2023 14:11:56 +0000 (16:11 +0200)]
intel/fs: don't SEND messages as partial writes

For instance, to load uniform data with the LSC we usually rely on
tranpose messages which have to execute in SIMD1. Those end up being
considered as partial writes so within loops their life span spread to
the whole loop, increasing register pressure.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21867>

19 months agoanv: more formats for acceleration structure vertices
Lionel Landwerlin [Thu, 9 Mar 2023 15:34:17 +0000 (17:34 +0200)]
anv: more formats for acceleration structure vertices

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21821>

19 months agoanv/video: disable picture id reampping.
Dave Airlie [Mon, 20 Feb 2023 19:59:41 +0000 (05:59 +1000)]
anv/video: disable picture id reampping.

This isn't needed at the hw level with vulkan

Fixes: 98c58a16ef1a ("anv: add initial video decode support for h264.")
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>

19 months agoanv/video: fix chroma qp to be a integer value.
Dave Airlie [Mon, 20 Feb 2023 03:38:45 +0000 (13:38 +1000)]
anv/video: fix chroma qp to be a integer value.

This is just a cleanup to the genxml

Fixes: 98c58a16ef1a ("anv: add initial video decode support for h264.")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21433>

19 months agolavapipe: add command debugging
Mike Blumenkrantz [Fri, 15 Jul 2022 14:23:15 +0000 (10:23 -0400)]
lavapipe: add command debugging

I keep adding this in locally. it's great for debugging

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

19 months agolavapipe: set render_condition_enabled=false for vkCmdClearDepthStencilImage
Mike Blumenkrantz [Thu, 9 Mar 2023 14:32:34 +0000 (09:32 -0500)]
lavapipe: set render_condition_enabled=false for vkCmdClearDepthStencilImage

this command ignores conditional rendering

fixes:
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_host_memory_secondary_buffer_inherited_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_expect_noop_inverted
dEQP-VK.conditional_rendering.conditional_ignore.clear_condition_local_memory_secondary_buffer_inherited_expect_noop

Fixes: fe53c222949 ("lavapipe: fix only clearing depth or stencil paths.")

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

19 months agolavapipe: fix dynamic depth clamping
Mike Blumenkrantz [Thu, 9 Mar 2023 13:53:43 +0000 (08:53 -0500)]
lavapipe: fix dynamic depth clamping

on pipeline bind with dynamic state, depth_clip_near needs to either be set by
* applying the dynamic state
* using the pipeline state

the previous code always used the pipeline state

fixes:
dEQP-VK.pipeline.*.extended_dynamic_state.between_pipelines.depth_clamp_enable

Fixes: 650880105e6 ("vulkan,lavapipe: Use a tri-state enum for depth clip enable")

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

19 months agoci: uprev virglrenderer and crosvm
Corentin Noël [Wed, 8 Mar 2023 16:15:46 +0000 (17:15 +0100)]
ci: uprev virglrenderer and crosvm

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

19 months agodocs: update Anv features support
Lionel Landwerlin [Mon, 13 Mar 2023 11:59:07 +0000 (13:59 +0200)]
docs: update Anv features support

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>

19 months agoanv: export EXT_pipeline_library_group_handles only with RT
Lionel Landwerlin [Mon, 13 Mar 2023 12:00:50 +0000 (14:00 +0200)]
anv: export EXT_pipeline_library_group_handles only with RT

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21870>

19 months agobroadcom/ci: no need to skip the tests that swap buffers anymore
Eric Engestrom [Mon, 13 Mar 2023 12:05:09 +0000 (12:05 +0000)]
broadcom/ci: no need to skip the tests that swap buffers anymore

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>

19 months agoci: disable weston session timeout
Eric Engestrom [Mon, 13 Mar 2023 10:58:45 +0000 (10:58 +0000)]
ci: disable weston session timeout

    -iN, --idle-time=N
           Set  the idle timeout to N seconds. The default timeout is
           300 seconds. When there has not been any user input for the idle
           timeout, Weston enters an inactive mode. The screen fades to black,
           monitors may switch off, and the shell may lock the session.
           A value of 0 effectively disables the timeout.

We don't want the session to get locked and monitors to switch off while tests
are running, as many of them depend on swapping buffers.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21877>

19 months agoaux/tc: use renderpass tracking to optimize texture_subdata calls
Mike Blumenkrantz [Wed, 8 Mar 2023 21:42:28 +0000 (16:42 -0500)]
aux/tc: use renderpass tracking to optimize texture_subdata calls

if it's known that a renderpass is active and the driver wants to do
renderpass optimizing, help out by not forcing a sync and instead doing
what the driver would do: create a staging buffer and copy it to the
image

this requires that the driver already handles buffer -> image copies
with resource_copy_region

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

19 months agoradv/sqtt: Skip dumping pipeline libraries
Konstantin Seurer [Sat, 11 Mar 2023 12:32:44 +0000 (13:32 +0100)]
radv/sqtt: Skip dumping pipeline libraries

They don't have any shaders which can lead to crashes when dumping
them.

Fixes: 2e04aeb ("radv: capture RT pipelines from the SQTT layer")
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21852>

19 months agotu: fix tu_GetInstanceProcAddr not handling null instance
Mark Collins [Thu, 9 Mar 2023 23:50:57 +0000 (23:50 +0000)]
tu: fix tu_GetInstanceProcAddr not handling null instance

It is legal to pass in nullptr as an instance into
vkGetInstanceProcAddr when resolving any global addresses, this
wasn't handled correctly and an illegal access to a member of
a null struct was made.

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21827>

19 months agotu: KGSL backend rewrite
Mark Collins [Tue, 28 Feb 2023 11:45:08 +0000 (11:45 +0000)]
tu: KGSL backend rewrite

This commit rewrites the KGSL backend to utilize vk common wherever
possible to bring the codebase in line with DRM while implicitly
fixing minor API bugs that may have occurred as a result of manually
implementing VK functions.

As a part of moving to vk common, KGSL sync is now implemented
atop vk common sync and vastly expanded in terms of functionality
such as:
* Import/Export of sync FDs - A required capability for properly
  supporting the Android WSI and as these functions were stubbed
  when a presentation operation used semaphores, it would cause a
  leak of FDs that were imported due to the expectation that the
  driver would close them. As well as causing UB around due to
  ignoring the imported FD or not exporting a valid FD.
* Supporting pre-signalled fences - Vulkan allows fences to be
  created in a signalled state which was stubbed prior and can
  lead to UB.
* Timeline semaphore support - As a result of utilizing vk common
  as the backbone for synchronization, its timeline semaphore
  emulation has been utilized to provide support for them without
  needing kernel support. (Note: On newer versions of KGSL,
  timeline semaphores can be implemented natively rather than
  using emulation as they support wait-before-signal)

Fixes freezes due to semaphore usage with presentation on:
* Genshin Impact
* Skyline Emulator

Signed-off-by: Mark Collins <mark@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21651>

19 months agoRevert "driconf: add a workaround for plasmashell freezing"
Pierre-Eric Pelloux-Prayer [Tue, 24 Jan 2023 20:44:24 +0000 (21:44 +0100)]
Revert "driconf: add a workaround for plasmashell freezing"

This reverts commit 41eb491fb6460f401a4c845fc28a53de92e9075b.

The underlying issue was fixed by the previous commit.

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

19 months agoyegl/wayland: fix glthread deadlocks
Pierre-Eric Pelloux-Prayer [Tue, 24 Jan 2023 20:42:49 +0000 (21:42 +0100)]
yegl/wayland: fix glthread deadlocks

We need to make sure that glthread is idle before using wl_*
functions or they might be used from 2 threads at the same
time.

Thanks to @deltib for the investigation of this issue.

Fixes: 58f90fd03f4 ("egl/wayland: fix glthread crashes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8136
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20887>

19 months agoci/panfrost: Add texturesize flake seen in the wild
Daniel Stone [Mon, 13 Mar 2023 15:05:15 +0000 (15:05 +0000)]
ci/panfrost: Add texturesize flake seen in the wild

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

19 months agofreedreno/a6xx: Simplify iova emit
Rob Clark [Sat, 4 Mar 2023 19:03:36 +0000 (11:03 -0800)]
freedreno/a6xx: Simplify iova emit

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

19 months agofreedreno/register: Define chip enum values
Danylo Piliaiev [Fri, 3 Mar 2023 13:10:19 +0000 (14:10 +0100)]
freedreno/register: Define chip enum values

Otherwise it cannot be used in templates

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21846>

19 months agofreedreno/registers: Define rest of CP_REG_WRITE
Rob Clark [Tue, 7 Mar 2023 15:52:36 +0000 (07:52 -0800)]
freedreno/registers: Define rest of CP_REG_WRITE

Enough that we can use OUT_PKT() to emit it, which will be needed when
we use it to write regs that are different btwn a6xx and a7xx.

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

19 months agofreedreno/registers: Fix nameless fields
Rob Clark [Mon, 6 Mar 2023 18:35:22 +0000 (10:35 -0800)]
freedreno/registers: Fix nameless fields

Originally if we had an anonymous field (ie. field declared as part of
the register definition itself) the name in the generated field struct
would include the gen prefix (ie. .a6xx_rb_stencil_buffer_pitch), but
this doesn't work for variants because the variant regs would have
different gen prefixes.  Fix this by using reg name instead of the
full_name.

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

19 months agofreedreno/registers: Add c++ magic for register variants
Rob Clark [Thu, 2 Mar 2023 19:18:05 +0000 (11:18 -0800)]
freedreno/registers: Add c++ magic for register variants

For regs with multiple variants, generate a template'ized function to
pack the reg value.  If the template param is known at compile time
(which is the expected usage) this will optimize to the same thing as
the "traditional" reg packing.

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

19 months agofreedreno/registers: Split out regpair builder helper
Rob Clark [Thu, 2 Mar 2023 19:17:06 +0000 (11:17 -0800)]
freedreno/registers: Split out regpair builder helper

We are going to want to re-use this in the next commit.

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

19 months agofreedreno/registers: Track varset
Rob Clark [Wed, 1 Mar 2023 23:17:57 +0000 (15:17 -0800)]
freedreno/registers: Track varset

Track varset and assert that variants refer to a valid varset enum
value.  This adds a bit of extra sanity checking, but becomes more
useful in the next commit.

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

19 months agofreedreno/registers: Start adding stuff for a7xx
Rob Clark [Wed, 3 Aug 2022 14:56:35 +0000 (07:56 -0700)]
freedreno/registers: Start adding stuff for a7xx

Start adding the bits needed for userspace.

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

19 months agofreedreno/decode: Start adding a7xx support
Rob Clark [Tue, 2 Aug 2022 22:51:53 +0000 (15:51 -0700)]
freedreno/decode: Start adding a7xx support

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

19 months agofreedreno/registers: Start adding a7xx pipe/control regs
Rob Clark [Tue, 2 Aug 2022 22:39:32 +0000 (15:39 -0700)]
freedreno/registers: Start adding a7xx pipe/control regs

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

19 months agofreedreno/registers: Merge a6xx and a7xx regs
Rob Clark [Sat, 23 Jul 2022 22:14:22 +0000 (15:14 -0700)]
freedreno/registers: Merge a6xx and a7xx regs

They have more similarities than differences, so merge them and use
"variant" attribute as needed to manage differences.

Note initially using "variant" conservatively when it comes to regs
known on a7xx but not a6xx.  It could be that they exist also on later
versions of a6xx as well, for example.  For ex, LPAC related regs/bits
likely existed on later a6xx (eg. a660 family) but BV stuff is not.

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

19 months agofreedreno/registers: Add prefix="variant"
Rob Clark [Tue, 2 Aug 2022 16:53:25 +0000 (09:53 -0700)]
freedreno/registers: Add prefix="variant"

To merge a7xx and a6xx regs, using variant property to manage the
differences, we'll want regs/etc to be named according to the first
generation it is use rather than the domain name.  Add a new prefix
type to accomplish this.  By default, if no variant property, things
will still be named based on domain (ie. REG_A6XX_...), and things
that have variant="A6XX" will also end up as they currently are
(since the chip enum matches domain name), but things that have
variant="A7XX" will end up as REG_A7XX_...

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

19 months agofreedreno/registers: Fix designator order
Rob Clark [Fri, 29 Jul 2022 18:44:16 +0000 (11:44 -0700)]
freedreno/registers: Fix designator order

C++ is picky about order matching for some reason.

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

19 months agofreedreno/a6xx: Convert to c++
Rob Clark [Sun, 17 Jul 2022 14:55:43 +0000 (07:55 -0700)]
freedreno/a6xx: Convert to c++

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

19 months agofreedreno/a6xx: Fix designator initializer order
Rob Clark [Sun, 5 Mar 2023 20:38:24 +0000 (12:38 -0800)]
freedreno/a6xx: Fix designator initializer order

Clang seems more relaxed about this, allowing C99 style initializers
without requiring ordering.  But unfortunately g++ is more picky :-/

TODO this doesn't completely fix everything with g++, namely sparse
array initialization.. for ir3 driver-params, I think we can convert
these to structs.  But there are still one or two others to deal with.

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

19 months agofreedreno/a6xx: Add missing "inline"
Rob Clark [Sun, 26 Feb 2023 17:59:33 +0000 (09:59 -0800)]
freedreno/a6xx: Add missing "inline"

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

19 months agofreedreno/a6xx: Rework texture_clear fallback
Rob Clark [Sun, 26 Feb 2023 17:57:24 +0000 (09:57 -0800)]
freedreno/a6xx: Rework texture_clear fallback

C++ is more picky about a goto jumping over variable initialization,
even if unused after the goto label (presumably because of destructors
that can be called after a variable goes out of scope).  Since there is
only a single fallback path, get rid of the goto.

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

19 months agofreedreno: c++-proofing
Rob Clark [Sun, 17 Jul 2022 18:04:54 +0000 (11:04 -0700)]
freedreno: c++-proofing

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

19 months agofreedreno: Un-inline buffer-mask enum
Rob Clark [Sat, 25 Feb 2023 17:28:16 +0000 (09:28 -0800)]
freedreno: Un-inline buffer-mask enum

Also, fix obsolete comment.

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

19 months agofreedreno/ir3: Add missing driver params
Rob Clark [Mon, 6 Mar 2023 16:02:14 +0000 (08:02 -0800)]
freedreno/ir3: Add missing driver params

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

19 months agofreedreno/ir3+tu: Calculate subgroup size in ir3
Rob Clark [Mon, 6 Mar 2023 15:59:19 +0000 (07:59 -0800)]
freedreno/ir3+tu: Calculate subgroup size in ir3

TBD if the size changes for a7xx, but at least let's have it in one
place instead of duplicating in turnip and gallium.

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

19 months agofreedreno/ir3: c++-proof the headers
Rob Clark [Sun, 17 Jul 2022 17:12:11 +0000 (10:12 -0700)]
freedreno/ir3: c++-proof the headers

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

19 months agofreedreno/ir3: Don't use negative opc for meta instructions
Rob Clark [Fri, 5 Aug 2022 16:39:18 +0000 (09:39 -0700)]
freedreno/ir3: Don't use negative opc for meta instructions

Stricter compilers complain about this, ie:

  error: left operand of shift expression ‘(-1 << 7)’ is negative [-fpermissive]

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

19 months agofreedreno/ir3: Un-inline enums
Rob Clark [Sun, 17 Jul 2022 16:20:09 +0000 (09:20 -0700)]
freedreno/ir3: Un-inline enums

It seems to be a thing that c++ dislikes

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

19 months agofreedreno: Quiet c++ warning about designated initializers
Rob Clark [Sun, 17 Jul 2022 15:12:41 +0000 (08:12 -0700)]
freedreno: Quiet c++ warning about designated initializers

And various other things that c++ is more strict about.  Perhaps we
re-instate a few of the more reasonable warnings over time.

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