platform/upstream/mesa.git
2 years agonouveau/nir: Put the UBO offset indirect into the address reg.
Emma Anholt [Mon, 25 Apr 2022 23:32:39 +0000 (16:32 -0700)]
nouveau/nir: Put the UBO offset indirect into the address reg.

Fixes indirect UBO addressing pre-nvc0.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>

2 years agonv50/nir: align tlsspace to 0x10
Karol Herbst [Mon, 25 Apr 2022 20:21:16 +0000 (22:21 +0200)]
nv50/nir: align tlsspace to 0x10

nvc0 aligns to 0x10 in setting up its rogram header, but nv50 TLS
allocation expects the incoming value to be aligned already (like TGSI
always did).  Avoids regression in
KHR-GL33.shaders.arrays.declaration.dynamic_expression_array_access_* with
the nir backend.

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

2 years agonouveau/nir: Add support for pre-GF100 images and ssbos.
Emma Anholt [Sun, 24 Apr 2022 19:44:23 +0000 (12:44 -0700)]
nouveau/nir: Add support for pre-GF100 images and ssbos.

We have to allocate them slots in the global file.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>

2 years agoci/nouveau: Add MESA_GLES_VERSION_OVERRIDE=3.1 baseline state.
Emma Anholt [Sun, 24 Apr 2022 17:19:34 +0000 (10:19 -0700)]
ci/nouveau: Add MESA_GLES_VERSION_OVERRIDE=3.1 baseline state.

imirkin requested that I test the GLES31 codepaths on nv50, and this is
the best I can do with the hardware I have.

Acked-by: Ilia Mirkin <imirkin@alum.mit.edu>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>

2 years agonouveau/nir: Move FS output stores to the end of the last block.
Emma Anholt [Wed, 20 Apr 2022 23:30:37 +0000 (16:30 -0700)]
nouveau/nir: Move FS output stores to the end of the last block.

The nir_move/sink caused instructions to sink interleaved into the output
stores at the end of the shader.  nouveau's RA doesn't track liveness of
FS outputs in registers after the export instruction, so they could end up
overwritten.  To work around it, after normal NIR move/sink, move the
output stores back to the end of the shader.

Fixes: b1fa2068b8e8 ("nouveau/nir: Enable nir_opt_move/sink.")

Reviewed-by: M Henning <drawoc@darkrefraction.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15949>

2 years agoturnip: fix drm modifier support with planar formats
Chia-I Wu [Tue, 26 Apr 2022 04:45:50 +0000 (21:45 -0700)]
turnip: fix drm modifier support with planar formats

We need to advertise the results of tu6_plane_count and handle
VK_IMAGE_ASPECT_MEMORY_PLANE_*_BIT.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6374
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16169>

2 years agomesa: add missing error-path
Erik Faye-Lund [Thu, 28 Apr 2022 09:47:37 +0000 (11:47 +0200)]
mesa: add missing error-path

The ARB_shader_objects spec says the following:

> The error INVALID_VALUE is generated by any command that takes one or
> more handles as input, and one or more of these handles are not an
> object handle generated by OpenGL.

And a long, long time ago, we used do to just that for
glDeleteObjectARB... Until 9ac9605de15, all the way back in February 2006,
where the error condition was removed without explanation.

Let's restore it, because it should really be there.

This was noticed by running the tests that are in the mesa-demos
repository, that actually tested this condition.

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

2 years agogallium/xlib: fix stale comment
Erik Faye-Lund [Fri, 29 Apr 2022 07:20:33 +0000 (09:20 +0200)]
gallium/xlib: fix stale comment

We haven't been doing what the comment says for about a decade, it's
about time to update the comment!

Fixes: 5f60a00743f ("st/glx: remove STENCIL_BITS, DEFAULT_SOFTWARE_DEPTH_BITS")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>

2 years agomeson: deprecate specifying osmesa-bits
Erik Faye-Lund [Fri, 29 Apr 2022 07:15:58 +0000 (09:15 +0200)]
meson: deprecate specifying osmesa-bits

This option has no meaningful effect any more other than pointlessly
renaming the the library. Let's introduce a new default value called
"unspecified", and complain if it's set to anything else.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>

2 years agomeson: remove unused defines
Erik Faye-Lund [Thu, 28 Apr 2022 12:05:14 +0000 (14:05 +0200)]
meson: remove unused defines

These defines are no longer used since we removed libmesa_classic.

Fixes: e030d5ba8ac ("mesa: Delete libmesa_classic")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16213>

2 years agoiris: Fix assertion meant to only target the clear-color stride
Jordan Justen [Fri, 29 Apr 2022 09:37:25 +0000 (02:37 -0700)]
iris: Fix assertion meant to only target the clear-color stride

Fixes: 2bc8c61fd00 ("iris: Return a 64B stride for clear color plane")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6398
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16241>

2 years agomicrosoft/compiler: Unload DXIL validator library *after* calling Release()
Jesse Natalie [Thu, 28 Apr 2022 20:52:11 +0000 (13:52 -0700)]
microsoft/compiler: Unload DXIL validator library *after* calling Release()

Otherwise, the code to actually run Release() might not be loaded or
callable anymore.

Fixes: 193cf76c ("microsoft/compiler: add common dxil-validator API")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16225>

2 years agoaco/optimizer: prevent any overflow between SGPR and const offset on MUBUF
Daniel Schürmann [Fri, 25 Mar 2022 11:03:27 +0000 (12:03 +0100)]
aco/optimizer: prevent any overflow between SGPR and const offset on MUBUF

Apparently, if the SGPR offset + const offset overflows,
it doesn't work.

Totals from 145 (0.11% of 134913) affected shaders: (GFX10.3)
SpillSGPRs: 134 -> 104 (-22.39%)
CodeSize: 1632676 -> 1645916 (+0.81%); split: -0.03%, +0.84%
Instrs: 316920 -> 320252 (+1.05%); split: -0.01%, +1.07%
Latency: 1456285 -> 1459686 (+0.23%); split: -0.02%, +0.25%
InvThroughput: 165785 -> 166086 (+0.18%); split: -0.02%, +0.20%
VClause: 6815 -> 6875 (+0.88%); split: -0.03%, +0.91%
SClause: 19089 -> 19079 (-0.05%); split: -0.06%, +0.01%
PreSGPRs: 7302 -> 7304 (+0.03%); split: -0.01%, +0.04%

Fixes: KHR-GL45.shader_storage_buffer_object.basic-operations-case1-cs
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15866>

2 years agoaco: adjust num_waves for LDS before scheduling
Daniel Schürmann [Tue, 19 Apr 2022 09:33:22 +0000 (11:33 +0200)]
aco: adjust num_waves for LDS before scheduling

Totals from 67 (0.05% of 134913) affected shaders: (GFX10.3)
VGPRs: 2024 -> 2136 (+5.53%); split: -0.40%, +5.93%
CodeSize: 162364 -> 162348 (-0.01%); split: -0.08%, +0.07%
MaxWaves: 1882 -> 1816 (-3.51%); split: +0.11%, -3.61%
Instrs: 29176 -> 29162 (-0.05%); split: -0.09%, +0.04%
Latency: 329984 -> 327272 (-0.82%); split: -0.88%, +0.06%
InvThroughput: 54653 -> 54672 (+0.03%); split: -0.01%, +0.04%
VClause: 782 -> 761 (-2.69%); split: -2.81%, +0.13%
SClause: 833 -> 824 (-1.08%); split: -2.28%, +1.20%
Copies: 1872 -> 1873 (+0.05%); split: -0.37%, +0.43%

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

2 years agoaco: split num_waves adjustment into separate function
Daniel Schürmann [Tue, 19 Apr 2022 09:32:56 +0000 (11:32 +0200)]
aco: split num_waves adjustment into separate function

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

2 years agoaco: remove 'max_waves' and use 'num_waves' to adjust for LDS and workgroup size
Daniel Schürmann [Tue, 19 Apr 2022 14:58:26 +0000 (16:58 +0200)]
aco: remove 'max_waves' and use 'num_waves' to adjust for LDS and workgroup size

Totals from 21 (0.02% of 134913) affected shaders: (GFX10.3)
VGPRs: 1024 -> 1176 (+14.84%)
CodeSize: 127824 -> 127664 (-0.13%); split: -0.17%, +0.04%
MaxWaves: 416 -> 378 (-9.13%)
Instrs: 22521 -> 22502 (-0.08%); split: -0.17%, +0.09%
Latency: 146386 -> 143154 (-2.21%); split: -2.21%, +0.00%
InvThroughput: 28379 -> 28944 (+1.99%); split: -0.23%, +2.22%
VClause: 575 -> 579 (+0.70%); split: -0.87%, +1.57%
SClause: 692 -> 645 (-6.79%)
Copies: 780 -> 747 (-4.23%); split: -4.74%, +0.51%

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

2 years agoturnip: Fix tu_debug_flags values clashing
Danylo Piliaiev [Fri, 29 Apr 2022 14:39:25 +0000 (17:39 +0300)]
turnip: Fix tu_debug_flags values clashing

Was not caught during rebase...

Fixes: 725ae34458ff3cbb9d87e08c8a73780672221a9e
("turnip: Add debug option to print gmem load/store skip stats")

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

2 years agomesa: unref syncobj after wait_sync
Juan A. Suarez Romero [Thu, 28 Apr 2022 16:05:55 +0000 (18:05 +0200)]
mesa: unref syncobj after wait_sync

Before returning the wait_sync() function, the sync object must be
unreferenced.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6377
Fixes: 0af7c1e385b ("mesa/st: merge the syncobj code from st into mesa")
Signed-off-by: Juan A. Suarez Romero <jasuarez@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16242>

2 years agoradv/ci: stop skipping dEQP-VK.synchronization.* on Bonaire
Samuel Pitoiset [Fri, 29 Apr 2022 07:38:00 +0000 (09:38 +0200)]
radv/ci: stop skipping dEQP-VK.synchronization.* on Bonaire

I can't reproduce GPU hangs after 5 CTS runs and Timur also confirmed
that his Bonaire GPU didn't hang after one CTS run.

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

2 years agoradv: fix the number of generated primitive queries with NGG GS vs legacy
Samuel Pitoiset [Tue, 12 Apr 2022 14:36:45 +0000 (16:36 +0200)]
radv: fix the number of generated primitive queries with NGG GS vs legacy

With NGG GS, the hardware can't know the number of generated primitives
and we have to increment it manually from the shader using a plain GDS
atomic operation.

Though this had a serious problem (see this old TODO) if the bound
pipeline was using legacy GS because the query implementation was
relying on NGG GS. Another situation is if we had one draw with NGG GS,
followed by one draw with legacy (or the opposite) the query result
would have been broken.

The solution is to allocate two 64-bit values for storing the begin/end
values if the query pool is supposed to need GDS and accumulate the
result with the number of generated primitives generated by the hw.

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

2 years agoturnip: Add debug option to print gmem load/store skip stats
Danylo Piliaiev [Fri, 15 Apr 2022 14:26:48 +0000 (17:26 +0300)]
turnip: Add debug option to print gmem load/store skip stats

TU_DEBUG=log_skip_gmem_ops would print stats about skipped
gmem/load every second.

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

2 years agoturnip: Skip load/stores for tiles with no geometry
Danylo Piliaiev [Thu, 14 Apr 2022 14:19:21 +0000 (17:19 +0300)]
turnip: Skip load/stores for tiles with no geometry

When HW binning is used tile loads/stores could be skipped
if there is no geometry in the tile.

Loads could be skipped when:
- The attachment won't be resolved, otherwise if load is skipped
  there would be holes in the resolved attachment;
- There is no vkCmdClearAttachments afterwards since it is likely
  a partial clear done via 2d blit (2d blit doesn't produce geometry).

Stores could be skipped when:
- The attachment was not cleared, which may happen by load_op or
  vkCmdClearAttachments;
- When store is not a resolve.

I chose to predicate each load/store separately to allow them to be
skipped when only some attachments are cleared or resolved.

Gmem loads are moved into separate cs because whether to emit
CP_COND_REG_EXEC depends on HW binning being enabled and usage of
vkCmdClearAttachments.

CP_COND_REG_EXEC predicate could be changed during draw_cs only
by perf query, in such case the predicate should be re-emitted.
(At the moment it is always re-emitted before stores)

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

2 years agofreedreno/a6xx: Add UNK fields to CP_REG_TEST and CP_COND_REG_EXEC
Danylo Piliaiev [Thu, 14 Apr 2022 14:15:49 +0000 (17:15 +0300)]
freedreno/a6xx: Add UNK fields to CP_REG_TEST and CP_COND_REG_EXEC

Their meaning is unknown, however they DO change the behavior.

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

2 years agovirgl: don't move input gl_SampleMaskIn to a temp
Gert Wollny [Sun, 17 Apr 2022 15:25:18 +0000 (17:25 +0200)]
virgl: don't move input gl_SampleMaskIn to a temp

The input is an array so moving it to a single temporary value doesn't
seem to make much sense. I also don't see any piglit regressions when
not moving the value to a temporary.

Fixes: bc912bace1cf8cd03793c5ae34bd5a2afd015019
  virgl: Add workarounds for virglrenderer input/sv signedness bugs.

v2: remove unused enum for SAMPLEMASK (Emma)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15997>

2 years agoradv/ci: remove empty flakes lists for GFX9
Samuel Pitoiset [Fri, 29 Apr 2022 07:42:03 +0000 (09:42 +0200)]
radv/ci: remove empty flakes lists for GFX9

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

2 years agoradeonsi: enable PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER
Pierre-Eric Pelloux-Prayer [Mon, 25 Apr 2022 12:19:24 +0000 (14:19 +0200)]
radeonsi: enable PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER

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

2 years agogallium: add PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER
Pierre-Eric Pelloux-Prayer [Mon, 25 Apr 2022 12:19:02 +0000 (14:19 +0200)]
gallium: add PIPE_CAP_ALLOW_DRAW_OUT_OF_ORDER

This way we can make allow_draw_out_of_order true by default for all
apps, iff the driver allows it.

And allow_draw_out_of_order=false can still be used in drirc, for
apps that need this optim to be turned off.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16139>

2 years agodrirc: remove i965 entry
Pierre-Eric Pelloux-Prayer [Mon, 25 Apr 2022 11:41:49 +0000 (13:41 +0200)]
drirc: remove i965 entry

The driver has been deleted in !10153.

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

2 years agoradeonsi: drop assume_no_z_fights option
Pierre-Eric Pelloux-Prayer [Wed, 16 Mar 2022 09:40:00 +0000 (10:40 +0100)]
radeonsi: drop assume_no_z_fights option

And garbage collect the code that was only used by this option.

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

2 years agoradeonsi: remove commutative_blend_add option
Pierre-Eric Pelloux-Prayer [Wed, 16 Mar 2022 09:36:38 +0000 (10:36 +0100)]
radeonsi: remove commutative_blend_add option

This is unused.

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

2 years agoradv/ci: update list of expected failures for Bonaire (GFX7)
Samuel Pitoiset [Fri, 29 Apr 2022 07:13:21 +0000 (09:13 +0200)]
radv/ci: update list of expected failures for Bonaire (GFX7)

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

2 years agomicrosoft/compiler: fixup indentation
Erik Faye-Lund [Thu, 21 Apr 2022 11:08:09 +0000 (13:08 +0200)]
microsoft/compiler: fixup indentation

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16079>

2 years agomicrosoft/clc: fixup indentation
Erik Faye-Lund [Thu, 21 Apr 2022 11:07:08 +0000 (13:07 +0200)]
microsoft/clc: fixup indentation

Acked-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16079>

2 years agottn: Make ttn_optimize_nir match gl_nir_opts
M Henning [Sat, 2 Apr 2022 04:16:55 +0000 (00:16 -0400)]
ttn: Make ttn_optimize_nir match gl_nir_opts

ttn_optimize_nir was copied from gl code in 9a834447d6, so update it
to include all of the lowering steps that gl does. nouveau needs
some of these passes to be applied.

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

2 years agovulkan/wsi: keep allocate queue families in image, just don't fill them
Dave Airlie [Sun, 13 Mar 2022 19:54:20 +0000 (05:54 +1000)]
vulkan/wsi: keep allocate queue families in image, just don't fill them

This changes the code so that it only looks at the passed in families
when concurrent, otherwise it always allocates one.

Fixes: 48b3ef625e19 ("vulkan/wsi: handle queue families properly for non-concurrent sharing mode.")
Acked-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Tested-by: Mike Lothian <mike@fireburn.co.uk>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15331>

2 years agovenus: add support for vk_xwayland_wait_ready
Renato Pereyra [Thu, 28 Apr 2022 21:36:42 +0000 (14:36 -0700)]
venus: add support for vk_xwayland_wait_ready

Signed-off-by: Renato Pereyra <renatopereyra@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16229>

2 years agozink: remove drm_fd
Mike Blumenkrantz [Thu, 28 Apr 2022 20:50:56 +0000 (16:50 -0400)]
zink: remove drm_fd

no longer used

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

2 years agozink: ignore KMS handle types
Mike Blumenkrantz [Thu, 28 Apr 2022 20:31:16 +0000 (16:31 -0400)]
zink: ignore KMS handle types

who could've guessed that such a thing was possible

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

2 years agozink: export fd info for all 2d images
Mike Blumenkrantz [Thu, 28 Apr 2022 20:30:43 +0000 (16:30 -0400)]
zink: export fd info for all 2d images

there's no way to add this later, so here we go

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

2 years agozink: fix dmabuf plane returns
Mike Blumenkrantz [Thu, 28 Apr 2022 19:50:40 +0000 (15:50 -0400)]
zink: fix dmabuf plane returns

use the actual drm format plane count, not the resource format

cc: mesa-stable

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

2 years agovtn: clamp SpvOpImageQuerySize dest to 32 bit
Karol Herbst [Thu, 14 Apr 2022 17:14:10 +0000 (19:14 +0200)]
vtn: clamp SpvOpImageQuerySize dest to 32 bit

CL image arrays slice is 64 bit for whatever reason...

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16205>

2 years agonir/deref: Add an alu-of-cast optimization
Jason Ekstrand [Wed, 30 Mar 2022 15:57:19 +0000 (10:57 -0500)]
nir/deref: Add an alu-of-cast optimization

Casts shouldn't change the bit pattern of the deref and you have to cast
again after you're done with the ALU anyway so we can ignore casts on
ALU sources.  This means we can actually start constant folding NULL
checks even if there are annoying casts in the way.

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15673>

2 years agogallium/vl: respect the video codecs configure in meson
Dave Airlie [Wed, 23 Mar 2022 03:12:38 +0000 (13:12 +1000)]
gallium/vl: respect the video codecs configure in meson

Acked-by: Christian König <christian.koenig@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>

2 years agomeson: add a video codec support option
Dave Airlie [Mon, 7 Mar 2022 02:37:29 +0000 (12:37 +1000)]
meson: add a video codec support option

This allows to turn on/off all hw implementations for a specific video
codec across the tree. Patent encumbered codecs can cause problems for
distributions due to the nature of at least MPEG-LA licensing.

https://jina-liu.medium.com/settle-your-questions-about-h-264-license-cost-once-and-for-all-hopefully-a058c2149256
is probably the best explaination I can find.

From a distro pov, codecs are a jigsaw puzzle, you only seem to become a problem well you fit all the pieces.

This patch will allow disabling the mesa piece of the puzzle.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>

2 years agogallium/omx: add video codec supported hook for decode paths.
Dave Airlie [Wed, 23 Mar 2022 03:11:42 +0000 (13:11 +1000)]
gallium/omx: add video codec supported hook for decode paths.

These never asked the driver for what was supported.

Acked-by: Christian König <christian.koenig@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>

2 years agogallium/vl: wrap codec support checks in a common function.
Dave Airlie [Wed, 23 Mar 2022 03:05:58 +0000 (13:05 +1000)]
gallium/vl: wrap codec support checks in a common function.

This just is an initial wrapping of all calls into the driver
to check for codec support.

The idea is to add more to this function to support the meson
level disables.

Acked-by: Christian König <christian.koenig@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15258>

2 years agointel_dev_info: Add --hwconfig command line parameter
Jordan Justen [Tue, 11 Jan 2022 22:14:01 +0000 (14:14 -0800)]
intel_dev_info: Add --hwconfig command line parameter

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14511>

2 years agointel/dev: Read hwconfig from i915
Jordan Justen [Sat, 30 Oct 2021 20:41:38 +0000 (13:41 -0700)]
intel/dev: Read hwconfig from i915

Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14511>

2 years agonir_to_tgsi: Drop the txl(lod=0)->tex nir_lower_tex() fixup.
Emma Anholt [Tue, 26 Apr 2022 00:02:20 +0000 (17:02 -0700)]
nir_to_tgsi: Drop the txl(lod=0)->tex nir_lower_tex() fixup.

I've fixed nir_lower_tex() to not do that for us any more.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16156>

2 years agonir/lower_tex: Make the adding a 0 LOD to nir_op_tex in the VS optional.
Emma Anholt [Mon, 25 Apr 2022 23:55:45 +0000 (16:55 -0700)]
nir/lower_tex: Make the adding a 0 LOD to nir_op_tex in the VS optional.

This controls the whole lowering of "make tex ops with implicit
derivatives on non-implicit-derivative stages be tex ops with an explicit
lod of 0 instead", but it's really hard to describe that in a git commit
summary.

All existing callers get it added except:
- nir_to_tgsi which didn't want it.
- nouveau, which didn't want it (fixes regressions in shadowcube and
  shadow2darray with NIR, since the shading languages don't expose txl of
  those sampler types and thus it's not supported in HW)
- optional lowering passes in mesa/st (lower_rect, YUV lowering, etc)

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16156>

2 years agovenus: disable VK_EXT_extended_dynamic_state2
Yiwei Zhang [Thu, 28 Apr 2022 17:57:38 +0000 (17:57 +0000)]
venus: disable VK_EXT_extended_dynamic_state2

extended_dynamic_state.*_raster tests timeout because the new
VK_DYNAMIC_STATE_RASTERIZER_DISCARD_ENABLE is not handled in venus.

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

2 years agoisl,iris: Add DG2 CCS modifier support for XeHP
Nanley Chery [Thu, 29 Apr 2021 19:04:04 +0000 (12:04 -0700)]
isl,iris: Add DG2 CCS modifier support for XeHP

Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>

2 years agointel/isl: Add a score for I915_FORMAT_MOD_4_TILED
Nanley Chery [Wed, 29 Sep 2021 22:59:21 +0000 (15:59 -0700)]
intel/isl: Add a score for I915_FORMAT_MOD_4_TILED

Enables the modifier in anv.

Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>

2 years agoisl,iris: Add I915_FORMAT_MOD_4_TILED support for XeHP
Anuj Phogat [Mon, 13 Jan 2020 20:51:55 +0000 (12:51 -0800)]
isl,iris: Add I915_FORMAT_MOD_4_TILED support for XeHP

This patch adds Tile 4 modifier support to Mesa and allows Mesa to
use Tile 4 on gen12-hp with GBM.

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>

2 years agoinclude/uapi: Update drm_fourcc.h from kernel
Anuj Phogat [Thu, 11 Mar 2021 23:32:53 +0000 (15:32 -0800)]
include/uapi: Update drm_fourcc.h from kernel

Signed-off-by: Anuj Phogat <anuj.phogat@gmail.com>
v2. Pull in the header from drm-next at commit
    9035039e1ed691cd893777a42e048003a2f349d6

Cc: 22.1 <mesa-stable>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>

2 years agoiris: Return a 64B stride for clear color plane
Nanley Chery [Thu, 28 Apr 2022 15:01:19 +0000 (08:01 -0700)]
iris: Return a 64B stride for clear color plane

Although modifiers which use a clear color plane specify that the
plane's pitch should be ignored, some kernels have been found to require
64-byte alignment.

Cc: mesa-stable
Fixes: db475c81b7c ("iris: Return non-zero stride for clear color plane")
Reported-by: Dongwon Kim <dongwon.kim@intel.com>
Suggested-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14521>

2 years agod3d12: Add a unit test for context reset recovery
Jesse Natalie [Fri, 11 Feb 2022 21:09:01 +0000 (13:09 -0800)]
d3d12: Add a unit test for context reset recovery

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agod3d12: Attempt screen reset during context create
Jesse Natalie [Fri, 11 Feb 2022 19:22:23 +0000 (11:22 -0800)]
d3d12: Attempt screen reset during context create

This will only work if all contexts have been destroyed. If the app
attempts to re-create one context, while another outstanding context
exists and is still in the removed state, then the screen is not
recovered and the new context will fail to create.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agod3d12: Plug screen leaks
Jesse Natalie [Fri, 11 Feb 2022 17:17:48 +0000 (09:17 -0800)]
d3d12: Plug screen leaks

This also breaks screen init/deinit into two parts. The first part of
creation cannot fail, and is not repeatable. The second part of creation
can fail, and is repeatable, to be used for reset recovery.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agod3d12: Plug context leaks
Jesse Natalie [Fri, 11 Feb 2022 21:08:42 +0000 (13:08 -0800)]
d3d12: Plug context leaks

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agod3d12: Hook up robustness extensions
Jesse Natalie [Fri, 11 Feb 2022 16:08:09 +0000 (08:08 -0800)]
d3d12: Hook up robustness extensions

We can at least correctly return whether the context was lost, but
at this point can't correctly tear down and create a new one, nor
do we support the callback for dynamic notification.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agowgl: Implement WGL_ARB_create_context_robustness
Jesse Natalie [Fri, 11 Feb 2022 15:55:14 +0000 (07:55 -0800)]
wgl: Implement WGL_ARB_create_context_robustness

Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15002>

2 years agonir: add 16 and 64 bit fisnormal lowering
Karol Herbst [Sun, 24 Apr 2022 19:55:34 +0000 (21:55 +0200)]
nir: add 16 and 64 bit fisnormal lowering

Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16206>

2 years agokopper: implement texture-from-pixmap for software (non-dmabuf)
Mike Blumenkrantz [Wed, 27 Apr 2022 12:48:16 +0000 (08:48 -0400)]
kopper: implement texture-from-pixmap for software (non-dmabuf)

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agokopper: rename a confusing variable
Mike Blumenkrantz [Thu, 28 Apr 2022 16:47:13 +0000 (12:47 -0400)]
kopper: rename a confusing variable

is_pixmap is defined in kopper_allocate_textures() as being (!window && x11),
which is very different from this check, which determines whether the drawable
is a window

so rename it to keep things consistent

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agokopper: check whether zink is using sw
Mike Blumenkrantz [Wed, 27 Apr 2022 21:20:03 +0000 (17:20 -0400)]
kopper: check whether zink is using sw

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agozink/kopper: add a function for determining if running on software
Mike Blumenkrantz [Wed, 27 Apr 2022 21:19:44 +0000 (17:19 -0400)]
zink/kopper: add a function for determining if running on software

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agokopper: check for modifiers to use modifier functionality
Mike Blumenkrantz [Wed, 27 Apr 2022 21:07:53 +0000 (17:07 -0400)]
kopper: check for modifiers to use modifier functionality

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agokopper: add some error logging for pixmap->texture failure
Mike Blumenkrantz [Wed, 27 Apr 2022 21:06:57 +0000 (17:06 -0400)]
kopper: add some error logging for pixmap->texture failure

Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16190>

2 years agod3d12: Don't block DISPLAY based on format for non-Windows
Jesse Natalie [Mon, 25 Apr 2022 20:38:40 +0000 (13:38 -0700)]
d3d12: Don't block DISPLAY based on format for non-Windows

On platforms where we're not using DXGI swapchains, there's no reason
to disallow DISPLAY for formats like B5G6R5. In fact, on Android,
we need to support this format as BIND_DISPLAY.

Reviewed-by: Bill Kristiansen <billkris@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16154>

2 years agoac: remove gallivm header include
Mike Blumenkrantz [Wed, 27 Apr 2022 13:13:18 +0000 (09:13 -0400)]
ac: remove gallivm header include

this doesn't seem to be used

Acked-by: Dave Airlie <airlied@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16192>

2 years agozink: radv ci updates
Mike Blumenkrantz [Thu, 28 Apr 2022 16:30:01 +0000 (12:30 -0400)]
zink: radv ci updates

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

2 years agoutil: change util_format_snorm8_to_sint8 -> snorm_to_sint for radeonsi
Marek Olšák [Mon, 25 Apr 2022 02:42:10 +0000 (22:42 -0400)]
util: change util_format_snorm8_to_sint8 -> snorm_to_sint for radeonsi

Convert all SNORM formats to SINT.

This fixes SNORM blits for radeonsi.

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16132>

2 years agoutil: add pipe formats R10G10B10X2_SINT, B10G10R10X2_SINT, G16R16_SINT
Marek Olšák [Mon, 25 Apr 2022 02:40:58 +0000 (22:40 -0400)]
util: add pipe formats R10G10B10X2_SINT, B10G10R10X2_SINT, G16R16_SINT

needed by radeonsi

Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16132>

2 years agoetnaviv: reinstate accidentially commented assert
Lucas Stach [Thu, 28 Apr 2022 10:26:14 +0000 (12:26 +0200)]
etnaviv: reinstate accidentially commented assert

I added this hack to my tree when testing another MR and ended up
squashing it into c2a3236d1a (etnaviv: clean up tiling setup in
etna_compile_rs_state) by accident when doing some changes to this
commit. Reinstate the assert.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Philipp Zabel <p.zabel@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16212>

2 years agodrm-uapi/i915_drm.h: Update from drm-next (2022-04-28)
Jordan Justen [Tue, 26 Apr 2022 20:19:01 +0000 (13:19 -0700)]
drm-uapi/i915_drm.h: Update from drm-next (2022-04-28)

git://anongit.freedesktop.org/drm/drm 9bda072a7bec278c424ad660373e69d8e4a3385d

Among other changes, this provides DRM_I915_QUERY_HWCONFIG_BLOB and
DRM_I915_QUERY_GEOMETRY_SUBSLICES, which are needed for DG2 support.

Cc: 22.1 <mesa-stable>
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16174>

2 years agovulkan/device_select: force default device if environment variable set
prashanth [Fri, 25 Mar 2022 18:31:44 +0000 (00:01 +0530)]
vulkan/device_select: force default device if environment variable set

Force default device if MESA_VK_DEVICE_SELECT_FORCE_DEFAULT_DEVICE
environment variable set. This will not give multiple device
options to app. There are apps that selects gpu to use based on its
own criteria, this patch can force default behaviour for these apps
by giving only one gpu device to select from.

v2: return 0 if no physical device present (Mihai Preda)
v3: document environment variables (Mihai Preda)(Marek Olšák)

Signed-off-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15585>

2 years agoci/lava: Retry when data fetching log RPC call is corrupted
Guilherme Gallo [Wed, 20 Apr 2022 23:55:47 +0000 (20:55 -0300)]
ci/lava: Retry when data fetching log RPC call is corrupted

Rarely the jobs.logs RPC call can return corrupted data, such as
mal-formed YAML data. As this is expected and very rare to occur, let's
retry this RPC call several times to give it a chance to fix itself.

Retrying would not swallow the log lines since we keep track of how many
log lines each job has.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Improve exception handling
Guilherme Gallo [Thu, 31 Mar 2022 18:42:49 +0000 (15:42 -0300)]
ci/lava: Improve exception handling

Move exceptions to its own file.
Create MesaCITimeoutError and MesaCIRetryError with specific exception
data for better exception classification.
Avoid the use of `fatal_err` in favor of raising a proper exception.
Make _call_proxy exception handling exhaustive, add missing
ResponseError treatment.

Also, detect JobError during job result parsing. So when a LAVA timeout error
happens, it is probably cause by some boot/network issues with a
specific device, we can retry the same job in other device with the same
device_type.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Cancel the job if the script is interrupted
Guilherme Gallo [Fri, 8 Apr 2022 14:52:50 +0000 (11:52 -0300)]
ci/lava: Cancel the job if the script is interrupted

During development, we may want to test lava_job_submitter.py locally,
sometimes one can find what one is been looking for before the LAV job
is done. Let's respond to SIGINT signal and cancel the LAVA job, as we
can't follow what is happening anymore via script.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Reduce LAVA boot phase timeout to 3 minutes
Guilherme Gallo [Fri, 25 Mar 2022 12:55:09 +0000 (09:55 -0300)]
ci/lava: Reduce LAVA boot phase timeout to 3 minutes

A normal boot on LAVA device would take less than 1 minute. Sometimes
the depthcharge freezes and LAVA waits until the current timeout (25
minutes) to kick in and fail the job.
With this lower timeout value, the job could fail faster and eventually
LAVA will be able to retry it.

Furthermore, set a default timeout for all actions to fix an undesired
behavior with some LAVA job subactions, such as depthcharge-action.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Let LAVA job submitter run without JWT file
Guilherme Gallo [Thu, 24 Mar 2022 21:22:49 +0000 (18:22 -0300)]
ci/lava: Let LAVA job submitter run without JWT file

Make jwt-file argument optional, this means that this submitter could
deal with more generic use cases, such as running it locally, since the
MINIO JWT is a sensitive information, which is not really required to
test if the submitter is working well.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Parse all test cases from 0_mesa suite
Guilherme Gallo [Thu, 24 Mar 2022 01:10:51 +0000 (22:10 -0300)]
ci/lava: Parse all test cases from 0_mesa suite

LAVA can filter which test suite to show the results from, let's list
all testcases possible in the mesa test suite, to be able to divide more
complex jobs into test_cases.
Another advantage is that the test case can vary its name.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Fix shebang in deqp-runner.sh
Guilherme Gallo [Mon, 11 Apr 2022 18:26:13 +0000 (15:26 -0300)]
ci/lava: Fix shebang in deqp-runner.sh

Now, every rootfs based device has bash installed, so we can use bash
shebang instead of dash to enforce the use of bash's echo, not dash's
one.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Trap init-stage2.sh background processes
Guilherme Gallo [Thu, 7 Apr 2022 19:01:27 +0000 (16:01 -0300)]
ci/lava: Trap init-stage2.sh background processes

Any daemon executed in init-stage2.sh may interfere with LAVA signals,
since any threaded output to console may clutter the signals, which are
based on the log output.
E.g: This job
https://gitlab.freedesktop.org/gallo/mesa/-/jobs/20779120#L2102
has failed because capture-devcoredump.sh was alive and emitting kernel
messages to the console during the LAVA signal handling, mangling the
output and making the LAVA to fail to check the results of the job.

Another problem is that CONFIG_DEBUG_STACK_USAGE Kconfig is enabled.
This causes process exit to dump a `RESULT=[  246.756067] lava-test-case
(156) used greatest stack depth: ... bytes left` kernel message to the
logs corrupting LAVA signal message. Empirically, it happens one in
every 280 jobs. To solve that, compose the lava-test-case custom script
with a short sleep to give time for kernel to dump the message clearly
and a exit command to keep the return code from init-stage2.sh script.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Use lava-test-case to run custom scripts in LAVA
Guilherme Gallo [Wed, 23 Mar 2022 01:39:31 +0000 (22:39 -0300)]
ci/lava: Use lava-test-case to run custom scripts in LAVA

The exit code is automatically parsed to fail/pass the job, so this
commit removes the `hwci.*pass|fail` regex and printings.

Add mesa-job-name parameter to get the CI_JOB_NAME easily to serve as
test name.

Besides, there is the treatment for the mesa job naeme, as LAVA does not
like whitespace character inside the test case/suite name, since it
interprets it as a LAVA signal parameter and it can make the job fail
when the script looks for the results from the LAVA RPC.

And the slash character seems to break gitlab log sectioning, so
removing every character after the first whitespace.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Always validate the lava job
Guilherme Gallo [Wed, 23 Mar 2022 01:02:59 +0000 (22:02 -0300)]
ci/lava: Always validate the lava job

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Set lava-signal to kmsg
Guilherme Gallo [Wed, 13 Apr 2022 22:23:23 +0000 (19:23 -0300)]
ci/lava: Set lava-signal to kmsg

By default, LAVA emit signals as specific lines of message to the
console serial for subsequent parsing. However, this is prone to be
interleaved with the dmesg messages, particularly with debug messages
that can happen just after the process exit, such as the ones set by
CONFIG_STACK_DEBUG_USAGE Kconfig.

Setting the `lava-signal` to `kmsg` will make those special messages to
be dumped to /dev/kmsg, where the each line is printed atomically

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Fix LAVA job validation
Guilherme Gallo [Wed, 23 Mar 2022 22:26:47 +0000 (19:26 -0300)]
ci/lava: Fix LAVA job validation

When jobs.validate returns something, it means that there is a dict
filled with the error message, so we were running the job with some
validation errors for a quite while

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Return test-suite result as exit code
Guilherme Gallo [Thu, 17 Feb 2022 01:11:49 +0000 (01:11 +0000)]
ci/lava: Return test-suite result as exit code

Makes it easier for external observers.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Filter log lines from LAVA return
Guilherme Gallo [Thu, 14 Apr 2022 17:58:55 +0000 (14:58 -0300)]
ci/lava: Filter log lines from LAVA return

Start to differentiate between the different types of LAVA log message;
the only visible change right now is that we make warnings and errors
bold and red to match bare-metal, but it comes in useful later as we
will use the results markers to watch us step through the different
stages of job execution.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Encapsulate job data in a class
Guilherme Gallo [Wed, 16 Feb 2022 18:06:20 +0000 (18:06 +0000)]
ci/lava: Encapsulate job data in a class

Less free-form passing stuff around, and also makes it easier to
implement log-based following in future.

The new class has:
- job log polling: This allows us to get rid of some more function-local
  state; the job now contains where we are, and the timeout etc is
  localised within the thing polling it.
- has-started detection into job class
- heartbeat logic to update the job instance state with the start time
  when the submitter begins to track the logs from the LAVA device

Besides:

- Split LAVA jobs and Mesa CI policy
- Update unit tests with LAVAJob class

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoci/lava: Sleep before, not after, API calls
Daniel Stone [Wed, 16 Feb 2022 17:52:23 +0000 (17:52 +0000)]
ci/lava: Sleep before, not after, API calls

We rate-limit LAVA API calls as they are standard polling calls rather
than blocking for changes. However when we sleep after making the calls
rather than before, we can block when we want to exit - e.g. after
getting the final logs, we will still sleep even though we can drop out.

Fix this by moving the calls to before the API calls, rather than after.
This means that the first calls (when we're waiting to be scheduled, or
haven't got our first log lines yet), will be delayed compared to
previously, but that's not going to slow us down as even in the best
case we won't be executing in a device within the first 15 seconds.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15938>

2 years agoisl: disable mcs (and mcs+ccs) for color msaa on DG2
Tapani Pälli [Sat, 23 Apr 2022 06:29:08 +0000 (09:29 +0300)]
isl: disable mcs (and mcs+ccs) for color msaa on DG2

Fixes lots of various test failures in:
   dEQP-VK.pipeline.multisample.min_sample_shading_disabled.*
   dEQP-GLES3.functional*multisample.*
   KHR-GL*sample_variables.*

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Kenneth Graunke <kenneth@whitecape.org>
Acked-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13991>

2 years agovulkan/wsi/x11: Use atomic_int with sent_image_count
Jordan Justen [Tue, 12 Apr 2022 21:46:39 +0000 (14:46 -0700)]
vulkan/wsi/x11: Use atomic_int with sent_image_count

Without this being atomically incremented and decremented, I observed
this assert triggering in debug builds:

  src/vulkan/wsi/wsi_common_x11.c:x11_present_to_x11_dri3():

  assert(chain->sent_image_count <= chain->base.image_count);

I think this was happening since,

  src/vulkan/wsi/wsi_common_x11.c:x11_handle_dri3_present_event()

which decrements chain->sent_image_count may be run in a separate
thread.

Fixes: d0bc1ad3776 ("vulkan/wsi/x11: add sent image counter")
Signed-off-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15908>

2 years agollvmpipe: add user memory resources to the debug global list.
Dave Airlie [Thu, 28 Apr 2022 00:43:45 +0000 (10:43 +1000)]
llvmpipe: add user memory resources to the debug global list.

Otherwise things will crash on destruction.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Fixes: 9a57dceeb760 ("llvmpipe: add support for user memory pointers")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16207>

2 years agofreedreno: Use staging transfer if mmap fails
Rob Clark [Wed, 20 Apr 2022 17:07:14 +0000 (10:07 -0700)]
freedreno: Use staging transfer if mmap fails

With externaly imported resources, we can have situations where we can't
mmap and directly access linear buffers.  So use the staging blit path
for this case.

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

2 years agofreedreno: Split out helper for staging blit
Rob Clark [Wed, 20 Apr 2022 16:41:31 +0000 (09:41 -0700)]
freedreno: Split out helper for staging blit

We are also going to want to use this for fallback when mmap fails.

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

2 years agofreedreno/a6xx: A couple more FD_BO_NOMAP
Rob Clark [Wed, 20 Apr 2022 16:40:49 +0000 (09:40 -0700)]
freedreno/a6xx: A couple more FD_BO_NOMAP

A couple other buffers that we don't need to mmap.

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

2 years agofreedreno/drm/virtio: Split up large uploads
Rob Clark [Mon, 18 Apr 2022 23:18:48 +0000 (16:18 -0700)]
freedreno/drm/virtio: Split up large uploads

Might be useful if host cached mmaps.. but OTOH we don't want to burn up
address space.

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