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

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

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

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

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

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

No foz-db changes.

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

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

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

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

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

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

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

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

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

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

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

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

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

2 years agov3dv/pipeline: include pipeline layout on the pipeline sha1
Alejandro Piñeiro [Tue, 3 May 2022 10:48:10 +0000 (12:48 +0200)]
v3dv/pipeline: include pipeline layout on the pipeline sha1

Fixes failures on tests like this when the on-disk-cache is enabled:
dEQP-VK.binding_model.descriptor_copy.compute.uniform_buffer_0

We only found them when running full CTS runs. What happens is that we
got a hit from the on-disk shader cache, for several tests using the
same shaders. But some tests seems to be using a uniform buffer, and
others a inline buffer. Right now inline buffers leads to some changes
on the final nir shader, and generated assembly, compared with uniform
buffers. So we got a wrong shader. Fortunately we only got an assert
instead of weird behaviour.

With this commit we include the pipeline layout on the pipeline sha1,
so those two cases would get different sha1. FWIW, this is what other
drivers are already doing.

Surprisingly that didn't cause a problem before.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline_cache: add on disk cache hit stats
Alejandro Piñeiro [Tue, 3 May 2022 11:10:30 +0000 (13:10 +0200)]
v3dv/pipeline_cache: add on disk cache hit stats

Useful when debugging/testing on disk cache.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline_cache: adds check to skip searching for a entry
Alejandro Piñeiro [Tue, 3 May 2022 11:03:54 +0000 (13:03 +0200)]
v3dv/pipeline_cache: adds check to skip searching for a entry

If we are calling pipeline_cache_upload_shared_data with
from_disk_cache, that means that we had used the disk-cache to found
that entry. And that should only happens if we didn't find the entry
on the cache. So on that case we can skip to search for it.

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agov3dv/pipeline: fix small comment typo
Alejandro Piñeiro [Tue, 3 May 2022 10:57:15 +0000 (12:57 +0200)]
v3dv/pipeline: fix small comment typo

Reviewed-by: Juan A. Suarez <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16313>

2 years agointel/dev: sync ADL-S pci ids with linux
Jonathan Gray [Wed, 4 May 2022 06:52:08 +0000 (16:52 +1000)]
intel/dev: sync ADL-S pci ids with linux

sync ADL-S pci ids with linux
c79b846f892d ("drm/i915/adl_s: Update ADL-S PCI IDs")

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

2 years agov3d: disable early-Z on odd frame dimensions
Juan A. Suarez Romero [Tue, 19 Apr 2022 14:53:20 +0000 (16:53 +0200)]
v3d: disable early-Z on odd frame dimensions

The early-Z buffer may load incorrect depth values if the frame has an
od width or height. In this case we need to disable early-Z.

v3:
 - Set job->early_zs_clear only for V3D_VERSION >= 40 (Iago)
 - Check early-Z is disabled if no zsbuf (Iago)

v4:
 - Borrow comments from v3dv around v3d_update_job_ez() (Iago)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/3557
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16166>

2 years agov3d: enable early Z/S clears
Juan A. Suarez Romero [Tue, 19 Apr 2022 14:52:44 +0000 (16:52 +0200)]
v3d: enable early Z/S clears

This performance optimization can be enabled if we are clearing Z/S
buffer, and not storing or loading it.

v2:
 - Add assertion on depth/stencil job loads (Iago)

Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16166>

2 years agowgl: don't auto-load zink before software drivers
Mike Blumenkrantz [Tue, 3 May 2022 19:12:45 +0000 (15:12 -0400)]
wgl: don't auto-load zink before software drivers

as in glx/egl, zink+lavapipe should only load if explicitly selected

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

2 years agozink: use VK_EXT_primitives_generated_query when available
Mike Blumenkrantz [Mon, 2 May 2022 12:58:25 +0000 (08:58 -0400)]
zink: use VK_EXT_primitives_generated_query when available

the old codepath must be maintained, but runtime will be far simpler

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

2 years agozink: add a flag to zink_query to trigger rasterizer discard workaround
Mike Blumenkrantz [Mon, 2 May 2022 13:05:29 +0000 (09:05 -0400)]
zink: add a flag to zink_query to trigger rasterizer discard workaround

make this agnostic of query types; no functional changes

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

2 years agozink: add and use a function to detected emulated primgen queries
Mike Blumenkrantz [Mon, 2 May 2022 12:53:57 +0000 (08:53 -0400)]
zink: add and use a function to detected emulated primgen queries

no functional changes, just reducing instances of PIPE_QUERY_PRIMITIVES_GENERATED

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

2 years agozink: pass screen param to convert_query_type()
Mike Blumenkrantz [Mon, 2 May 2022 12:53:00 +0000 (08:53 -0400)]
zink: pass screen param to convert_query_type()

no functional changes

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

2 years agozink: pass query object to get_num_results()
Mike Blumenkrantz [Mon, 2 May 2022 12:36:42 +0000 (08:36 -0400)]
zink: pass query object to get_num_results()

no functional changes

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

2 years agozink: pass query object to get_num_query_pools()
Mike Blumenkrantz [Mon, 2 May 2022 12:35:07 +0000 (08:35 -0400)]
zink: pass query object to get_num_query_pools()

no functional changes

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

2 years agozink: pass query object to get_num_queries()
Mike Blumenkrantz [Mon, 2 May 2022 12:31:45 +0000 (08:31 -0400)]
zink: pass query object to get_num_queries()

no functional changes

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

2 years agozink: hook up VK_EXT_primitives_generated_query
Mike Blumenkrantz [Mon, 2 May 2022 12:24:33 +0000 (08:24 -0400)]
zink: hook up VK_EXT_primitives_generated_query

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

2 years agogallivm: use VPERMPS (x86/AVX2) for 32-bit 8-element shuffles
Autumn on Tape [Fri, 1 Apr 2022 20:03:40 +0000 (13:03 -0700)]
gallivm: use VPERMPS (x86/AVX2) for 32-bit 8-element shuffles

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agogallivm: use shufflevector for shuffles when index is constant data
Autumn on Tape [Fri, 1 Apr 2022 20:03:30 +0000 (13:03 -0700)]
gallivm: use shufflevector for shuffles when index is constant data

This checks if index is a ConstantAggregateZero, ConstantDataSequential,
or UndefValue and emits a single shufflevector instead of a loop if so.

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agolavapipe: enable subgroup shuffle operations
Autumn on Tape [Fri, 1 Apr 2022 20:03:20 +0000 (13:03 -0700)]
lavapipe: enable subgroup shuffle operations

Bits flipped in VkPhysicalDeviceSubgroupProperties.supportedOperations:
  * SUBGROUP_FEATURE_SHUFFLE_BIT
  * SUBGROUP_FEATURE_SHUFFLE_RELATIVE_BIT

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agogallivm: add subgroup shuffle support
Autumn on Tape [Fri, 1 Apr 2022 20:02:55 +0000 (13:02 -0700)]
gallivm: add subgroup shuffle support

Signed-off-by: Autumn on Tape <autumn@cyfox.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13671>

2 years agonir: Don't assert on tg4 offset range.
Emma Anholt [Sat, 30 Apr 2022 14:40:59 +0000 (07:40 -0700)]
nir: Don't assert on tg4 offset range.

From the GL 4.6 spec: "If the value of any non-ignored component of the
offset vector operand is outside implementation-dependent limits, the
results of the texture lookup are undefined."  We shouldn't assertion
fail, then.

GLSL-to-NIR shouldn't be enforcing limits on TG4 offsets, since it doesn't
for non-TG4 tex_src_offset either.  Leave it up to the driver to handle
it.

Fixes a crash in a piglit test on nouveau that supplies a negative random
number up to 10,000 as the first coordinate for some reason.  Other NIR
drivers lowered TG4 explicit offsets to tex_src_offset, so they weren't
affected.

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

2 years agowgl: always set alpha on kopper windows
Mike Blumenkrantz [Mon, 25 Apr 2022 20:02:14 +0000 (16:02 -0400)]
wgl: always set alpha on kopper windows

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

2 years agoutil: fix test on msvc
Erik Faye-Lund [Tue, 3 May 2022 08:41:05 +0000 (10:41 +0200)]
util: fix test on msvc

We also miss this function on MSVC. But let's use the functionality in
meson to check for supported functions instead of hand-rolling the list
here.

Fixes: 067023dce2c ("util: Add some unit tests of the half-float conversions.")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Reviewed-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16290>

2 years agonir: Don't set writes_memory for reading XFB
Alyssa Rosenzweig [Mon, 2 May 2022 17:59:55 +0000 (13:59 -0400)]
nir: Don't set writes_memory for reading XFB

That's a read, not a write. Fixes optimizations getting disabled for fragment
shaders when linked with a shader producing transform feedback varyings.

Fixes: 85a723975bb ("nir: add and gather shader_info::writes_memory")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16285>

2 years agonir: Eliminate out-of-bounds read/writes in local lowering.
Emma Anholt [Wed, 20 Apr 2022 21:31:50 +0000 (14:31 -0700)]
nir: Eliminate out-of-bounds read/writes in local lowering.

Avoids nir validation assertion failures, and it's not like backend
drivers would want to see definitely-out-of-bounds read/writes either.

Reviewed-by: Matt Turner <mattst88@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16066>

2 years agoci: traces: re-enable disabled traces which are now trimmed traces
David Heidelberg [Mon, 2 May 2022 07:01:22 +0000 (09:01 +0200)]
ci: traces: re-enable disabled traces which are now trimmed traces

After checksum mismatch, visually verified both re-enabled traces and
updated checksums for virgl-traces job.

Suggested-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16260>

2 years agoci: traces: switch to Valve trimmed traces
David Heidelberg [Sat, 30 Apr 2022 12:31:01 +0000 (14:31 +0200)]
ci: traces: switch to Valve trimmed traces

Valve has trimmed traces already for some time, switch to
them to save network bandwidth, storage and run-time.

Reviewed-by: Emma Anholt <emma@anholt.net>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16260>

2 years agopan/bi: Use a dynarray for predecessors
Alyssa Rosenzweig [Tue, 19 Apr 2022 22:58:27 +0000 (18:58 -0400)]
pan/bi: Use a dynarray for predecessors

This is deterministic, unlike a set. Note we need the extra dereferencing to
keep the macro safe, simple, and standards compliant:

1. Nesting two for-loops would cause break/continue to fail.
2. Declaring variables outside the loop would pollute the namespace.
3. Declaring an anonymous struct is not conformant and doesn't compile in clang.

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

2 years agopan/bi: Use worklist for scoreboard analysis
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:08:44 +0000 (14:08 -0400)]
pan/bi: Use worklist for scoreboard analysis

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

2 years agopan/bi: Use bi_worklist for post-RA liveness
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:06:09 +0000 (14:06 -0400)]
pan/bi: Use bi_worklist for post-RA liveness

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

2 years agopan/bi: Use bi_worklist for liveness
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:04:20 +0000 (14:04 -0400)]
pan/bi: Use bi_worklist for liveness

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

2 years agopan/bi: Use bi_worklist in analyze_helper_requirements
Alyssa Rosenzweig [Tue, 19 Apr 2022 17:35:19 +0000 (13:35 -0400)]
pan/bi: Use bi_worklist in analyze_helper_requirements

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

2 years agopan/bi: Add u_worklist wrapper macros
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:00:10 +0000 (14:00 -0400)]
pan/bi: Add u_worklist wrapper macros

..expanding to bi_block.

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

2 years agopan/bi: Count blocks
Alyssa Rosenzweig [Tue, 19 Apr 2022 18:00:01 +0000 (14:00 -0400)]
pan/bi: Count blocks

For u_worklist.

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

2 years agopan/bi: Rename bi_block->name to bi_block->index
Alyssa Rosenzweig [Tue, 19 Apr 2022 17:59:31 +0000 (13:59 -0400)]
pan/bi: Rename bi_block->name to bi_block->index

This is consistent with nir_block and (IMO) less confusing.

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

2 years agodocs: explain state emission in Anv
Lionel Landwerlin [Fri, 29 Apr 2022 21:16:20 +0000 (00:16 +0300)]
docs: explain state emission in Anv

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: remove static_state_mask
Lionel Landwerlin [Thu, 28 Apr 2022 07:54:27 +0000 (10:54 +0300)]
anv: remove static_state_mask

This is now unnecessary. Either an instruction is never dynamic and
it's emitted in genX_pipeline.c or it can be and it's emitted in
genX_cmd_buffer.c/gfx8_cmd_buffer/gfx7_cmd_buffer.c

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: don't emit 3DSTATE_VF_TOPOLOGY in pipeline batch
Lionel Landwerlin [Thu, 28 Apr 2022 08:35:35 +0000 (11:35 +0300)]
anv: don't emit 3DSTATE_VF_TOPOLOGY in pipeline batch

v2: drop primitive_topology = 0xffffffff (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: don't emit 3DSTATE_DEPTH_BOUNDS in pipeline batch
Lionel Landwerlin [Thu, 28 Apr 2022 07:42:44 +0000 (10:42 +0300)]
anv: don't emit 3DSTATE_DEPTH_BOUNDS in pipeline batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: don't emit 3DSTATE_BLEND_STATE_POINTERS in pipeline batch
Lionel Landwerlin [Wed, 27 Apr 2022 21:12:52 +0000 (00:12 +0300)]
anv: don't emit 3DSTATE_BLEND_STATE_POINTERS in pipeline batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: don't emit 3DSTATE_WM in pipeline batch
Lionel Landwerlin [Thu, 28 Apr 2022 06:26:39 +0000 (09:26 +0300)]
anv: don't emit 3DSTATE_WM in pipeline batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: don't emit 3DSTATE_STREAMOUT in pipeline batch
Lionel Landwerlin [Thu, 28 Apr 2022 06:23:23 +0000 (09:23 +0300)]
anv: don't emit 3DSTATE_STREAMOUT in pipeline batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: never emit 3DSTATE_CPS in the pipeline batch
Lionel Landwerlin [Thu, 28 Apr 2022 06:15:02 +0000 (09:15 +0300)]
anv: never emit 3DSTATE_CPS in the pipeline batch

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: rework sample location
Lionel Landwerlin [Wed, 27 Apr 2022 20:44:40 +0000 (23:44 +0300)]
anv: rework sample location

On Gfx7 we can only give the sample location for a given multisample
number. This means everytime the multisampling value changes, we have
to re-emit the locations. It's fine because it's also where
(3DSTATE_MULTISAMPLE) the number of samples is stored.

On Gfx8+ though, 3DSTATE_MULTISAMPLE only holds the number of samples
and all the sample locations for all number of samples are located in
3DSTATE_SAMPLE_PATTERN. So to be more effecient there, we need to
track the locations for all sample numbers and compare new values with
the relevant sample count when touching the dynamic state.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoRevert "anv: fix dynamic state emission"
Lionel Landwerlin [Wed, 27 Apr 2022 19:38:28 +0000 (22:38 +0300)]
Revert "anv: fix dynamic state emission"

This reverts commit f348103fce4484b891a58bf3147b71e3a3558135. The
change was causing performance regressions.

Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: add missing logic op set in pipeline dyn state
Lionel Landwerlin [Fri, 29 Apr 2022 20:08:42 +0000 (23:08 +0300)]
anv: add missing logic op set in pipeline dyn state

v2: add ANV_CMD_DIRTY_DYNAMIC_LOGIC_OP check (Tapani)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 75ad0e4b0874 ("anv: support blending logic op dynamic state")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agoanv: reset all dynamic state after secondary execution
Lionel Landwerlin [Thu, 28 Apr 2022 10:15:53 +0000 (13:15 +0300)]
anv: reset all dynamic state after secondary execution

We don't know in what state the secondary buffer will leave the HW
when it ends. It's easier to consider everything needs to be reemitted
for now.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16220>

2 years agosrc/util/futex.h: fix build on 32-bit architectures using 64-bit time_t
Fabrice Fontaine [Sat, 21 Aug 2021 15:55:33 +0000 (17:55 +0200)]
src/util/futex.h: fix build on 32-bit architectures using 64-bit time_t

Fix the following build failure on 32-bit architectures using 64-bit
time_t (e.g. riscv32):

../src/util/futex.h: In function 'sys_futex':
../src/util/futex.h:39:19: error: 'SYS_futex' undeclared (first use in this function); did you mean 'sys_futex'?
   39 |    return syscall(SYS_futex, addr1, op, val1, timeout, addr2, val3);
      |                   ^~~~~~~~~
      |                   sys_futex

Fixes:
 - http://autobuild.buildroot.org/results/692700a5f967760a0b8cd358b1712f1d5a7b681e

Signed-off-by: Fabrice Fontaine <fontaine.fabrice@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12496>

2 years agoradeonsi: remove si_create_surface_custom
Marek Olšák [Mon, 25 Apr 2022 07:54:49 +0000 (03:54 -0400)]
radeonsi: remove si_create_surface_custom

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

2 years agoradeonsi: remove si_create_sampler_view_custom and related code
Marek Olšák [Mon, 25 Apr 2022 07:52:59 +0000 (03:52 -0400)]
radeonsi: remove si_create_sampler_view_custom and related code

This was used for compressed and subsampled gfx copies.

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

2 years agoradeonsi: remove compressed and subsampled gfx copy from resource_copy_region
Marek Olšák [Mon, 25 Apr 2022 07:45:08 +0000 (03:45 -0400)]
radeonsi: remove compressed and subsampled gfx copy from resource_copy_region

This is unused because the compute copy is always used in these cases.

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

2 years agoradeonsi: improve the subsampled copy_image calculation
Marek Olšák [Mon, 25 Apr 2022 10:44:25 +0000 (06:44 -0400)]
radeonsi: improve the subsampled copy_image calculation

This fixes a few cases for AMD_TEST=copyimage, but it's still pretty broken.

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

2 years agoradeonsi: handle compressed formats in si_compute_copy_image
Marek Olšák [Mon, 25 Apr 2022 07:31:50 +0000 (03:31 -0400)]
radeonsi: handle compressed formats in si_compute_copy_image

This fixes a lot of AMD_TEST=copyimage cases, but there are still some
failures.

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

2 years agoradeonsi/ci: update sienna_cichlid results
Marek Olšák [Mon, 25 Apr 2022 14:45:44 +0000 (10:45 -0400)]
radeonsi/ci: update sienna_cichlid results

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

2 years agoradeonsi/test_image_copy: test all formats
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: test all formats

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

2 years agoradeonsi/test_image_copy: test mipmaps
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: test mipmaps

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

2 years agoradeonsi/test_image_copy: test copying a block-compressed format
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: test copying a block-compressed format

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

2 years agoradeonsi/test_image_copy: test all interesting texture targets
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: test all interesting texture targets

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

2 years agoradeonsi/test_image_copy: separate printing pipe_resource into a function
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: separate printing pipe_resource into a function

also print texture targets that are going to be tested

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

2 years agoradeonsi/test_image_copy: separate generating a random pipe_resource
Marek Olšák [Sun, 24 Apr 2022 11:37:50 +0000 (07:37 -0400)]
radeonsi/test_image_copy: separate generating a random pipe_resource

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

2 years agoradeonsi/test_image_copy: simplify texture size generation
Marek Olšák [Sun, 24 Apr 2022 11:19:13 +0000 (07:19 -0400)]
radeonsi/test_image_copy: simplify texture size generation

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

2 years agoradeonsi/test_image_copy: remove special SDMA codepaths
Marek Olšák [Sun, 24 Apr 2022 11:13:15 +0000 (07:13 -0400)]
radeonsi/test_image_copy: remove special SDMA codepaths

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

2 years agoradeonsi/test_image_copy: remove linear and power-of-two size testing
Marek Olšák [Sun, 24 Apr 2022 10:36:27 +0000 (06:36 -0400)]
radeonsi/test_image_copy: remove linear and power-of-two size testing

it doesn't add any value

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

2 years agoradeonsi/test_image_copy: remove whole image copies
Marek Olšák [Sun, 24 Apr 2022 10:20:14 +0000 (06:20 -0400)]
radeonsi/test_image_copy: remove whole image copies

it doesn't add any value

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

2 years agoradeonsi: rename si_test_blit -> si_test_image_copy_region
Marek Olšák [Sun, 24 Apr 2022 08:25:37 +0000 (04:25 -0400)]
radeonsi: rename si_test_blit -> si_test_image_copy_region

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

2 years agoradeonsi: don't expose formats that CB supports, but not shaders
Marek Olšák [Mon, 25 Apr 2022 09:06:29 +0000 (05:06 -0400)]
radeonsi: don't expose formats that CB supports, but not shaders

e.g. R4G4B4A4_UINT

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

2 years agoradeonsi: assert format support in si_compute_copy_image
Marek Olšák [Mon, 25 Apr 2022 09:05:59 +0000 (05:05 -0400)]
radeonsi: assert format support in si_compute_copy_image

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

2 years agoradeonsi: cosmetic changes in si_compute_copy_image
Marek Olšák [Mon, 25 Apr 2022 07:14:50 +0000 (03:14 -0400)]
radeonsi: cosmetic changes in si_compute_copy_image

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

2 years agoradeonsi: implement compute_copy_image between 1D_ARRAY and other texture types
Marek Olšák [Mon, 25 Apr 2022 04:04:41 +0000 (00:04 -0400)]
radeonsi: implement compute_copy_image between 1D_ARRAY and other texture types

And set more optimal compute block sizes.

The compute copy is required to preserve NaNs, so this fixes a lot of
AMD_TEST=copyimage cases.

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

2 years agoradeonsi: add color buffer support for R9G9B9E5_FLOAT on gfx10.3
Marek Olšák [Mon, 25 Apr 2022 03:06:43 +0000 (23:06 -0400)]
radeonsi: add color buffer support for R9G9B9E5_FLOAT on gfx10.3

This was missed when we added gfx10.3.

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

2 years agoradeonsi: add color buffer support for 2_10_10_10 pipe formats
Marek Olšák [Mon, 25 Apr 2022 03:05:37 +0000 (23:05 -0400)]
radeonsi: add color buffer support for 2_10_10_10 pipe formats

The hw enum is reversed.

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

2 years agoradeonsi: don't allow broken compute image copies into A8R8_UNORM
Marek Olšák [Mon, 25 Apr 2022 02:19:39 +0000 (22:19 -0400)]
radeonsi: don't allow broken compute image copies into A8R8_UNORM

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

2 years agoradeonsi: don't report R64_*INT as a sampler format because it doesn't work
Marek Olšák [Mon, 25 Apr 2022 02:18:51 +0000 (22:18 -0400)]
radeonsi: don't report R64_*INT as a sampler format because it doesn't work

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

2 years agoradeonsi: add si_can_use_compute_blit
Marek Olšák [Sun, 24 Apr 2022 08:18:01 +0000 (04:18 -0400)]
radeonsi: add si_can_use_compute_blit

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

2 years agoradeonsi: code style fix
Marek Olšák [Sun, 24 Apr 2022 08:17:42 +0000 (04:17 -0400)]
radeonsi: code style fix

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

2 years agoradeonsi: simplify setting COMPUTE_PGM_RSRC2.SCRATCH_EN
Marek Olšák [Thu, 28 Apr 2022 10:14:57 +0000 (06:14 -0400)]
radeonsi: simplify setting COMPUTE_PGM_RSRC2.SCRATCH_EN

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

2 years agoradeonsi: remove unused si_cs_shader_state::uses_scratch
Marek Olšák [Thu, 28 Apr 2022 10:01:15 +0000 (06:01 -0400)]
radeonsi: remove unused si_cs_shader_state::uses_scratch

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

2 years agoradeonsi: align the tessellation ring address to 2MB
Marek Olšák [Wed, 27 Apr 2022 06:30:49 +0000 (02:30 -0400)]
radeonsi: align the tessellation ring address to 2MB

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

2 years agoradeonsi: cleanup local includes
Marek Olšák [Wed, 27 Apr 2022 06:30:00 +0000 (02:30 -0400)]
radeonsi: cleanup local includes

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

2 years agoradeonsi: always print the lower-case GPU name for radeonsi-run-tests.py
Marek Olšák [Wed, 27 Apr 2022 02:29:31 +0000 (22:29 -0400)]
radeonsi: always print the lower-case GPU name for radeonsi-run-tests.py

This fixes the GPU name detection in radeonsi-run-tests.py when
the marketing name is unknown.

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

2 years agoac,radeonsi: report SCALED formats as unsupported by samplers and color buffers
Marek Olšák [Mon, 25 Apr 2022 01:20:33 +0000 (21:20 -0400)]
ac,radeonsi: report SCALED formats as unsupported by samplers and color buffers

This was never exercised and it doesn't work.

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

2 years agoac: support GR channel order in ac_choose_spi_color_formats
Marek Olšák [Mon, 25 Apr 2022 02:18:20 +0000 (22:18 -0400)]
ac: support GR channel order in ac_choose_spi_color_formats

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

2 years agoac/llvm: don't set ac_dlc in visit_intrinsic
Marek Olšák [Wed, 27 Apr 2022 03:22:40 +0000 (23:22 -0400)]
ac/llvm: don't set ac_dlc in visit_intrinsic

It's set by get_load_cache_policy later.

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

2 years agoac/llvm: set the correct cache policy for sparse buffer loads
Marek Olšák [Wed, 27 Apr 2022 03:21:08 +0000 (23:21 -0400)]
ac/llvm: set the correct cache policy for sparse buffer loads

The DLC bit was missing on gfx10.

Fixes: 6d5e26752c664c "ac/nir: implement sparse image/texture loads"
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16215>

2 years agoac: remove really_needs_scratch, parameter from ac_parse_shader_binary_config
Marek Olšák [Thu, 28 Apr 2022 05:14:39 +0000 (01:14 -0400)]
ac: remove really_needs_scratch, parameter from ac_parse_shader_binary_config

it's always true

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

2 years agoac/gpu_info: rework how num_se is derived
Marek Olšák [Wed, 27 Apr 2022 00:50:21 +0000 (20:50 -0400)]
ac/gpu_info: rework how num_se is derived

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

2 years agopanfrost: Unit test "from legacy" helper
Alyssa Rosenzweig [Wed, 27 Apr 2022 18:59:41 +0000 (14:59 -0400)]
panfrost: Unit test "from legacy" helper

So we don't regress the UABI. This doesn't get much CI coverage otherwise.

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

2 years agopanfrost: Unit test stride calculations
Alyssa Rosenzweig [Wed, 27 Apr 2022 18:50:59 +0000 (14:50 -0400)]
panfrost: Unit test stride calculations

These have reasonable interpretations now, and the three row strides have been
deduplicated. So add stride expectations to our ASTC unit tests.

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

2 years agopanfrost: Unify row stride and AFBC row stride
Alyssa Rosenzweig [Wed, 27 Apr 2022 18:09:01 +0000 (14:09 -0400)]
panfrost: Unify row stride and AFBC row stride

Row stride is defined in terms of header blocks for AFBC. Usually,
afbc.row_stride is used for AFBC images and row_stride for non-AFBC images;
however, the nonsense non-AFBC stride leaked into the UABI. So handle that in
the legacy conversion path and use a unified row stride (equal to
afbc.row_stride for AFBC images and row_stride otherwise).

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

2 years agopanfrost: Remove line_stride
Alyssa Rosenzweig [Wed, 27 Apr 2022 16:12:05 +0000 (12:12 -0400)]
panfrost: Remove line_stride

There are no more users. This eliminates a class of issues.

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

2 years agolima,panfrost: Use row stride for tiling routines
Alyssa Rosenzweig [Wed, 27 Apr 2022 16:04:54 +0000 (12:04 -0400)]
lima,panfrost: Use row stride for tiling routines

This makes more sense.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Erico Nunes <nunes.erico@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16201>

2 years agopanfrost: Use row_stride even for linear resources
Alyssa Rosenzweig [Wed, 27 Apr 2022 16:10:37 +0000 (12:10 -0400)]
panfrost: Use row_stride even for linear resources

In that case, they match up.

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