platform/upstream/mesa.git
3 years agov3dv: improve TLB layered image clears
Iago Toral Quiroga [Thu, 15 Jul 2021 09:05:20 +0000 (11:05 +0200)]
v3dv: improve TLB layered image clears

Our meta image clearing code was emitting a job per layer to clear,
but we can emit a single job that packs multiple layer clears for
better performance. For this we just need to make sure we pass
the maximum layer we can emit to v3dv_job_start_frame so we
allocate sufficent tile state memory.

Actually, since this operation is TLB based and doesn't make use of
layered rendering, we could do with allocating less tile state
memory too. We will improve this for this and many others TLB meta
implementations in follow up patches.

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

3 years agov3dv: remove unused layer field from struct rcl_clear_info
Iago Toral Quiroga [Thu, 15 Jul 2021 08:43:57 +0000 (10:43 +0200)]
v3dv: remove unused layer field from struct rcl_clear_info

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

3 years agoradv: fix specifying the stencil layout for separate depth/stencil layouts
Samuel Pitoiset [Wed, 14 Jul 2021 15:04:18 +0000 (17:04 +0200)]
radv: fix specifying the stencil layout for separate depth/stencil layouts

The Vulkan spec has been updated few months ago again and pNext is
always honored if present.

Found this with vkd3d-proton which implemented separate depth/stencil
layouts recently.

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

3 years agoradv: report APUs as discrete GPUs for Red Dead Redemption 2
Samuel Pitoiset [Wed, 14 Jul 2021 09:40:15 +0000 (11:40 +0200)]
radv: report APUs as discrete GPUs for Red Dead Redemption 2

On APUs, we fake heaps to simulate a dGPU setup because it seems to
have the maximum compatibility. Though, some applications like RDR2
still only looks at GTT if the driver reports an iGPU which means it
will only use 1/3rd of total memory available.

This is currently behind a drirc option because it might have
implications for other apps but we might want to extend this later
if everything is fine.

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

3 years agoradv: fix bounds checking for zero vertex stride on GFX6-7
Samuel Pitoiset [Thu, 15 Jul 2021 08:10:09 +0000 (10:10 +0200)]
radv: fix bounds checking for zero vertex stride on GFX6-7

GFX6 and GFX10+ have similar logic.

This fixes test_zero_vertex_stride from vkd3d-proton on
Pitcairn (GFX6) and on Bonaire (GFX7).

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

3 years agonir: Better document the Boissinot algorithm in nir_from_ssa()
Jason Ekstrand [Mon, 1 Feb 2021 22:10:19 +0000 (16:10 -0600)]
nir: Better document the Boissinot algorithm in nir_from_ssa()

Reviewed-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8815>

3 years agointel/dev: Drop a bogus assert
Jason Ekstrand [Fri, 16 Jul 2021 02:41:06 +0000 (21:41 -0500)]
intel/dev: Drop a bogus assert

In c24ba6cecbac, I copied over the CHV thread count code from i965 and
ANV into common code.  While at it, I added an assert that I thought
should be true based on the comments.  It turns out to be invalid.  Drop
it.

Fixes: c24ba6cecbac "intel/dev: Handle CHV CS thread weirdness in..."
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5072
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11918>

3 years agoanv: Unbreak wide lines on HSW/BDW
Iván Briano [Thu, 15 Jul 2021 20:57:54 +0000 (13:57 -0700)]
anv: Unbreak wide lines on HSW/BDW

I knew there was a reason the limit was at ~8 and not rounded to it.

Fixes: 004fcfe6985 ("anv: fix some multisample lines_wide CTS tests")

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

3 years agoanv: Zero initialize pipeline structs
Caio Marcelo de Oliveira Filho [Wed, 14 Jul 2021 05:24:26 +0000 (22:24 -0700)]
anv: Zero initialize pipeline structs

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

3 years agovulkan/util: Add and use vk_multialloc_zalloc variants
Caio Marcelo de Oliveira Filho [Wed, 14 Jul 2021 05:39:23 +0000 (22:39 -0700)]
vulkan/util: Add and use vk_multialloc_zalloc variants

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

3 years agovulkan/wsi/wayland: Initialise wl_shm pointer in VkImage
Daniel Stone [Thu, 15 Jul 2021 09:19:53 +0000 (10:19 +0100)]
vulkan/wsi/wayland: Initialise wl_shm pointer in VkImage

We don't explicitly calloc the wsi_wl_image to zero; anything that's
expected to be valid needs to be explicitly initialised.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5063
Fixes: 6b36f35734a9 ("vulkan/wsi/wl: add wl_shm support for lavapipe.")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Tested-by: Jan Beich <jbeich@freebsd.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11909>

3 years agovulkan/wsi/wayland: Cosmetic alignment fix
Daniel Stone [Thu, 15 Jul 2021 09:13:50 +0000 (10:13 +0100)]
vulkan/wsi/wayland: Cosmetic alignment fix

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

3 years agodraw: handle resetting draw_id between instances.
Dave Airlie [Thu, 15 Jul 2021 05:25:24 +0000 (15:25 +1000)]
draw: handle resetting draw_id between instances.

If we have a multi draw then the draw_id needs to get reset
between each instance.

Fixes the rest of the VK CTS multidraw tests

Fixes: ce0b1f23c30e ("aux/draw: track increment_draw_id value from draw info")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11899>

3 years agolavapipe: fix indexed multi draw draw_id increment
Dave Airlie [Thu, 15 Jul 2021 05:24:35 +0000 (15:24 +1000)]
lavapipe: fix indexed multi draw draw_id increment

I cut-n-paste this badly from the non-indexed, and used the wrong
struct.

Fixes a bunch of multi-draw CTS

Fixes: cc8f7dbf2a1a ("lavapipe: fix multi-draw regression in shader parameters test")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11899>

3 years agonir: Validate after deserialization.
Emma Anholt [Tue, 13 Jul 2021 23:31:52 +0000 (16:31 -0700)]
nir: Validate after deserialization.

It's a particularly relevant place for NIR bugs to occur, and if you make
a mistake in this code it gets caught in your debug build in something
like mesa/st's call to nir_split_var_copies() during finalization, which is
rather misleading.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11860>

3 years agodocs: mark mesa 21.0 as done
Dylan Baker [Fri, 4 Jun 2021 18:26:18 +0000 (11:26 -0700)]
docs: mark mesa 21.0 as done

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

3 years agoanv: fix some multisample lines_wide CTS tests
Iván Briano [Thu, 22 Apr 2021 18:14:02 +0000 (11:14 -0700)]
anv: fix some multisample lines_wide CTS tests

We can use a better algorithm from ICL and onward by setting a chicken
bit, but prior to that we need to resort to disabling rectangular lines.
Since we don't support strictLines anyway, this shouldn't be a major
issue.

Closes #2833
Fixes dEQP-VK.rasterization.interpolation_multisample_*_bit.*lines_wide

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

3 years agoanv: Don't advertise unsupported shader stages
Iván Briano [Wed, 14 Jul 2021 21:37:40 +0000 (14:37 -0700)]
anv: Don't advertise unsupported shader stages

We don't currently support mesh or ray tracing, so don't advertise their
shader stages as supported for subgroups.

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

3 years agoradv: Use 128-sized vertex grouping for NGG shaders.
Timur Kristóf [Fri, 9 Jul 2021 19:23:25 +0000 (21:23 +0200)]
radv: Use 128-sized vertex grouping for NGG shaders.

This matches what RadeonSI also does.
It seems to improve performance especially with NGG culling shaders.

Eg. in Doom Eternal this gives me +5ish fps.

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

3 years agomesa: (correctly) flush more in _mesa_make_current
Adam Jackson [Thu, 10 Jun 2021 14:55:17 +0000 (10:55 -0400)]
mesa: (correctly) flush more in _mesa_make_current

The code being removed here requires that the old context have a
window-system drawable bound to the default framebuffer as a condition
of the context-release flush. I can find no justification for
restricting flushes to contexts like this, and GL 3.0 (etc) let you make
a context current without any drawable bound.

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

3 years agoglx/drisw: Nerf PutImage when loaderPrivate == NULL
Adam Jackson [Wed, 16 Jun 2021 01:53:27 +0000 (21:53 -0400)]
glx/drisw: Nerf PutImage when loaderPrivate == NULL

This means the drawable was already destroyed. This can happen during
diplay teardown, destroying the context will make it current first so it
can flush rendering and destroy textures and such, and if the drawable
is already destroyed then flushing to nowhere would crash.

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

3 years agoasahi: Move assignment after null check.
Vinson Lee [Thu, 15 Jul 2021 05:23:09 +0000 (22:23 -0700)]
asahi: Move assignment after null check.

Fix defect reported by Coverity Scan.

Dereference before null check (REVERSE_INULL)
check_after_deref: Null-checking so suggests that it may be null,
but it has already been dereferenced on all paths leading to the
check.

Fixes: dcd2d8ca500 ("asahi: Track more Gallium state")
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11898>

3 years agoRevert "ci: disable Broadcom CI"
Jose Maria Casanova Crespo [Thu, 15 Jul 2021 11:11:17 +0000 (13:11 +0200)]
Revert "ci:  disable Broadcom CI"

Our POE switch rebooted with factory settings. So devices weren't turning
on/off because of failing SMNP auth.

This reverts commit 87cdcf56455b78b0ca799adccb20c7d23d1b3a51.

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

3 years agoutil: document that workaround also fixes Riptale
Timothy Arceri [Wed, 14 Jul 2021 06:03:00 +0000 (16:03 +1000)]
util: document that workaround also fixes Riptale

The games use an idential executable.

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

3 years agov3dv: refactor meta copy/clear code
Iago Toral Quiroga [Thu, 15 Jul 2021 06:51:55 +0000 (08:51 +0200)]
v3dv: refactor meta copy/clear code

This change does the following:

- Moves image clearing code from v3dv_meta_copy.c to v3dv_meta_clear.c
  where it belongs.
- Renames v3dv_meta_copy.h to v3dv_meta_common.h since now it is required
  by the copy and clear code.
- Renames 'struct framebuffer_data' type.
- Merges v3dvx_meta_clear.c and v3dvx_meta_copy.c into v3dvx_meta_common.c.
- Prefixes all "public" meta functions with the 'meta' prefix.

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

3 years agov3dv: remove more dead clearing code
Iago Toral Quiroga [Thu, 15 Jul 2021 06:23:42 +0000 (08:23 +0200)]
v3dv: remove more dead clearing code

We forgot to remove the v3dvx code for the clearing code fallbacks
we removed after we implemented layered clears.

Fixes: 5ba7f64b45 ('v3dv: remove fallback path for vkCmdClearAttachments')

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

3 years agoci: disable Broadcom CI
Iago Toral Quiroga [Thu, 15 Jul 2021 07:52:04 +0000 (09:52 +0200)]
ci:  disable Broadcom CI

The CI is down at the moment, disable it while we figure out
a solution.

Acked-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11901>

3 years agoradv: only init the TC-compat ZRANGE metadata for the depth aspect
Samuel Pitoiset [Wed, 14 Jul 2021 18:05:54 +0000 (20:05 +0200)]
radv: only init the TC-compat ZRANGE metadata for the depth aspect

With separate depth/stencil layouts, if the depth aspect is first
initialized and then cleared, the ZRANGE_PRECISION metadata might
be different than 0. Initializing it again for the stencil aspect
will overwrite the value.

Fixes rendering glitches with Scarlet Nexus on GFX8-9.

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

3 years agonv50/ir: Initialize Value member id in constructor.
Vinson Lee [Thu, 22 Apr 2021 04:06:28 +0000 (21:06 -0700)]
nv50/ir: Initialize Value member id in constructor.

Fix defect reported by Coverity Scan.

Uninitialized scalar field (UNINIT_CTOR)
uninit_member: Non-static class member id is not initialized in
this constructor nor in any functions that it calls.

Suggested-by: Karol Herbst <kherbst@redhat.com>
Signed-off-by: Vinson Lee <vlee@freedesktop.org>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10401>

3 years agolima: handle fp16 vertex formats
Vasily Khoruzhick [Wed, 14 Jul 2021 06:12:13 +0000 (23:12 -0700)]
lima: handle fp16 vertex formats

12128fb1351e marked fp16 vertex formats supported, but they aren't actually handled
by lima_pipe_format_to_attrib_type(). Fix it by handling it there.
FP16 seems to be the only missing index which is 0x3.

Fixes: 12128fb1351e ("lima: add natively supported vertex buffer formats")

Cc: 21.1 mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Signed-off-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11872>

3 years agovenus: refactor vn_EndCommandBuffer
Chia-I Wu [Wed, 14 Jul 2021 23:08:25 +0000 (16:08 -0700)]
venus: refactor vn_EndCommandBuffer

Add vn_cmd_submit as a wrapper to vn_instance_ring_submit.  It is also
designed such that it can be called from any of the vn_Cmd* functions.

Signed-off-by: Chia-I Wu <olvaffe@gmail.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11896>

3 years agolavapipe: fix multi-draw regression in shader parameters test
Dave Airlie [Wed, 14 Jul 2021 22:05:03 +0000 (08:05 +1000)]
lavapipe: fix multi-draw regression in shader parameters test

dEQP-VK.draw.shader_draw_parameters.base_instance.draw,Fail
dEQP-VK.draw.shader_draw_parameters.base_instance.draw_indexed,Fail

Fixes: 6b6dda56b5ff ("lavapipe: increment drawid for multidraws")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11894>

3 years agopan/gen_pack: Use 1U for unpacking log2 to avoid undefined behaviour
Icecream95 [Wed, 14 Jul 2021 00:48:11 +0000 (12:48 +1200)]
pan/gen_pack: Use 1U for unpacking log2 to avoid undefined behaviour

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

3 years agopan/decode: Avoid undefined behaviour on shift in bits()
Icecream95 [Wed, 14 Jul 2021 00:47:30 +0000 (12:47 +1200)]
pan/decode: Avoid undefined behaviour on shift in bits()

v2: Return 0 instead of `word` (Alyssa)

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

3 years agointel/dev: Add a max_cs_workgroup_threads field
Jason Ekstrand [Tue, 13 Jul 2021 23:21:43 +0000 (18:21 -0500)]
intel/dev: Add a max_cs_workgroup_threads field

This is distinct form max_cs_threads because it also encodes
restrictions about the way we use GPGPU/COMPUTE_WALKER.  This gets rid
of the MIN2(64, devinfo->max_cs_threads) we have scattered all over the
driver and puts it in a central place.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11861>

3 years agointel/dev: Handle BSW naming issues
Jason Ekstrand [Tue, 13 Jul 2021 22:56:11 +0000 (17:56 -0500)]
intel/dev: Handle BSW naming issues

Braswell, a particular Cherryview variant, is especially strange.  We
can't even get the chip name from the PCI ID and instead have to look at
fusing information to decide if it's a 400 or a 405.  Pull that into the
common code as well.  This fixes BSW naming on ANV and crocus.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11861>

3 years agointel/dev: Put the device name in intel_device_info
Jason Ekstrand [Tue, 13 Jul 2021 22:56:01 +0000 (17:56 -0500)]
intel/dev: Put the device name in intel_device_info

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11861>

3 years agointel/dev: Handle CHV CS thread weirdness in get_device_info_from_fd
Jason Ekstrand [Tue, 13 Jul 2021 22:06:44 +0000 (17:06 -0500)]
intel/dev: Handle CHV CS thread weirdness in get_device_info_from_fd

Cherryview is weird in that the actual limits we can expose through GL
are dependent on fusing information which is only obtainable at runtime.
The same PCI ID may have different configurations with different maximum
CS thread counts.  We currently handle this in i965 and ANV by doing the
calculation in the driver.

This dates back to when intel_device_info was computed from the PCI ID.
Now that we have get_device_info_from_fd, we can move the CHV stuff
there and get it out of the driver.  This fixes CHV thread counts on
crocus as well.

Reviewed-by: Caio Marcelo de Oliveira Filho <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11861>

3 years agolavapipe: Use common Vulkan format helpers
Joshua Ashton [Wed, 14 Jul 2021 02:21:11 +0000 (03:21 +0100)]
lavapipe: Use common Vulkan format helpers

Drops the vk_format_to_pipe (and it's outdated table) for vk_format_to_pipe_format, aswell as the duplicated vk_format_aspects function.

The old format table was missing USCALED and other values, causing incorrect rendering in many games.

Fixes rendering in Portal 1, Hat in Time, Half-Life 2 and pretty much every other D3D9 title with DXVK.

Fixes: b38879f8c5f ("vallium: initial import of the vulkan frontend")

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11863>

3 years agodocs: drop duplicate `21.1` branch name from release calendar
Eric Engestrom [Wed, 14 Jul 2021 20:55:31 +0000 (21:55 +0100)]
docs: drop duplicate `21.1` branch name from release calendar

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

3 years agodocs: update calendar and link releases notes for 21.1.5
Eric Engestrom [Wed, 14 Jul 2021 20:29:39 +0000 (21:29 +0100)]
docs: update calendar and link releases notes for 21.1.5

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

3 years agodocs: add release notes for 21.1.5
Eric Engestrom [Wed, 14 Jul 2021 19:50:17 +0000 (20:50 +0100)]
docs: add release notes for 21.1.5

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

3 years agolavapipe: increment drawid for multidraws
Mike Blumenkrantz [Wed, 14 Jul 2021 13:43:39 +0000 (09:43 -0400)]
lavapipe: increment drawid for multidraws

Fixes: f99f7c06 ("lavapipe: implement multidraw ext")

Reviewed-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11878>

3 years agozink: improve detection for broken drawids
Mike Blumenkrantz [Wed, 14 Jul 2021 18:21:24 +0000 (14:21 -0400)]
zink: improve detection for broken drawids

this is also broken for multidraws where drawid shouldn't be incremented

Fixes: 2d32d123e56 ("zink: avoid unnecessarily rewriting gl_DrawID")

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

3 years agodocs: update calendar for 21.2.0-rc1
Dylan Baker [Wed, 14 Jul 2021 19:00:02 +0000 (12:00 -0700)]
docs: update calendar for 21.2.0-rc1

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

3 years agolvp: fixup multi draw memcpys
Dave Airlie [Wed, 14 Jul 2021 05:01:32 +0000 (15:01 +1000)]
lvp: fixup multi draw memcpys

This doesn't fix the tests but it fixes a bunch of valgrind
uninitialised value warnings

Fixes: f99f7c06e71d ("lavapipe: implement multidraw ext")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-By: Joshua Ashton <joshua@froggi.es>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11870>

3 years agopanfrost: Warn on transitions to linear
Alyssa Rosenzweig [Tue, 13 Jul 2021 17:26:32 +0000 (13:26 -0400)]
panfrost: Warn on transitions to linear

The timing is critical for e.g video players, but this can also happen
unexpectedly in other apps which could be a symptom of deeper trouble.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Suggested-by: Icecream95 <ixn@disroot.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11830>

3 years agopanfrost: Warn on get_fresh_batch
Alyssa Rosenzweig [Mon, 12 Jul 2021 18:09:11 +0000 (14:09 -0400)]
panfrost: Warn on get_fresh_batch

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

3 years agopanfrost: Warn on get_fresh_batch_for_fbo
Alyssa Rosenzweig [Mon, 12 Jul 2021 18:08:10 +0000 (14:08 -0400)]
panfrost: Warn on get_fresh_batch_for_fbo

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

3 years agopanfrost: Log reasons for flushes
Alyssa Rosenzweig [Mon, 12 Jul 2021 18:05:09 +0000 (14:05 -0400)]
panfrost: Log reasons for flushes

Premature flushes (i.e. before pipe->flush() is called) can be
expensive, particularly if they require extra reloads/resolves.

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

3 years agopanfrost: Warn on going out of AFBC
Alyssa Rosenzweig [Mon, 12 Jul 2021 17:56:16 +0000 (13:56 -0400)]
panfrost: Warn on going out of AFBC

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

3 years agopanfrost: Warn on software conditional rendering
Alyssa Rosenzweig [Mon, 12 Jul 2021 17:56:07 +0000 (13:56 -0400)]
panfrost: Warn on software conditional rendering

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

3 years agopanfrost: Add perf_debug macros
Alyssa Rosenzweig [Mon, 12 Jul 2021 17:55:30 +0000 (13:55 -0400)]
panfrost: Add perf_debug macros

Lifted from freedreno.

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

3 years agodocs/relnotes/new_features: empty for next release cycle
Dylan Baker [Wed, 14 Jul 2021 17:21:20 +0000 (10:21 -0700)]
docs/relnotes/new_features: empty for next release cycle

3 years agoVERSION: bump version for 21.3 development cycle
Dylan Baker [Wed, 14 Jul 2021 17:20:34 +0000 (10:20 -0700)]
VERSION: bump version for 21.3 development cycle

3 years agointel/compiler: Update block IPs once in opt_cmod_propagation
Ian Romanick [Tue, 29 Jun 2021 03:53:22 +0000 (20:53 -0700)]
intel/compiler: Update block IPs once in opt_cmod_propagation

No difference proven at 95.0% confidence (n=10) in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13.

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

3 years agointel/compiler: Update block IPs once in register_coalesce
Ian Romanick [Tue, 29 Jun 2021 02:06:44 +0000 (19:06 -0700)]
intel/compiler: Update block IPs once in register_coalesce

Performance improvement in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 for n=30:

release build (w/Fedora build flags): -0.82% ± 0.23%
Meson -Dbuildtype=debugoptimized:     -0.74% ± 0.27%

The difference in the debugoptimized build is the calls to
inst_is_in_block(block, this) still exist on each call to remove().

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

3 years agointel/compiler: Update block IPs once in dead_code_eliminate
Ian Romanick [Tue, 29 Jun 2021 02:02:40 +0000 (19:02 -0700)]
intel/compiler: Update block IPs once in dead_code_eliminate

Performance improvement in
dEQP-VK.ssbo.phys.layout.random.16bit.scalar.13 for n=30:

release build (w/Fedora build flags): -7.79% ± 0.25%
Meson -Dbuildtype=debugoptimized:     -5.10% ± 0.40%

The difference in the debugoptimized build is the calls to
inst_is_in_block(block, this) still exist on each call to remove().

v2: Only update each block's IP data once instead of once per block.
Suggested by Emma.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

3 years agointel/compiler: Add cfg_t::adjust_block_ips() method
Ian Romanick [Thu, 1 Jul 2021 17:24:01 +0000 (10:24 -0700)]
intel/compiler: Add cfg_t::adjust_block_ips() method

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

3 years agointel/compiler: Add the ability to defer IP updates in backend_instruction::remove
Ian Romanick [Tue, 29 Jun 2021 02:02:11 +0000 (19:02 -0700)]
intel/compiler: Add the ability to defer IP updates in backend_instruction::remove

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11632>

3 years agoaco/live_var_analysis: change worklist to a single integer
Daniel Schürmann [Wed, 14 Jul 2021 12:56:48 +0000 (14:56 +0200)]
aco/live_var_analysis: change worklist to a single integer

Reduces overall compile times by ~0.45%.

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

3 years agoaco/insert_waitcnt: Remove many unnecessary wait_imm.combine()
Daniel Schürmann [Wed, 14 Jul 2021 11:49:20 +0000 (13:49 +0200)]
aco/insert_waitcnt: Remove many unnecessary wait_imm.combine()

Reduces overall compile times by ~0.2%.

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

3 years agoaco/isel: avoid unnecessary calls to nir_unsigned_upper_bound()
Daniel Schürmann [Wed, 14 Jul 2021 11:47:01 +0000 (13:47 +0200)]
aco/isel: avoid unnecessary calls to nir_unsigned_upper_bound()

These were responsible for ~20% of the time
spent in instruction selection.
Reduces overall compile times by ~0.5%.

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

3 years agobroadcom/compiler: implement gl_PrimitiveID in FS without a GS
Iago Toral Quiroga [Tue, 13 Jul 2021 10:47:20 +0000 (12:47 +0200)]
broadcom/compiler: implement gl_PrimitiveID in FS without a GS

OpenGL ES 3.1 specifies that a geometry shader can write to gl_PrimitiveID,
which can then be read by a fragment shader.

OpenGL ES 3.2 additionally adds the capacity for the fragment shader
to read gl_PrimitiveID even if there is no geometry shader. This
commit adds support for this feature, which is also implicitly
expected by the geometry shader feature in Vulkan 1.0.

Fixes:
dEQP-VK.pipeline.framebuffer_attachment.no_attachments
dEQP-VK.pipeline.framebuffer_attachment.no_attachments_ms

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

3 years agov3d: better scissor tracking
Iago Toral Quiroga [Mon, 5 Jul 2021 12:24:12 +0000 (14:24 +0200)]
v3d: better scissor tracking

If all drawing is scissored but we have multiple discontinuous
scissor rects, we end up flushing all the tiles in the rect that
covers all scissor rects, which can be a waste, particularly for
large render targets. The obvious case for this are updates to a
mega texture or atlas for example.

This change checks if all rendering happenings against scissor
rects, in which case it keeps track of the rects and uses this to
discard tiles that are not included in any of them.

This optimization needs to be disabled if we have any
non-scissored rendering, including non-scissored clears.

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

3 years agozink: respect line_rectangular state
Erik Faye-Lund [Tue, 13 Jul 2021 07:37:01 +0000 (09:37 +0200)]
zink: respect line_rectangular state

This is mostly a theoretical fix for the Nine frontent, which doesn't
want rectangular lines even when multisampling.

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

3 years agozink: check for right feature
Erik Faye-Lund [Tue, 13 Jul 2021 07:33:58 +0000 (09:33 +0200)]
zink: check for right feature

I accidentally repeated the rectangular lines test instead of checking
for smooth lines. Whoopsie!

Fixes: c3b0f439a78 ("zink: fill in the right line-mode based on state")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11841>

3 years agovulkan: allocate host-visible memory for swapchain images
Erik Faye-Lund [Tue, 13 Jul 2021 13:38:16 +0000 (15:38 +0200)]
vulkan: allocate host-visible memory for swapchain images

The Vulkan 1.2 specification, section 11.2.12 ("Host Access to Device
Memory Objects") say the following:

> memory must have been created with a memory type that reports
> VK_MEMORY_PROPERTY_HOST_VISIBLE_BIT

Since there's no guarantee that there's any memory that is *both*
device-local *and* host-visible, let's just use the latter requirement.

Fixes: 8af568e4ae7 ("vulkan: implement wsi_win32 backend")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11848>

3 years agovulkan: do not map zero-sized region of memory
Erik Faye-Lund [Tue, 13 Jul 2021 13:38:16 +0000 (15:38 +0200)]
vulkan: do not map zero-sized region of memory

The Vulkan 1.2 specification, section 11.2.12 ("Host Access to Device
Memory Objects") say the following:

> If size is not equal to VK_WHOLE_SIZE, size must be greater than 0

So, mapping a zero-sized range is illegal. Let's instead map the
reported size of the image, which we already know.

Fixes: 8af568e4ae7 ("vulkan: implement wsi_win32 backend")
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11848>

3 years agoanv/allocator: Use list->u64 in free_list_push
Jason Ekstrand [Tue, 13 Jul 2021 21:23:22 +0000 (16:23 -0500)]
anv/allocator: Use list->u64 in free_list_push

Since we always modify this structure with atomics on the u64, it seems
better to use the u64 here too.  I have no idea if this fixes a bug.

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

3 years agollvmpipe: Handle NULL views in llvmpipe_cleanup_stage_sampling
Joshua Ashton [Tue, 13 Jul 2021 21:09:24 +0000 (22:09 +0100)]
llvmpipe: Handle NULL views in llvmpipe_cleanup_stage_sampling

This is the only barrier to lavapipe fully working in RenderDoc.

Fixes: 21864bdaaef6 ("llvmpipe: unmap display target of shader image/sampler")

Signed-off-by: Joshua Ashton <joshua@froggi.es>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11856>

3 years agofreedreno+turnip: Add a6xx gen4 support
Rob Clark [Thu, 8 Jul 2021 18:47:15 +0000 (11:47 -0700)]
freedreno+turnip: Add a6xx gen4 support

This adds support for a660 and a635.

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

3 years agofreedreno+turnip: Get device name from device-info table
Rob Clark [Thu, 8 Jul 2021 18:35:31 +0000 (11:35 -0700)]
freedreno+turnip: Get device name from device-info table

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

3 years agofreedreno+turnip: Add has_8bpp_ubwc
Rob Clark [Thu, 8 Jul 2021 17:43:08 +0000 (10:43 -0700)]
freedreno+turnip: Add has_8bpp_ubwc

Newer a6xx devices seem to drop 8b/pixel UBWC support.

The turnip part was adapted from Jonathans patch on !10892

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

3 years agofreedreno+turnip: Add has_cp_reg_write
Rob Clark [Thu, 8 Jul 2021 17:28:43 +0000 (10:28 -0700)]
freedreno+turnip: Add has_cp_reg_write

Newer a6xx devices drop this packet from the sqe firmware, and use
direct (pkt4) register writes instead for the few cases that previously
used CP_REG_WRITE.

The turnip part was adapted from Jonathans patch on !10892

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

3 years agoturnip: Get has_sample_locations from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:44:45 +0000 (09:44 -0700)]
turnip: Get has_sample_locations from fd_dev_info

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

3 years agoturnip: Get has_tex_filter_cubic from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:31:25 +0000 (09:31 -0700)]
turnip: Get has_tex_filter_cubic from fd_dev_info

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

3 years agoturnip: Get indirect_draw_wfm_quirk from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:25:20 +0000 (09:25 -0700)]
turnip: Get indirect_draw_wfm_quirk from fd_dev_info

At some point we might want to change this to minimum fw version, but
for now it can be a bool.

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

3 years agoturnip: Get storage_16bit from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 16:01:12 +0000 (09:01 -0700)]
turnip: Get storage_16bit from fd_dev_info

Removing more gpu_id checks that will become bogus as we add more a6xx.

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

3 years agoturnip: Drop unused vshs_workgroup param
Rob Clark [Thu, 8 Jul 2021 15:49:18 +0000 (08:49 -0700)]
turnip: Drop unused vshs_workgroup param

Unused since d968995c67f5e3a48e49015184f9ea1f143251ec, and this gets rid
of one more gpu_id check.

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

3 years agofreedreno/ir3: Get reg_size_vec4 from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 17:02:19 +0000 (10:02 -0700)]
freedreno/ir3: Get reg_size_vec4 from fd_dev_info

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

3 years agofreedreno/ir3: Get tess_use_shared from fd_dev_info
Rob Clark [Thu, 8 Jul 2021 15:37:55 +0000 (08:37 -0700)]
freedreno/ir3: Get tess_use_shared from fd_dev_info

A step towards getting rid of checks for gpu_id sprinkled around.
Checking major generation is ok, but checking for == or >= a specific
gpu_id is going to start getting messy as we add more a6xx.

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

3 years agoturnip: Convert fd_dev_info to const pointer
Rob Clark [Thu, 8 Jul 2021 01:46:49 +0000 (18:46 -0700)]
turnip: Convert fd_dev_info to const pointer

Split out from earlier patch to reduce churn.

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

3 years agofreedreno: Convert fd_dev_info to const pointer
Rob Clark [Thu, 8 Jul 2021 01:37:09 +0000 (18:37 -0700)]
freedreno: Convert fd_dev_info to const pointer

Split out from previous patch to reduce churn.

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

3 years agofreedreno: Generate device-info tables at build time
Rob Clark [Wed, 7 Jul 2021 21:47:02 +0000 (14:47 -0700)]
freedreno: Generate device-info tables at build time

This way we can make the tables const.  At the same time, for a6xx, this
introduces a "sub-generation template" to reduce the copy/paste for
parameters which are keyed to the sub-generation.  It also explicitly
lists every supported GPU, to get rid of duplicate lists of supported
gpus between the device-info and drivers.

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

3 years agofreedreno: Rename *_dev_info
Rob Clark [Wed, 7 Jul 2021 20:48:21 +0000 (13:48 -0700)]
freedreno: Rename *_dev_info

Everywhere else symbols/types/etc are shortend to "fd_*", so lets do the
same here for consistency.

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

3 years agofreedreno/common: unhardcode CCU color cache offset
Jonathan Marek [Thu, 20 May 2021 02:46:16 +0000 (22:46 -0400)]
freedreno/common: unhardcode CCU color cache offset

Replace it with a calculation which works for all current GPUs.

Duplicated the calculation in both drivers because freedreno_dev_info isn't
meant for derived parameters (and drivers might want to just calculate on
the fly instead).

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agofreedreno/a6xx: larger gmem_page_align from tile align instead of gpu id
Jonathan Marek [Thu, 20 May 2021 01:56:53 +0000 (21:56 -0400)]
freedreno/a6xx: larger gmem_page_align from tile align instead of gpu id

The larger page alignment is directly related to the 96 tile alignment,
so check for that instead of a specific gpu id.

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agotu: remove workaround for conditional rendering + hw binning
Jonathan Marek [Wed, 19 May 2021 23:04:43 +0000 (19:04 -0400)]
tu: remove workaround for conditional rendering + hw binning

- It hurts users with newer firmware who don't need the workaround
- Kernel now rejects older firmware due to security issues, so this will
  prevent users from using older firmware anyway.
- Only whitelisting 650 enables the workaround by default for any new GPUs

Signed-off-by: Jonathan Marek <jonathan@marek.ca>
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11790>

3 years agoiris: Use simple_mtx in the bufmgr.
Kenneth Graunke [Tue, 9 Jun 2020 19:05:07 +0000 (12:05 -0700)]
iris: Use simple_mtx in the bufmgr.

This avoids having to call out through the PLT just to lock/unlock.

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

3 years agopanfrost: Initialise the blend equation in create_blend_state
Icecream95 [Wed, 14 Jul 2021 00:04:42 +0000 (12:04 +1200)]
panfrost: Initialise the blend equation in create_blend_state

Valgrind still complains about uninitialised values, but tests don't
flake anymore.

Fixes flakes in dEQP-GLES3.functional.fragment_out.*

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

3 years agocrocus: use simple_mtx in the bufmgr
Dave Airlie [Tue, 13 Jul 2021 22:56:09 +0000 (08:56 +1000)]
crocus: use simple_mtx in the bufmgr

anything you can do I can do better^W^Wadapt for crocus

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11859>

3 years agoradv, aco, ac/nir: Tweak position export scheduling for NGG culling.
Timur Kristóf [Mon, 5 Jul 2021 13:26:18 +0000 (15:26 +0200)]
radv, aco, ac/nir: Tweak position export scheduling for NGG culling.

The result is about +5-ish fps in Doom Eternal.

It turns out that the location of position exports matters more
than we thought, and it's actually better to keep them at the bottom
for culling shaders rather than schedule it up to the top.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Reuse uniforms from top part of culling shaders.
Timur Kristóf [Mon, 5 Jul 2021 13:18:28 +0000 (15:18 +0200)]
ac/nir: Reuse uniforms from top part of culling shaders.

Uniforms have the same value in all invocations, therefore they
can safely be reused by invocations even after repacking.
This saves several instructions from culling shaders, mainly
UBO loads and such.

We exclude uniform floats, because those would harm the VGPR
usage of the shaders too much.

Fossil DB results on Sienna Cichlid (with NGG culling on):

Totals from 55379 (43.05% of 128647) affected shaders:
VGPRs: 1926472 -> 1925360 (-0.06%); split: -0.07%, +0.01%
SpillSGPRs: 139 -> 330 (+137.41%)
CodeSize: 159472988 -> 157462856 (-1.26%); split: -1.27%, +0.00%
MaxWaves: 1571492 -> 1571412 (-0.01%)
Instrs: 30665685 -> 30302076 (-1.19%); split: -1.21%, +0.02%
Latency: 127385148 -> 126723891 (-0.52%); split: -0.55%, +0.03%
InvThroughput: 21096298 -> 20773069 (-1.53%); split: -1.53%, +0.00%
VClause: 514792 -> 511231 (-0.69%); split: -0.83%, +0.13%
SClause: 713959 -> 679556 (-4.82%); split: -4.84%, +0.02%
Copies: 2975106 -> 2828185 (-4.94%); split: -5.39%, +0.45%
Branches: 1201921 -> 1152766 (-4.09%)
PreSGPRs: 1753786 -> 1892848 (+7.93%); split: -0.00%, +7.93%
PreVGPRs: 1590522 -> 1583574 (-0.44%); split: -0.44%, +0.00%

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Analyze culling shaders to remember which inputs are used when.
Timur Kristóf [Mon, 5 Jul 2021 13:17:10 +0000 (15:17 +0200)]
ac/nir: Analyze culling shaders to remember which inputs are used when.

These will be useful for some optimizations.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoac/nir: Reuse the repacked output positions of culling shaders.
Timur Kristóf [Tue, 4 May 2021 09:36:02 +0000 (11:36 +0200)]
ac/nir: Reuse the repacked output positions of culling shaders.

The position outputs are stored into LDS and reloaded after
repacking, therefore the repacked position values can be
reused in the bottom part of the shader.

Fossil DB results on Sienna Cichlid (with NGG culling on):

Totals from 9016 (7.01% of 128647) affected shaders:
VGPRs: 372472 -> 347560 (-6.69%); split: -6.82%, +0.13%
SpillSGPRs: 437 -> 87 (-80.09%)
CodeSize: 32359340 -> 30441692 (-5.93%); split: -5.93%, +0.00%
MaxWaves: 222030 -> 238970 (+7.63%); split: +7.83%, -0.20%
Instrs: 6207833 -> 5834149 (-6.02%); split: -6.02%, +0.00%
Latency: 27626263 -> 27890632 (+0.96%); split: -5.34%, +6.29%
InvThroughput: 4792958 -> 4361336 (-9.01%); split: -9.01%, +0.00%
VClause: 144385 -> 139586 (-3.32%); split: -9.29%, +5.97%
SClause: 141350 -> 129875 (-8.12%); split: -8.57%, +0.45%
Copies: 580017 -> 568916 (-1.91%); split: -3.60%, +1.68%
Branches: 209067 -> 209154 (+0.04%); split: -0.24%, +0.28%
PreSGPRs: 281320 -> 277814 (-1.25%)
PreVGPRs: 290040 -> 273861 (-5.58%)

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: Run algebraic optimizations before NGG lowering.
Timur Kristóf [Tue, 6 Jul 2021 06:45:33 +0000 (08:45 +0200)]
radv: Run algebraic optimizations before NGG lowering.

This makes culling shaders more efficient because they split the
shader in two parts. It is better to optimize before this split
happens.

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

3 years agoradv: Support NGG culling with new perftest environment variable.
Timur Kristóf [Tue, 8 Jun 2021 10:32:35 +0000 (12:32 +0200)]
radv: Support NGG culling with new perftest environment variable.

Currently we don't enable it on any chip by default, but
we plan to enable it soon on GFX10.3 when we are comfortable
with its performance.

RADV_PERFTEST=nggc environment variable enables it on GFX10+ GPUs.

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

3 years agoaco: Implement NGG culling related intrinsics.
Timur Kristóf [Thu, 29 Apr 2021 11:33:45 +0000 (13:33 +0200)]
aco: Implement NGG culling related intrinsics.

These are very straightforward as they just copy data from
the newly added shader arguments.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10525>

3 years agoradv: New shader args for NGG culling settings and viewport.
Timur Kristóf [Mon, 7 Jun 2021 21:23:38 +0000 (23:23 +0200)]
radv: New shader args for NGG culling settings and viewport.

Add new shader arguments in RADV for:
- NGG culling settings
- Viewport transform

These will be used by NGG culling shaders.

Additionally, some tweaks are made to some config registers
in order to make culling shaders more efficient.

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