Compare commits

..

669 Commits

Author SHA1 Message Date
Eric Engestrom
4ee0a7e796 docs/relnotes: add sha256sum for 22.3.7 2023-03-08 19:13:45 +00:00
Eric Engestrom
127b1f0b06 VERSION: bump for 22.3.7 2023-03-08 18:37:09 +00:00
Eric Engestrom
3dbe6c6daf docs: add release notes for 22.3.7 2023-03-08 18:33:45 +00:00
Samuel Pitoiset
acb42bea9c radv: disable DCC with signedness reinterpretation on GFX11
All formats should be compatible on GFX11 but for some weird reasons
DCC with signedness reinterpretation doesn't work as expected, like
R8_UINT<->R8_SINT. Note that RadeonSI also has issues with this.

This might be a hardware bug on RDNA3.

This fixes DCC issues with Cyberpunk and A Plague Tale: Requiem.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8020
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8371
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21755>
(cherry picked from commit e6735409ee)
2023-03-08 18:00:17 +00:00
Samuel Pitoiset
8292375d11 radv: fix defining RADV_USE_WSI_PLATFORM
RADV_USE_WSI_PLATFORM was unused in radv_CreateImage().

Fixes: 2a5d7f4926 ("radv: fix missing implementation of creating images from swapchains")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21763>
(cherry picked from commit c87c34bbba)
2023-03-08 18:00:17 +00:00
Samuel Pitoiset
15a2c3d198 radv: fix border color swizzle for stencil-only format on GFX9+
Swizzle of 8-bit stencil format is defined as _x__ but the hw expects
BC_SWIZZLE_XYZW.

Fixes dEQP-VK.pipeline.monolithic.sampler.border_swizzle.*s8_uint*.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21482>
(cherry picked from commit 7b2086d741)
2023-03-08 18:00:17 +00:00
Yogesh Mohan Marimuthu
0ffe21ae02 ac/surface: only adjust pitch if surf_pitch was modified
Modifying pitch for all LINEAR surface isn't correct;
the original change that modified surf_pitch was only
intended for YUV textures.

This fixes vkGetImageSubresourceLayout rowPitch return value
for VK_FORMAT_BC3_UNORM_BLOCK + VK_IMAGE_TILING_LINEAR.

Fixes: fcc499d5 (ac/surface: adjust gfx9.pitch[*] based on surf->blk_w)

v2: add check for UYVY format (Pierre-Eric)
v3: move blk_w division to above if check (Pierre-Eric)

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21595>
(cherry picked from commit 347a5b79f9)
2023-03-08 18:00:17 +00:00
Samuel Pitoiset
371926246b radv: fix incorrect stride for primitives generated query with GDS
When the query pool uses GDS (for NGG), the stride is 40.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8412
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21650>
(cherry picked from commit c119b19f98)
2023-03-08 18:00:17 +00:00
Lionel Landwerlin
58f6de78bd nir: fix nir_ishl_imm
Both GLSL & SPIRV have undefined values for shift > bitsize. But SM5
says :

   "This instruction performs a component-wise shift of each 32-bit
    value in src0 left by an unsigned integer bit count provided by
    the LSB 5 bits (0-31 range) in src1, inserting 0."

Better to not hard code the wrong behavior in NIR.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: e227bb9fd5 ("nir/builder: add ishl_imm helper")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@colllabora.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21720>
(cherry picked from commit a278eeb719)
2023-03-08 18:00:17 +00:00
Karol Herbst
d8e120afdc rusticl/kernel: Images arg sizes also have to match the host pointer size
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8267
Fixes: b0d698c532 ("rusticl: correctly check global argument size")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21604>
(cherry picked from commit 4c24ff0a34)
2023-03-08 18:00:17 +00:00
Mike Blumenkrantz
c52cb739c0 zink: propagate valid_buffer_range when replacing buffer storage
this is otherwise unreliable

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
(cherry picked from commit a4b1ae1f03)
2023-03-08 18:00:17 +00:00
Mike Blumenkrantz
ce2dba376a zink: fix descriptor update flagging on null ssbo set
this could unset the update flag if the last ssbo was null, which would
be a bug if it could ever be triggered

found by inspection

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
(cherry picked from commit 7145ccfa05)
2023-03-08 18:00:16 +00:00
Mike Blumenkrantz
bd0217cace zink: only add deferred barrier on fb unbind when layout needs to change
this otherwise may have been a surface that was never drawn to or
already had its layout corrected, in which case a deferred barrier
is not only unnecessary, it might be broken

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21739>
(cherry picked from commit e0dfe058c4)
2023-03-08 18:00:16 +00:00
Sam Edwards
4585f21de4 nouveau: Fix null dereference in nouveau_pushbuf_destroy
This may happen if the Nouveau device fails to initialize before
the pushbuf is set up; the abort logic will call this either way.

Signed-off-by: Sam Edwards <CFSworks@gmail.com>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21611>
(cherry picked from commit 9de997bde6)
2023-03-08 18:00:16 +00:00
Mike Blumenkrantz
64d830c0ab zink: unbind fb on context destroy
this ensures that batch refs are added for fb surfaces on unbind, which
prevents stale batch tracking from persisting on resources
after the context is destroyed

fixes:
*EGL.functional.render.multi_context*

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21727>
(cherry picked from commit 62f1a8a3a6)
2023-03-08 18:00:16 +00:00
Ruijing Dong
e94375f2de raseonsi/vcn: fix a h264 decoding issue
reason:
   some h264 streams have some strange pictures, from
   vaapi input these pictures don't have a reference frame,
   however, they are not intra only pictures, in MB layer
   these pictures are looking for some references, if they
   cannot find it. It could cause PF.

   when reference pictures exist, it will need to set used_for
   reference_flags, therefore if that is set, however the
   number of reference frames is zero, which is odd, it
   should be avoided.

solution:
   In the above case,  to scan the ref list so that it will
   make at least one reference available to avoid crash, since
   this is not accurate enough, it could cause some artifacts.
   And in that case, it will need to be checked individually
   for another solution.

closes: https://gitlab.freedesktop.org/drm/amd/-/issues/1462
closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8401
Cc: mesa-stable

Tested-by: llyyr <llyyr.public@gmail.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21732>
(cherry picked from commit 0f3370eede)
2023-03-08 18:00:16 +00:00
Eric Engestrom
9bdc25490b .pick_status.json: Mark bb796f70a1 as denominated 2023-03-08 18:00:16 +00:00
Mike Blumenkrantz
27aa0a3d76 zink: fix zink_resource_access_is_write()
this was accurately returning whether the access had only write flags,
but it was incorrectly returning false for READ|WRITE

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21583>
(cherry picked from commit 5be506c16e)
2023-03-08 18:00:16 +00:00
Gert Wollny
21680b8f0d r600/sfn: Fix atomic lowering
Fixes: 56dedf052f
  r600/sfn: add r600 specific lowering pass for atomics and use it

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21684>
(cherry picked from commit 9b09f244f0)
2023-03-08 18:00:16 +00:00
Lionel Landwerlin
742628dc24 anv: fix incorrect parameter
cmd_buffer_update_dirty_vbs_for_gfx8_vb_flush takes a value RANDOM/SEQUENTIAL. Not a boolean.
Fortunately this worked okay because true == RANDOM

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
(cherry picked from commit 4246a519f3)
2023-03-08 18:00:16 +00:00
Lionel Landwerlin
6693d9bf26 anv: pull Wa_14016118574 out of some loop not changing state
The WA is meant to be here to apply some state that is not propagated
properly inside the HW. But if you have a loop like :

for ( ... ) {
  emit(3DPRIMITIVE, some param);
}

You're not really changing any state, just push more draws into the
pipeline.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
(cherry picked from commit 6ee7a2ecfa)
2023-03-08 18:00:15 +00:00
Marek Olšák
3c705ffac9 radeonsi: don't merge SET_* packets that have a different index in si_pm4_state
Oops.

Fixes: c8e2c6faf6 ("radeonsi: use SET_SH_REG_INDEX with index=3 for registers containing CU_EN")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21641>
(cherry picked from commit 3a26d2b1a7)
2023-03-08 18:00:15 +00:00
Samuel Pitoiset
6cc56aa7df radv: fix DCC decompress on GFX11
The hardware requires one color output to be set by CB registers,
otherwise the DCC decompression does nothing.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8127
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8175
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8370
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21629>
(cherry picked from commit 4ec6850210)
2023-03-08 18:00:15 +00:00
Mike Blumenkrantz
806f5706e9 zink: disable queries for clear_texture()
this otherwise can do weird things

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21628>
(cherry picked from commit f7d1fff23f)
2023-03-08 18:00:15 +00:00
Yogesh Mohan Marimuthu
3215dd37b9 wsi/display: check alloc failure in wsi_display_alloc_connector()
vulkancts test dEQP-VK.wsi.direct_drm.surface.create_simulate_oom is failing
because in wsi_display_alloc_connector() function memory allocation for
connector is not checked for return NULL. create_simulate_oom test simulates
out of memory, hence memory allocation fails for connector and later when
tried to dereference connector program will segfault.

This patch fixes the dEQP-VK.wsi.direct_drm.surface.create_simulate_oom test
segfault issue by checking if connector is NULL afer memory allocation.

Cc: mesa-stable
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21701>
(cherry picked from commit af953616a1)
2023-03-08 18:00:15 +00:00
Sil Vilerino
ca25ff5d50 d3d12: VP9 Decode - Fix use_prev_in_find_mvs_refs calculation
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
(cherry picked from commit fb82371558)
2023-03-08 18:00:15 +00:00
Sil Vilerino
488db14f21 frontend/va: Keep track of some VP9 previous frame data for current frame use_prev_in_find_mvs_refs
Fixes: c8e8ce83 ("d3d12: Add VP9 Decode support")

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21694>
(cherry picked from commit 6fea823dc0)
2023-03-08 18:00:15 +00:00
Lionel Landwerlin
b8a0400d6a anv: remove pre hasvk split assert
With softpin we should not always expect a BO in addresses.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20497>
(cherry picked from commit f5dc88910f)
2023-03-08 18:00:15 +00:00
Lionel Landwerlin
a9c1e40120 anv: fixup condition for Wa_14016118574
We don't want the WA to kick-in if it's not point/line topology.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f2645229c2 ("anv: implement Wa_14016118574")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21660>
(cherry picked from commit d82e8e01c8)
2023-03-08 18:00:14 +00:00
Väinö Mäkelä
0b388d97da hasvk: Disable non-zero fast clears for 8xMSAA images
Using texelFetch to read samples from an 8xMSAA fast cleared image on
Haswell can read transparent black pixels around triangles from where
there should be none. This issue isn't present when using sample
shading, resolving the image using vkCmdResolveImage or in a copy the
image. The easiest way to fix this is by just disabling non-zero fast
clears for 8xMSAA images.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7587

Cc: mesa-stable
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21444>
(cherry picked from commit e509afacf3)
2023-03-08 18:00:14 +00:00
Tatsuyuki Ishi
4a106e32cc radv: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 7b5ab48c40 ("radv: partial sdma support")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
(cherry picked from commit e9a55b332a)
2023-03-08 18:00:14 +00:00
Tatsuyuki Ishi
ed7cb614cd radeonsi: SDMA v4 size field is size - 1
After cross-checking with kernel and the old buffer copy code, it seems
that the size field should be size - 1 instead.

Fixes: 46c95047bd ("radeonsi: implement si_sdma_copy_image for gfx7+")

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21585>
(cherry picked from commit 4f50497a96)
2023-03-08 18:00:14 +00:00
Eric Engestrom
292b004ba5 .pick_status.json: Mark 646cff13bc as denominated 2023-03-08 18:00:14 +00:00
Samuel Pitoiset
7aa1f07ddc amd,ac/rgp: fix SQTT memory types
This crashed on Steam Deck because the memory type is LPDDR5 and it
wasn't not handled in the switch. It seems the kernel changed the
memory type returned for VanGogh because it used to work.

Fixes: aef7ea868f ("ac/gpu_info: handle LPDDR4 and 5 in ac_memory_ops_per_clock")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21627>
(cherry picked from commit f19fccd9f8)
2023-03-08 18:00:14 +00:00
Yiwei Zhang
d85d54db75 venus: fix VK_EXT_image_view_min_lod feature query
Fixes: 8b81098519 ("venus: enable VK_EXT_image_view_min_lod")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21617>
(cherry picked from commit 054a83492d)
2023-03-08 18:00:14 +00:00
Lionel Landwerlin
2c2dc4ddd9 genxml: fix border color offset field on Gfx12+
I wonder if the docs are correct for Gfx11 because this is the
generation that gave us the Bindless Sampler Heap of 4Gb. So it would
make sense that the border colors can also be placed anywhere in that
4Gb heap.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
(cherry picked from commit 42e8a2c1d6)
2023-03-08 18:00:14 +00:00
Lionel Landwerlin
8f32bba18a genxml: Fix STATE_BASE_ADDRESS::BindlessSurfaceStateSize field size
BSpec 44507

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21600>
(cherry picked from commit 58b687d77b)
2023-03-08 18:00:14 +00:00
Dave Airlie
4b3a2e2475 llvmpipe: fix compute address bits to return native pointer size.
On 32-bit systems llvm will only be dealing with 32-bit ptrs

Reviewed-by: Karol Herbst <kherbst@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21601>
(cherry picked from commit 53dda476a9)
2023-03-08 18:00:13 +00:00
Samuel Pitoiset
bc594a5a91 radv: fix draw calls with 0-sized index buffers and robustness on NAVI10
The correct workaround is to bind an internal index buffer to handle
robustness2 correctly.

Fixes dEQP-VK.robustness.index_access.* in CTS 1.3.5.0 on NAVI10.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21471>
(cherry picked from commit c356f1b4ed)
2023-03-08 18:00:13 +00:00
Samuel Pitoiset
283143c143 radv: fix flushing non-coherent images in EndCommandBuffer()
The condition was inverted.

This doesn't fix anything known.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
(cherry picked from commit 7c62f6fa01)
2023-03-08 18:00:13 +00:00
Samuel Pitoiset
e4ffd343ab radv: fix flushing non-coherent images inside secondaries on GFX9+
Fixes
dEQP-VK.draw.dynamic_rendering.complete_secondary_cmd_buff.multi_draw.mosaic.*
on VEGA10 (related to the use of HTILE).

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21549>
(cherry picked from commit 6750a9094f)
2023-03-08 18:00:13 +00:00
Eric Engestrom
c18f920e5d glapi/meson: drop duplicate line in deps
Fixes: 0842bc879b ("meson: wire the new generator for es1 and es2")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21562>
(cherry picked from commit c9f3ba987f)
2023-03-08 18:00:13 +00:00
Dylan Baker
55b6c88d4d util: rzalloc and free hash_table_u64
Otherwise we're prone to leaking the table itself, since it's not freed
in the destroy function

CID: 1516552
fixes: 6649b840c3
       ("mesa/util: add a hash table wrapper which support 64-bit keys")

Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21499>
(cherry picked from commit ff494361be)
2023-03-08 18:00:13 +00:00
Mike Blumenkrantz
57be6f6ef2 zink: remove suspended queries from list before resuming
this avoids double-starting primgen queries from recursion when
needs_rast_discard_workaround is true

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21534>
(cherry picked from commit 96f7fe7191)
2023-03-08 18:00:13 +00:00
Caio Oliveira
5d43c6e140 gallivm: Fix handling of nir_intrinsic_scoped_barrier
A scoped barrier only has a control barrier behavior if there's
an execution scope.

Fixes: 13d900de0d ("llvmpipe: set nir_shader_compiler_options::use_scoped_barrier")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3339>
(cherry picked from commit 2178a8da51)
2023-03-08 18:00:13 +00:00
Rhys Perry
f4fc1e0d59 aco: always update orig_names in get_reg_phi()
No idea why this wasn't done if pc.first was a renamed temporary.

Fixes navi10 RA validation error with
dEQP-VK.binding_model.descriptor_buffer.multiple.graphics_geom_buffers1_sets3_imm_samplers

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8349
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21501>
(cherry picked from commit 75d9a4a6ce)
2023-03-08 18:00:13 +00:00
Eric Engestrom
281bf4bc7d radv: split linker script for android since it requires different symbols
Fixes: 4956f6d0bf ("radv: Add Android module info to linker script.")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8338
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21518>
(cherry picked from commit 735df516e9)
2023-03-08 18:00:12 +00:00
Mike Blumenkrantz
b47265ecd1 zink: avoid adding ubo/ssbo bindings multiple times for different bitsizes
these are valid variables, but the descriptor binding needs to be unique

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
(cherry picked from commit a7b98dd4be)
2023-03-08 18:00:12 +00:00
Mike Blumenkrantz
0759f1b56c zink: fix shader read access removal for barrier generation
barrier access is based on total binds per gfx/compute, not per stage

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21522>
(cherry picked from commit ddb116d755)
2023-03-08 18:00:12 +00:00
Iván Briano
5716f6b1e8 anv: stop tracking color blend state in the pipeline
Now that all color blend bits are dynamic, emit_cb_state() is doing
almost nothing and half of that is wrong.

In the case that color write enable is dynamic, at the time the pipeline
state is emitted, it sees all the color attachments as having write
disabled and stores the WriteDisabled bit for each channel.
When all dynamic state is flushed, we have the right values already but
the values recorded into the command buffer get ORed with the ones
stored in the pipeline, and so WriteDisabled tag along when they
shouldn't.

Since all disabled color attachments are handled already when dynamic
state is flushed, there's no point in doing so at pipeline creation
time too. And since the only other thing done by emit_cb_state() is
writing three hardcoded values, they might as well be taken care of in
the same place as everything else.

Fixes CTS from the future:
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_equation_*dynamic*
dEQP-VK.pipeline.*.extended_dynamic_state.*.color_blend_all_*

Fixes: fc3fd7c69e (anv: dynamic color write mask)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
(cherry picked from commit b71957635f)
2023-03-08 18:00:12 +00:00
Iván Briano
d927a1f1d0 anv: fix testing for dynamic color blend bits
Fixes: fc3fd7c69e (anv: dynamic color write mask)
Fixes: 9dc6bed9a1 (anv: dynamic state for logic op enable)

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
(cherry picked from commit dd5c6446b4)
2023-03-08 18:00:12 +00:00
Iván Briano
ec5de835c2 vulkan: track the right value on CmdSetColorWriteMasks
Fixes: 092be5a329 ("vulkan: Add more dynamic color blend states")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21509>
(cherry picked from commit 6e60612d42)
2023-03-08 18:00:12 +00:00
Marek Olšák
68e1cd631c radeonsi: disable Smart Access Memory because CPU access has large overhead
It will be remove completely in the next commit.

Related: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8176

Cc: mesa-stable

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
(cherry picked from commit d8b17b1752)
2023-03-08 18:00:12 +00:00
Marek Olšák
5d0bb66d8e radeonsi/gfx11: set CB_COLORi_INFO.MAX_COMP_FRAG on GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
(cherry picked from commit ee83ba5771)
2023-03-08 18:00:12 +00:00
Marek Olšák
40394b0ad5 radeonsi/gfx11: don't set non-existent VGT_STRMOUT_BUFFER_CONFIG
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
(cherry picked from commit c54635a033)
2023-03-08 18:00:12 +00:00
Marek Olšák
87c167e2f4 radeonsi/gfx11: fix the CU_EN clear mask for RSRC4_GS
Fixes: 9fecac091f - radeonsi/gfx11: scattered register deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
(cherry picked from commit 31438fbab5)
2023-03-08 18:00:12 +00:00
Marek Olšák
269a94eef7 amd: add missing gfx11 register definitions
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21525>
(cherry picked from commit 63b21e3066)
2023-03-08 18:00:11 +00:00
Sviatoslav Peleshko
df02db05e7 anv: Move WA MEDIA_VFE_STATE after stalling PIPE_CONTROL
Fixes: bc612536 ("anv: Emit a dummy MEDIA_VFE_STATE before switching from GPGPU to 3D")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6172
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21472>
(cherry picked from commit 07b57deea2)
2023-03-08 18:00:11 +00:00
Pierre-Eric Pelloux-Prayer
f817193569 radeonsi: fix incorrect vgpr indices in the ps_prolog
In monolithic PS shaders, we need to account for PERSP_PULL_MODEL even
if we don't use it; si_get_ps_prolog_key already does the same thing
to determine color_interp_vgpr_index.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8280
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21483>
(cherry picked from commit 2b655e267e)
2023-03-08 18:00:11 +00:00
Friedrich Vock
826be8bafe mesa: Report GL_SHADER_BINARY_FORMAT_SPIR_V as supported
GL_ARB_gl_spirv introduced it, but its corresponding format was never listed in GL_SHADER_BINARY_FORMATS.

Fixes: 5bc03d25 ("mesa: implement SPIR-V loading in glShaderBinary")
Closes: #7644
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19559>
(cherry picked from commit c0c911d9ba)
2023-03-08 18:00:11 +00:00
Sviatoslav Peleshko
e65d574613 anv: Handle all fields in VkAccelerationStructureBuildRangeInfoKHR
Add handling of primitiveOffset and firstVertex.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8296
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21342>
(cherry picked from commit 4bf38f5652)
2023-03-08 18:00:11 +00:00
Caio Oliveira
ffa4534e2a iris, crocus: Align workaround address to 32B
The workaround address is used as a source for push constants when
there's no resource available, that address must be 32B aligned.

This fixes invalid address being used for buffers in
3DSTATE_CONSTANT_* packets.

Now that intel_debug_write_identifiers() already add the padding,
there's no need to include extra "+ 8" to the offset.

Thanks to Xiaoming Wang that contributed to find and fix this issue.

Fixes: 2a4c361b06 ("iris: add identifier BO")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21479>
(cherry picked from commit a4a0417263)
2023-03-08 18:00:11 +00:00
Sil Vilerino
95d788e0b6 d3d12: Fix VP9 Decode - Checking 0xFF instead of 0x7F for invalid frame_ref[i].Index7Bits
Fixes: c8e8ce8359 ("d3d12: Add VP9 Decode support")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21507>
(cherry picked from commit 9490633723)
2023-03-08 18:00:11 +00:00
Väinö Mäkelä
14b5e17133 hasvk: Mark VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL as stencil write optimal
VK_KHR_synchronization2 added VK_IMAGE_LAYOUT_ATTACHMENT_OPTIMAL, which
was not previously recognized by vk_image_layout_stencil_write_optimal.

Would close https://gitlab.freedesktop.org/mesa/mesa/-/issues/5578 if it
wasn't already closed.

Fixes: b996fa8efa ("anv: implement VK_KHR_synchronization2")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19876>
(cherry picked from commit d3162f97b5)
2023-03-08 18:00:11 +00:00
Karol Herbst
a2b96975d7 nir/deref: don't replace casts with deref_struct if we'd lose the stride
The result might be used in a deref_ptr_as_array, which requires a proper
stride within lower_explicit_io. If we'd lose that information or end up
with a different stride don't execute this optimization.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8289
Fixes: b779baa9bf ("nir/deref: fix struct wrapper casts. (v3)")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21458>
(cherry picked from commit 56a9aad401)
2023-03-08 18:00:11 +00:00
Sviatoslav Peleshko
f79e814218 iris: Avoid creating uncompressed view with unaligned tile offsets on BDW
Fixes: 60568d5d ("iris: Use isl_surf_get_uncompressed_surf")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7990
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21147>
(cherry picked from commit 4229d9324f)
2023-03-08 18:00:10 +00:00
Rhys Perry
2d0b4d36a3 aco: fix pathological case in LdsDirectVALUHazard
Similar to bfd4ac4581.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Fixes: 296b4d95a3 ("aco/gfx11: workaround LdsDirectVALUHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21423>
(cherry picked from commit 94abccf3ce)
2023-03-08 18:00:10 +00:00
Eric Engestrom
2ae6719029 .pick_status.json: Update to 41ae2d0725 2023-03-08 18:00:05 +00:00
Eric Engestrom
ad477424c4 docs/relnotes: add sha256sum for 22.3.6 2023-02-22 22:00:38 +00:00
Eric Engestrom
234055882d VERSION: bump for 22.3.6 2023-02-22 20:35:56 +00:00
Eric Engestrom
26a199d0a3 docs: add release notes for 22.3.6 2023-02-22 20:35:50 +00:00
Mike Blumenkrantz
e96d7e4559 driconf: add zink glthread disable for a game
ref #8333

fixes #8328

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21424>
(cherry picked from commit 50a65e2e2b)
2023-02-22 20:29:16 +00:00
Sviatoslav Peleshko
af0e91d66a driconf/anv: Apply limit_trig_input_range WA to Rise of the Tomb Raider
During its Ambient Occlusion calculations the game ends up calculating
sin/cos of some pretty big values, for which HW produces completely bogus
results (e.g. cos(3929491.25) ~= -0.011, while correct would be ~0.923).

Limit the arguments to the reasonable (-2*Pi; 2*Pi) range with the
limit_trig_input_range WA.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8292
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21396>
(cherry picked from commit 42dba8ebc5)
2023-02-22 20:29:16 +00:00
Mike Blumenkrantz
538f9ad0d3 kopper: fix loop iterating for msaa texture creation
the pipe_resource template values need to always be initialized or
else texture creation fails and rendering is broken

fixes #8331

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21450>
(cherry picked from commit b43d32b77d)
2023-02-22 20:29:16 +00:00
Charmaine Lee
09802e77ae svga: use upload buffer if texture has pending changes
When establishing a texture transfer map, if there is any pending changes on the
texture, instead of trying direct map with DONTBLOCK first, just
use the upload buffer path.

Fixes piglit tests gen-teximages, arb_copy_images-formats

Cc: mesa-stable

Reviewed-by: Neha Bhende <bhenden@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
(cherry picked from commit 1b9b060f0e)
2023-02-22 20:29:16 +00:00
Charmaine Lee
527787da54 svga: fix compatible formats for shareable surfaces
Add typeless format to the compatible format lists for shareable surfaces.

Fixes webgl benchmark crash in eglCreateImage running from firefox on Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
(cherry picked from commit 3a359385cb)
2023-02-22 20:29:16 +00:00
Charmaine Lee
f96201f60f svga: fix resource_get_handle from resource created without SHARED bind flag
When an EGLImage is created from a 2D texture and used for texture sharing,
the texture surface might not have been created with the SHARED bind flag.
To allow these surfaces for sharing, this patch sets the USAGE SHARED bit
for surfaces that can be potentially used for sharing even when the SHARED
bind flag is not originally set. Instead of unconditionally enabling the
SHARED bind flag for all surfaces and unnecessarily bypass the surface cache
optimization, this patch only enables the USAGE SHARED bit for surfaces
that also have the RENDER TARGET bind flag.
When the surface handle is inquired and if the surface is currently
marked as cachable, we will need to unset the cachable bit so
the surface handle will not be recycled again.

This patch fixes an assertion in svga_resource_get_handle() when the
EGL_MESA_image_dma_buf_export extension is used in webgl benchamrk running
from firefox in Fedora 37.

Cc: mesa-stable

Reviewed-by: Martin Krastev <krastevm@vmware.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21393>
(cherry picked from commit 75b7296fc3)
2023-02-22 20:29:16 +00:00
Timothy Arceri
b74f1d090d glsl: isolate object macro replacments
Here we use a leading space to isolate them from
the code they will be inserted into. For example:

    #define VALUE -1.0
    int a = -VALUE;

Should be evaluated to int a = - -1.0; not int a = --1.0;

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7932

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
(cherry picked from commit 3a9edfc494)
2023-02-22 20:29:16 +00:00
Timothy Arceri
2da88f4bf7 glsl: add _token_list_prepend() helper to the parser
This will be used in the following patch.

Cc: mesa-stable
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21352>
(cherry picked from commit 6e29dce291)
2023-02-22 20:29:16 +00:00
Marek Olšák
49f745a617 mesa: ignore indices[i] if count[i] == 0 for MultiDrawElements
Cc: mesa-stable

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21039>
(cherry picked from commit e2ad086f48)
2023-02-22 20:29:16 +00:00
Timur Kristóf
07d5b352b1 radv: Call nir_lower_array_deref_of_vec in radv_lower_io_to_scalar_early.
This fixes an issue when a vector component of an arrayed output has a deref.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8197
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21028>
(cherry picked from commit e13074d763)
2023-02-22 20:29:16 +00:00
Samuel Pitoiset
35d330ed89 radv/amdgpu: only set a new pstate if the current one is different
AMDGPU pstate is per context but if there is multiple AMDGPU contexts
in flight, the kernel can return -EBUSY.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
(cherry picked from commit 6d73841d34)
2023-02-22 20:29:16 +00:00
Samuel Pitoiset
2029f4bd30 Revert "radv: acquire pstate on-demand when capturing with RGP"
This change is wrong for two reasons:
- it hangs most of the time maybe, because changing PSTATE when the
  application is running is broken somehow
- it increases the time between triggering and generating the capture
  considerably, because there is a delay for changing PSTATE

This restores previous logic where PSTATE is set to profile_peak at
logical device creation. Though, it also re-introduces an issue with
multiple logical devices (kernel returns -EBUSY) but this will be
fixed in the next commit.

This fixes GPU hangs when trying to record RGP captures on my NAVI21.
Note that profile_peak is only required for some RDNA2 chips (including
VanGogh).

Cc: mesa-stable
This reverts commit 923a864d94.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21222>
(cherry picked from commit 663877e894)
2023-02-22 20:29:16 +00:00
Erico Nunes
bcbfb7dcbb lima: don't use resource_from_handle while creating scanout
resource_from_handle implementations create an additional reference to
the scanout resource, which caused lima to leak those resources after
commit ad4d7ca833.

Do as the other drivers do and import the bo directly while creating
the scanount resource.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8198
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/21330>
(cherry picked from commit c426e5677f)
2023-02-22 20:29:16 +00:00
Italo Nicola
83fc369ad6 panfrost: fix tiny sample_positions BO memory leak
Fixes a 4KB memory leak that happens once per-device creation.

Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Tested-by: Chris Healy healych@amazon.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21372>
(cherry picked from commit e787ddf298)
2023-02-22 20:29:16 +00:00
Faith Ekstrand
70e53f2dff nir/from_ssa: Move the loop bounds check in resolve_parallel_copy
We loop, effectively, over two stacks: ready and to_do and finish only
when both are empty.  In the case where ready is empty, we pull one off
of to_do, add a copy to a temporary, and push it onto the ready stack.
Previously, we assumed that we would never get to the temporary copy
case if to_do has exactly one entry because that would imply that there
was only one copy left which means there can't possibly be a cycle to
break.  This was true until c7fc44f9eb ("nir/from_ssa: Respect and
populate divergence information") which changed things such that
temporary copies sometimes get added in the case where a convergent
value is copied both to convergent and divergent destinations.

This patch adjusts our loop iteration to always attempt to clear the
ready stack before checking if there's anything left on the to_do stack.
I also added an assert to make the exit condition more clear.

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8037
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
(cherry picked from commit 4e09d37f3b)
2023-02-22 20:29:16 +00:00
Faith Ekstrand
7f6062bff0 nir/from_ssa: Only re-locate values that are destinations
There is an optimization in the parallel copy algorithm where, after a
copy has been performed, we can treat the destination as the new source
for future copies of the same source.  In particular, consider the
following parallel copy: A -> B, C -> A, A -> C.  In this case, after we
have done the A -> B copy, we can make note that the value in A is now
in B and emit the sequence: A -> B, C -> A, B -> C.  This allows us to
resolve the swap cycle between A anc C without allocating a temporary
register because we know B is also a copy of A.

When one of the registers involved is convergent and the other is
divergent, this optimization is problematic because, while convergent to
divergent copies are fine, we can't re-use the divergent copy in later
copies if any of those copies are to a convergent variable.  We could,
but it would require a read_first_invocation which would get messy.  In
In c7fc44f9eb ("nir/from_ssa: Respect and populate divergence
information"), we attempted to deal with this by limiting the rename
optimization to the case where the divergence matched.

The problem is that we did the re-name part whenever the divergence
matched but only marked it as ready if the thing being copied was a
destination.  (We actually left two instances of loc[a] = b, one which
always happened and one which only happened if we also wanted to flag
the source as being ready to use as a destination.)  While this
technically doesn't cause any problems, it may result in more inter-mov
dependencies which hurts instruction scheduling.  For example, if we had
the parallel copy A -> B, A -> C, A -> D, we now end up emitting the
sequence A -> B, B -> C, C -> D which has many more data hazards between
instructions caused by the constant shuffling.

This commit restores the original logic in which we only perform the
rename optimization if the rename would free up a register we will later
use as a destination.  This isn't entirely optimal as it still doesn't
prove that there is a cycle involved first, but it should lead to a
reduction in unnecessary dependencies.

No shader-db changes on SKL or DG2

Fixes: c7fc44f9eb ("nir/from_ssa: Respect and populate divergence information")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21315>
(cherry picked from commit 5afba073c6)
2023-02-22 20:29:16 +00:00
Sidney Just
609da7429c zink: Add missing features to the profile file
Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20920>
(cherry picked from commit fc84c63e17)
2023-02-22 20:29:16 +00:00
Emma Anholt
245ee95436 hasvk: Fix SPIR-V warning about TF unsupported on gen7.
It's supported now.

Fixes: d82826ad44 ("anv: Implement VK_EXT_transform_feedback on Gen7")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21228>
(cherry picked from commit ed62eec58b)
2023-02-22 20:29:16 +00:00
Mike Blumenkrantz
1a26e48926 vulkan/wsi: avoid deadlocking dri3 when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

fixes #6685

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
(cherry picked from commit 819cbf329a)
2023-02-22 20:29:16 +00:00
Mike Blumenkrantz
515f353647 dri3: avoid deadlocking when polling deleted windows for events
upcoming xserver releases will emit PresentConfigureNotify with this
flag set when a window is destroyed, ensuring drivers
don't poll infinitely and deadlock

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/116

cc: mesa-stable

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Michel Dänzer <mdaenzer@redhat.com>

Acked-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21339>
(cherry picked from commit 91de576a7f)
2023-02-22 20:29:15 +00:00
Pierre-Eric Pelloux-Prayer
8412c9a9e2 amd/surface: fix base_mip_width of subsampled formats
base_mip_width is used in si_compute_copy_image when the
SI_IMAGE_ACCESS_BLOCK_FORMAT_AS_UINT flag is used.

   width = tex->surface.u.gfx9.base_mip_width;

This will be incorrect if we don't adjust it. For instance,
with a 260x256 image, surf_pitch and base_mip_width are
320 before surf_pitch is updated to be 192.

Both need to match, or computing the width from base_mip_width
leads to incorrect result.

Cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21253>
(cherry picked from commit affa8a9fb2)
2023-02-22 20:29:15 +00:00
Chia-I Wu
16d47a065a turnip: fix a major leak with GPL LTO
This allows dEQP-VK.pipeline.pipeline_library.* to run to finish.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21328>
(cherry picked from commit bce8e7f2ae)
2023-02-22 20:29:15 +00:00
Constantine Shablya
255b5edddb anv,hasvk: flush what UNIFORM_READ flushes on SHADER_READ
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8287
Cc: mesa-stable
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21310>
(cherry picked from commit 09501fe5a7)
2023-02-22 20:29:15 +00:00
Mike Blumenkrantz
70e8f8b4d0 zink: block LINEAR filtered blits for zs formats
this is illegal, and the u_blitter path has to be taken to guarantee
enough accuracy that the strictest piglit tests pass

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21314>
(cherry picked from commit f0e1512673)
2023-02-22 20:29:15 +00:00
Lionel Landwerlin
385f9a9662 intel/fs: bound subgroup invocation read to dispatch size
This is to avoid out of bound register accesses (potentially leading
to hangs) when the dispatch size is smaller than when is reported in
the NIR subgroup_size.

v2: Implement bounding with a mask (since workgroup sizes are powers of 2) (Faith)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 530de844ef ("intel,anv,iris,crocus: Drop subgroup size from the shader key")
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21282>
(cherry picked from commit 9ac192d79d)
2023-02-22 20:29:15 +00:00
Georg Lehmann
7f2afea6b9 aco: Don't use vcmpx with DPP.
V_CMPX+DPP returns 0 with reads from disabled lanes, unlike V_CMP+DPP (RDNA3 ISA doc, 7.7)

Fixes: baab6f18c9 ("aco: Optimize branching sequence during SSA elimination.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20537>
(cherry picked from commit 4fbcd046ce)
2023-02-22 20:29:15 +00:00
Eric Engestrom
af1a8e98e6 .pick_status.json: Mark b68f13bc90 as denominated 2023-02-22 20:29:15 +00:00
Michel Dänzer
8e053f0042 anv/grl: Use union for reinterpreting integer as float
Fixes strict aliasing violations flagged by GCC 12:

../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float as_float(uint32_t)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:182:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  182 |     return *reinterpret_cast<float*>(&i);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float3 as_float3(int3)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  187 |     return *reinterpret_cast<float3*>(&i3);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:187:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h: In function ‘float4 as_float4(int4)’:
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]
  192 |     return *reinterpret_cast<float4*>(&i4);
      |             ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../src/intel/vulkan/grl/include/GRLOCLCompatibility.h:192:13: warning: dereferencing type-punned pointer will break strict-aliasing rules [-Wstrict-aliasing]

Fixes: 5f948503e4 ("anv: Import GRL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21236>
(cherry picked from commit 53ce756eeb)
2023-02-22 20:29:15 +00:00
Eric Engestrom
bfbbe34d27 .pick_status.json: Update to dd3b67b974 2023-02-22 20:29:15 +00:00
Eric Engestrom
6f87476877 .pick_status.json: Mark 75e5d458a0 as denominated 2023-02-22 20:29:15 +00:00
Samuel Pitoiset
f4b6574c78 radv: disable DCC for mipmaps on GFX11
It seems broken but can't really figure out why and DCC levels aren't
interleaved on GFX11. Skipping DCC initialization for levels seems to
also fix it but seems safer to disable completely, as a hotfix.

Fixes DCC issues with Hi-Fi Rush, Sonic Frontiers, Hogwarts Legacy
and probably more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8230
Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21186>
(cherry picked from commit 5d41d8258a)
2023-02-22 20:29:15 +00:00
Dave Airlie
093069615c crocus: switch gen4/5 tiling flags to follow suggestions.
Fixes: 6043f66dd3 ("crocus: disable Y tiling for render targets properly.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21300>
(cherry picked from commit 6d3c79fa4c)
2023-02-22 20:29:15 +00:00
Eric Engestrom
45db0c5a55 .pick_status.json: Mark 5c246e21b7 as denominated 2023-02-22 20:29:15 +00:00
Alan Coopersmith
10d72a4573 util/disk_cache: Handle OS'es without d_type in struct dirent
Needed to build on Solaris

Fixes: f58e6fee74 ("util/disk_cache: delete more cache items in one go when full")
Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21110>
(cherry picked from commit 289eb50abf)
2023-02-22 20:29:15 +00:00
Mike Blumenkrantz
1eb541289f zink: always use NEAREST for zs blits
LINEAR is illegal, and swapping filtering at this point still
seems to be conformant given questionable GL spec requirements for
LINEAR zs filtering

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21203>
(cherry picked from commit 067545eb9a)
2023-02-22 20:29:15 +00:00
Lionel Landwerlin
7cab0f7838 anv/hasvk: handle a SAMPLED_READ/STORAGE_READ access flags
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21277>
(cherry picked from commit eb5d7056e0)
2023-02-22 20:29:15 +00:00
SoroushIMG
9ed54537c4 zink: free resource objects' views array during destruction
since the array is not ralloc managed, it has be explicitly freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
(cherry picked from commit 96849363eb)
2023-02-22 20:29:15 +00:00
SoroushIMG
840e0b9410 zink: allocate program shader caches from the program's mem ctx
these will now be freed when the program itself is freed.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
(cherry picked from commit b3ed037ca8)
2023-02-22 20:29:15 +00:00
SoroushIMG
2cb4f5a1bc zink: fix compute shader leaks
Compute program owns the nir and zink shaders now and must free them
too when destroyed.

Fixes: 4cb4bb555e ("zink: create compute programs from compute shaders directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21285>
(cherry picked from commit 6af3a12e70)
2023-02-22 20:29:15 +00:00
Mike Blumenkrantz
d233bf7c7d zink: ralloc zink_shader structs
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 9e0e6708ed)
2023-02-22 20:26:54 +00:00
Mike Blumenkrantz
6e9c95f690 zink: fix descriptor pool free iterating
these arrays are sparsely allocated, and using pop() on them will
fail to access some elements

Fixes: cf7c17a7af ("zink: rework descriptor pool overflow")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
(cherry picked from commit ffd91ee7a8)
2023-02-14 17:48:07 +00:00
Mike Blumenkrantz
b9f89132fb zink: sync LTO compiles for GPL pipelines on shader free
this avoids invalid access

affects:
KHR-Single-GL46.arrays_of_arrays_gl.InteractionStorageBuffers2

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21246>
(cherry picked from commit 16c019142b)
2023-02-14 17:48:06 +00:00
Mike Blumenkrantz
23d9e6da3a zink: unset gfx shader read when unbinding shader images
this otherwise will never be unset

Fixes: 50e764fa50 ("zink: track gfx/compute descriptor barrier info")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21229>
(cherry picked from commit ee53b07c0a)
2023-02-14 14:42:10 +00:00
Hans-Kristian Arntzen
57edba1586 radv: Fix missing VK_ACCESS_2_SHADER_SAMPLED_READ_BIT.
Cannot be used for SSBO, so ignore SCACHE invalidation.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
(cherry picked from commit 7efabfbbe4)
2023-02-14 12:41:13 +00:00
Hans-Kristian Arntzen
cb48348f61 radv: Fix invalid 64-bit shift.
For sync2 bits, overflow can happen.
Use BITFIELD64_BIT to align with ANV.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 8df17163c7 ("radv: implement vkCmdWaitEvents2KHR")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21271>
(cherry picked from commit 97aa8d9547)
2023-02-14 12:41:12 +00:00
Michel Dänzer
5e8b3d3cc8 glsl/standalone: Do not pass memory allocated with ralloc_size to free
Pointed out by GCC:

In function ‘load_text_file’,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/compiler/glsl/standalone.cpp:358:17: error: ‘free’ called on pointer ‘block_195’ with nonzero offset 48 [-Werror=free-nonheap-object]
  358 |             free(text);
      |                 ^
In function ‘ralloc_size’,
    inlined from ‘load_text_file’ at ../src/compiler/glsl/standalone.cpp:352:31,
    inlined from ‘standalone_compile_shader’ at ../src/compiler/glsl/standalone.cpp:491:38,
    inlined from ‘main’ at ../src/compiler/glsl/main.cpp:98:45:
../src/util/ralloc.c:117:18: note: returned from ‘malloc’
  117 |    void *block = malloc(align64(size + sizeof(ralloc_header),
      |                  ^

Fixes: a9696e79fb ("main: Close memory leak of shader string from load_text_file.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
(cherry picked from commit 49a6bdde8e)
2023-02-14 12:41:11 +00:00
Michel Dänzer
5d515d7a3d glsl/standalone: Fix up _mesa_reference_shader_program_data signature
Drop the unused ctx parameter, to match the main Mesa code.

Fixes ODR violation flagged by -Wodr with LTO enabled:

../src/mesa/main/shaderobj.h:74:1: error: ‘_mesa_reference_shader_program_data’ violates the C++ One Definition Rule [-Werror=odr]
   74 | _mesa_reference_shader_program_data(struct gl_shader_program_data **ptr,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: type mismatch in parameter 1
   76 | _mesa_reference_shader_program_data(struct gl_context *ctx,
      | ^
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: ‘_mesa_reference_shader_program_data’ was previously declared here
../src/compiler/glsl/standalone_scaffolding.cpp:76:1: note: code may be misoptimized unless ‘-fno-strict-aliasing’ is used

Fixes: 717a720e9c ("mesa: drop unused context parameter to shader program data reference.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21215>
(cherry picked from commit bf67f32d4b)
2023-02-14 12:41:09 +00:00
Eric Engestrom
130dbe0e00 .pick_status.json: Update to 75e5d458a0 2023-02-14 12:41:08 +00:00
Bas Nieuwenhuizen
418f1812de nir: Apply a maximum stack depth to avoid stack overflows.
A stackless (or at least using allocated memory for stack) version
might be nice but for now this works around some games compiling
large shaders and hitting stack overflows.

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21231>
(cherry picked from commit 0a17c3afc5)
2023-02-12 10:55:06 +00:00
Sviatoslav Peleshko
fa4947e696 anv: Handle VkAccelerationStructureBuildRangeInfoKHR::transformOffset
Previously it was not actually handled. This meant that all geometries
with the same transform buffer were using the same (first) transformation
matrix.

Fixes: f3ddfd81 ("anv: Build BVHs on the GPU with GRL")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7575
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21227>
(cherry picked from commit 9b2ddd2c5e)
2023-02-12 10:54:43 +00:00
Danylo Piliaiev
98050ce31f turnip: Disable draw states after dyn renderpass in all cases
Draw states were not disabled after a dynamic renderpass which
spans several command buffers, the next renderpass if started in
the same command buffer wouldn't emit the full draw state,
since TU_CMD_DIRTY_DRAW_STATE was not set by previous renderpass.

The issue could be observed when corrupting all regs at cmdbuf start in:
 dEQP-VK.dynamic_rendering.primary_cmd_buff.random.seed7_geometry

Fixes: cb0f414b2a
("tu: Add support for suspending and resuming renderpasses")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
(cherry picked from commit 2d20564a6a)
2023-02-12 10:54:41 +00:00
Danylo Piliaiev
d805e74833 tu: Prevent using stale value of GRAS_SC_CNTL in sysmem clear
cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21148>
(cherry picked from commit 388e4ea733)
2023-02-12 10:54:40 +00:00
Mike Blumenkrantz
cb0e344a85 zink: add newlines to some debug printfs
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21239>
(cherry picked from commit cd446b87e1)
2023-02-12 10:54:25 +00:00
Eric Engestrom
6fe167e28d .pick_status.json: Update to c0bc0ecf9e 2023-02-12 10:54:11 +00:00
GH Cao
e448321812 dzn: Declare debug only root_dwords as ASSERTED
Such variable is only used in assert(), so declare it as ASSERTED.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7885
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7234

Signed-off-by: GH Cao <driver1998.ms@outlook.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20676>
(cherry picked from commit af55e36d79)
2023-02-10 16:35:29 +00:00
Dave Airlie
ba0e805d96 crocus: disable Y tiling for render targets properly.
The old code would disallow linear targets as well which would confuse
things with reimporting dma-bufs.

Fixes: 32728dc66e ("crocus: introduce main resource configuration helper.")
Acked-by: Faith Ekstrand <faith.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21209>
(cherry picked from commit 6043f66dd3)
2023-02-10 13:56:17 +00:00
Eric Engestrom
3077937b56 .pick_status.json: Mark db6c374919 as denominated 2023-02-10 13:56:17 +00:00
Lionel Landwerlin
ac80ae62c6 intel/fs: fix mesh indirect movs
The size in src[2] is in byte and needs to cover any possible data
accessed in src[0] by the indirection. That way the register
allocation is aware of what cannot be spilled for the instruction to
execute on valid data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 70ace2bbcd ("intel/compiler: Implement Task Output and Mesh Input")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21188>
(cherry picked from commit ebc4893947)
2023-02-10 13:56:17 +00:00
Tapani Pälli
449caf6705 intel/blorp: disable REP16 for gfx12+ with R10G10B10_FLOAT_A2
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21137>
(cherry picked from commit 88cadf1454)
2023-02-10 13:56:17 +00:00
Eric Engestrom
c7fdaf3369 .pick_status.json: Mark f7b2dbb2bd as denominated 2023-02-10 13:56:17 +00:00
Georg Lehmann
64f6793b52 aco: don't allow output modifiers for v_cvt_pkrtz_f16_f32
Cc: mesa-stable
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21174>
(cherry picked from commit b63aa2bb8e)
2023-02-10 10:19:50 +00:00
Eric Engestrom
63071f2971 .pick_status.json: Update to 94eff7ccd8 2023-02-10 10:19:26 +00:00
Eric Engestrom
78ef633056 docs/relnotes: add sha256sum for 22.3.5 2023-02-08 22:24:16 +00:00
Eric Engestrom
6570a15662 VERSION: bump for 22.3.5 2023-02-08 21:05:36 +00:00
Eric Engestrom
ad91f96a8d docs: add release notes for 22.3.5 2023-02-08 21:05:31 +00:00
Iván Briano
0950a0b307 anv: uncompressed views of compressed 3d images are now valid
There was a VUID-VkImageViewCreateInfo-image-04739 in the Vulkan 1.3
spec that said:

    If image was created with the
    VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT flag and format is a
    non-compressed format, viewType must not be VK_IMAGE_VIEW_TYPE_3D

That VUID has since been removed, and when a view of a 3D image is
created, with put the depth into the array_len, so it won't be always 1.

Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20803>
(cherry picked from commit 58ababdee6)
2023-02-08 20:34:47 +00:00
Georg Lehmann
72a090347a aco: fix imod/omod for gfx11 VOP3 opcodes
Fixes: d8d99c3c4f ("aco: add GFX11 opcode numbers")
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21170>
(cherry picked from commit c8adf16278)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
c6a3803803 util/vbuf: fix multidraw unrolling
* drawid needs to be incremented at end of loop
* rescope draw structs to initialize at top of loop

fix #8191

Fixes: 6b07893b31 ("util/vbuf: handle multidraws")

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21139>
(cherry picked from commit 8f5a63ebfe)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
deccd02888 zink: use screen indexing for bindless descriptor set in template bind
Fixes: 8636717270 ("zink: add a "compact" descriptor mode")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit faaf6f95cc)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
0efffb8f55 zink: make last_vertex_stage the first bit in zink_vs_key_base
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 77d8cd9c07)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
9b3aaba297 zink: fix gpl lib hashing
this was including the generated tcs bits, which was likely to be wrong
and thus break optimal key hashing, requiring more pipelines

it also wasn't setting the optimal key value correctly during precompile,
which meant the wrong hash value was used and the precompiled libs were never
actually accessible

cc: mesa-stable

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 4cf54e2ed2)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
0064841f28 zink: set zs feedback loop bit from driver workaround on ctx create
this may otherwise not be set until the cache has been broken

Fixes: 56fb258064 ("zink: replace mixed_zs with zs feedback loops")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit bbae237258)
2023-02-08 20:34:47 +00:00
Mike Blumenkrantz
e9b1628209 zink: set gfx feedback loop bit in pipeline state for driver workaround
this needs to be set on context create or it may never get set

Fixes: 645f2da3fa ("zink: always set VK_PIPELINE_CREATE_COLOR_ATTACHMENT_FEEDBACK_LOOP_BIT_EXT sometimes")

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 0cb326cc74)
2023-02-08 20:34:46 +00:00
Mike Blumenkrantz
3d71f97353 zink: add a define for testing that an optimal key is the default
tcs values here are ignored since they only matter for generated tcs

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry picked from commit 7c021cc5f0)
2023-02-08 20:34:46 +00:00
Mike Blumenkrantz
bf586009b4 zink: add a define for the "default" optimal key
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21169>
(cherry-picked from 1f08a6dcdb)
2023-02-08 20:34:46 +00:00
SoroushIMG
a194c941cc zink: fix pointcoord y inversion
Point sprite coordinates in general need to be inverted,
not just the texcoords converted to point sprite.

Move point coord y inversion out to its own pass.
Fixes GTF-GL46.gtf21.GL2FixedTests.point_sprites.point_sprites
with FBO dEQP surface.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21050>
(cherry picked from commit 782f1e9e01)
2023-02-08 20:34:46 +00:00
Ian Romanick
c528593940 lavapipe: Fix bad array index scale factor in lvp_inline_uniforms pass
A few lines earlier uni_offsets is accessed with ubo scaled by
PIPE_MAX_CONSTANT_BUFFERS:

   if (uni_offsets[ubo * PIPE_MAX_CONSTANT_BUFFERS + i] == offset)

Found by inspection.

Looking at the before and after NIR code for
dEQP-VK.graphicsfuzz.cov-int-initialize-from-multiple-large-arrays,
using the correct indexing appears to enable the pass to inline an
additional uniform. My guess is that when a uniform is used more than
once, the first loop wouldn't find the offset recored in the table
because it was recorded at the wrong location.

Fixes: d23a9380dd ("lavapipe: implement extreme uniform inlining")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21144>
(cherry picked from commit a7696a4d98)
2023-02-08 20:34:46 +00:00
Rhys Perry
f615ca7458 aco: fix out-of-bounds access when moving s_mem(real)time across SMEM
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8224
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21138>
(cherry picked from commit fad1f716dd)
2023-02-08 20:34:46 +00:00
Mike Blumenkrantz
bc9220de95 lavapipe: disable VK_FORMAT_FEATURE_2_COLOR_ATTACHMENT_BLEND_BIT for int formats
this is unsupported and undefined by the spec

cc: mesa-stable

Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21099>
(cherry picked from commit 7d8e2db9f9)
2023-02-08 20:34:46 +00:00
Iago Toral Quiroga
abfbec7ae5 v3dv: ensure we apply binning syncs to secondary command buffers
Currently, we postpone binning syncs until we record draw calls
and can validate if any of them require accessing protected
resources in the binning stage, however, if the draw calls are
recorded in a secondary command buffer and the barriers have
been recorded in the primary command buffer, we won't apply the
binning sync in the secondary when we record the draw calls
and so we must apply it when we execute the secondary in the
primary.

Fixes flakyness in:
dEQP-VK.api.command_buffers.record_many_draws_secondary_2

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
(cherry picked from commit fec15a225f)
2023-02-08 20:34:46 +00:00
Iago Toral Quiroga
1e65762031 v3dv: ensure at least V3D_CL_MAX_INSTR_SIZE bytes in last CL instruction
The CLE parser in the sim will read this many bytes for each instruction
in a CL, so we should ensure we have at least that many bytes available
in the BO when reading the last instruction, otherwise we can trigger
a GMP violation. It is not clear whether this behavior applies to real
hardware too.

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21162>
(cherry picked from commit c2601f0690)
2023-02-08 20:34:45 +00:00
pal1000
9d4413d65f meson: Ignore unused variables when assertions are disabled
Fixes: 46b099e3
("meson: Ignore unused variables in release builds")

46b099e3 has some issues:
- it doesn't enable unused variables warning on release builds
with assertions enabled;
- it doesn't disable unused variables warning on debug builds
with assertions disabled;
- it doesn't disable unused variables warning when building
with MSVC and assertions are disabled regardless of buildtype,
see #8147. 3/4 regressions reported there have this limitation
alone as root cause.

Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21154>
(cherry picked from commit 4347072443)
2023-02-08 20:34:45 +00:00
Yuxuan Shui
3e5da1cc33 loader: unregister special event in loader_dri3_drawable_fini
This was inadvertently removed in 98a6cfd395 and causes continuous
memory leaks as events are being received after the context has been
unbound.

Fixes: 3170b63314 ("loader: Add infrastructure for tracking active CRTC resources")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8238
Signed-off-by: Yuxuan Shui <yshuiv7@gmail.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21128>
(cherry picked from commit 27a89a0903)
2023-02-08 20:34:45 +00:00
Mike Blumenkrantz
edb82453e1 zink: fix max acquired image count
according to spec, the maximum number of acquired images can be calculated with

swapchain_size - VkSurfaceCapabilitiesKHR::minImageCount + 1

the previous calculation was both wrong and occurring in the wrong place,
so this corrects both issues

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21095>
(cherry picked from commit 89cf0a3bdc)
2023-02-08 20:34:45 +00:00
SoroushIMG
df96e9c0a0 zink: clear null image surfaces to 0
GL Spec says that imageLoad from incomplete images must return 0.
This is not really spec compliant as for proper behavior nullDescriptor
and robustImageAccess2 is needed.
A workaround for lack of either of these requires a shader variant.
Clearing the null surface and hoping the app doesn't write to the image
is closer to spec, while avoiding a shader recompile.

KHR-GL46.shader_image_load_store.incomplete_textures tests this.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21135>
(cherry picked from commit 22e91af1a7)
2023-02-08 20:34:45 +00:00
SoroushIMG
4f58fe67d2 zink: fix leak when rebinding same image surface
simple way to reproduce this is to run these 4 together:
KHR-GL46.gpu_shader5.images_array_indexing
KHR-GL46.shader_image_load_store.advanced-allMips
KHR-GL46.shader_image_load_store.advanced-sso-simple
KHR-GL46.shader_image_load_store.incomplete_textures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
(cherry picked from commit 104040b5c7)
2023-02-08 20:34:45 +00:00
SoroushIMG
21e6f53a68 zink: only save frag const buffers when used by blit
fixes upload manager constant buffer leak.
zink only needs to save the const buffer for stencil fallback blits.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21134>
(cherry picked from commit 4c647c9e25)
2023-02-08 20:34:45 +00:00
Rhys Perry
72fbe4451d radv: set state.vbo_misaligned_mask_invalid in radv_bind_vs_input_state
Found by inspection. Something probably hangs because of this, but I don't
know what.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Tatsuyuki Ishi <ishitatsuyuki@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: c199a5160a ("radv: bind the VS input state for prologs created with GPL")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20913>
(cherry picked from commit 10a5035c83)
2023-02-08 20:34:45 +00:00
Konstantin Seurer
e29a84fc16 ac/llvm: Fix validation error with global io
Fixes: afd645f057 ("ac/llvm: remove LLVMBuildGEP usages")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20521>
(cherry picked from commit 10ac51a52b)
2023-02-08 20:34:44 +00:00
Timur Kristóf
18f0d33423 ac/nir/ngg: Include culled primitives in query.
Vulkan spec 18.8. Primitives Generated Queries:

When a generated primitive query for a vertex stream is active,
the primitives-generated count is incremented every time a
primitive emitted to that stream reaches the transform feedback
stage, whether or not transform feedback is active.

We can see the order of stages in chapter 27 Fixed-Function
Vertex Post-Processing, which shows that the transform feedback
stage is before rasterization (and therefore culling).

Conclusion is that culled primitives should be included
in the primitives generated query.

This commit makes sure to emit the primitives generated query
code before culling and uses the input primitive count passed
to the current wave instead of the exec mask after culling.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21037>
(cherry picked from commit 3a819bd22e)
2023-02-08 20:34:44 +00:00
SoroushIMG
489f1293db zink: fix cap check for arb sparse texture2
arb_sparse_texture2 also enables multisampled sparse textures.
bring back the check for msaa support.

fixes #8229

Fixes: 4f8ba2b9aa ("zink: fix sparse residency query and minLOD feature checks")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21121>
(cherry picked from commit 8f928a95e1)
2023-02-08 20:34:44 +00:00
SoroushIMG
c8aa0587e1 zink: fix sparse residency query and minLOD feature checks
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21013>
(cherry picked from commit 4f8ba2b9aa)
2023-02-08 20:34:44 +00:00
Dylan Baker
28e5823a68 meson: combine checks for linker --gc-sections support
We first do an incomplete check for whether the linker supports
--gc-sections, then potentially add C and C++ arguments assuming that it
works, then later do a complete check to see if it actually works and
use --gc-sections. This means we can end up putting functions and data
in separate sections when we can't gc them.

Combine the checks, do less work, and be more accurate.

fixes: f51ce21e4e
       ("meson: Drop adding -Wl,--gc-sections to project c/cpp arguments.")

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21083>
(cherry picked from commit fd9b50aa1c)
2023-02-08 20:34:44 +00:00
Qiang Yu
b742313eaf ac/nir/ngg: fix clip dist culling mask uninitialized
Fixes: f75452918b ("ac/nir/ngg: support clipdist culling")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20691>
(cherry picked from commit d798214c7b)
2023-02-08 20:34:44 +00:00
Timur Kristóf
eadaef0ffd radv: Disable NGG culling when conservative overestimation is used.
Even when small primitive culling is disabled, the face culling algorithm
in ac_nir_cull can delete tiny triangles when their area is almost zero.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20987>
(cherry picked from commit 3508597aa1)
2023-02-08 20:34:44 +00:00
Constantine Shablya
9a5bec6695 anv: handle ATTACHMENT_OPTIMAL layout
Closes: #8216
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21066>
(cherry picked from commit 9b3b7e5091)
2023-02-08 20:34:44 +00:00
Marek Olšák
e10b4ffa4d amd: fix typo in shadowed uconfig registers on gfx11
It used an invalid offset, which hung.

Fixes: f24f8665db - ac: implement register shadowing for gfx11

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 76472c850b)
2023-02-08 20:34:43 +00:00
Marek Olšák
2da08ed347 amd: fix tile_swizzle on gfx11 - should be shifted by 10 bits, not 8
This reverts the radv_adjust_tile_swizzle change to unify the code.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 47f598a183)
2023-02-08 20:34:43 +00:00
Marek Olšák
d218080952 amd: split GFX1103 into GFX1103_R1 and GFX1103_R2
Fixes: caa09f66ae - amd: add chip identification for gfx1100-1103

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 84d59cdb59)
2023-02-08 20:34:43 +00:00
Marek Olšák
88fd058521 radeonsi/gfx11: unset SAMPLE_MASK_TRACKER_WATERMARK to fix hangs
Same as PAL.

Fixes: 529eb739fc - radeonsi/gfx11: add CB deltas

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 66d11391f7)
2023-02-08 20:34:43 +00:00
Marek Olšák
b1f454182e radeonsi: fix RB+ blending with sRGB formats
The epsilon for 8bpc is for the linear colorspace. There is no epsilon
for sRGB.

Fixes: 17021efc74 - radeonsi: adjust RB+ blend optimization settings

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21041>
(cherry picked from commit 8556b3db71)
2023-02-08 20:34:43 +00:00
Lucas Stach
2dbe1e8ef3 etnaviv: fix double scanout import of multiplanar resources
etna_resource_from_handle() is called for each plane of a multiplanar
resource, so there is no point in looping over all planes to do the
renderonly scanout import. In fact that will cause us to lose track
of the scanout imports from later planes when the earlier planes are
redoing the import, overwriting the pointer to the allocated
renderonly_scanout struct.

Drop the loop and just do the import for the current plane.

Fixes: 826f95778a ("etnaviv: always try to create KMS side handles for imported resources")
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/20993>
(cherry picked from commit 175732bb51)
2023-02-08 20:34:43 +00:00
Marek Olšák
00da41e6c9 Revert "radeonsi: enable glthread by default"
This reverts commit d6fabe49cd.

It has issues that are not worth fixing in this release branch in my opinion.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21087>
2023-02-08 20:34:43 +00:00
Eric Engestrom
62858c93d4 .pick_status.json: Mark d23b3a1394 as denominated 2023-02-08 20:34:43 +00:00
Sagar Ghuge
390d4c7e82 intel/fs: Always stall between the fences on Gen11+
Be conservative in Gfx11+ and always stall in a fence.  Since there are
two different fences, and shader might want to synchronize between them.

This change also brings back the original code block for the stall
between the fence and comment from the commit
b390ff3517.

v2: (Caio)
 - Re-arrange code block.
 - Adjust comment.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6958

Fixes: f7262462 ("intel/fs: Rework fence handling in brw_fs_nir.cpp")
Signed-off-by: Sagar Ghuge <sagar.ghuge@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20996>
(cherry picked from commit 0c083d29a5)
2023-02-08 20:34:43 +00:00
Eric Engestrom
773e3cb793 .pick_status.json: Mark a568a5492f as denominated 2023-02-08 20:34:42 +00:00
Rhys Perry
444fc67a99 aco: limit VALUPartialForwardingHazard search
Complicated CFG and lots of SALU can cause this to take an extremely long
time to finish.

Fixes
dEQP-VK.graphicsfuzz.cov-value-tracking-selection-dag-negation-clamp-loop
and Monster Hunter Rise demo compile times.

fossil-db (gfx1100):
Totals from 57 (0.04% of 134574) affected shaders:
Instrs: 170919 -> 171165 (+0.14%)
CodeSize: 860144 -> 861128 (+0.11%)
Latency: 961466 -> 961505 (+0.00%)
InvThroughput: 127598 -> 127608 (+0.01%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8153
Fixes: 5806f0246f ("aco/gfx11: workaround VALUPartialForwardingHazard")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20941>
(cherry picked from commit bfd4ac4581)
2023-02-08 20:34:42 +00:00
José Roberto de Souza
58a320186d intel/ds: Fix crash when allocating more intel_ds_queues than u_vector was initialized
u_vector_add() don't keep the returned pointers valid.
After the initial size allocated in u_vector_init() is reached it will
allocate a bigger buffer and copy data from older buffer to the new
one and free the old buffer, making all the previous pointers returned
by u_vector_add() invalid and crashing the application when trying to
access it.

This is reproduced when running
dEQP-VK.synchronization.signal_order.timeline_semaphore.* in DG2 SKUs
that has 4 CCS engines, INTEL_COMPUTE_CLASS=1 is set and of course
perfetto build is enabled.

To fix this issue here I'm moving the storage/allocation of
struct intel_ds_queue to struct anv_queue/iris_batch and using
struct list_head to maintain a chain of intel_ds_queue of the
intel_ds_device.
This allows us to append or remove queues dynamically in future if
necessary.

Fixes: e760c5b37b ("anv: add perfetto source")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20977>
(cherry picked from commit 8092bc2158)
2023-02-08 20:34:42 +00:00
José Roberto de Souza
52b984e555 intel/ds: Nuke intel_ds_queue::queue_id
queue_id is not used anywhere.

Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20888>
(cherry picked from commit 5ccc2049fa)
2023-02-08 20:34:42 +00:00
Rhys Perry
b8ae58820e aco/spill: always end spill vgpr after control flow
To fix a hypothetical issue:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

This is also much simpler.

fossil-db (gfx1100):
Totals from 1195 (0.89% of 134574) affected shaders:
Instrs: 4123856 -> 4123826 (-0.00%); split: -0.00%, +0.00%
CodeSize: 21461256 -> 21461100 (-0.00%); split: -0.00%, +0.00%
Latency: 62816001 -> 62812999 (-0.00%); split: -0.00%, +0.00%
InvThroughput: 9339049 -> 9338564 (-0.01%); split: -0.01%, +0.00%
Copies: 304028 -> 304005 (-0.01%); split: -0.02%, +0.01%
PreVGPRs: 115761 -> 115762 (+0.00%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
(cherry picked from commit bbc5247bf7)
2023-02-08 20:34:42 +00:00
Rhys Perry
4710d25a44 aco: end reduce tmp after control flow, when used within control flow
In the case of:

v0 = start_linear_vgpr
if (...) {

} else {
   use_linear_vgpr(v0)
}
v0 = phi

We need a p_end_linear_vgpr to ensure that the phi does not use the same
VGPR as the linear VGPR.

fossil-db (gfx1100):
Totals from 3763 (2.80% of 134574) affected shaders:
MaxWaves: 90296 -> 90164 (-0.15%)
Instrs: 6857726 -> 6856608 (-0.02%); split: -0.03%, +0.01%
CodeSize: 35382188 -> 35377688 (-0.01%); split: -0.02%, +0.01%
VGPRs: 234864 -> 235692 (+0.35%); split: -0.01%, +0.36%
Latency: 47471923 -> 47474965 (+0.01%); split: -0.03%, +0.04%
InvThroughput: 5640320 -> 5639736 (-0.01%); split: -0.04%, +0.03%
VClause: 93098 -> 93107 (+0.01%); split: -0.01%, +0.02%
SClause: 214137 -> 214130 (-0.00%); split: -0.00%, +0.00%
Copies: 369895 -> 369305 (-0.16%); split: -0.31%, +0.15%
Branches: 164996 -> 164504 (-0.30%); split: -0.30%, +0.00%
PreVGPRs: 210655 -> 211438 (+0.37%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20621>
(cherry picked from commit 44fdd2ebcb)
2023-02-08 20:34:42 +00:00
Eric Engestrom
36ded4ae53 .pick_status.json: Mark 13de23ea07 as denominated 2023-02-08 20:34:42 +00:00
Mike Blumenkrantz
986cd34917 zink: always unref old images when adding new binds
at some point this was correct, but refactoring has since occurred,
and this ends up leaking storage image objects

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
(cherry picked from commit d745e3b0ab)
2023-02-08 20:34:42 +00:00
Mike Blumenkrantz
adf5b07f02 zink: stop leaking push descriptor templates
templates[ZINK_DESCRIPTOR_TYPE_UNIFORMS] needs to be deleted, which
requires a larger iterator

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20867>
(cherry picked from commit dd733034aa)
2023-02-08 20:34:41 +00:00
Mike Blumenkrantz
732beb9641 zink: don't add dmabuf export type if dmabuf isn't supported
avoid trying to create dmabuf-exportable resources too

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20791>
(cherry picked from commit 01d2e7afce)
2023-02-08 20:34:41 +00:00
Samuel Pitoiset
f7aba11a52 radv: fix RB+ for SRGB formats
This should be set for linear colorspace only.

Ported from RadeonSI.

Cc: mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20982>
(cherry picked from commit c8a575eb30)
2023-02-08 20:34:41 +00:00
Eric Engestrom
9db2229a3e .pick_status.json: Mark 47852b9ff4 as denominated 2023-02-08 20:34:41 +00:00
Bas Nieuwenhuizen
7689e2dfc8 radv: Shift left the tile swizzle more on GFX11.
ac/surface puts the raw pip_bank_xor there, which needs the extra
shift for the actual tile_swizzle.

(I think long term we should refactor this in ac/surface but for
 now lets fix like radeonsi to avoid race conditions.)

CC: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
(cherry picked from commit b0a9772cc6)
2023-02-08 20:34:41 +00:00
Bas Nieuwenhuizen
14483d16b5 radv: Set FDCC_CONTROL SAMPLE_MASK_TRACKER_WATERMARK
Might cause hangs according to comments. Syncs with radeonsi/PAL.

Fixes: e210ffb4d0 ("radv: update framebuffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20979>
(cherry picked from commit d321bc1323)
2023-02-08 20:34:41 +00:00
Eric Engestrom
eca296b07b .pick_status.json: Mark 4b841cfec8 as denominated 2023-02-08 20:34:41 +00:00
Hyunjun Ko
302186957b vulkan/runtime: match the spec when taking pipeline subsets.
Signed-off-by: Hyunjun Ko <zzoon@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/21006>
(cherry picked from commit c489b3eadb)
2023-02-08 20:34:41 +00:00
Lucas Stach
8459995eef etnaviv: drm: fix check if BO is on a deferred destroy list
list_is_linked() isn't the right function to use in order to check if
the BO is on a cache bucket or the zombie list, as this checks if the
next pointer of the list isn't NULL. This is always the case with the
BO list item as it's always initialized, so the next pointer points to
the list head itself when the BO isn't on any list.

Use list_is_empty() to check if the BO is actually linked into one
of the deferred destroy lists.

Fixes: 1b1f8592c0 ("etnaviv: drm: properly handle reviving BOs via a lookup")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
(cherry picked from commit 196882a147)
2023-02-08 20:34:40 +00:00
Lucas Stach
480b9ff46e etnaviv: free pm queries dynarray on screen destroy
CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
(cherry picked from commit c59369005b)
2023-02-08 20:34:40 +00:00
Lucas Stach
d5d88aa190 etnaviv: drm: fix BO array leaks
Free the both arrays tracking BOs when the etna_cmd_stream is destroyed.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20940>
(cherry picked from commit 3156b15f70)
2023-02-08 20:34:40 +00:00
Lionel Landwerlin
552902a4fb anv: fix null descriptors
When writing descriptor with a null buffer/image we expect that
writing 0 will point to the null surface. For that to work the null
surface has to be in the bindless surface heap.

This fixes some new failures in dEQP-VK.robustness.* tests once
rewritten from the NV_ray_tracing to KHR_ray_tracing extension.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7762
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20953>
(cherry picked from commit 0d7f8aa249)
2023-02-08 20:34:40 +00:00
Eric Engestrom
ae63d10205 .pick_status.json: Mark ac339d9797 as denominated 2023-02-08 20:34:40 +00:00
Eric Engestrom
a4c4269746 .pick_status.json: Mark 6f7b752fdd as denominated 2023-02-08 20:34:40 +00:00
Eric Engestrom
9267c30f19 .pick_status.json: Mark cc9fa060ee as denominated 2023-02-08 20:34:40 +00:00
Mike Blumenkrantz
2105b352d6 zink: set vkusage/vkflags for buffer resource objects
this needs to be populated for other places in the driver that need it

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
(cherry picked from commit 3c562cfc06)
2023-02-08 20:34:40 +00:00
Mike Blumenkrantz
18af0f23f9 zink: add VK_BUFFER_USAGE_SHADER_DEVICE_ADDRESS_BIT for buffers if ext is enabled
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
(cherry picked from commit c545300f30)
2023-02-08 20:34:40 +00:00
Mike Blumenkrantz
bd723283f3 Revert "zink: allow direct memory mapping for any COHERENT+CACHED buffer"
This reverts commit a3552048c7.

on some drivers this catches qbos, which then hits the below assert.
needs more investigation

Fixes: a3552048c7 ("zink: allow direct memory mapping for any COHERENT+CACHED buffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20912>
(cherry picked from commit 07809c4527)
2023-02-08 20:34:39 +00:00
Rhys Perry
c02ae8592e aco: set has_color_exports with GPL
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: 192486b7aa ("aco/gfx11: export mrtz in discard early exit for non-color shaders")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20937>
(cherry picked from commit 695cf75266)
2023-02-08 20:34:39 +00:00
Samuel Pitoiset
68246581eb radv: add a layer for fixing rendering issues with RAGE2
This game seems to incorrectly set the render area and since we switched
to full dynamic rendering, the framebuffer dimensions is no longer used.

Forcing the render area to be the framebuffer dimensions restore the
previous logic and it fixes rendering issues.

Fixes: c7d0d328d5 ("radv: Set the window scissor to the render area, not framebuffer")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20900>
(cherry picked from commit 1a93cd1556)
2023-02-08 20:34:39 +00:00
Kenneth Graunke
b52fbf7185 egl: Rewrite eglGetMscRateANGLE to avoid probes and handle multi-monitor
RRGetScreenInfo re-probes connector status, which may result in an EDID
transfer for every output, which according to Adam Jackson can be on the
order of 100ms for a single EDID block.  So our previous implementation
of this eglGetMscRateANGLE was blocking for excessive periods of time
instead of being a quick query of the refresh rate like users expect.

This changes our eglGetMscRateANGLE implementation from using
RRGetScreenInfo to RRGetScreenResourcesCurrent and RRGetCrtcInfo.
This obtains the same monitor info without re-probing connectors.

Fixes a severe performance regression in Chromium WebGL performance.

While we're re-implementing the extension, we also implement proper
multi-monitor support: if there are multiple active CRTCs, we determine
which contains the largest portion of the surface, as specified in the
EGL_ANGLE_sync_control_rate extension.

We also now report fractional refresh rates correctly rather than
rounding to the nearest Hz.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6996
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7038
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
(cherry picked from commit 41d5f0ee09)
2023-02-08 20:34:39 +00:00
Kenneth Graunke
987e4f54c0 loader: Add infrastructure for tracking active CRTC resources
This provides a cached view of the current screen resources, with the
coordinates and refresh rate for every active CRTC.  It's currently only
implemented for X11/XCB.

Fixes: 4752655649 ("egl/x11: implement ANGLE_sync_control_rate")
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20665>
(cherry picked from commit 3170b63314)
2023-02-08 20:34:39 +00:00
Corentin Noël
c6d2afccc8 kopper: Do not free the given screen in initScreen implementation
The given screen is already freed by the caller in case a NULL-pointer is
returned by the implementation.

Cc: mesa-stable
Signed-off-by: Corentin Noël <corentin.noel@collabora.com>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20933>
(cherry picked from commit dd3730f8bd)
2023-02-08 20:34:39 +00:00
Eric Engestrom
8b883564a4 .pick_status.json: Update to 6390953fa5 2023-02-08 20:34:26 +00:00
Eric Engestrom
276f31c6ad docs/relnotes: add sha256sum for 22.3.4 2023-01-26 17:36:37 +00:00
Eric Engestrom
a5ffb70f86 VERSION: bump for 22.3.4 2023-01-26 17:07:55 +00:00
Eric Engestrom
9fa5197899 docs: add release notes for 22.3.4 2023-01-26 17:07:48 +00:00
Paulo Zanoni
321d470c92 hasvk: check the return value of anv_execbuf_add_bo_bitset()
This is the Hasvk version of Anv's:
  3d37950fd9 ("anv: check the return value of anv_execbuf_add_bo_bitset()")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20800>
(cherry picked from commit 5039acfd9d)
2023-01-26 15:40:35 +00:00
Paulo Zanoni
60f75a013e hasvk: don't leave undefined values in exec->syncobj_values
This is the Hasvk version of Anv's:
  ad6a036a68 ("anv: don't leave undefined values in exec->syncobj_values")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20800>
(cherry picked from commit 80196aaa5b)
2023-01-26 15:40:35 +00:00
Samuel Pitoiset
d1daf01b3a radv: fix ignoring graphics shader stages that don't need to be imported
If a shader stage is already imported from a library it should be
properly ignored.

Fixes recent CTS dEQP-VK.pipeline.fast_linked_library.misc.unused_shader_stages*.

Fixes: c8765c5244 ("radv: ignore shader stages that don't need to be imported with GPL")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20899>
(cherry picked from commit b97fee432c)
2023-01-26 15:40:35 +00:00
Lionel Landwerlin
5a2ca86429 vulkan/wsi/wayland: improve same gpu detection
Some compositor like KWin do not return the render node.

v2: Make sure we test if only drm_info.hasPrimary is true (Jason)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: db42ed1e04 ("vulkan/wsi/wl: correctly find whether the compositor uses the same GPU")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8139
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20914>
(cherry picked from commit e27d217fb1)
2023-01-26 15:40:35 +00:00
Francisco Jerez
8f0b387d94 intel/fs: Fix src and dst types of LOAD_PAYLOAD ACP entries during copy propagation.
The ACP entries created by copy propagation to track the implied
copies of LOAD_PAYLOAD instructions don't model the behavior of
LOAD_PAYLOAD correctly, since (as of 41868bb682) header
moves are implicitly retyped to UD and the destination of non-header
copies implicitly uses the same type as the corresponding source, even
though the ACP entries created for such copies could incorrectly
represent a type conversion, which can lead to mis-optimization of the
program.

According to Marcin, this fixes the func.mesh.ext.workgroup_id.task.q0
crucible test.

Fixes: 41868bb682 ("i965/fs: Rework the fs_visitor LOAD_PAYLOAD instruction")
Reported-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Tested-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18980>
(cherry picked from commit 7b5e933629)
2023-01-26 15:40:35 +00:00
Mike Blumenkrantz
67f2d07eff zink: fix VK_DYNAMIC_STATE_LINE_WIDTH usage
add a special tracker here to set the state only when necessary

Fixes: 659c39fafb ("zink: rework primitive rasterization type logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20886>
(cherry picked from commit 06a125942b)
2023-01-26 15:40:35 +00:00
Italo Nicola
3a65dc4f7f panfrost: fix off-by-one when exporting format modifiers
`count` should not be incremented before the check, because it causes
the modifiers array to be filled starting from position 1 instead of 0.

This bug causes one less format modifier to be available than would
otherwise be expected, which could then lead to a dmabuf query failing
in situations where a supported modifier wouldn't be advertised.

It also causes garbage data to be advertised as a modifier in position 0
of the array, although this is not very likely to cause issues.

Fixes: 2a1217513 ("panfrost: Implement panfrost_query_dmabuf_modifiers")
Cc: mesa-stable
Signed-off-by: Italo Nicola <italonicola@collabora.com>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20879>
(cherry picked from commit 6c446377ff)
2023-01-26 15:40:35 +00:00
Pierre-Eric Pelloux-Prayer
518487158a radeonsi/gfx11: fix ge_cntl programming
gfx11 renamed PRIM_GRP_SIZE to VERTS_PER_SUBGRP but another change was
was missed.

Update our code based on PAL's UniversalCmdBuffer::CalcGeCntl function
(especially useVgtOnchipCntlForTess being false for gfx11).

Fixes: 25a66477d0 ("radeonsi/gfx11: register changes")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20728>
(cherry picked from commit f73cdda983)
2023-01-26 15:40:35 +00:00
Emma Anholt
8d8987577d zink: Re-emit the SpvBuiltInSampleMask access chain each load.
Otherwise, the access chain you emitted last time may not dominate the
current use.

Fixes the following validation failure in
dEQP-GLES31.functional.shaders.sample_variables.sample_mask_in.bits_unique_per_sample.multisample_texture_2:

  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv(ERROR / SPEC):
  msgNum: 7060244 - Validation Error: [
  UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
  0x55cf3cea2c60, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
  SPIR-V module not valid: ID '67[%67]' defined in block '23[%23]' does
  not dominate its use in block '31[%31]'

Fixes: 8899f6a198 ("zink: fix gl_SampleMaskIn spirv generation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit 4286633eec)
2023-01-26 15:40:35 +00:00
Emma Anholt
135425a3ae zink: Fix up mismatches of memory model vs addressing model.
MemoryModelVulkan was left out for CSes using it.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit 1e4deb3b89)
2023-01-26 15:40:35 +00:00
Emma Anholt
617fdb8818 zink: Fix validation failure for maxLod < minLod.
GL lets you set a silly state, so do something plausible instead of
undefined.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit adf81044d4)
2023-01-26 15:40:35 +00:00
Emma Anholt
4671e270df zink: Add missing Flat decorations on some inputs.
Fixes validation failures:

Test case 'dEQP-GLES31.functional.android_extension_pack.shaders.es32.extension_directive.oes_sample_variables'..
MESA: error: Validation Error: [
UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle =
0x563a1838b790, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 |
SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment
OpEntryPoint operand 31 with Input interfaces with integer or float type
must have a Flat decoration for Entry Point id 4.
%gl_SampleId = OpVariable %_ptr_Input_uint Input

Test case 'KHR-GL46.shader_ballot_tests.ShaderBallotAvailability'..
MESA: error: Validation Error: [ UNASSIGNED-CoreValidation-Shader-InconsistentSpirv ] Object 0: handle = 0x5558e12f17e0, type = VK_OBJECT_TYPE_DEVICE; | MessageID = 0x6bbb14 | SPIR-V module not valid: [VUID-StandaloneSpirv-Flat-04744] Fragment OpEntryPoint operand 28 with Input interfaces with integer or float type must have a Flat decoration for Entry Point id 4.
  %gl_SubgroupLocalInvocationId = OpVariable %_ptr_Input_uint Input

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20756>
(cherry picked from commit 2a33d509ca)
2023-01-26 15:40:35 +00:00
Marcin Ślusarz
e79f4e0b12 intel/compiler/mesh: handle const data in task & mesh programs
Started showing up when nir_opt_large_constants call was moved in 88756cee8d.
Fixes dEQP-VK.mesh_shader.ext.smoke.monolithic.fullscreen_gradient*

Suggested-by: Kenneth Graunke <kenneth@whitecape.org>
Fixes: 88756cee8d ("intel/compiler: Run nir_opt_large_constants before scalarizing consts")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20876>
(cherry picked from commit 536a2acfc2)
2023-01-26 15:40:34 +00:00
Lionel Landwerlin
1c243f4f8b intel/fs: avoid cmod optimization on instruction with different write_mask
I've been running into failures with tests like :

dEQP-VK.robustness.robustness2.bind.notemplate.rgba32i.unroll.nonvolatile.uniform_buffer_dynamic.no_fmt_qual.len_4.samples_1.1d.frag

With the load_global_const_block_intel NIR intrinsic, you can load a
vec8/vec16 with a predicate. The predicate is correctly uniformized to
feed into the SEND instruction's flag register.

The problem is that a series of optimization first remove the
find_live_channel and then changes the broadcast into a simple MOV
instruction, on the assumption that the first channel is always active
if there is not control flow. This is correct.

But after that the cmod optimzation will remove this instruction :

   mov.nz.f0.0(16) null:D, vgrf16+0.0<0>:D NoMask

because it seems to be equivalent to :

   cmp.g.f0.0(16) vgrf16:D, vgrf12:D, 63d

In this case vgrf16 is the predicate to the load block SEND
instruction. Since the execution mask is different between both, some
of the channels of the SEND instruction end up not being loaded or
loaded with the wrong predication and we end up with incorrect UBO
data.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20852>
(cherry picked from commit a50d2fdb46)
2023-01-26 15:40:34 +00:00
Mike Blumenkrantz
4502264786 zink: use actual swapchain object for surface comparison
the outer swapchain object is persistent, which means checking it
will never yield an update after the first check

fixes #8122

Fixes: b2739c9f00 ("zink: set surface->dt when updating swapchain"
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20814>
(cherry picked from commit 474ed4b877)
2023-01-26 15:40:34 +00:00
Erik Faye-Lund
d240b30e35 radeonsi: respect smoothing_enabled
When this was last changed, the smoothing_enabled flag seems to have
been forgotten about, breaking line-smoothing (and probably also polygon
smoothing).

Fixes: 4147add280 ("radeonsi: update db_eqaa even if msaa is disabled")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20810>
(cherry picked from commit 9f4f131f2e)
2023-01-26 15:40:34 +00:00
Jonathan Gray
8e2e275985 egl/dri2: avoid undefined unlocks
unlocks were incorrectly added to paths using dri2_egl_display() as
well as those using dri2_egl_display_lock()

pthread_mutex_unlock() when unlocked is documented by posix as
being undefined behaviour.  On OpenBSD pthread_mutex_unlock() will call
abort(3) if this happens.

Fixes: f1efe037df ("egl/dri2: Add display lock")
Reviewed-by: Rob Clark <robclark@freedesktop.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20712>
(cherry picked from commit 0594b3c143)
2023-01-26 15:40:34 +00:00
Marek Olšák
16fc1641cc glthread: handle GL_*_ARRAY in glEnable/Disable
Surprisingly, the GL compatibility profile allows these in both
glEnableClientState and glEnable.

Fixes: 0b1dd18591 - glthread: track which vertex array attribs are enabled

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
(cherry picked from commit 777166cc66)
2023-01-26 15:40:34 +00:00
Marek Olšák
75a63104b0 mesa: allow GL_UNSIGNED_INT64_ARB as vertex format for ARB_bindless_texture
This wasn't implemented, but the spec requires it.

Fixes: 1fe7b1f972 - mesa: implement ARB_bindless_texture

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
(cherry picked from commit 721526227c)
2023-01-26 15:40:34 +00:00
Marek Olšák
01185dcd60 util: fix util_is_vbo_upload_ratio_too_large
It was wrong. For example, if the draw vertex count was 10 and the upload
vertex count was 150, u_vbuf wouldn't unroll the draw and would instead
memcpy 150 vertices. This fixes that case.

Fixes: 068a3bf0d7 - util: move and adjust the vertex upload heuristic equation from u_vbuf

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20824>
(cherry picked from commit 4f6e785876)
2023-01-26 15:40:34 +00:00
Marek Olšák
6c869d993a glthread: fix an upload buffer leak
Fixes: befbd54864 - glthread: don't use atomics for refcounting to decrease overhead on AMD Zen

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20804>
(cherry picked from commit 4d4995b32b)
2023-01-26 15:40:34 +00:00
Mike Blumenkrantz
7b38217922 zink: don't use ds3 blend states without color attachments
this is illegal and causes validation errors

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
(cherry picked from commit 5d44318566)
2023-01-26 15:40:34 +00:00
Mike Blumenkrantz
95961596d4 zink: delete need_blend_constants
this is an artifact of very old code before the dynamic state was set
for all graphics pipelines

now the checks only cause blend constants to not be updated, which triggers
bugs and validation failures

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20799>
(cherry picked from commit b4d18f2ad1)
2023-01-26 15:40:33 +00:00
Rose Hudson
3b5dfeda81 radeonsi: report 0 block size for Polaris HEVC encoding
makes encoded videos resemble the input again :)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7992
Fixes: c4482a3c1a ("radeonsi/vcn: enable multi-slice encoding")
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20714>
(cherry picked from commit e8a60633da)
2023-01-26 15:40:33 +00:00
Tapani Pälli
cedf4e4d46 iris: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7892
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
(cherry picked from commit 247c06d419)
2023-01-26 15:40:33 +00:00
Tapani Pälli
74d02d26df hasvk: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer format.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
(cherry picked from commit 58dd9d5134)
2023-01-26 15:40:33 +00:00
Tapani Pälli
5d473b4282 anv: add restrictions for 3DSTATE_RASTER::AntiAliasingEnable
Field must be disabled if any render targets have integer
format, additionally for Gfx12+ field must be disabled when
num multisamples > 1 or forced multisample count > 1.

Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20671>
(cherry picked from commit 9b37ef40f8)
2023-01-26 15:40:33 +00:00
Danylo Piliaiev
5d747f334c tu/kgsl: do not use kgsl_command_object::offset
offset field in kgsl_command_object is NOT used by KGSL, so
we should offset directly to iova.

Fixes weird hangs on KGSL. E.g. fixes the hang in:
 dEQP-VK.memory.pipeline_barrier.transfer_dst_storage_texel_buffer.1024

cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20795>
(cherry picked from commit 926f626b95)
2023-01-26 15:40:33 +00:00
Mike Blumenkrantz
da1ac780bf zink: preserve present resources during async presentation
ensure that these have a lifetime great enough to be presented

fixes #7781

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20793>
(cherry picked from commit 020db79340)
2023-01-26 15:40:33 +00:00
Julia Tatz
8d955313dc zink: correct sparse bo mem_type_idx placement
VK_MEMORY_PROPERTY_DEVICE_LOCAL_BIT = 0x01 has been incidently the
correct memory type index, but isn't guaranteed to be, which is why it
hasn't caused issues yet

Fixes: f9515d93 ("zink: allocate/place memory using memoryTypeIndex directly")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
(cherry picked from commit c71287e70c)
2023-01-26 15:40:33 +00:00
Julia Tatz
87146b2158 zink: trival renames heap_idx -> memoryTypeIndex
Trival renames to correctly identify vulkan memory type indices aren't
the same as zink heaps

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
(cherry picked from commit e20e8f2243)
2023-01-26 15:40:33 +00:00
Julia Tatz
2ff2ffff18 zink: zink_heap isn't 1-to-1 with memoryTypeIndex
Clarify the relationship between zink heaps and vulkan memory type
indices, and resolve the issues from mixing the two up.

Closes: #7588, #7813
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20264>
(cherry picked from commit f6d3a5755f)
2023-01-26 15:40:33 +00:00
Mike Blumenkrantz
9fa0dd2f65 zink: handle modifier nplanes queries correctly for planar formats
this just returns the number of planes in the base format as a default, which
matches the behavior of other drivers

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
(cherry picked from commit 6ff334e54a)
2023-01-26 15:40:32 +00:00
Mike Blumenkrantz
9f0fd0562f zink: store drm format as internal_format for imported resources
internal_format is the "real" format of a resource, and the "real" format
of imported resources is the external-facing format, not the pipe format

this ensures the correct format is available for internal ops, such as nplanes queries

Fixes: 2e2775c11b ("zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20753>
(cherry picked from commit 072e29a22e)
2023-01-26 15:40:32 +00:00
Samuel Pitoiset
a6292889be radv: fix creating BC image views when the base layer is > 0
When the base array layer of the image view is > 0, addrlib computes
the offset (in HwlComputeSubResourceOffsetForSwizzlePattern) which is
then added to the base VA in RADV. But if the driver doesn't reset
the base array layer, the hw will compute incorrect addressing
(ie. base array will be added twice). This also matches AMDVLK.

This fixes a VM fault followed by a GPU hang on RDNA2 when trying
to join a multiplayer game with medium settings in Halo Infinite.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
(cherry picked from commit 8d191b2cfb)
2023-01-26 15:40:32 +00:00
Samuel Pitoiset
af03528185 radv: fix buffer to image copies with BC views on the graphics queue
The color surface descriptor needs to be adjusted, otherwise addressing
is wrong.

Fixes tests performed on the graphics queue from
dEQP-VK.api.copy_and_blit.*.image_to_buffer.2d_images.mip_copies_*.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7900
Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
(cherry picked from commit 18aaa373b7)
2023-01-26 15:40:32 +00:00
Samuel Pitoiset
2414591e5c radv: fix setting MAX_MIP for BC views
MAX_MIP should always be the number of levels minus one from the hw
perspective.

This doesn't fix anything known.

Fixes: 98ba1e0d81 ("radv: Fix mipmap views on GFX10+")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20761>
(cherry picked from commit aff5fe3f94)
2023-01-26 15:40:32 +00:00
Pierre-Eric Pelloux-Prayer
c70ffcc8e3 glthread: fix glArrayElement handling
This must be marshalled synchronously or the attrib pointers' content
might change by the time we use them.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8068
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
(cherry picked from commit ddc721e15c)
2023-01-26 15:40:32 +00:00
Pierre-Eric Pelloux-Prayer
bc487cecdc vbo: lower VBO_SAVE_BUFFER_SIZE to avoid large VRAM usage
The ideal case for performance is to have a single buffer for
all display list. The caveat is that large buffers are less
likely to be freed because they're refcounted: it only takes
1 user (diplay list) to keep it in VRAM.

This lowers VRAM usage when replaying the trace attached
of the trace attached to !6140 from 5.5 GB to about 1.8 GB.

Viewperf snx performance isn't affected.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6140
Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
(cherry picked from commit 0f5c8c3dc3)
2023-01-26 15:40:32 +00:00
Pierre-Eric Pelloux-Prayer
474f6f60c0 vbo: remove bogus assert
grow_vertex_storage may call wrap_filled_vertex, which will
trigger the assert incorrectly because the new size will be
smaller than 'new_size' but it's correct because
'vertex_store->used' has been reset to 0.

Fixes: a08baaff97 ("vbo/dlist: fix indentation in vbo_save_api.c")
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20748>
(cherry picked from commit 491f6b138e)
2023-01-26 15:40:32 +00:00
Lionel Landwerlin
90e1c36baa nir/lower_io: fix bounds checking for 64bit_bounded_global
If the offset is negative like it's the case in

dEQP-VK.robustness.robustness2.bind.notemplate.r32i.unroll.volatile.storage_buffer_dynamic.readwrite.no_fmt_qual.len_256.samples_1.1d.comp

we end up passing the bounds checking condition because it's using
signed integers.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Suggested-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Cc: mesa-stable
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Reviewed-by: Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20762>
(cherry picked from commit ff34e96701)
2023-01-26 15:40:32 +00:00
Kenneth Graunke
89e679803b intel/compiler: Drop redundant 32-bit expansion for shared float atomics
We already expanded data to 32-bit a few lines earlier, so this is just
redundantly doing it a second time.

Fixes: 43169dbbe5 ("intel/compiler: Support 16 bit float ops")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Rohan Garg <rohan.garg@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20604>
(cherry picked from commit f7b29d7924)
2023-01-26 15:40:32 +00:00
Francisco Jerez
7fe1d202d5 intel/fs/gfx12: Ensure that prior reads have executed before barrier with acquire semantics.
This avoids a violation of the Vulkan memory model that was leading to
intermittent failures of at least 8k test-cases of the Vulkan CTS
(within the group dEQP-VK.memory_model.*) on TGL and DG2 platforms.
In theory the issue may be reproducible on earlier platforms like IVB
and ICL, but the SYNC.ALLWR instruction is not available on those
platforms so a different (likely costlier) fix will be needed.

The issue occurs within the sequence we emit for a NIR memory barrier
with acquire semantics requiring the synchronization of multiple
caches, e.g. in pseudocode for a barrier involving the TGM and UGM
caches on DG2:

 x <- load.ugm // Atomic read sequenced-before the barrier
 y <- fence.ugm
 z <- fence.tgm
 wait(y, z)
 w <- load.tgm // Read sequenced-after the barrier

In the example we must provide the guarantee that the memory load for
x is completed before the one for w, however this ordering can be
reversed with the intervention of a concurrent thread, since the UGM
fence will block on the prior UGM load and potentially take a long
time, while the TGM fence may complete and invalidate the TGM cache
immediately, so a concurrent thread could pollute the TGM cache with
stale contents for the w location *before* the UGM load has completed,
leading to an inversion of the expected memory ordering.

v2: Apply the workaround regardless of whether the NIR barrier
    intrinsic specifies multiple storage classes or a single one,
    since an acquire barrier is required to order subsequent requests
    relative to previous atomic requests of unknown storage class not
    necessarily specified by the memory scope information of the
    intrinsic.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20690>
(cherry picked from commit 4a2e7306dd)
2023-01-26 15:40:31 +00:00
Paulo Zanoni
9098d83fb3 anv: check the return value of anv_execbuf_add_bo_bitset()
Because anv_execbuf_add_bo_bitset() calls anv_execbuf_add_bo(), which
can fail if its memory allocations fail.

I have seen dEQP tests exercising memory allocation failures during
anv_execbuf_add_bo(), but I don't think the path coming from
add_bo_biset() was specifically exercised. Anyway, add the error check
just in case.

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
(cherry picked from commit 3d37950fd9)
2023-01-26 15:40:31 +00:00
Paulo Zanoni
f2aaa18997 anv: don't leave undefined values in exec->syncobj_values
In anv_execbuf_add_syncobj(), we try to not create or use
exec->syncobj_values if we don't need to. But when we figure we're
going to need it (i.e., when timeline_value is not zero), then we
create exec->syncobj_values with vk_zalloc, which means every previous
value is set to zero, as it should be. This is all correct.

The problem starts when we add a 16th element. In this case we double
exec->syncobj_array_length and realloc the buffer by using vk_alloc
and copying the old array to the new one. After that, we write the
timeline_value to the array only if it's not zero, and that's the
problem: since we just used vkalloc and memcpy, we don't have any
guarantees that the new array will be zero after the 16th element, and
if timeline_value is zero we write nothing to that position.

Once we start using exec->syncobj_values we have to commit to using
it, so the "if (timeline_value)" check near the end of the function
has to be changed to "if (exec->syncobj_values)", so we actually set
elements after the 16th to zero when they need to be zero.  Another
approach to fix this would be to memset the new elements once we
double syncobj_array_length.

In practice, I couldn't find any application or deqp test that used
more than 3 elements in exec->syncobj_array_length, and we need more
than 16 elements in order to be able to reproduce the bug, so I'm not
aware of any real-world bug that goes away with this patch. This issue
was found while reading code.

If we craft a little Vulkan program that submits a ton of timeline and
binary semaphores on vkQueueSubmit, then waits for them, we get the
following error without this patch:

MESA: error: ../../src/intel/vulkan/anv_batch_chain.c:1910: execbuf2 failed: Invalid argument (VK_ERROR_DEVICE_LOST)

v2: Rebase.

Cc: mesa-stable
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Signed-off-by: Paulo Zanoni <paulo.r.zanoni@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20703>
(cherry picked from commit ad6a036a68)
2023-01-26 15:40:31 +00:00
Maíra Canal
3f75b640be v3dv: remove unused clamp_to_transparent_black_border property
Commit e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
removes the only code that handled the clamp_to_transparent_black_border
variable. Therefore, the variable can be deleted, as it is not currently
being used.

Fixes: e07c5467 ("v3dv/format: use XYZ1 swizzle for three-component formats")
Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20746>
(cherry picked from commit 86c9bdcd9a)
2023-01-26 15:40:31 +00:00
Lionel Landwerlin
04bc00cf2c nir/divergence: add missing RT intrinsinc handling
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20763>
(cherry picked from commit b82d9b1a3d)
2023-01-26 15:40:31 +00:00
Alyssa Rosenzweig
9f4d8d7595 mesa: Set info.separate_shader for ARB programs
ARB programs are logically separate, and Mesa will happily mix and match them.
We need to alert backends of this fact, by setting nir->info.separate_shader.
Otherwise, backends may link shaders invalidly.

Fixes fp-abs-01 on Bifrost. (We don't use separate_shader for anything on
Valhall, so the issue doesn't appear there.)

Compare 151aa19c21 ("ttn: Set nir->info.separate_shader"), which fixed a
similar issue with TGSI.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20688>
(cherry picked from commit 7e68cf91d7)
2023-01-26 15:40:31 +00:00
Gert Wollny
e020f913bb virgl: drop the separable flag for cases that can't be handled
The host can't assign more than 32 locations explicitly, and we
exhaust this already when we handle patches and generics. So
drop the separable flag in cases when we have other IO that
uses generated names that will have to be matched by name.

v2: skip tests for VS input and FS outputs

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20738>
(cherry picked from commit 8084b412ca)
2023-01-26 15:40:31 +00:00
Erik Faye-Lund
56be7ba217 zink: fix depth-clip disable cap
We use EXT_depth_clip_enable for this, not EXT_depth_clip_control, which
is what depth_clip_control_missing is a proxy for.

Fixes: 721f33cd0f ("zink: fix return for PIPE_CAP_DEPTH_CLIP_DISABLE")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20740>
(cherry picked from commit c12fed1804)
2023-01-26 15:40:31 +00:00
Jason Ekstrand
8da3b21d07 gallium,util: Pull u_indices and u_primconvert back into gallium
This was moved in !13741 but doing so created a link-time dependency
between util and gallium which causes problems for Vulkan drivers.
Meanwhile, having mesa/main depend on gallium is fine now that we don't
have any classic drivers.  It's a bit circular but should be harmless.

Fixes: 97ba2f2fd4 ("move util/indices to core util")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8098
Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20734>
(cherry picked from commit d292cb82b8)
2023-01-26 15:40:31 +00:00
Rob Clark
c465184d26 freedreno: Fix tracking of enabled SSBOs
Clearing all of the modified bits an relying on OR'ing the needed bits
back in the loop below doesn't quite work out, Because of early continue
if the SSBO has not changed.

Fixes: 0ed053f03d ("freedreno: simplify fd_set_shader_buffers(..)")
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20575>
(cherry picked from commit e41d19a711)
2023-01-26 15:40:31 +00:00
Gert Wollny
a31d28210e r600/sfn: Fix readport check
We have to take multi-slot instructions into account, and we don't fail
when there are still possible bank swizzle values to be checked.

For clarity also rename the bank swizzle iterator iterator.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20739>
(cherry picked from commit ca5bbff558)
2023-01-26 15:40:31 +00:00
Alyssa Rosenzweig
ff6a911fd4 panfrost: Fix clears with conditional rendering
batch can be invalidated by the render condition check.

Fixes nv_conditional_render-clear.

Fixes: 638b22354e ("panfrost: Clear with a quad to avoid flushing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20689>
(cherry picked from commit 02f9cddb61)
2023-01-26 15:40:30 +00:00
Alyssa Rosenzweig
bc198e8005 panfrost: Fix logic ops on Bifrost
opaque should not be set when logicops are enabled, that needs blending
even on Bifrost. Fixes is for when I believe the bug became possible to hit.
The logical error is older.

Fixes Piglit logicop tests again.

Fixes: d849d9779a ("panfrost: Avoid blend shader when not blending")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20685>
(cherry picked from commit 41d99c10d1)
2023-01-26 15:40:30 +00:00
Alyssa Rosenzweig
d8db0ee96d panfrost: Enable NV_primitive_restart on Valhall
Unlike literally every other mesa/st emulation, for some inexplicable reason we
need to pretend to support the CAP and then set a different EMULATE cap instead
of the emulation keying off the lack of support for the CAP. Set the CAPs
accordingly so we get NV_primitive_restart (with emulation of non-fixed
indices).

This gets Mesa to advertise GL 3.1 on Mali-G57 as intended.

Fixes: 30c14f54cf ("panfrost: Disable PIPE_CAP_PRIMITIVE_RESTART on v9")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20702>
(cherry picked from commit fe4dc59e99)
2023-01-26 15:40:30 +00:00
Alyssa Rosenzweig
aec46cecfa pan/bi: Fix incorrect compilation of fsat(reg.yx)
Future changes to nir_lower_blend cause fsat(reg.yx) instructions to be
generated, which correspond to "FCLAMP.v2f16 x.h10" pseudoinstructions. These
get their swizzles lowered, but we forgot to clear the swizzle out, so we end up
with extra swap (cancelling out the intended swizzle).

Fix the lowering logic.

Fixes: ac636f5adb ("pan/bi: Use FCLAMP pseudo op for clamp prop")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20683>
(cherry picked from commit ed46c617b0)
2023-01-26 15:40:30 +00:00
Alejandro Piñeiro
116b1de2aa vulkan/wsi: check if image info was already freed
We set the different data being freed to NULL after freeing it, and
checks for NULL before freeing it.

This fixes several double free crash with v3dv, when running OOM wsi
tests, like for example:
dEQP-VK.wsi.xlib.swapchain.simulate_oom.composite_alpha

Although note that only one person got those on a new fresh install of
the Raspbian OS, so this problem was rare.

Fixes: 5b13d74583 ("vulkan/wsi/drm: Break create_native_image in pieces")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20695>
(cherry picked from commit b27e42dcb5)
2023-01-26 15:40:30 +00:00
Friedrich Vock
893910b353 radv/rt: Divide by the correct workgroup size
Improves build performance by around 25%.

Fixes: 9369b407 ("radv: Use PLOC for BVH building")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20717>
(cherry picked from commit eab2c39951)
2023-01-26 15:40:30 +00:00
Bas Nieuwenhuizen
c1a38fed99 aco: Pass correct number of coords to Vega 1D LOD instruction.
If we pass a physical 2D texture descriptor we should also pass 2
coords. Otherwise it just uses the random content in the second
register which ends up funny sometimes.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20696>
(cherry picked from commit edca10e9c9)
2023-01-26 15:40:30 +00:00
t0b3
a141c82d01 nir/nir_opt_move: fix ALWAYS_INLINE compiler error
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Closes: #6825
Fixes: f1d20ec6 ("nir/nir_opt_move: handle non-SSA defs ")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17439>
(cherry picked from commit 267dd1f4d5)
2023-01-26 15:40:30 +00:00
Samuel Pitoiset
629630b3de radv: fix missing implementation of creating images from swapchains
These pNext structs are part of VK_KHR_swapchain which is core Vulkan
1.1 but they were missing. Loosely based on ANV.

Passed WSI CTS.

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7797
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20641>
(cherry picked from commit 2a5d7f4926)
2023-01-26 15:40:30 +00:00
Emma Anholt
17e4b46819 docs/perfetto: Fix the name of the i915 render stages data sources.
Fixes: ef27399bca ("docs: update perfetto with the latest status")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20658>
(cherry picked from commit dbd6031c06)
2023-01-26 15:40:30 +00:00
Simon Ser
8ee572daf8 zink: fix PIPE_RESOURCE_PARAM_NPLANES with format modifier
Some format modifiers change the number of planes used by an image.
For instance AMD DCC modifiers uses 2 or 3 planes. However the
format modifier was ignored in the PIPE_RESOURCE_PARAM_NPLANES
get_param hook.

Fix this by using get_dmabuf_modifier_planes() instead of
util_format_get_num_planes().

This fixes wlroots-based compositors under zink.

Signed-off-by: Simon Ser <contact@emersion.fr>
Fixes: c025cb9ee9 ("zink: fix dmabuf plane returns")
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20395>
(cherry picked from commit 2e2775c11b)
2023-01-26 15:40:29 +00:00
Eric Engestrom
8126a053b9 gen_release_notes: include links in relnotes.rst when generating the new release note
This is required to allow the docs to build, which in turn is required
if we want to allow merge requests against release (staging) branches.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20460>
(cherry picked from commit b3f517b988)
2023-01-26 15:40:29 +00:00
Rhys Perry
16c5e743c6 radv/gfx11: increase radeon_check_space for occlusion query begin
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20652>
(cherry picked from commit 9112fe3c76)
2023-01-26 15:40:29 +00:00
Dave Airlie
eaa4e81ea2 lavapipe: fix one more descriptor set reference issue
I thought I'd fixed this already, must have gotten lost in a rebase.

fixes
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.bind_null_descriptor_set.1010

Fixes: 20902d1ed6 ("lavapipe: fix descriptor set layout reference counting in layout merge")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20662>
(cherry picked from commit 417c51a511)
2023-01-26 15:40:29 +00:00
Dave Airlie
8bad85053b vk_cmd_queue: add a callback to free push descriptors set khr
This should clean this up properly.

Fixes: eb7eccc76f ("lavapipe: Use generated command queue code")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
(cherry picked from commit 3ec428bb32)
2023-01-26 15:40:29 +00:00
Dave Airlie
4f55991938 llvmpipe: unref images correctly in the fragment shader path
fixes a memory leak seen in lavapipe asan tests
dEQP-VK.robustness.robustness2.bind.template.rg32f.unroll.nonvolatile.storage_buffer.readwrite.no_fmt_qual.null_descriptor.samples_1.1d.frag

Fixes: 2909c654b0 ("llvmpipe: add fragment shader image support")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
(cherry picked from commit ff0433b8cb)
2023-01-26 15:40:29 +00:00
Dave Airlie
92657fa42d lavapipe: fix merged layout ref counting
When creating a merged layout, don't use ralloc, just use the
correct reference counting, also only reference a layout if the
pipeline uses it.

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
(cherry picked from commit 474965adb3)
2023-01-26 15:40:29 +00:00
Dave Airlie
ddff1bce46 lavapipe: fix descriptor set layout reference counting in layout merge
When taking the descriptor set layouts from the pipeline layout, make
sure to take references

Fixes: d4d5a7abba ("lavapipe: implement EXT_graphics_pipeline_library")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20630>
(cherry picked from commit 20902d1ed6)
2023-01-26 15:40:29 +00:00
Eric Engestrom
1bcf94ac87 .pick_status.json: Mark e527f686ca as denominated 2023-01-26 15:40:29 +00:00
Eric Engestrom
7ab0764349 .pick_status.json: Update to 9f51340b99 2023-01-26 15:40:24 +00:00
Eric Engestrom
163489ab93 docs/relnotes: add sha256sum for 22.3.3 2023-01-11 18:08:36 +00:00
Eric Engestrom
08341a7b16 VERSION: bump for 22.3.3 2023-01-11 17:46:41 +00:00
Eric Engestrom
56c1c20161 docs: add release notes for 22.3.3 2023-01-11 17:45:05 +00:00
Iago Toral Quiroga
4c8bca5afb v3dv: fix alpha-to-one for single sample setup
In Vulkan this is expected to work with single sample scenarios too.

Fixes new test in CTS main:
dEQP-VK.pipeline.monolithic.multisample.alpha_to_one.samples_1

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20634>
(cherry picked from commit 09782e5e6d)
2023-01-11 17:44:23 +00:00
Mike Blumenkrantz
5b0971c64d zink: set surface->dt when updating swapchain
this otherwise re-creates swapchain surfaces on every frame and has
a significant perf hit for no reason

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20613>
(cherry picked from commit b2739c9f00)
2023-01-11 17:44:23 +00:00
Pierre-Eric Pelloux-Prayer
936c86f52a mesa: add missing count_scale attributes
The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

for both functions.

Cc: mesa-stable
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
(cherry picked from commit 1ab80eb061)
2023-01-11 17:44:23 +00:00
Pierre-Eric Pelloux-Prayer
05125049cb mesa: add missing count_scale attribute
The EXT_gpu_program_parameters spec says:

   <params> points to an array of 4*<count> values

Fixes: a4e935f2d7 ("mesa: add EXT_dsa + EXT_gpu_program_parameters functions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7943
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8025
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20603>
(cherry picked from commit 37dcd18331)
2023-01-11 17:44:23 +00:00
Marek Olšák
cdac733874 radeonsi: rewrite si_update_ps_colorbuf0_slot to fix crashes and recursions
I'm convinced that u_blitter interactions with fbfetch can't be handled
in si_update_ps_colorbuf0_slot alone, so it has to be force-disabled
by si_blitter_begin. Another reason why it has to be disabled for u_blitter
and not ignored is because FBFETCH with MSAA enables sample shading
regardless of context states, and we don't want that for u_blitter.

Also, si_update_ps_colorbuf0_slot now disables FBFETCH explicitly before
its own DCC and CMASK decompression because even though u_blitter can't do
anything (due to blitter_running), si_blitter_end calls it too.

The result is that no recursion can occur thanks to the blitter_running
and suppress_update_ps_colorbuf0_slot flags, and FBFETCH is always
force-disabled before those flags are set, which is the state we want
to be in.

Fixes: bc6d22b920 ("radeonsi: fix ps_uses_fbfetch value")

Acked-by: Yogesh Mohan Marimuthu <yogesh.mohanmarimuthu@amd.com>
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20318>
(cherry picked from commit 3632d39835)
2023-01-11 17:44:23 +00:00
Lucas Stach
ac676fee53 etnaviv: blt: properly use upper half of clear value
Instead of replicating the lower half of the clear value, properly
use the upper half to program the second clear value BLT state.

CC: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20586>
(cherry picked from commit 03fdcbba19)
2023-01-11 17:44:22 +00:00
Danylo Piliaiev
958ab782e7 tu: Fix varyings interpolation reading stale values
tu6_vpc_varying_mode returned how many bits are consumed IF they are
non-zero, for SMOOTH mode nothing is written and it was treated like
no bits were consumed.

When input with smooth interpolation was the last one and straddled
the VPC_VARYING_INTERP_MODE regs, the last interp mode were not written.

Fixes misrendering in "Psychonauts 2".

Cc: mesa-stable

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20533>
(cherry picked from commit a45d32b10b)
2023-01-11 17:44:22 +00:00
Mike Blumenkrantz
b469182963 zink: stop using VK_PIPELINE_CACHE_CREATE_EXTERNALLY_SYNCHRONIZED_BIT
this used to be fine back when there was only one thread doing cache management,
but now the cache is used by precompile threads too, so let the driver do sync

fixes #7660

Fixes: 41ffb15de5 ("zink: implement async gfx precompile")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20519>
(cherry picked from commit f18827e015)
2023-01-11 17:44:22 +00:00
Timothy Arceri
ac128236d2 util/driconf: add Dune: Spice Wars workaround
As per the bug report the game does not correctly handle a uniform
index of -1 being returned for the unused array element, which
results in rendering issues. So here we skip the uniform array
resizing optimisation.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6397
Cc: mesa-stable

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20579>
(cherry picked from commit ac5af6c06d)
2023-01-11 17:44:22 +00:00
Mike Blumenkrantz
453cb59d03 lavapipe: add some safety asserts when beginning rendering
if the render area exceeds the attachment size, this is not only illegal,
it will crash later

cc: mesa-stable

Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20583>
(cherry picked from commit 847d198c1f)
2023-01-11 17:44:22 +00:00
Lionel Landwerlin
d8cf98bcb8 anv: use the null surface with unused push descriptor binding table entries
Some binding table entries have been identify as unused in the shaders
by the push constant analysis pass. We can just put the null entry in
there.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0b7 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
(cherry picked from commit 2d627f28c8)
2023-01-11 17:44:22 +00:00
Lionel Landwerlin
7d2915088d anv: return properly typed value for no ubo promoted
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
(cherry picked from commit bbfca4eb92)
2023-01-11 17:44:22 +00:00
Lionel Landwerlin
b95e5a8cc2 anv: check that push range actually match binding considered
We can't just check the load_ubo range is contained in the push entry,
we also need to check that the push entry set/binding matches the
load_ubo set/binding.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
(cherry picked from commit e2b0086b78)
2023-01-11 17:44:22 +00:00
Lionel Landwerlin
605feb0281 anv: don't nullify entries
We'll use those to fill the push constant addresses, so we can't have
them turned to null.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: ff91c5ca42 ("anv: add analysis for push descriptor uses and store it in shader cache")
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20555>
(cherry picked from commit 48bb3df951)
2023-01-11 17:44:22 +00:00
Tapani Pälli
859e2de1f3 iris: let isl set tiling mode for external resources
Patch sets memory object external format (which is otherwise
PIPE_FORMAT_NONE for memory objects) before main surface gets
configured. With this we can add a check that when dealing
with external resource that has no modifier set, we let isl
figure out the tiling mode.

Fixes memobj tests on DG2:
   piglit.spec.ext_external_objects.vk-image-display-muliple-textures
   piglit.spec.ext_external_objects.vk-image-display-overwrite
   piglit.spec.ext_external_objects.vk-depth-display
   piglit.spec.ext_external_objects.vk-image-display
   piglit.spec.ext_external_objects.vk-stencil-display

v2: add assert and comment on tiling decision (Ken)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7684
Cc: mesa-stable
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Simon Zeni <simon@bl4ckb0ne.ca>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20473>
(cherry picked from commit 319d485679)
2023-01-11 17:44:22 +00:00
Qiu Wenbo
888bb9c380 vc4: Fix running process_mux_deps on irrelevant type of instructions
Only ALU and ALU Small Imm instructions have input mux.

Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20581>
(cherry picked from commit ee32f3873c)
2023-01-11 17:44:22 +00:00
Qiu Wenbo
09676cf5e8 vc4: Fix RADDR_A field extraction of branch instruction
Signed-off-by: Qiu Wenbo <qiuwenbo@kylinos.com.cn>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20581>
(cherry picked from commit 7489c29abe)
2023-01-11 17:44:22 +00:00
Mike Blumenkrantz
1249d31af2 zink: protect against invalid scissored renderpass clears
if the clear region is oob, this is illegal and may crash some drivers

fixes (lavapipe):
dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.buffer_age_clear_render
dEQP-EGL.functional.swap_buffers_with_damage.resize_before_swap.buffer_age_render_clear

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
(cherry picked from commit 6f02fe8842)
2023-01-11 17:44:22 +00:00
Mike Blumenkrantz
93f2eec67b zink: only update framebuffer object during swapchain update if framebuffer exists
otherwise this might be randomly creating an unused framebuffer for dynamic render

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20584>
(cherry picked from commit 79a4d22928)
2023-01-11 17:44:21 +00:00
Samuel Pitoiset
60474e53ea radv: fix re-emitting tessellation domain origin when it's dynamic
The winding order can be different between pipelines.

Fixes new dEQP-VK.pipeline.pipeline_library.dynamic_control_points.change_*_winding.

Fixes: f22290949d ("radv: add support for dynamic tessellation domain origin")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20486>
(cherry picked from commit f1b3e6aefd)
2023-01-11 17:44:21 +00:00
Pierre-Eric Pelloux-Prayer
6f1f06eacf util/00-mesa-defaults: add Limbo workaround
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7976
Cc: mesa-stable

Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Tested-by: Diego Viola <diego.viola@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20548>
(cherry picked from commit 6e24b76c10)
2023-01-11 17:44:21 +00:00
Xaver Hugl
c59b6e6c88 driconf: add a workaround for plasmashell freezing
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7624

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Tested-by: Dan Johansen <strit@manjaro.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20472>
(cherry picked from commit 41eb491fb6)
2023-01-11 17:44:21 +00:00
Gert Wollny
b979eadb9d virgl: Use virgl host side shader stage IDs when reading caps
The ordering of enum pipe_shader_type changed, but not all locations where
the host uses the original ordering were changed to translate to the new
ordering, namely reading the shader caps was not fixed up so do this now.

v2: - inline virgl_shader_stage_convert (Corentin)
    - encapuslate use of host shader stage when reading array elements
      of host caps

Fixes: a26543f636
   gallium: reorder the shader stage enum to match Mesa

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/8023

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20544>
(cherry picked from commit c91a78c03a)
2023-01-11 17:44:21 +00:00
Rhys Perry
b582b7f1b6 aco/gfx11: update s_code_end padding
Match ac_rtld_open().

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: 22.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20536>
(cherry picked from commit 9e55b3b790)
2023-01-11 17:44:21 +00:00
Eric Engestrom
32e567d411 meson: add missing dependency
Now that renderonly.h includes util/simple_mtx.h, which itself includes
valgrind.h, dep_valgrind is required by any module that includes
renderonly.h.

    In file included from ../src/gallium/auxiliary/renderonly/renderonly.h:33,
                     from ../src/gallium/winsys/kmsro/drm/kmsro_drm_winsys.c:39:
    ../src/util/simple_mtx.h:34:12: fatal error: valgrind.h: No such file or directory
       34 | #  include <valgrind.h>
          |            ^~~~~~~~~~~~
    compilation terminated.

dep_valgrind is part of idep_mesautil, which should be used instead of
copying the list of deps for each util header included (which would
have to be updated every time a util header changes its own includes),
so let's add idep_mesautil everywhere that includes renderonly.h.

Fixes: ad4d7ca833 ("kmsro: Fix renderonly_scanout BO aliasing")
Tested-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20530>
(cherry picked from commit aab4a260db)
2023-01-11 17:44:21 +00:00
Samuel Pitoiset
eab2bbe291 radv: fix returning VK_PIPELINE_COMPILE_REQUIRED from library
When VK_PIPELINE_CREATE_FAIL_ON_PIPELINE_COMPILE_REQUIRED is set by
the application, the driver should return VK_COMPILE_REQUIRED but this
was broken for GPL (it returned VK_SUCCESS instead). Also, objects
shouldn't be destroyed when creating the library failed because it's
already handled in radv_graphics_lib_pipeline_create().

Cc: 22.3 mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7512
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20532>
(cherry picked from commit 5757dbe1ee)
2023-01-11 17:44:21 +00:00
Asahi Lina
2adab724e5 kmsro: Fix renderonly_scanout BO aliasing
BOs can only have one handle. If renderonly_create_gpu_import_for_resource
ends up importing a BO that was already mapped for scanout, it will get
the same handle. This leaves us with two renderonly_scanout objects for
one handle, and the first one to be destroyed will free it.

Import the BO map tracking logic from asahi, to avoid aliasing
renderonly_scanout objects. Each actual BO now is only represented by a
single object instance, which is reference counted.

Fixes KWin full-screen PipeWire capture breaking scanout entirely.

Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Asahi Lina <lina@asahilina.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20397>
(cherry picked from commit ad4d7ca833)
2023-01-11 17:44:21 +00:00
Pierre-Eric Pelloux-Prayer
0291da280b egl: handle NULL loaderPrivate in dri_is_thread_safe
This can happen when a context is created from
loader_dri3_blit_context_get and glthread is enabled.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7949
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7960
Cc: mesa-stable

Acked-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20479>
(cherry picked from commit b111e8aa49)
2023-01-11 17:44:21 +00:00
Maíra Canal
722f6676c8 v3dv: initialize fd variable for proper error handling
Currently, process_singlesync_signals() checks if fd == -1 to handle
possible errors in the drmSyncobjExportSyncFile function. But, fd is not
initialized, which means that drmSyncobjExportSyncFile might fail and
the error will not be handled as fd might not be equal to -1.

Therefore, initialize the fd variable with value -1 to ensure proper
error handling.

cc: mesa-stable

Signed-off-by: Maíra Canal <mcanal@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20475>
(cherry picked from commit a2252adde8)
2023-01-11 17:44:21 +00:00
Emma Anholt
c591be200e zink: Only expose PIPE_CAP_SHADER_ATOMIC_INT64 if we can do shared and ssbos.
Fixes: 3ac0706aa8 ("zink: export PIPE_CAP_SHADER_ATOMIC_INT64")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20506>
(cherry picked from commit b8d9f860a0)
2023-01-11 17:44:21 +00:00
Emma Anholt
cb971d5e53 zink: Only expose PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD if we can actually add.
Drivers may expose the ext without the add capability, if they can
load/store/exchange.

Fixes: c32f046ab6 ("zink: export PIPE_CAP_IMAGE_ATOMIC_FLOAT_ADD")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20506>
(cherry picked from commit 426cb025e7)
2023-01-11 17:44:21 +00:00
Timothy Arceri
a5f33e0350 util/00-mesa-defaults: add Metal Slug XX workaround
The game uses texture2D() in glsl 4.40 shaders, but texture2D()
was moved to compat in 4.20.

Cc: mesa-stable

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20511>
(cherry picked from commit a4a1f95431)
2023-01-11 17:44:21 +00:00
Felix DeGrood
22f8331320 hasvk: Emit CS stall on INTEL_MEASURE timestamp
For INTEL_MEASURE, ensure all prior instructions completed before
timestamp taken. Continue to support no CS flush case for Perfetto.
CS stall was dropped from pipecontrol when adding u_trace support.

Fixes: cc5843a573 ("anv: implement u_trace support")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20502>
(cherry picked from commit c1c81137d9)
2023-01-11 17:44:20 +00:00
Felix DeGrood
6893f2b5b4 anv: Emit CS stall on INTEL_MEASURE timestamp
For INTEL_MEASURE, ensure all prior instructions completed before
timestamp taken. Continue to support no CS flush case for Perfetto.
CS stall was dropped from pipecontrol when adding u_trace support.

Fixes: cc5843a573 ("anv: implement u_trace support")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20502>
(cherry picked from commit 7f6beb8537)
2023-01-11 17:44:20 +00:00
Samuel Pitoiset
052a2a47b3 radv: fix multiple resolves in the same subpass
If there is multiple resolves, the driver shouldn't always select the
fragment path because it doesn't work for all images.

Fixes dEQP-VK.pipeline.monolithic.multisample.misc.*

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19986>
(cherry picked from commit 22543653d5)
2023-01-11 17:44:20 +00:00
Adam Stylinski
b46d3d7ebb nv30: Fix an offset for vbos being applied to a buffer twice
Similar to 1387d1d4, this offset was being applied twice (once in
translate_generic, and once when the buffer is mapped).

This fixes 7972, which was initially thought to be an endianness
specific issue.

CC: mesa-stable
Tested-by: Filip Gawin <filip@gawin.net>
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20468>
(cherry picked from commit 50972297f4)
2023-01-11 17:44:20 +00:00
Yiwei Zhang
96b85f1574 venus: properly ignore the sampler for immutable sampler
This was found while debugging venus-lavapipe ci failure. It's a real
bug though no tests have caught this yet, but fixing this would regress
venus-lavapipe non-templated push tests if without the dependent lvp
fix. The sampler in the descriptor write can be garbled if the binding
has immutable samplers.

cc: mesa-stable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Corentin Noël <corentin.noel@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20471>
(cherry picked from commit 33b778cc36)
2023-01-11 17:44:20 +00:00
Yiwei Zhang
685718bcbe lvp: properly ignore sampler write for immutable sampler
The issue is hidden due to a overly relaxed cts:
dEQP-VK.binding_model.shader_access.primary_cmd_buf.with_push*
that doesn't scrub the sampler from descriptor writes for immutable
samplers. The issue is exposed via venus-lavapipe ci because venus must
ignore the potentially garbled sampler. This change aligns the
VK_DESCRIPTOR_TYPE_SAMPLER path with the
VK_DESCRIPTOR_TYPE_COMBINED_IMAGE_SAMPLER path by removing a false check
against the provided sampler from push since the sampler can be null. An
alternative is to also check against !binding->immutable_samplers there.

Test: venus-lavapipe with venus push descriptor support

cc: mesa-stable

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20471>
(cherry picked from commit 9a104f6348)
2023-01-11 17:44:20 +00:00
Sil Vilerino
7b74a905e0 frontends/va: Update state var frame_num disregarding cap check
The frame_num variable must be updated for encode entrypoint disregarding
the outcome of the PIPE_VIDEO_CAP_REQUIRES_FLUSH_ON_END_FRAME cap check

fixes: 229c6f79a6 ("frontends/va: Implement vaSyncBuffer")

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20490>
(cherry picked from commit fb0038f489)
2023-01-11 17:44:20 +00:00
Samuel Pitoiset
ea1202f6b0 radv: fix missing initialization of radv_resolve_barrier::dst_stage_mask
Otherwise, this value is unitialized when read in
radv_ace_internal_barrier().

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7909
Fixes: 4c6f83006d ("radv: Synchronization for task shaders.")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20351>
(cherry picked from commit 050c39c92f)
2023-01-11 17:44:20 +00:00
Daniel Schürmann
fea1fc4b49 aco: fix reset_block_regs() in postRA-optimizer
Accidentally, we picked the index of the predecessors instead of the predecessors.

Totals from 8496 (6.30% of 134913) affected shaders: (GFX10.3)
CodeSize: 64070724 -> 64022516 (-0.08%); split: -0.08%, +0.00%
Instrs: 11932750 -> 11920698 (-0.10%); split: -0.10%, +0.00%
Latency: 144040266 -> 144017062 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 29327735 -> 29326421 (-0.00%); split: -0.00%, +0.00%

Fossil DB stats on Rembrandt (RDNA2):
Totals from 4488 (3.33% of 134906) affected shaders:
CodeSize: 42759736 -> 42735392 (-0.06%); split: -0.06%, +0.00%
Instrs: 7960522 -> 7954436 (-0.08%); split: -0.08%, +0.00%
Latency: 96192647 -> 96172571 (-0.02%); split: -0.02%, +0.00%
InvThroughput: 19313576 -> 19312575 (-0.01%); split: -0.01%, +0.00%

Fixes: 75967a4814 ('aco/optimizer_postRA: Speed up reset_block() with predecessors.')
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16161>
(cherry picked from commit 8f4eccb138)
2023-01-11 17:44:20 +00:00
Konstantin Kharlamov
44b4caaa4d bin/gen_release_notes.py: read Closes/Fixes tags case-insensitively
Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit 05ca7d114e)
2023-01-11 17:44:20 +00:00
Konstantin Kharlamov
31b0adc74a bin/gen_release_notes.py: parse "Fixes" tags as well as "Closes"
Some commits refer to bugs being fixed with "Fixes" tag. Example of one:

    e13d53e1fd 'Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"'

Parse this tag as well.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit e67578a264)
2023-01-11 17:44:20 +00:00
Konstantin Kharlamov
bbb7597cfe bin/gen_release_notes.py: don't fail if "Closes" refers to an MR
Sometimes a tag "Closes:" in a commit may refer to a merge request
instead of an issue. Examples of such commits:

    34319c7d84 "ci/freedreno: disable antichambers trace"
    998122d9c2 "mesa: fix GL_INVALID_OPERATION in glEGLImageTargetTexStorageEXT"

Avoid failing on these by explicitly checking that the URL refers to an
issue

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit 52cd87ea16)
2023-01-11 17:44:20 +00:00
Konstantin Kharlamov
199ccbc64f bin/gen_release_notes.py: do not fail on confidential features
A commit may refer to an issue marked as confidential. That will look
like a 404 page for outside users. One example of such commit is:

    369c12e5be "anv: clear descriptorsets if AllocateDescriptorSets fails"

Let's handle that case.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit 334123a908)
2023-01-11 17:44:20 +00:00
Konstantin Kharlamov
1e6aa5ebab bin/gen_release_notes.py: do not end "features" with "None"
Currently, the "New features" list unconditionally ends with a "None"
point, which makes no sense. The original author probably meant to check
whether the file is empty, so remove the else clause, and add the check
for emptiness.

Cc: mesa-stable
Signed-off-by: Konstantin Kharlamov <Hi-Angel@yandex.ru>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20241>
(cherry picked from commit bd807eecd1)
2023-01-11 17:44:20 +00:00
Eric Engestrom
2aff633332 gen_release_notes: strip second newline in new features
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20132>
(cherry picked from commit 980d6a91ee)
2023-01-11 17:44:20 +00:00
Eric Engestrom
b8b16d4199 .pick_status.json: Update to 38d6185432 2023-01-11 17:44:17 +00:00
Ruijing Dong
80891799ce radeonsi/vcn: av1 film_grain output fix
use film grain surface as the output instead of target,
which should be kept for DPB process.

fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6903

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit a7b3a279fb)
2023-01-01 17:28:29 +00:00
Ruijing Dong
13872b0434 frontends/va: pass in film_grain_target as new output
In av1 film grain case, to use the film_grain_target
as the output, instead of target buffer, which is kept
as the input for DPB processing in film_grain output
scenario.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit af695149e9)
2023-01-01 17:28:29 +00:00
Ruijing Dong
df124acd48 frontneds/va: use current_display_picture from VA for film grain
use the interface defined in vaapi for av1 film grain's output
https://github.com/intel/libva/blob/master/va/va_dec_av1.h#L296-L304

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Mark Thompson <sw@jkqxz.net>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit 7e91f94864)
2023-01-01 17:28:29 +00:00
Ruijing Dong
037bf0f556 frontends/omx: initialize film_grain_target
set film_grain_target to NULL, and not using it
in omx path.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit 7f71f732ea)
2023-01-01 17:28:29 +00:00
Ruijing Dong
7ce0bd2e90 gallium: add film_grain_target into av1 dec desc
In vaapi, film_grain output will need to direct into
other output surface instead of the current render_target.

CC: 22.3
Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20139>
(cherry picked from commit b70953f5ba)
2023-01-01 17:28:29 +00:00
Väinö Mäkelä
44bb614c37 intel: Fix a hang caused by invalid dispatch enables on gfx6/7
Because commit b9403b1c47 moved dispatch enable handling away from the
compiler, brw_fs_get_dispatch_enables must be used to ensure valid
dispatch enable values.

v2: Fix gfx6 build and use brw_fs_get_dispatch_enables for gfx6 in crocus

Fixes: b9403b1c47 ("intel: factor out dispatch PS enabling logic")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20267>
(cherry picked from commit 4c986c58b3)
2023-01-01 17:07:04 +00:00
Eric Engestrom
8c57a97230 docs/relnotes: add sha256sum for 22.3.2 2022-12-29 21:20:00 +00:00
Eric Engestrom
a09d5e2747 VERSION: bump for 22.3.2 2022-12-29 19:43:28 +00:00
Eric Engestrom
e217d5d25e docs: add release notes for 22.3.2 2022-12-29 19:42:57 +00:00
Lucas Stach
72356c713e etnaviv: disable linear PE by default
Linear PE causes a lot of issues in the ZS stage. While some of those issues
can be worked around on newer GPU cores by doing all ZS operations in the
late stage, GC600 r4653 exhibits spurious Z fails when linear PE is active
even though this GPU does not even have a early Z stage.

Disable linear PE for now, until the issue can be analyzed further. Leave the
debug option in place to allow to enable linear PE for testing.

Fixes: 43eb5e777e ("etnaviv: add debug option to disable linear PE feature")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20405>
(cherry picked from commit c5231025be)
2022-12-29 19:25:30 +00:00
Lionel Landwerlin
1010e2ca89 anv: handle null push descriptors in deferred optimization
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: b49b18f0 ("anv: reduce BT emissions & surface state writes with push descriptors")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20410>
(cherry picked from commit 739a08ad23)
2022-12-29 19:25:30 +00:00
Timur Kristóf
76e8cb61fb radv: Include view index SET_SH_REG in ace_predication_size.
This fixes an issue when conditional rendering and multiple views
were used with a task+mesh draw call.

Fixes: 2479b62869
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20098>
(cherry picked from commit d368914a38)
2022-12-29 19:25:30 +00:00
Gert Wollny
b62e66a9be r600/sfn: Don't try to re-use the iterator when uses is updated
It seems on libc++ the iterator is invalidated when an element is removed
from the set, so make sure that we don't implicitely use the old,
invalidated iterator in the range based - open code the loop using while
instead.

Fixes: f3415c (r600/sfn: copy propagate register load chains)

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7931

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20394>
(cherry picked from commit 05fab97b2c)
2022-12-29 19:25:30 +00:00
Timur Kristóf
b37fb24796 radv: Destroy mesh shader scratch ring in radv_queue_state_finish.
Fixes: 0280b526d5
Signed-off--by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20010>
(cherry picked from commit 64aa555909)
2022-12-29 19:25:30 +00:00
Rohan Garg
fa4a0b7f63 anv: Ensure we clear ANV_PIPE_PSS_STALL_SYNC_BIT on flush
Add the PSS stall bit to ANV_PIPE_STALL_BITS so that it get's cleared on
flush.

Fixes: f3c62973 ("anv,iris: PSS Stall Sync around color fast clears")

Signed-off-by: Rohan Garg <rohan.garg@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20317>
(cherry picked from commit ad9c0e8cd9)
2022-12-29 19:25:30 +00:00
Friedrich Vock
192b312550 radv/rt: Refactor exiting PLOC
The previous approach was susceptible to sync hazards, causing hangs in Doom Eternal.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7897
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
(cherry picked from commit f0f5d5c5e5)
2022-12-29 19:25:30 +00:00
Friedrich Vock
9b1d9d169b radv/rt: Execute memory barrier before updating the phase end count
We want to be sure that the values were updated before letting other invocations continue.

Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
(cherry picked from commit 54ca0665c8)
2022-12-29 19:25:30 +00:00
Friedrich Vock
b65b1a782c radv/rt: PLOC fixes for active_leaf_count
Fixes: 271865373 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20377>
(cherry picked from commit 0e0f42723e)
2022-12-29 19:25:30 +00:00
Marek Vasut
20dd926bea etnaviv: Do expose 2D texture support on pre-halti GPUs
Commit d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
started returning 0 from PIPE_CAP_MAX_TEXTURE_2D_SIZE as well due to switch
case fallthrough. Reinstate the behavior of PIPE_CAP_MAX_TEXTURE_2D_SIZE,
while at the same time, retain the new behavior introduced by commit
d08bd9a8d8 , Otherwise not even kmscube displays the spinning cube,
weston does not display desktop and so on.

Triggered on "Vivante GC600 rev 4653" , i.MX8M Mini .

Fixes: d08bd9a8d8 ("etnaviv: don't expose array and 3D texture support on pre-halti GPUs")
Closes: #7898
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20373>
(cherry picked from commit 18f4dc6b75)
2022-12-29 19:25:30 +00:00
Alyssa Rosenzweig
1fa1009ef2 panfrost: Align WSI strides for tiled AFBC
When calculating legacy WSI strides for tiled AFBC, we need to account for the
greater alignment requirement of tiled AFBC, or importing resources will fail
later.

Since tiled AFBC is only supported on v7 and later, and AFBC of window surfaces
isn't being used on Linux on v7 and later, this probably hasn't been hit in
practice. Probably.

We're about to fix AFBC of window surfaces so we need to fix this side first.

Fixes: 0255f554f3 ("panfrost: Advertise 16x16 tiled AFBC")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20311>
(cherry picked from commit a3f9aa3b3e)
2022-12-29 19:25:30 +00:00
pal1000
3cfe9bb623 OpenCL/draw module: Support linking with LLVM and clang 15 static libraries
Cc: mesa-stable

Closes: #7243

Closes: #7487

Reviewed-by: Karol Herbst <kherbst@redhat.com>

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19009>
(cherry picked from commit f69b43ae3e)
2022-12-29 19:25:30 +00:00
Rhys Perry
d03c94fa82 radv/gfx11: disable mesh shaders
Even if the perftest is used, these should be disabled on GFX11. We
don't implement it yet

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 <mesa-stable>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20358>
(cherry picked from commit 74ceff1816)
2022-12-29 19:25:30 +00:00
Rhys Perry
e6e692e19a aco/gfx11: export mrtz in discard early exit for non-color shaders
If a shader doesn't export any color targets and instead only exports
mrtz, the discard early exit block should match.

Fixes artifacts on Lara in Rise of the Tomb Raider benchmark and hair in
The Witcher 3 (classic).

https://reviews.llvm.org/D128185

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Fixes: bc8da20dda ("aco: export MRT0 instead of NULL on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20345>
(cherry picked from commit 192486b7aa)
2022-12-29 19:25:30 +00:00
Iago Toral Quiroga
7a9c1e17fe v3dv: be more careful when restoring dirty state after meta operations
So far we have been only restoring dirty dynamic states used by meta
pipelines however, static state from meta pipelines will also clear
dirty flags, preventing follow-up draw calls in the command buffer
to honor these if they are flagged as dynamic states in their
pipelines. Fix this by always resetting all dirty state flags after
a meta operation so we re-emit all the state we need with the next draw
call.

Fixes:
dEQP-VK.dynamic_state.monolithic.image.clear

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20356>
(cherry picked from commit df8611e816)
2022-12-29 19:25:30 +00:00
Iago Toral Quiroga
538a66b027 v3dv: pipeline creation feedback may not request all stages
Nothing in the spec seems to require that the number of stages for
which creation feedback is requested must match the number of stages
available in the pipeline. In fact, the spec explicitly mentions
that this number could be 0:

   "If pipelineStageCreationFeedbackCount is not 0,
    pPipelineStageCreationFeedbacks must be a valid pointer to an
    array of pipelineStageCreationFeedbackCount
    VkPipelineCreationFeedback structures"

Fixes an assert crash in:
dEQP-VK.pipeline.monolithic.creation_feedback.graphics_tests.vertex_stage_fragment_stage_no_cache_zero_out_feedback_cout

cc: mesa-stable

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20352>
(cherry picked from commit 3cc863649f)
2022-12-29 19:25:29 +00:00
Pavel Ondračka
edb0e10b5a r300: be more careful with presubtract and non-native swizzles
The problematic scenario is when we have the same source used by both
normal and presubtract argument. We check that case currently and count
the source only once. However if one of the arguments uses a non-native
swizzle, we have to rewrite it later and the source changes. Therefore
we end with too many sources and fail later during pair translation.

Example:
ADD temp[21].xy, temp[20].xy__, temp[17].xy__;
MAD temp[22].xy, temp[17].zw__, temp[11].xy__, temp[21].xy__;

will get converted to

MAD temp[22].xy, temp[17].zw__, temp[11].xy__, (temp[17] + temp[20]).xy__;

however after dataflow swizzles pass we end with

MOV temp[3].x, temp[17].z___;
MOV temp[3].y, temp[17]._w__;
MAD temp[22].xy, temp[3].xy__, temp[11].xy__, (temp[17] + temp[20]).xy__;

Just skip the "don't count the same source twice" optimization when a
non-native swizzle is used to fix 2 dEQP atan2 tests.

Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Tested-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19764>
(cherry picked from commit 6738a7b5b4)
2022-12-29 19:25:29 +00:00
Iago Toral Quiroga
49d8af74ed v3dv: honor render area in subpass resolve fallback
When falling back to handling subpass resolves via separate
image resolves we were resolving the entire attachment instead
of limiting the resolve to the render area defined for the render
pass.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
(cherry picked from commit ce94d3e48d)
2022-12-29 19:25:29 +00:00
Iago Toral Quiroga
4847a0845c v3dv: handle depth/stencil resolves we can't implement via TLB
If we can't use the TLB to do a subpass resolve we have a fallaback
that emits separate image resolves, but this fallback was only
handling color resolves. This adds depth/stencil as well.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
(cherry picked from commit 9ac053e0a2)
2022-12-29 19:25:29 +00:00
Iago Toral Quiroga
c92aaf6d09 v3dv: don't resolve by averaging samples on depth/stencil resolves
For these we always want to use sample_0, averaging is reserved for
color formats. We were already doing this correctly for depth/stencil
resolved in render passes, but not for those happening through
vkCmdResolveImage.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
(cherry picked from commit 284285376b)
2022-12-29 19:25:29 +00:00
Iago Toral Quiroga
02b95befed v3dv: always store/restore attachment state during meta operations
attachment state is only relevant during render passes, however,
there is a corner case: if we can't resolve an attachment in a
subpass using the hardware, we emit a manual image resolve in the
driver which can trigger a meta operation via blit. In this case,
we pretend we are not in a render pass (since vulkan disallows
blits/resolves in a render pass) but we really want to keep the
attachment state after the meta operation.

Fixes some of the issues we have with CTS 1.3.4 in:
dEQP-VK.pipeline.monolithic.multisample.misc.*

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20331>
(cherry picked from commit 6117f855ee)
2022-12-29 19:25:29 +00:00
Lionel Landwerlin
9c1899e93f anv: fixup another dirty issue with gpu_memcpy
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20335>
(cherry picked from commit b21cd1ee1b)
2022-12-29 19:25:29 +00:00
Konstantin Seurer
ae0c9ee7e1 radv/rra: Emit leaf node ids for leaf nodes instead of internal nodes
Fixes: e4283d8 ("radv/rra: Handle box16 nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20184>
(cherry picked from commit ab8777b384)
2022-12-29 19:25:29 +00:00
Timur Kristóf
da887a635b aco: Don't accept constants on p_bpermute.
The sequence emitted for this pseudo instruction is not ready
to handle constants or literals at all.

Cc: mesa-stable
Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20293>
(cherry picked from commit 614348f28b)
2022-12-29 19:25:29 +00:00
Emma Anholt
02d32bac72 zink: Fix reversed cap declarations for ImageBuffer
Fixes validation fails on
KHR-GLES31.core.texture_buffer.texture_buffer_texture_buffer_range.

Fixes: f55a4407ef ("zink: more accurately set {Sampled,Image}Buffer caps")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20308>
(cherry picked from commit 9dedbf66f6)
2022-12-29 19:25:29 +00:00
Eric Engestrom
c4843e4ab4 .pick_status.json: Update to def474e916 2022-12-29 19:25:25 +00:00
Eric Engestrom
6db008a8bb docs/relnotes: add 22.3.1 to index 2022-12-14 22:40:29 +00:00
Eric Engestrom
c20f1fc62e docs/relnotes: add sha256sum for 22.3.1 2022-12-14 22:34:47 +00:00
Eric Engestrom
c36706142b VERSION: bump for 22.3.1 2022-12-14 21:06:11 +00:00
Eric Engestrom
840eef75bd docs: add release notes for 22.3.1 2022-12-14 21:05:30 +00:00
Sathishkumar S
9b02e5c023 gallium/vl: return the buffer plane order for yuv444p format
plane order is expected when trying to render yuv surfaces, update it for yuv444p

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19445>
(cherry picked from commit f1ea0bc18a)
2022-12-14 20:56:55 +00:00
Sathishkumar S
cdbba253c2 frontends/va: fix crash during grayscale rendering
crash is observed as format is assumed to be yuv and buffer plane
order is undefined for monochrome. luma only format is not to be
considered yuv format. It has to be rendered with rgb=rrr.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20165>
(cherry picked from commit 6a3179c5a9)
2022-12-14 20:56:54 +00:00
Lionel Landwerlin
a60641d132 anv: disable Wa_1806565034 when robustImageAccess is enabled
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5711
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7859
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
(cherry picked from commit a921486e2a)
2022-12-14 20:56:54 +00:00
Lionel Landwerlin
fcb34f031c intel/fs: make Wa_1806565034 conditional to non robust access
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
(cherry picked from commit 94bb4a13fa)
2022-12-14 20:56:54 +00:00
Lionel Landwerlin
b5820a84a2 isl: make Wa_1806565034 conditional to non robust access
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20280>
(cherry picked from commit 89a550a37b)
2022-12-14 20:56:54 +00:00
Ian Romanick
c1fad08d69 glsl_to_nir: Fix NIR bit-size of ir_triop_bitfield_extract and ir_quadop_bitfield_insert
Previously these would return result->bit_size of 32 even though the
type might have been int16_t or uint16_t.  This prevents many assertion
failures in "glsl: Use nir_type_convert instead of
nir_type_conversion_op" on zink.

Fixes: 5e922fbc16 ("glsl_to_nir: fix bitfield_extract with 16-bit operands")
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15121>
(cherry picked from commit 43da822312)
2022-12-14 20:56:54 +00:00
Eric Engestrom
ae1fa524c4 v3dv: skip some invalid tests
Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20305>
(cherry picked from commit 408f1c689c)
2022-12-14 20:56:54 +00:00
Sathishkumar S
74d17cba5c radeonsi/vcn: fix regression in yuv422 jpeg decode
- yuv422 decode was blocked in 12acee17fa, enable it back.
- nv12 yuv422 and grayscale decode is supported on all versions.
- JPEG2 and higher versions supports 444p decode.
- add l8_unorm to supported formats, can be used for grayscale.

Fixes: 12acee17fa (frontends/va: reallocate surface for yuv400/yuv444 picture)

v2: indent the switch case correctly (Thong Thai)

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Thong Thai <thong.thai@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20165>
(cherry picked from commit 7ad4a5079e)
2022-12-14 20:56:53 +00:00
Sathishkumar S
0565b834b6 radeonsi/vcn: enable yuv422 jpeg decode
add yuv422 to supported decode format on asics that support it.

Signed-off-by: Sathishkumar S <sathishkumar.sundararaju@amd.com>
Reviewed-by: Leo Liu <leo.liu@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19445>
(cherry picked from commit 581220aa54)
2022-12-14 20:56:02 +00:00
Samuel Pitoiset
a8911c50c8 radv: do not remove the PointSize built-in for polygon mode as points
Determine if it can be removed when generating the graphics pipeline
key because of dynamic states.

Fixes new CTS dEQP-VK.rasterization.polygon_as_large_points.* and also
spec@!opengl 1.1@polygon-offset with Zink/RADV.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20073>
(cherry picked from commit b4f940913d)
2022-12-14 20:47:02 +00:00
Jan Palus
a9b3fee4b0 vdpau: allow building vdpau st with virgl only
Fixes: 6b5aecb195 ("virgl: add support for hardware video acceleration")

Signed-off-by: Jan Palus <jpalus@fastmail.com>
Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20108>
(cherry picked from commit 8560ce28c2)
2022-12-14 20:47:02 +00:00
Friedrich Vock
63e1ccd598 radv: Handle NULL miss shaders
Fixes reflections in DOOM Eternal.

Fixes: 85580faa ("radv: Add ray traversal loop.")
Closes: #6210
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20270>
(cherry picked from commit 568fa71ef8)
2022-12-14 20:47:02 +00:00
Peng Huang
3e3def9620 intel: Fix crashes for importing drm buffer
image_aspect_to_binding() converts aspect to index by subrracting
VK_IMAGE_ASPECT_MEMORY_PLANE_0_BIT_EXT, however these enum values
are bitfields, not consecutive numbers, so comparing and subtracting
them won't work.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20269>
(cherry picked from commit 7642f3b99c)
2022-12-14 20:47:02 +00:00
Lionel Landwerlin
0c7a3133ac anv: fixup descriptor copies
I did not properly understood that we cannot access the views written
to the descriptor sets because they might have been destroyed after
the write operation and the copy operation is allowed to copy what is
invalid data. The shader just can't access it.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 03e1e19246 ("anv: Refactor descriptor copy")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20222>
(cherry picked from commit a0991c7c79)
2022-12-14 20:47:02 +00:00
Iván Briano
dc889d95bc hasvk: pipelineStageCreationFeedbackCount is allowed to be 0
Fixes: 6601e5d6fc ("anv: implement VK_EXT_pipeline_creation_feedback")

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20216>
(cherry picked from commit 68b546ec3d)
2022-12-14 20:47:02 +00:00
Lionel Landwerlin
bf1d05b8e4 intel/nir/rt: fixup primitive id
There is a delta index value in the hit structure, we forgot to add it
to the base value.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0465714790 ("intel/nir/rt: add more helpers for ray queries")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7565
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19346>
(cherry picked from commit 6106396825)
2022-12-14 20:47:02 +00:00
Samuel Pitoiset
5e0dfcb9c7 radv: fix hashing descriptor set layout
Shouldn't have pointers.

Fixes: 19f8d33876 ("radv: Use vk_descriptor_set_layout")
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/20250>
(cherry picked from commit 13f39da71a)
2022-12-14 20:47:02 +00:00
Friedrich Vock
57827e6903 nir: Do not consider phis with incompatible dests equal
CSE tries to collapse equal instructions, and collapsing two phis with incompatible dests is illegal.

Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Fixes: 6bdce55c ("nir: Add a basic CSE pass")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19960>
(cherry picked from commit a54c2c8289)
2022-12-14 20:47:01 +00:00
Lionel Landwerlin
68fece9af5 Revert "anv: compile anv_acceleration_structure.c"
This reverts commit 74d0be27ae.

Also remove anv_acceleration_structure.c, it was meant to be removed
earlier. There was probably a rebase issue somewhere.

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20248>
(cherry picked from commit d608706875)
2022-12-14 20:47:01 +00:00
Rhys Perry
2c73855937 aco/ra: don't swap p_create_vector operand with definition blocker for scc
SCC is 1-bit, and we can't copy a 32-bit value into it.

Fixes dEQP-VK.spirv_assembly.type.scalar.i32.iequal_tesse with
ACO_DEBUG=noopt.

No fossil-db changes.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 9476986e6f ("aco/ra: special-case get_reg_for_create_vector_copy()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20240>
(cherry picked from commit a05dd58309)
2022-12-14 20:47:01 +00:00
Ruijing Dong
6922882d8f frontends/va: fix gst videotestsrc h264 enc fail issue.
problem:
when doing "gst-launch-1.0 -v videotestsrc num-buffer=10 !
   vaapih264enc ! fakeink"

The command will fail due to gst will fetch the first
available supported format in the list, it becomes P010_LE
due to the commit in

[0b02db3007]
frontends/va: fixed av1 decoding 10bit ffmpeg output YUV issue

fix:
move the P010_LE code block to the end of the function, the sequence
of the supported formats restored to its original.

cc: mesa-stable

Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20242>
(cherry picked from commit a73e86e0a5)
2022-12-14 20:47:01 +00:00
Tapani Pälli
e17740493f anv: emit sample mask state independent of fragment stage
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7861
Fixes: 9f6af43743 ("anv: dynamic multisample sample mask")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20221>
(cherry picked from commit 68ef0d8448)
2022-12-14 20:47:01 +00:00
Boyuan Zhang
bcc73ba6f7 radeonsi: disable av1 decode for navi24
Disable AV1 decode for Navi24 since hardware doesn't support.

fixed: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7855

cc: mesa-stable

Signed-off-by: Boyuan Zhang <boyuan.zhang@amd.com>
Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20230>
(cherry picked from commit 5233551e19)
2022-12-14 20:47:01 +00:00
Tapani Pälli
5b6718728b intel/fs: implement Wa_14017989577
The first instruction of any kernel should have non-zero emask. This
restriction needs to be obeyed to avoid GPU hangs.

Patch adds a function to insert dummy mov as first instruction
to make sure this requirement is fulfilled.

Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20194>
(cherry picked from commit bc4b7de0d0)
2022-12-14 20:47:01 +00:00
Kenneth Graunke
d936394cf4 intel/compiler: Set NoMask on cr0 access for float controls mode
This is trying to clear a bit in the control register.  However, it's
executing with whatever channel mask happens to be active.  Typically
this is the one at the start of the program, so at least some channels
will be active.  Typically the first channel will be active due to
packed dispatch, but that's not always guaranteed.  Without NoMask,
the float controls writes may randomly not happen.

Recent GPUs also seem to have a hang issue when the first instruction in
the shader doesn't have any active channels.  Having an instruction with
NoMask at the start of the program works around the issue.  See HSD bug
14017989577.  In our case, the float controls preamble was breaking that
restriction every time, causing us to run into this problem frequently.

Thanks to Tapani Pälli for finding this hang issue, and Francisco
Jerez and Lionel Landwerlin for helping pinpoint this issue during
review of a workaround patch in !20194.

Fixes GPU hangs in Elder Scrolls Online, Witcher 3, and likely more.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7639
Fixes: 9da56ffc52 ("i965/fs: add emit_shader_float_controls_execution_mode() and aux functions")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20214>
(cherry picked from commit bafbe7c23a)
2022-12-14 20:47:01 +00:00
Iván Briano
75e55ca05a vulkan: VkPolygonMode has a bit more than two values
Fixes: 9d0ed9cbcc ("vulkan: Add more dynamic rasterizer state")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20212>
(cherry picked from commit e1ab7629f8)
2022-12-14 20:47:01 +00:00
Otavio Pontes
d4d1f52284 anv/hasvk: Clamping Scissor Rect values in a valid range
On cmd_buffer_emit_scissor(), if VkViewport height or width are set to
a value lower than 1.0, y_max or x_max can be attributed negative values,
causing an overflow. That leads to ScissorRectangleYMax or
ScissorRectangleXMax to be set to values on an unsupported range.

Clamping x_max and y_max in the valid range solves the problem.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7471
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20200>
(cherry picked from commit 2e775b8bdb)
2022-12-14 20:47:01 +00:00
Danylo Piliaiev
a0ffb41002 meson: Do not enable drm for KGSL Turnip build
Android may use either DRM or some downstream solution, KGSL is a
downstream kernel driver for Adreno. Don't enable DRM when we want
Turnip to use KGSL instead of DRM.

Fixes: 09ac29cca9
("meson: Enable system_has_kms_drm for android")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20168>
(cherry picked from commit 1cfc413c9a)
2022-12-14 20:47:01 +00:00
Dave Airlie
2fbea1fdaa glx: fix xshm check to init xshm_opcode.
Found and proposed by Ray Strode (halfline)

Fixes: 68e8940114 ("glx/drisw: use xcb instead of X to query connection")
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20188>
(cherry picked from commit 57b7102ef9)
2022-12-14 20:47:01 +00:00
Erik Faye-Lund
1fa232af41 zink: don't use defunct custom-flag
We're no longer respecting this flag, so there's no need in setting it.

Fixes: 00dc0036bb ("zink: flatten out buffer creation usage flags codepath")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20183>
(cherry picked from commit 2ccf481c17)
2022-12-14 20:47:01 +00:00
Dawn Han
0aecc20890 venus: fix deqp tests failed on iub descriptor type
Fixes: abae9d4831 ("Add the iub binding count tracking")

Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20064>
(cherry picked from commit fbf4c6e43f)
2022-12-14 20:47:01 +00:00
Samuel Pitoiset
7fa84a47df radv: fix guardband if the polygon mode is points or lines
If points or lines are drawn using the polygon mode, the guardband
should be adjusted for large points/lines.

Cc: 22.3 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/20185>
(cherry picked from commit 12f26b5e6d)
2022-12-14 20:47:01 +00:00
Marcin Ślusarz
5f387adc02 nir/lower_task_shader: fix task payload corruption when shared memory workaround is enabled
We were not taking into account that when all invocations within workgroup
are active, we'll copy more data than needed, corrupting task payload
of other workgroups.

Fixes: 8aff8d3dd4 ("nir: Add common task shader lowering to make the backend's job easier.")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20080>
(cherry picked from commit ffefa386fd)
2022-12-14 20:47:01 +00:00
Rhys Perry
91c565df53 aco: more carefully apply constant offsets into scratch accesses
Death stranding does scratch_arr[80-idx]. This doesn't seem to work if we
try to combine the subtraction into the access.

fossil-db (navi21):
Totals from 52 (0.04% of 135636) affected shaders:
Instrs: 78560 -> 79036 (+0.61%)
CodeSize: 427940 -> 431188 (+0.76%)
Latency: 1313809 -> 1318142 (+0.33%)
InvThroughput: 292833 -> 293842 (+0.34%)
VClause: 2361 -> 2555 (+8.22%); split: -0.51%, +8.73%
Copies: 8767 -> 8746 (-0.24%); split: -0.35%, +0.11%

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Fixes: 0e783d687a ("aco: use scratch_* for scratch load/store on GFX9+")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7735
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20117>
(cherry picked from commit 381de3c809)
2022-12-14 20:47:01 +00:00
Ruijing Dong
d8d1b09474 radeonsi/vcn: adding av1 decoding film grain block
add the logic for calculating film grain related
coefficients for VCN to generate film grain output.

Reviewed-by: Leo Liu <leo.liu@amd.com>
Signed-off-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19660>
(cherry picked from commit b283567456)
2022-12-14 20:47:01 +00:00
Samuel Pitoiset
648081624d radv: use LATE_Z for depth/stencil attachments used in feedback loops
To make sure shader invocations read the correct values.

Fixes dEQP-VK.rasterization.rasterization_order_attachment_access.*.samples_*.multi_draw_barriers

Cc: 22.3 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/19728>
(cherry picked from commit a42f8d49c3)
2022-12-14 20:47:01 +00:00
Chia-I Wu
3ef6b27bde nir: fix nir_link_varying_precision
link_varyings ignores precisions and can assign the same location to
variables with different precisions.  nir_link_varying_precision should
check location_frac as well.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20113>
(cherry picked from commit 7244d88516)
2022-12-14 20:47:01 +00:00
Lionel Landwerlin
7b5ba2d363 intel: add missing restriction on fragment simd dispatch
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7755
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20169>
(cherry picked from commit d4cd33630a)
2022-12-14 20:47:01 +00:00
Lionel Landwerlin
e2fc0b33cd intel: factor out dispatch PS enabling logic
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Tested-by: Mark Janes <markjanes@swizzler.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20169>
(cherry picked from commit b9403b1c47)
2022-12-14 20:47:01 +00:00
Samuel Pitoiset
2510c6c502 radv: do not set ZPASS_INCREMENT_DISABLE on GFX11
This field no longer exists.

Cc: 22.3 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/20090>
(cherry picked from commit b051719b05)
2022-12-14 20:47:00 +00:00
Samuel Pitoiset
b6e7aeb14e radv: fix emitting invalid color attachments
Note sure how this happened.

Fixes: 97dc28b177 ("radv: fix configuring COLOR_INVALID on GFX11")
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/20127>
(cherry picked from commit 664aa7a37b)
2022-12-14 20:47:00 +00:00
Jan Alexander Steffens (heftig)
ff39ada94f dzn: Don't crash when libd3d12.so can't be found
`dzn_instance_create` will call `dzn_instance_destroy` when the d3d12
library fails to load. Just like the issue in `d3d12_screen`, this will
lead to a crash because `d3d12_mod` is NULL.

To fix this, only close the library after if it was actually opened.

Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145>
(cherry picked from commit b513389400)
2022-12-14 20:47:00 +00:00
Jan Alexander Steffens (heftig)
1b27820b76 d3d12: Don't crash when libd3d12.so can't be found
`d3d12_destroy_screen` is called by `d3d12_create_dxcore_screen` after
`d3d12_init_screen_base` fails and attempts to call `util_dl_close` on
a NULL pointer, leading to an abort.

To fix this, only close the library after if it was actually opened.

Cc: mesa-stable
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20145>
(cherry picked from commit b3d1ae19f2)
2022-12-14 20:47:00 +00:00
Sviatoslav Peleshko
d43425f7e0 anv: Defer flushing PIPE_CONTROL bits forbidden in CCS while in GPGPU mode
Fixes: 313aeee8 ("anv: Use pending pipe control mechanism in flush_pipeline_select()
")

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7816
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20124>
(cherry picked from commit 77ecf9149c)
2022-12-14 20:47:00 +00:00
Jason Ekstrand
b34f6c1559 dxil: Use nir_const_value_for_uint in dxil_nir_lower_int_samplers
This change should avoid any accidental rounding issues because of
border colors getting stored in a float in dxil_wrap_sampler_state.  It
also switches us to using the correct helpers for nir_const_value so we
can avoid any weird uninitialized data failures that can be caused by
filling out the fields in the struct directly.

Fixes: b9c61379ab ("microsoft/compiler: translate nir to dxil")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
(cherry picked from commit cd5c66e165)
2022-12-14 20:47:00 +00:00
Jason Ekstrand
3b5c8ec1a9 r600/nir: Fix u64vec2 immediate lowering
There were a couple of issues here:

 1. We should be using nir_const_value_for_uint instead of setting the
    union fields directly to ensure the rest of the union is zeroed.

 2. It was always filling out the first two components of val even if
    the incoming constant had 2 64-bit components.

Fixes: 165fb5117b ("r600/sfn: add lowering passes to get 64 bit ops lowered to 32 bit vec2")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
(cherry picked from commit f3f1c28f8e)
2022-12-14 20:47:00 +00:00
Jason Ekstrand
af63185bda st/mesa: Use nir_const_value_for_bool() in ATIFS
Fixes: 0a179bb6e2 ("st/mesa: Generate NIR for ATI_fragment_shader instead of TGSI.")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
(cherry picked from commit 49d86200e5)
2022-12-14 20:47:00 +00:00
Jason Ekstrand
f2327830b2 nir: Use nir_const_value_for_int in nir_lower_subgroups
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7670
Fixes: e4e79de2a4 ("nir/subgroups: Support > 1 ballot components")
Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19689>
(cherry picked from commit e6de164e03)
2022-12-14 20:47:00 +00:00
Konstantin Seurer
d988e3f32b radv/rra: Set the metadata size correctly
Fixes: 5749806 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20047>
(cherry picked from commit bb6b45e26e)
2022-12-14 20:47:00 +00:00
Danylo Piliaiev
dcf2960733 nir/nir_opt_offsets: Prevent offsets going above max
In try_fold_load_store when trying to extract const addition from
non-const offset source, we should take into account that there is
already a constant base offset, which should count towards the limit.

The issue was found in "Monster Hunter: World" running on Turnip.

Fixes: cac6f633b2
("nir/opt_offsets: Use nir_ssa_scalar to chase offset additions.")

Well, the issue was present before this commit but it made a lot
of changes in surrounding code.

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com
Reviewed-by: Connor Abbott <cwabbott0@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20099>
(cherry picked from commit 5d025f4003)
2022-12-14 20:47:00 +00:00
Lionel Landwerlin
a17409115a anv: correctly predicate ray tracing
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 7479fe6ae0 ("anv: Implement vkCmdTraceRays and vkCmdTraceRaysIndirect")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20011>
(cherry picked from commit af3f7948d1)
2022-12-14 20:47:00 +00:00
Lionel Landwerlin
b81a29146b isl: don't report I915_FORMAT_MOD_Y_TILED_CCS on Gfx8
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Acked-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19852>
(cherry picked from commit 0626b68c88)
2022-12-14 20:47:00 +00:00
Danylo Piliaiev
48e7b3a1f8 ir3: Reduce the maximum allowed imm offset for shared var load/store
STL/LDL have 13 bits to store imm offset. However the most significant
bit in the offset is a sign bit, so the positive offset is limited by
12 bits.

nir_opt_offsets only has the upper limit and doesn't deal with
negative offsets, so shared_max should be changed to `(1 << 12) - 1`.

The issue was found in "Monster Hunter: World".

Fixes: 0b2da9d795
("ir3: Limit the maximum imm offset in nir_opt_offset for shared vars")

Signed-off-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20100>
(cherry picked from commit 8f0177b334)
2022-12-14 20:47:00 +00:00
Daniel Stone
bd5d599127 ci: Rebalance radv/grunt testing
We've recently rebalanced our lab devices to get a fewer number of
grunts. Switch to scheduling only on the newer shinier ones, running
fewer tests. We'll evaluate the runtime, and if they're quick enough
then we can increase the amount of testing we do.

Signed-off-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20081>
(cherry picked from commit 921cfcf4c4)
2022-12-14 20:47:00 +00:00
Iago Toral Quiroga
8dcb79b68f v3dv: fix job serialization for single sync path
The idea in the single sync path is that we serialize any job that
needs to wait, however, our ANY queue syncobj only tracks the last job
submitted to any hardware queue, so in practice when we wait on this
we are only serializing against the queue to which we have submitted
the last job, which is not correct.

Fix that by accumulating the last job sync into the ANY queue synbcobj
to ensure that waiting on this syncobj effectively waits on all
hardware queues.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20078>
(cherry picked from commit 4276ec9f2a)
2022-12-14 20:47:00 +00:00
Iago Toral Quiroga
e8a59e42ec v3dv: make single-sync paths more explicit
Instead of having functions that return early in multi-sync mode
let's only call them when we are in single-sync mode. I think this
makes the code more explicit.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20078>
(cherry picked from commit 95b9293eeb)
2022-12-14 20:47:00 +00:00
Marcin Ślusarz
2615b5a354 intel/compiler: user payload starts after TUE header & its padding
All data written by the user are offset by TUE header size.
Without this patch we copy the correct amount of user data, but both
"from" and "to" offsets are wrong.

Fixes: 37e78803d7 ("intel/compiler: use nir_lower_task_shader pass")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
(cherry picked from commit db0e6f9a07)
2022-12-14 20:47:00 +00:00
Marcin Ślusarz
985a4ebab3 nir/lower_task_shader: allow offsetting of the start of payload
We need this, because on Intel task payload starts with private header,
followed by user-accessible data.

Fixes: 37e78803d7 ("intel/compiler: use nir_lower_task_shader pass")

Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
(cherry picked from commit f6adfd6278)
2022-12-14 20:47:00 +00:00
Marcin Ślusarz
20ba98ab2f intel/compiler: adjust [store|load]_task_payload.base too
Base also needs to be converted from bytes to words.

Fixes: c36ae42e4c ("intel/compiler: Use nir_var_mem_task_payload")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19409>
(cherry picked from commit 7aaafaa8ae)
2022-12-14 20:47:00 +00:00
Connor Abbott
b022752572 freedreno/fdl: Set sRGB bit for storage images
This probably wasn't noticed earlier because tests using sRGB storage
images didn't exist, and we didn't know whether this works, but this
fixes dEQP-VK.image.store.without_format.2d.*_srgb which also proves
that the bit works.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20060>
(cherry picked from commit ccef6d1f5f)
2022-12-14 20:47:00 +00:00
Bas Nieuwenhuizen
2cabe4167f radv: Handle nodes with 2 invalid children in internal node converter.
Fixes: 682dc5c28e ("radv: Add conversion shader for internal nodes")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19891>
(cherry picked from commit f531f671ef)
2022-12-14 20:47:00 +00:00
Georg Lehmann
68fc987c49 aco: Use wave size specific opcode for s_or in cube map coord code.
Cc: mesa-stable

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20041>
(cherry picked from commit a3beb82cf6)
2022-12-14 20:47:00 +00:00
Alyssa Rosenzweig
ba9ee546d5 pan/mdg: Emulate 8-bit with the 16-bit pipe
We don't care to support i8vec16, we just need a bit of 8-bit support to
implement format packing/unpacking in blend shaders. We're already doing
this by using the 16-bit pipe, we just need to commit to it all the way
-- reporting the correct sizes in max_bitsize_for_alu so the mask
packing logic works as intended -- and dropping the imov-specific hack
that was introduced to workaround a similar class of bugs.

With the previous patch, fixes:

   dEQP-GLES31.functional.draw_buffers_indexed.random.max_required_draw_buffers.1

Fixes: 39e4b7279d ("pan/midg: Fix swizzling on 8-bit sources")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19763>
(cherry picked from commit 976405907e)
2022-12-14 20:47:00 +00:00
Eric Engestrom
88cb57c8eb .pick_status.json: Update to 264a0cabd1 2022-12-14 20:47:00 +00:00
Lionel Landwerlin
6fae6b40f7 iris: move bindless surface state heap inside the surface state heap
We're about to make scratch surface states part of the surface state
heap. Because those are required to be in the low 26bits parts surface
state heap (we're limited in bits handed in the CFE_STATE, 3DSTATE_VS,
etc... instructions), this change splits the 32bit surface state heap
as follow:

   - 8Mb of surface states for scratch
   - 1Gb - 8Mb of binding tables
   - 3Gb of surface states

That way all of the surfaces are located within a 4Gb region visible
from STATE_BASE_ADDRESS::SurfaceStateBaseAddress

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>
(cherry picked from commit daab161535)
2022-12-14 20:47:00 +00:00
Eric Engestrom
60a8ab5996 docs: add release notes for 22.3.0 2022-12-14 20:46:59 +00:00
Eric Engestrom
32552010d1 VERSION: bump for 22.3.0 2022-11-30 21:28:51 +00:00
Eric Engestrom
1df8ddafb8 commit_in_branch.py: add support for checking staging branches
Or any branch that contains a `/` slash.

Cc: mesa-stable
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19988>
(cherry picked from commit 707015891f)
2022-11-30 21:12:44 +00:00
Connor Abbott
a584116950 ir3: Don't save/restore disasm string pointer
It's not in the key, so it randomly may or may not be present, and if it
is present then we don't actually save/restore the contents, so we will
save/restore random pointer values from the last run. Turnip already
disables searching the shader cache when assembly is requested, but
still wrote the final ir3_shader_variant which resulted in trying to
save random stale pointers when saving off the executable if a
subsequent compile hit that cache entry.

This fixes flakes in
dEQP-VK.pipeline.pipeline_library.shader_module_identifier.pipeline_from_id.*
for me.

Fixes: 56909868cd ("turnip: implement VK_KHR_pipeline_executable_properties")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20056>
(cherry picked from commit 8ba2d612d5)
2022-11-30 21:12:44 +00:00
Connor Abbott
d28350a810 tu: Fix binding NULL descriptor sets
This fixes the new test
dEQP-VK.pipeline.pipeline_library.graphics_library.misc.other.null_descriptor_set_in_monolithic_pipeline.

Fixes: e9f5de11d4 ("tu: Initial implementation of VK_EXT_graphics_pipeline_library")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20057>
(cherry picked from commit 515c9a2e07)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
b392942486 radv: disable VRS entirely on GFX11
Based on registers, VRS changed a lot and it's unclear how to program
it. This disable VK_KHR_fragment_shading_rate, VRS flat shading and
RADV_FORCE_VRS.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20054>
(cherry picked from commit 80072df824)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
a3013b1df4 radv: do not enable NGG culling on GFX11
RadeonSI disables it as well. It's really unclear if it will help or
not (eg. NGG culling never helped on GFX10).

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20054>
(cherry picked from commit 5d552b4f6c)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
ed0cb79072 radv: do not enable DCC for MSAA images without FMASK
I don't know how this is supposed to work, especially for fast clears
because CMASK should be cleared to 0xC but FMASK implies CMASK.
This fixes a bunch of MSAA test failures on GFX10.3 with
RADV_DEBUG=nofmask.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20054>
(cherry picked from commit 84a7138d3c)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
488f186c2a radv: set INTERPOLATE_COMP_Z to 0 on GFX11
Ported from RadeonSI to fix a EQAA bug.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20054>
(cherry picked from commit 9b637aa9a1)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
49d1eae7c1 radv: set missing SPI_SHADER_PGM_xxx registers on GFX11
Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20054>
(cherry picked from commit 62715a6d03)
2022-11-30 21:12:44 +00:00
Samuel Pitoiset
da6c352d7a radv: introduce RADV_DEBUG=nofmask
To disable MSAA compression on MSAA images. This will also allow us to
emulate GFX11 (FMASK has been removed) and to experiment 32 byte
descriptor sizes.

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/19613>
(cherry picked from commit cf7b96a83f)
2022-11-30 21:12:44 +00:00
Jessica Clarke
3955e72587 panfrost/blend: Fix invalid const values leading to NIR validation errors
Using a designated initializer like this leaves padding bits, which form
part of the aliasing u64/f64 member of the union, uninitialised, but a
nir_const_value must always have the unused bits zeroed out. Thus, use
the nir_const_value_for_float helper instead like everywhere else which
will do a memset 0 for us first.

Without this, using the pan_blend shader in a build with validation
enabled fails with:

  NIR validation failed after nir_lower_vars_to_ssa
  ...
            vec4 32 ssa_58 = load_const (0x3f7cfcfd /* 0.988235 */, 0x3f7cfcfd /* 0.988235 */, 0x3f7cfcfd /* 0.988235 */, 0x3f800000 /* 1.000000 */)
  error: memcmp(val, &cmp_val, sizeof(cmp_val)) == 0 (../src/compiler/nir/nir_validate.c:976)

Fixes: 1378c67bcf ("panfrost/blend: Inline blend constants")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20071>
(cherry picked from commit 750325730b)
2022-11-30 21:12:44 +00:00
Yiwei Zhang
fdde4e622e venus: fix android wsi with global fencing disabled
Fixes: b21e4a7990 ("venus: put android wsi on the sub-optimal path")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20049>
(cherry picked from commit 6148ccef63)
2022-11-30 21:12:44 +00:00
Sajeesh Sidharthan
e8aededfe7 radeonsi/vcn: set current pic index correctly
video corruption observed while running decode test for av1
content in chromeos.

solution is when target buffer is found in render pic list and when
target codec is null, set curr_pic_indx as index to the
pic in render pic list.

Cc: mesa-stable
Signed-off-by: Sajeesh Sidharthan <sajeesh.sidharthan@amd.com>
Reviewed-by: Boyuan Zhang <Boyuan.Zhang@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20000>
(cherry picked from commit 8b99e96dc8)
2022-11-30 21:12:44 +00:00
Karol Herbst
7a28549247 nir/lower_int64: fix shift lowering
Starting with !19748 lowered 64 bit shifts were showing wrong results for
shifts with insignificant bits set.

nir shifts are defined to only look at the least significant bits. The
lowering has take this into account.

So there are two things going on:
1. the `ieq` and `uge` further down depend on `y` being masked.
2. the calculation of `reverse_count` actually depends on a masked `y` as
   well, due to the `(iabs (iadd y -32))` giving a different result for
   shifts > 31;

Fixes: 41f3e9e5f5 ("nir: Implement lowering of 64-bit shift operations")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19995>
(cherry picked from commit 5398dd04bf)
2022-11-30 21:12:44 +00:00
Connor Abbott
304005ff81 tu: Use right enum for compute active_shader_stages
This is VkShaderStageFlags, not VkPipelineStageFlags. Fixes preloading
descriptors for compute dispatches.

Fixes: d862a2ebcb ("turnip: Only emit descriptor loads for active stages in the pipeline.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20059>
(cherry picked from commit 0a0a04bdaa)
2022-11-30 21:12:44 +00:00
Roman Stratiienko
a569c68e87 meson: Enable system_has_kms_drm for android
This allows to build libgbm when  system = 'android'  is set in
the cross_file.

Cc: "22.3" "22.2" mesa-stable
Signed-off-by: Roman Stratiienko <r.stratiienko@gmail.com>
Acked-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20033>
(cherry picked from commit 09ac29cca9)
2022-11-30 21:12:43 +00:00
Erik Faye-Lund
d4f0c6a30c d3d12: fix max-array-layers
We used to need this, because we incorrectly multiplied the cube array
sizes by 6. Now that this has been fixed, we can actually support the
OpenGL 4.1 limit for this.

Fixes: 7118b2136e ("d3d12: Don't multiply cube array sizes by 6")
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19780>
(cherry picked from commit acc0039aec)
2022-11-30 21:12:43 +00:00
Mauro Rossi
3f80abc103 AOSP: Add intel_hasvk vulkan library suffix
Required to correctly install vulkan.intel_hasvk.so module
after commit 50013ca9 ("intel: add a hasvk vulkan driver")

In order to set property ro.hardware.vulkan as 'intel_hasvk' for the correct iGPU parts at init stage,
i915 'graphics version' can only be detected by means of /sys/kernel/debug/dri/0/i915_capabilities
and debugfs needs to be mounted at early-init stage

https://review.lineageos.org/c/LineageOS/android_device_lge_g3-common/+/19875

Cc: "22.3" mesa-stable
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20048>
(cherry picked from commit ea10b0fc7a)
2022-11-30 21:12:43 +00:00
Gert Wollny
94b2aebf6f r600/sfn: always use four slots for Cayman trans ops
This is a partial revert of
  ed6204eb0 (r600/sfn: only use 3 channels on Cayman for trans ops)

The scheduler and/or optimizer passes generate faulty code when
we use only three slots as decribed in the spec. So for now disable
this optimization.

Fixes: ed6204eb0 (r600/sfn: only use 3 channels on Cayman for trans ops)
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7774

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20034>
(cherry picked from commit 28c7684eb9)
2022-11-30 21:12:43 +00:00
Konstantin Seurer
3148738adf radv/rt: Check space before emitting descriptors
Found by inspection.

cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20020>
(cherry picked from commit c5d91ab254)
2022-11-30 21:12:43 +00:00
Konstantin Seurer
d6f992b1eb radv/ray_queries: Fix AABB handling
AABB intersections always have to be committed manually.
-> We don't have to copy opaque ones to closest.

It's also invalid to query t for candidate AABBs.

Totals from 7 (14.29% of 49) affected shaders:
CodeSize: 171008 -> 169672 (-0.78%)
Instrs: 32499 -> 32250 (-0.77%); split: -0.78%, +0.01%
Latency: 418859 -> 414759 (-0.98%); split: -0.98%, +0.00%
InvThroughput: 89182 -> 88251 (-1.04%); split: -1.05%, +0.00%
VClause: 602 -> 599 (-0.50%)
SClause: 837 -> 835 (-0.24%)
Copies: 4804 -> 4802 (-0.04%); split: -0.35%, +0.31%
Branches: 1593 -> 1585 (-0.50%)
PreSGPRs: 567 -> 566 (-0.18%)

Fixes: 3f72061 ("radv/rq: Use the common traversal helper")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19698>
(cherry picked from commit 0966fb2c10)
2022-11-30 21:12:43 +00:00
Bas Nieuwenhuizen
3aa65abd14 radv: reserve space for the scissor in vkCmdBeginRendering.
Fixes: c7d0d328d5 ("radv: Set the window scissor to the render area, not framebuffer")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20014>
(cherry picked from commit a97a6d0f0e)
2022-11-30 21:12:43 +00:00
Lucas Stach
fe062fe182 etnaviv: fix wrong surface TS clear size
Clearing ts_size - ts_offset bytes in a level means we are clearing the
TS region of all layers in the level starting from the surface layer, so
clearing one surface might corrupt all other layers of a resource level.
Use the correct size to clear only the requested TS region.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19814>
(cherry picked from commit b6fa3cdb0e)
2022-11-30 21:12:43 +00:00
Lucas Stach
a318f3c8b7 etnaviv: blt: use correct TS offset in clear operations
Using the ts_offset from the level means we are always clearing the
TS region of layer 0 of the level. Use the correct offset which takes
into account the layer offset.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19814>
(cherry picked from commit d9e2a7d6ad)
2022-11-30 21:12:43 +00:00
Martin Roukala (né Peres)
e13d53e1fd Revert "glx/dri: Fix DRI drawable release at MakeCurrent time"
This reverts commit 31b04e420b which
is also breaking KDE in some ways.

Fixes: #7674
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>
(cherry picked from commit ea3f73ba85)
2022-11-30 21:12:43 +00:00
Martin Roukala (né Peres)
ac18e931fa Revert "glx: Fix drawable refcounting for naked Windows"
This reverts commit 768238fdc0 which
is not only leading to memory leaks, but also reportedly breaks KDE
pretty badly.

Fixes: #7674, #7435
Acked-by: Michel Dänzer <mdaenzer@redhat.com>
Acked-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Adam Jackson <ajax@redhat.com>
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19972>
(cherry picked from commit 0cee008fee)
2022-11-30 21:12:43 +00:00
Lucas Stach
27b92b131c etnaviv: rs: fix blits with insufficient alignment for dual pipe operation
Up-aligning the blit height does not always work, as some blit targets
have a smaller padded height. Fall back to single pipe operation if
increasing the height alignment fails. Still try to do it opportunistically
as it improves performance when resolving MSAA targets.

Fixes: 0ff96aaef3 ("etnaviv: rs: fix MSAA alignment adjustment")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>
(cherry picked from commit 797454edfc)
2022-11-30 21:12:43 +00:00
Lucas Stach
a47ce0b938 etnaviv: always use RS align when GPU has TEXTURE_HALIGN feature
Due to a logic bug we didn't always up-align the resource when the GPU
has the TEXTURE_HALIGN feature, which broke the RS blit when we need
to blit into a sampler shadow from a multi-tiled render target.

Fixes: 735718ed33 ("etnaviv: move etna_layout_multiple into etnaviv_resource.c")
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19991>
(cherry picked from commit fd06b313b0)
2022-11-30 21:12:43 +00:00
Sviatoslav Peleshko
1869c2ebf5 driconf/intel: Use fake vendor to WA bad detection in Source engine games
Source engine uses flawed device detection in Linux native OpenGL backend,
which causes it to use bad configurations for Intel devices and thus
not always render correctly. Workaround this by using vendor string that
does not include "Intel" in it.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7725
Signed-off-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19828>
(cherry picked from commit 478ffe7127)
2022-11-30 21:12:43 +00:00
Bas Nieuwenhuizen
6c2a5ad084 vulkan: Remove asserts that weren't valid for RADV ETC2 emulation.
Wasn't caught when radv was modified to use these helpers ...

Tried to move the aspects assert so it still checks application inputs.

Fixes: d9048e31a0 ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
(cherry picked from commit 13d755441c)
2022-11-30 21:12:43 +00:00
Bas Nieuwenhuizen
a8e2fa733f radv: Fix sampler types in ETC2 decode.
Otherwise we'd have a type mismatch vs texture fetches, which
is asserted upon these days.

Fixes: 1153db23f5 ("radv: Add ETC2 decode shader.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
(cherry picked from commit eab61863c0)
2022-11-30 21:12:43 +00:00
Bas Nieuwenhuizen
1b08bbe2db radv: Use correct init order for ETC2 image views
Fixes: d9048e31a0 ("radv: Use vk_image_view as the base for radv_image_view")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19914>
(cherry picked from commit c6ec4925c0)
2022-11-30 21:12:43 +00:00
Samuel Pitoiset
dd7e8d3cdb radv: make sure to mark DCC as compressed on GFX11
The bit has moved to FDCC_ENABLE on GFX11.
Found by inspection.

Cc: 22.3 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/20005>
(cherry picked from commit ccac91db7b)
2022-11-30 21:12:43 +00:00
Rhys Perry
78a07aa90b ac/nir: mask shift operands
NIR shifts are defined to truncate the shift amount to the number of bits
needed to represent the bit-size of the value shifted. LLVM treats large
shifts as poison. This fix achieves NIR semantics for shifts.

As an example, a|(b << 32), where "a" is 32bits, should produce a|b
according to NIR (because 32&31 == 0).

This caused LLVM to incorrectly optimize "(a >> c) | (b << (32 - c))" to a
u2u32(pack_64_2x32(a, b) >> c) (v_alignbit_b32), when the original NIR
should have returned "a | b" if c==0.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Mihai Preda <mhpreda@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19966>
(cherry picked from commit 064336d359)
2022-11-30 21:12:43 +00:00
Gert Wollny
0c6af7585d virgl: Fix injection of double from const mov instruction
We only copy two components, we have to use the complete original source,
and we should rewrite the new source from scratch to avoid incorrect
dimension and indirect handling.

Fixes: 036d7172c (virgl: Move double operands to a temp to avoid double-swizzling bugs)

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19975>
(cherry picked from commit d5217b024e)
2022-11-30 21:12:42 +00:00
Eric Engestrom
cd01442bab .pick_status.json: Mark 470fbb35ef as denominated 2022-11-30 21:12:42 +00:00
Samuel Pitoiset
5cda9f529c radv: re-emit dynamic depth clamp enable if depth clip enable changed
The depth clamp mode depends on depth clip enable/disable.

Fixes: e48c0fbd8f ("radv: add support for dynamic depth clamp enable")
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/19843>
(cherry picked from commit de4de09a56)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
2e369e60aa mesa: treat unsupported queries as dummies
It's legal in OpenGL to start a query even if the result will have zero
valid bits. It's not enough to just report zero bits, We need to also
prevent calling down into the driver with these invalid queries.

Because ARB_ES3_compatibility adds ANY_SAMPLES_PASSED and
ANY_SAMPLES_PASSED_CONSERVATIVE to the set of queries that support zero
bits, we also need to check for the corresponding indices.

Fixes: 0186e9e1c5 ("mesa: always support occlusion queries")
Reviewed-by: Soroush Kashani <soroush.kashani@imgtec.com>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19750>
(cherry picked from commit 1b1e8873fe)
2022-11-30 21:12:42 +00:00
Marek Olšák
74a9e97532 st/vdpau: fix interop with GL
Fixes: e00bb6cb98 - mesa/st: use tracked samplerview swizzle values
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7751

Tested-By: Veerabadhran.Gopalakrishnan@amd.com
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19961>
(cherry picked from commit c70eec86ef)
2022-11-30 21:12:42 +00:00
Alyssa Rosenzweig
a2617ca303 panfrost: Revert "Require 64-byte alignment on imports"
This reverts commit 811f8a1946. As Alpine put it
-- this is causing more problems than it's fixing. Hotfix to revert the
offending commit until a more measured fix can be implemented.

Closes: #7731
Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Jan Palus
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19993>
(cherry picked from commit 4b19725ee5)
2022-11-30 21:12:42 +00:00
Dawn Han
bf8bec0146 venus: enable VK_KHR_push_descriptor
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
(cherry picked from commit 505a5bc79f)
2022-11-30 21:12:42 +00:00
Dawn Han
11b106cc1b venus: implement vkCmdPushDescriptorSetWithTemplateKHR
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
(cherry picked from commit 933ca11f1a)
2022-11-30 21:12:42 +00:00
Dawn Han
1bd40d4185 venus: extend VkPipelineLayout lifetime for batched VkCmdPushConstants()
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
(cherry picked from commit 19f2b9d0bb)
2022-11-30 21:12:42 +00:00
Dawn Han
962ec6f8de venus: extend lifetime of push descriptor set layout
Signed-off-by: Dawn Han <dawnhan@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18988>
(cherry picked from commit 91966f2eff)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
836db826bd docs/zink: add missing required device-feature
Seems I forgot to add this to the list of required features.

Fixes: eb0195358c ("zink: only inspect dual-src limit if feature enabled")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
(cherry picked from commit a2a0ac21e4)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
556b945d13 zink: update textureCompressionBC requirement
The mesa state-tracker can now emulate all formats indicated by this
feature-flag, so we don't require this for OpenGL 4.2 any more.

It's however a good idea to support for power-usage and performance
reasons, saving on memory bandwidth. So let's move it to the
gl46_optimal block instead.

Fixes: e4ff42684b ("mesa/st: enable bptc extension with fallback")
Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
(cherry picked from commit 13bccac5a7)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
f1eb8b2fcf zink: fix incorrect requirements
These were in the wrong list all along.

Fixes: a466c2a783 ("zink: check for stores and atomics features")
Fixes: 2644835f03 ("zink: add missing required feature")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
(cherry picked from commit 754353c417)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
e58d22220a zink: remove needless requirements
We never required the uniform texel buffer bit for more than
bufferFeatures for a bunch of these formats.

Similarly, we *don't* need the uniform texel buffer bit for sampled
image access.

For the image-dimensions, the Mesa frontend doesn't validate the max 1D,
3D or Cube sizes, nor the max texture layers. So we'll expose GL 4.1
without these, even if that's not conformant.

Finally, we don't require robustImageAccess2 for OpenGL 4.3 at all. All
we need is the robustBufferAccess feature.

Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
(cherry picked from commit b60bc52992)
2022-11-30 21:12:42 +00:00
Erik Faye-Lund
394d7edb4f zink: fix json-errors in profile-file
There's some stray commas here, let's get rid of them.

Fixes: 2ea481b2f0 ("Zink: add Zink profiles file")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19779>
(cherry picked from commit b707cf24a3)
2022-11-30 21:12:42 +00:00
Yonggang Luo
79488fd111 gallivm: use valid LLVM_VERSION_MAJOR instead of LLVM_VERSION
Partial of: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7680
Fixes: 203920d4c6 ("gallivm: add atomic 32-bit float support")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19926>
(cherry picked from commit b461921ed8)
2022-11-30 21:12:42 +00:00
Christian Gmeiner
531fa051de etnaviv: Hide MSAA support behind debug flag
With the current level of MSAA support we have some real world rendering
problems in Chromium/Skia (issue #7678). Convert the MSAA support to an
explicit opt-in by settings ETNA_MESA_DEBUG=msaa.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19870>
(cherry picked from commit 4f5e59d114)
2022-11-30 21:12:42 +00:00
Alyssa Rosenzweig
755eb3370c pan/mdg: Fix out-of-order execution
We can go up to 15 instructions out of order (performance fix) but we
can't go past a branch (bug fix).

Fixes: 30a393f458 ("pan/mdg: Enable out-of-order execution after texture ops")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19762>
(cherry picked from commit 044428211c)
2022-11-30 21:12:42 +00:00
Eric Engestrom
84faa6b409 .pick_status.json: Update to 22be0d09a0 2022-11-30 21:12:29 +00:00
Eric Engestrom
e16ab1b4cb VERSION: bump for 22.3.0-rc4 2022-11-23 19:13:15 +00:00
Hans-Kristian Arntzen
11f33e6198 vk/runtime: Fix narrowing of timeline signal and wait value to u32.
They are u64. Fixes deadlock in
dEQP-VK.wsi.xcb.present_id_wait.wait.past_no_timeout.

Signed-off-by: Hans-Kristian Arntzen <post@arntzen-software.no>
Fixes: 9bffd81f1c ("vulkan: Add common implementations of vkQueueSubmit
and vkQueueWaitIdle")

Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19951>
(cherry picked from commit f2e535e4fe)
2022-11-23 19:12:00 +00:00
Lionel Landwerlin
4b38684f60 nir/divergence: add missing btd_shader_type_intel
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6d9ae6ec1e ("intel: add a new intrinsic to get the shader stage from bindless shaders")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19948>
(cherry picked from commit 99dcdf4d64)
2022-11-23 19:12:00 +00:00
Lionel Landwerlin
a4eeeb8f78 anv: generate correct addresses for state pool offsets
Fixes a number of CTS patterns on DG2 :

   - dEQP-VK.dynamic_rendering.primary_cmd_buff.random*
   - dEQP-VK.draw.*secondary_cmd*
   - dEQP-VK.dynamic_rendering.*secondary_cmd*
   - dEQP-VK.geometry.*secondary_cmd_buffer
   - dEQP-VK.multiview.*secondary_cmd*

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d9 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>
(cherry picked from commit 9bb055ff5d)
2022-11-23 19:12:00 +00:00
Lionel Landwerlin
532521adbc blorp: support negative offsets in addresses
Similar to anv_address

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 9c1c1888d9 ("intel/fs: put scratch surface in the surface state heap")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19946>
(cherry picked from commit 20e8e1eb06)
2022-11-23 19:12:00 +00:00
Lionel Landwerlin
ac303c5d5b intel/fs: improve Wa_22013689345 workaround
The initial implementation is a pretty big hammer. Implement the HW
recommendation to minimize cases in which we need a fence.

This improves by 10FPS on some of the Sascha Willems RT demos.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 6031ad4bf6 ("intel/fs: Add Wa_22013689345")
Reviewed-by: Francisco Jerez <currojerez@riseup.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19322>
(cherry picked from commit 945637514e)
2022-11-23 19:12:00 +00:00
Mauro Rossi
3982e3aca7 r600/sfn: allow building with clang 6 (Android 9)
static constexpr const 'value' is replaced by static function
in all type_char template specializations
to avoid the following building errors happening with clang 6

/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::ExportInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::ExportInstr>(std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&, std::__1::list<r600::ExportInstr*, std::__1::allocator<r600::ExportInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
...
/home/utente/pie-x86_kernel/prebuilts/clang/host/linux-x86/clang-4691093/bin/ld.lld: error: undefined symbol: r600::type_char<r600::RatInstr>::value
>>> referenced by sfn_scheduler.cpp
>>>               sfn_sfn_scheduler.cpp.o:(bool r600::BlockSheduler::collect_ready_type<r600::RatInstr>(std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&, std::__1::list<r600::RatInstr*, std::__1::allocator<r600::RatInstr*> >&)) in archive src/gallium/drivers/r600/libr600.a
clang-6.0: error: linker command failed with exit code 1 (use -v to see invocation)

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19873>
(cherry picked from commit e74d989a69)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
174236d2ed aco: fix emitting DEALLOC_VGPRS in the discard block
It should be emitted right before s_endpgm.

Cc: 22.3 mesa-stable
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/19931>
(cherry picked from commit ce11c06429)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
46bb7eaf56 radv: fix possible hangs with NGG streamout and secondary cmdbuf
This was missing but it might hang if streamout is used only in
secondary command buffers.
Found by inspection.

Cc: 22.3 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/19801>
(cherry picked from commit c9f0b7b042)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
33ebcd5d10 radv: fix NGG streamout when it's never enabled in runtime
If a shader has XFB outputs but the application never enables
streamout in runtime (no buffers bound and no begin/end pair), we
have to disable it in the shader by emitting buffer size as 0. It's
also still needed to remember that the cmdbuf needs GDS/GDS OA BOs,
so move this at pipeline bind time instead.

Cc: 22.3 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/19801>
(cherry picked from commit 3189be249d)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
654d0cebb8 radv: re-mit streamout buffers to unbind them when NGG streamout is disabled
A buffer size as 0 acts like if streamout is disabled with NGG.

Cc: 22.3 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/19801>
(cherry picked from commit 6a2bcce882)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
562e8a17d5 radv: enable NGG XFB queries only if streamout is enabled
Otherwise, it's possible to increase counters if a shader has XFB but
the application paused it.

Cc: 22.3 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/19801>
(cherry picked from commit 5b60949155)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
fb51066b48 radv: fix computing the pervertex LDS size with NGG streamout
The NGG streamout lowering pass allocates space for all outputs which
means we have to align our computation. Otherwise, the maximum number
of vertices is incorrect and we end up by reaching the maximum allowed
LDS size. This code could be shared instead of being duplicated but
that's for later.

Fixes some transform feedback tests with Zink and
RADV_PERFTEST=ngg_streamout on GFX10.3.

Cc: 22.3 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/19801>
(cherry picked from commit ba81dcf971)
2022-11-23 19:12:00 +00:00
Samuel Pitoiset
c0bc23f194 radv: stop overallocating LDS for VS/TES when NGG streamout is enabled
The number of shader outputs should only be considered when the
shader has XFB, otherwise we are overallocating LDS.

fossils-db (GFX1100):
Totals from 16602 (12.31% of 134913) affected shaders:
LDS: 17000448 -> 8500224 (-50.00%)

Cc: 22.3 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/19801>
(cherry picked from commit 499abeba60)
2022-11-23 19:12:00 +00:00
Christian Gmeiner
1e46b971c9 etnaviv: nir: lower extract byte/word
Fixes e.g. 'Unhandled ALU op: extract_u16' seen with deqp on gc7000.

Cc: 22.3 mesa-stable
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>
(cherry picked from commit e244b0f8b2)
2022-11-23 19:12:00 +00:00
Christian Gmeiner
8090e45618 etnaviv: Support negative float inline immediates
Closes: #7652
Fixes: 45a111c21c ("nir/opt_algebraic: Fuse c - a * b to FMA")
Signed-off-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19776>
(cherry picked from commit 7d78fe4a86)
2022-11-23 19:12:00 +00:00
Marek Olšák
569c230e22 st/mesa: suppress async glthread flushing for GLX_EXT_texture_from_pixmap
This might fix some window system issues.

Fixes: 3da170faae - glthread: change when glFlush flushes asynchronously

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19809>
(cherry picked from commit d871958702)
2022-11-23 19:12:00 +00:00
Lucas Stach
2946c2b3b3 etnaviv: fix tile status interaction with write mappings
This fixes a longstanding bug in the interaction between TS and a write
mapping. The write does not update TS regardless of the way the update
is done. Update via etna_copy_resource would just set the target ts_valid
to false without actually writing back any dirty TS to the resource.
Writes via the CPU would update the resource, but keep ts_valid at true
even if the tile status may now not match the actually written tiles of
the resource anymore.

Fix this by writing back a dirty TS to the target resource if needed
before updating the level with the write data. Always invalidate TS,
even when the update is done by the CPU.

Cc: mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19846>
(cherry picked from commit 0fb813526e)
2022-11-23 19:12:00 +00:00
Lionel Landwerlin
b92f135377 anv: fixup context initialization on DG2
Fixing a typo :(

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 507a86e131 ("anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19922>
(cherry picked from commit f7d6c6e1ed)
2022-11-23 19:12:00 +00:00
Jason Ekstrand
17b00ea533 vulkan: Add a dummy vk_common_CmdSetColorBlendAdvancedEXT()
The entrypoint needs to exist but we don't need to do anything with it.

Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
(cherry picked from commit 9cec1ed51d)
2022-11-23 19:12:00 +00:00
Jason Ekstrand
b3754a5b17 vulkan: Add a common implementation of CmdSetSampleLocationsEnableEXT
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
(cherry picked from commit 182aa9eb15)
2022-11-23 19:11:59 +00:00
Jason Ekstrand
e32d17def7 vulkan: Add state for extraPrimitiveOverestimationSize
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19817>
(cherry picked from commit b172fd62f5)
2022-11-23 19:11:59 +00:00
Lionel Landwerlin
77a9b631db anv: ensure CPS is initialized when KHR_fragment_shading_rate is disabled
We need to set CPS_MODE_NONE when no per coarse pixel dispatch.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 231651fd89 ("anv: implement VK_KHR_fragment_shading_rate")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>
(cherry picked from commit 507a86e131)
2022-11-23 19:11:59 +00:00
Lionel Landwerlin
46517e0b65 anv: fix 3d state initialization
We missed a couple of restriction leading to inconsistent 3d pipeline
state. It is mostly noticeable when doing a multiple sample dispatch
as the verify first 3d operation.

Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7531
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19867>
(cherry picked from commit 62f12c2dad)
2022-11-23 19:11:59 +00:00
Ian Romanick
73580de2e8 nir/loop_analyze: Fix get_iteration for nir_op_fneu
Consider the loop:

    float i = 0.0;
    while (true) {
       if (i != 0.0)
          break;

       i = i + 1.0;
    }

This loop clearly executes exactly one time.

Some trickery is necessary to handle cases where the initial loop value
is very large and the increment is, by comparison, very small.  From the
fenu_once test case,

    float i = -604462909807314587353088.0;
    while (true) {
       if (i != -604462909807314587353088.0)
          break;

       i = i + 36028797018963968.0;
    }

This loop should also execute exactly once, but this is much more
challenging to calculate due to precision issues.

Going towards smaller magnitude (i.e., adding a small positive value to
a large negative value) requires a smaller delta to make a difference
than going towards a larger magnitude. For this reason,
-604462909807314587353088.0 + 36028797018963968.0 !=
-604462909807314587353088.0, but -604462909807314587353088.0 +
-36028797018963968.0 == -604462909807314587353088.0. Math class is
tough.

No changes in shader-db or fossil-db.

v2: Fix major bug in checking result of the eval_const_binop(nir_op_feq,
...) discovered while developing fneu_once_easy unit test. Fix a typo in
the comment just above that. Add fneu_once_easy test.

v3: Skip the iteration count adjustment tests for nir_op_fenu and
nir_op_ine. Since the iteration count is either 1 or unknown, all this
function can do is add numerical error. Add fenu_once tests.

v4: Change the initial value in the fneu_once test from large positive
to large negative. Change check in get_iteration from nir_op_fsub to
nir_op_fadd. Both changes from discussion with M Henning. Also add some
more explanation in fneu_once.

v5: Rename test cases.

Fixes: 6772a17acc ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>
(cherry picked from commit f75c83c4aa)
2022-11-23 19:11:59 +00:00
Ian Romanick
aee1c4ca00 nir/loop_analyze: Fix get_iteration for nir_op_ine
I discovered this problem because adding an algebraic transformation to
convert some uge and ult to ieq or ine caused a couple loops to stop
unrolling. Consider the loop:

    uint i = 0;
    while (true) {
       if (i >= 1)
          break;

       i++;
    }

This loop clearly executes exactly one time. Note that uge(x, 1) is
equivalent to ine(x, 0). Changing the condition to 'if (i != 0)' will
also execute exactly one time.

In the added test cases, uge_once correctly get an exact loop trip count
of 1. Without the changes to nir_loop_analyze.c, the ine_once case
detects a maximum loop trip count of zero and does not get an exact loop
trip count.

No changes in shader-db or fossil-db.

v2: Move nir_op_fneu changes to a separate commit.

v3: Rename test cases.

Fixes: 6772a17acc ("nir: Add a loop analysis pass")
Reviewed-by: Timothy Arceri <tarceri@itsqueeze.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19732>
(cherry picked from commit d9f014401b)
2022-11-23 19:11:59 +00:00
Karol Herbst
949c4ec5b7 rusticl/device: put space at the end of CL_DEVICE_VERSION
Apparently some software relies on that and the spec kind of says it's
there.

Fixes: 20c90fed5a ("rusticl: added")
Reported-by: sobkas
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19872>
(cherry picked from commit b51eb98cf6)
2022-11-23 19:11:59 +00:00
Gert Wollny
3b282d2c3d virgl: don't a use staging when a resources created with the shared flag
There seems to be a problem with running firefox by using Xwayland that
results in a shared resources being not always tagged as using staging.

As a result one process tries to map the resource that was allocated as
one that uses staging without actually using the staging resource, and
hence the mapped range only accounts for the small region that we have
to allocated because a zero-allocation doesn't work, but the application
mapping the resource assumes that a properly sized range is mapped, and
consequently this results in invalid memory access.

To work around this issue disable creating staging for resources that
are created by using shared binding. It is not clear to me whether this
is the best fix, but it seems to quell the issue.

Fixes: c9d99b7eec
    virgl: Fix texture transfers by using a staging resource

Related: https://gitlab.freedesktop.org/virgl/virglrenderer/-/issues/291
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19655>
(cherry picked from commit e496d24cb2)
2022-11-23 19:11:59 +00:00
Lionel Landwerlin
d567ac1dc8 intel/fs: put scratch surface in the surface state heap
In 4ceaed7839 we made scratch surface state allocations part of the
internal heap (mapped to STATE_BASE_ADDRESS::SurfaceStateBaseAddress)
so that it doesn't uses slots in the application's expected 1M
descriptors (especially with vkd3d-proton).

But all our compiler code relies on BSS
(STATE_BASE_ADDRESS::BindlessSurfaceStateBaseAddress).

The additional issue is that there is only 26bits of surface offset
available in CS instruction (CFE_STATE, 3DSTATE_VS, etc...) for
scratch surfaces. So we need the drivers to put the scratch surfaces
in the first chunk of STATE_BASE_ADDRESS::SurfaceStateBaseAddress
(hence all the driver changes).

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 4ceaed7839 ("anv: split internal surface states from descriptors")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7687
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19727>
(cherry picked from commit 9c1c1888d9)
2022-11-23 19:11:59 +00:00
Eric Engestrom
fbc9f23653 .pick_status.json: Mark 56bd81ee21 as denominated 2022-11-23 19:11:59 +00:00
Rhys Perry
c0c581ec34 aco: ensure MRT0 is written with dual source blending
Fixes crucible test func.shader.dualsrc_mrt0_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>
(cherry picked from commit 3061bc792d)
2022-11-23 19:11:59 +00:00
Rhys Perry
1a60fb52be radv: disable MRT compaction with dual-source blending
Fixes crucible tests func.shader.dualsrc_mrt0_undef on navi21 and
func.shader.dualsrc_mrt1_undef on polaris10.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Cc: 22.3 mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19806>
(cherry picked from commit ea0ae17fc4)
2022-11-23 19:11:59 +00:00
Bas Nieuwenhuizen
a8477c373d radv: Fix custom build id with C90 compilation.
Seems some build configurations have problems with VLAs still.

Fixes: 97641e5c94 ("radv: Add ability to override the build id for the cache.")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19869>
(cherry picked from commit 8d37ab6bfa)
2022-11-23 19:11:59 +00:00
Jose Maria Casanova Crespo
4bb8973deb v3d: Minor fixes on sand8 blit based on sand30 modifications
* load_uniform for sand8_stride is uint32 instead of int32 and its range
  is 4 instead of 1 as it is counted in bytes.
* Now we save and restore constant buffer 1 properly for the ubo used
  in the blit. We need to take into account that in V3D the first UBO
  with index 0 is stored on constant buffer 1, because gallium uses
  internally contant buffer 0 (See for reference commit c8212731e7)
* Removed not needed return.
* Added shader information about uniforms, ubos, inputs and outputs.
* Fixed typos in the comments.

Fixes: 95c4f0f910 "v3d: Enables DRM_FORMAT_MOD_BROADCOM_SAND128 support"
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19639>
(cherry picked from commit c82775e3c7)
2022-11-23 19:11:59 +00:00
Samuel Pitoiset
399eacfce1 zink: require extendedDynamicState3ColorBlendEquation for full ds3
Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19851>
(cherry picked from commit e253729e03)
2022-11-23 19:11:59 +00:00
Qiang Yu
6c19c36288 ac/llvm: fix 16bit varying llvm compile error
Found when 16bit vec3 varying with llvm14 (not found
when llvm15), one 32bit vec4 slot is filled like this:
  vec3[0] | undef
  vec3[1] | undef
  vec3[2] | undef
  undef   | undef

LLVM error is for the elements with undef:
  %287 = insertelement float %280, half %279, i64 0

After this change, we get:
  %287 = insertelement <2 x half> %280, half %279, i64 0

Fixes: 279eea5bda ("amd/llvm: Transition to LLVM "opaque pointers"")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19848>
(cherry picked from commit e3b1f26a2b)
2022-11-23 19:11:59 +00:00
Eric Engestrom
6bf4a48155 v3d(v): account for debug flags when using the cache
Signed-off-by: Eric Engestrom <eric@igalia.com>
Cc: mesa-stable
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19796>
(cherry picked from commit 2b99523a95)
2022-11-23 19:11:59 +00:00
Gert Wollny
7f33a0b997 r600/sfn: sort FS color outputs before all other outputs
The color outputs must be checked against the number of available
color buffers, therefore it is best to sort the color outputs to be
on the driver locations before the other FS outputs.

Fixes: 79ca456b48
   r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7530

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19804>
(cherry picked from commit be570cd322)
2022-11-23 19:11:59 +00:00
Lionel Landwerlin
4e0f9c36e0 Revert "nir/lower_shader_calls: put inserted instructions into a dummy block"
This reverts commit 35d82ecf1e.

Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
(cherry picked from commit e2dadda35f)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
8f6c7cb351 nir/lower_shader_calls: wrap only jumps rather than entire code blocks
Moving entire chunks of code into a dummy if block is causing issues
in some situations. To work around the issue that we tried to fix in
35d82ecf1e ("nir/lower_shader_calls: put inserted instructions into a
dummy block") which is that we cannot cut and past a block of
instruction that ends with a jump if there are more instruction behind
where we're going to past. We can instead just wraps the jumps into
dummy if blocks.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
(cherry picked from commit 3686d5a312)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
b2b0770690 nir/lower_shader_calls: update metadata before validation
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19820>
(cherry picked from commit 96d84e2a77)
2022-11-23 19:11:58 +00:00
Ian Romanick
35c695882d nir/range_analysis: Set higher default maximum for max_workgroup_count
Fixes: c2a81ebe19 ("nir: Add default unsigned upper bound configuration.")
Closes: #7676
Reviewed-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19835>
(cherry picked from commit 2ba55ec504)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
d0cc462008 nir/lower_explicit_io: fix metadata preserve
This pass can insert if blocks, therefore no dominance/block_index for
you.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19818>
(cherry picked from commit 723b15fb75)
2022-11-23 19:11:58 +00:00
Rhys Perry
8718187b22 radv: lower 8/16-bit uadd_carry/usub_borrow
Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7615
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
(cherry picked from commit 6fc4a76057)
2022-11-23 19:11:58 +00:00
Rhys Perry
df7dc583e7 nir/lower_bit_size: lower uadd_carry
8/16-bit uadd_carry can exist in SPIR-V.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Gitlab: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7615
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19473>
(cherry picked from commit da30fb5df7)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
d6b2c77fac intel/perf: fix B/C counters accumulation in non query mode
When we're not using queries, all the counters from the
MI_REPORT_PERF_COUNT are available. This is the case when using
perfetto with the global pps datasource that capture global counter
values.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8750f43a90 ("intel/perf: add performance query layout using MI_SRM")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
(cherry picked from commit 61fef1ed72)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
84ada12002 intel/perf: allocate cleared counter infos
This array of structure needs to be initialized to 0 as it contains a
bitset we don't explicitly clear.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3144bc1d33 ("intel/perf: move query_mask and location out of gen_perf_query_counter")
Reviewed-by: Ivan Briano <ivan.briano@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18893>
(cherry picked from commit e754bf6be4)
2022-11-23 19:11:58 +00:00
Lionel Landwerlin
9476566032 anv: get rid of ilog2_round_up
__builtin_clz(value - 1) is undefined for with value=1 (because
__builtin_clz(0) is undefined).

Because we set rt_pipeline->stack_size = 1 when a ray tracing pipeline
doesn't need any stack allocation to differentiate from a dynamic size
(rt_pipeline->stack_size = 0) we can run into this undefinied behavior
issue.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: f68d64dac0 ("anv: Add support for vkCmdSetRayTracingPipelineStackSizeKHR")
Reviewed-by: Marcin Ślusarz <marcin.slusarz@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19781>
(cherry picked from commit 440da44a84)
2022-11-23 19:11:58 +00:00
Michel Dänzer
9a31d05b01 vulkan/wsi/wayland: Set num_modifier_lists = 0 if num_drm_modifiers == 0
This case was missed in
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18826 ,
resulting in native Wayland apps failing with

 ../src/vulkan/wsi/wsi_common_drm.c:452: wsi_configure_native_image: Assertion `!"Failed to find a supported modifier!  This should never " "happen because LINEAR should always be available"' failed.

if the Wayland compositor advertises only the INVALID modifier.

Fixes: c315e20d61 ("vulkan/wsi/wayland: Configure images via params passed to wsi_swapchain_init()")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19795>
(cherry picked from commit 8d7aa4279a)
2022-11-23 19:11:58 +00:00
Konstantin Seurer
054a971ecd radv/rra: Fix copying accel structs that were not built yet
In the case that radv_GetEventStatus always returns true, the loop will
never exit.

Fixes: 5749806 ("radv: Add Radeon Raytracing Analyzer trace dumping utilities")
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19772>
(cherry picked from commit f24bb8194b)
2022-11-23 19:11:58 +00:00
Sil Vilerino
00c3949310 d3d12: Video Screen - Do not crash if HEVC not supported, return no support instead
Fixes: 8f654b90 ("d3d12: Fix HEVC wrong caps detection due to bad parenthesis in condition")
Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19813>
(cherry picked from commit 0c4fdbaa92)
2022-11-23 19:11:58 +00:00
Eric Engestrom
d496e5e4ff .pick_status.json: Update to f2e535e4fe 2022-11-23 19:11:54 +00:00
Eric Engestrom
76e3938fec VERSION: bump for 22.3.0-rc3 2022-11-17 17:18:07 +00:00
Eric Engestrom
3de72d74c8 ci: avoid triggering vc4 & v3d tests on v3dv-only MRs
There are a lot of vulkan-only MRs, so we can save a lot of CI resources
by not running GL tests as well.

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19680>
(cherry picked from commit bc286e8586)
2022-11-17 14:05:05 +00:00
Samuel Pitoiset
7964efaa97 radv: suspend/resume XFB queries with NGG for meta operations
XFB queries enable primitives generated queries with NGG and meta
operations shouldn't be counted.

Reproduced on GFX10.3 by forcing NGG streamout.

Cc: 22.3 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/19785>
(cherry picked from commit 62356e71f4)
2022-11-17 14:05:05 +00:00
Samuel Pitoiset
bbcde41cb2 aco: fix FS inputs loads in WQM with 16-bit
p_wqm needs to use the same size.

Fixes: 16d2c7ad55 ("aco/gfx11: perform FS input loads in WQM")
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/19788>
(cherry picked from commit 50fe37070f)
2022-11-17 14:05:05 +00:00
Michel Dänzer
e566cd6add Revert "egl/glx: add fallback for zink loading"
This reverts commit 2569215f43.

Conflicts:
	src/egl/main/eglapi.c
	src/glx/glxext.c

It broke the fallback to swrast in some cases where zink can't work.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7333
Fixes: 2569215f43 ("egl/glx: add fallback for zink loading")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19681>
(cherry picked from commit 71a0a386b5)
2022-11-17 14:05:05 +00:00
Jonathan Gray
7d19be3eb5 util: include sys/time.h for timespec functions
When the futex code moved it removed an include which broke the build
on OpenBSD.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Fixes: 095dfc6caa ("util: Move the implementation of futex_wake and futex_wait from futex.h to futex.c")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19735>
(cherry picked from commit fe851d7759)
2022-11-17 14:05:05 +00:00
Samuel Pitoiset
1f23f529d1 aco: fix dual source blending on GFX11
Assembly looks similar to LLVM.

Cc: 22.3 mesa-stable
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/19643>
(cherry picked from commit fb781bfb0a)
2022-11-17 14:05:04 +00:00
Samuel Pitoiset
578f84373b aco: add p_dual_src_export_gfx11 for dual source blending on GFX11
Dual source blending must be in strict WQM mode.

Cc: 22.3 mesa-stable
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/19643>
(cherry picked from commit bb90d29660)
2022-11-17 14:05:04 +00:00
Gert Wollny
df117562bf r600/sfn: Fix location for reading cube array image dimensions
Fixes: 79ca456b48
        r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19755>
(cherry picked from commit 35d6e290e4)
2022-11-17 14:05:04 +00:00
Gert Wollny
30ea71b9b0 r600/sfn: Honor shader key w.r.t. atomic counter layout
Fixes: 79ca456b48
        r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19755>
(cherry picked from commit 0ccf7ed791)
2022-11-17 14:05:04 +00:00
Samuel Pitoiset
a5c8473a59 aco: fix missing SCC for p_interp_gfx11 in emit_interp_mov_instr()
Fixes: 369c9b6425 ("aco: fix p_interp_gfx11 to not overwrite SCC")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19777>
(cherry picked from commit 5a3cc2d453)
2022-11-17 14:05:04 +00:00
Alyssa Rosenzweig
09623eb2fd panfrost: Use PIPE_CAP_VERTEX_ATTRIB_ELEMENT_ALIGNED_ONLY
..instead of 4BYTE_ALIGNED_ONLY. This is more correct and avoids
needless repacking. Noticed in Firefox, which was hitting the vbuf
translate path.

Fixes: e03622e50f ("panfrost: Set STRIDE_4BYTE_ALIGNED_ONLY")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19761>
(cherry picked from commit c567e5528f)
2022-11-17 14:05:04 +00:00
Alyssa Rosenzweig
449eb0798f panfrost: Fix reference counting with batch->resources
Refactor accesses to batch->resources to happen through safe helpers
that update the appropriate bookkeeping. This makes it obvious that (in
particular) reference counts are updated when they should be.

The functional change is that we are now correctly unreferencing
resources during shadowing, fixing a leak of shadowed resources.

Closes: #7362
Fixes: 2d8f28df73 ("panfrost: Replace resource shadowing flush")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Mastodon, apparently
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19753>
(cherry picked from commit 42212a9bfd)
2022-11-17 14:05:04 +00:00
José Roberto de Souza
d09f780bf3 iris: Set priority for replaced engine context
The replace_kernel_ctx() code path was not setting back the context
priority.

Fixes: 5c4c8bdc4c ("iris/batch: Add support for engines contexts")
Signed-off-by: José Roberto de Souza <jose.souza@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19687>
(cherry picked from commit cd159c7d6c)
2022-11-17 14:05:04 +00:00
Sil Vilerino
a44264e3c0 ci: Add va frontend to windows-build-rules
Fixes: 2d504bc5 ("CI: Add gallium-va and video-codecs in windows-vs2019 and debian-mingw32-x86_64")

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19767>
(cherry picked from commit 912c72eda5)
2022-11-17 14:05:04 +00:00
Yonggang Luo
e39b25b788 util: Test __PPC64__ for getting PIPE_ARCH_PPC_64 respond to __PPC64__ take effect
Fixes: e737a99a6f ("Fix PPC detection on darwin")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19674>
(cherry picked from commit 7710cc8506)
2022-11-17 14:05:04 +00:00
Sil Vilerino
7f9e923959 frontend/va: Fix WIN32 VA_DRIVER_INIT_FUNC declaration. Remove declspec as it uses .def file
Fixes: b557ceb7 ("frontends/va: Add windows VA frontend support via vl_winsys_win32 and libva-win32")
Closes: #7702

Signed-off-by: Sil Vilerino <sivileri@microsoft.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19754>
(cherry picked from commit d81e40b20c)
2022-11-17 14:05:04 +00:00
Samuel Pitoiset
64b775c972 aco: fix p_interp_gfx11 to not overwrite SCC
s_wqm_b64 clobbers SCC.
Found this while working on dual source blending.

Fixes: 6113ee650a ("aco/gfx11: fix FS input loads in quad-divergent control flow")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19747>
(cherry picked from commit 369c9b6425)
2022-11-17 14:05:04 +00:00
Yonggang Luo
559530f151 clover: empty soversion when on win32
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7675
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Prodea Alexandru-Liviu <liviuprodea@yahoo.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19653>
(cherry picked from commit 14eef14147)
2022-11-17 14:05:04 +00:00
Erik Faye-Lund
62a6fd3983 docs: remove stale envvar-reference
This reference was left over when the envvar was removed.

Fixes: 231ccb6100 ("docs: Remove no-longer-accurate text about the xlib driver")

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19593>
(cherry picked from commit 9bfa939a5e)
2022-11-17 14:05:04 +00:00
Erik Faye-Lund
86e7eb1830 docs: do not mention EGL_MESA_drm_display
This extension was removed back in 2016, but it seems we left a mention
of it in the docs.

The entire section with this extension seems kinda pointless now, so
let's drop it entirely.

Fixes: f3e23ead53 ("egl: remove remnants of MESA_drm_display")
Reviewed-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19719>
(cherry picked from commit 9f2c9e4c3f)
2022-11-17 14:05:04 +00:00
Lucas Stach
2aae392bba etnaviv: switch to late Z when linear PE is used
In linear PE mode the early and late depth stage do not only disagree
about the cache layout, but they seem to fundamentally disagree about
the buffer layout. When Z was written via the late stage, early tests
always show spurious zfails, even if they are not in the same draw
call. Cache flushing and pipe stalls don't help in that case.

The only option to get reliable Z tests with linear render targets is
to move all Z handling into the PE stage. Even when early Z writes
are possible, we don't know if any other draw to the same surface
needs late Z handling, so we must never use the early stage.

Fixes: 53445284a4 ("etnaviv: add linear PE support")
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/19686>
(cherry picked from commit 7fe91c9f66)
2022-11-17 14:05:04 +00:00
Lucas Stach
f55b090c84 etnaviv: fix shader register control with MSAA
Apparently MSAA doesn't only add another input, but it also increases
required temporaries by one. Simple programs where the register demand
is given by the number of inputs did work fine, while more complex ones,
where register demand is given by the number of temporaries exhibit
rendering issues without this fix.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19582>
(cherry picked from commit e65d266529)
2022-11-17 14:05:04 +00:00
David Heidelberg
4734048d51 ci/update_traces_checksum.py: check if checksum is in the array, not it's value
Fixes: 45eda06953 ("ci: introduce update_traces_checksum.py")

Reviewed-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19510>
(cherry picked from commit e1d40d11f5)
2022-11-17 14:05:04 +00:00
Guilherme Gallo
053f0f5934 freedreno/ci: Skip civilization-v/CivilizationV-trim trace
It is been flaking, the following jobs are expecting the same checksum,
but produced different ones.

- https://mesa.pages.freedesktop.org/-/mesa/-/jobs/31762457/artifacts/results/summary/results/trace@freedreno-a630@civilization-v@CivilizationV-trim--s705-761-f762-v20201203-v2.trace.html
- https://mesa.pages.freedesktop.org/-/mesa/-/jobs/31763571/artifacts/results/summary/results/trace@freedreno-a630@civilization-v@CivilizationV-trim--s705-761-f762-v20201203-v2.trace.html

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
David Heidelberg
34319c7d84 ci/freedreno: disable antichambers trace
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7668
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19627

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
(cherry picked from commit f562e37c93)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
Benjamin Tissoires
76dc28e3ff CI: convert to use the new S3 server instead of the legacy minio
We don't need to login anymore, but we can't use plain minio commands
now. `ci-fairy` got a helper as `s3cp` to keep an almost identical
API.

Solved Conflicts:
	.gitlab-ci/common/init-stage2.sh
	.gitlab-ci/container/lava_build.sh
	.gitlab-ci/prepare-artifacts.sh
	src/amd/ci/traces-amd.yml
	src/freedreno/ci/traces-freedreno.yml
	src/gallium/frontends/lavapipe/ci/traces-lavapipe.yml

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 67cee534a8)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
Guilherme Gallo
935ba13ee4 ci: Update ci-fairy in CI, rootfs and containers
ci-fairy is pulverized in possible different versions at Mesa CI. This
commit updates all of them to the version that migrates minio to s3.
Also, trigger the build of base and test containers, as both uses
ci-fairy as well.

Solved Conflicts:
	.gitlab-ci/image-tags.yml

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit a04ed2f971)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
Guilherme Gallo
03d1edf3c8 ci: Update piglit-traces tests expectations
Found some:
- crashes in zink, softpipe
- fails in a630-restricted
- unexpectedpass in broadcom
    - fixed by https://gitlab.freedesktop.org/mesa/piglit/-/merge_requests/730

More details in the test expectations files comments.

Solved Conflicts:
	src/gallium/drivers/zink/ci/zink-lvp-skips.txt

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
(cherry picked from commit a108e4f70c)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
Guilherme Gallo
f3c55ddd42 ci: Update piglit with s3 support
With new S3 support, we can use JWT-only server interaction via the
removal of `role-session` and `minio-host` arguments from PIGLIT_ARGS in
YAML.
This parameter change will come in a later commit.

Solved Conflicts:
	.gitlab-ci/container/build-piglit.sh
	.gitlab-ci/image-tags.yml

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
(cherry picked from commit 70ce1dcacc)

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19734>
2022-11-17 14:05:04 +00:00
Alejandro Piñeiro
e51b0b1060 v3dv/bo: reset bo and then call gem close
After 'v3dv: fix debug dump on BO free' we changed the order, and this
lead to the following test
dEQP-VK.api.object_management.multithreaded_per_thread_resources.device_memory_small

v2: Expanded comment just before the reset, explaining that we need to
do the reset before we free the BO from the kernel (Iago)

Raising this assertion:
deqp-vk: ../src/broadcom/vulkan/v3dv_bo.c:281: v3dv_bo_alloc: Assertion `bo && bo->handle == 0' failed.

Fixes: 2c44597181 ('v3dv: fix debug dump on BO free')

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19693>
(cherry picked from commit ec1cdc13d5)
2022-11-17 14:05:04 +00:00
Iago Toral Quiroga
f100c77d0e v3dv: ignore imported BOs when tracking BO memory usage
Imported BOs are not allocated by the device so we don't
update BO stats when they are imported. Therefore, we should
not be updating them when they are freed either.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19675>
(cherry picked from commit f14e2ca099)
2022-11-17 14:05:04 +00:00
Qiang Yu
de5ebe433b ac/llvm: fix gfx11 fs input load for 16bit varying
Otherwise we get empty output.

Fixes: b07204d780 ("radeonsi/gfx11: interp changes for 16bit")
Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19637>
(cherry picked from commit 88b1bb326d)
2022-11-17 14:05:04 +00:00
Qiang Yu
5421dd52dd ac/nir/ngg: remove nuw for negative value add
Add negative value is possible to wrap around. I haven't seen this
"nuw" causes any problem yet, but let's remove it for safe.

Fixes: 60ac5dda82 ("ac: Add NIR lowering for NGG GS.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19718>
(cherry picked from commit c21e184cc5)
2022-11-17 14:05:04 +00:00
Qiang Yu
2a28762dff ac/nir/ngg: fix nogs culling with nuw add
We should not use "nuw" here as negative add positive may wrap
around (negative is 0xffffff??).

This problem can be observed with LLVM15 (I can't see when LLVM14):
  %.neg = mul nsw i32 %31, -4
  %163 = add nuw nsw i32 %.neg, 16
  %164 = lshr i32 257, %.neg
  %165 = lshr i32 %164, %163

LLVM just assume %.neg is possitive, so pre-shift 0x01010101 by 16.
This get wrong value because we can't get back the shifted bits with
a negative shift right.

Fixes: 75dbb40439 ("ac/nir: Remove byte permute from prefix sum of the repack sequence.")
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Signed-off-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19718>
(cherry picked from commit 982b523769)
2022-11-17 14:05:04 +00:00
Dave Airlie
ae63ea0631 gallivm: add coro malloc hooks earlier and always.
This fixes GALLIVM_DEBUG=asm for compute shaders, changing
the hooks after dumping causes a segfault because the
memory has already been finalised. Just add the hooks always,
and before dumping anything.

Fixes: f511d2a553 ("gallivm: rework coroutine malloc/free callouts.")
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19714>
(cherry picked from commit fb7de303ba)
2022-11-17 14:05:03 +00:00
Caio Oliveira
be102fede4 intel/compiler: Fix missing tie-breaker in brw_nir_analyze_ubo_ranges() ordering code
Per Ken suggestion, use ascending order for the start offset.

Fixes: 6d28c6e52c ("i965: Select ranges of UBO data to be uploaded as push constants.")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19731>
(cherry picked from commit 494e2edb90)
2022-11-17 14:05:03 +00:00
Caio Oliveira
6e4a46e2a8 intel/compiler: Fix dynarray usage in intel_clc
The code builds up the dynamic array of objects (spirv_objs) and
collect pointers to each of them into another dynamic
array (spirv_ptr_objs).

If the growth of the first array cause a reallocation, it is
possible that the previous pointers end up invalid.

Fixes: 77e929a527 ("intel/clc: allow multiple CL files to be compiled together")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19730>
(cherry picked from commit 9fd1d47aa0)
2022-11-17 14:05:03 +00:00
Samuel Pitoiset
5abbb4131d radv: enable lowering of subgroup shuffle in NIR on GFX11+
VGPR allocation changed on GFX11 and this might have changed how
shared VGPRs work, so it's probably more secure to lower in NIR.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19679>
(cherry picked from commit d255bc8f05)
2022-11-17 14:05:03 +00:00
Jason Ekstrand
84381034a7 vulkan: Unconditionally add barriers for missing external subpass deps
This is a very scorched-earth approach which doesn't take into account
whether or not there are any explicitly provided dependencies.  We could
take a finer-grained approach in theory but it's unlikely to matter in
practice since you usually stall in Begin/EndRenderPass anyway.

Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6203
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7650
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
(cherry picked from commit 11b2a063bf)
2022-11-17 14:05:03 +00:00
Jason Ekstrand
8747b27202 vulkan: Handle VK_SUBPASS_EXTERNAL at the end of a subpass
Fixes: 1d726940d2 ("vulkan: Add a common CmdBegin/EndRederPass implementation")
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19599>
(cherry picked from commit 4ff5051944)
2022-11-17 14:05:03 +00:00
Gert Wollny
c06dff600b r600/sfn: Fix f2u32 and remove backend lowring of f2u64 and f2i64
The two conversion ops are now handled in nir_lower_int64,
but the fixup for the input to f2u32 has to be handled there
and not in f2u64.

Fixes: 29da985682
   nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19707>
(cherry picked from commit fee0042157)
2022-11-17 14:05:03 +00:00
Gert Wollny
fcb0d2fa31 r600/sfn: Fix source modifiers for ffract64
Fixes: 79ca456b48
    r600/sfn: rewrite NIR backend

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19707>
(cherry picked from commit fd27b18631)
2022-11-17 14:05:03 +00:00
Lionel Landwerlin
97a017ed25 anv: bump pool bucket max allocation size
Age of Empire IV generates a shader of ~2.3Mb on DG2 which is above
the limit we currently have.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19669>
(cherry picked from commit ae76bba34a)
2022-11-17 14:05:03 +00:00
Yiwei Zhang
5824068393 venus: handle VK_QUERY_TYPE_PRIMITIVES_GENERATED_EXT
This change adds some docs for the query size, and has been tested with
dEQP-VK.transform_feedback.primitives_generated_query.* on supported
implementations.

Fixes: 8f7b5bf34b ("venus: add VK_EXT_primitives_generated_query support")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Juston Li <justonli@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19684>
(cherry picked from commit f7d7e558c9)
2022-11-17 14:05:03 +00:00
Lucas Stach
0bcf214da3 etnaviv: fix late Z with MSAA active
On RA_WRITE_DEPTH GPUs the RA stage needs to be told that MSAA is active
when the PE Z/S stage is needed. Not sure what it does exactly, but this
fixes broken late Z on those GPUs when performing MSAA rendering.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19571>
(cherry picked from commit 2f85d9095e)
2022-11-17 14:05:03 +00:00
Lucas Stach
aa63bf1834 etnaviv: update headers from rnndb
Update to etna_viv commit 6939cfeba30c.

Cc: 22.3 mesa-stable
Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19571>
(cherry picked from commit 804bf2eba2)
2022-11-17 14:05:03 +00:00
Timothy Arceri
18a8b0a122 nir: fix typo in lower_double options handling
Seems the intention was to check that both flags were not enabled
instead we were checking that the floor flag was both set and not
set so the result would always be false.

Fixes: 3749a6ecd2 ("nir: honor lower_double options for ffloor and ffract")

Reviewed-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19642>
(cherry picked from commit 34c52d8cb9)
2022-11-17 14:05:03 +00:00
Iago Toral Quiroga
f77567942a v3dv: fix debug dump on BO free
We were resetting the BO struct right before dumping its data. Fix
this by moving the reset later.

Fixes: 44fa8304d4 ('v3dv: add a refcount mechanism to BOs')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19672>
(cherry picked from commit 2c44597181)
2022-11-17 14:05:03 +00:00
noasakurajin
e0867504d1 disable zinks shader cache when the needed functions do not exist
Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
 Reviewed-by: Eric Engestrom <eric@igalia.com>

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19592>
(cherry picked from commit 7666988937)
2022-11-17 14:05:03 +00:00
Tapani Pälli
fc57b9ac44 anv: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>
(cherry picked from commit ecd4517560)
2022-11-17 14:05:03 +00:00
Tapani Pälli
61ad5a811f iris: setup stage bitmask for Wa_22011440098
Fixes: 40b66a4499 ("anv, iris: Add Wa_22011440098 for DG2")
Signed-off-by: Tapani Pälli <tapani.palli@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19636>
(cherry picked from commit 210d95bdb3)
2022-11-17 14:05:03 +00:00
Lionel Landwerlin
d7ca6ccee2 anv: split internal surface states from descriptors
On Intel HW we use the same mechanism for internal operations surfaces
as well as application surfaces (VkDescriptor).

This change splits the surface pool in 2, one part dedicated to
internal allocations, the other to application VkDescriptors.

To do so, the STATE_BASE_ADDRESS::SurfaceStateBaseAddress points to a
4Gb area, with the following layout :
   - 1Gb of binding table pool
   - 2Gb of internal surface states
   - 1Gb of bindless surface states

That way any entry from the binding table can refer to both internal &
bindless surface states but none of the driver allocations interfere
with the allocation of the application.

Based off a change from Sviatoslav Peleshko.

v2: Allocate image view null surface state from bindless heap (Sviatoslav)
    Removed debug stuff (Sviatoslav)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7110
Cc: mesa-stable
Tested-by: Sviatoslav Peleshko <sviatoslav.peleshko@globallogic.com>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19275>
(cherry picked from commit 4ceaed7839)
2022-11-17 14:05:03 +00:00
Gert Wollny
238c58e7d1 nir/algeraic_opt: use double options too for lowering ftrunc@64
ftrunc@64 also might need lowering on fp64 only, especially now
that it might be introduced by nir_lower_int64.

Fixes: 29da985682
   nir/lower_int64: Enable lowering of 64-bit float to 64-bit integer conversions.

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19657>
(cherry picked from commit 917d992b32)
2022-11-17 14:05:03 +00:00
Luis Felipe Strano Moraes
d9d4c97ca1 meson: only enable intel-clc for x86_64 builds
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19662>
(cherry picked from commit d983827a62)
2022-11-17 14:05:03 +00:00
Samuel Pitoiset
a90e68cb04 radv: re-emit NGG culling settings when conservative rast mode is dynamic
Found by inspection.

Fixes: fbed3aed4a ("radv: add support for dynamic conservative rasterization mode")
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Timur Kristóf <timur.kristof@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19651>
(cherry picked from commit 08b346e81a)
2022-11-17 14:05:02 +00:00
Yonggang Luo
782af9b02a meson: Fixes name_prefix for clover on mingw
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit 67627c84a7)
2022-11-17 14:05:02 +00:00
Yonggang Luo
e1415b0d5a clover: Fixes building with mingw-x86
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit f25d483e1b)
2022-11-17 14:05:02 +00:00
Yonggang Luo
e127adf5ec clover: Rename *OpenCL.def to *OpenCL.def.in
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit a3b26e2758)
2022-11-17 14:05:02 +00:00
Yonggang Luo
cf6a913796 meson: fixes mingw-clang32 building
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit ab20ec9da7)
2022-11-17 14:05:02 +00:00
Yonggang Luo
7db1912a2a meson: Refactoring shared gen_vs_module_defs_normal_command out
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit f03421702c)
2022-11-17 14:05:02 +00:00
Yonggang Luo
f68e25315f radv: Fixes prototypes
Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19610>
(cherry picked from commit e5656f07c7)
2022-11-17 14:05:02 +00:00
Dylan Baker
986a55f9ba util/glsl2spirv: fix appending extra flags
The variable is called `extra`, but what's written is `extra - flags`,
and `flags` is undefined, so if the variable was ever passed there would
be an uncaught exception.

fixes: 9786d9ef2a

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
(cherry picked from commit 4ffa8a9ac0)
2022-11-17 14:05:02 +00:00
Dylan Baker
aececb9c4e util/glsl2spirv: fix type error in argument handling
args.Olib is set to `store_true`, which means it will always be `True`
or `False`, this means that the we always, unconditionally, add
`--keep-uncalled` to the command line.

fixes: 9786d9ef2a

Reviewed-by: Luis Felipe Strano Moraes <luis.strano@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19449>
(cherry picked from commit 76e3b482be)
2022-11-17 14:05:02 +00:00
Emma Anholt
077e04bd86 ir3/ra: Make sure we don't pick a preferred reg overflowing the file.
If we're in handle_collect()'s dst allocation and are part of a merge set
near the end of the file, our check for reg_elem_size(reg) would let us
use the preferred reg when that would immediately lead to
allocate_dst_fixed() creating an interval extending thruogh reg_size(reg)
that overflows the file.

Avoids a regression on gfxbench5/gl_5_high_off/17.shader_test in the next
commit.  No change on shader-db.

Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18946>
(cherry picked from commit a39113b616)
2022-11-17 14:05:02 +00:00
Erik Faye-Lund
fd23e5b22e docs: fixup broken link syntax
Seems I got this slightly wrong when I fixed up the previous syntax
issue. Whoops, let's fix that!

Fixes: 6b3b633391 ("docs/zink: fix and cleanup rst syntax")
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19574>
(cherry picked from commit ef05d28aa2)
2022-11-17 14:05:02 +00:00
Lionel Landwerlin
91dfc02570 anv: fixup invalid enum for nir environment
Also switching away from PIPE_

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 8c4c4c3ee1 ("anv: Add softtp64 workaround")
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19638>
(cherry picked from commit 68fd9d2829)
2022-11-17 14:05:02 +00:00
Alyssa Rosenzweig
57e8d21fff panfrost: Require 64-byte alignment on imports
While Panfrost allocates linear images with strides that are a multiple of 64
bytes, other dma-buf producers on the system may not satisfy this requirement.
However, at least on v7 and newer, any image with a regular format must have a
stride that is a multiple of 64 bytes.

This fixes a real bug in an application that created a linear R8_UNORM image
with stride 480 bytes, imported it as an EGL_image, and then tried to texture
from it with the GPU. Previously, the driver allowed this situation but it
resulted in an imprecise fault from the GPU. This patch corrects the driver to
reject the import as invalid due to the unaligned stride, ensuring we never
attempt to texture from such a resource.

To implement, we add some new layout queries to centralize knowledge about the
stride alignment requirements, and we sprinkle in asserts to show how the
invariant is upheld throughout the lifecycle of image creation to texturing.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19620>
(cherry picked from commit 811f8a1946)
2022-11-17 14:05:02 +00:00
Karol Herbst
5f5821232a glsl: fix buffer texture type
Fixes: 3ace6b968b ("compiler/types: Add a texture type")
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19381>
(cherry picked from commit 87526f79db)
2022-11-17 14:05:02 +00:00
Samuel Pitoiset
0dad87e413 ac/nir: do not convert GS outputs to the expected variable size on GFX11
Outputs are always considered 32-bits.
Found by inspection.

Cc: 22.3 mesa-stable
Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Qiang Yu <yuq825@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19612>
(cherry picked from commit d2563e6600)
2022-11-17 14:05:02 +00:00
Timothy Arceri
674e20d1d0 mesa: fix typo from adding glGetObjectLabelEXT
Fixes: 	675bcbb7a1 ("mesa: add EXT_debug_label support")

Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19607>
(cherry picked from commit e295ee778b)
2022-11-17 14:05:02 +00:00
Eric Engestrom
dc7b34983e .pick_status.json: Update to 9bd11f6523 2022-11-17 14:04:58 +00:00
Eric Engestrom
38cb64bfe9 VERSION: bump for 22.3.0-rc2 2022-11-09 21:24:41 +00:00
Iago Toral Quiroga
80b0483ea9 broadcom/compiler: avoid using ldvary sequence to hide latency of branching
This can cause us to stomp the contents of r5 before we have a chance to read
it, like this:

0x3d103186bb800000 nop                           ; nop                         ; ldvary.r0
0x3d105686bbf40000 nop                           ; mov rf26, r5                ; ldvary.r1
0x020000ef0000d000 bu.allna  232, r:unif (0x0000001c / 0.000000)
0x3d1096c6bbf40000 nop                           ; mov rf27, r5                ; ldvary.r2

Here, the MOV in the last instruction is supposed to read r5 produced from
ldvary.r0, but because we have inserted the bu instruction in between now
that read happens at the same time that ldvary.r1 updates r5, stomping the
value we were supposed to read.

Fix this by disallowing injection of a branch instruction in between an ldvary
instruction and its write to the r5 register 2 instructions later.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7062
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19616>
(cherry picked from commit 1174f37609)
2022-11-09 21:22:06 +00:00
Jason Ekstrand
7701bf1228 intel: Don't cross DWORD boundaries with byte scratch load/store
The back-end swizzles dwords so that our indirect scratch messages match
the memory layout of spill/fill messages for better cache coherency.
The swizzle happens at a DWORD granularity.  If a read or write crosses
a DWORD boundary, the first bit will get correctly swizzled but whatever
piece lands in the next dword will not because the scatter instructions
assume sequential addresses for all bytes.  For DWORD writes, this is
handled naturally as part of scalarizing.  For smaller writes, we need
to be sure that a single write never escapes a dword.

Fixes: fd04f858b0 ("intel/nir: Don't try to emit vector load_scratch instructions")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7364
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
(cherry picked from commit 25c180b509)
2022-11-09 21:22:06 +00:00
Jason Ekstrand
d580ab8898 intel/lower_mem_access_bit_sizes: Compute alignments automatically
Because dup_mem_intrinsic() retains the SSA offset from the original
intrinsic and only modifies it by adding a constant, we can compute the
alignment based on the original alignment and the constant offset.  This
is both easier and more accurate.

Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19580>
(cherry picked from commit 85685cf932)
2022-11-09 21:22:06 +00:00
Mario Kleiner
dd860e4bb9 vulkan/wsi/display: Reset connector state in vkReleaseDisplay().
If an application was transitioning out of fullscreen exclusive
display mode, the wsi_display_connector->active state was not
reset in vkReleaseDisplay() from fullscreen. When the app then
later tried to go to fullscreen display mode again on the same
display output with the same video mode, this caused
_wsi_display_queue_next() to skip a required drmModeSetCrtc()
during the first vkQueuePresent() after entering direct display
mode.

While this often worked by pure luck on a single-display setup,
it goes sideways on a multi-display setup where the viewport
of the associated crtc does not have a (x,y) offset of (0,0).
E.g., XOrg/X11 RandR output leasing of an output whose viewport
starts at x = 1920:

1. X-Server has RandR outputs viewport at x = 1920, in a shared
   framebuffer, shared across all crtc's on a X-Screen.

2. Application leases that output for direct display mode,
   1st vkQueuePresent() triggers drmModeSetCrtc() of output
   to (x,y) = 0,0, as required for Vulkan/wsi/direct framebuffer
   setup.

3. Application does rendering and presenting.

4. Application vkReleaseDisplay() the output, terminates the
   RandR lease. X-Server takes over again.

5. X-Server modesets to reconfigure output back to viewport
   with (x,y) = 1920, 0.

6. Application leases same output again later on, and tries
   vkQueuePresent() again. Because of the bug fixed in this
   commit, the required drmModeSetCrtc() to (x,y) = 0,0 is
   erroneously skipped due to the stale cached connector state.

7. drmModePageflip() fails due to the wrong crtc viewport
   (x,y) = 1920, 0, mismatched for the need of the Vulkan
   framebuffer of (x,y) = 0,0. Kernel returns -ENOSPACE,
   Swapchain goes into permanent VK_ERROR_SURFACE_LOST state.
   Destroying and recreating the swapchain, as recommended
   by the Vulkan spec for error handling won't help. Game over!

Resetting wsi_display_connector->active = false; fixes the
problem of wrong / stale connector state and Vulkan/wsi/display
clients are happy on multi-display setups again, as tested
in various single- and multi-display configurations.

This bug affects all Mesa releases with Vulkan/WSI/Display
support and should therefore be backported.

Signed-off-by: Mario Kleiner <mario.kleiner.de@gmail.com>
Fixes: 352d320a07 ("vulkan: Add EXT_direct_mode_display [v2]")
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19484>
(cherry picked from commit 24094ee03d)
2022-11-09 21:22:06 +00:00
Alyssa Rosenzweig
6c24336ea4 panfrost: Copy resources when necessary
If the map doesn't set MAP_DISCARD_RANGE, we do have to copy the existing
contents over. MAP_WRITE on its only gives permission to replace the contents,
unfortunately it does not require that the application actually do so.

Closes: #7640
Fixes: 0b26a9f773 ("panfrost: Don't copy resources if replaced")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reported-by: Roman Elshin
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19576>
(cherry picked from commit cf7a3906b0)
2022-11-09 21:22:06 +00:00
Alyssa Rosenzweig
d812245daa panfrost: Fix build with Perfetto (again)
Sync UAPI for the upstream fix.

Upstream commit: https://cgit.freedesktop.org/drm-misc/commit/?h=drm-misc-fixes&id=c4299907c09a638c0a30f029338d07941c049d73

Closes: #7195
Fixes: 6a4532cbab ("panfrost: Sync panfrost_drm.h from drm-misc-next")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Tested-by: Chris Healy <healych@amazon.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19581>
(cherry picked from commit d40af87909)
2022-11-09 21:22:06 +00:00
Yonggang Luo
e56be98d93 ci: Fixes macos.yml
Stick to macos-11 to prevent accident broken
always install meson with pip to prevent pull new version of python

Cc: mesa-stable

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19615>
(cherry picked from commit 81b4af2849)
2022-11-09 21:22:06 +00:00
Caio Oliveira
f4a7f28608 nir: Don't reorder volatile intrinsics
Fixes issue with "is helper invocation" that in recent SPIR-V is mapped to
a volatile Load.  The CSE was catching the loads before they were transformed
in the new is_helper_invocation intrinsic (that is not reorderable).

Fixes: 729df14e45 ("nir: Handle volatile semantics for loading HelperInvocation builtin")
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: M Henning <drawoc@darkrefraction.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19432>
(cherry picked from commit 8ab628ab2e)
2022-11-09 21:22:06 +00:00
Lionel Landwerlin
e54150d6e1 anv: fix missing VkPhysicalDeviceExtendedDynamicState3PropertiesEXT handling
Fixes: 13c422e1b2 ("anv: toggle on EXT_extended_dynamic_state3")
Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19573>
(cherry picked from commit 97b3dd34c1)
2022-11-09 21:22:06 +00:00
Ian Romanick
87e7794d7b intel/fs: Fix constant propagation into 32x16 integer multiplication
Don't copy propagate the constant in situations like

    mov(8)          g8<1>D          0x7fffffffD
    mul(8)          g16<1>D         g8<8,8,1>D      g15<16,8,2>W

On platforms that only have a 32x16 multiplier, this will result in
lowering the multiply to

    mul(8)          g15<1>D         g14<8,8,1>D     0xffffUW
    mul(8)          g16<1>D         g14<8,8,1>D     0x7fffUW
    add(8)          g15.1<2>UW      g15.1<16,8,2>UW g16<16,8,2>UW

On Gfx8 and Gfx9, which have the full 32x32 multiplier, it results in

    mul(8)          g16<1>D         g15<16,8,2>W    0x7fffffffD

Volume 2a of the Skylake PRM says:

    When multiplying a DW and any lower precision integer, the
    DW operand must on src0.

See also https://gitlab.freedesktop.org/mesa/crucible/-/merge_requests/104.

Previous to INTEL_shader_integer_functions2 (in Vulkan or OpenGL), I
don't think it would be possible to create a situation where this could
occur.  I discovered this via some optimizations that can determine that
the non-constant source must be able to fit in 16-bits.  The case listed
above came from piglit's "ext_transform_feedback-order arrays points"
with those optimizations in place.

No shader-db or fossil-db changes on any Intel platform.

Fixes: de6c0f8487 ("intel/fs: Implement support for NIR opcodes for INTEL_shader_integer_functions2")
Reviewed-by: Caio Oliveira <caio.oliveira@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17718>
(cherry picked from commit db20412168)
2022-11-09 21:22:06 +00:00
Mauro Rossi
4eea1cb8cf Android.mk: Fix gnu++14 related build failures
This patch filters-out '-std=gnu++14' from the cflags obtained
from AOSP/KATI dummy target output to avoid the following building errors:

FAILED: src/gallium/drivers/r600/45f68e3@@r600@sta/sfn_sfn_assembler.cpp.o
...
clang++ ... -std=c++17 ... -std=gnu++14
...
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:56: error: no template named 'is_base_of_v' in namespace 'std'; did you mean 'is_base_of'?
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ~~~~~^~~~~~~~~~~~
                                                       is_base_of
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:1412:29: note: 'is_base_of' declared here
struct _LIBCPP_TEMPLATE_VIS is_base_of
                            ^
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.cpp:27:
In file included from ../src/gallium/drivers/r600/sfn/sfn_assembler.h:32:
In file included from ../src/gallium/drivers/r600/sfn/sfn_shader.h:31:
../src/gallium/drivers/r600/sfn/sfn_instr.h:369:51: error: template argument for non-type template parameter must be an expression
template <typename T, typename = std::enable_if_t<std::is_base_of_v<Instr, T>>>
                                                  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
/home/utente/pie-x86_kernel/external/libcxx/include/type_traits:439:16: note: template parameter is declared here
template <bool _Bp, class _Tp = void> using enable_if_t = typename enable_if<_Bp, _Tp>::type;
               ^
2 errors generated.

Cc: "22.2" "22.3" mesa-stable
Reviewed-by: Roman Stratiienko <r.stratiienko@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19563>
(cherry picked from commit fd8ec189e5)
2022-11-09 21:22:06 +00:00
Samuel Pitoiset
1391564493 ac/nir,radv: rework and fix NGG queries enables for VS/TES
XFB queries need to be enabled with NGG streamout and VS/TES.
Previously, the NGG lowering code relied on has_prim_query for XFB.

This fixes failures with RADV_PERFTEST=ngg_streamout on GFX10.3 with
the vkd3d-proton testsuite. Vulkan CTS is missing TES tests with XFB
queries apparently.

Cc: 22.3 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/19493>
(cherry picked from commit 505290dc44)
2022-11-09 21:22:06 +00:00
Samuel Pitoiset
935aaef351 radv: re-emit the guardband state when restoring meta operations
Meta operations change dynamic states like viewports and previously,
the guardband state was also always re-emitted because it relied on
dynamic viewport/scissor changes.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7577
Fixes: 40d8df7280 ("radv: emit the guardband state separately from the scissor state")
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/19521>
(cherry picked from commit 33d60bda9d)
2022-11-09 21:22:06 +00:00
Marek Vasut
19711e41c5 etnaviv: Use old set of state registers for PE configuration on GC880
While the GC880 is HALTI0, it still uses the old set of state registers
for PE pipe configuration. This is another specialty of the GC880, readd
the missing handling for this GPU otherwise e.g. Qt5 cube example suffers
from rendering corruption with both eglfs and wayland backends.

Fixes: 7c46a48836 ("etnaviv: use new PE pipe address states on >= HALTI0")
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Reviewed-by: Lucas Stach <l.stach@pengutronix.de>
Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19562>
(cherry picked from commit 20984aab0f)
2022-11-09 21:22:06 +00:00
Erik Faye-Lund
a23360cd0f docs/zink: fix and cleanup rst syntax
This new section didn't use the correct RST syntax, and ended up
with a broken section in the rendered docs.

Fix the syntax, and clean things up a bit to avoid overly long lines.

Fixes: be235edfe2 ("zink: add profile documentation")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19481>
(cherry picked from commit 6b3b633391)
2022-11-09 21:22:06 +00:00
Francisco Jerez
a7482cfa89 nir/lower_int64: Fix float16 to int64 conversions.
Currently float16 to int64 conversions don't work correctly, because
the "div" variable has an infinite value, since 2^32 isn't
representable as a 16-bit float, which causes the result of of rem(x,
div) to be NaN for all inputs, leading to an incorrect result.  Since
no values of magnitude greater than 2^32 are representable as a
float16 we don't actually need to do the fdiv/frem operations, the
conversion is equivalent to f2u32 with the result padded to 64 bits.

Rework:
 * Jordan: Handle f16 in if/else rather than conditional

Fixes: 936c58c8fc ("nir: Extend nir_lower_int64() to support i2f/f2i lowering")
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19391>
(cherry picked from commit e14f85366e)
2022-11-09 21:22:06 +00:00
Marek Olšák
f4fac39ded radeonsi/gfx11: fix compute scratch buffer - WAVES is always per SE
Fixes: ba02ed91a6 - ac/gfx11: fix the scratch buffer

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19477>
(cherry picked from commit bdfacd0a24)
2022-11-09 21:22:06 +00:00
Konstantin Seurer
7110d632c1 radv/rt: Restore prev barycentrics when rejecting hits
Closes: #6348
cc: mesa-stable

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19534>
(cherry picked from commit e5b3efe582)
2022-11-09 21:22:06 +00:00
Alex Brachet
7ba025d528 nir: Fix qsort comparator function
`pred` is a pointer, for sufficiently large numbers these
being cast to int were both > 0 regardless of the order
of `data1` and `data2`.

Fixes: 523a28d3fe ("nir: add an instruction set API")

Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19539>
(cherry picked from commit c987a727a7)
2022-11-09 21:22:06 +00:00
Samuel Pitoiset
c0c453e5ca radv: invalidate L2 instead of only writeback L2 when using DCC stores
It seems INV_L2 is the right thing to do, especially for RDNA2 chips
with non-coherent RBs (NAVI22 is one of these). This fixes DCC
corruption.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6476
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/7507
Cc: 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/19516>
(cherry picked from commit 06adf6ad11)
2022-11-09 21:22:05 +00:00
Samuel Pitoiset
68b469ba1a radv: make the GDS/GDS OA buffer objects resident
GDS is used for NGG queries/streamout (GFX10+ only) and the BOs were
only added to the graphics queue because compute doesn't need them.
Though, the kernel emits a GDS switch when a queue submission doesn't
use GDS. That means that submitting jobs on the compute queue without
GDS can reset the state of the graphics queue and lead to GPU hangs.

The only viable solution for now is to make the GDS BOs resident to
avoid resetting the state between queues. This shouldn't introduce
more syncs between queues because GDS BOs are similar for both.

This fixes a GPU hang with Warhammer Chaosbane during loading time and
possibly some spurious random GPU hangs. Note that this GPU hang was
workarounded on the Steam side with RADV_DEBUG=nongg.

Cc: 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/19466>
(cherry picked from commit 26c8fedc1b)
2022-11-09 21:22:05 +00:00
Martin Roukala (né Peres)
4acfc6a9be zink/ci: add another subtest to the list of known failures for radv
This test as a whole does not seem to work anywhere, even lavapipe, but
one particular subtest was passing until a recent change
(!19438 - zink: polygon mode fixes?).

After consideration by @kusma, it appears that the subtest was passing
by accident due to zink generating the wrong values. Given that this is
not something that users would ever experience as a regression, we
simply document this new failure along with all the others for this
test.

Fixes: 53721827ea ("zink: correct depth-bias enable condition")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Reviewed-by: Erik Faye-Lund <erik.faye-lund@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19517>
(cherry picked from commit d7ad9e7014)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
6b4e3cce45 v3dv: use vk_alloc instead of malloc
Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
(cherry picked from commit 22789d34be)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
29c6d79a5f v3dv: vkCmdWaitEvents2 takes an array of VkDependencyInfo
We have been incorrectly assuming there was just one for all the
events, apparently CTS never uses more than one event.

Fixes: e6884df088 ('v3dv: fix event synchronization')
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19518>
(cherry picked from commit 36ef75b6eb)
2022-11-09 21:22:05 +00:00
Martin Roukala (né Peres)
5a5c33ee95 zink/ci: mark another test as fixed after the frontend caching series
Just like on Lavapipe, Emma Anholt's !19124 also fixed the
restore-sso-program test on RADV.

Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19468>
(cherry picked from commit dc08875415)
2022-11-09 21:22:05 +00:00
Samuel Pitoiset
cdecc19acc radv: fix setting MIN_LOD for texture descriptors on GFX11
Found by inspection because the MIN_LOD bits were moved.

Cc: 22.3 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/19496>
(cherry picked from commit e891e84f4b)
2022-11-09 21:22:05 +00:00
Mauro Rossi
15aae04df5 hasvk: fix android build and reported API version
anv_device.c for vulkan.intel_hasvk requires changes to be compiled
and behave correctly for android target

Fixes the following building error:

FAILED: src/intel/vulkan_hasvk/libanv_hasvk_common.a.p/anv_device.c.o
...
../src/intel/vulkan_hasvk/anv_device.c:143:19: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
   *pApiVersion = ANV_API_VERSION_1_3;
                  ^
../src/intel/vulkan_hasvk/anv_device.c:1822:44: error: use of undeclared identifier 'ANV_API_VERSION_1_3'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                           ^
../src/intel/vulkan_hasvk/anv_device.c:1822:66: error: use of undeclared identifier 'ANV_API_VERSION_1_2'
      .apiVersion = pdevice->use_softpin ? ANV_API_VERSION_1_3 : ANV_API_VERSION_1_2,
                                                                 ^
3 errors generated.

Cc: "22.3" mesa-stable
Fixes: 00eefdc ("hasvk: stop advertising Vk 1.3 on non-softpin")
Reviewed-by: Tapani Pälli <tapani.palli@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19452>
(cherry picked from commit 814b822fe0)
2022-11-09 21:22:05 +00:00
Friedrich Vock
ab1a7fe377 radv: Use spirv1.5 instead of vulkan1.2
Ubuntu 20.04 ships a glslangValidator that doesn't know about vulkan1.2 yet.

Fixes: 27186537 ("radv: Add PLOC shader")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19479>
(cherry picked from commit 95ed033066)
2022-11-09 21:22:05 +00:00
Connor Abbott
d4a9ef1b21 tu: tu: Clear patchControlPoints dirty state with static patchControlPoints
Noticed by inspection after the previous issue.

Fixes: 68f3c38c80 ("tu: Implement extendedDynamicState2PatchControlPoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>
(cherry picked from commit 4466f9aa02)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
ebd65d011f v3dv: fix event synchronization
Since we now implement events in the GPU we need to be more careful
and insert barriers to honor the dependencies provided by the API
as well as ensuring we are synchronizing these with the compute
queue, since that is how we implement GPU event functionality.

Fixes: ecb01d53fd ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit e6884df088)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
614ae3ba0b v3dv: make the helper to emit pipeline barriers public to other files
Fixes: ecb01d53fd ("v3dv: refactor events")
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 8113f973b3)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
7331880ab4 v3dv: always check VK_ACCESS_2_MEMORY_READ_BIT for read accesses
Fixes: a981ac0539 ('v3dv: skip binning sync if binning shaders don't access external resources')

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 67e82fd1f2)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
7f3657fbe3 v3dv: increase limit for active event objects
Fixes: ecb01d53fd ("v3dv: refactor events")
Fixes: dEQP-VK.api.command_buffers.execute_large_primary

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 4c861cf22a)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
ef0210c517 v3dv: do better cleanup on failure during pipeline cache operation
Fixes (with disk cache enabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 5e97150e21)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
78b5a25430 v3dv: handle allocation failure during pipeline initialization
Fixes (with disk cache disabled):
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 1f5966397a)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
abedacb9c6 v3dv: fix incorrect return type
Fixes: ecb01d53fd ("v3dv: refactor events")

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit 7f905a8117)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
0f99923b54 v3dv: do a better job at cleaning up the device on init failure
These leaks on device creation failure have been there before, but
were only exposed as CTS failures after the recent event refactoring.

Partially fixes:
dEQP-VK.api.device_init.create_instance_device_intentional_alloc_fail.basic
dEQP-VK.api.object_management.alloc_callback_fail.device
dEQP-VK.api.object_management.alloc_callback_fail.device_group

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit b78fd50e90)
2022-11-09 21:22:05 +00:00
Eric Engestrom
424e3c10ce v3dv: avoid freeing already-freed memory
Fixes: ecb01d53fd ("v3dv: refactor events")
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit aff368fe83)
2022-11-09 21:22:05 +00:00
Iago Toral Quiroga
dea1b80747 v3dv: remove unnecessary check for NULL
We are initializing the device, so we know this will be NULL.

Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit c793d384c1)
2022-11-09 21:22:05 +00:00
Eric Engestrom
8ebbb2f04b vk/runtime: drop incorrect UNUSED annotation
Signed-off-by: Eric Engestrom <eric@engestrom.ch>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Alejandro Piñeiro <apinheiro@igalia.com>
cc: mesa-stable

Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19458>
(cherry picked from commit c6c5949ff7)
2022-11-09 21:22:05 +00:00
Samuel Pitoiset
d34e913aef radv: fix fallback for extreme geometry with tessellation on GFX11
It would assert anyways. Found by inspection.

Cc: 22.3 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/19495>
(cherry picked from commit fab87b0f41)
2022-11-09 21:22:05 +00:00
Lionel Landwerlin
32a7d9b892 anv: Reduce RHWO optimization (Wa_1508744258)
Implement Wa_1508744258:

   Disable RHWO by setting 0x7010[14] by default except during resolve
   pass.

Disable the RCC RHWO optimization at all times except when resolving
single sampled color surfaces.

v2: Move stalling to genX(cmd_buffer_apply_pipe_flushes) for clarity (Mark)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Mark Janes <markjanes@swizzler.org>
Reviewed-by: Jordan Justen <jordan.l.justen@intel.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19450>
(cherry picked from commit ba0336ab3f)
2022-11-09 21:22:05 +00:00
Bas Nieuwenhuizen
b4ba437ea7 radv: Make the compute scratch waves per SE as well.
Fixes: 278e533ec9 ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
(cherry picked from commit d876ddc920)
2022-11-09 21:22:05 +00:00
Bas Nieuwenhuizen
a6bf520407 radv: Fix compute scratch buffer emission.
Copied wrong from radeonsi. The registers following the scratch
buffer address are the shader rsrc1/rsrc2. Not the user SGPR0
containing the ring resource word 1.

Fixes: 278e533ec9 ("radv: update scratch buffer registers on GFX11")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19488>
(cherry picked from commit b8865ad046)
2022-11-09 21:22:05 +00:00
Karol Herbst
bf46cebc0c iris: invalidate sysvals if grid dimension changes
Cc: mesa-stable
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18581>
(cherry picked from commit 9ccdd86b90)
2022-11-09 21:22:05 +00:00
Yonggang Luo
cfa0a22315 glx: Fixes apple/apple_visual.c that include non-exist util/debug.h
Fixes: aa4ac5ff8b ("utils: Merge util/debug.* into util/u_debug.* and remove util/debug.*")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Illia Abernikhin <illia.abernikhin@globallogic.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19486>
(cherry picked from commit 287435134c)
2022-11-09 21:22:05 +00:00
Alyssa Rosenzweig
4be9ceb5b8 panfrost: Replace resource shadowing flush
The entire point of resource shadowing is to avoid unnecessary flushing.
Flushing readers after shadowing is counterproductive. A refresher on
how resource shadowing is supposed to work:

First, we determine if it's beneficial to shadow resources. If so, we
create a new backing buffer object. We flush the current writer of the
resource, if there is one, so the current contents become known to the
CPU. If we are not discarding the original resource, we then copy the
existing contents of the buffer to the new shadow buffer on the CPU.
Finally, we swap the resource's backing buffer for our shadow. Any batch
that reads the resource will continue to read the old copy of the
resource, and any future draw calls will see the new copy with the
change implemented.

Where did we go wrong?

In 988d5aae74 ("panfrost: Flush resources when shadowing"), we started
flushing all readers. We didn't actually need to flush, we just needed
to avoid dangling references on the batches reading the old copy of the
resource. But that's easily enough avoided: just remove the references.
The batches still hold a reference to the underlying BO, which will be
freed at the right time regardless.

Originally motivated by glmark2 -bbuffer:update-method=subdata, which
has some pathological access paterns.

Firefox is a lot faster anecdotally (now scrolling at 60fps in firefox).

But what actually motivated this is an apitrace from Duckstation's GLES
renderer. With this patch, the in-game portion is improved 3fps to 21fps.

Closes: #4028
Fixes: 988d5aae74 ("panfrost: Flush resources when shadowing")
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
(cherry picked from commit 2d8f28df73)
2022-11-09 21:22:05 +00:00
Alyssa Rosenzweig
ec5bc021fe panfrost: Don't copy resources if replaced
If a synchronized transfer_map is going to overwrite an entire resource,
there's no need to memcpy in the original contents ahead-of-time. This
memcpy is particularly bad for large buffers where it's copying WC->WC,
although that could be mitigated with threaded_context's cpu_storage in
the future if needed.

Prevents a performance regression in glmark2's buffer scenes from the
next patch, hence the Cc.

Cc: mesa-stable
Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19361>
(cherry picked from commit 0b26a9f773)
2022-11-09 21:22:05 +00:00
Eric Engestrom
76906af371 zink: add missing build_id linker args
Fixes: 4e14da056d ("zink: Enable mesa/st frontend shader caching.")
Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19485>
(cherry picked from commit dfa8600a2d)
2022-11-09 21:22:05 +00:00
Eric Engestrom
41de25b2f0 .pick_status.json: Update to 1174f37609 2022-11-09 21:21:58 +00:00
Eric Engestrom
f1beb9bfb3 VERSION: bump to 22.3.0-rc1 2022-11-02 19:48:31 +00:00
2532 changed files with 167071 additions and 713551 deletions

View File

@@ -8,7 +8,7 @@ charset = utf-8
insert_final_newline = true
tab_width = 8
[*.{c,h,cpp,hpp,cc,hh,y,yy}]
[*.{c,h,cpp,hpp,cc,hh}]
indent_style = space
indent_size = 3
max_line_length = 78

View File

@@ -26,7 +26,6 @@ jobs:
brew "libxcb"
brew "libxdamage"
brew "libxext"
brew "molten-vk"
brew "ninja"
brew "pkg-config"
brew "python@3.10"
@@ -42,7 +41,7 @@ jobs:
[binaries]
llvm-config = '/usr/local/opt/llvm/bin/llvm-config'
EOL
$MESON_EXEC . build --native-file=native_config -Dmoltenvk-dir=$(brew --prefix molten-vk) -Dbuild-tests=true -Dosmesa=true -Dgallium-drivers=swrast,zink -Dglx=${{ matrix.glx_option }}
$MESON_EXEC . build --native-file=native_config -Dbuild-tests=true -Dosmesa=true -Dgallium-drivers=swrast -Dglx=${{ matrix.glx_option }}
- name: Build
run: $MESON_EXEC compile -C build
- name: Test

1
.gitignore vendored
View File

@@ -1,4 +1,3 @@
.vscode*
*.pyc
*.pyo
*.out

View File

@@ -23,8 +23,6 @@ variables:
LIMA_FARM: "online"
IGALIA_FARM: "online"
ANHOLT_FARM: "online"
VALVE_FARM: "online"
AUSTRIANCODER_FARM: "online" # only etnaviv GPUs
default:
before_script:
@@ -55,7 +53,6 @@ include:
- project: 'freedesktop/ci-templates'
ref: *ci-templates-commit
file:
- '/templates/alpine.yml'
- '/templates/debian.yml'
- '/templates/fedora.yml'
- local: '.gitlab-ci/image-tags.yml'
@@ -130,24 +127,21 @@ stages:
.docs-base:
variables:
BUILDER: html
extends:
- .fdo.ci-fairy
- .build-rules
artifacts:
expose_as: 'Documentation preview'
paths:
- public/
script:
- apk --no-cache add graphviz doxygen
- pip3 install sphinx===5.1.1 breathe===4.34.0 mako===1.2.3 sphinx_rtd_theme===1.0.0
- docs/doxygen-wrapper.py --out-dir=docs/doxygen_xml
- sphinx-build -W -b $BUILDER docs public
- sphinx-build -W -b html docs public
pages:
extends: .docs-base
stage: deploy
artifacts:
paths:
- public
needs: []
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
@@ -176,24 +170,16 @@ test-docs-mr:
- test-docs
needs:
- sanity
artifacts:
expose_as: 'Documentation preview'
paths:
- public/
rules:
- if: *is-pre-merge
changes: *docs-or-ci
when: on_success
# Other cases default to never
lincheck-docs:
extends: .docs-base
# Cancel job if a newer commit is pushed to the same branch
interruptible: true
stage: deploy
needs: []
rules:
- !reference [.scheduled_pipeline-rules, rules]
allow_failure: true
variables:
BUILDER: linkcheck
# When to automatically run the CI for build jobs
.build-rules:
rules:

View File

@@ -52,7 +52,7 @@ deployment:
b2c.container="-ti --tls-verify=false docker://{{ '{{' }} fdo_proxy_registry }}/mupuf/valve-infra/machine_registration:latest check"
b2c.ntp_peer=10.42.0.1 b2c.pipefail b2c.cache_device=auto b2c.poweroff_delay={{ poweroff_delay }}
b2c.minio="gateway,{{ '{{' }} minio_url }},{{ '{{' }} job_bucket_access_key }},{{ '{{' }} job_bucket_secret_key }}"
b2c.volume="{{ '{{' }} job_bucket }}-results,mirror=gateway/{{ '{{' }} job_bucket }},pull_on=pipeline_start,push_on=changes,overwrite{% for excl in job_volume_exclusions %},exclude={{ excl }}{% endfor %},remove,expiration=pipeline_end,preserve"
b2c.volume="{{ '{{' }} job_bucket }}-results,mirror=gateway/{{ '{{' }} job_bucket }},pull_on=pipeline_start,push_on=changes,overwrite{% for excl in job_volume_exclusions %},exclude={{ excl }}{% endfor %},expiration=pipeline_end,preserve"
{% for volume in volumes %}
b2c.volume={{ volume }}
{% endfor %}

View File

@@ -92,12 +92,10 @@ if args.mount_volume is not None:
values['working_dir'] = args.working_dir
assert(len(args.local_container) > 0)
# Use the gateway's pull-through registry caches to reduce load on fd.o.
values['local_container'] = args.local_container
for url, replacement in [('registry.freedesktop.org', '{{ fdo_proxy_registry }}'),
('harbor.freedesktop.org', '{{ harbor_fdo_registry }}')]:
values['local_container'] = values['local_container'].replace(url, replacement)
values['local_container'] = args.local_container.replace(
# Use the gateway's pull-through registry cache to reduce load on fd.o.
'registry.freedesktop.org', '{{ fdo_proxy_registry }}'
)
if 'B2C_KERNEL_CMDLINE_EXTRAS' in environ:
values['cmdline_extras'] = environ['B2C_KERNEL_CMDLINE_EXTRAS']

View File

@@ -0,0 +1,26 @@
#!/bin/sh
# This test script groups together a bunch of fast dEQP variant runs
# to amortize the cost of rebooting the board.
set -ex
EXIT=0
# Run reset tests without parallelism:
if ! env \
DEQP_RESULTS_DIR=results/reset \
FDO_CI_CONCURRENT=1 \
DEQP_CASELIST_FILTER='.*reset.*' \
/install/deqp-runner.sh; then
EXIT=1
fi
# Then run everything else with parallelism:
if ! env \
DEQP_RESULTS_DIR=results/nonrobustness \
DEQP_CASELIST_INV_FILTER='.*reset.*' \
/install/deqp-runner.sh; then
EXIT=1
fi

View File

@@ -1 +0,0 @@
../bin/ci

View File

@@ -13,7 +13,6 @@ and show the job(s) logs.
import argparse
import re
from subprocess import check_output
import sys
import time
from concurrent.futures import ThreadPoolExecutor
@@ -215,7 +214,7 @@ def print_log(project, job_id) -> None:
job = project.jobs.get(job_id)
# GitLab's REST API doesn't offer pagination for logs, so we have to refetch it all
lines = job.trace().decode("raw_unicode_escape").splitlines()
lines = job.trace().decode("unicode_escape").splitlines()
for line in lines[printed_lines:]:
print(line)
printed_lines = len(lines)
@@ -236,7 +235,7 @@ def parse_args() -> None:
)
parser.add_argument("--target", metavar="target-job", help="Target job")
parser.add_argument(
"--rev", metavar="revision", help="repository git revision (default: HEAD)"
"--rev", metavar="revision", help="repository git revision", required=True
)
parser.add_argument(
"--token",
@@ -257,9 +256,6 @@ def find_dependencies(target_job: str, project_path: str, sha: str) -> set[str]:
)
target_dep_dag = filter_dag(dag, target_job)
if not target_dep_dag:
print(Fore.RED + "The job(s) were not found in the pipeline." + Fore.RESET)
sys.exit(1)
print(Fore.YELLOW)
print("Detected job dependencies:")
print()
@@ -276,23 +272,18 @@ if __name__ == "__main__":
token = read_token(args.token)
gl = gitlab.Gitlab(url="https://gitlab.freedesktop.org",
private_token=token,
retry_transient_errors=True)
gl = gitlab.Gitlab(url="https://gitlab.freedesktop.org", private_token=token)
cur_project = get_gitlab_project(gl, "mesa")
REV: str = args.rev
if not REV:
REV = check_output(['git', 'rev-parse', 'HEAD']).decode('ascii').strip()
print(f"Revision: {REV}")
pipe = wait_for_pipeline(cur_project, REV)
print(f"Revision: {args.rev}")
pipe = wait_for_pipeline(cur_project, args.rev)
print(f"Pipeline: {pipe.web_url}")
deps = set()
if args.target:
print("🞋 job: " + Fore.BLUE + args.target + Style.RESET_ALL)
deps = find_dependencies(
target_job=args.target, sha=REV, project_path=cur_project
target_job=args.target, sha=args.rev, project_path=cur_project
)
target_job_id, ret = monitor_pipeline(
cur_project, pipe, args.target, deps, args.force_manual, args.stress

View File

@@ -18,7 +18,6 @@ import sys
from ruamel.yaml import YAML
import gitlab
from colorama import Fore, Style
from gitlab_common import get_gitlab_project, read_token, wait_for_pipeline
@@ -38,8 +37,8 @@ def gather_results(
if target_jobs_regex.match(job.name) and job.status == "failed":
cur_job = project.jobs.get(job.id)
# get variables
print(f"👁 {job.name}...")
log: list[str] = cur_job.trace().decode("unicode_escape").splitlines()
print(f"👁 Looking through logs for the device variable and traces.yml file in {job.name}...")
log = cur_job.trace().decode("unicode_escape").splitlines()
filename: str = ''
dev_name: str = ''
for logline in log:
@@ -51,7 +50,7 @@ def gather_results(
dev_name = device_name.group(1)
if not filename or not dev_name:
print(Fore.RED + "Couldn't find device name or YML file in the logs!" + Style.RESET_ALL)
print("! Couldn't find device name or YML file in the logs!")
return
print(f"👁 Found {dev_name} and file {filename}")
@@ -84,20 +83,19 @@ def gather_results(
checksum: str = value['images'][0]['checksum_render']
if not checksum:
print(Fore.RED + f"{dev_name}: {trace}: checksum is missing! Crash?" + Style.RESET_ALL)
print(f"Trace {trace} checksum is missing! Abort.")
continue
if checksum == "error":
print(Fore.RED + f"{dev_name}: {trace}: crashed" + Style.RESET_ALL)
print(f"Trace {trace} crashed")
continue
if target['traces'][trace][dev_name].get('checksum') == checksum:
continue
if "label" in target['traces'][trace][dev_name]:
print(f'{dev_name}: {trace}: please verify that label {Fore.BLUE}{target["traces"][trace][dev_name]["label"]}{Style.RESET_ALL} is still valid')
print(f'{trace}: {dev_name}: has label: {target["traces"][trace][dev_name]["label"]}, is it still right?')
print(Fore.GREEN + f'{dev_name}: {trace}: checksum updated' + Style.RESET_ALL)
target['traces'][trace][dev_name]['checksum'] = checksum
with open(traces_file[0], 'w', encoding='utf-8') as target_file:

View File

@@ -183,8 +183,6 @@ debian-build-testing:
-D spirv-to-dxil=true
-D osmesa=true
-D tools=drm-shim,etnaviv,freedreno,glsl,intel,intel-ui,nir,nouveau,lima,panfrost,asahi
-D b_lto=true
LLVM_VERSION: 13
script:
- .gitlab-ci/lava/lava-pytest.sh
- .gitlab-ci/run-shellcheck.sh
@@ -226,44 +224,6 @@ debian-release:
script:
- .gitlab-ci/meson/build.sh
alpine-build-testing:
extends:
- .meson-build
- .use-alpine/x86_build
stage: build-x86_64
variables:
BUILDTYPE: "release"
C_ARGS: >
-Wno-error=cpp
-Wno-error=array-bounds
-Wno-error=stringop-overread
DRI_LOADERS: >
-D glx=disabled
-D gbm=enabled
-D egl=enabled
-D glvnd=false
-D platforms=wayland
LLVM_VERSION: ""
GALLIUM_DRIVERS: "crocus,etnaviv,freedreno,iris,kmsro,lima,nouveau,panfrost,r300,r600,radeonsi,svga,swrast,tegra,v3d,vc4,virgl,zink"
GALLIUM_ST: >
-D dri3=enabled
-D gallium-extra-hud=true
-D gallium-vdpau=disabled
-D gallium-omx=disabled
-D gallium-va=enabled
-D gallium-xa=disabled
-D gallium-nine=true
-D gallium-rusticl=false
-D gles1=disabled
-D gles2=enabled
-D llvm=enabled
-D microsoft-clc=disabled
-D shared-llvm=enabled
UNWIND: "disabled"
VULKAN_DRIVERS: "amd,broadcom,freedreno,intel,imagination-experimental"
script:
- .gitlab-ci/meson/build.sh
fedora-release:
extends:
- .meson-build
@@ -273,6 +233,9 @@ fedora-release:
C_ARGS: >
-Wno-error=array-bounds
-Wno-error=stringop-overread
-Wno-error=uninitialized
CPP_ARGS: >
-Wno-error=array-bounds
DRI_LOADERS: >
-D glx=dri
-D gbm=enabled
@@ -322,6 +285,9 @@ debian-android:
-Wno-error=initializer-overrides
-Wno-error=missing-braces
-Wno-error=sometimes-uninitialized
-Wno-error=unused-function
CPP_ARGS: >
-Wno-error=deprecated-declarations
DRI_LOADERS: >
-D glx=disabled
-D gbm=disabled
@@ -362,7 +328,7 @@ debian-android:
-D glx=dri
-D gbm=enabled
-D egl=enabled
-D platforms=x11,wayland
-D platforms=x11
-D osmesa=false
GALLIUM_ST: >
-D dri3=enabled
@@ -395,9 +361,6 @@ debian-armhf:
-D llvm=disabled
-D valgrind=false
MINIO_ARTIFACT_NAME: mesa-armhf
# The strip command segfaults, failing to strip the binary and leaving
# tempfiles in our artifacts.
ARTIFACTS_DEBUG_SYMBOLS: 1
script:
- .gitlab-ci/meson/build.sh
- .gitlab-ci/prepare-artifacts.sh
@@ -458,6 +421,7 @@ debian-clang:
-Wno-error=implicit-const-int-float-conversion
-Wno-error=overloaded-virtual
-Wno-error=tautological-constant-out-of-range-compare
-Wno-error=unused-const-variable
-Wno-error=unused-private-field
DRI_LOADERS: >
-D glx=dri

View File

@@ -28,6 +28,8 @@ for var in \
CROSVM_GALLIUM_DRIVER \
CROSVM_GPU_ARGS \
DEQP_BIN_DIR \
DEQP_CASELIST_FILTER \
DEQP_CASELIST_INV_FILTER \
DEQP_CONFIG \
DEQP_EXPECTED_RENDERER \
DEQP_FRACTION \
@@ -60,7 +62,6 @@ for var in \
HWCI_FREQ_MAX \
HWCI_KERNEL_MODULES \
HWCI_KVM \
HWCI_START_WESTON \
HWCI_START_XORG \
HWCI_TEST_SCRIPT \
IR3_SHADER_DEBUG \

View File

@@ -45,16 +45,6 @@ set -ex
echo -n $HWCI_KERNEL_MODULES | xargs -d, -n1 /usr/sbin/modprobe
}
# Set up ZRAM
HWCI_ZRAM_SIZE=2G
if zramctl --find --size $HWCI_ZRAM_SIZE -a zstd; then
mkswap /dev/zram0
swapon /dev/zram0
echo "zram: $HWCI_ZRAM_SIZE activated"
else
echo "zram: skipping, not supported"
fi
#
# Load the KVM module specific to the detected CPU virtualization extensions:
# - vmx for Intel VT
@@ -128,7 +118,6 @@ BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
if [ -n "$HWCI_START_XORG" ]; then
echo "touch /xorg-started; sleep 100000" > /xorg-script
env \
VK_ICD_FILENAMES=/install/share/vulkan/icd.d/${VK_DRIVER}_icd.`uname -m`.json \
xinit /bin/sh /xorg-script -- /usr/bin/Xorg -noreset -s 0 -dpms -logfile /Xorg.0.log &
BACKGROUND_PIDS="$! $BACKGROUND_PIDS"
@@ -142,21 +131,6 @@ if [ -n "$HWCI_START_XORG" ]; then
export DISPLAY=:0
fi
if [ -n "$HWCI_START_WESTON" ]; then
export XDG_RUNTIME_DIR=/run/user
mkdir -p $XDG_RUNTIME_DIR
# Xwayland to be used when HWCI_START_XORG is not set
export DISPLAY=:0
mkdir -p /tmp/.X11-unix
env \
VK_ICD_FILENAMES=/install/share/vulkan/icd.d/${VK_DRIVER}_icd.`uname -m`.json \
weston -Bheadless-backend.so --use-gl -Swayland-0 --xwayland &
export WAYLAND_DISPLAY=wayland-0
sleep 1
fi
RESULT=fail
set +e
sh -c "$HWCI_TEST_SCRIPT"

View File

@@ -1,70 +0,0 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -e
set -o xtrace
EPHEMERAL="
autoconf
automake
bzip2
cmake
git
libtool
libepoxy-dev
libtbb-dev
make
openssl-dev
unzip
wget
xz
zstd-dev
"
apk add \
bison \
ccache \
clang-dev \
flex \
gcc \
g++ \
gettext \
glslang \
linux-headers \
llvm15-dev \
meson \
expat-dev \
elfutils-dev \
libselinux-dev \
libva-dev \
libpciaccess-dev \
zlib-dev \
python3-dev \
py3-mako \
py3-ply \
vulkan-headers \
spirv-tools-dev \
util-macros \
$EPHEMERAL
. .gitlab-ci/container/container_pre_build.sh
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
pushd /usr/local
git clone https://gitlab.freedesktop.org/mesa/shader-db.git --depth 1
rm -rf shader-db/.git
cd shader-db
make
popd
############### Uninstall the build software
apk del $EPHEMERAL
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,12 +1,6 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n

View File

@@ -1,12 +1,6 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
# abootimg with a 'dummy' rootfs fails with root=/dev/nfs
CONFIG_BLK_DEV_INITRD=n
@@ -66,7 +60,6 @@ CONFIG_POWER_RESET_QCOM_PON=y
CONFIG_RTC_DRV_PM8XXX=y
CONFIG_INTERCONNECT=y
CONFIG_INTERCONNECT_QCOM=y
CONFIG_INTERCONNECT_QCOM_MSM8996=y
CONFIG_INTERCONNECT_QCOM_SDM845=y
CONFIG_INTERCONNECT_QCOM_MSM8916=y
CONFIG_INTERCONNECT_QCOM_OSM_L3=y
@@ -74,9 +67,6 @@ CONFIG_INTERCONNECT_QCOM_SC7180=y
CONFIG_CRYPTO_DEV_QCOM_RNG=y
CONFIG_SC_DISPCC_7180=y
CONFIG_SC_GPUCC_7180=y
CONFIG_QCOM_SPMI_ADC5=y
CONFIG_DRM_PARADE_PS8640=y
CONFIG_PHY_QCOM_USB_HS=y
# db410c ethernet
CONFIG_USB_RTL8152=y

View File

@@ -6,13 +6,13 @@ set -ex
git config --global user.email "mesa@example.com"
git config --global user.name "Mesa CI"
CROSVM_VERSION=504899212d626ecf42b1c459e5592891dde5bf91
CROSVM_VERSION=acd262cb42111c53b580a67355e795775545cced
git clone --single-branch -b main --no-checkout https://chromium.googlesource.com/crosvm/crosvm /platform/crosvm
pushd /platform/crosvm
git checkout "$CROSVM_VERSION"
git submodule update --init
VIRGLRENDERER_VERSION=3f2685355f71201f22b98c19aa778b43732c8435
VIRGLRENDERER_VERSION=3c5a9bbb7464e0e91e446991055300f4f989f6a9
rm -rf third_party/virglrenderer
git clone --single-branch -b master --no-checkout https://gitlab.freedesktop.org/virgl/virglrenderer.git third_party/virglrenderer
pushd third_party/virglrenderer

View File

@@ -16,7 +16,7 @@ if [ -n "${DEQP_RUNNER_GIT_TAG}${DEQP_RUNNER_GIT_REV}" ]; then
DEQP_RUNNER_CARGO_ARGS="${DEQP_RUNNER_CARGO_ARGS} ${EXTRA_CARGO_ARGS}"
else
# Install from package registry
DEQP_RUNNER_CARGO_ARGS="--version 0.16.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
DEQP_RUNNER_CARGO_ARGS="--version 0.15.0 ${EXTRA_CARGO_ARGS} -- deqp-runner"
fi
cargo install --locked \

View File

@@ -40,12 +40,6 @@ cmake -S /VK-GL-CTS -B . -G Ninja \
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-x11
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=wayland \
-DCMAKE_BUILD_TYPE=Release \
$EXTRA_CMAKE_ARGS
ninja modules/egl/deqp-egl
cp /deqp/modules/egl/deqp-egl /deqp/modules/egl/deqp-egl-wayland
cmake -S /VK-GL-CTS -B . -G Ninja \
-DDEQP_TARGET=${DEQP_TARGET:-x11_glx} \

View File

@@ -1,13 +1,12 @@
#!/usr/bin/env bash
#!/bin/bash
set -ex
MOLD_VERSION="1.9.0"
MOLD_VERSION="1.6.0"
git clone -b v"$MOLD_VERSION" --single-branch --depth 1 https://github.com/rui314/mold.git
pushd mold
cmake -DCMAKE_BUILD_TYPE=Release -D BUILD_TESTING=OFF -D MOLD_LTO=ON
cmake --build . --parallel
cmake --install .
popd
cd mold
make
make install
cd ..
rm -rf mold

View File

@@ -5,7 +5,12 @@ set -ex
git clone https://gitlab.freedesktop.org/mesa/piglit.git --single-branch --no-checkout /piglit
pushd /piglit
git checkout 1cd716180cfb6ef0c1fc54702460ef49e5115791
git checkout 591c91865012de4224bea551eac5d2274acf06ad
# TODO: Remove the following patch when piglit commit got past
# 1cd716180cfb6ef0c1fc54702460ef49e5115791
git apply $OLDPWD/.gitlab-ci/piglit/build-piglit_backport-s3-migration.diff
patch -p1 <$OLDPWD/.gitlab-ci/piglit/disable-vs_in.diff
cmake -S . -B . -G Ninja -DCMAKE_BUILD_TYPE=Release $PIGLIT_OPTS $EXTRA_CMAKE_ARGS
ninja $PIGLIT_BUILD_TARGETS

View File

@@ -2,7 +2,7 @@
set -ex
VKD3D_PROTON_COMMIT="804751ee1cb108a2ec59e182ce0c052bafef268e"
VKD3D_PROTON_COMMIT="5b73139f182d86cd58a757e4b5f0d4cfad96d319"
VKD3D_PROTON_DST_DIR="/vkd3d-proton-tests"
VKD3D_PROTON_SRC_DIR="/vkd3d-proton-src"

View File

@@ -1,5 +1,4 @@
#!/bin/bash
# shellcheck disable=SC2086 # we want word splitting
set -ex
@@ -9,7 +8,7 @@ export WAYLAND_PROTOCOLS_VERSION="1.24"
git clone https://gitlab.freedesktop.org/wayland/wayland
cd wayland
git checkout "$LIBWAYLAND_VERSION"
meson -Ddocumentation=false -Ddtd_validation=false -Dlibraries=true _build $EXTRA_MESON_ARGS
meson -Ddocumentation=false -Ddtd_validation=false -Dlibraries=true _build
ninja -C _build install
cd ..
rm -rf wayland
@@ -17,7 +16,7 @@ rm -rf wayland
git clone https://gitlab.freedesktop.org/wayland/wayland-protocols
cd wayland-protocols
git checkout "$WAYLAND_PROTOCOLS_VERSION"
meson _build $EXTRA_MESON_ARGS
meson _build
ninja -C _build install
cd ..
rm -rf wayland-protocols

View File

@@ -2,8 +2,6 @@
if test -f /etc/debian_version; then
CCACHE_PATH=/usr/lib/ccache
elif test -f /etc/alpine-release; then
CCACHE_PATH=/usr/lib/ccache/bin
else
CCACHE_PATH=/usr/lib64/ccache
fi
@@ -45,6 +43,4 @@ export MAKEFLAGS="-j${FDO_CI_CONCURRENT:-4}"
echo -e "retry_connrefused = on\n" \
"read_timeout = 300\n" \
"tries = 4\n" \
"retry_on_host_error = on\n" \
"retry_on_http_error = 429,500,502,503,504\n" \
"wait_retry = 32" >> /etc/wgetrc

View File

@@ -2,18 +2,19 @@
arch=$1
cross_file="/cross_file-$arch.txt"
meson env2mfile --cross --debarch "$arch" -o "$cross_file"
/usr/share/meson/debcrossgen --arch "$arch" -o "$cross_file"
# Explicitly set ccache path for cross compilers
sed -i "s|/usr/bin/\([^-]*\)-linux-gnu\([^-]*\)-g|/usr/lib/ccache/\\1-linux-gnu\\2-g|g" "$cross_file"
if [ "$arch" = "i386" ]; then
# Work around a bug in debcrossgen that should be fixed in the next release
sed -i "s|cpu_family = 'i686'|cpu_family = 'x86'|g" "$cross_file"
fi
# Rely on qemu-user being configured in binfmt_misc on the host
# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
sed -i -e '/\[properties\]/a\' -e "needs_exe_wrapper = False" "$cross_file"
# Add a line for rustc, which meson env2mfile is missing.
cc=$(sed -n "s|^c\s*=\s*\[?'\(.*\)'\]?|\1|p" < "$cross_file")
# Add a line for rustc, which debcrossgen is missing.
cc=$(sed -n 's|c = .\(.*\).|\1|p' < "$cross_file")
if [[ "$arch" = "arm64" ]]; then
rust_target=aarch64-unknown-linux-gnu
elif [[ "$arch" = "armhf" ]]; then
@@ -27,7 +28,6 @@ elif [[ "$arch" = "s390x" ]]; then
else
echo "Needs rustc target mapping"
fi
# shellcheck disable=SC1003 # how this sed doesn't seems to work for me locally
sed -i -e '/\[binaries\]/a\' -e "rust = ['rustc', '--target=$rust_target', '-C', 'linker=$cc']" "$cross_file"

View File

@@ -102,11 +102,9 @@ apt-get -y install --no-install-recommends \
sntp \
strace \
waffle-utils \
weston \
wget \
xinit \
xserver-xorg-core \
xwayland \
zstd

View File

@@ -18,7 +18,6 @@ apt-get install -y --no-remove \
crossbuild-essential-$arch \
libelf-dev:$arch \
libexpat1-dev:$arch \
libffi-dev:$arch \
libpciaccess-dev:$arch \
libstdc++6:$arch \
libvulkan-dev:$arch \
@@ -36,7 +35,6 @@ apt-get install -y --no-remove \
libxrandr-dev:$arch \
libxshmfence-dev:$arch \
libxxf86vm-dev:$arch \
libwayland-dev:$arch \
wget
if [[ $arch != "armhf" ]]; then
@@ -52,6 +50,7 @@ if [[ $arch != "armhf" ]]; then
# around this.
apt-get install -y --no-remove --no-install-recommends \
libclang-cpp${LLVM}:$arch \
libffi-dev:$arch \
libgcc-s1:$arch \
libtinfo-dev:$arch \
libz3-dev:$arch \
@@ -69,8 +68,6 @@ fi
EXTRA_MESON_ARGS="--cross-file=/cross_file-${arch}.txt -D libdir=lib/$(dpkg-architecture -A $arch -qDEB_TARGET_MULTIARCH)"
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y \
$STABLE_EPHEMERAL

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
set -e
arch=arm64 . .gitlab-ci/container/debian/arm_test.sh

View File

@@ -50,9 +50,8 @@ apt-get -y install \
libxrandr-dev \
libxshmfence-dev \
libxxf86vm-dev \
libwayland-dev \
llvm-11-dev \
ninja-build \
meson \
pkg-config \
python3-mako \
python3-pil \
@@ -71,9 +70,6 @@ apt-get install -y --no-remove -t buster \
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# We need at least 0.61.4 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==0.63.3
arch=armhf
. .gitlab-ci/container/cross_build.sh
@@ -85,8 +81,6 @@ arch=armhf
EXTRA_MESON_ARGS=
. .gitlab-ci/container/build-libdrm.sh
. .gitlab-ci/container/build-wayland.sh
apt-get purge -y $STABLE_EPHEMERAL
. .gitlab-ci/container/container_post_build.sh

View File

@@ -1,5 +1,4 @@
#!/bin/bash
# shellcheck disable=SC2154 # arch is assigned in previous scripts
set -e
set -o xtrace
@@ -26,13 +25,12 @@ apt-get install -y --no-remove \
wget https://raw.githubusercontent.com/net-snmp/net-snmp/master/mibs/SNMPv2-SMI.txt \
-O /usr/share/snmp/mibs/SNMPv2-SMI.txt
. .gitlab-ci/container/baremetal_build.sh
arch=arm64 . .gitlab-ci/container/baremetal_build.sh
arch=armhf . .gitlab-ci/container/baremetal_build.sh
if [[ "$arch" == "arm64" ]]; then
# This firmware file from Debian bullseye causes hangs
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a530_pfp.fw?id=d5f9eea5a251d43412b07f5295d03e97b89ac4a5 \
-O /rootfs-arm64/lib/firmware/qcom/a530_pfp.fw
fi
# This firmware file from Debian bullseye causes hangs
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/qcom/a530_pfp.fw?id=d5f9eea5a251d43412b07f5295d03e97b89ac4a5 \
-O /rootfs-arm64/lib/firmware/qcom/a530_pfp.fw
mkdir -p /baremetal-files/jetson-nano/boot/
ln -s \

View File

@@ -1,5 +0,0 @@
#!/usr/bin/env bash
set -e
arch=armhf . .gitlab-ci/container/debian/arm_test.sh

View File

@@ -59,7 +59,7 @@ apt-get install -y --no-remove \
libxshmfence-dev \
libxxf86vm-dev \
make \
ninja-build \
meson \
pkg-config \
python3-mako \
python3-pil \
@@ -78,8 +78,8 @@ apt-get install -y --no-remove \
# Needed for ci-fairy, this revision is able to upload files to MinIO
pip3 install git+http://gitlab.freedesktop.org/freedesktop/ci-templates@ffe4d1b10aab7534489f0c4bbc4c5899df17d3f2
# We need at least 1.0.0 for proper Rust; 0.62 for modern meson env2mfile
pip3 install meson==1.0.0
# We need at least 0.61.4 for proper Rust
pip3 install meson==0.61.5
. .gitlab-ci/container/build-rust.sh

View File

@@ -27,8 +27,9 @@ popd
# Building libva
git clone https://github.com/intel/libva
pushd libva/
# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0)
git checkout 2.17.0
# Checking out commit hash with libva-win32 support
# This feature will be released with libva version 2.17
git checkout 2579eb0f77897dc01a02c1e43defc63c40fd2988
popd
# libva already has a build dir in their repo, use builddir instead
mkdir -p libva/builddir

View File

@@ -92,7 +92,7 @@ ninja install
popd
rm -rf DirectX-Headers
pip3 install lavacli==1.5.2
pip3 install git+https://git.lavasoftware.org/lava/lavacli@3db3ddc45e5358908bc6a17448059ea2340492b7
# install bindgen
RUSTFLAGS='-L native=/usr/local/lib' cargo install \

View File

@@ -25,7 +25,6 @@ STABLE_EPHEMERAL=" \
libudev-dev \
libvulkan-dev \
libwaffle-dev \
libwayland-dev \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
@@ -60,8 +59,7 @@ apt-get install -y --no-remove \
python3-lxml \
python3-renderdoc \
python3-simplejson \
spirv-tools \
weston
spirv-tools
. .gitlab-ci/container/container_pre_build.sh

View File

@@ -45,6 +45,7 @@ STABLE_EPHEMERAL=" \
python3-setuptools \
python3-wheel \
software-properties-common \
wget \
wine64-tools \
xz-utils \
"
@@ -56,7 +57,6 @@ apt-get install -y --no-remove --no-install-recommends \
pciutils \
python3-lxml \
python3-simplejson \
wget \
xinit \
xserver-xorg-video-amdgpu \
xserver-xorg-video-ati
@@ -66,6 +66,10 @@ apt-key add .gitlab-ci/container/debian/winehq.gpg.key
apt-add-repository https://dl.winehq.org/wine-builds/debian/
apt-get update -q
# Needed for Valve's tracing jobs to collect information about the graphics
# hardware on the test devices.
pip3 install gfxinfo-mupuf==0.0.9
# workaround wine needing 32-bit
# https://bugs.winehq.org/show_bug.cgi?id=53393
apt-get install -y --no-remove wine-stable-amd64 # a requirement for wine-stable

View File

@@ -31,6 +31,7 @@ dnf install -y --setopt=install_weak_deps=False \
glslang \
kernel-headers \
llvm-devel \
clang-devel \
meson \
"pkgconfig(dri2proto)" \
"pkgconfig(expat)" \
@@ -64,6 +65,8 @@ dnf install -y --setopt=install_weak_deps=False \
python-unversioned-command \
python3-devel \
python3-mako \
python3-devel \
python3-mako \
python3-ply \
vulkan-headers \
spirv-tools-devel \

View File

@@ -189,7 +189,7 @@ debian/android_build:
debian/x86_test-base:
extends: debian/x86_build-base
variables:
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v6.0-for-mesa-ci-93bd820c433b/linux-v6.0-for-mesa-ci-93bd820c433b.tar.bz2"
KERNEL_URL: &kernel-rootfs-url "https://gitlab.freedesktop.org/gfx-ci/linux/-/archive/v5.19-for-mesa-ci-d4efddaec194/linux-v5.17-for-mesa-ci-b78f7870d97b.tar.bz2"
MESA_IMAGE_TAG: &debian-x86_test-base ${DEBIAN_BASE_TAG}
.use-debian/x86_test-base:
@@ -213,7 +213,7 @@ debian/x86_test-gl:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_GL_PATH}
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_PATH}
MESA_IMAGE_TAG: *debian-x86_test-gl
needs:
- debian/x86_test-gl
@@ -229,7 +229,7 @@ debian/x86_test-vk:
- .set-image-base-tag
variables:
MESA_BASE_TAG: *debian-x86_test-base
MESA_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_VK_PATH}
MESA_IMAGE_PATH: "debian/x86_test-vk"
MESA_IMAGE_TAG: *debian-x86_test-vk
needs:
- debian/x86_test-vk
@@ -255,24 +255,6 @@ debian/arm_build:
- debian/arm_build
# Alpine based x86 build image
alpine/x86_build:
extends:
- .fdo.container-build@alpine
- .container
variables:
FDO_DISTRIBUTION_VERSION: "3.16"
MESA_IMAGE_TAG: &alpine-x86_build ${ALPINE_X86_BUILD_TAG}
.use-alpine/x86_build:
extends:
- .set-image
variables:
MESA_IMAGE_PATH: "alpine/x86_build"
MESA_IMAGE_TAG: *alpine-x86_build
needs:
- alpine/x86_build
# Fedora 34 based x86 build image
fedora/x86_build:
extends:
@@ -340,56 +322,30 @@ kernel+rootfs_armhf:
MESA_ROOTFS_TAG: *kernel-rootfs
# x86 image with ARM64 & armhf kernel & rootfs for baremetal testing
.debian/arm_test:
debian/arm_test:
extends:
- .fdo.container-build@debian
- .container
# Don't want the .container rules
- .build-rules
variables:
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
ARTIFACTS_PREFIX: "https://${MINIO_HOST}/mesa-lava"
ARTIFACTS_SUFFIX: "${MESA_ROOTFS_TAG}--${MESA_ARTIFACTS_TAG}--${MESA_TEMPLATES_COMMIT}"
MESA_ARTIFACTS_TAG: *debian-arm_build
MESA_ROOTFS_TAG: *kernel-rootfs
debian/armhf_test:
extends:
- .debian/arm_test
needs:
- kernel+rootfs_armhf
variables:
MESA_IMAGE_TAG: &debian-armhf_test ${DEBIAN_BASE_TAG}
debian/arm64_test:
extends:
- .debian/arm_test
needs:
- kernel+rootfs_arm64
- kernel+rootfs_armhf
variables:
MESA_IMAGE_TAG: &debian-arm64_test ${DEBIAN_BASE_TAG}
.use-debian/arm_test:
variables:
FDO_DISTRIBUTION_TAG: "${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
ARTIFACTS_PREFIX: "https://${MINIO_HOST}/mesa-lava"
ARTIFACTS_SUFFIX: "${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
MESA_ARM_BUILD_TAG: *debian-arm_build
MESA_IMAGE_TAG: &debian-arm_test ${DEBIAN_BASE_TAG}
MESA_ROOTFS_TAG: *kernel-rootfs
.use-debian/armhf_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
.use-debian/arm_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_ARM_BUILD_TAG}--${MESA_TEMPLATES_COMMIT}"
variables:
MESA_IMAGE_PATH: "debian/armhf_test"
MESA_IMAGE_TAG: *debian-armhf_test
needs:
- debian/arm_test
.use-debian/arm64_test:
image: "$CI_REGISTRY_IMAGE/${MESA_IMAGE_PATH}:${MESA_IMAGE_TAG}--${MESA_ROOTFS_TAG}--${MESA_TEMPLATES_COMMIT}"
extends:
- .use-debian/arm_test
variables:
MESA_IMAGE_PATH: "debian/arm64_test"
MESA_IMAGE_TAG: *debian-arm64_test
MESA_ARM_BUILD_TAG: *debian-arm_build
MESA_IMAGE_PATH: "debian/arm_test"
MESA_IMAGE_TAG: *debian-arm_test
MESA_ROOTFS_TAG: *kernel-rootfs
needs:
- debian/arm_test

View File

@@ -40,7 +40,6 @@ if [[ "$DEBIAN_ARCH" = "arm64" ]]; then
DEVICE_TREES+=" arch/arm64/boot/dts/mediatek/mt8183-kukui-jacuzzi-juniper-sku16.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/nvidia/tegra210-p3450-0000.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-lazor-limozeen-nots-r5.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/qcom/sc7180-trogdor-kingoftown-r1.dtb"
DEVICE_TREES+=" arch/arm64/boot/dts/freescale/imx8mq-nitrogen.dtb"
KERNEL_IMAGE_NAME="Image"
@@ -110,7 +109,6 @@ apt-get install -y --no-remove \
libx11-xcb-dev \
libxcb-dri2-0-dev \
libxkbcommon-dev \
libwayland-dev \
ninja-build \
patch \
protobuf-compiler \
@@ -200,8 +198,6 @@ if [[ ${DEBIAN_ARCH} = "amd64" ]]; then
. .gitlab-ci/container/build-crosvm.sh
mv /usr/local/bin/crosvm /lava-files/rootfs-${DEBIAN_ARCH}/usr/bin/
mv /usr/local/lib/$GCC_ARCH/libvirglrenderer.* /lava-files/rootfs-${DEBIAN_ARCH}/usr/lib/$GCC_ARCH/
mkdir -p /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/
mv /usr/local/libexec/virgl* /lava-files/rootfs-${DEBIAN_ARCH}/usr/local/libexec/
fi
############### Build libdrm
@@ -244,7 +240,6 @@ cp .gitlab-ci/container/debian/winehq.gpg.key /lava-files/rootfs-${DEBIAN_ARCH}/
chroot /lava-files/rootfs-${DEBIAN_ARCH} sh /create-rootfs.sh
rm /lava-files/rootfs-${DEBIAN_ARCH}/{llvm-snapshot,winehq}.gpg.key
rm /lava-files/rootfs-${DEBIAN_ARCH}/create-rootfs.sh
cp /etc/wgetrc /lava-files/rootfs-${DEBIAN_ARCH}/etc/.
############### Install the built libdrm

View File

@@ -1,12 +1,6 @@
CONFIG_LOCALVERSION_AUTO=y
CONFIG_DEBUG_KERNEL=y
CONFIG_CRYPTO_ZSTD=y
CONFIG_ZRAM_MEMORY_TRACKING=y
CONFIG_ZRAM_WRITEBACK=y
CONFIG_ZRAM=y
CONFIG_ZSMALLOC_STAT=y
CONFIG_PWM=y
CONFIG_PM_DEVFREQ=y
CONFIG_OF=y

View File

@@ -96,8 +96,7 @@ LIBGL_ALWAYS_SOFTWARE=${CROSVM_LIBGL_ALWAYS_SOFTWARE} \
GALLIUM_DRIVER=${CROSVM_GALLIUM_DRIVER} \
VK_ICD_FILENAMES=$CI_PROJECT_DIR/install/share/vulkan/icd.d/${CROSVM_VK_DRIVER}_icd.x86_64.json \
crosvm --no-syslog run \
--gpu "${CROSVM_GPU_ARGS}" --gpu-render-server "path=/usr/local/libexec/virgl_render_server" \
-m "${CROSVM_MEMORY:-4096}" -c 2 --disable-sandbox \
--gpu "${CROSVM_GPU_ARGS}" -m "${CROSVM_MEMORY:-4096}" -c 2 --disable-sandbox \
--shared-dir /:my_root:type=fs:writeback=true:timeout=60:cache=always \
--host-ip "192.168.30.1" --netmask "255.255.255.0" --mac "AA:BB:CC:00:00:12" \
-s $VM_SOCKET \

View File

@@ -18,7 +18,6 @@ INSTALL=`pwd`/install
export LD_LIBRARY_PATH=`pwd`/install/lib/
export EGL_PLATFORM=surfaceless
export VK_ICD_FILENAMES=`pwd`/install/share/vulkan/icd.d/"$VK_DRIVER"_icd.${VK_CPU:-`uname -m`}.json
export OCL_ICD_VENDORS=`pwd`/install/etc/OpenCL/vendors/
RESULTS=`pwd`/${DEQP_RESULTS_DIR:-results}
mkdir -p $RESULTS
@@ -86,6 +85,14 @@ if [ -z "$DEQP_SUITE" ]; then
sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
fi
if [ -n "$DEQP_CASELIST_FILTER" ]; then
sed -ni "/$DEQP_CASELIST_FILTER/p" /tmp/case-list.txt
fi
if [ -n "$DEQP_CASELIST_INV_FILTER" ]; then
sed -ni "/$DEQP_CASELIST_INV_FILTER/!p" /tmp/case-list.txt
fi
if [ ! -s /tmp/case-list.txt ]; then
echo "Caselist generation failed"
exit 1

View File

@@ -1,31 +1,27 @@
variables:
DEBIAN_X86_BUILD_BASE_IMAGE: "debian/x86_build-base"
DEBIAN_BASE_TAG: "2023-01-31-rust-valgrind-23-stable"
DEBIAN_BASE_TAG: "2022-11-15-ci-fairy"
DEBIAN_X86_BUILD_IMAGE_PATH: "debian/x86_build"
DEBIAN_BUILD_TAG: "2023-01-09-lavacli"
DEBIAN_BUILD_TAG: "2022-11-15-ci-fairy"
DEBIAN_X86_BUILD_MINGW_IMAGE_PATH: "debian/x86_build-mingw"
DEBIAN_BUILD_MINGW_TAG: "2023-01-03-ci-libva-2.17"
DEBIAN_BUILD_MINGW_TAG: "2022-10-18-dx-headers-va"
DEBIAN_X86_TEST_BASE_IMAGE: "debian/x86_test-base"
DEBIAN_X86_TEST_IMAGE_GL_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_IMAGE_VK_PATH: "debian/x86_test-vk"
DEBIAN_X86_TEST_IMAGE_PATH: ${DEBIAN_X86_TEST_IMAGE_GL_PATH}
DEBIAN_X86_TEST_IMAGE_PATH: "debian/x86_test-gl"
DEBIAN_X86_TEST_GL_TAG: "2022-11-15-ci-fairy"
DEBIAN_X86_TEST_VK_TAG: "2022-11-15-ci-fairy"
DEBIAN_X86_TEST_GL_TAG: "2023-01-08-weston-xwayland"
DEBIAN_X86_TEST_VK_TAG: "2022-12-12-vkd3d-proton-uprev"
ALPINE_X86_BUILD_TAG: "2023-01-10-robust-wget"
FEDORA_X86_BUILD_TAG: "2023-01-10-robust-wget"
KERNEL_ROOTFS_TAG: "2023-01-10-virglrenderer"
FEDORA_X86_BUILD_TAG: "2022-09-22-python3-ply-2"
KERNEL_ROOTFS_TAG: "2022-11-03-piglit_mesa-22.3"
WINDOWS_X64_VS_PATH: "windows/x64_vs"
WINDOWS_X64_VS_TAG: "2022-10-20-upgrade-zlib"
WINDOWS_X64_BUILD_PATH: "windows/x64_build"
WINDOWS_X64_BUILD_TAG: "2023-01-03-ci-libva-2.17"
WINDOWS_X64_BUILD_TAG: "2022-10-18-wrap-nodownload-va"
WINDOWS_X64_TEST_PATH: "windows/x64_test"
WINDOWS_X64_TEST_TAG: "2023-01-03-piglit-waffle"
WINDOWS_X64_TEST_TAG: "2022-08-17-bump"

View File

@@ -20,11 +20,11 @@ import traceback
import urllib.parse
import xmlrpc.client
from datetime import datetime, timedelta
from io import StringIO
from os import getenv
from typing import Any, Optional
import lavacli
import yaml
from lava.exceptions import (
MesaCIException,
MesaCIKnownIssueException,
@@ -42,7 +42,7 @@ from lava.utils import (
hide_sensitive_data,
print_log,
)
from lavacli.utils import flow_yaml as lava_yaml
from lavacli.utils import loader
# Timeout in seconds to decide if the device from the dispatched LAVA job has
# hung or not due to the lack of new log output.
@@ -62,7 +62,7 @@ NUMBER_OF_RETRIES_TIMEOUT_DETECTION = int(getenv("LAVA_NUMBER_OF_RETRIES_TIMEOUT
NUMBER_OF_ATTEMPTS_LAVA_BOOT = int(getenv("LAVA_NUMBER_OF_ATTEMPTS_LAVA_BOOT", 3))
def generate_lava_yaml_payload(args) -> dict[str, Any]:
def generate_lava_yaml(args):
# General metadata and permissions, plus also inexplicably kernel arguments
values = {
'job_name': 'mesa: {}'.format(args.pipeline_info),
@@ -74,20 +74,11 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
},
"timeouts": {
"job": {"minutes": args.job_timeout},
"action": {"minutes": 3},
"actions": {
"depthcharge-retry": {
# Could take between 1 and 1.5 min in slower boots
"minutes": 2
},
"depthcharge-start": {
# Should take less than 1 min.
"minutes": 1,
},
"depthcharge-action": {
# This timeout englobes the entire depthcharge timing,
# including retries
"minutes": 2 * NUMBER_OF_ATTEMPTS_LAVA_BOOT,
},
"minutes": 3 * NUMBER_OF_ATTEMPTS_LAVA_BOOT,
}
}
},
}
@@ -156,13 +147,8 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
# - fetch and unpack per-job environment from lava-submit.sh
# - exec .gitlab-ci/common/init-stage2.sh
with open(args.first_stage_init, "r") as init_sh:
run_steps += [
x.rstrip() for x in init_sh if not x.startswith("#") and x.rstrip()
]
run_steps.append(
f"wget -S --progress=dot:giga -O- {args.job_rootfs_overlay_url} | tar -xz -C /",
)
with open(args.first_stage_init, 'r') as init_sh:
run_steps += [ x.rstrip() for x in init_sh if not x.startswith('#') and x.rstrip() ]
if args.jwt_file:
with open(args.jwt_file) as jwt_file:
@@ -181,6 +167,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
run_steps += [
'mkdir -p {}'.format(args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar --zstd -x -C {}'.format(args.build_url, args.ci_project_dir),
'wget -S --progress=dot:giga -O- {} | tar -xz -C /'.format(args.job_rootfs_overlay_url),
# Sleep a bit to give time for bash to dump shell xtrace messages into
# console which may cause interleaving with LAVA_SIGNAL_STARTTC in some
@@ -198,7 +185,7 @@ def generate_lava_yaml_payload(args) -> dict[str, Any]:
{ 'test': test },
]
return values
return yaml.dump(values, width=10000000)
def setup_lava_proxy():
@@ -285,12 +272,8 @@ class LAVAJob:
def _load_log_from_data(self, data) -> list[str]:
lines = []
if isinstance(data, xmlrpc.client.Binary):
# We are dealing with xmlrpc.client.Binary
# Let's extract the data
data = data.data
# When there is no new log data, the YAML is empty
if loaded_lines := lava_yaml.load(data):
if loaded_lines := yaml.load(str(data), Loader=loader(False)):
lines = loaded_lines
self.last_log_line += len(lines)
return lines
@@ -355,7 +338,7 @@ def find_exception_from_metadata(metadata, job_id):
def find_lava_error(job) -> None:
# Look for infrastructure errors and retry if we see them.
results_yaml = _call_proxy(job.proxy.results.get_testjob_results_yaml, job.job_id)
results = lava_yaml.load(results_yaml)
results = yaml.load(results_yaml, Loader=loader(False))
for res in results:
metadata = res["metadata"]
find_exception_from_metadata(metadata, job.job_id)
@@ -365,17 +348,16 @@ def find_lava_error(job) -> None:
job.status = "fail"
def show_job_data(job, colour=f"{CONSOLE_LOG['BOLD']}{CONSOLE_LOG['FG_GREEN']}"):
def show_job_data(job):
with GitlabSection(
"job_data",
"LAVA job info",
type=LogSectionType.LAVA_POST_PROCESSING,
start_collapsed=True,
colour=colour,
):
show = _call_proxy(job.proxy.scheduler.jobs.show, job.job_id)
for field, value in show.items():
print(f"{field:<15}: {value}")
print("{}\t: {}".format(field, value))
def fetch_logs(job, max_idle_time, log_follower) -> None:
@@ -451,6 +433,8 @@ def follow_job_execution(job):
while not job.is_finished:
fetch_logs(job, max_idle_time, lf)
show_job_data(job)
# Mesa Developers expect to have a simple pass/fail job result.
# If this does not happen, it probably means a LAVA infrastructure error
# happened.
@@ -469,7 +453,6 @@ def print_job_final_status(job):
f"{CONSOLE_LOG['RESET']}"
)
show_job_data(job, colour=f"{CONSOLE_LOG['BOLD']}{color}")
def retriable_follow_job(proxy, job_definition) -> LAVAJob:
retry_count = NUMBER_OF_RETRIES_TIMEOUT_DETECTION
@@ -522,9 +505,7 @@ def main(args):
# script section timeout with a reasonable delay.
GL_SECTION_TIMEOUTS[LogSectionType.TEST_CASE] = timedelta(minutes=args.job_timeout)
job_definition_stream = StringIO()
lava_yaml.dump(generate_lava_yaml_payload(args), job_definition_stream)
job_definition = job_definition_stream.getvalue()
job_definition = generate_lava_yaml(args)
if args.dump_yaml:
with GitlabSection(

View File

@@ -3,6 +3,7 @@ from .gitlab_section import GitlabSection
from .log_follower import (
LogFollower,
fatal_err,
fix_lava_color_log,
fix_lava_gitlab_section_log,
hide_sensitive_data,
print_log,

View File

@@ -49,10 +49,6 @@ class LogFollower:
section_is_created == section_has_started
), "Can't follow logs beginning from uninitialized GitLab sections."
# Initialize fix_lava_gitlab_section_log generator
self.gl_section_fix_gen = fix_lava_gitlab_section_log()
next(self.gl_section_fix_gen)
@property
def phase(self) -> LogSectionType:
return (
@@ -142,7 +138,7 @@ class LogFollower:
# job is progressing
is_job_healthy = True
self.manage_gl_sections(line)
if parsed_line := self.parse_lava_line(line):
if parsed_line := parse_lava_line(line):
self._buffer.append(parsed_line)
self.log_hints.detect_failure(new_lines)
@@ -154,61 +150,55 @@ class LogFollower:
self._buffer = []
return buffer
def parse_lava_line(self, line) -> Optional[str]:
prefix = ""
suffix = ""
if line["lvl"] in ["results", "feedback", "debug"]:
return
elif line["lvl"] in ["warning", "error"]:
prefix = CONSOLE_LOG["FG_RED"]
suffix = CONSOLE_LOG["RESET"]
elif line["lvl"] == "input":
prefix = "$ "
suffix = ""
elif line["lvl"] == "target":
# gl_section_fix_gen will output the stored line if it can't find a
# match for the first split line
# So we can recover it and put it back to the buffer
if recovered_first_line := self.gl_section_fix_gen.send(line):
self._buffer.append(recovered_first_line)
def fix_lava_color_log(line):
"""This function is a temporary solution for the color escape codes mangling
problem. There is some problem in message passing between the LAVA
dispatcher and the device under test (DUT). Here \x1b character is missing
before `[:digit::digit:?:digit:?m` ANSI TTY color codes, or the more
complicated ones with number values for text format before background and
foreground colors.
When this problem is fixed on the LAVA side, one should remove this function.
"""
line["msg"] = re.sub(r"(\[(\d+;){0,2}\d{1,3}m)", "\x1b" + r"\1", line["msg"])
return f'{prefix}{line["msg"]}{suffix}'
def fix_lava_gitlab_section_log():
def fix_lava_gitlab_section_log(line):
"""This function is a temporary solution for the Gitlab section markers
splitting problem. Gitlab parses the following lines to define a collapsible
mangling problem. Gitlab parses the following lines to define a collapsible
gitlab section in their log:
- \x1b[0Ksection_start:timestamp:section_id[collapsible=true/false]\r\x1b[0Ksection_header
- \x1b[0Ksection_end:timestamp:section_id\r\x1b[0K
There is some problem in message passing between the LAVA dispatcher and the
device under test (DUT), that replaces \r control characters into \n. When
this problem is fixed on the LAVA side, one should remove this function.
device under test (DUT), that digests \x1b and \r control characters
incorrectly. When this problem is fixed on the LAVA side, one should remove
this function.
"""
while True:
line = yield False
first_line = None
split_line_pattern = re.compile(r"\x1b\[0K(section_\w+):(\d+):([^\s\r]+)$")
second_line_pattern = re.compile(r"\x1b\[0K([\S ]+)?")
if match := re.match(r"\[0K(section_\w+):(\d+):(\S+)\[0K([\S ]+)?", line["msg"]):
marker, timestamp, id_collapsible, header = match.groups()
# The above regex serves for both section start and end lines.
# When the header is None, it means we are dealing with `section_end` line
header = header or ""
line["msg"] = f"\x1b[0K{marker}:{timestamp}:{id_collapsible}\r\x1b[0K{header}"
if not re.search(split_line_pattern, line["msg"]):
continue
first_line = line["msg"]
# Delete the current line and hold this log line stream to be able to
# possibly merge it with the next line.
line["msg"] = ""
line = yield False
def parse_lava_line(line) -> Optional[str]:
prefix = ""
suffix = ""
# This code reached when we detect a possible first split line
if re.search(second_line_pattern, line["msg"]):
assert first_line
line["msg"] = f"{first_line}\r{line['msg']}"
else:
# The current line doesn't match with the previous one, send back the
# latter to give the user the chance to recover it.
yield first_line
if line["lvl"] in ["results", "feedback", "debug"]:
return
elif line["lvl"] in ["warning", "error"]:
prefix = CONSOLE_LOG["FG_RED"]
suffix = CONSOLE_LOG["RESET"]
elif line["lvl"] == "input":
prefix = "$ "
suffix = ""
elif line["lvl"] == "target":
fix_lava_color_log(line)
fix_lava_gitlab_section_log(line)
return f'{prefix}{line["msg"]}{suffix}'
def print_log(msg):
@@ -224,5 +214,5 @@ def fatal_err(msg):
sys.exit(1)
def hide_sensitive_data(yaml_data: str, hide_tag: str ="HIDEME"):
def hide_sensitive_data(yaml_data, hide_tag="HIDEME"):
return "".join(line for line in yaml_data.splitlines(True) if hide_tag not in line)

View File

@@ -24,7 +24,7 @@ fi
# tests in their meson.build with:
#
# test(...,
# should_fail: meson.get_external_property('xfail', '').contains(t),
# should_fail: meson.get_cross_property('xfail', '').contains(t),
# )
#
# where t is the name of the test, and the '' is the string to search when

View File

@@ -0,0 +1,89 @@
diff --git a/framework/replay/download_utils.py b/framework/replay/download_utils.py
index 36322b000..5c3fe140d 100644
--- a/framework/replay/download_utils.py
+++ b/framework/replay/download_utils.py
@@ -27,20 +27,20 @@ import base64
import hashlib
import hmac
import xml.etree.ElementTree as ET
-
-from typing import Dict
from email.utils import formatdate
from os import path
from time import time
+from typing import Dict
+from urllib.parse import urlparse
+
import requests
from requests.adapters import HTTPAdapter, Retry
-from framework.replay.local_file_adapter import LocalFileAdapter
from requests.utils import requote_uri
from framework import core, exceptions
+from framework.replay.local_file_adapter import LocalFileAdapter
from framework.replay.options import OPTIONS
-
__all__ = ['ensure_file']
minio_credentials = None
@@ -90,7 +90,7 @@ def get_minio_credentials(url):
minio_credentials['SessionToken'])
-def get_authorization_headers(url, resource):
+def get_minio_authorization_headers(url, resource):
minio_key, minio_secret, minio_token = get_minio_credentials(url)
date = formatdate(timeval=None, localtime=False, usegmt=True)
@@ -107,6 +107,17 @@ def get_authorization_headers(url, resource):
return headers
+def get_jwt_authorization_headers(url, resource):
+ date = formatdate(timeval=None, localtime=False, usegmt=True)
+ jwt = OPTIONS.download['jwt']
+ host = urlparse(url).netloc
+
+ headers = {'Host': host,
+ 'Date': date,
+ 'Authorization': 'Bearer %s' % (jwt)}
+ return headers
+
+
def download(url: str, file_path: str, headers: Dict[str, str], attempts: int = 2) -> None:
"""Downloads a URL content into a file
@@ -178,7 +189,9 @@ def ensure_file(file_path):
assert OPTIONS.download['minio_bucket']
assert OPTIONS.download['role_session_name']
assert OPTIONS.download['jwt']
- headers = get_authorization_headers(url, file_path)
+ headers = get_minio_authorization_headers(url, file_path)
+ elif OPTIONS.download['jwt']:
+ headers = get_jwt_authorization_headers(url, file_path)
else:
headers = None
diff --git a/unittests/framework/replay/test_download_utils.py b/unittests/framework/replay/test_download_utils.py
index 1e78b26e7..749c5d835 100644
--- a/unittests/framework/replay/test_download_utils.py
+++ b/unittests/framework/replay/test_download_utils.py
@@ -195,3 +195,17 @@ class TestDownloadUtils(object):
get_request = requests_mock.request_history[1]
assert(get_request.method == 'GET')
assert(requests_mock.request_history[1].headers['Authorization'].startswith('AWS Key'))
+
+ def test_jwt_authorization(self, requests_mock):
+ """download_utils.ensure_file: Check we send the authentication headers to the server"""
+ # reset minio_host from previous tests
+ OPTIONS.download['minio_host'] = ''
+ OPTIONS.download['jwt'] = 'jwt'
+
+ assert not self.trace_file.check()
+ download_utils.ensure_file(self.trace_path)
+ TestDownloadUtils.check_same_file(self.trace_file, "remote")
+
+ get_request = requests_mock.request_history[0]
+ assert(get_request.method == 'GET')
+ assert(requests_mock.request_history[0].headers['Authorization'].startswith('Bearer'))

75
.gitlab-ci/piglit/run_cl.sh Executable file
View File

@@ -0,0 +1,75 @@
#!/bin/bash
set -e
set -o xtrace
VERSION=`head -1 install/VERSION`
ROOTDIR=`pwd`
if [ -d results ]; then
cd results && rm -rf ..?* .[!.]* *
fi
cd /piglit
export OCL_ICD_VENDORS=$ROOTDIR/install/etc/OpenCL/vendors/
set +e
unset DISPLAY
export LD_LIBRARY_PATH=$ROOTDIR/install/lib
clinfo
# If the job is parallel at the gitlab job level, will take the corresponding
# fraction of the caselist.
if [ -n "$CI_NODE_INDEX" ]; then
if [ "$PIGLIT_PROFILES" != "${PIGLIT_PROFILES% *}" ]; then
echo "Can't parallelize piglit with multiple profiles"
exit 1
fi
USE_CASELIST=1
fi
if [ -n "$USE_CASELIST" ]; then
./piglit print-cmd $PIGLIT_TESTS $PIGLIT_PROFILES --format "{name}" > /tmp/case-list.txt
sed -ni $CI_NODE_INDEX~$CI_NODE_TOTAL"p" /tmp/case-list.txt
PIGLIT_TESTS="--test-list /tmp/case-list.txt"
fi
./piglit run -c -j${FDO_CI_CONCURRENT:-4} $PIGLIT_OPTIONS $PIGLIT_TESTS $PIGLIT_PROFILES $ROOTDIR/results
retVal=$?
if [ $retVal -ne 0 ]; then
echo "Found $(cat /tmp/version.txt), expected $VERSION"
fi
set -e
PIGLIT_RESULTS=${PIGLIT_RESULTS:-$PIGLIT_PROFILES}
mkdir -p .gitlab-ci/piglit
./piglit summary console $ROOTDIR/results \
| tee ".gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig" \
| head -n -1 \
| grep -v ": pass" \
| sed '/^summary:/Q' \
> .gitlab-ci/piglit/$PIGLIT_RESULTS.txt
if [ -n "$USE_CASELIST" ]; then
# Just filter the expected results based on the tests that were actually
# executed, and switch to the version with no summary
cat .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.orig | sed '/^summary:/Q' | rev \
| cut -f2- -d: | rev | sed "s/$/:/g" > /tmp/executed.txt
grep -F -f /tmp/executed.txt $ROOTDIR/install/$PIGLIT_RESULTS.txt \
> .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline || true
else
cp $ROOTDIR/install/$PIGLIT_RESULTS.txt .gitlab-ci/piglit/$PIGLIT_RESULTS.txt.baseline
fi
if diff -q .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}; then
exit 0
fi
./piglit summary html --exclude-details=pass $ROOTDIR/results/summary $ROOTDIR/results
echo Unexpected change in results:
diff -u .gitlab-ci/piglit/$PIGLIT_RESULTS.txt{.baseline,}
exit 1

View File

@@ -10,7 +10,7 @@ rm -rf install/bin install/include
# Strip the drivers in the artifacts to cut 80% of the artifacts size.
if [ -n "$CROSS" ]; then
STRIP=$(sed -n -E "s/strip\s*=\s*\[?'(.*)'\]?/\1/p" "$CROSS_FILE")
STRIP=`sed -n -E "s/strip\s*=\s*'(.*)'/\1/p" "$CROSS_FILE"`
if [ -z "$STRIP" ]; then
echo "Failed to find strip command in cross file"
exit 1

View File

@@ -1,41 +1,27 @@
#!/usr/bin/env bash
set -e
set -v
echo -e "\e[0Ksection_start:$(date +%s):shader-db-prepare[collapsed=true]\r\e[0KPreparing shader-db"
ARTIFACTSDIR=$(pwd)/shader-db
mkdir -p "$ARTIFACTSDIR"
ARTIFACTSDIR=`pwd`/shader-db
mkdir -p $ARTIFACTSDIR
export DRM_SHIM_DEBUG=true
LIBDIR=$(pwd)/install/lib
LIBDIR=`pwd`/install/lib
export LD_LIBRARY_PATH=$LIBDIR
cd /usr/local/shader-db
echo -e "\e[0Ksection_end:$(date +%s):shader-db-prepare\r\e[0K"
for driver in freedreno intel v3d vc4; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-${driver}[collapsed=true]\r\e[0KRunning shader-db for $driver"
env LD_PRELOAD="$LIBDIR/lib${driver}_noop_drm_shim.so" \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/${driver}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-${driver}\r\e[0K"
for driver in freedreno intel v3d; do
echo "Running drm-shim for $driver"
env LD_PRELOAD=$LIBDIR/lib${driver}_noop_drm_shim.so \
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
> $ARTIFACTSDIR/${driver}-shader-db.txt
done
# Run shader-db over a number of supported chipsets for nouveau
for chipset in 40 a3 c0 e4 f0 134 162; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-nouveau-${chipset}[collapsed=true]\r\e[0KRunning shader-db for nouveau - ${chipset}"
env LD_PRELOAD="$LIBDIR/libnouveau_noop_drm_shim.so" \
echo "Running drm-shim for nouveau - $chipset"
env LD_PRELOAD=$LIBDIR/libnouveau_noop_drm_shim.so \
NOUVEAU_CHIPSET=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" ./shaders \
> "$ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-nouveau-${chipset}\r\e[0K"
done
# Run shader-db for r300 (RV370 and RV515)
for chipset in 0x5460 0x7140; do
echo -e "\e[0Ksection_start:$(date +%s):shader-db-r300-${chipset}[collapsed=true]\r\e[0KRunning shader-db for r300 - ${chipset}"
env LD_PRELOAD="$LIBDIR/libradeon_noop_drm_shim.so" \
RADEON_GPU_ID=${chipset} \
./run -j"${FDO_CI_CONCURRENT:-4}" -o r300 ./shaders \
> "$ARTIFACTSDIR/r300-${chipset}-shader-db.txt"
echo -e "\e[0Ksection_end:$(date +%s):shader-db-r300-${chipset}\r\e[0K"
./run -j${FDO_CI_CONCURRENT:-4} ./shaders \
> $ARTIFACTSDIR/nouveau-${chipset}-shader-db.txt
done

371
.gitlab-ci/skqp-runner.sh Executable file
View File

@@ -0,0 +1,371 @@
#!/bin/bash
#
# Copyright (C) 2022 Collabora Limited
# Author: Guilherme Gallo <guilherme.gallo@collabora.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice (including the next
# paragraph) shall be included in all copies or substantial portions of the
# Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
# Args:
# $1: section id
# $2: section header
gitlab_section_start() {
echo -e "\e[0Ksection_start:$(date +%s):$1[collapsed=${GL_COLLAPSED:-false}]\r\e[0K\e[32;1m$2\e[0m"
}
# Args:
# $1: section id
gitlab_section_end() {
echo -e "\e[0Ksection_end:$(date +%s):$1\r\e[0K"
}
# sponge allows piping to files that are being used as input.
# E.g.: sort file.txt | sponge file.txt
# In order to avoid installing moreutils just to have the sponge binary, we can
# use a bash function for it
# Source https://unix.stackexchange.com/a/561346/310927
sponge () (
set +x
append=false
while getopts 'a' opt; do
case $opt in
a) append=true ;;
*) echo error; exit 1
esac
done
shift "$(( OPTIND - 1 ))"
outfile=$1
tmpfile=$(mktemp "$(dirname "$outfile")/tmp-sponge.XXXXXXXX") &&
cat >"$tmpfile" &&
if "$append"; then
cat "$tmpfile" >>"$outfile"
else
if [ -f "$outfile" ]; then
chmod --reference="$outfile" "$tmpfile"
fi
if [ -f "$outfile" ]; then
mv "$tmpfile" "$outfile"
elif [ -n "$outfile" ] && [ ! -e "$outfile" ]; then
cat "$tmpfile" >"$outfile"
else
cat "$tmpfile"
fi
fi &&
rm -f "$tmpfile"
)
remove_comments_from_files() (
INPUT_FILES="$*"
for INPUT_FILE in ${INPUT_FILES}
do
[ -f "${INPUT_FILE}" ] || continue
sed -i '/#/d' "${INPUT_FILE}"
sed -i '/^\s*$/d' "${INPUT_FILE}"
done
)
subtract_test_lists() (
MINUEND=$1
sort "${MINUEND}" | sponge "${MINUEND}"
shift
for SUBTRAHEND in "$@"
do
sort "${SUBTRAHEND}" | sponge "${SUBTRAHEND}"
join -v 1 "${MINUEND}" "${SUBTRAHEND}" |
sponge "${MINUEND}"
done
)
merge_rendertests_files() {
BASE_FILE=$1
shift
FILES="$*"
# shellcheck disable=SC2086
cat $FILES "$BASE_FILE" |
sort --unique --stable --field-separator=, --key=1,1 |
sponge "$BASE_FILE"
}
assure_files() (
for CASELIST_FILE in $*
do
>&2 echo "Looking for ${CASELIST_FILE}..."
[ -f ${CASELIST_FILE} ] || (
>&2 echo "Not found. Creating empty."
touch ${CASELIST_FILE}
)
done
)
# Generate rendertests from scratch, customizing with fails/flakes/crashes files
generate_rendertests() (
set -e
GENERATED_FILE=$(mktemp)
TESTS_FILE_PREFIX="${SKQP_FILE_PREFIX}-${SKQP_BACKEND}_rendertests"
FLAKES_FILE="${TESTS_FILE_PREFIX}-flakes.txt"
FAILS_FILE="${TESTS_FILE_PREFIX}-fails.txt"
CRASHES_FILE="${TESTS_FILE_PREFIX}-crashes.txt"
RENDER_TESTS_FILE="${TESTS_FILE_PREFIX}.txt"
# Default to an empty known flakes file if it doesn't exist.
assure_files ${FLAKES_FILE} ${FAILS_FILE} ${CRASHES_FILE}
# skqp does not support comments in rendertests.txt file
remove_comments_from_files "${FLAKES_FILE}" "${FAILS_FILE}" "${CRASHES_FILE}"
# create an exhaustive rendertest list
"${SKQP_BIN_DIR}"/list_gms | sort > "$GENERATED_FILE"
# Remove undesirable tests from the list
subtract_test_lists "${GENERATED_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}"
# Add ",0" to each test to set the expected diff sum to zero
sed -i 's/$/,0/g' "$GENERATED_FILE"
merge_rendertests_files "$GENERATED_FILE" "${FAILS_FILE}"
mv "${GENERATED_FILE}" "${RENDER_TESTS_FILE}"
echo "${RENDER_TESTS_FILE}"
)
generate_unittests() (
set -e
GENERATED_FILE=$(mktemp)
TESTS_FILE_PREFIX="${SKQP_FILE_PREFIX}_unittests"
FLAKES_FILE="${TESTS_FILE_PREFIX}-flakes.txt"
FAILS_FILE="${TESTS_FILE_PREFIX}-fails.txt"
CRASHES_FILE="${TESTS_FILE_PREFIX}-crashes.txt"
UNIT_TESTS_FILE="${TESTS_FILE_PREFIX}.txt"
# Default to an empty known flakes file if it doesn't exist.
assure_files ${FLAKES_FILE} ${FAILS_FILE} ${CRASHES_FILE}
# Remove unitTest_ prefix
for UT_FILE in "${FAILS_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}"; do
sed -i 's/^unitTest_//g' "${UT_FILE}"
done
# create an exhaustive unittests list
"${SKQP_BIN_DIR}"/list_gpu_unit_tests > "${GENERATED_FILE}"
# Remove undesirable tests from the list
subtract_test_lists "${GENERATED_FILE}" "${CRASHES_FILE}" "${FLAKES_FILE}" "${FAILS_FILE}"
remove_comments_from_files "${GENERATED_FILE}"
mv "${GENERATED_FILE}" "${UNIT_TESTS_FILE}"
echo "${UNIT_TESTS_FILE}"
)
run_all_tests() {
rm -f "${SKQP_ASSETS_DIR}"/skqp/*.txt
}
copy_tests_files() (
# Copy either unit test or render test files from a specific driver given by
# GPU VERSION variable.
# If there is no test file at the expected location, this function will
# return error_code 1
SKQP_BACKEND="${1}"
SKQP_FILE_PREFIX="${INSTALL}/${GPU_VERSION}-skqp"
if echo "${SKQP_BACKEND}" | grep -qE 'vk|gl(es)?'
then
echo "Generating rendertests.txt file"
GENERATED_RENDERTESTS=$(generate_rendertests)
cp "${GENERATED_RENDERTESTS}" "${SKQP_ASSETS_DIR}"/skqp/rendertests.txt
mkdir -p "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}"
cp "${GENERATED_RENDERTESTS}" "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}/generated_rendertests.txt"
return 0
fi
# The unittests.txt path is hardcoded inside assets directory,
# that is why it needs to be a special case.
if echo "${SKQP_BACKEND}" | grep -qE "unitTest"
then
echo "Generating unittests.txt file"
GENERATED_UNITTESTS=$(generate_unittests)
cp "${GENERATED_UNITTESTS}" "${SKQP_ASSETS_DIR}"/skqp/unittests.txt
mkdir -p "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}"
cp "${GENERATED_UNITTESTS}" "${SKQP_RESULTS_DIR}/${SKQP_BACKEND}/generated_unittests.txt"
fi
)
resolve_tests_files() {
if [ -n "${RUN_ALL_TESTS}" ]
then
run_all_tests
return
fi
SKQP_BACKEND=${1}
if ! copy_tests_files "${SKQP_BACKEND}"
then
echo "No override test file found for ${SKQP_BACKEND}. Using the default one."
fi
}
test_vk_backend() {
if echo "${SKQP_BACKENDS:?}" | grep -qE 'vk'
then
if [ -n "$VK_DRIVER" ]; then
return 0
fi
echo "VK_DRIVER environment variable is missing."
# shellcheck disable=SC2012
VK_DRIVERS=$(ls "$INSTALL"/share/vulkan/icd.d/ | cut -f 1 -d '_')
if [ -n "${VK_DRIVERS}" ]
then
echo "Please set VK_DRIVER to the correct driver from the list:"
echo "${VK_DRIVERS}"
fi
echo "No Vulkan tests will be executed, but it was requested in SKQP_BACKENDS variable. Exiting."
exit 2
fi
# Vulkan environment is not configured, but it was not requested by the job
return 1
}
setup_backends() {
if test_vk_backend
then
export VK_ICD_FILENAMES="$INSTALL"/share/vulkan/icd.d/"$VK_DRIVER"_icd."${VK_CPU:-$(uname -m)}".json
fi
}
show_reports() (
set +xe
# Unit tests produce empty HTML reports, guide the user to check the TXT file.
if echo "${SKQP_BACKENDS}" | grep -qE "unitTest"
then
# Remove the empty HTML report to avoid confusion
rm -f "${SKQP_RESULTS_DIR}"/unitTest/report.html
echo "See skqp unit test results at:"
echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts${SKQP_RESULTS_DIR}/unitTest/unit_tests.txt"
fi
REPORT_FILES=$(mktemp)
find "${SKQP_RESULTS_DIR}"/**/report.html -type f > "${REPORT_FILES}"
while read -r REPORT
do
# shellcheck disable=SC2001
BACKEND_NAME=$(echo "${REPORT}" | sed 's@.*/\([^/]*\)/report.html@\1@')
echo "See skqp ${BACKEND_NAME} render tests report at:"
echo "https://$CI_PROJECT_ROOT_NAMESPACE.pages.freedesktop.org/-/$CI_PROJECT_NAME/-/jobs/$CI_JOB_ID/artifacts${REPORT}"
done < "${REPORT_FILES}"
# If there is no report available, tell the user that something is wrong.
if [ ! -s "${REPORT_FILES}" ]
then
echo "No skqp report available. Probably some fatal error has occured during the skqp execution."
fi
)
usage() {
cat <<EOF
Usage: $(basename "$0") [-a]
Arguments:
-a: Run all unit tests and render tests, useful when introducing a new driver to skqp.
EOF
}
parse_args() {
while getopts ':ah' opt; do
case "$opt" in
a)
echo "Running all skqp tests"
export RUN_ALL_TESTS=1
shift
;;
h)
usage
exit 0
;;
?)
echo "Invalid command option."
usage
exit 1
;;
esac
done
}
set -e
parse_args "${@}"
# Needed so configuration files can contain paths to files in /install
INSTALL="$CI_PROJECT_DIR"/install
if [ -z "$GPU_VERSION" ]; then
echo 'GPU_VERSION must be set to something like "llvmpipe" or
"freedreno-a630" (it will serve as a component to find the path for files
residing in src/**/ci/*.txt)'
exit 1
fi
LD_LIBRARY_PATH=$INSTALL:$LD_LIBRARY_PATH
setup_backends
SKQP_BIN_DIR=${SKQP_BIN_DIR:-/skqp}
SKQP_ASSETS_DIR="${SKQP_BIN_DIR}"/assets
SKQP_RESULTS_DIR="${SKQP_RESULTS_DIR:-${PWD}/results}"
mkdir -p "${SKQP_ASSETS_DIR}"/skqp
# Show the reports on exit, even when a test crashes
trap show_reports INT TERM EXIT
SKQP_EXITCODE=0
for SKQP_BACKEND in ${SKQP_BACKENDS}
do
resolve_tests_files "${SKQP_BACKEND}"
SKQP_BACKEND_RESULTS_DIR="${SKQP_RESULTS_DIR}"/"${SKQP_BACKEND}"
mkdir -p "${SKQP_BACKEND_RESULTS_DIR}"
BACKEND_EXITCODE=0
GL_COLLAPSED=true gitlab_section_start "skqp_${SKQP_BACKEND}" "skqp logs for ${SKQP_BACKEND}"
"${SKQP_BIN_DIR}"/skqp "${SKQP_ASSETS_DIR}" "${SKQP_BACKEND_RESULTS_DIR}" "${SKQP_BACKEND}_" ||
BACKEND_EXITCODE=$?
gitlab_section_end "skqp_${SKQP_BACKEND}"
if [ ! $BACKEND_EXITCODE -eq 0 ]
then
echo "skqp failed on ${SKQP_BACKEND} tests with exit code: ${BACKEND_EXITCODE}."
else
echo "skqp succeeded on ${SKQP_BACKEND}."
fi
# Propagate error codes to leverage the final job result
SKQP_EXITCODE=$(( SKQP_EXITCODE | BACKEND_EXITCODE ))
done
exit $SKQP_EXITCODE

View File

@@ -14,20 +14,6 @@
- if: *is-scheduled-pipeline
when: never
# Rule for restricted traces jobs to only run for users with access to those
# traces (both https://gitlab.freedesktop.org/gfx-ci/tracie/traces-db-private
# for trace access, and minio bucket access for viewing result images from CI).
#
# This is a compromise, allowing some marked developers to have their MRs
# blocked on regressions to non-redistributable traces, while not blocking
# merges for other devs who would be unable to debug changes to them.
.restricted-rules:
rules:
# If the triggerer has access to the restricted traces and if it is pre-merge
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu|okias|gallo)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
# Mesa core source file dependencies that may impact any test job
# ---------------------------------------------------------------
.core-rules:
@@ -174,21 +160,6 @@
- if: '$ANHOLT_FARM == "offline"'
when: never
.valve-farm-rules:
rules:
- if: '$VALVE_FARM == "offline"'
when: never
# The Valve CI Farm uses allow lists for projects/users to prevent abuse,
# so only enable automatic testing when running in the context of Mesa to
# prevent failures in forks.
- if: '$CI_PROJECT_NAMESPACE != "mesa"'
when: never
.austriancoder-farm-rules:
rules:
- if: '$AUSTRIANCODER_FARM == "offline"'
when: never
# Skips freedreno jobs if either of the farms we use are offline.
.freedreno-farm-rules:
rules:
@@ -199,7 +170,6 @@
# Rules for changes that impact either freedreno or turnip.
.freedreno-common-rules:
rules:
- !reference [.no_scheduled_pipelines-rules, rules]
- !reference [.freedreno-farm-rules, rules]
- changes: &freedreno_core_file_list
- src/freedreno/ci/**/*
@@ -240,7 +210,10 @@
.freedreno-rules-restricted:
stage: freedreno
rules:
- !reference [.restricted-rules, rules]
# If the triggerer has access to the restricted traces and if it is pre-merge
- if: '($GITLAB_USER_LOGIN !~ "/^(robclark|anholt|flto|cwabbott0|Danil|tomeu|okias|gallo)$/") &&
($GITLAB_USER_LOGIN != "marge-bot" || $CI_COMMIT_BRANCH)'
when: never
- !reference [.freedreno-rules, rules]
# Rules for GL driver performance tracking. We want them to run as code is
@@ -322,7 +295,7 @@
- src/panfrost/vulkan/*
when: on_success
- changes:
- src/panfrost/compiler/**/*
- src/panfrost/bifrost/**/*
when: on_success
.broadcom-common-rules:
@@ -387,24 +360,13 @@
.radv-rules:
stage: amd
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.vulkan-rules, rules]
- changes: &radv_file_list
- src/amd/**/*
- src/vulkan/**/*
when: on_success
.radv-collabora-rules:
stage: amd
rules:
- !reference [.collabora-farm-rules, rules]
- !reference [.radv-rules, rules]
.radv-valve-rules:
stage: amd
rules:
- !reference [.valve-farm-rules, rules]
- !reference [.radv-rules, rules]
.virgl-rules:
stage: layered-backends
rules:
@@ -568,13 +530,6 @@
- !reference [.anv-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-anv-rules-restricted:
stage: layered-backends
rules:
- !reference [.restricted-rules, rules]
- !reference [.anv-rules, rules]
- !reference [.zink-common-rules, rules]
.zink-turnip-rules:
stage: layered-backends
rules:
@@ -649,7 +604,6 @@
.etnaviv-rules:
stage: etnaviv
rules:
- !reference [.austriancoder-farm-rules, rules]
- !reference [.gl-rules, rules]
- changes:
- src/etnaviv/**/*

View File

@@ -109,6 +109,11 @@ rustfmt:
variables:
DEQP_VER: vk
.skqp-test:
variables:
HWCI_START_XORG: 1
HWCI_TEST_SCRIPT: "/install/skqp-runner.sh"
.fossilize-test:
script:
- ./install/fossilize-runner.sh
@@ -130,8 +135,6 @@ rustfmt:
# improve it even more (see https://docs.mesa3d.org/ci/bare-metal.html for
# setup).
- echo -e "\e[0Ksection_start:$(date +%s):artifacts_download[collapsed=true]\r\e[0KDownloading artifacts from minio"
# Note: Build dir (and thus install) may be dirty due to GIT_STRATEGY
- rm -rf install
- wget ${FDO_HTTP_CACHE_URI:-}https://${PIPELINE_ARTIFACTS_BASE}/${MINIO_ARTIFACT_NAME}.tar.zst -S --progress=dot:giga -O- | tar --zstd -x
- echo -e "\e[0Ksection_end:$(date +%s):artifacts_download\r\e[0K"
artifacts:
@@ -149,12 +152,12 @@ rustfmt:
.baremetal-test-armhf:
extends:
- .baremetal-test
- .use-debian/armhf_test
- .use-debian/arm_test
variables:
BM_ROOTFS: /rootfs-armhf
MINIO_ARTIFACT_NAME: mesa-armhf
needs:
- debian/armhf_test
- debian/arm_test
- job: debian-armhf
artifacts: false
@@ -162,12 +165,12 @@ rustfmt:
.baremetal-test-arm64:
extends:
- .baremetal-test
- .use-debian/arm64_test
- .use-debian/arm_test
variables:
BM_ROOTFS: /rootfs-arm64
MINIO_ARTIFACT_NAME: mesa-arm64
needs:
- debian/arm64_test
- debian/arm_test
- job: debian-arm64
artifacts: false
@@ -175,12 +178,12 @@ rustfmt:
.baremetal-arm64-asan-test:
extends:
- .baremetal-test
- .use-debian/arm64_test
- .use-debian/arm_test
variables:
DEQP_RUNNER_OPTIONS: "--env LD_PRELOAD=libasan.so.6:/install/lib/libdlclose-skip.so"
MINIO_ARTIFACT_NAME: mesa-arm64-asan
needs:
- debian/arm64_test
- debian/arm_test
- job: debian-arm64-asan
artifacts: false
@@ -201,13 +204,13 @@ rustfmt:
# like FDO_DISTRIBUTION_TAG for *the* image, there is no way to
# depend on more than one image per job. So, the job container is
# built as part of the CI in the boot2container project.
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-12-08.1
image: registry.freedesktop.org/mupuf/valve-infra/mesa-trigger:2022-03-03.2
timeout: 1h 40m
variables:
# No need by default to pull the whole repo
GIT_STRATEGY: none
# boot2container initrd configuration parameters.
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/519/download' # Linux 6.1
B2C_KERNEL_URL: 'https://gitlab.freedesktop.org/mupuf/valve-infra/-/package_files/144/download' # 5.17.1
B2C_INITRAMFS_URL: 'https://gitlab.freedesktop.org/mupuf/boot2container/-/releases/v0.9.8/downloads/initramfs.linux_amd64.cpio.xz'
B2C_JOB_SUCCESS_REGEX: '\[.*\]: Execution is over, pipeline status: 0\r$'
B2C_JOB_WARN_REGEX: '\*ERROR\* ring .* timeout, but soft recovered'
@@ -236,11 +239,9 @@ rustfmt:
GENERATE_ENV_SCRIPT: "${CI_COMMON_SCRIPTS}/generate-env.sh"
B2C_JOB_TEMPLATE: "${CI_B2C_ARTIFACTS}/b2c.yml.jinja2.jinja2"
JOB_FOLDER: "job_folder"
before_script:
# We don't want the tarball unpacking of .test, but will take the JWT bits.
- !reference [default, before_script]
- |
set -x
@@ -320,6 +321,7 @@ rustfmt:
env PYTHONUNBUFFERED=1 executorctl \
run -w b2c.yml.jinja2 -j $(slugify "$CI_JOB_NAME") -s ${JOB_FOLDER}
ls -l
# Anything our job places in results/ will be collected by the
# Gitlab coordinator for status presentation. results/junit.xml
# will be parsed by the UI for more detailed explanations of
@@ -330,7 +332,7 @@ rustfmt:
paths:
- ${JOB_FOLDER}/results
reports:
junit: ${JOB_FOLDER}/results/**/junit.xml
junit: ${JOB_FOLDER}/results/junit.xml
.b2c-test-vk:
extends:

View File

@@ -1,22 +1,15 @@
from contextlib import nullcontext as does_not_raise
from datetime import datetime
from io import StringIO
from itertools import cycle
from typing import Any, Callable, Generator, Iterable, Optional, Tuple, Union
from typing import Callable, Generator, Iterable, Optional, Tuple, Union
import yaml
from freezegun import freeze_time
from lava.utils.log_section import (
DEFAULT_GITLAB_SECTION_TIMEOUTS,
FALLBACK_GITLAB_SECTION_TIMEOUT,
LogSectionType,
)
from lavacli.utils import flow_yaml as lava_yaml
def yaml_dump(data: dict[str, Any]) -> str:
stream = StringIO()
lava_yaml.dump(data, stream)
return stream.getvalue()
def section_timeout(section_type: LogSectionType) -> int:
@@ -53,7 +46,7 @@ def jobs_logs_response(
logs = [timed_msg] if msg is None else msg
return finished, yaml_dump(logs)
return finished, yaml.safe_dump(logs)
def section_aware_message_generator(

View File

@@ -298,9 +298,11 @@ def test_parse_job_result_from_log(message, expectation, mock_proxy):
reason="Slow and sketchy test. Needs a LAVA log raw file at /tmp/log.yaml"
)
def test_full_yaml_log(mock_proxy, frozen_time):
import itertools
import random
from datetime import datetime
from lavacli.utils import flow_yaml as lava_yaml
import yaml
def time_travel_from_log_chunk(data_chunk):
if not data_chunk:
@@ -319,28 +321,26 @@ def test_full_yaml_log(mock_proxy, frozen_time):
# the same of from the job submitter execution
with open("/tmp/log.yaml", "r") as f:
first_log = f.readline()
first_log_time = lava_yaml.load(first_log)[0]["dt"]
first_log_time = yaml.safe_load(first_log)[0]["dt"]
frozen_time.move_to(first_log_time)
def load_lines() -> list:
with open("/tmp/log.yaml", "r") as f:
# data = yaml.safe_load(f)
data = f.readlines()
stream = chain(data)
data = yaml.safe_load(f)
chain = itertools.chain(data)
try:
while True:
data_chunk = [next(stream) for _ in range(random.randint(0, 50))]
serial_message = "".join(data_chunk)
data_chunk = [next(chain) for _ in range(random.randint(0, 50))]
# Suppose that the first message timestamp is the same of
# log fetch RPC call
time_travel_from_log_chunk(data_chunk)
yield False, "[]"
yield False, []
# Travel to the same datetime of the last fetched log line
# in the chunk
time_travel_from_log_chunk(data_chunk)
yield False, serial_message
yield False, data_chunk
except StopIteration:
yield True, serial_message
yield True, data_chunk
return
proxy = mock_proxy()

View File

@@ -8,16 +8,18 @@
from datetime import datetime, timedelta
import pytest
import yaml
from lava.exceptions import MesaCIKnownIssueException, MesaCITimeoutError
from lava.utils import (
GitlabSection,
LogFollower,
LogSectionType,
fix_lava_color_log,
fix_lava_gitlab_section_log,
hide_sensitive_data,
)
from ..lava.helpers import create_lava_yaml_msg, does_not_raise, lava_yaml, yaml_dump
from ..lava.helpers import create_lava_yaml_msg, does_not_raise
GITLAB_SECTION_SCENARIOS = {
"start collapsed": (
@@ -156,49 +158,91 @@ SENSITIVE_DATA_SCENARIOS = {
ids=SENSITIVE_DATA_SCENARIOS.keys(),
)
def test_hide_sensitive_data(input, expectation, tag):
yaml_data = yaml_dump(input)
yaml_data = yaml.safe_dump(input)
yaml_result = hide_sensitive_data(yaml_data, tag)
result = lava_yaml.load(yaml_result)
result = yaml.safe_load(yaml_result)
assert result == expectation
GITLAB_SECTION_SPLIT_SCENARIOS = {
"Split section_start at target level": (
"\x1b[0Ksection_start:1668454947:test_post_process[collapsed=true]\r\x1b[0Kpost-processing test results",
(
"\x1b[0Ksection_start:1668454947:test_post_process[collapsed=true]",
"\x1b[0Kpost-processing test results",
COLOR_MANGLED_SCENARIOS = {
"Mangled error message at target level": (
create_lava_yaml_msg(msg="[0m[0m[31mERROR - dEQP error: ", lvl="target"),
"\x1b[0m\x1b[0m\x1b[31mERROR - dEQP error: ",
),
"Mangled pass message at target level": (
create_lava_yaml_msg(
msg="[0mPass: 26718, ExpectedFail: 95, Skip: 25187, Duration: 8:18, Remaining: 13",
lvl="target",
),
"\x1b[0mPass: 26718, ExpectedFail: 95, Skip: 25187, Duration: 8:18, Remaining: 13",
),
"Split section_end at target level": (
"\x1b[0Ksection_end:1666309222:test_post_process\r\x1b[0K",
("\x1b[0Ksection_end:1666309222:test_post_process", "\x1b[0K"),
"Mangled error message with bold formatting at target level": (
create_lava_yaml_msg(msg="[1;31mReview the image changes...", lvl="target"),
"\x1b[1;31mReview the image changes...",
),
"Second line is not split from the first": (
("\x1b[0Ksection_end:1666309222:test_post_process", "Any message"),
("\x1b[0Ksection_end:1666309222:test_post_process", "Any message"),
"Mangled error message with high intensity background at target level": (
create_lava_yaml_msg(msg="[100mReview the image changes...", lvl="target"),
"\x1b[100mReview the image changes...",
),
"Mangled error message with underline+bg color+fg color at target level": (
create_lava_yaml_msg(msg="[4;41;97mReview the image changes...", lvl="target"),
"\x1b[4;41;97mReview the image changes...",
),
"Bad input for color code.": (
create_lava_yaml_msg(
msg="[4;97 This message is missing the `m`.", lvl="target"
),
"[4;97 This message is missing the `m`.",
),
}
@pytest.mark.parametrize(
"expected_message, messages",
GITLAB_SECTION_SPLIT_SCENARIOS.values(),
ids=GITLAB_SECTION_SPLIT_SCENARIOS.keys(),
"message, fixed_message",
COLOR_MANGLED_SCENARIOS.values(),
ids=COLOR_MANGLED_SCENARIOS.keys(),
)
def test_fix_lava_gitlab_section_log(expected_message, messages):
fixed_messages = []
gen = fix_lava_gitlab_section_log()
next(gen)
def test_fix_lava_color_log(message, fixed_message):
fix_lava_color_log(message)
for message in messages:
lava_log = create_lava_yaml_msg(msg=message, lvl="target")
if recovered_line := gen.send(lava_log):
fixed_messages.append((recovered_line, lava_log["msg"]))
fixed_messages.append(lava_log["msg"])
assert message["msg"] == fixed_message
assert expected_message in fixed_messages
GITLAB_SECTION_MANGLED_SCENARIOS = {
"Mangled section_start at target level": (
create_lava_yaml_msg(
msg="[0Ksection_start:1652658415:deqp[collapsed=false][0Kdeqp-runner",
lvl="target",
),
"\x1b[0Ksection_start:1652658415:deqp[collapsed=false]\r\x1b[0Kdeqp-runner",
),
"Mangled section_start at target level with header with spaces": (
create_lava_yaml_msg(
msg="[0Ksection_start:1652658415:deqp[collapsed=false][0Kdeqp runner stats",
lvl="target",
),
"\x1b[0Ksection_start:1652658415:deqp[collapsed=false]\r\x1b[0Kdeqp runner stats",
),
"Mangled section_end at target level": (
create_lava_yaml_msg(
msg="[0Ksection_end:1652658415:test_setup[0K",
lvl="target",
),
"\x1b[0Ksection_end:1652658415:test_setup\r\x1b[0K",
),
}
@pytest.mark.parametrize(
"message, fixed_message",
GITLAB_SECTION_MANGLED_SCENARIOS.values(),
ids=GITLAB_SECTION_MANGLED_SCENARIOS.keys(),
)
def test_fix_lava_gitlab_section_log(message, fixed_message):
fix_lava_gitlab_section_log(message)
assert message["msg"] == fixed_message
WATCHDOG_SCENARIOS = {

View File

@@ -1,26 +0,0 @@
#!/bin/bash
set -eu
function execute_testsuite {
local RESULTS_FOLDER EXEC_DONE_FILE
RESULTS_FOLDER="results/$1"
EXEC_DONE_FILE="$RESULTS_FOLDER/.done"
if [ ! -f "$EXEC_DONE_FILE" ]; then
DEQP_RESULTS_DIR="$RESULTS_FOLDER" PIGLIT_RESULTS_DIR="$RESULTS_FOLDER" $2
touch "$EXEC_DONE_FILE"
else
echo "--> Skipped, as it already was executed"
fi
}
echo -e "\n# GL CTS testing"
DEQP_VER=gl46 execute_testsuite gl ./install/deqp-runner.sh
echo -e "\n# GLES CTS testing"
DEQP_SUITE=zink-radv execute_testsuite gles ./install/deqp-runner.sh
echo -e "\n# Piglit testing"
execute_testsuite piglit ./install/piglit/piglit-runner.sh

View File

@@ -1,3 +1,10 @@
$dxil_dll = cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 -no_logo && where dxil.dll" 2>&1
if ($dxil_dll -notmatch "dxil.dll$") {
Write-Output "Couldn't get path to dxil.dll"
exit 1
}
$env:Path = "$(Split-Path $dxil_dll);$env:Path"
# VK_ICD_FILENAMES environment variable is not used when running with
# elevated privileges. Add a key to the registry instead.
$hkey_path = "HKLM:\SOFTWARE\Khronos\Vulkan\Drivers\"

View File

@@ -83,5 +83,6 @@ Copy-Item ".\.gitlab-ci\windows\spirv2dxil_check.ps1" -Destination $installdir
Copy-Item ".\.gitlab-ci\windows\spirv2dxil_run.ps1" -Destination $installdir
Copy-Item ".\.gitlab-ci\windows\deqp_runner_run.ps1" -Destination $installdir
Copy-Item ".\src\microsoft\ci\deqp-dozen.toml" -Destination $installdir
Get-ChildItem -Recurse -Filter "ci" | Get-ChildItem -Include "*.txt","*.toml" | Copy-Item -Destination $installdir
Get-ChildItem -Recurse -Filter "ci" | Get-ChildItem -Filter "*.txt" | Copy-Item -Destination $installdir

View File

@@ -64,9 +64,10 @@ if (!$?) {
}
Push-Location -Path ".\deps\libva"
Write-Host "Checking out libva df3c584bb79d1a1e521372d62fa62e8b1c52ce6c"
# libva-win32 is released with libva version 2.17 (see https://github.com/intel/libva/releases/tag/2.17.0)
git checkout 2.17.0
Write-Host "Checking out libva commit 2579eb0f77897dc01a02c1e43defc63c40fd2988"
# Checking out commit hash with libva-win32 support
# This feature will be released with libva version 2.17
git checkout 2579eb0f77897dc01a02c1e43defc63c40fd2988
Pop-Location
Write-Host "Building libva"

View File

@@ -1,36 +1,33 @@
Get-Date
Write-Host "Cloning Waffle"
Write-Host "Downloading Freeglut"
$freeglut_zip = 'freeglut-MSVC.zip'
$freeglut_url = "https://www.transmissionzero.co.uk/files/software/development/GLUT/$freeglut_zip"
For ($i = 0; $i -lt 5; $i++) {
Invoke-WebRequest -Uri $freeglut_url -OutFile $freeglut_zip
$freeglut_downloaded = $?
if ($freeglut_downloaded) {
Break
}
}
if (!$freeglut_downloaded) {
Write-Host "Failed to download Freeglut"
Exit 1
}
Get-Date
Write-Host "Installing Freeglut"
Expand-Archive $freeglut_zip -DestinationPath C:\
if (!$?) {
Write-Host "Failed to install Freeglut"
Exit 1
}
$MyPath = $MyInvocation.MyCommand.Path | Split-Path -Parent
. "$MyPath\mesa_vs_init.ps1"
git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/waffle.git 'C:\src\waffle'
if (!$?) {
Write-Host "Failed to clone Waffle repository"
Exit 1
}
Push-Location -Path C:\src\waffle
git checkout 950a1f35a718bc2a8e1dda75845e52651bb331a7
Pop-Location
Get-Date
$waffle_build = New-Item -ItemType Directory -Path "C:\src\waffle" -Name "build"
Push-Location -Path $waffle_build.FullName
Write-Host "Compiling Waffle"
meson setup `
--buildtype=release `
--default-library=static `
--prefix="C:\Waffle" && `
ninja -j32 install
$buildstatus = $?
Pop-Location
Remove-Item -Recurse -Path $waffle_build
if (!$buildstatus) {
Write-Host "Failed to compile or install Waffle"
Exit 1
}
Get-Date
Write-Host "Downloading glext.h"
New-Item -ItemType Directory -Path ".\glext" -Name "GL"
@@ -39,31 +36,39 @@ Invoke-WebRequest -Uri 'https://www.khronos.org/registry/OpenGL/api/GL/glext.h'
Get-Date
Write-Host "Cloning Piglit"
git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/piglit.git 'C:\piglit'
git clone --no-progress --single-branch --no-checkout https://gitlab.freedesktop.org/mesa/piglit.git 'C:\src\piglit'
if (!$?) {
Write-Host "Failed to clone Piglit repository"
Exit 1
}
Push-Location -Path C:\piglit
git checkout b41accc83689966f91217fc5b57dbe06202b8c8c
Push-Location -Path C:\src\piglit
git checkout f7f2a6c2275cae023a27b6cc81be3dda8c99492d
Pop-Location
Get-Date
$piglit_build = New-Item -ItemType Directory -Path "C:\src\piglit" -Name "build"
Push-Location -Path $piglit_build.FullName
Write-Host "Compiling Piglit"
cmake -S . -B . `
cmake .. `
-GNinja `
-DCMAKE_BUILD_TYPE=Release `
-DPIGLIT_USE_WAFFLE=ON `
-DWaffle_INCLUDE_DIRS=C:\Waffle\include\waffle-1 `
-DWaffle_LDFLAGS=C:\Waffle\lib\libwaffle-1.a `
-DCMAKE_INSTALL_PREFIX="C:\Piglit" `
-DGLUT_INCLUDE_DIR=C:\freeglut\include `
-DGLUT_glut_LIBRARY_RELEASE=C:\freeglut\lib\x64\freeglut.lib `
-DGLEXT_INCLUDE_DIR=.\glext && `
ninja -j32
$buildstatus = $?
ninja -j32 install | Out-Null
$installstatus = $?
Pop-Location
if (!$buildstatus) {
Write-Host "Failed to compile Piglit"
Remove-Item -Recurse -Path $piglit_build
if (!$buildstatus -Or !$installstatus) {
Write-Host "Failed to compile or install Piglit"
Exit 1
}
Copy-Item -Path C:\freeglut\bin\x64\freeglut.dll -Destination C:\Piglit\lib\piglit\bin\freeglut.dll
Get-Date
Write-Host "Cloning spirv-samples"
git clone --no-progress --single-branch --no-checkout https://github.com/dneto0/spirv-samples.git C:\spirv-samples\
@@ -99,8 +104,8 @@ cmake -S $($deqp_source) `
ninja -j32
$buildstatus = $?
Pop-Location
if (!$buildstatus) {
Write-Host "Failed to compile deqp"
if (!$buildstatus -Or !$installstatus) {
Write-Host "Failed to compile or install deqp"
Exit 1
}
@@ -130,50 +135,5 @@ Write-Host "Installing deqp-runner"
$env:Path += ";$($env:USERPROFILE)\.cargo\bin"
cargo install --git https://gitlab.freedesktop.org/anholt/deqp-runner.git
Get-Date
Write-Host "Downloading DirectX 12 Agility SDK"
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.D3D12/1.706.3-preview -OutFile 'agility.zip'
Expand-Archive -Path 'agility.zip' -DestinationPath 'C:\agility'
Remove-Item 'agility.zip'
$piglit_bin = 'C:\Piglit\bin'
$vk_cts_bin = "$deqp_build\external\vulkancts\modules\vulkan"
# Copy Agility SDK into subfolder of piglit and Vulkan CTS
$agility_dest = New-Item -ItemType Directory -Path $piglit_bin -Name 'D3D12'
Copy-Item 'C:\agility\build\native\bin\x64\*.dll' -Destination $agility_dest
$agility_dest = New-Item -ItemType Directory -Path $vk_cts_bin -Name 'D3D12'
Copy-Item 'C:\agility\build\native\bin\x64\*.dll' -Destination $agility_dest
Remove-Item -Recurse 'C:\agility'
Get-Date
Write-Host "Downloading Updated WARP"
Invoke-WebRequest -Uri https://www.nuget.org/api/v2/package/Microsoft.Direct3D.WARP/1.0.2 -OutFile 'warp.zip'
Expand-Archive -Path 'warp.zip' -DestinationPath 'C:\warp'
Remove-Item 'warp.zip'
# Copy WARP next to piglit and Vulkan CTS
Copy-Item 'C:\warp\build\native\amd64\d3d10warp.dll' -Destination $piglit_bin
Copy-Item 'C:\warp\build\native\amd64\d3d10warp.dll' -Destination $vk_cts_bin
Remove-Item -Recurse 'C:\warp'
Get-Date
Write-Host "Downloading DirectXShaderCompiler release"
Invoke-WebRequest -Uri https://github.com/microsoft/DirectXShaderCompiler/releases/download/v1.7.2207/dxc_2022_07_18.zip -OutFile 'DXC.zip'
Expand-Archive -Path 'DXC.zip' -DestinationPath 'C:\DXC'
# No more need to get dxil.dll from the VS install
Copy-Item 'C:\DXC\bin\x64\*.dll' -Destination 'C:\Windows\System32'
Get-Date
Write-Host "Enabling developer mode"
# Create AppModelUnlock if it doesn't exist, required for enabling Developer Mode
$RegistryKeyPath = "HKLM:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppModelUnlock"
if (-not(Test-Path -Path $RegistryKeyPath)) {
New-Item -Path $RegistryKeyPath -ItemType Directory -Force
}
# Add registry value to enable Developer Mode
New-ItemProperty -Path $RegistryKeyPath -Name AllowDevelopmentWithoutDevLicense -PropertyType DWORD -Value 1 -Force
Get-Date
Write-Host "Complete"

View File

@@ -1,13 +1,28 @@
$env:PIGLIT_NO_FAST_SKIP = 1
Copy-Item -Path _install\bin\opengl32.dll -Destination C:\Piglit\bin\opengl32.dll
Copy-Item -Path _install\bin\libgallium_wgl.dll -Destination C:\Piglit\bin\libgallium_wgl.dll
Copy-Item -Path _install\bin\libglapi.dll -Destination C:\Piglit\bin\libglapi.dll
Copy-Item -Path _install\bin\opengl32.dll -Destination C:\Piglit\lib\piglit\bin\opengl32.dll
Copy-Item -Path _install\bin\libgallium_wgl.dll -Destination C:\Piglit\lib\piglit\bin\libgallium_wgl.dll
Copy-Item -Path _install\bin\libglapi.dll -Destination C:\Piglit\lib\piglit\bin\libglapi.dll
deqp-runner suite --output .\logs --suite "_install/$env:PIGLIT_SUITE" `
--skips "_install/$env:PIGLIT_SKIPS" `
--baseline "_install/$env:PIGLIT_BASELINE" `
--flakes "_install/$env:PIGLIT_FLAKES"
if (!$?) {
# Run this using VsDevCmd.bat to ensure DXIL.dll is in %PATH%
cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 && py -3 C:\Piglit\bin\piglit.py run `"$env:PIGLIT_PROFILE`" $env:PIGLIT_OPTIONS $env:PIGLIT_TESTS .\results"
py -3 C:\Piglit\bin\piglit.py summary console .\results | Select -SkipLast 1 | Select-String -NotMatch -Pattern ': pass' | Set-Content -Path .\result.txt
$reference = Get-Content ".\_install\$env:PIGLIT_RESULTS.txt"
$result = Get-Content .\result.txt
if (-Not ($reference -And $result)) {
Exit 1
}
$diff = Compare-Object -ReferenceObject $reference -DifferenceObject $result
if (-Not $diff) {
Exit 0
}
py -3 C:\Piglit\bin\piglit.py summary html --exclude-details=pass .\summary .\results
Write-Host "Unexpected change in results:"
Write-Output $diff | Format-Table -Property SideIndicator,InputObject -Wrap
Exit 1

View File

@@ -1,3 +1,11 @@
# Ensure that dxil.dll in on the %PATH%
$dxil_dll = cmd.exe /C "C:\BuildTools\Common7\Tools\VsDevCmd.bat -host_arch=amd64 -arch=amd64 -no_logo && where dxil.dll" 2>&1
if ($dxil_dll -notmatch "dxil.dll$") {
Write-Output "Couldn't get path to dxil.dll"
exit 1
}
$env:Path = "$(Split-Path $dxil_dll);$env:Path"
$exec_mode_to_stage = @{ Fragment = "fragment"; Vertex = "vertex"; GLCompute = "compute" }
$spvasm_files = (Get-ChildItem C:\spirv-samples\spvasm\*.spvasm) | Sort-Object Name

File diff suppressed because it is too large Load Diff

View File

@@ -123,8 +123,8 @@ meson.build @dbaker @eric
/src/gallium/drivers/freedreno/ @robclark
# Imagination
/include/drm-uapi/pvr_drm.h @CreativeCylon @frankbinns @MTCoster
/src/imagination/ @CreativeCylon @frankbinns @MTCoster
/include/drm-uapi/pvr_drm.h @CreativeCylon @frankbinns
/src/imagination/ @CreativeCylon @frankbinns
/src/imagination/rogue/ @simon-perretta-img
# Intel

View File

@@ -1 +1 @@
23.0.1
22.3.7

View File

@@ -45,26 +45,24 @@ def is_commit_valid(commit: str) -> bool:
return ret == 0
def branch_has_commit(upstream_branch: str, commit: str) -> bool:
def branch_has_commit(upstream: str, branch: str, commit: str) -> bool:
"""
Returns True if the commit is actually present in the branch
"""
ret = subprocess.call(['git', 'merge-base', '--is-ancestor',
commit, upstream_branch],
commit, upstream + '/' + branch],
stdout=subprocess.DEVNULL,
stderr=subprocess.DEVNULL)
return ret == 0
def branch_has_backport_of_commit(upstream_branch: str, commit: str) -> str:
def branch_has_backport_of_commit(upstream: str, branch: str, commit: str) -> str:
"""
Returns the commit hash if the commit has been backported to the branch,
or an empty string if is hasn't
"""
upstream, _ = upstream_branch.split('/', 1)
out = subprocess.check_output(['git', 'log', '--format=%H',
upstream + '..' + upstream_branch,
upstream + '..' + upstream + '/' + branch,
'--grep', 'cherry picked from commit ' + commit],
stderr=subprocess.DEVNULL)
return out.decode().strip()
@@ -127,15 +125,17 @@ if __name__ == "__main__":
help='colorize output (default: true if stdout is a terminal)')
args = parser.parse_args()
if branch_has_commit(args.branch, args.commit):
print_(args, True, 'Commit ' + args.commit + ' is in branch ' + args.branch)
upstream, branch = args.branch.split('/', 1)
if branch_has_commit(upstream, branch, args.commit):
print_(args, True, 'Commit ' + args.commit + ' is in branch ' + branch)
exit(0)
backport = branch_has_backport_of_commit(args.branch, args.commit)
backport = branch_has_backport_of_commit(upstream, branch, args.commit)
if backport:
print_(args, True,
'Commit ' + args.commit + ' was backported to branch ' + args.branch + ' as commit ' + backport)
'Commit ' + args.commit + ' was backported to branch ' + branch + ' as commit ' + backport)
exit(0)
print_(args, False, 'Commit ' + args.commit + ' is NOT in branch ' + args.branch)
print_(args, False, 'Commit ' + args.commit + ' is NOT in branch ' + branch)
exit(1)

View File

@@ -88,31 +88,33 @@ def test_is_commit_valid(commit: str, expected: bool) -> None:
@pytest.mark.parametrize(
'branch, commit, expected',
[
(get_upstream() + '/20.1', '20.1-branchpoint', True),
(get_upstream() + '/20.1', '20.0', False),
(get_upstream() + '/20.1', 'main', False),
(get_upstream() + '/20.1', 'e58a10af640ba58b6001f5c5ad750b782547da76', True),
(get_upstream() + '/20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', True),
(get_upstream() + '/staging/20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', True),
(get_upstream() + '/20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', False),
(get_upstream() + '/main', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', True),
(get_upstream() + '/20.0', 'd043d24654c851f0be57dbbf48274b5373dea42b', False),
('20.1', '20.1-branchpoint', True),
('20.1', '20.0', False),
('20.1', 'main', False),
('20.1', 'e58a10af640ba58b6001f5c5ad750b782547da76', True),
('20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', True),
('staging/20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', True),
('20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', False),
('main', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', True),
('20.0', 'd043d24654c851f0be57dbbf48274b5373dea42b', False),
])
def test_branch_has_commit(branch: str, commit: str, expected: bool) -> None:
assert branch_has_commit(branch, commit) == expected
upstream = get_upstream()
assert branch_has_commit(upstream, branch, commit) == expected
@pytest.mark.parametrize(
'branch, commit, expected',
[
(get_upstream() + '/20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', 'd043d24654c851f0be57dbbf48274b5373dea42b'),
(get_upstream() + '/staging/20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', 'd043d24654c851f0be57dbbf48274b5373dea42b'),
(get_upstream() + '/20.1', '20.1-branchpoint', ''),
(get_upstream() + '/20.1', '20.0', ''),
(get_upstream() + '/20.1', '20.2', 'abac4859618e02aea00f705b841a7c5c5007ad1a'),
(get_upstream() + '/20.1', 'main', ''),
(get_upstream() + '/20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', ''),
(get_upstream() + '/20.0', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', '8cd4f57381cefe69019a3282d457d5bda3644030'),
('20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', 'd043d24654c851f0be57dbbf48274b5373dea42b'),
('staging/20.1', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', 'd043d24654c851f0be57dbbf48274b5373dea42b'),
('20.1', '20.1-branchpoint', ''),
('20.1', '20.0', ''),
('20.1', '20.2', ''),
('20.1', 'main', ''),
('20.1', 'd043d24654c851f0be57dbbf48274b5373dea42b', ''),
('20.0', 'dd2bd68fa69124c86cd008b256d06f44fab8e6cd', ''),
])
def test_branch_has_backport_of_commit(branch: str, commit: str, expected: bool) -> None:
assert branch_has_backport_of_commit(branch, commit) == expected
upstream = get_upstream()
assert branch_has_backport_of_commit(upstream, branch, commit) == expected

View File

@@ -217,10 +217,7 @@ async def parse_issues(commits: str) -> typing.List[str]:
async def gather_bugs(version: str) -> typing.List[str]:
commits = await gather_commits(version)
if commits:
issues = await parse_issues(commits)
else:
issues = []
issues = await parse_issues(commits)
loop = asyncio.get_event_loop()
async with aiohttp.ClientSession(loop=loop) as session:
@@ -298,7 +295,7 @@ def calculate_previous_version(version: str, is_point: bool) -> str:
def get_features(is_point_release: bool) -> typing.Generator[str, None, None]:
p = pathlib.Path('docs') / 'relnotes' / 'new_features.txt'
p = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / 'new_features.txt'
if p.exists() and p.stat().st_size > 0:
if is_point_release:
print("WARNING: new features being introduced in a point release", file=sys.stderr)
@@ -336,7 +333,7 @@ def update_release_notes_index(version: str) -> None:
async def main() -> None:
v = pathlib.Path('VERSION')
v = pathlib.Path(__file__).parent.parent / 'VERSION'
with v.open('rt') as f:
raw_version = f.read().strip()
is_point_release = '-rc' not in raw_version
@@ -353,7 +350,7 @@ async def main() -> None:
gather_bugs(previous_version),
)
final = pathlib.Path('docs') / 'relnotes' / f'{this_version}.rst'
final = pathlib.Path(__file__).parent.parent / 'docs' / 'relnotes' / f'{this_version}.rst'
with final.open('wt') as f:
try:
f.write(TEMPLATE.render(
@@ -371,7 +368,6 @@ async def main() -> None:
))
except:
print(exceptions.text_error_template().render())
return
subprocess.run(['git', 'add', final])

View File

@@ -118,25 +118,24 @@ SOURCES = [
'api': 'opencl',
'inc_folder': 'CL',
'sources': [
Source('include/CL/opencl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/opencl.h'),
Source('include/CL/cl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl.h'),
Source('include/CL/cl_platform.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_platform.h'),
Source('include/CL/cl_gl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_gl.h'),
Source('include/CL/cl_gl_ext.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_gl_ext.h'),
Source('include/CL/cl_ext.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_ext.h'),
Source('include/CL/cl_version.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_version.h'),
Source('include/CL/cl_icd.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_icd.h'),
Source('include/CL/cl_egl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_egl.h'),
Source('include/CL/cl_d3d10.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_d3d10.h'),
Source('include/CL/cl_d3d11.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_d3d11.h'),
Source('include/CL/cl_dx9_media_sharing.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_dx9_media_sharing.h'),
Source('include/CL/cl_dx9_media_sharing_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_dx9_media_sharing_intel.h'),
Source('include/CL/cl_ext_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_ext_intel.h'),
Source('include/CL/cl_va_api_media_sharing_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/main/CL/cl_va_api_media_sharing_intel.h'),
Source('include/CL/opencl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/opencl.h'),
Source('include/CL/cl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl.h'),
Source('include/CL/cl_platform.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_platform.h'),
Source('include/CL/cl_gl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_gl.h'),
Source('include/CL/cl_gl_ext.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_gl_ext.h'),
Source('include/CL/cl_ext.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_ext.h'),
Source('include/CL/cl_version.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_version.h'),
Source('include/CL/cl_icd.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_icd.h'),
Source('include/CL/cl_egl.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_egl.h'),
Source('include/CL/cl_d3d10.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_d3d10.h'),
Source('include/CL/cl_d3d11.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_d3d11.h'),
Source('include/CL/cl_dx9_media_sharing.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_dx9_media_sharing.h'),
Source('include/CL/cl_dx9_media_sharing_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_dx9_media_sharing_intel.h'),
Source('include/CL/cl_ext_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_ext_intel.h'),
Source('include/CL/cl_va_api_media_sharing_intel.h', 'https://github.com/KhronosGroup/OpenCL-Headers/raw/master/CL/cl_va_api_media_sharing_intel.h'),
Source('include/CL/cl.hpp', 'https://github.com/KhronosGroup/OpenCL-CLHPP/raw/5f3cc41df821a3e5988490232082a3e3b82c0283/include/CL/cl.hpp'),
Source('include/CL/cl2.hpp', 'https://github.com/KhronosGroup/OpenCL-CLHPP/raw/main/include/CL/cl2.hpp'),
Source('include/CL/opencl.hpp', 'https://github.com/KhronosGroup/OpenCL-CLHPP/raw/main/include/CL/opencl.hpp'),
Source('include/CL/cl.hpp', 'https://github.com/KhronosGroup/OpenCL-CLHPP/raw/master/include/CL/cl.hpp'),
Source('include/CL/cl2.hpp', 'https://github.com/KhronosGroup/OpenCL-CLHPP/raw/master/include/CL/cl2.hpp'),
],
},

View File

@@ -20,16 +20,11 @@
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
import argparse
import os
def main():
parser = argparse.ArgumentParser()
parser.add_argument('version_dir', help="Directory with VERSION file")
args = parser.parse_args()
filename = os.path.join(args.version_dir, 'VERSION')
filename = os.path.join(os.environ['MESON_SOURCE_ROOT'], 'VERSION')
with open(filename) as f:
version = f.read().strip()
print(version, end='')

View File

@@ -6,8 +6,17 @@
import docutils.nodes
import sphinx.addnodes
from sphinx.util.nodes import split_explicit_title
from docutils import nodes, utils
def parse_envvar(env, sig, signode):
envvar, t, default = sig.split(" ", 2)
envvar = envvar.strip().upper()
t = "Type: %s" % t.strip(" <>").lower()
default = "Default: %s" % default.strip(" ()")
signode += sphinx.addnodes.desc_name(envvar, envvar)
signode += docutils.nodes.Text(' ')
signode += sphinx.addnodes.desc_type(t, t)
signode += docutils.nodes.Text(', ')
signode += sphinx.addnodes.desc_annotation(default, default)
return envvar
def parse_opcode(env, sig, signode):
opcode, desc = sig.split("-", 1)
@@ -17,23 +26,8 @@ def parse_opcode(env, sig, signode):
signode += sphinx.addnodes.desc_annotation(desc, desc)
return opcode
def ext_role(name, rawtext, text, lineno, inliner, options={}, content=[]):
text = utils.unescape(text)
has_explicit_title, title, ext = split_explicit_title(text)
parts = ext.split('_', 2)
if parts[0] == 'VK':
full_url = f'https://registry.khronos.org/vulkan/specs/1.3-extensions/man/html/{ext}.html'
elif parts[0] == 'GL':
full_url = f'https://registry.khronos.org/OpenGL/extensions/{parts[1]}/{parts[1]}_{parts[2]}.txt'
else:
raise Exception(f'Unexpected API: {parts[0]}')
pnode = nodes.reference(title, title, internal=False, refuri=full_url)
return [pnode], []
def setup(app):
app.add_object_type("envvar", "envvar", "%s (environment variable)",
parse_envvar)
app.add_object_type("opcode", "opcode", "%s (TGSI opcode)",
parse_opcode)
app.add_role('ext', ext_role)

View File

@@ -3,7 +3,7 @@ Amber Branch
After Mesa 21.3, all non-Gallium DRI drivers were removed from the Mesa
source-tree. These drivers are still being maintained to some degree,
but only on the ``amber`` branch, and only for critical fixes.
but only on the 21.3.x branch, and only for critical fixes.
These drivers include:
@@ -39,8 +39,8 @@ enable that logic, you need to pass the ``-Damber=true`` flag to Meson.
Documentation
-------------
On `docs.mesa3d.org <https://docs.mesa3d.org/>`__, we currently only
On `docs.mesa3d.org <https://docs.mesa3d.org/>`, we currently only
publish the documentation from our main branch. But you can view the
documentation for the Amber branch `here
<https://gitlab.freedesktop.org/mesa/mesa/-/tree/amber/docs>`__.
<https://gitlab.freedesktop.org/mesa/mesa/-/tree/21.3/docs>`_.

View File

@@ -1,13 +1,13 @@
LAVA CI
=======
`LAVA <https://www.lavasoftware.org/>`__ is a system for functional
testing of boards including deploying custom bootloaders and kernels.
This is particularly relevant to testing Mesa because we often need
to change kernels for UAPI changes (and this lets us do full testing
of a new kernel during development), and our workloads can easily
take down boards when mistakes are made (kernel oopses, OOMs that
take out critical system services).
`LAVA <https://lavasoftware.org/>`_ is a system for functional testing
of boards including deploying custom bootloaders and kernels. This is
particularly relevant to testing Mesa because we often need to change
kernels for UAPI changes (and this lets us do full testing of a new
kernel during development), and our workloads can easily take down
boards when mistakes are made (kernel oopses, OOMs that take out
critical system services).
Mesa-LAVA software architecture
-------------------------------

View File

@@ -34,7 +34,7 @@ initramfs) for trace replay testing. Given that we need networking already, and
our dEQP/Piglit/etc. payload is large, we use NFS from the x86 runner system
rather than initramfs.
See ``src/freedreno/ci/gitlab-ci.yml`` for an example of fastboot on DB410c and
See `src/freedreno/ci/gitlab-ci.yml` for an example of fastboot on DB410c and
DB820c (freedreno-a306 and freedreno-a530).
Requirements (Servo)
@@ -74,7 +74,7 @@ call "servo"::
dhcp-option=tag:cheza1,option:root-path,/srv/nfs/cheza1
dhcp-option=tag:cheza2,option:root-path,/srv/nfs/cheza2
See ``src/freedreno/ci/gitlab-ci.yml`` for an example of Servo on cheza. Note
See `src/freedreno/ci/gitlab-ci.yml` for an example of Servo on cheza. Note
that other Servo boards in CI are managed using LAVA.
Requirements (POE)
@@ -124,12 +124,12 @@ With that set up, you should be able to power on/off a port with something like:
Note that the "1.3.6..." SNMP OID changes between switches. The last digit
above is the interface id (port number). You can probably find the right OID by
google, that was easier than figuring it out from finding the switch's MIB
database. You can query the POE status from the switch serial using the ``show
power inline`` command.
database. You can query the POE status from the switch serial using the `show
power inline` command.
Other than that, find the dnsmasq/tftp/NFS setup for your boards "servo" above.
See ``src/broadcom/ci/gitlab-ci.yml`` and ``src/nouveau/ci/gitlab-ci.yml`` for an
See `src/broadcom/ci/gitlab-ci.yml` and `src/nouveau/ci/gitlab-ci.yml` for an
examples of POE for Raspberry Pi 3/4, and Jetson Nano.
Setup

View File

@@ -3,7 +3,7 @@ Docker CI
For LLVMpipe and Softpipe CI, we run tests in a container containing
VK-GL-CTS, on the shared GitLab runners provided by `freedesktop
<https://freedesktop.org>`__
<http://freedesktop.org>`_
Software architecture
---------------------
@@ -53,7 +53,7 @@ step across multiple test runs. Since the images are large and change
approximately weekly, the DUTs also need to be running some script to
prune stale Docker images periodically in order to not run out of disk
space as we rev those containers (perhaps `this script
<https://gitlab.com/gitlab-org/gitlab-runner/-/issues/2980#note_169233611>`__).
<https://gitlab.com/gitlab-org/gitlab-runner/issues/2980#note_169233611>`_).
Note that Docker doesn't allow containers to be stored on NFS, and
doesn't allow multiple Docker daemons to interact with the same

View File

@@ -59,7 +59,7 @@ The CI replays application traces with various drivers in two different jobs. Th
job replays traces listed in ``src/<driver>/ci/traces-<driver>.yml`` files and if any
of those traces fail the pipeline fails as well. The second job replays traces listed in
``src/<driver>/ci/restricted-traces-<driver>.yml`` and it is allowed to fail. This second
job is only created when the pipeline is triggered by ``marge-bot`` or any other user that
job is only created when the pipeline is triggered by `marge-bot` or any other user that
has been granted access to these traces.
A traces YAML file also includes a ``download-url`` pointing to a MinIO
@@ -173,7 +173,7 @@ faster personal machine as a runner. You can find the gitlab-runner
package in Debian, or use GitLab's own builds.
To do so, follow `GitLab's instructions
<https://docs.gitlab.com/ee/ci/runners/runners_scope.html#create-a-specific-runner>`__ to
<https://docs.gitlab.com/ce/ci/runners/#create-a-specific-runner>`__ to
register your personal GitLab runner in your Mesa fork. Then, tell
Mesa how many jobs it should serve (``concurrent=``) and how many
cores those jobs should use (``FDO_CI_CONCURRENT=``) by editing these
@@ -191,7 +191,7 @@ Docker caching
The CI system uses Docker images extensively to cache
infrequently-updated build content like the CTS. The `freedesktop.org
CI templates
<https://gitlab.freedesktop.org/freedesktop/ci-templates/>`__ help us
<https://gitlab.freedesktop.org/freedesktop/ci-templates/>`_ help us
manage the building of the images to reduce how frequently rebuilds
happen, and trim down the images (stripping out manpages, cleaning the
apt cache, and other such common pitfalls of building Docker images).
@@ -199,7 +199,7 @@ apt cache, and other such common pitfalls of building Docker images).
When running a container job, the templates will look for an existing
build of that image in the container registry under
``MESA_IMAGE_TAG``. If it's found it will be reused, and if
not, the associated ``.gitlab-ci/containers/<jobname>.sh`` will be run
not, the associated `.gitlab-ci/containers/<jobname>.sh`` will be run
to build it. So, when developing any change to container build
scripts, you need to update the associated ``MESA_IMAGE_TAG`` to
a new unique string. We recommend using the current date plus some
@@ -211,7 +211,7 @@ When developing a given change to your Docker image, you would have to
bump the tag on each ``git commit --amend`` to your development
branch, which can get tedious. Instead, you can navigate to the
`container registry
<https://gitlab.freedesktop.org/mesa/mesa/container_registry>`__ for
<https://gitlab.freedesktop.org/mesa/mesa/container_registry>`_ for
your repository and delete the tag to force a rebuild. When your code
is eventually merged to main, a full image rebuild will occur again
(forks inherit images from the main repo, but MRs don't propagate

View File

@@ -18,8 +18,8 @@ Linux mainline, that is why Mesa has its own kernel version which should be used
as the base for newer kernels.
So, one should base the kernel uprev from the last tag used in the Mesa CI,
please refer to ``.gitlab-ci/container/gitlab-ci.yml`` ``KERNEL_URL`` variable.
Every tag has a standard naming: ``vX.YZ-for-mesa-ci-<commit_short_SHA>``, which
please refer to `.gitlab-ci/container/gitlab-ci.yml` `KERNEL_URL` variable.
Every tag has a standard naming: `vX.YZ-for-mesa-ci-<commit_short_SHA>`, which
can be created via the command:
:code:`git tag vX.YZ-for-mesa-ci-$(git rev-parse --short HEAD)`
@@ -28,7 +28,7 @@ Building Kernel
---------------
When Mesa CI generates a new rootfs image, the Linux Kernel is built based on
the script located at ``.gitlab-ci/container/build-kernel.sh``.
the script located at `.gitlab-ci/container/build-kernel.sh`.
Updating Kconfigs
^^^^^^^^^^^^^^^^^
@@ -36,7 +36,7 @@ Updating Kconfigs
When a Kernel uprev happens, it is worth compiling and cross-compiling the
Kernel locally, in order to update the Kconfigs accordingly. Remember that the
resulting Kconfig is a merge between *Mesa CI Kconfig* and *Linux tree
defconfig* made via ``merge_config.sh`` script located at Linux Kernel tree.
defconfig* made via `merge_config.sh` script located at Linux Kernel tree.
Kconfigs location
"""""""""""""""""
@@ -70,9 +70,9 @@ Development routine
1. Compile the newer kernel locally for each platform.
2. Compile device trees for ARM platforms
3. Update Kconfigs. Are new Kconfigs necessary? Is CONFIG_XYZ_BLA deprecated? Does the ``merge_config.sh`` override an important config?
3. Update Kconfigs. Are new Kconfigs necessary? Is CONFIG_XYZ_BLA deprecated? Does the `merge_config.sh` override an important config?
4. Push a new development branch to `Kernel repository`_ based on the latest kernel tag used in GitLab CI
5. Hack ``build-kernel.sh`` script to clone kernel from your development branch
5. Hack `build-kernel.sh` script to clone kernel from your development branch
6. Update image tags. See `Updating image tags`_
7. Run the entire CI pipeline, all the automatic jobs should be green. If some job is red or taking too long, you will need to investigate it and probably ask for help.
@@ -80,7 +80,7 @@ When the Kernel uprev is stable
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
1. Push a new tag to Mesa CI `Kernel repository`_
2. Update KERNEL_URL ``debian/x86_test-gl`` job definition
2. Update KERNEL_URL `debian/x86_test-gl` job definition
3. Open a merge request, if it is not opened yet
Tips and Tricks
@@ -107,15 +107,15 @@ Bare-metal custom kernels
Some CI jobs have support to plug in a custom kernel by simply changing a variable.
This is great, since rebuilding the kernel and rootfs may takes dozens of minutes.
For example, Freedreno jobs ``gitlab.yml`` manifest support a variable named
``BM_KERNEL``. If one puts a gz-compressed kernel URL there, the job will use that
kernel to boot the Freedreno bare-metal devices. The same works for ``BM_DTB`` in
For example, Freedreno jobs `gitlab.yml` manifest support a variable named
`BM_KERNEL`. If one puts a gz-compressed kernel URL there, the job will use that
kernel to boot the Freedreno bare-metal devices. The same works for `BM_DTB` in
the case of device tree binaries.
Careful reading of the job logs
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Sometimes a job may turn to red for reasons unrelated to the kernel update, e.g.
LAVA ``tftp`` timeout, problems with the freedesktop servers etc.
LAVA `tftp` timeout, problems with the freedesktop servers etc.
So it is important to see the reason why the job turned red, and retry it if an
infrastructure error has happened.

View File

@@ -3,10 +3,10 @@ Running traces on a local machine
Prerequisites
-------------
- Install `Apitrace <https://apitrace.github.io/>`__
- Install `Renderdoc <https://renderdoc.org/>`__ (only needed for some traces)
- Download and compile `Piglit <https://gitlab.freedesktop.org/mesa/piglit>`__ and install his `dependencies <https://gitlab.freedesktop.org/mesa/piglit#2-setup>`__
- Download traces you want to replay from `traces-db <https://gitlab.freedesktop.org/gfx-ci/tracie/traces-db/>`__
- Install `Apitrace <https://apitrace.github.io/>`_
- Install `Renderdoc <https://renderdoc.org/>`_ (only needed for some traces)
- Download and compile `Piglit <https://gitlab.freedesktop.org/mesa/piglit>`_ and install his `dependencies <https://gitlab.freedesktop.org/mesa/piglit#2-setup>`_
- Download traces you want to replay from `traces-db <https://gitlab.freedesktop.org/gfx-ci/tracie/traces-db/>`_
Running single trace
--------------------
@@ -16,7 +16,7 @@ A simple run to see the output of the trace can be done with
apitrace replay -w name_of_trace.trace
For more information, look into the `Apitrace documentation <https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown>`__.
For more information, look into the `Apitrace documentation <https://github.com/apitrace/apitrace/blob/master/docs/USAGE.markdown>`_.
For comparing checksums use:
@@ -32,7 +32,7 @@ Simulating CI trace job
Sometimes it's useful to be able to test traces on your local machine instead of the Mesa CI runner. To simulate the CI environment as closely as possible.
Download the YAML file from your driver's ``ci/`` directory and then change the path in the YAML file from local proxy or MinIO to the local directory (url-like format ``file://``)
Download the YAML file from your driver's `ci/` directory and then change the path in the YAML file from local proxy or MinIO to the local directory (url-like format ``file://``)
.. code-block:: console

View File

@@ -1,33 +1,101 @@
SkQP
====
`SkQP <https://skia.org/docs/dev/testing/skqp/>`__ stands for SKIA Quality
`SkQP <https://skia.org/docs/dev/testing/skqp/>`_ stands for SKIA Quality
Program conformance tests. Basically, it has sets of rendering tests and unit
tests to ensure that `SKIA <https://skia.org/>`__ is meeting its design specifications on a specific
tests to ensure that `SKIA <https://skia.org/>`_ is meeting its design specifications on a specific
device.
The rendering tests have support for GL, GLES and Vulkan backends and test some
rendering scenarios.
And the unit tests check the GPU behavior without rendering images, using any of the GL/GLES or Vulkan drivers.
And the unit tests check the GPU behavior without rendering images.
Tests
-----
Render tests design
^^^^^^^^^^^^^^^^^^^
It is worth noting that `rendertests.txt` can bring some detail about each test
expectation, so each test can have a max pixel error count, to tell SkQP that it
is OK to have at most that number of errors for that test. See also:
https://github.com/google/skia/blob/c29454d1c9ebed4758a54a69798869fa2e7a36e0/tools/skqp/README_ALGORITHM.md
.. _test-location:
Location
^^^^^^^^
Each `rendertests.txt` and `unittest.txt` file must be located inside a specific
subdirectory inside SkQP assets directory.
+--------------+--------------------------------------------+
| Test type | Location |
+==============+============================================+
| Render tests | `${SKQP_ASSETS_DIR}/skqp/rendertests.txt` |
+--------------+--------------------------------------------+
| Unit tests | `${SKQP_ASSETS_DIR}/skqp/unittests.txt` |
+--------------+--------------------------------------------+
The `skqp-runner.sh` script will make the necessary modifications to separate
`rendertests.txt` for each backend-driver combination. As long as the test files are located in the expected place:
+--------------+----------------------------------------------------------------------------------------------+
| Test type | Location |
+==============+==============================================================================================+
| Render tests | `${MESA_REPOSITORY_DIR}/src/${GPU_DRIVER}/ci/${GPU_VERSION}-${SKQP_BACKEND}_rendertests.txt` |
+--------------+----------------------------------------------------------------------------------------------+
| Unit tests | `${MESA_REPOSITORY_DIR}/src/${GPU_DRIVER}/ci/${GPU_VERSION}_unittests.txt` |
+--------------+----------------------------------------------------------------------------------------------+
Where `SKQP_BACKEND` can be:
- gl: for GL backend
- gles: for GLES backend
- vk: for Vulkan backend
Example file
""""""""""""
.. code-block:: console
src/freedreno/ci/freedreno-a630-skqp-gl_rendertests.txt
- GPU_DRIVER: `freedreno`
- GPU_VERSION: `freedreno-a630`
- SKQP_BACKEND: `gl`
.. _rendertests-design:
SkQP reports
------------
SkQP generates reports after finishing its execution, and deqp-runner collects
them in the job artifacts results directory under the test name. Click the
'Browse' button from a failing job to get to them.
SkQP generates reports after finishing its execution, they are located at the job
artifacts results directory and are divided in subdirectories by rendering tests
backends and unit
tests. The job log has links to every generated report in order to facilitate
the SkQP debugging.
SkQP failing tests
------------------
Maintaining SkQP on Mesa CI
---------------------------
SkQP rendering tests will have a range of pixel values allowed for the driver's
rendering for a given test. This can make the "expected" image in the result
output look rather strange, but you should be able to make sense of it knowing
that.
SkQP is built alongside with another binary, namely `list_gpu_unit_tests`, it is
located in the same folder where `skqp` binary is.
In SkQP itself, testcases can have increased failing pixel thresholds added to
them to keep CI green when the rendering is "correct" but out of normal range.
However, we don't support changing the thresholds in our testing. Because any
driver rendering not meeting the normal thresholds will trigger Android CTS
failures, we treat them as failures and track them as expected failures the
```*-fails.txt`` file.`
This binary will generate the expected `unittests.txt` for the target GPU, so
ideally it should be executed on every SkQP update and when a new device
receives SkQP CI jobs.
1. Generate target unit tests for the current GPU with :code:`./list_gpu_unit_tests > unittests.txt`
2. Run SkQP job
3. If there is a failing or crashing unit test, remove it from the corresponding `unittests.txt`
4. If there is a crashing render test, remove it from the corresponding `rendertests.txt`
5. If there is a failing render test, visually inspect the result from the HTML report
- If the render result is OK, update the max error count for that test
- Otherwise, or put `-1` in the same threshold, as seen in :ref:`rendertests-design`
6. Remember to put the new tests files to the locations cited in :ref:`test-location`

View File

@@ -36,7 +36,7 @@ Basic formatting guidelines
- Use comments wherever you think it would be helpful for other
developers. Several specific cases and style examples follow. Note
that we roughly follow `Doxygen <https://www.doxygen.nl>`__
that we roughly follow `Doxygen <http://www.doxygen.nl>`__
conventions.
Single-line comments:

View File

@@ -89,9 +89,8 @@ todo_include_todos = False
# Disable highlighting unless a language is specified, otherwise we'll get
# python keywords highlit in literal blocks.
highlight_language = 'none'
highlight_language = "none"
default_role = 'c:expr'
# -- Options for HTML output ----------------------------------------------
@@ -100,7 +99,7 @@ default_role = 'c:expr'
#
html_theme = 'sphinx_rtd_theme'
html_favicon = 'favicon.ico'
html_favicon = "favicon.ico"
# Theme options are theme-specific and customize the look and feel of a theme
# further. For a list of options available for each theme, see the
@@ -140,19 +139,6 @@ html_redirects = [
]
# -- Options for linkcheck ------------------------------------------------
linkcheck_ignore = [
r'specs/.*\.spec', # gets copied during the build process
r'news:.*', # seems linkcheck doesn't like the news: URI-scheme...
r'http://mesa-ci-results.jf.intel.com', # only available for Intel employees
r'https://gitlab.com/.*#.*', # needs JS eval
r'https://gitlab.freedesktop.org/.*#.*', # needs JS eval
r'https://github.com/.*#.*', # needs JS eval
]
linkcheck_exclude_documents = [r'relnotes/.*']
# -- Options for HTMLHelp output ------------------------------------------
# Output file base name for HTML help builder.

View File

@@ -14,4 +14,4 @@ In your debugger you can set a breakpoint in ``_mesa_error()`` to trap
Mesa errors.
There is a display list printing/debugging facility. See the end of
``src/mesa/main/dlist.c`` for details.
``src/dlist.c`` for details.

View File

@@ -71,7 +71,7 @@ This can be implemented in just a few lines of C code. The file
{
const struct _glapi_table * const dispatch = GET_DISPATCH();
dispatch->Vertex3f(x, y, z);
(*dispatch->Vertex3f)(x, y, z);
}
The problem with this simple implementation is the large amount of
@@ -94,10 +94,10 @@ where each can or cannot be used are listed.
Starting with the 2.4.20 Linux kernel, each thread is allocated an area
of per-thread, global storage. Variables can be put in this area using
some extensions to GCC that called ``ELF TLS``. By storing the dispatch table
some extensions to GCC that called `ELF TLS`. By storing the dispatch table
pointer in this area, the expensive call to ``pthread_getspecific`` and
the test of ``_glapi_Dispatch`` can be avoided. As we don't support for
Linux kernel earlier than 2.4.20, so we can always using ``ELF TLS``.
Linux kernel earlier than 2.4.20, so we can always using `ELF TLS`.
The dispatch table pointer is stored in a new variable called
``_glapi_tls_Dispatch``. A new variable name is used so that a single

View File

@@ -5,7 +5,7 @@ Downloading
-----------
You can download the released versions of Mesa via
`HTTPS <https://archive.mesa3d.org/>`__ or
`HTTPS <https://mesa.freedesktop.org/archive/>`__ or
`FTP <ftp://ftp.freedesktop.org/pub/mesa/>`__.
Our release tarballs are GPG-signed, and the public keys are available

View File

@@ -7,9 +7,6 @@ Debugging
Here are a few environment variable debug environment variables
specific to ANV:
:envvar:`ANV_ENABLE_GENERATED_INDIRECT_DRAWS`
If defined to ``0`` or ``false``, this will disable the generated
indirect draw optimization in Anv. This will only affect Gfx11+.
:envvar:`ANV_ENABLE_PIPELINE_CACHE`
If defined to ``0`` or ``false``, this will disable pipeline
caching, forcing ANV to reparse and recompile any VkShaderModule
@@ -17,7 +14,7 @@ specific to ANV:
:envvar:`ANV_DISABLE_SECONDARY_CMD_BUFFER_CALLS`
If defined to ``1`` or ``true``, this will prevent usage of self
modifying command buffers to implement ``vkCmdExecuteCommands``. As
a result of this, it will also disable :ext:`VK_KHR_performance_query`.
a result of this, it will also disable ``VK_KHR_performance_query``.
:envvar:`ANV_ALWAYS_BINDLESS`
If defined to ``1`` or ``true``, this forces all descriptor sets to
use the internal `Bindless model`_.
@@ -31,7 +28,7 @@ specific to ANV:
Haswell, Cherryview).
:envvar:`ANV_PRIMITIVE_REPLICATION_MAX_VIEWS`
Specifies up to how many view shaders can be lowered to handle
:ext:`VK_KHR_multiview`. Beyond this number, multiview is implemented
VK_KHR_multiview. Beyond this number, multiview is implemented
using instanced rendering. If unspecified, the value default to
``2``.
@@ -41,7 +38,7 @@ Experimental features
:envvar:`ANV_EXPERIMENTAL_NV_MESH_SHADER`
If defined to ``1`` or ``true``, this advertise support for
:ext:`VK_NV_mesh_shader` extension for platforms that have hardware
VK_NV_mesh_shader extension for platforms that have hardware
support for it.
@@ -275,34 +272,3 @@ checking for ``ANV_CMD_DIRTY_PIPELINE``. It should only do so if it
requires to know some value that is coming from the
``anv_graphics_pipeline`` object that is not available from
``anv_dynamic_state``.
Generated indirect draws optimization
-------------------------------------
Indirect draws have traditionally been implemented on Intel HW by
loading the indirect parameters from memory into HW registers using
the command streamer's ``MI_LOAD_REGISTER_MEM`` instruction before
dispatching a draw call to the 3D pipeline.
On recent products, it was found that the command streamer is showing
as performance bottleneck, because it cannot dispatch draw calls fast
enough to keep the 3D pipeline busy.
The solution to this problem is to change the way we deal with
indirect draws. Instead of loading HW registers with values using the
command streamer, we generate entire set of ``3DPRIMITIVE``
instructions using a shader. The generated instructions contain the
entire draw call parameters. This way the command streamer executes
only ``3DPRIMITIVE`` instructions and doesn´t do any data loading from
memory or touch HW registers, feeding the 3D pipeline as fast as it
can.
In Anv this implemented by using a side batch buffer. When Anv
encounters the first indirect draws, it generates a jump into the side
batch, the side batch contains a draw call using a generation shader
for each indirect draw. We keep adding on more generation draws into
the batch until we have to stop due to command buffer end, secondary
command buffer calls or a barrier containing the access flag
``VK_ACCESS_INDIRECT_COMMAND_READ_BIT``. The side batch buffer jump
back right after the instruction where it was called.

View File

@@ -12,8 +12,6 @@ On macOS, the experimental Asahi driver may built with options:
To use, set the ``DYLD_LIBRARY_PATH`` environment variable:
.. code-block:: console
DYLD_LIBRARY_PATH=/Users/nobody/mesa/build/src/gallium/targets/libgl-xlib/ glmark2 --reuse-context
Only X11 apps are supported. XQuartz must be setup separately.
@@ -38,7 +36,7 @@ The library is only built if ``-Dtools=asahi`` is passed. It builds a single
For example, to trace an app ``./app``, run:
DYLD_INSERT_LIBRARIES=~/mesa/build/src/asahi/lib/libwrap.dylib ./app
DYLD_INSERT_LIBRARIES=~/mesa/build/src/asahi/lib/libwrap.dylib ./app
Hardware varyings
-----------------
@@ -152,15 +150,15 @@ within the compiler.
Fragment shader
```````````````
In the fragment shader, coefficient registers, identified by the prefix ``cf``
In the fragment shader, coefficient registers, identified by the prefix `cf`
followed by a decimal index, act as opaque handles to varyings. For flat
shading, coefficient registers may be loaded into general registers with the
``ldcf`` instruction. For smooth shading, the coefficient register corresponding
`ldcf` instruction. For smooth shading, the coefficient register corresponding
to the desired varying is passed as an argument to the "iterate" instruction
``iter`` in order to "iterate" (interpolate) a varying. As perspective correct
`iter` in order to "iterate" (interpolate) a varying. As perspective correct
interpolation also requires the W component of the fragment coordinate, the
coefficient register for W is passed as a second argument. As an example, if
there's a single varying to interpolate, an instruction like ``iter r0, cf1, cf0``
there's a single varying to interpolate, an instruction like `iter r0, cf1, cf0`
is used.
Iterator
@@ -277,30 +275,3 @@ logically. These extra levels pad out layers of 3D images to the size of the
first layer, simplifying layout calculations for both software and hardware.
Although the padding is logically unnecessary, it wastes little space compared
to the sizes of large mipmapped 3D textures.
drm-shim (Linux only)
---------------------
Mesa includes a library that mocks out the DRM UABI used by the Asahi driver
stack, allowing the Mesa driver to run on non-M1 Linux hardware. This can be
useful for exercising the compiler. To build, use options:
::
-Dgallium-drivers=asahi -Dtools=drm-shim
Then run an OpenGL workload with environment variable:
.. code-block:: console
LD_PRELOAD=~/mesa/build/src/asahi/drm-shim/libasahi_noop_drm_shim.so
For example to compile a shader with shaderdb and print some statistics along
with the IR:
.. code-block:: console
~/shader-db$ AGX_MESA_DEBUG=shaders,shaderdb ASAHI_MESA_DEBUG=precompile LIBGL_DRIVERS_PATH=~/lib/dri/ LD_PRELOAD=~/mesa/build/src/asahi/drm-shim/libasahi_noop_drm_shim.so ./run shaders/glmark/1-12.shader_test
The drm-shim implementation for Asahi is located in ``src/asahi/drm-shim``. The
drm-shim implementation there should be updated as new UABI is added.

View File

@@ -15,51 +15,47 @@ Debugging
There's a few tools that are useful for debugging D3D12, such as these
environment variables:
.. envvar:: D3D12_DEBUG
.. envvar:: D3D12_DEBUG <flags> ("")
Accepts the following comma-separated list of flags:
``verbose``
Enable verbose output to stdout
``blit``
Trace blit and copy resource calls
``experimental``
Enable experimental shader models feature
``dxil``
Dump DXIL during program compile
``disass``
Dump disassambly of created DXIL shader
``res``
Debug resources
``debuglayer``
Enable `debug layer`_
``gpuvalidator``
Enable `GPU validator`_
``verbose``
Enable verbose output to stdout
``blit``
Trace blit and copy resource calls
``experimental``
Enable experimental shader models feature
``dxil``
Dump DXIL during program compile
``disass``
Dump disassambly of created DXIL shader
``res``
Debug resources
``debuglayer``
Enable `debug layer`_
``gpuvalidator``
Enable `GPU validator`_
.. envvar:: DXIL_DEBUG <flags> ("")
.. envvar:: DXIL_DEBUG
``verbose``
Enable verbose output to stdout
``dump_blob``
Write shader blobs
``trace``
Trace instruction conversion
``dump_module``
dump module tree to stderr
Accepts the following comma-separated list of flags:
``verbose``
Enable verbose output to stdout
``dump_blob``
Write shader blobs
``trace``
Trace instruction conversion
``dump_module``
dump module tree to stderr
.. _debug layer: https://learn.microsoft.com/en-us/windows/win32/direct3d12/understanding-the-d3d12-debug-layer
.. _GPU validator: https://learn.microsoft.com/en-us/windows/win32/direct3d12/using-d3d12-debug-layer-gpu-based-validation
.. _debug layer: https://docs.microsoft.com/en-us/windows/win32/direct3d12/understanding-the-d3d12-debug-layer
.. _GPU validator: https://docs.microsoft.com/en-us/windows/win32/direct3d12/using-d3d12-debug-layer-gpu-based-validation
Utilities
---------
Environment variables that control the behavior of the D3D12 driver.
.. envvar:: MESA_D3D12_DEFAULT_ADAPTER_NAME
.. envvar:: MESA_D3D12_DEFAULT_ADAPTER_NAME <string> ("")
Specifies a substring to search for when choosing a default adapter to
run on. The first adapter matching the substring is chosen. The substring
is not case sensitive.
Specifies a substring to search for when choosing a default adapter to
run on. The first adapter matching the substring is chosen. The substring
is not case sensitive.

View File

@@ -1,574 +1,12 @@
Freedreno
=========
Freedreno GLES and GL driver for Adreno 2xx-6xx GPUs. It implements up to
OpenGL ES 3.2 and desktop OpenGL 4.5.
See the `Freedreno Wiki
<https://gitlab.freedesktop.org/freedreno/freedreno/-/wikis/home>`__ for more
details.
Turnip
======
Turnip is a Vulkan 1.3 driver for Adreno 6xx GPUs.
The current set of specific chip versions supported can be found in
:file:`src/freedreno/common/freedreno_devices.py`. The current set of features
supported can be found rendered at `Mesa Matrix <https://mesamatrix.net/>`__.
There are no plans to port to a5xx or earlier GPUs.
Hardware architecture
---------------------
Adreno is a mostly tile-mode renderer, but with the option to bypass tiling
("gmem") and render directly to system memory ("sysmem"). It is UMA, using
mostly write combined memory but with the ability to map some buffers as cache
coherent with the CPU.
.. toctree::
:glob:
freedreno/hw/*
Hardware acronyms
^^^^^^^^^^^^^^^^^
.. glossary::
Cluster
A group of hardware registers, often with multiple copies to allow
pipelining. There is an M:N relationship between hardware blocks that do
work and the clusters of registers for the state that hardware blocks use.
CP
Command Processor. Reads the stream of statechanges and draw commands
generated by the driver.
PFP
Prefetch Parser. Adreno 2xx-4xx CP component.
ME
Micro Engine. Adreno 2xx-4xx CP component after PFP, handles most PM4 commands.
SQE
a6xx+ replacement for PFP/ME. This is the microcontroller that runs the
microcode (loaded from Linux) which actually processes the command stream
and writes to the hardware registers. See `afuc
<https://gitlab.freedesktop.org/mesa/mesa/-/blob/main/src/freedreno/afuc/README.rst>`__.
ROQ
DMA engine used by the SQE for reading memory, with some prefetch buffering.
Mostly reads in the command stream, but also serves for
``CP_MEMCPY``/``CP_MEM_TO_REG`` and visibility stream reads.
SP
Shader Processor. Unified, scalar shader engine. One or more, depending on
GPU and tier.
TP
Texture Processor.
UCHE
Unified L2 Cache. 32KB on A330, unclear how big now.
CCU
Color Cache Unit.
VSC
Visibility Stream Compressor
PVS
Primitive Visibiliy Stream
FE
Front End? Index buffer and vertex attribute fetch cluster. Includes PC,
VFD, VPC.
VFD
Vertex Fetch and Decode
VPC
Varying/Position Cache? Hardware block that stores shaded vertex data for
primitive assembly.
HLSQ
High Level Sequencer. Manages state for the SPs, batches up PS invocations
between primitives, is involved in preemption.
PC_VS
Cluster where varyings are read from VPC and assembled into primitives to
feed GRAS.
VS
Vertex Shader. Responsible for generating VS/GS/tess invocations
GRAS
Rasterizer. Responsible for generating PS invocations from primitives, also
does LRZ
PS
Pixel Shader.
RB
Render Backend. Performs both early and late Z testing, blending, and
attachment stores of output of the PS.
GMEM
Roughly 128KB-1MB of memory on the GPU (SKU-dependent), used to store
attachments during tiled rendering
LRZ
Low Resolution Z. A low resolution area of the depth buffer that can be
initialized during the binning pass to contain the worst-case (farthest) Z
values in a block, and then used to early reject fragments during
rasterization.
Cache hierarchy
^^^^^^^^^^^^^^^
The a6xx GPUs have two main caches: CCU and UCHE.
UCHE (Unified L2 Cache) is the cache behind the vertex fetch, VSC writes,
texture L1, LRZ, and storage image accesses (``ldib``/``stib``). Misses and
flushes access system memory.
The CCU is the separate cache used by 2D blits and sysmem render target access
(and also for resolves to system memory when in GMEM mode). Its memory comes
from a carveout of GMEM controlled by ``RB_CCU_CNTL``, with a varying amount
reserved based on whether we're in a render pass using GMEM for attachment
storage, or we're doing sysmem rendering. Cache entries have the attachment
number and layer mixed into the cache tag in some way, likely so that a
fragment's access is spread through the cache even if the attachments are the
same size and alignments in address space. This means that the cache must be
flushed and invalidated between memory being used for one attachment and another
(notably depth vs color, but also MRT color).
The Texture Processors (TP) additionally have a small L1 cache (1KB on A330,
unclear how big now) before accessing UCHE. This cache is used for normal
sampling like ``sam``` and ``isam`` (and the compiler will make read-only
storage image access through it as well). It is not coherent with UCHE (may get
stale results when you ``sam`` after ``stib``), but must get flushed per draw or
something because you don't need a manual invalidate between draws storing to an
image and draws sampling from a texture.
The command processor (CP) does not read from either of these caches, and
instead uses FIFOs in the ROQ to avoid stalls reading from system memory.
Draw states
^^^^^^^^^^^
Since the SQE is not a fast processor, and tiled rendering means that many draws
won't even be used in many bins, since a5xx state updates can be batched up into
"draw states" that point to a fragment of CP packets. At draw time, if the draw
call is going to actually execute (some primitive is visible in the current
tile), the SQE goes through the ``GROUP_ID``\s and for any with an update since
the last time they were executed, it executes the corresponding fragment.
Starting with a6xx, states can be taggged with whether they should be executed
at draw time for any of sysmem, binning, or tile rendering. This allows a
single command stream to be generated which can be executed in any of the modes,
unlike pre-a6xx where we had to generate separate command lists for the binning
and rendering phases.
Note that this means that the generated draw state has to always update all of
the state you have chosen to pack into that ``GROUP_ID``, since any of your
previous statechanges in a previous draw state command may have been skipped.
Pipelining (a6xx+)
^^^^^^^^^^^^^^^^^^
Most CP commands write to registers. In a6xx+, the registers are located in
clusters corresponding to the stage of the pipeline they are used from (see
``enum tu_stage`` for a list). To pipeline state updates and drawing, registers
generally have two copies ("contexts") in their cluster, so previous draws can
be working on the previous set of register state while the next draw's state is
being set up. You can find what registers go into which clusters by looking at
:command:`crashdec` output in the ``regs-name: CP_MEMPOOL`` section.
As SQE processes register writes in the command stream, it sends them into a
per-cluster queue stored in ``CP_MEMPOOL``. This allows the pipeline stages to
process their stream of register updates and events independent of each other
(so even with just 2 contexts in a stage, earlier stages can proceed on to later
draws before later stages have caught up).
Each cluster has a per-context bit indicating that the context is done/free.
Register writes will stall on the context being done.
During a 3D draw command, SQE generates several internal events flow through the
pipeline:
- ``CP_EVENT_START`` clears the done bit for the context when written to the
cluster
- ``PC_EVENT_CMD``/``PC_DRAW_CMD``/``HLSQ_EVENT_CMD``/``HLSQ_DRAW_CMD`` kick off
the actual event/drawing.
- ``CONTEXT_DONE`` event completes after the event/draw is complete and sets the
done flag.
- ``CP_EVENT_END`` waits for the done flag on the next context, then copies all
the registers that were dirtied in this context to that one.
The 2D blit engine has its own ``CP_2D_EVENT_START``, ``CP_2D_EVENT_END``,
``CONTEXT_DONE_2D``, so 2D and 3D register contexts can do separate context
rollover.
Because the clusters proceed independently of each other even across draws, if
you need to synchronize an earlier cluster to the output of a later one, then
you will need to ``CP_WAIT_FOR_IDLE`` after flushing and invalidating any
necessary caches.
Also, note that some registers are not banked at all, and will require a
``CP_WAIT_FOR_IDLE`` for any previous usage of the register to complete.
In a2xx-a4xx, there weren't per-stage clusters, and instead there were two
register banks that were flipped between per draw.
Bindless/Bindful Descriptors (a6xx+)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Starting with a6xx++, cat5 (texture) and cat6 (image/ssbo/ubo) instructions are
extended to support bindless descriptors.
In the old bindful model, descriptors are separate for textures, samplers,
UBOs, and IBOs (combined descriptor for images and SSBOs), with separate
registers for the memory containing the array of descriptors, and/or different
``STATE_TYPE`` and ``STATE_BLOCK`` for ``CP_LOAD_STATE``/``_FRAG``/``_GEOM``
to pre-load the descriptors into cache.
- textures - per-shader-stage
- registers: ``SP_xS_TEX_CONST``/``SP_xS_TEX_COUNT``
- state-type: ``ST6_CONSTANTS``
- state-block: ``SB6_xS_TEX``
- samplers - per-shader-stage
- registers: ``SP_xS_TEX_SAMP``
- state-type: ``ST6_SHADER``
- state-block: ``SB6_xS_TEX``
- UBOs - per-shader-stage
- registers: none
- state-type: ``ST6_UBO``
- state-block: ``SB6_xS_SHADER``
- IBOs - global acress shader 3d stages, separate for compute shader
- registers: ``SP_IBO``/``SP_IBO_COUNT`` or ``SP_CS_IBO``/``SP_CS_IBO_COUNT``
- state-type: ``ST6_SHADER``
- state-block: ``ST6_IBO`` or ``ST6_CS_IBO`` for compute shaders
- Note, unlike per-shader-stage descriptors, ``CP_LOAD_STATE6`` is used,
as opposed to ``CP_LOAD_STATE6_GEOM`` or ``CP_LOAD_STATE6_FRAG``
depending on shader stage.
.. note::
For the per-shader-stage registers and state-blocks the ``xS`` notation
refers to per-shader-stage names, ex. ``SP_FS_TEX_CONST`` or ``SB6_DS_TEX``
Textures and IBOs (images) use *basically* the same 64byte descriptor format
with some exceptions (for ex, for IBOs cubemaps are handles as 2d array).
SSBOs are just untyped buffers, but otherwise use the same descriptors and
instructions as images. Samplers use a 16byte descriptor, and UBOs use an
8byte descriptor which packs the size in the upper 15 bits of the UBO address.
In the bindless model, descriptors are split into 5 desciptor sets, which are
global across shader stages (but as with bindful IBO descriptors, separate for
3d stages vs compute stage). Each hw descriptor is an array of descriptors
of configurable size (each descriptor set can be configured for a descriptor
pitch of 8bytes or 64bytes). Each descriptor can be of arbitrary format (ie.
UBOs/IBOs/textures/samplers interleaved), it's interpretation by the hw is
determined by the instruction that references the descriptor. Each descriptor
set can contain at least 2^^16 descriptors.
The hw is configured with the base address of the descriptor set via an array
of "BINDLESS_BASE" registers, ie ``SP_BINDLESS_BASE[n]``/``HLSQ_BINDLESS_BASE[n]``
for 3d shader stages, or ``SP_CS_BINDLESS_BASE[n]``/``HLSQ_CS_BINDLESS_BASE[n]``
for compute shaders, with the descriptor pitch encoded in the low bits.
Which of the descriptor sets is referenced is encoded via three bits in the
instruction. The address of the descriptor is calculated as::
descriptor_addr = (BINDLESS_BASE[n] & ~0x3) +
(idx * 4 * (2 << BINDLESS_BASE[n] & 0x3))
.. note::
Turnip reserves one descriptor set for internal use and exposes the other
four for the application via the vulkan API.
Software Architecture
---------------------
Freedreno and Turnip use a shared core for shader compiler, image layout, and
register and command stream definitions. They implement separate state
management and command stream generation.
Freedreno driver specific docs.
.. toctree::
:glob:
freedreno/*
GPU devcoredump
^^^^^^^^^^^^^^^^^^
A kernel message from DRM of "gpu fault" can mean any sort of error reported by
the GPU (including its internal hang detection). If a fault in GPU address
space happened, you should expect to find a message from the iommu, with the
faulting address and a hardware unit involved:
.. code-block:: console
*** gpu fault: ttbr0=000000001c941000 iova=000000010066a000 dir=READ type=TRANSLATION source=TP|VFD (0,0,0,1)
On a GPU fault or hang, a GPU core dump is taken by the DRM driver and saved to
``/sys/devices/virtual/devcoredump/**/data``. You can cp that file to a
:file:`crash.devcore` to save it, otherwise the kernel will expire it
eventually. Echo 1 to the file to free the core early, as another core won't be
taken until then.
Once you have your core file, you can use :command:`crashdec -f crash.devcore`
to decode it. The output will have ``ESTIMATED CRASH LOCATION`` where we
estimate the CP to have stopped. Note that it is expected that this will be
some distance past whatever state triggered the fault, given GPU pipelining, and
will often be at some ``CP_REG_TO_MEM`` (which waits on previous WFIs) or
``CP_WAIT_FOR_ME`` (which waits for all register writes to land) or similar
event. You can try running the workload with ``TU_DEBUG=flushall`` or
``FD_MESA_DEBUG=flush`` to try to close in on the failing commands.
You can also find what commands were queued up to each cluster in the
``regs-name: CP_MEMPOOL`` section.
If ``ESTIMATED CRASH LOCATION`` doesn't exist you could find ``CP_SQE_STAT``,
though going here is the last resort and likely won't be helpful.
.. code-block::
indexed-registers:
- regs-name: CP_SQE_STAT
dwords: 51
PC: 00d7 <-------------
PKT: CP_LOAD_STATE6_FRAG
$01: 70348003 $11: 00000000
$02: 20000000 $12: 00000022
The ``PC`` value is an instruction address in the current firmware.
You would need to disassemble the firmware (/lib/firmware/qcom/aXXX_sqe.fw) via:
.. code-block:: console
afuc-disasm -v a650_sqe.fw > a650_sqe.fw.disasm
Now you should search for PC value in the disassembly, e.g.:
.. code-block::
l018: 00d1: 08dd0001 add $addr, $06, 0x0001
00d2: 981ff806 mov $data, $data
00d3: 8a080001 mov $08, 0x0001 << 16
00d4: 3108ffff or $08, $08, 0xffff
00d5: 9be8f805 and $data, $data, $08
00d6: 9806e806 mov $addr, $06
00d7: 9803f806 mov $data, $03 <------------- HERE
00d8: d8000000 waitin
00d9: 981f0806 mov $01, $data
Command Stream Capture
^^^^^^^^^^^^^^^^^^^^^^
During Mesa development, it's often useful to look at the command streams we
send to the kernel. Mesa itself doesn't implement a way to stream them out
(though it maybe should!). Instead, we have an interface for the kernel to
capture all submitted command streams:
.. code-block:: console
cat /sys/kernel/debug/dri/0/rd > cmdstream &
By default, command stream capture does not capture texture/vertex/etc. data.
You can enable capturing all the BOs with:
.. code-block:: console
echo Y > /sys/module/msm/parameters/rd_full
Note that, since all command streams get captured, it is easy to run the system
out of memory doing this, so you probably don't want to enable it during play of
a heavyweight game. Instead, to capture a command stream within a game, you
probably want to cause a crash in the GPU during a farme of interest so that a
single GPU core dump is generated. Emitting ``0xdeadbeef`` in the CS should be
enough to cause a fault.
Capturing Hang RD
+++++++++++++++++
Devcore file doesn't contain all submitted command streams, only the hanging one.
Additionally it is geared towards analyzing the GPU state at the moment of the crash.
Alternatively, it's possible to obtain the whole submission with all command
streams via ``/sys/kernel/debug/dri/0/hangrd``:
.. code-block:: console
sudo cat /sys/kernel/debug/dri/0/hangrd > logfile.rd // Do the cat _before_ the expected hang
The format of hangrd is the same as in ordinary command stream capture.
``rd_full`` also has the same effect on it.
Replaying Command Stream
^^^^^^^^^^^^^^^^^^^^^^^^
`replay` tool allows capturing and replaying ``rd`` to reproduce GPU faults.
Especially useful for transient GPU issues since it has much higher chances to
reproduce them.
Dumping rendering results or even just memory is currently unsupported.
- Replaying command streams requires kernel with ``MSM_INFO_SET_IOVA`` support.
- Requires ``rd`` capture to have full snapshots of the memory (``rd_full`` is enabled).
Replaying is done via `replay` tool:
.. code-block:: console
./replay test_replay.rd
More examples:
.. code-block:: console
./replay --first=start_submit_n --last=last_submit_n test_replay.rd
.. code-block:: console
./replay --override=0 --generator=./generate_rd test_replay.rd
Editing Command Stream (a6xx+)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
While replaying a fault is useful in itself, modifying the capture to
understand what causes the fault could be even more useful.
``rddecompiler`` decompiles a single cmdstream from ``rd`` into compilable C source.
Given the address space bounds the generated program creates a new ``rd`` which
could be used to override cmdstream with 'replay'. Generated ``rd`` is not replayable
on its own and depends on buffers provided by the source ``rd``.
C source could be compiled using rdcompiler-meson.build as an example.
The workflow would look like this:
1. Find the cmdstream № you want to edit;
2. Decompile it:
.. code-block:: console
./rddecompiler -s %cmd_stream_n% example.rd > generate_rd.c
3. Edit the command stream;
4. Compile it back, see rdcompiler-meson.build for the instructions;
5. Plug the generator into cmdstream replay:
.. code-block:: console
./replay --override=%cmd_stream_№% --generator=~/generate_rd
6. Repeat 3-5.
GPU Hang Debugging
^^^^^^^^^^^^^^^^^^
Not a guide for how to do it but mostly an enumeration of methods.
Useful ``TU_DEBUG`` (for Turnip) options to narrow down the hang cause:
``sysmem``, ``gmem``, ``nobin``, ``forcebin``, ``noubwc``, ``nolrz``, ``flushall``, ``syncdraw``, ``rast_order``
Useful ``FD_MESA_DEBUG`` (for Freedreno) options:
``sysmem``, ``gmem``, ``nobin``, ``noubwc``, ``nolrz``, ``notile``, ``dclear``, ``ddraw``, ``flush``, ``inorder``, ``noblit``
Useful ``IR3_SHADER_DEBUG`` options:
``nouboopt``, ``spillall``, ``nopreamble``, ``nofp16``
Use Graphics Flight Recorder to narrow down the place which hangs,
use our own breadcrumbs implementation in case of unrecoverable hangs.
In case of faults use RenderDoc to find the problematic command. If it's
a draw call, edit shader in RenderDoc to find whether it culprit is a shader.
If yes, bisect it.
If editing the shader messes the assembly too much and the issue becomes unreproducible
try editing the assembly itself via ``IR3_SHADER_OVERRIDE_PATH``.
If fault or hang is transient try capturing an ``rd`` and replay it. If issue
is reproduced - bisect the GPU packets until the culprit is found.
Do the above if culprit is not a shader.
The hang recovery mechanism in Kernel is not perfect, in case of unrecoverable
hangs check whether the kernel is up to date and look for unmerged patches
which could improve the recovery.
GPU Breadcrumbs
+++++++++++++++
Breadcrumbs described below are available only in Turnip.
Freedreno has simpler breadcrumbs, in debug build writes breadcrumbs
into ``CP_SCRATCH_REG[6]`` and per-tile breadcrumbs into ``CP_SCRATCH_REG[7]``,
in this way they are available in the devcoredump. TODO: generalize Tunip's
breadcrumbs implementation.
This is a simple implementations of breadcrumbs tracking of GPU progress
intended to be a last resort when debugging unrecoverable hangs.
For best results use Vulkan traces to have a predictable place of hang.
For ordinary hangs as a more user-friendly solution use GFR
"Graphics Flight Recorder".
Or breadcrumbs implementation aims to handle cases where nothing can be done
after the hang. In-driver breadcrumbs also allow more precise tracking since
we could target a single GPU packet.
While breadcrumbs support gmem, try to reproduce the hang in a sysmem mode
because it would require much less breadcrumb writes and syncs.
Breadcrumbs settings:
.. code-block:: console
TU_BREADCRUMBS=%IP%:%PORT%,break=%BREAKPOINT%:%BREAKPOINT_HITS%
``BREAKPOINT``
The breadcrumb starting from which we require explicit ack.
``BREAKPOINT_HITS``
How many times breakpoint should be reached for break to occur.
Necessary for a gmem mode and re-usable cmdbuffers in both of which
the same cmdstream could be executed several times.
A typical work flow would be:
- Start listening for breadcrumbs on a remote host:
.. code-block:: console
nc -lvup $PORT | stdbuf -o0 xxd -pc -c 4 | awk -Wposix '{printf("%u:%u\n", "0x" $0, a[$0]++)}'
- Start capturing command stream;
- Replay the hanging trace with:
.. code-block:: console
TU_BREADCRUMBS=$IP:$PORT,break=-1:0
- Increase hangcheck period:
.. code-block:: console
echo -n 60000 > /sys/kernel/debug/dri/0/hangcheck_period_ms
- After GPU hang note the last breadcrumb and relaunch trace with:
.. code-block:: console
TU_BREADCRUMBS=%IP%:%PORT%,break=%LAST_BREADCRUMB%:%HITS%
- After the breakpoint is reached each breadcrumb would require
explicit ack from the user. This way it's possible to find
the last packet which did't hang.
- Find the packet in the decoded cmdstream.
See the `Freedreno Wiki <https://github.com/freedreno/freedreno/wiki>`__
for more details.

View File

@@ -1,122 +0,0 @@
Low Resolution Z Buffer
=======================
This doc is based on a6xx HW reverse engineering, a5xx should be similar to
a6xx before gen3.
Low Resolution Z buffer is very similar to a depth prepass that helps
the HW to avoid executing the fragment shader on those fragments that will
be subsequently discarded by the depth test afterwards.
The interesting part of this feature is that it allows applications
to submit the vertices in any order.
Citing official Adreno documentation:
::
[A Low Resolution Z (LRZ)] pass is also referred to as draw order independent
depth rejection. During the binning pass, a low resolution Z-buffer is constructed,
and can reject LRZ-tile wide contributions to boost binning performance. This LRZ
is then used during the rendering pass to reject pixels efficiently before testing
against the full resolution Z-buffer.
TODO: a7xx
Limitations
-----------
There are two main limitations of LRZ:
- Since LRZ is an early depth test, such test cannot be used when late-z is required;
- LRZ buffer could be formed only in one direction, changing depth comparison directions
without disabling LRZ would lead to a malformed LRZ buffer.
Pre-a650 (before gen3)
----------------------
The direction is fully tracked on CPU. In renderpass LRZ starts with
unknown direction, the direction is set first time when depth write occurs
and if it does change afterwards then the direction becomes invalid and LRZ is
disabled for the rest of the renderpass.
Since the direction is not tracked by the GPU, it's impossible to know whether
LRZ is enabled during construction of secondary command buffers.
For the same reason, it's impossible to reuse LRZ between renderpasses.
A650+ (gen3+)
-------------
Now LRZ direction can be tracked on GPU. There are two parts:
- Direction byte which stores current LRZ direction - ``GRAS_LRZ_CNTL.DIR``.
- Parameters of the last used depth view - ``GRAS_LRZ_DEPTH_VIEW``.
The idea is the same as when LRZ tracked on CPU: when ``GRAS_LRZ_CNTL``
is used, its direction is compared to the previously known direction
and direction byte is set to disabled when directions are incompatible.
Additionally, to reuse LRZ between renderpasses, ``GRAS_LRZ_CNTL`` checks
if the current value of ``GRAS_LRZ_DEPTH_VIEW`` is equal to the value
stored in the buffer. If not, LRZ is disabled. This is necessary
because depth buffer may have several layers and mip levels, while the
LRZ buffer represents only a single layer + mip level.
LRZ Fast-Clear
--------------
The LRZ fast-clear buffer is initialized to zeroes and read/written
when ``GRAS_LRZ_CNTL.FC_ENABLE`` is set. It appears to store 1b/block.
``0`` means block has original depth clear value, and ``1`` means that the
corresponding block in LRZ has been modified.
LRZ fast-clear conservatively clears LRZ buffer. At the point where LRZ is
written the LRZ block which corresponds to a single fast-clear bit is cleared:
- To ``0.0`` if depth comparison is ``GREATER``
- To ``1.0`` if depth comparison is ``LESS``
This way it's always valid to fast-clear.
LRZ Precision
-------------
LRZ always uses ``Z16_UNORM``. The epsilon for it is ``1.f / (1 << 16)`` which is
not enough to represent all values of ``Z32_UNORM`` or ``Z32_FLOAT``.
This especially raises questions in context of fast-clear, if fast-clear
uses a value which cannot be precisely represented by LRZ - we wouldn't
be able to round it in the correct direction since direction is tracked
on GPU.
However, it seems that depth comparisons with LRZ values have some "slack"
and nothing special should be done for such depth clear values.
How it was tested:
- Clear ``Z32_FLOAT`` attachment to ``1.f / (1 << 17)``
- LRZ buffer contains all zeroes.
- Do draws and check whether all samples are passing:
- ``OP_GREATER`` with ``(1.f / (1 << 17) + float32_epsilon)`` - passing;
- ``OP_GREATER`` with ``(1.f / (1 << 17) - float32_epsilon)`` - not passing;
- ``OP_LESS`` with ``(1.f / (1 << 17) - float32_epsilon)`` - samples;
- ``OP_LESS`` with ``(1.f / (1 << 17) + float32_epsilon)``- not passing;
- ``OP_LESS_OR_EQ`` with ``(1.f / (1 << 17) + float32_epsilon)`` - not passing.
In all cases resulting LRZ buffer is all zeroes and LRZ direction is updated.
LRZ Caches
----------
``LRZ_FLUSH`` flushes and invalidates LRZ caches, there are two caches:
- Cache for fast-clear buffer;
- Cache for direction byte + depth view params.
They could be cleared by ``LRZ_CLEAR``. To become visible in GPU memory
the caches should be flushed with ``LRZ_FLUSH`` afterwards.
``GRAS_LRZ_CNTL`` reads from these caches.

View File

@@ -15,7 +15,7 @@ Here, the second instruction needs the output of the first group of scalar instr
So the current compiler instead, in the frontend, generates a directed-acyclic-graph of instructions and basic blocks, which go through various additional passes to eventually schedule and do register assignment.
For additional documentation about the hardware, see wiki: `a3xx ISA
<https://github.com/freedreno/freedreno/wiki/A3xx-shader-instruction-set-architecture>`__.
<https://github.com/freedreno/freedreno/wiki/A3xx-shader-instruction-set-architecture>`_.
External Structure
------------------
@@ -165,12 +165,12 @@ Meta Instructions
**collect**
Groups registers which need to be assigned to consecutive scalar
registers, for example ``sam`` (texture fetch) src instructions (see
registers, for example `sam` (texture fetch) src instructions (see
`register groups`_) or array element dereference
(see `relative addressing`_).
**split**
The counterpart to **collect**, when an instruction such as ``sam``
The counterpart to **collect**, when an instruction such as `sam`
writes multiple components, splits the result into individual
scalar components to be consumed by other instructions.

View File

@@ -62,9 +62,9 @@ Environment variables
These are some Lima-specific environment variables that may aid in
debugging. None of this is required for normal use.
.. envvar:: LIMA_DEBUG
.. envvar:: LIMA_DEBUG <flags> ("")
accepts the following comma-separated list of flags:
accepts the following comma-separated list of flags:
``bocache``
print debug info for BO cache
@@ -92,21 +92,21 @@ debugging. None of this is required for normal use.
disable multi job optimization
.. envvar:: LIMA_CTX_NUM_PLB
.. envvar:: LIMA_CTX_NUM_PLB <int> (None)
set number of PLB per context (used for development purposes)
set number of PLB per context (used for development purposes)
.. envvar:: LIMA_PLB_MAX_BLK
.. envvar:: LIMA_PLB_MAX_BLK <int> (None)
set PLB max block (used for development purposes)
set PLB max block (used for development purposes)
.. envvar:: LIMA_PPIR_FORCE_SPILLING
.. envvar:: LIMA_PPIR_FORCE_SPILLING <int> (None)
force spilling of variables in PPIR (used for development purposes)
force spilling of variables in PPIR (used for development purposes)
.. envvar:: LIMA_PLB_PP_STREAM_CACHE_SIZE
.. envvar:: LIMA_PLB_PP_STREAM_CACHE_SIZE <int> (None)
set PP stream cache size (used for development purposes)
set PP stream cache size (used for development purposes)
Known hardware limitations
--------------------------
@@ -131,9 +131,9 @@ Here are some known caveats in OpenGL support:
that may affect the quality of the texture lookup.
- Lima supports FP16 textures in OpenGL ES (through
:ext:`GL_OES_texture_half_float<GL_OES_texture_float>`), but not in OpenGL.
This is because it would require :ext:`GL_ARB_texture_float` which would
also require 32-bit float textures, that the Mali-4xx does not support.
``GL_OES_texture_half_float``), but not in OpenGL.
This is because it would require ``ARB_texture_float`` which would also
require 32-bit float textures, that the Mali-4xx does not support.
- Rendering to FP16 is possible, but the result is clamped to the
[0.0,1.0] range.
@@ -252,6 +252,6 @@ Reference
---------
Luc Verhaegens original Lima site:
https://web.archive.org/web/20180101212947/http://limadriver.org/
http://web.archive.org/web/20180106112822/http://limadriver.org/
.. _Mesa issue: https://gitlab.freedesktop.org/mesa/mesa/-/issues?label_name%5B%5D=lima
.. _Mesa issue: https://gitlab.freedesktop.org/mesa/mesa/issues?label_name%5B%5D=lima

Some files were not shown because too many files have changed in this diff Show More