platform/upstream/mesa.git
3 years agopan/bi: Zero initialize shader_info
Alyssa Rosenzweig [Mon, 19 Jul 2021 17:41:32 +0000 (13:41 -0400)]
pan/bi: Zero initialize shader_info

Fixes the following assert with the standalone compiler

bifrost_compiler: ../src/panfrost/bifrost/bi_opt_push_ubo.c:134: bi_opt_push_ubo: Assertion `ctx->info->push.count == 0' failed.

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

3 years agopan/bi: Parse file names in standalone compiler
Alyssa Rosenzweig [Mon, 19 Jul 2021 17:35:17 +0000 (13:35 -0400)]
pan/bi: Parse file names in standalone compiler

Would like to compile compute shaders too.

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

3 years agopan/bi: Remove unused option
Alyssa Rosenzweig [Mon, 19 Jul 2021 17:21:28 +0000 (13:21 -0400)]
pan/bi: Remove unused option

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

3 years agopan/bi: Remove unused pointer from bi_instr
Alyssa Rosenzweig [Sat, 17 Jul 2021 00:10:18 +0000 (20:10 -0400)]
pan/bi: Remove unused pointer from bi_instr

Yikes.

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

3 years agozink: use dynamic line stipple
Mike Blumenkrantz [Tue, 25 May 2021 20:57:50 +0000 (16:57 -0400)]
zink: use dynamic line stipple

save those pipeline bits!

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

3 years agoci: add another zink job with timelines disabled
Mike Blumenkrantz [Tue, 27 Jul 2021 22:01:19 +0000 (18:01 -0400)]
ci: add another zink job with timelines disabled

this codepath needs to be maintained for *vague handwaving*

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

3 years agozink: add env var to disable timelines
Mike Blumenkrantz [Tue, 27 Jul 2021 21:58:59 +0000 (17:58 -0400)]
zink: add env var to disable timelines

for ci use only

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

3 years agozink: export PIPE_CAP_TGSI_BALLOT
Mike Blumenkrantz [Mon, 5 Apr 2021 16:02:39 +0000 (12:02 -0400)]
zink: export PIPE_CAP_TGSI_BALLOT

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

3 years agozink: remove VK_EXT_shader_subgroup_ballot from device info
Mike Blumenkrantz [Wed, 21 Jul 2021 15:09:52 +0000 (11:09 -0400)]
zink: remove VK_EXT_shader_subgroup_ballot from device info

restrict this to 1.2 only

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

3 years agozink: implement compiler handling for subgroup ballot builtins/intrinsics
Mike Blumenkrantz [Mon, 5 Apr 2021 16:02:08 +0000 (12:02 -0400)]
zink: implement compiler handling for subgroup ballot builtins/intrinsics

these are all lowered and unremarkable

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

3 years agozink: lower subgroup ballot instructions
Mike Blumenkrantz [Mon, 5 Apr 2021 16:00:56 +0000 (12:00 -0400)]
zink: lower subgroup ballot instructions

this handles rewrites of ballot-related instructions/builtins to spirv
vec4 types from the native GLSL U64 type

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

3 years agozink: change descriptor flushing to assert
Mike Blumenkrantz [Fri, 21 May 2021 20:54:46 +0000 (16:54 -0400)]
zink: change descriptor flushing to assert

there should never be flushing due to pool depletion; instead, trigger an
oom flush and stall to replenish the pool after the draw/compute

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

3 years agoetnaviv: fix gbm_bo_get_handle_for_plane for multiplanar images
Philipp Zabel [Thu, 22 Jul 2021 10:47:15 +0000 (12:47 +0200)]
etnaviv: fix gbm_bo_get_handle_for_plane for multiplanar images

Implement resource_get_param for PIPE_RESOURCE_PARAM_NPLANES and fix
resource_get_handle to walk to the correct linked resource for
multiplanar images, allowing gbm_bo_get_handle_for_plane to be called
with plane > 0.

This fixes an assert that is triggered when a wayland client tries
to send weston an NV12 dmabuf, for example:

  weston: .../mesa/src/gbm/backends/dri/gbm_dri.c:752: gbm_dri_bo_get_handle_for_plane: Assertion `plane == 0' failed.

Fixes: 788f6dc85781 ('Revert "gallium/dri: fix dri2_from_planar for multiplanar images"')
Signed-off-by: Philipp Zabel <p.zabel@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12037>

3 years agovirgl: Enable caching for sampler views and render targets
Rohan Garg [Fri, 2 Jul 2021 09:56:58 +0000 (11:56 +0200)]
virgl: Enable caching for sampler views and render targets

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11241>

3 years agoRevert "Revert "virgl: Cache depth and stencil buffers""
Rohan Garg [Tue, 8 Jun 2021 09:46:57 +0000 (11:46 +0200)]
Revert "Revert "virgl: Cache depth and stencil buffers""

This reverts commit a8e75bb73c6f8ce94c4f598a2f4763b12188991c.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11241>

3 years agovirgl: Add more meta data to cached resources
Rohan Garg [Tue, 8 Jun 2021 09:43:35 +0000 (11:43 +0200)]
virgl: Add more meta data to cached resources

By expanding the meta data about resources in the cache we can match more
resources such as 3D textures, samplers and render targets.

Signed-off-by: Rohan Garg <rohan.garg@collabora.com>
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11241>

3 years agopan/va: Integrate the tests into meson test
Alyssa Rosenzweig [Fri, 16 Jul 2021 15:48:46 +0000 (11:48 -0400)]
pan/va: Integrate the tests into meson test

This way we will get testing in CI. Invoke as

   meson test --suite=panfrost

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

3 years agopan/va: Add disassembler test harness
Alyssa Rosenzweig [Fri, 16 Jul 2021 17:22:27 +0000 (13:22 -0400)]
pan/va: Add disassembler test harness

Uses the same set of cases. This is a standalone C program because the
easy way of hooking into the disassembler from Python with subprocesses
was slow. This seems cleaner anyway.

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

3 years agopan/va: Add assembler test harness
Alyssa Rosenzweig [Tue, 27 Jul 2021 19:26:07 +0000 (15:26 -0400)]
pan/va: Add assembler test harness

Integration regression testing. Nothing fancy.

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

3 years agopan/va: Add negative test cases for the assembler
Alyssa Rosenzweig [Fri, 16 Jul 2021 15:08:31 +0000 (11:08 -0400)]
pan/va: Add negative test cases for the assembler

These are lines of assembly that look valid but are not, and should
raise a parser error but not otherwise crash the assembler or produce
invalid code.

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

3 years agopan/va: Add dis/assembler test cases
Alyssa Rosenzweig [Fri, 16 Jul 2021 15:07:03 +0000 (11:07 -0400)]
pan/va: Add dis/assembler test cases

These are valid pairs of hexdumped assembled instructions and the
corresponding disassembly, to be used to regression test both the
assembler and the disassembler.

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

3 years agopan/va: Add disassembler generator
Alyssa Rosenzweig [Fri, 16 Jul 2021 14:59:27 +0000 (10:59 -0400)]
pan/va: Add disassembler generator

When we bring up the Valhall compiler in Mesa, we will like to have a
disassembler in native code, so we shouldn't write our disassembler in
Python. Instead, we write a disassembler generator in Python with mako
templates, which will produce a va_disasm_instr entrypoint from the
architecture defined in ISA.xml and valhall.py.

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

3 years agopan/va: Check for FAU conflicts in the assembler
Alyssa Rosenzweig [Wed, 21 Jul 2021 23:54:02 +0000 (19:54 -0400)]
pan/va: Check for FAU conflicts in the assembler

Logic described in the "Uniform/constant restrictions" section of the
Valhall specification. (You know, my Valhall specification. Is there
another one?)

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

3 years agopan/va: Add Valhall assembler
Alyssa Rosenzweig [Fri, 16 Jul 2021 14:52:43 +0000 (10:52 -0400)]
pan/va: Add Valhall assembler

This Python script acts as a standalone assembler. It takes Valhall
instructions with Mesa-flavour syntax, parses them, errors out if there
are syntax errors, and writes out an assembled binary if there are not.
It also is available as a programmatic interface for automated testing.

While this attempts to handle syntax errors, it does not check
semantics. It will happily compile programs that fault, provided each
instruction locally 'looks' plausible.

The code itself is quite small, despite supporting most of the known
ISA, because the syntax is regular and the heavylifting is done by
ISA.xml and valhall.py.

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

3 years agopan/va: Assert no instructions are duplicated
Alyssa Rosenzweig [Fri, 23 Jul 2021 21:19:21 +0000 (17:19 -0400)]
pan/va: Assert no instructions are duplicated

Caught a bug in the published PDF. Whoops!

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

3 years agopan/va: Add ISA.xml parser and support code
Alyssa Rosenzweig [Fri, 16 Jul 2021 14:49:35 +0000 (10:49 -0400)]
pan/va: Add ISA.xml parser and support code

This Python module parses the ISA.xml file added in the previous
commits, extracts all the useful information, and combines it with
extra annotations. In total, it provides a programmatic way to interface
with the Valhall instruction set.

   from valhall import instructions, enums

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

3 years agopan/va: Add initial ISA.xml for Valhall
Alyssa Rosenzweig [Fri, 16 Jul 2021 14:40:58 +0000 (10:40 -0400)]
pan/va: Add initial ISA.xml for Valhall

This handwritten file is the product of over a hundred hours of
reverse-engineering and represents the sum of what I've learned about
the Valhall architecture. It will be used in the next commits as the
backbone of a Valhall toolchain.

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

3 years agollvmpipe: correct the debug information printed with GALLIVM_PERF=nopt
suijingfeng [Mon, 19 Jul 2021 15:06:48 +0000 (23:06 +0800)]
llvmpipe: correct the debug information printed with GALLIVM_PERF=nopt

GALLIVM_PERF_NO_OPT is "belond" to GALLIVM_PERF environment variable,
not GALLIVM_DEBUG. when GALLIVM_PERF=nopt is passed to llvmpipe,
"-sroa -early-cse -simplifycfg -reassociate -constprop -instcombine -gvn"
should not be printed. Those llvm optimation techniques should only be
printed when the default(-O2) optimation is enabled.

$ GALLIVM_PERF=nopt GALLIVM_DEBUG=dumpbc glmark2

Before apply this patch:

  Invoke as "opt -sroa -early-cse -simplifycfg -reassociate -mem2reg -constprop -instcombine -gvn ir_setup_variant_0.bc | llc -O2 [-mcpu=<-mcpu option>] [-mattr=<-mattr option(s)>]"

After apply this patch:

  Invoke as "opt -mem2reg ir_fs304_variant0.bc | llc -O0 [-mcpu=<-mcpu option>] [-mattr=<-mattr option(s)>]"

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Signed-off-by: suijingfeng <suijingfeng@loongson.cn>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11994>

3 years agogallium: Reset {d,r}Priv in dri_unbind_context
Lepton Wu [Sat, 24 Jul 2021 04:27:00 +0000 (21:27 -0700)]
gallium: Reset {d,r}Priv in dri_unbind_context

The code in dri_make_current just checks the value of the pointers
to decide to update texture_stamp or not. This is buggy since a new
allocated drawable could share the same address with the previous
released drawable. Fix the stale pointer issue by always resetting
these pointers to NULL in dri_unbind_context.

v2:
   Move the reset codes to the end of the function.

Signed-off-by: Lepton Wu <lepton@chromium.org>
Cc: mesa-stable
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Emil Velikov <emil.l.velikov@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12050>

3 years agoanv/android: Rework our handling of AHardwareBuffer imports
Jason Ekstrand [Thu, 22 Jul 2021 16:17:28 +0000 (11:17 -0500)]
anv/android: Rework our handling of AHardwareBuffer imports

The current code we have for this is a bit of a mess, likely due to
trying too hard to put it in anv_android.c.  The external_format bit in
anv_image, for instance, really means "quit creation early" which is
something we want to do for AHardwareBuffer imports regardless of
whether or not they use a native format.  It gets set both by declaring
an AHardwareBuffer external handle type and by VkExternalFormatANDROID.
However, VkExternalFormatANDROID is only allowed for AHardwareBuffer
imports.  If we ever did get an external format outside the context of
an AHardwareBuffer import, we would end up with a useless partially
created image.

When we detect an AHardwareBuffer import, we punt off to a function in
anv_android.c that does nothing interesting but call anv_create_image
with AUX disabled and external_format = true.  The aux disable here is
useless because the actual isl_surf layout is done by resolve_ahw_image
which also sets ISL_SURF_USAGE_DISABLE_AUX_BIT.  As far as external
formats go, anv_image_from_external() sets it regardless of whether or
not there is actually an external format.

This commit replaces anv_image::external_format with anv_image::from_ahb
which is the thing we actually want to track for this.  We delete
anv_image_from_external and a bunch of the external_format handling
because it's all useless.  The end result is massively simpler and,
while it appears to blur the boundary between Android code and the rest
of the driver, it makes the whole flow more obvious.

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

3 years agotu: Triage some CTS failures
Connor Abbott [Mon, 26 Jul 2021 14:01:03 +0000 (16:01 +0200)]
tu: Triage some CTS failures

These should be fixed by the linked VK-GL-CTS change. I couldn't
reproduce the other renderpass failure on a650 though.

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

3 years agopanvk: Implement vkCmdClearAttachments
Tomeu Vizoso [Fri, 9 Jul 2021 14:11:50 +0000 (16:11 +0200)]
panvk: Implement vkCmdClearAttachments

For now it only supports one RT and color attachments.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: Expose panvk_cmd_alloc_fb_desc and panvk_cmd_alloc_tls_desc
Tomeu Vizoso [Fri, 9 Jul 2021 14:10:56 +0000 (16:10 +0200)]
panvk: Expose panvk_cmd_alloc_fb_desc and panvk_cmd_alloc_tls_desc

For use in panvk_meta.c.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: A pipeline might not be bound when the render pass is ended
Tomeu Vizoso [Thu, 8 Jul 2021 13:48:42 +0000 (15:48 +0200)]
panvk: A pipeline might not be bound when the render pass is ended

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: Move check for fragment requirement up to the draw
Tomeu Vizoso [Fri, 23 Jul 2021 11:05:41 +0000 (13:05 +0200)]
panvk: Move check for fragment requirement up to the draw

As the panvk_cmd_alloc_fb_desc function might be called outside a draw,
without a pipeline having been bound to the command buffer.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: Close batch when ending a command buffer
Tomeu Vizoso [Thu, 22 Jul 2021 13:40:45 +0000 (15:40 +0200)]
panvk: Close batch when ending a command buffer

In some cases, there will be an open batch because an event operation
has been recorded, or a non-rendering command.

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: Start a new batch when the job index gets above the limit
Tomeu Vizoso [Tue, 6 Jul 2021 09:45:56 +0000 (11:45 +0200)]
panvk: Start a new batch when the job index gets above the limit

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agopanvk: Don't try to update samplers if they are immutable
Tomeu Vizoso [Tue, 6 Jul 2021 09:14:13 +0000 (11:14 +0200)]
panvk: Don't try to update samplers if they are immutable

Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12019>

3 years agoci/v3dv: update vulkan expected results
Juan A. Suarez Romero [Mon, 26 Jul 2021 11:14:08 +0000 (13:14 +0200)]
ci/v3dv: update vulkan expected results

Add a couple of flakes.

Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12068>

3 years agoglsl: Properly handle .length() of an unsized array
Yevhenii Kolesnikov [Wed, 14 Jul 2021 17:52:56 +0000 (20:52 +0300)]
glsl: Properly handle .length() of an unsized array

There are two distinct cases:
- The last member of a shader storage block (length determined at run-time)
- Implicitly-sized array (length determined at link-time)

Fixes: 273f61a0051a ("glsl: Add parser/compiler support for unsized array's length()")
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11952>

3 years agoglsl: Add operator for .length() method on implicitly-sized arrays
Yevhenii Kolesnikov [Wed, 14 Jul 2021 17:39:45 +0000 (20:39 +0300)]
glsl: Add operator for .length() method on implicitly-sized arrays

ARB_shader_storage_buffer_object extension (promoted to core in 4.3) allows us
to call .length() method on arrays declared without an explicit size. The length is
determined at link time as a maximum array access.

Fixes: 273f61a0051a ("glsl: Add parser/compiler support for unsized array's length()")
Signed-off-by: Yevhenii Kolesnikov <yevhenii.kolesnikov@globallogic.com>
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11952>

3 years agolima: avoid crash with negative viewport values
Erico Nunes [Sun, 25 Jul 2021 11:48:59 +0000 (13:48 +0200)]
lima: avoid crash with negative viewport values

The viewport value computations done in lima_set_viewport_states
can result in a negative value for viewport.
These could end up converted to unsigned values in
lima_clip_scissor_to_viewport causing crashes from invalid
scissor commands.
Prevent this by limiting the minimum value to zero as is already
done for the left and bottom values.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/2938
Cc: mesa-stable
Signed-off-by: Erico Nunes <nunes.erico@gmail.com>
Reviewed-by: Vasily Khoruzhick <anarsoul@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12055>

3 years agodlist: don't handle unmerged draws as merged
Pierre-Eric Pelloux-Prayer [Tue, 20 Jul 2021 12:31:19 +0000 (14:31 +0200)]
dlist: don't handle unmerged draws as merged

The comment was incorrect: we can have N draws using the
same mode with N > 1 (eg: GL_QUAD_STRIP draws
cannot be merged).

This commit fixes the drawing code to use the correct draw
function.

This fixes a hang in Starsector (see issue #5086).

Fixes: b328d8e9bc9 ("dlist: use an union instead of allocating a 1-sized array")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11978>

3 years agov3dv: expose VK_KHR_multiview
Iago Toral Quiroga [Tue, 20 Jul 2021 09:32:17 +0000 (11:32 +0200)]
v3dv: expose VK_KHR_multiview

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

3 years agov3dv: implement interaction of queries with multiview
Iago Toral Quiroga [Fri, 23 Jul 2021 12:49:05 +0000 (14:49 +0200)]
v3dv: implement interaction of queries with multiview

When multiview is enabled, queries must begin and end in the
same subpass and N consecutive queries are implicitly used,
where N is the number of views enabled in the subpass.
Implementations decide how results are split across queries.

In our case, only one query is really used, but we still need
to flag all N queries as available by the time we flag the one
we use so that the application doesn't receive unexpected errors
when trying to retrieve values from them.

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

3 years agov3dv: fix query error handling
Iago Toral Quiroga [Fri, 23 Jul 2021 11:45:54 +0000 (13:45 +0200)]
v3dv: fix query error handling

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

3 years agov3dv: track first and last subpass that use a view index
Iago Toral Quiroga [Fri, 23 Jul 2021 10:21:38 +0000 (12:21 +0200)]
v3dv: track first and last subpass that use a view index

When multiview is enabled, we no longer care about when a particular
attachment is first or last used in a render pass, since not all views
in the attachment will meet that criteria. Instead, we need to track
each individual view (layer) in each attachment and emit our stores,
loads and clears accordingly.

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

3 years agov3dv: skip processing tiles for layers that are not in the view mask
Iago Toral Quiroga [Thu, 22 Jul 2021 12:06:28 +0000 (14:06 +0200)]
v3dv: skip processing tiles for layers that are not in the view mask

If a multiview subpass doesn't use a particular layer then we can ignore
that layer completely.

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

3 years agov3dv: use correct number of layers for multiview
Iago Toral Quiroga [Thu, 22 Jul 2021 11:50:16 +0000 (13:50 +0200)]
v3dv: use correct number of layers for multiview

The Vulkan spec states that when multiview is enabled the number of
layers in the framebuffer is set to one and that each attachment
must then have at least as many layers as referenced by view masks
in the subpasses in which is used.

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

3 years agov3dv: don't merge subpasses with different view masks
Iago Toral Quiroga [Thu, 22 Jul 2021 11:49:48 +0000 (13:49 +0200)]
v3dv: don't merge subpasses with different view masks

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

3 years agov3dv: broadcast multiview draw commands
Iago Toral Quiroga [Fri, 23 Jul 2021 07:41:14 +0000 (09:41 +0200)]
v3dv: broadcast multiview draw commands

We implement multiview by replicating draw commands for all enabled
views and setting a command buffer state for the currently active
view we are broadcasting to.

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

3 years agobroadcom/compiler: implement nir_intrinsic_load_view_index
Iago Toral Quiroga [Fri, 23 Jul 2021 07:38:02 +0000 (09:38 +0200)]
broadcom/compiler: implement nir_intrinsic_load_view_index

This is used for multiview's gl_ViewIndex built-in.

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

3 years agov3dv: inject a custom passthrough geometry shader for multiview pipelines
Iago Toral Quiroga [Fri, 23 Jul 2021 10:42:59 +0000 (12:42 +0200)]
v3dv: inject a custom passthrough geometry shader for multiview pipelines

This allows us to use layered rendering to broadcast draw calls to the
appropriate views (layers).

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

3 years agov3dv: move all our NIR pre-processing to preprocess_nir
Iago Toral Quiroga [Fri, 23 Jul 2021 10:42:27 +0000 (12:42 +0200)]
v3dv: move all our NIR pre-processing to preprocess_nir

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

3 years agov3dv: store multiview info in our render pass data
Iago Toral Quiroga [Tue, 20 Jul 2021 08:57:12 +0000 (10:57 +0200)]
v3dv: store multiview info in our render pass data

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

3 years agov3dv: drop unused parameters
Iago Toral Quiroga [Wed, 21 Jul 2021 11:12:06 +0000 (13:12 +0200)]
v3dv: drop unused parameters

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

3 years agoradv: implement VK_EXT_shader_atomic_float2
Samuel Pitoiset [Thu, 10 Jun 2021 10:10:37 +0000 (12:10 +0200)]
radv: implement VK_EXT_shader_atomic_float2

Some floating atomic instructions are not available on GFX8-9.
No LLVM support.

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/12060>

3 years agoaco: implement VK_EXT_shader_atomic_float2
Samuel Pitoiset [Thu, 10 Jun 2021 12:04:17 +0000 (14:04 +0200)]
aco: implement VK_EXT_shader_atomic_float2

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/12060>

3 years agovenus: log more WSI messages
Chia-I Wu [Wed, 21 Jul 2021 23:34:55 +0000 (16:34 -0700)]
venus: log more WSI messages

They can be useful before resorting to gdb or perfetto.

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/12073>

3 years agoturnip: Add support for VK_VALVE_mutable_descriptor_type
Eduardo Lima Mitev [Tue, 27 Jul 2021 04:49:56 +0000 (04:49 +0000)]
turnip: Add support for VK_VALVE_mutable_descriptor_type

v1.  Hyunjun Ko <zzoon@igalia.com>
- Add to hanlde VK_DESCRIPTOR_POOL_CREATE_HOST_ONLY_BIT_VALVE
- Don't support VK_DESCRIPTOR_TYPE_INPUT_ATTACHMENT and
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER

v2.  Hyunjun Ko <zzoon@igalia.com>
- Fix some indentations and nitpicks.
- Add the extension to features.txt

v3.  Hyunjun Ko <zzoon@igalia.com>
- Remove unnecessary asserts.

Signed-off-by: Eduardo Lima Mitev <elima@igalia.com>
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9322>

3 years agovenus: suballocate memory in more cases
Chia-I Wu [Tue, 27 Jul 2021 01:09:39 +0000 (18:09 -0700)]
venus: suballocate memory in more cases

When a dedicated allocation is not required, ignore it and suballocate.

Fixes dEQP-VK.api.invariance.random.

Cc: 21.2 mesa-stable
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/12072>

3 years agovenus: clean up vn_AllocateMemory
Chia-I Wu [Mon, 26 Jul 2021 23:58:53 +0000 (16:58 -0700)]
venus: clean up vn_AllocateMemory

Mainly to add vn_device_memory_should_suballocate.

Cc: 21.2 mesa-stable
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/12072>

3 years agollvmpipe: fix nir dot products (fsum op)
Roland Scheidegger [Mon, 26 Jul 2021 14:55:10 +0000 (16:55 +0200)]
llvmpipe: fix nir dot products (fsum op)

When the dot product uses a source which can be optimized to a scalar,
after a bunch of nir optimization steps the source to fsum will be a scalar
with a x replicate swizzle. Hence nir_src_num_components is just 1 and the
fsum was just a no-op which is not correct. Arguably this could be optimized
a bit better, but just determine the number of addends by using nir_op_infos
instead (the operand fetch was fixed already by 39a938ecf41b doing the same).

Fixes: 4eb0475b5a00 ("gallivm/nir: add fsum support")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12066>

3 years agozink: EXT_vertex_input_dynamic_state
Mike Blumenkrantz [Thu, 13 May 2021 19:55:43 +0000 (15:55 -0400)]
zink: EXT_vertex_input_dynamic_state

this eliminates vertex attributes from the pipeline state, massively
deduplicating the number of pipelines needed

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

3 years agozink: improve oom flushing
Mike Blumenkrantz [Tue, 1 Jun 2021 12:08:02 +0000 (08:08 -0400)]
zink: improve oom flushing

flush on 30k works and also check oom_flush

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

3 years agozink: merge draw_count and compute_count, move to batch struct
Mike Blumenkrantz [Fri, 21 May 2021 21:27:43 +0000 (17:27 -0400)]
zink: merge draw_count and compute_count, move to batch struct

one fewer deref and now it's a single counter

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

3 years agozink: more explicitly check shader stages during compile
Mike Blumenkrantz [Thu, 24 Jun 2021 14:21:57 +0000 (10:21 -0400)]
zink: more explicitly check shader stages during compile

this is a bit more obvious

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

3 years agozink: remove no longer used internal resource function
Mike Blumenkrantz [Wed, 7 Jul 2021 13:43:07 +0000 (09:43 -0400)]
zink: remove no longer used internal resource function

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

3 years agozink: replace some direct batch_usage calls with resource abstractions
Mike Blumenkrantz [Wed, 7 Jul 2021 13:42:46 +0000 (09:42 -0400)]
zink: replace some direct batch_usage calls with resource abstractions

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

3 years agozink: use new resource batch usage utils for is_resource_busy
Mike Blumenkrantz [Wed, 7 Jul 2021 13:39:50 +0000 (09:39 -0400)]
zink: use new resource batch usage utils for is_resource_busy

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

3 years agozink: simplify some dumb code in invalidate_buffer
Mike Blumenkrantz [Mon, 26 Jul 2021 23:51:40 +0000 (19:51 -0400)]
zink: simplify some dumb code in invalidate_buffer

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

3 years agozink: use resource batch usage helpers in invalidate_buffer()
Mike Blumenkrantz [Wed, 7 Jul 2021 13:37:35 +0000 (09:37 -0400)]
zink: use resource batch usage helpers in invalidate_buffer()

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

3 years agozink: collapse a conditional in zink_batch_resource_usage_set()
Mike Blumenkrantz [Wed, 7 Jul 2021 13:33:16 +0000 (09:33 -0400)]
zink: collapse a conditional in zink_batch_resource_usage_set()

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

3 years agozink: add some resource util functions for batch usage
Mike Blumenkrantz [Wed, 7 Jul 2021 13:36:45 +0000 (09:36 -0400)]
zink: add some resource util functions for batch usage

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

3 years agozink: force batch completion check on query result
Mike Blumenkrantz [Thu, 22 Jul 2021 14:51:23 +0000 (10:51 -0400)]
zink: force batch completion check on query result

non-timeline drivers have no screen-based method of "checking" batch
completion, so the context method has to be used here to avoid an infinite
loop

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

3 years agozink: add screen function for checking usage completion
Mike Blumenkrantz [Wed, 26 May 2021 12:24:17 +0000 (08:24 -0400)]
zink: add screen function for checking usage completion

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

3 years agofreedreno/a6xx: Add missing PC_CCU_INVALIDATE_x
Rob Clark [Sat, 24 Jul 2021 00:10:51 +0000 (17:10 -0700)]
freedreno/a6xx: Add missing PC_CCU_INVALIDATE_x

The kernel normally inserts these between submits, but when we merge
submits in userspace we need to add them ourselves.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5114
Fixes: cccdc513e3e ("freedreno/drm/sp: Implement deferred submit merging")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12049>

3 years agozink: use array size in spirv bo length calculations
Mike Blumenkrantz [Mon, 26 Jul 2021 17:11:18 +0000 (13:11 -0400)]
zink: use array size in spirv bo length calculations

I don't know why I was dropping this, but doing so breaks drivers that have
optimization passes based on the lengths of these variables

Fixes: c1cdf30a119 ("zink: apply Delete All The Code methodology to the ubo/ssbo variables")

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

3 years agokmsro: Add 'kirin' driver support
Roman Stratiienko [Wed, 7 Jul 2021 07:16:25 +0000 (10:16 +0300)]
kmsro: Add 'kirin' driver support

Kirin is used by hisilicon SOCs (Hikey boards, etc.)
Driver is available in the mainline kernel [1]

[1]: https://elixir.bootlin.com/linux/v5.13/source/drivers/gpu/drm/hisilicon/kirin/kirin_drm_ade.c#L928

Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11755>

3 years agocrocus/gen4: restrict memcpy mapping to gen5
Dave Airlie [Mon, 26 Jul 2021 05:27:52 +0000 (15:27 +1000)]
crocus/gen4: restrict memcpy mapping to gen5

This is due to gen4 + 4.5 having some rather strange swizzling
that we can't actually detect properly in userspace

Fixes: f3630548f1da ("crocus: initial gallium driver for Intel gfx 4-7")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12058>

3 years agofrontends/va: change to per-layer rate control
Thong Thai [Tue, 13 Jul 2021 16:04:39 +0000 (12:04 -0400)]
frontends/va: change to per-layer rate control

Allows for each layer in a Scalable Video Coding (SVC) video to have its
own rate control setting, when encoding H.264.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agofrontends/omx: change rate ctrl struct to array
Thong Thai [Tue, 13 Jul 2021 16:03:59 +0000 (12:03 -0400)]
frontends/omx: change rate ctrl struct to array

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agoradeon/vcn/enc: change to per-temporal layer rate control
Thong Thai [Tue, 13 Jul 2021 16:06:17 +0000 (12:06 -0400)]
radeon/vcn/enc: change to per-temporal layer rate control

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agoradeon/vce: change rate ctrl struct to array
Thong Thai [Tue, 13 Jul 2021 16:06:00 +0000 (12:06 -0400)]
radeon/vce: change rate ctrl struct to array

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agor600: change rate ctrl struct to array
Thong Thai [Tue, 13 Jul 2021 15:59:50 +0000 (11:59 -0400)]
r600: change rate ctrl struct to array

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agogallium: change rate ctrl struct to array
Thong Thai [Tue, 13 Jul 2021 15:59:11 +0000 (11:59 -0400)]
gallium: change rate ctrl struct to array

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agofrontends/va: handle h264 num_temporal_layers for SVC encoding
Thong Thai [Tue, 13 Jul 2021 15:51:08 +0000 (11:51 -0400)]
frontends/va: handle h264 num_temporal_layers for SVC encoding

Allows for the number of temporal layers to be specified when encoding
Scalable Video Coding (SVC) H.264 videos.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agoradeonsi: enable H.264 temporal encoding support for VCN
Thong Thai [Tue, 13 Jul 2021 15:55:14 +0000 (11:55 -0400)]
radeonsi: enable H.264 temporal encoding support for VCN

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agoradeon/vcn/enc: H.264 SVC encode
Thong Thai [Tue, 13 Jul 2021 15:51:39 +0000 (11:51 -0400)]
radeon/vcn/enc: H.264 SVC encode

Implement H.264 temporal, Scalable Video Coding (SVC) for VCN devices by
sending the required parameters to the firmware, and creating H.264 NALU
prefix and SEI scalability_info headers.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agogallium: update h264 struct to track temporal layers
Thong Thai [Tue, 13 Jul 2021 15:52:11 +0000 (11:52 -0400)]
gallium: update h264 struct to track temporal layers

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agofrontends/va: check number of temporal layers supported by encoder
Thong Thai [Tue, 13 Jul 2021 15:55:28 +0000 (11:55 -0400)]
frontends/va: check number of temporal layers supported by encoder

Checks the encoder to determine the number of temporal layers supported,
and returns max_num_temporal_layers_minus1, along with setting the
corresponding control flag if multiple layers are supported.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agogallium: add temporal layers cap enum
Thong Thai [Tue, 13 Jul 2021 15:55:00 +0000 (11:55 -0400)]
gallium: add temporal layers cap enum

Determine the number of temporal layers the encoder supports. Used for
encoding Scalable Video Coding (SVC) videos.

Signed-off-by: Thong Thai <thong.thai@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11850>

3 years agotu: handle half-reg fs outputs
Danylo Piliaiev [Mon, 26 Jul 2021 15:09:12 +0000 (18:09 +0300)]
tu: handle half-reg fs outputs

This would allow to enable translation of RelaxedPrecision spirv
variable decorator into mediump which for us means fp16.

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

3 years agonv30: fix emulated vertex index buffers
Karol Herbst [Sun, 25 Jul 2021 00:10:29 +0000 (02:10 +0200)]
nv30: fix emulated vertex index buffers

We ended up applying the offset twice. Quite embarrassing.

This fixes a bunch of vertex shader related issues like the gnome desktop
is less broken and probably a lot of other applications.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5061
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12054>

3 years agoradv: allow unused VkSpecializationMapEntries
Samuel Pitoiset [Mon, 26 Jul 2021 11:47:13 +0000 (13:47 +0200)]
radv: allow unused VkSpecializationMapEntries

Fixes future CTS: dEQP-VK.pipeline.spec_constant.*.basic.*unused_*

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/12062>

3 years agonir/shrink_vectors: shrink vecN properly
Daniel Schürmann [Mon, 12 Jul 2021 09:00:29 +0000 (11:00 +0200)]
nir/shrink_vectors: shrink vecN properly

This patch allows to shrink vecN instructions where
one or more components at any position are unused.

Stat changes for softpipe:
total instructions in shared programs: 2986101 -> 2985416 (-0.02%)
instructions in affected programs: 51216 -> 50531 (-1.34%)

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

3 years agonir/shrink_vectors: shrink ALU properly
Daniel Schürmann [Wed, 7 Jul 2021 14:43:13 +0000 (16:43 +0200)]
nir/shrink_vectors: shrink ALU properly

ALU instructions of which not all components are read,
can be shrunk to the number of read components.
Previously, this would only remove trailing components.

This patch enables to remove components from any position.

Stat changes for softpipe:
total instructions in shared programs: 3001291 -> 2984698 (-0.55%)
instructions in affected programs: 225585 -> 208992 (-7.36%)
total loops in shared programs: 1389 -> 1358 (-2.23%)
loops in affected programs: 36 -> 5 (-86.11%)

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

3 years agonir/opt_shrink_vectors: reverse iteration order
Daniel Schürmann [Wed, 16 Jun 2021 07:20:01 +0000 (09:20 +0200)]
nir/opt_shrink_vectors: reverse iteration order

This pass should be backwards in order to reach the fixed point
in linear time.

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

3 years agonir: consider write_mask in nir_ssa_def_components_read()
Daniel Schürmann [Mon, 14 Jun 2021 17:19:23 +0000 (19:19 +0200)]
nir: consider write_mask in nir_ssa_def_components_read()

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

3 years agonir/opt_shrink_vectors: don't shrink vectors used by intrinsics
Daniel Schürmann [Thu, 22 Jul 2021 07:51:32 +0000 (09:51 +0200)]
nir/opt_shrink_vectors: don't shrink vectors used by intrinsics

Store intrinsics shrink the sources by creating a new vecN.
Other intrinsics cannot shrink their sources.

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