platform/upstream/mesa.git
3 years agoaco/util: replace DIV_ROUND_UP(n+1,m) by n/m+1
Daniel Schürmann [Wed, 9 Jun 2021 13:35:08 +0000 (15:35 +0200)]
aco/util: replace DIV_ROUND_UP(n+1,m) by n/m+1

Reviewed-by: Tony Wasserka <tony.wasserka@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11271>

3 years agobroadcom/compiler: fix add vs. mul
Thomas H.P. Andersen [Wed, 7 Jul 2021 14:50:05 +0000 (16:50 +0200)]
broadcom/compiler: fix add vs. mul

Spotted by a compile warning

Fixes: 7f61ff7b4d1 ("broadcom/compiler: Merge instructions more efficiently")

Reviewed-by: Iago Torral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11764>

3 years agobroadcom/compiler: use correct flag enum
Thomas H.P. Andersen [Wed, 7 Jul 2021 14:48:03 +0000 (16:48 +0200)]
broadcom/compiler: use correct flag enum

They have the same value, so no functional change

Reviewed-by: Iago Torral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11764>

3 years agointel/compiler: Track latency/perf of LSC fences
Lionel Landwerlin [Tue, 25 May 2021 08:31:10 +0000 (11:31 +0300)]
intel/compiler: Track latency/perf of LSC fences

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11759>

3 years agopanfrost: Fix GPU ID for t76x in get_perf_config
Icecream95 [Mon, 12 Jul 2021 08:33:55 +0000 (20:33 +1200)]
panfrost: Fix GPU ID for t76x in get_perf_config

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

3 years agov3dv: expose geometry shaders
Iago Toral Quiroga [Thu, 1 Jul 2021 07:42:24 +0000 (09:42 +0200)]
v3dv: expose geometry shaders

A run of dEQP-VK.*geom* has 6328 test passes and 16 failures. 14 of
these failures are related to a CTS bug affecting atomic operations
for which I submitted a CL to Khronos. Another fail looks like it might
be a case of the error threshold in CTS being slightly low. There is
only one test fail in that list that looks like it might be an actual
driver bug, but it is a variable pointers test, so it might be unrelated
to geometry shaders in the end.

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

3 years agobroadcom/ci: update expected fails for v3dv after enabling geometry shaders
Iago Toral Quiroga [Tue, 6 Jul 2021 12:56:17 +0000 (14:56 +0200)]
broadcom/ci: update expected fails for v3dv after enabling geometry shaders

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

3 years agov3dv: remove deferred vkCmdClearAtachments path
Iago Toral Quiroga [Thu, 8 Jul 2021 11:35:34 +0000 (13:35 +0200)]
v3dv: remove deferred vkCmdClearAtachments path

This was required to handle the case of secondary command buffers that
did not have framebuffer information available from the primary, since
we used to have an implementation that required this information to
be available for the fallback path of vkCmdClearAttachments. Now that
we can handle our our attachment clears in the current subpass by
emitting draw calls, we no longer need the framebuffer information to
be available and we can remove this.

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

3 years agov3dv: remove fallback path for vkCmdClearAttachments
Iago Toral Quiroga [Thu, 8 Jul 2021 11:13:17 +0000 (13:13 +0200)]
v3dv: remove fallback path for vkCmdClearAttachments

Now that we support layered clears this code is dead.

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

3 years agov3dv: implement layered attachment clears
Iago Toral Quiroga [Thu, 8 Jul 2021 10:42:22 +0000 (12:42 +0200)]
v3dv: implement layered attachment clears

Now that we have geometry shaders, we can leverage this to implement
clears of layered framebuffers by adding a geometry shader in our
clear pipelines that redirects the clear rect to the appropriate
layer in the framebuffer, instead of falling back to emitting separate
clear jobs for each layer, which is a lot slower.

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

3 years agobroadcom/compiler: don't ignore constant offset on per-vertex input loads
Iago Toral Quiroga [Wed, 7 Jul 2021 08:56:32 +0000 (10:56 +0200)]
broadcom/compiler: don't ignore constant offset on per-vertex input loads

Fixes:
dEQP-VK.clipping.user_defined.clip_distance.vert_geom.{5,6,7,8}

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

3 years agobroadcom/compiler: handle compact input arrays for geometry shaders
Iago Toral Quiroga [Wed, 7 Jul 2021 08:54:57 +0000 (10:54 +0200)]
broadcom/compiler: handle compact input arrays for geometry shaders

Clip distance arrays will come as compact array variables, so we need
to handle them as such, like we did for vertex inputs.

Fixes:
dEQP-VK.clipping.user_defined.clip_distance.vert_geom.{1,2,3,4}

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

3 years agov3dv: fix copy buffer to image TFU path for 3D images
Iago Toral Quiroga [Tue, 6 Jul 2021 05:53:31 +0000 (07:53 +0200)]
v3dv: fix copy buffer to image TFU path for 3D images

This bug was exposed by the following CTS tests (requires
geometry shaders):
dEQP-VK.geometry.layered.3d.*.readback

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

3 years agov3dv: handle QUNIFORM_FB_LAYERS
Iago Toral Quiroga [Thu, 1 Jul 2021 07:39:17 +0000 (09:39 +0200)]
v3dv: handle QUNIFORM_FB_LAYERS

There is a bit of a corner case here for secondary buffers that
don't inherit framebuffer information, since those won't have
access to the number of layers in the framebuffer by the time
we get here. Since we only emit this to sanitize the value of
gl_Layer produced from geometry shaders, I think it is probably
fine to lie about it and just use the maximum number of layers
we support. The only issue with that is that broken shaders that
emit out of bounds layer indices (which the spect states may lead
to unfined shading results) may cause undefined results.

In the future we could do better and patch the uniform streams
later when the secondary is executed inside a primary, since we
will have the required framebuffer information at that point,
but for now this seems like a reasonable compromise.

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

3 years agov3dv: emit state packets for geometry shaders
Iago Toral Quiroga [Thu, 1 Jul 2021 07:08:02 +0000 (09:08 +0200)]
v3dv: emit state packets for geometry shaders

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

3 years agobroadcom/compiler: create a helper for computing VPM config
Iago Toral Quiroga [Thu, 1 Jul 2021 11:05:44 +0000 (13:05 +0200)]
broadcom/compiler: create a helper for computing VPM config

This code is the same across drivers.

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

3 years agov3dv: add support for geometry shaders to pipelines
Iago Toral Quiroga [Wed, 30 Jun 2021 08:43:54 +0000 (10:43 +0200)]
v3dv: add support for geometry shaders to pipelines

This gets our graphics pipelines (and pipeline cache) to accept
and compile geometry shader modules.

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

3 years agobroadcom/compiler: track if geometry shaders write gl_PointSize
Iago Toral Quiroga [Tue, 6 Jul 2021 10:01:53 +0000 (12:01 +0200)]
broadcom/compiler: track if geometry shaders write gl_PointSize

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

3 years agov3dv: add a few more broadcom shader stage helpers
Iago Toral Quiroga [Wed, 30 Jun 2021 08:39:04 +0000 (10:39 +0200)]
v3dv: add a few more broadcom shader stage helpers

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

3 years agov3dv: define a generic helper to create binning pipeline stages
Iago Toral Quiroga [Wed, 30 Jun 2021 08:12:30 +0000 (10:12 +0200)]
v3dv: define a generic helper to create binning pipeline stages

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

3 years agov3dv: extend broadcom stages to include geometry
Iago Toral Quiroga [Wed, 30 Jun 2021 08:11:10 +0000 (10:11 +0200)]
v3dv: extend broadcom stages to include geometry

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

3 years agov3dv: always free pipeline stages after compiling
Iago Toral Quiroga [Thu, 1 Jul 2021 12:05:55 +0000 (14:05 +0200)]
v3dv: always free pipeline stages after compiling

We were not freeing this when the pipeline was loaded from the cache.

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

3 years agocrocus: add GL_CLAMP emulation in driver again.
Dave Airlie [Mon, 12 Jul 2021 05:12:02 +0000 (15:12 +1000)]
crocus: add GL_CLAMP emulation in driver again.

I removed this because I thought the state tracker could handle it,
and it really should handle it, but it has some minecraft side effects
I'm unsure about. This fixes the problem for now, we can revisit it later.

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

3 years agocrocus/gen8: fix wrap mode needs border color.
Dave Airlie [Mon, 12 Jul 2021 04:21:03 +0000 (14:21 +1000)]
crocus/gen8: fix wrap mode needs border color.

missing piece here.

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

3 years agoagx: Flip point coordinates because OpenGL
Alyssa Rosenzweig [Sun, 11 Jul 2021 22:07:53 +0000 (18:07 -0400)]
agx: Flip point coordinates because OpenGL

Fixes dEQP-GLES2.functional.shaders.builtin_variable.pointcoord

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

3 years agoasahi: Handle point coordinates
Alyssa Rosenzweig [Sun, 11 Jul 2021 21:27:55 +0000 (17:27 -0400)]
asahi: Handle point coordinates

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

3 years agoasahi: Identify triangle/lines vs point varyings
Alyssa Rosenzweig [Sun, 11 Jul 2021 21:10:29 +0000 (17:10 -0400)]
asahi: Identify triangle/lines vs point varyings

Seems to allow skipping over point coords?

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

3 years agoasahi: Unpack varying descriptors (1x)
Alyssa Rosenzweig [Sun, 11 Jul 2021 21:05:03 +0000 (17:05 -0400)]
asahi: Unpack varying descriptors (1x)

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

3 years agoasahi: Lower PIPE_CAPF_MAX_POINT_WIDTH to hw limit
Alyssa Rosenzweig [Sun, 11 Jul 2021 20:45:06 +0000 (16:45 -0400)]
asahi: Lower PIPE_CAPF_MAX_POINT_WIDTH to hw limit

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

3 years agoasahi: Set bit for psiz
Alyssa Rosenzweig [Sun, 11 Jul 2021 20:42:33 +0000 (16:42 -0400)]
asahi: Set bit for psiz

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

3 years agoasahi: Set point magic bit in rasterizer
Alyssa Rosenzweig [Sun, 11 Jul 2021 20:37:39 +0000 (16:37 -0400)]
asahi: Set point magic bit in rasterizer

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

3 years agoasahi: Set bits in UNK11 needed for points
Alyssa Rosenzweig [Sun, 11 Jul 2021 20:35:54 +0000 (16:35 -0400)]
asahi: Set bits in UNK11 needed for points

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

3 years agozink: fix mem info query to be more permissive
Mike Blumenkrantz [Fri, 9 Jul 2021 14:17:48 +0000 (10:17 -0400)]
zink: fix mem info query to be more permissive

airlied was right, this was way too conservative

Fixes: ff4ba3d4a77 ("zink: support PIPE_CAP_QUERY_MEMORY_INFO")

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

3 years agoasahi/decode: Print some IOGPU stuff
Alyssa Rosenzweig [Sun, 11 Jul 2021 18:48:03 +0000 (14:48 -0400)]
asahi/decode: Print some IOGPU stuff

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

3 years agoasahi/decode: Print clear/store pipelines
Alyssa Rosenzweig [Sun, 11 Jul 2021 18:43:37 +0000 (14:43 -0400)]
asahi/decode: Print clear/store pipelines

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

3 years agoasahi: Garbage collect senseless cmdbuf struct
Alyssa Rosenzweig [Sun, 11 Jul 2021 18:13:46 +0000 (14:13 -0400)]
asahi: Garbage collect senseless cmdbuf struct

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

3 years agoasahi: Consolidate some magic numbers
Alyssa Rosenzweig [Sun, 11 Jul 2021 17:37:11 +0000 (13:37 -0400)]
asahi: Consolidate some magic numbers

This is a bunch of software data structures concatenated, not a true command
buffer like previously thought.

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

3 years agoasahi: Allocate global IDs
Alyssa Rosenzweig [Sun, 11 Jul 2021 17:28:40 +0000 (13:28 -0400)]
asahi: Allocate global IDs

Use the same UABI as Metal. One less hack, trying to rule out possible
differences to Metal...

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

3 years agoasahi: Allow specifying an encoder ID
Alyssa Rosenzweig [Sun, 11 Jul 2021 17:17:30 +0000 (13:17 -0400)]
asahi: Allow specifying an encoder ID

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

3 years agoasahi/decode: Fix decoding of draw calls
Alyssa Rosenzweig [Sat, 10 Jul 2021 16:32:10 +0000 (12:32 -0400)]
asahi/decode: Fix decoding of draw calls

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

3 years agoasahi/decode: Handle CULL packets
Alyssa Rosenzweig [Sat, 10 Jul 2021 16:30:27 +0000 (12:30 -0400)]
asahi/decode: Handle CULL packets

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

3 years agoasahi/decode: Fix up high word
Alyssa Rosenzweig [Sat, 10 Jul 2021 16:30:09 +0000 (12:30 -0400)]
asahi/decode: Fix up high word

Not sure what's happening here, there's some magic for sure.

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

3 years agoasahi: Identify more unknown fields in the memmap
Alyssa Rosenzweig [Sat, 10 Jul 2021 16:05:34 +0000 (12:05 -0400)]
asahi: Identify more unknown fields in the memmap

From validating the memory map of a Metal sample and seeing what goes wrong.

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

3 years agoasahi: Reserve more space to stop a command buffer
Alyssa Rosenzweig [Sat, 10 Jul 2021 15:24:32 +0000 (11:24 -0400)]
asahi: Reserve more space to stop a command buffer

Let's be safer.

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

3 years agoasahi/decode: Check fewer zeroes after a command buffer
Alyssa Rosenzweig [Sat, 10 Jul 2021 15:23:50 +0000 (11:23 -0400)]
asahi/decode: Check fewer zeroes after a command buffer

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

3 years agoasahi: Make track_free safer
Alyssa Rosenzweig [Sat, 10 Jul 2021 15:16:56 +0000 (11:16 -0400)]
asahi: Make track_free safer

Ensure that we don't free the same BO multiple times, which can lead to later
segfaults in decode.

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

3 years agoasahi/decode: Only dump mapped allocations
Alyssa Rosenzweig [Sat, 10 Jul 2021 15:04:45 +0000 (11:04 -0400)]
asahi/decode: Only dump mapped allocations

This matches the hardware's view of memory and helps catch spurious reads. (One
symptom of messing this up -- besides broken rendering -- is a kernel warning
about a "bogus texture handle 0".)

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

3 years agoasahi: Remove unused bo_access property
Alyssa Rosenzweig [Sat, 10 Jul 2021 15:01:25 +0000 (11:01 -0400)]
asahi: Remove unused bo_access property

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

3 years agoasahi: Add missing copyright/guards for magic.c/h
Alyssa Rosenzweig [Sat, 10 Jul 2021 14:51:06 +0000 (10:51 -0400)]
asahi: Add missing copyright/guards for magic.c/h

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

3 years agoasahi: Move fixed internal shaders to agx_blit.c
Alyssa Rosenzweig [Sat, 10 Jul 2021 14:48:56 +0000 (10:48 -0400)]
asahi: Move fixed internal shaders to agx_blit.c

A more natural place to put them, as the clear/store shaders use a similar
mechanism as the reload shaders. Now magic.c is exclusively kernel side piping.

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

3 years agopanfrost: Set register allocation in the v7 RSD
Alyssa Rosenzweig [Fri, 11 Jun 2021 19:34:10 +0000 (15:34 -0400)]
panfrost: Set register allocation in the v7 RSD

Required to hit full occupancy. Now that this information is piped
through the compiler, we can do this correctly.

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

3 years agopanfrost: Generalize pan_blitter's reg count assert
Alyssa Rosenzweig [Thu, 24 Jun 2021 15:55:27 +0000 (11:55 -0400)]
panfrost: Generalize pan_blitter's reg count assert

Needed to avoid crashing on Bifrost/Valhall.

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

3 years agopanfrost: Enable more tiler levels if we can
Alyssa Rosenzweig [Wed, 16 Jun 2021 17:29:53 +0000 (13:29 -0400)]
panfrost: Enable more tiler levels if we can

Boosts glmark2 scores on Mali G52.

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

3 years agopanfrost: Query tiler features
Alyssa Rosenzweig [Wed, 16 Jun 2021 17:28:58 +0000 (13:28 -0400)]
panfrost: Query tiler features

We need the maximum levels to configure the hierarchy mask correctly. We
should also respect the bin size...

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

3 years agopanfrost: Zero depth_source in vertex shaders
Alyssa Rosenzweig [Wed, 16 Jun 2021 15:29:28 +0000 (11:29 -0400)]
panfrost: Zero depth_source in vertex shaders

Spurious assignment.

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

3 years agopanfrost: Don't set zs_update_operation in vertex shaders
Alyssa Rosenzweig [Wed, 16 Jun 2021 15:28:09 +0000 (11:28 -0400)]
panfrost: Don't set zs_update_operation in vertex shaders

Spurious assignment.

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

3 years agopanfrost: Add a performance counter dump utility
Alyssa Rosenzweig [Tue, 15 Jun 2021 22:59:33 +0000 (18:59 -0400)]
panfrost: Add a performance counter dump utility

This uses Antonio's src/panfrost/perf for all the heavylifting, just
like the Perfetto producer. Unlike the Perfetto producer, it has no
dependencies and is a lot less useful. But it's a good smoke test.

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

3 years agopanfrost: Fix FPK enable condition
Alyssa Rosenzweig [Fri, 11 Jun 2021 19:23:12 +0000 (15:23 -0400)]
panfrost: Fix FPK enable condition

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

3 years agopan/bi: Don't lower fpow
Alyssa Rosenzweig [Mon, 28 Jun 2021 14:49:56 +0000 (10:49 -0400)]
pan/bi: Don't lower fpow

We can fuse the intermediate multiply with the FMA_RSCALE in the
exponent code and save an instruction. Whether this is better than
adding a NIR op remains to be seen.

total instructions in shared programs: 146614 -> 146190 (-0.29%)
instructions in affected programs: 40724 -> 40300 (-1.04%)
helped: 157
HURT: 0
helped stats (abs) min: 1.0 max: 9.0 x̄: 2.70 x̃: 2
helped stats (rel) min: 0.22% max: 10.34% x̄: 1.37% x̃: 1.20%
95% mean confidence interval for instructions value: -3.00 -2.40
95% mean confidence interval for instructions %-change: -1.58% -1.15%
Instructions are helped.

total tuples in shared programs: 128116 -> 127696 (-0.33%)
tuples in affected programs: 33421 -> 33001 (-1.26%)
helped: 150
HURT: 0
helped stats (abs) min: 1.0 max: 16.0 x̄: 2.80 x̃: 2
helped stats (rel) min: 0.28% max: 4.37% x̄: 1.36% x̃: 1.07%
95% mean confidence interval for tuples value: -3.24 -2.36
95% mean confidence interval for tuples %-change: -1.50% -1.21%
Tuples are helped.

total clauses in shared programs: 27531 -> 27483 (-0.17%)
clauses in affected programs: 719 -> 671 (-6.68%)
helped: 20
HURT: 0
helped stats (abs) min: 1.0 max: 8.0 x̄: 2.40 x̃: 1
helped stats (rel) min: 1.61% max: 12.90% x̄: 6.96% x̃: 5.33%
95% mean confidence interval for clauses value: -3.48 -1.32
95% mean confidence interval for clauses %-change: -9.10% -4.82%
Clauses are helped.

total cycles in shared programs: 12250.81 -> 12233.69 (-0.14%)
cycles in affected programs: 1251.50 -> 1234.38 (-1.37%)
helped: 141
HURT: 0
helped stats (abs) min: 0.041665999999999315 max: 0.6666670000000003 x̄: 0.12 x̃: 0
helped stats (rel) min: 0.29% max: 5.00% x̄: 1.48% x̃: 1.20%
95% mean confidence interval for cycles value: -0.14 -0.10
95% mean confidence interval for cycles %-change: -1.63% -1.32%
Cycles are helped.

total arith in shared programs: 4840.25 -> 4822.71 (-0.36%)
arith in affected programs: 1324.08 -> 1306.54 (-1.32%)
helped: 151
HURT: 0
helped stats (abs) min: 0.041665999999999315 max: 0.6666670000000003 x̄: 0.12 x̃: 0
helped stats (rel) min: 0.29% max: 5.00% x̄: 1.43% x̃: 1.13%
95% mean confidence interval for arith value: -0.13 -0.10
95% mean confidence interval for arith %-change: -1.59% -1.28%
Arith are helped.

total texture in shared programs: 1666.50 -> 1666.50 (0.00%)
texture in affected programs: 0 -> 0
helped: 0
HURT: 0

total vary in shared programs: 639.06 -> 639.06 (0.00%)
vary in affected programs: 0 -> 0
helped: 0
HURT: 0

total ldst in shared programs: 9682 -> 9682 (0.00%)
ldst in affected programs: 0 -> 0
helped: 0
HURT: 0

total quadwords in shared programs: 116758 -> 116378 (-0.33%)
quadwords in affected programs: 28054 -> 27674 (-1.35%)
helped: 148
HURT: 2
helped stats (abs) min: 1.0 max: 16.0 x̄: 2.58 x̃: 2
helped stats (rel) min: 0.29% max: 5.13% x̄: 1.54% x̃: 1.23%
HURT stats (abs)   min: 1.0 max: 1.0 x̄: 1.00 x̃: 1
HURT stats (rel)   min: 0.67% max: 0.85% x̄: 0.76% x̃: 0.76%
95% mean confidence interval for quadwords value: -2.94 -2.12
95% mean confidence interval for quadwords %-change: -1.69% -1.33%
Quadwords are helped.

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

3 years agopan/bi: Factor out exp2/log2 code
Alyssa Rosenzweig [Mon, 28 Jun 2021 14:33:04 +0000 (10:33 -0400)]
pan/bi: Factor out exp2/log2 code

Will be reused for fpow.

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

3 years agopan/bi: Comment the fexp2 implementation
Alyssa Rosenzweig [Mon, 28 Jun 2021 14:22:35 +0000 (10:22 -0400)]
pan/bi: Comment the fexp2 implementation

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

3 years agopan/bi: Simplify cube map descriptor generation
Alyssa Rosenzweig [Fri, 25 Jun 2021 22:31:50 +0000 (18:31 -0400)]
pan/bi: Simplify cube map descriptor generation

We don't need to do the bitwise manipulation ourselves, we can just use
a bitwise MUX instead.

total instructions in shared programs: 146840 -> 146614 (-0.15%)
instructions in affected programs: 15037 -> 14811 (-1.50%)
helped: 109
HURT: 0
helped stats (abs) min: 2.0 max: 4.0 x̄: 2.07 x̃: 2
helped stats (rel) min: 0.86% max: 4.00% x̄: 1.70% x̃: 1.77%
95% mean confidence interval for instructions value: -2.15 -2.00
95% mean confidence interval for instructions %-change: -1.81% -1.59%
Instructions are helped.

total tuples in shared programs: 128149 -> 128116 (-0.03%)
tuples in affected programs: 2896 -> 2863 (-1.14%)
helped: 16
HURT: 0
helped stats (abs) min: 1.0 max: 5.0 x̄: 2.06 x̃: 1
helped stats (rel) min: 0.65% max: 2.33% x̄: 1.16% x̃: 0.70%
95% mean confidence interval for tuples value: -3.01 -1.12
95% mean confidence interval for tuples %-change: -1.50% -0.83%
Tuples are helped.

total cycles in shared programs: 12257.10 -> 12250.81 (-0.05%)
cycles in affected programs: 449.87 -> 443.58 (-1.40%)
helped: 92
HURT: 0
helped stats (abs) min: 0.0416660000000002 max: 0.20833400000000069 x̄: 0.07 x̃: 0
helped stats (rel) min: 0.93% max: 2.53% x̄: 1.40% x̃: 1.26%
95% mean confidence interval for cycles value: -0.08 -0.06
95% mean confidence interval for cycles %-change: -1.48% -1.32%
Cycles are helped.

total arith in shared programs: 4847.33 -> 4840.25 (-0.15%)
arith in affected programs: 490.37 -> 483.29 (-1.44%)
helped: 109
HURT: 0
helped stats (abs) min: 0.0416660000000002 max: 0.20833400000000069 x̄: 0.06 x̃: 0
helped stats (rel) min: 0.93% max: 5.56% x̄: 1.51% x̃: 1.26%
95% mean confidence interval for arith value: -0.07 -0.06
95% mean confidence interval for arith %-change: -1.64% -1.39%
Arith are helped.

total quadwords in shared programs: 116775 -> 116758 (-0.01%)
quadwords in affected programs: 1331 -> 1314 (-1.28%)
helped: 7
HURT: 0
helped stats (abs) min: 1.0 max: 4.0 x̄: 2.43 x̃: 3
helped stats (rel) min: 0.91% max: 2.38% x̄: 1.65% x̃: 1.39%
95% mean confidence interval for quadwords value: -3.48 -1.38
95% mean confidence interval for quadwords %-change: -2.27% -1.04%
Quadwords are helped.

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

3 years agopan/bi: Workaround widen restrictions on +FADD.f32
Alyssa Rosenzweig [Fri, 25 Jun 2021 15:40:47 +0000 (11:40 -0400)]
pan/bi: Workaround widen restrictions on +FADD.f32

We can use *FADD.f32 for these cases.

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

3 years agopan/bi: Add a constant subexpression elimination pass
Alyssa Rosenzweig [Thu, 24 Jun 2021 23:36:11 +0000 (19:36 -0400)]
pan/bi: Add a constant subexpression elimination pass

ALU only. Intended to clean up the lowerings used with complex
texturings. Ex: if a shader reads two cube maps at the same coordinates,
this deduplicates the cube map transformation.

This needs to happen in the backend since we do the cube map
transformation with the backend builder, rather than special NIR ops.
This is a tradeoff.

Pass based on ir3's, which in turn is inspired by NIR's.

total instructions in shared programs: 148799 -> 147348 (-0.98%)
instructions in affected programs: 20509 -> 19058 (-7.07%)
helped: 145
HURT: 0
helped stats (abs) min: 4.0 max: 30.0 x̄: 10.01 x̃: 8
helped stats (rel) min: 1.92% max: 54.55% x̄: 10.87% x̃: 7.41%
95% mean confidence interval for instructions value: -10.73 -9.28
95% mean confidence interval for instructions %-change: -12.81% -8.94%
Instructions are helped.

total tuples in shared programs: 129992 -> 128908 (-0.83%)
tuples in affected programs: 17624 -> 16540 (-6.15%)
helped: 145
HURT: 0
helped stats (abs) min: 2.0 max: 25.0 x̄: 7.48 x̃: 7
helped stats (rel) min: 0.74% max: 42.86% x̄: 9.16% x̃: 7.22%
95% mean confidence interval for tuples value: -7.96 -6.99
95% mean confidence interval for tuples %-change: -10.52% -7.79%
Tuples are helped.

total clauses in shared programs: 27632 -> 27582 (-0.18%)
clauses in affected programs: 1077 -> 1027 (-4.64%)
helped: 44
HURT: 0
helped stats (abs) min: 1.0 max: 3.0 x̄: 1.14 x̃: 1
helped stats (rel) min: 2.50% max: 16.67% x̄: 4.99% x̃: 4.45%
95% mean confidence interval for clauses value: -1.26 -1.01
95% mean confidence interval for clauses %-change: -5.70% -4.27%
Clauses are helped.

total cycles in shared programs: 12323 -> 12285.63 (-0.30%)
cycles in affected programs: 618.25 -> 580.88 (-6.05%)
helped: 120
HURT: 0
helped stats (abs) min: 0.08333299999999966 max: 0.5416680000000014 x̄: 0.31 x̃: 0
helped stats (rel) min: 0.77% max: 66.67% x̄: 7.60% x̃: 7.37%
95% mean confidence interval for cycles value: -0.33 -0.29
95% mean confidence interval for cycles %-change: -8.73% -6.47%
Cycles are helped.

total arith in shared programs: 4916.75 -> 4866.88 (-1.01%)
arith in affected programs: 677.79 -> 627.92 (-7.36%)
helped: 145
HURT: 0
helped stats (abs) min: 0.08333299999999966 max: 1.0833329999999997 x̄: 0.34 x̃: 0
helped stats (rel) min: 0.77% max: 66.67% x̄: 12.81% x̃: 7.87%
95% mean confidence interval for arith value: -0.37 -0.32
95% mean confidence interval for arith %-change: -15.33% -10.29%
Arith are helped.

total quadwords in shared programs: 118117 -> 117262 (-0.72%)
quadwords in affected programs: 15283 -> 14428 (-5.59%)
helped: 143
HURT: 0
helped stats (abs) min: 1.0 max: 23.0 x̄: 5.98 x̃: 5
helped stats (rel) min: 0.44% max: 25.71% x̄: 7.56% x̃: 5.56%
95% mean confidence interval for quadwords value: -6.46 -5.50
95% mean confidence interval for quadwords %-change: -8.59% -6.53%
Quadwords are helped.

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

3 years agopan/bi: Fuse LD_VAR+TEXS_2D -> VAR_TEX
Alyssa Rosenzweig [Thu, 24 Jun 2021 22:35:58 +0000 (18:35 -0400)]
pan/bi: Fuse LD_VAR+TEXS_2D -> VAR_TEX

When the LD_VAR is only used once as an input to a texture instruction,
this is an improvement. We handle this case as a backwards pass.

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

3 years agopan/bi: Analyze helper invocations
Alyssa Rosenzweig [Thu, 24 Jun 2021 15:49:19 +0000 (11:49 -0400)]
pan/bi: Analyze helper invocations

Set the .skip bit on texture instructions and the terminate discarded
threads bit on the clause header based on data flow analysis of helper
invocations. This code is adapted from Midgard, which requires the same
analysis with a few details changed.

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

3 years agopan/bi: Track LOD mode even for TEXC
Alyssa Rosenzweig [Tue, 6 Jul 2021 15:56:16 +0000 (11:56 -0400)]
pan/bi: Track LOD mode even for TEXC

Redundant with the texture operation descriptor, but we don't want to
parse that in the rest of the compiler. Handling it as a pseudo-modifier
lets us share a code path with TEXS.

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

3 years agopan/bi: Report cycle counts
Alyssa Rosenzweig [Thu, 24 Jun 2021 15:04:25 +0000 (11:04 -0400)]
pan/bi: Report cycle counts

Based on analysis of results from the Mali Offline Compiler. I am
uncertain how well these translate to real life, and they are
normalized counts only...

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

3 years agopan/bi: Only spill nodes that could progress in RA
Alyssa Rosenzweig [Wed, 16 Jun 2021 20:13:56 +0000 (16:13 -0400)]
pan/bi: Only spill nodes that could progress in RA

This reduces number of spills and hence compile-time by avoiding
pointless decisions. In a terrain shader forced to use full threads:

Before: 39:168 spills:fills
After: 23:127 spills:fills

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

3 years agopan/bi: Try to hit full occupancy on v7
Alyssa Rosenzweig [Wed, 16 Jun 2021 18:35:43 +0000 (14:35 -0400)]
pan/bi: Try to hit full occupancy on v7

Bifrost v7 trades off register pressure and occupancy. If we restrict to
[R0, R15] U [R48, R63], we get full occupancy, but if we use the full
register file, we only get half occupancy. Try to allocate just 32
registers, and only use the full 64 registers if that would spill.

Clever heuristics could make this both more effective (live range
splitting, shuffling, spilling if deemed acceptable) and cheaper at
compile-time (tracking maximum liveness to determine if it's possible to
hit at all). For now, this should suffice.

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

3 years agopan/bi: Pack staging_barrier for the -next- clause
Alyssa Rosenzweig [Tue, 15 Jun 2021 21:19:38 +0000 (17:19 -0400)]
pan/bi: Pack staging_barrier for the -next- clause

Match the semantic in the compiler header.

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

3 years agopan/bi: Add bi_foreach_instr_global_rev_safe helper
Alyssa Rosenzweig [Thu, 24 Jun 2021 18:07:43 +0000 (14:07 -0400)]
pan/bi: Add bi_foreach_instr_global_rev_safe helper

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

3 years agopan/bi: Fix skip/lod_mode aliasing with VAR_TEX
Alyssa Rosenzweig [Thu, 24 Jun 2021 18:07:27 +0000 (14:07 -0400)]
pan/bi: Fix skip/lod_mode aliasing with VAR_TEX

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

3 years agopan/bi: Improve clause printing
Alyssa Rosenzweig [Tue, 15 Jun 2021 21:20:04 +0000 (17:20 -0400)]
pan/bi: Improve clause printing

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

3 years agopanfrost: Always use a fragment shader when alpha test is enabled
Icecream95 [Fri, 9 Jul 2021 12:31:02 +0000 (00:31 +1200)]
panfrost: Always use a fragment shader when alpha test is enabled

Fixes incorrect rendering with OpenSCAD.

Fixes: 275277a2b48 ("panfrost: Implement alpha testing natively")
Reported-by: Urja Rannikko <urjaman@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11812>

3 years agoradv: fix applying radv_disable_dcc for DOOM 2016 again
Samuel Pitoiset [Fri, 9 Jul 2021 16:41:47 +0000 (18:41 +0200)]
radv: fix applying radv_disable_dcc for DOOM 2016 again

application_name_match is a regex... and DCC was also disabled for
DOOM Eternal (because DOOMEternal matches DOOM). Fun.

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

3 years agoegl/android: restore image creation fallback path used by virgl
Yiwei Zhang [Wed, 7 Jul 2021 20:16:21 +0000 (20:16 +0000)]
egl/android: restore image creation fallback path used by virgl

For virgl backend used in ARCVM, cros buffer info query brings back
real modifier info for the host image, which cannot be resolved by the
gallium virgl backend. Thus the fallback path is used here.

This patch fixes a behavior change introduced by a prior commit.

Fixes: 5d3e64f1 ("egl: android: prepare code for adding more buffer_info getters")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Chia-I Wu <olvaffe@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11771>

3 years agollvmpipe: do not leak display target mapped ptr in cs setup
Heinrich Fink [Thu, 1 Jul 2021 09:26:57 +0000 (11:26 +0200)]
llvmpipe: do not leak display target mapped ptr in cs setup

For compute shader textures that are backed by a display target, do not
leak the mapped pointer and unmap when access to the mapped resource is
not needed anymore.

Also use llvmpipe_resource_[un]map instead of calling winsys map
functions directly.

v2:
    - use llvmpipe_resource_[un]map directly instead of winsys DT map
    func and unneeded helper function for unmapping.

v3 (Emil Velikov):
    - add comment in lp_csctx_set_sampler_views to explain
    unmapping current texture early in the loop.

Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>

3 years agollvmpipe: do not leak map of display target in fs setup
Heinrich Fink [Mon, 5 Jul 2021 17:54:20 +0000 (19:54 +0200)]
llvmpipe: do not leak map of display target in fs setup

For fragment shader textures that are backed by a display target, do not
leak the mapped pointer, but unmap before unref'ing its associated
pipe_resource instances.

Also, make sure that the pointer that's mapped into a jit texture stays
valid while rasterization works on a jit context copy by mapping the
display target again during scene setup, and unmapping when finalizing
rasterization.

v2 (Daniel Stone):
    - remove redundant helper function for [un]mapping DT, use
      llvmpipe_resource_[un]map right away

v3 (Emil Velikov):
    - add comment in lp_setup_set_fragment_sampler_views to explain
    unmapping current texture early in the loop

Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>

3 years agosoftpipe: unmap display target of shader sampler
Heinrich Fink [Thu, 1 Jul 2021 12:39:36 +0000 (14:39 +0200)]
softpipe: unmap display target of shader sampler

Unmap display target in cleanup routine for sampler views that are using
textures backed by a display target.

v2:
    - remove obsolete comment

Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>

3 years agollvmpipe: unmap display target of shader image/sampler
Heinrich Fink [Wed, 30 Jun 2021 11:28:17 +0000 (13:28 +0200)]
llvmpipe: unmap display target of shader image/sampler

Revive hooks for cleaning up shader sampler and image data and when
finalizing llvmpipe_draw_vbo. In cleanup routines, for any sampler or
image that was set up with displaytarget_map, call displaytarget_unmap.

This fixes leaks of mmap calls of the underlying displaytarget
resources.

v2 (Daniel Stone):
    - Use a single cleanup function for sampler/image to simplify patchset

v3 (Emil Velikov):
    - use llvmpipe_resource_[un]map instead of open-coding through
    winsys

v4:
    - check tex/image for NULL before calling into
    llvmpipe_resource_unmap (fixes dEQP crash of llvmpipe runner)

Signed-off-by: Heinrich Fink <hfink@snap.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11741>

3 years agonir/lower_subgroups: Pad ballot values before bitcasting
Jason Ekstrand [Thu, 8 Jul 2021 19:36:15 +0000 (14:36 -0500)]
nir/lower_subgroups: Pad ballot values before bitcasting

Otherwise, if we cast from a uint32_t to a uint64_t, the bitcast will
fail before we pad.  This happens on Intel.

Fixes: e4e79de2a420 "nir/subgroups: Support > 1 ballot components"
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5045
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11786>

3 years agoandroid: Restore android/Android.mk
Jason Ekstrand [Fri, 9 Jul 2021 12:16:36 +0000 (07:16 -0500)]
android: Restore android/Android.mk

It was accidentally dropped as part of d4b482d378e3 but it's the one
Android makefile we want to keep.

Fixes: d4b482d378e3 "android: Drop the Android.mk build system"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11798>

3 years agoac,radv: implement the cs_regalloc_hang HW bug workaround
Samuel Pitoiset [Thu, 1 Jul 2021 11:32:05 +0000 (13:32 +0200)]
ac,radv: implement the cs_regalloc_hang HW bug workaround

Might fix spurious failures on GFX6 and some GFX7 chips.

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

3 years agodocs: update zink requirements
Erik Faye-Lund [Fri, 9 Jul 2021 10:16:10 +0000 (12:16 +0200)]
docs: update zink requirements

We currently require VK_EXT_line_rasterization with *all* optional
features to render all kinds of lines required. Because some (if not
all) of these can be emulated, let's make the list explicit, so it's
easy to remove items as we implement emulation.

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

3 years agozink: fill in the right line-mode based on state
Erik Faye-Lund [Tue, 20 Apr 2021 16:28:24 +0000 (18:28 +0200)]
zink: fill in the right line-mode based on state

We need to fill in the right line-mode here based on the state to get
the correct rasterization; bresenham isn't always the right one.

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

3 years agozink: support line stippling
Erik Faye-Lund [Mon, 28 Oct 2019 16:34:38 +0000 (17:34 +0100)]
zink: support line stippling

VK_EXT_line_rasterization allows us to specify a line-stilling pattern.
So let's do that.

While we're at it, use more bit-allocation here.

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

3 years agozink: use bit-allocation for boolean rasterizer-state
Erik Faye-Lund [Fri, 9 Jul 2021 10:23:16 +0000 (12:23 +0200)]
zink: use bit-allocation for boolean rasterizer-state

This reduces the size of the struct a bit, and we're about to add some
more bit-allocated stuff in the next commit.

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

3 years agozink: hook up line-rasterization ext
Erik Faye-Lund [Mon, 28 Oct 2019 15:42:48 +0000 (16:42 +0100)]
zink: hook up line-rasterization ext

The VK_EXT_line_rasterization extension allows to specify the
correct line-rasterization rules, which is needed for correct OpenGL
rendering.

So, let's prepare for filling this one out. Right now, it does a whole
lot of nothing, but that's about to change.

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

3 years agoir3: add newly found shlg.b16 instruction
Danylo Piliaiev [Wed, 7 Jul 2021 11:40:52 +0000 (14:40 +0300)]
ir3: add newly found shlg.b16 instruction

Example of blob's output:
  (nop3) shlg.b16 hr8.x, (r)8, (r)hr8.x, 12

It does: (src2 << src1) | src2

src1 and src2 could be GPRs, relative GPRs, relative consts,
or immidiates. However, they could not be plain const registers.

Blob does use it in conjuncture with "samgq" instruction.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11760>

3 years agoaco: use nir_ssa_def_is_unused() to determine if atomic dest is used
Samuel Pitoiset [Fri, 9 Jul 2021 09:21:01 +0000 (11:21 +0200)]
aco: use nir_ssa_def_is_unused() to determine if atomic dest is used

Instead of duplicating this chunk everywhere.

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

3 years agovulkan/wsi/wayland: Add support for more SRGB formats.
Georg Lehmann [Thu, 8 Jul 2021 09:47:52 +0000 (11:47 +0200)]
vulkan/wsi/wayland: Add support for more SRGB formats.

This is required by the Vulkan specification:

If pSurfaceFormats includes an entry whose value for colorSpace is
VK_COLOR_SPACE_SRGB_NONLINEAR_KHR and whose value for format is a UNORM
(or SRGB) format and the corresponding SRGB (or UNORM) format is a color
renderable format for VK_IMAGE_TILING_OPTIMAL, then pSurfaceFormats must also
contain an entry with the same value for colorSpace and format equal to the
corresponding SRGB (or UNORM) format.

Signed-off-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11778>

3 years agov3dv/format: expose properly that some formats are not filterable
Alejandro Piñeiro [Fri, 9 Jul 2021 09:47:58 +0000 (11:47 +0200)]
v3dv/format: expose properly that some formats are not filterable

Specifically A8B8G8R8_UINT_PACK32, A8B8G8R8_SINT_PACK32, and
A2B10G10R10_UINT_PACK32. They are based on the internal types RGBA8UI,
RGBA8I, and RGB10_A2UI, that are not filterable.

That gets several failing CTS like this:
  dEQP-VK.api.copy_and_blit.core.blit_image.all_formats.color.3d.a8b8g8r8_uint_pack32.a8b8g8r8_uint_pack32.optimal_optimal_linear_stripes_x

To properly skip instead of fail. So we also update the ci
expectation.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11794>

3 years agoci: Add Fedora release build job
Michel Dänzer [Wed, 12 May 2021 14:55:00 +0000 (16:55 +0200)]
ci: Add Fedora release build job

The intention is for this to more or less match the Fedora package
build. The main benefit right now is GCC 11 build test coverage.

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

3 years agoci: Add Fedora 34 based x86 build docker image
Michel Dänzer [Wed, 12 May 2021 14:42:37 +0000 (16:42 +0200)]
ci: Add Fedora 34 based x86 build docker image

v2:
* Do not install weak dependencies in Fedora docker image.

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

3 years agoci: Rename Debian based build jobs from meson-* to debian-*
Michel Dänzer [Tue, 15 Jun 2021 16:23:33 +0000 (18:23 +0200)]
ci: Rename Debian based build jobs from meson-* to debian-*

meson has been the only build system in tree for some time, so the
meson- prefix was a bit meaningless.

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

3 years agoci: Add debian/ prefix to job names for Debian based docker images
Michel Dänzer [Tue, 15 Jun 2021 15:42:22 +0000 (17:42 +0200)]
ci: Add debian/ prefix to job names for Debian based docker images

And move the image build scripts to a subdirectory correspondingly.

Preparation for adding images based on other OSs.

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

3 years agoturnip: Mark local variable ASSERTED
Michel Dänzer [Fri, 14 May 2021 13:59:33 +0000 (15:59 +0200)]
turnip: Mark local variable ASSERTED

It's only used in assert. Avoids compiler warning/error with assertions disabled:

../src/freedreno/vulkan/tu_cs.h: In function 'tu_cs_reserve':
../src/freedreno/vulkan/tu_cs.h:208:13: error: unused variable 'result' [-Werror=unused-variable]
  208 |    VkResult result = tu_cs_reserve_space(cs, reserved_size);
      |             ^~~~~~

Reviewed-by: Samuel Iglesias Gonsálvez <siglesias@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11412>

3 years agodlist: skip NOP command at the head of a list
Pierre-Eric Pelloux-Prayer [Fri, 18 Jun 2021 16:10:05 +0000 (18:10 +0200)]
dlist: skip NOP command at the head of a list

If we build a dlist starting with a NOP (for alignment purpose),
we don't have to execute the NOP.

Instead shift the start value by one.

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

3 years agodlist: remove unused _mesa_dlist_alloc
Pierre-Eric Pelloux-Prayer [Fri, 18 Jun 2021 13:11:54 +0000 (15:11 +0200)]
dlist: remove unused _mesa_dlist_alloc

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