platform/upstream/mesa.git
2 years agoegl: Just include driconf.h instead of redefining its values.
Emma Anholt [Mon, 11 Jul 2022 19:37:38 +0000 (12:37 -0700)]
egl: Just include driconf.h instead of redefining its values.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>

2 years agokopper: Respect the vblank_mode env var.
Emma Anholt [Thu, 7 Jul 2022 00:13:37 +0000 (17:13 -0700)]
kopper: Respect the vblank_mode env var.

We were defaulting to a swap interval of 1, but we can follow dri2/dri3's
lead and respect the driconf var.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>

2 years agoglx: Unify dri2/dri3 vblank_mode logic.
Emma Anholt [Mon, 11 Jul 2022 19:01:27 +0000 (12:01 -0700)]
glx: Unify dri2/dri3 vblank_mode logic.

We need it from kopper, as well.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>

2 years agokopper: Use the swap interval that was set at swapchain creation time.
Emma Anholt [Mon, 11 Jul 2022 19:24:17 +0000 (12:24 -0700)]
kopper: Use the swap interval that was set at swapchain creation time.

We need to track what the caller has given us for swap interval, and use
that to set the present mode at startup.

Fixes incorrect vblank syncing in apitrace's glretrace, which sets the
swap interval to 0 before the swapchain is made.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>

2 years agokopper: Fix the return value of kopperSetSwapInterval().
Emma Anholt [Mon, 11 Jul 2022 18:51:54 +0000 (11:51 -0700)]
kopper: Fix the return value of kopperSetSwapInterval().

Compare to dri2SetSwapInterval() and dri3_set_swap_interval()
implementations of the same method.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17470>

2 years agoetnaviv: Implement TXD
Marek Vasut [Sat, 23 Apr 2022 13:41:13 +0000 (15:41 +0200)]
etnaviv: Implement TXD

Fill in support for TXD instruction which emits shader TEXLDD opcode.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-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/17500>

2 years agoetnaviv: Rename etna_emit_tex() args
Marek Vasut [Mon, 25 Apr 2022 21:35:26 +0000 (23:35 +0200)]
etnaviv: Rename etna_emit_tex() args

Rename the args from low_bias/compare to src1/src2, since they
are used for different purposes depending on the texture load
type. No functional change.

Signed-off-by: Marek Vasut <marex@denx.de>
Reviewed-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/17500>

2 years agovenus: GetPhysicalDeviceSparseImageFormatProperties to match sparse support
Yiwei Zhang [Mon, 11 Jul 2022 22:36:02 +0000 (22:36 +0000)]
venus: GetPhysicalDeviceSparseImageFormatProperties to match sparse support

Test: dEQP-VK.api.info.sparse_image_format_properties2.*

Fixes: 1a7632e54b4 ("venus: add NO_FENCE_FEEDBACK perf option and disable sparse resource")

Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17476>

2 years agomicrosoft/spirv_to_dxil: Fix discard to demote + return pass
Enrico Galli [Mon, 11 Jul 2022 21:15:40 +0000 (14:15 -0700)]
microsoft/spirv_to_dxil: Fix discard to demote + return pass

While SPIR-V's OpKill is block terminating, the converted discard
intrinsic is not block terminating. This can lead to issues where
instruction could be placed after discard.

This patch adds an extra pass that drops all instructions after discard
before we convert discards.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17474>

2 years agozink/ci: update list of CTS flakes for RADV
Samuel Pitoiset [Tue, 12 Jul 2022 11:56:13 +0000 (13:56 +0200)]
zink/ci: update list of CTS flakes for RADV

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17492>

2 years agoglx: Fix return values from __glXGetDrawableAttribute
Adam Jackson [Wed, 6 Jul 2022 17:46:24 +0000 (13:46 -0400)]
glx: Fix return values from __glXGetDrawableAttribute

This is intended to return true on attribute-found.

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

2 years agoglx/dri2: Stop tracking the protocol version in the display state
Adam Jackson [Wed, 6 Jul 2022 14:22:39 +0000 (10:22 -0400)]
glx/dri2: Stop tracking the protocol version in the display state

We only use it at init time, no need to keep it around.

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

2 years agoglx: Remove excess screen parameter from CreateContext
Adam Jackson [Fri, 1 Jul 2022 15:50:04 +0000 (11:50 -0400)]
glx: Remove excess screen parameter from CreateContext

This is effectively looked up from the config anyway, which we're
already passing in.

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

2 years agoglx: Remove unused __glXSetupForCommand from __glXIsDirect
Adam Jackson [Thu, 23 Jun 2022 18:44:20 +0000 (14:44 -0400)]
glx: Remove unused __glXSetupForCommand from __glXIsDirect

This was needed when we emitted an xlib request here, but xcb knows the
GLX major opcode for the connection already.

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

2 years agoglx: Remove some can't-happen checks from protocolDestroyDrawable
Adam Jackson [Tue, 21 Jun 2022 21:36:03 +0000 (17:36 -0400)]
glx: Remove some can't-happen checks from protocolDestroyDrawable

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

2 years agofreedreno/a6xx: VPC_SO_NCOMP is actually VPC_SO_BUFFER_STRIDE
Connor Abbott [Tue, 12 Jul 2022 14:55:03 +0000 (16:55 +0200)]
freedreno/a6xx: VPC_SO_NCOMP is actually VPC_SO_BUFFER_STRIDE

This answers the question in a comment in turnip, and fixes some GL46
tests and piglit tests.

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

2 years agovc4: Add links to test bug reports.
Emma Anholt [Sun, 10 Jul 2022 15:39:36 +0000 (08:39 -0700)]
vc4: Add links to test bug reports.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>

2 years agovc4: Work around a HW bug with 2-vert line loops.
Emma Anholt [Sun, 10 Jul 2022 15:11:15 +0000 (08:11 -0700)]
vc4: Work around a HW bug with 2-vert line loops.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>

2 years agomesa: Fix the error check for VertexAttrib*.
Emma Anholt [Sun, 10 Jul 2022 15:02:51 +0000 (08:02 -0700)]
mesa: Fix the error check for VertexAttrib*.

It was checking "mesa's theoretical max attributes" rather than "the
driver's max attributes."

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Jose Maria Casanova Crespo <jmcasanova@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17449>

2 years agozink: Do the timestamp-to-ns math in a double to have better precision.
Emma Anholt [Mon, 11 Jul 2022 22:50:50 +0000 (15:50 -0700)]
zink: Do the timestamp-to-ns math in a double to have better precision.

Fixes arb_timer_query-timestamp-get on my radv system, where the GPU has
been on for many days and the timestamp would only increment every once in
a while.

Part of fixing #6808

Fixes: 7a40b734ee2b ("zink: handle timestamp queries")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17477>

2 years agor600/sfn: Don't use assert to test success of operation
Gert Wollny [Tue, 12 Jul 2022 16:15:41 +0000 (18:15 +0200)]
r600/sfn: Don't use assert to test success of operation

With that the actual call will be eliminated if the code is
compiled with NDEBUG.

Fixes: 79ca456b4837b3bc21cf9ef3c03c505c4b4909f6
  r600/sfn: rewrite NIR backend

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6832
Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Reviewed-by: Filip Gawin <filip@gawin.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17496>

2 years agovenus: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:06:18 +0000 (13:06 +0100)]
venus: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agopanvk: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:07:04 +0000 (13:07 +0100)]
panvk: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agodzn: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:05:54 +0000 (13:05 +0100)]
dzn: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agoanv: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:03:31 +0000 (13:03 +0100)]
anv: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agopvr: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:05:45 +0000 (13:05 +0100)]
pvr: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agolavapipe: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:05:20 +0000 (13:05 +0100)]
lavapipe: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agozink: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:05:06 +0000 (13:05 +0100)]
zink: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Hoe Hao Cheng <haochengho12907@gmail.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agozink/codegen: use the updated identifiers
Hoe Hao Cheng [Sat, 2 Jul 2022 08:19:13 +0000 (16:19 +0800)]
zink/codegen: use the updated identifiers

Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agoturnip: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:04:48 +0000 (13:04 +0100)]
turnip: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agov3dv: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:04:28 +0000 (13:04 +0100)]
v3dv: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Acked-by: Iago Toral Quiroga <itoral@igalia.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agoradv: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:03:58 +0000 (13:03 +0100)]
radv: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agonir: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:07:26 +0000 (13:07 +0100)]
nir: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agovulkan: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:02:59 +0000 (13:02 +0100)]
vulkan: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agovulkan/runtime: use updated tokens from vk.xml
Eric Engestrom [Fri, 1 Jul 2022 12:02:59 +0000 (13:02 +0100)]
vulkan/runtime: use updated tokens from vk.xml

Signed-off-by: Eric Engestrom <eric@igalia.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17342>

2 years agovulkan: add script to detect & replace identifiers that have been renamed
Eric Engestrom [Thu, 10 Jan 2019 14:02:51 +0000 (14:02 +0000)]
vulkan: add script to detect & replace identifiers that have been renamed

Signed-off-by: Eric Engestrom <eric@engestrom.ch>
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/17342>

2 years agovulkan/wsi: Add debug variables to force the SW and PRIME buffer blit paths
Jason Ekstrand [Fri, 8 Jul 2022 21:21:25 +0000 (16:21 -0500)]
vulkan/wsi: Add debug variables to force the SW and PRIME buffer blit paths

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17436>

2 years agovulkan/wsi/wayland: Add a BUFFER_TYPE flag
Jason Ekstrand [Fri, 8 Jul 2022 21:47:48 +0000 (16:47 -0500)]
vulkan/wsi/wayland: Add a BUFFER_TYPE flag

This makes all the different ways of presenting a bit more clear.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17436>

2 years agoanv: Init supported extensions before WSI
Jason Ekstrand [Thu, 7 Jul 2022 00:51:03 +0000 (19:51 -0500)]
anv: Init supported extensions before WSI

Otherwise WSI extension support checks won't work.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17436>

2 years agolavapipe: don't crash on null xfb buffer pointer
Mike Blumenkrantz [Mon, 11 Jul 2022 19:04:00 +0000 (15:04 -0400)]
lavapipe: don't crash on null xfb buffer pointer

cc: mesa-stable

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

2 years agolavapipe: don't overwrite entire VkFormatProperties3 struct
Mike Blumenkrantz [Mon, 11 Jul 2022 14:59:00 +0000 (10:59 -0400)]
lavapipe: don't overwrite entire VkFormatProperties3 struct

this clobbers pNext and breaks tooling, as found by Panagiotis Apostolou

Fixes: f72d5a930b1 ("lavapipe: KHR_format_feature_flags2")

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

2 years agozink: Fix BO size when it's not aligned to 16 bytes
SoroushIMG [Mon, 11 Jul 2022 13:00:50 +0000 (14:00 +0100)]
zink: Fix BO size when it's not aligned to 16 bytes

glsl_get_explicit_size can return non-16 byte aligned sizes.
Therefore, make sure the sure the size isrounded up so that OOB does not happen.

Fixes: ea8a0654f5b ("zink: further improve bo sizing")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17460>

2 years agoradv: Fix acceleration structure size queries
Konstantin Seurer [Sat, 9 Jul 2022 20:20:58 +0000 (22:20 +0200)]
radv: Fix acceleration structure size queries

From looking at the CTS,
VK_QUERY_TYPE_ACCELERATION_STRUCTURE_SIZE_KHR
refers to the serialization size and not to the
actual, current size.

Fixes the following CTS:
dEQP-VK.ray_tracing_pipeline.acceleration_structures.query_pool_results.cpu.buffer.size
dEQP-VK.ray_tracing_pipeline.acceleration_structures.query_pool_results.cpu.memory.size
dEQP-VK.ray_tracing_pipeline.acceleration_structures.query_pool_results.gpu.buffer.size
dEQP-VK.ray_tracing_pipeline.acceleration_structures.query_pool_results.gpu.memory.size

Fixes: 5d56c2c ("radv: Add accel struct queries for maintenance1")
Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17444>

2 years agoradv: Add ability to override the build id for the cache.
Bas Nieuwenhuizen [Fri, 8 Jul 2022 16:18:13 +0000 (18:18 +0200)]
radv: Add ability to override the build id for the cache.

This would allow us to keep the shader cache key the same for updates
that we know won't impact compilation on SteamOS.

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

2 years agov3dv: remove unused lowering for nir_intrinsic_load_layer_id
Iago Toral Quiroga [Tue, 12 Jul 2022 09:36:56 +0000 (11:36 +0200)]
v3dv: remove unused lowering for nir_intrinsic_load_layer_id

This intrinsic is only produced when the compiler is instructed
to handle layer id as a system value, which we don't use. Also,
we have been supporting layered rendering for a while and passing
all the relevant tests which would've failed if we were hitting
this lowering.

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

2 years agov3dv: fix comment in texel buffer shader copy path
Iago Toral Quiroga [Tue, 12 Jul 2022 09:02:15 +0000 (11:02 +0200)]
v3dv: fix comment in texel buffer shader copy path

When using the texel buffer copy path to copy a buffer we need to
sample from the buffer and for that we need a texture shader state
record where we specify the base offset of the texture (the buffer).
If the copy operation has a start offset we can't add that offset
to the base address of the buffer because the texture state record
requires the base pointer to be 64-byte aligned, so it would only
work for offsets that are multiple of 64B. Instead, we pass the
offset (in elements) to the shader and we use that to shift the
indices into the buffer when selecting the source texel to copy.

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

2 years agogallium/dri: Remove the memory of GLX_MESA_multithread_makecurrent
Adam Jackson [Mon, 11 Jul 2022 20:24:36 +0000 (16:24 -0400)]
gallium/dri: Remove the memory of GLX_MESA_multithread_makecurrent

The only way this could happen was if GLX did it, which it doesn't.

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

2 years agoglx: Remove the remains of GLX_MESA_multithread_makecurrent
Adam Jackson [Mon, 11 Jul 2022 20:11:53 +0000 (16:11 -0400)]
glx: Remove the remains of GLX_MESA_multithread_makecurrent

This hasn't actually been exported for a while. I think I probably broke
this in

    commit 63a6b719d98fb1ad58ae93c2de859e6d4bfa8b8b
    Author: Adam Jackson <ajax@redhat.com>
    Date:   Tue Dec 5 11:10:09 2017 -0500

        glx: GLX_MESA_multithread_makecurrent is direct-only

in which I made it no longer default to having client support, but
failed to instruct dri{2,3,sw} to enable it. In any case, it was never
widely used, there is no EGL equivalent, and we've had zero complaints
about it getting nerfed.

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

2 years agoradv: Skip pipeline_no_null_shaders_flag tests
Konstantin Seurer [Sat, 9 Jul 2022 15:22:43 +0000 (17:22 +0200)]
radv: Skip pipeline_no_null_shaders_flag tests

Those tests either fail or hang so just exclude
all of them for now to make ray tracing CTS usable
again.

Signed-off-by: Konstantin Seurer <konstantin.seurer@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17443>

2 years agoradv: fix wide points/lines by configuring the guardband correctly
Samuel Pitoiset [Thu, 7 Jul 2022 08:28:57 +0000 (10:28 +0200)]
radv: fix wide points/lines by configuring the guardband correctly

Fixes all remaining wide points/lines failures with Zink.

Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6121
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/17392>

2 years agomesa: Follow ASTC decode mode extension for RGBA8 output
Nanley Chery [Tue, 12 Apr 2022 22:00:23 +0000 (15:00 -0700)]
mesa: Follow ASTC decode mode extension for RGBA8 output

The GL extension, EXT_texture_compression_astc_decode_mode, enables
applications to specify the desired decoding precision when decoding
non-sRGB ASTC textures. The options for the channels are FP16 (the
default), UNORM8, and RGB9_E5.

The ASTC LDR decoder outputs to UNORM8 by doing the following
conversions: UNORM16 -> FP16 -> UNORM8. This doesn't seem to be defined
by any specification and is costly according to perf profiles. To
conform to the decode mode spec (and for better performance), we convert
UNORM16 to UNORM8 by simply storing/keeping the top 8 bits.

In a texture upload microbenchmark, this decreases the upload time for
textures in the linear color space by about 34%.

Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17195>

2 years agomesa: Simplify UNORM8 conversions for sRGB ASTC textures
Nanley Chery [Wed, 13 Apr 2022 22:15:38 +0000 (15:15 -0700)]
mesa: Simplify UNORM8 conversions for sRGB ASTC textures

The ASTC extension specs state that a vector of UNORM8 values are
returned when decoding sRGB ASTC textures. For the alpha channel
however, they don't seem to specify how to get there from the UNORM16
produced after interpolation (or returned from a void-extent block).

The ASTC decoder in the VK-GL-CTS project treats the alpha channel like
the RGB channels and simply uses the top 8 bits of the UNORM16. For
better performance, we choose to do the same.

In a texture upload microbenchmark, this decreases the upload time for
textures in the sRGB color space by about 13%.

Ref: https://gitlab.khronos.org/egl/DataFormat/-/merge_requests/32
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17195>

2 years agomesa: Stub out GL_APPLE_object_purgeable
Adam Jackson [Fri, 8 Jul 2022 15:43:55 +0000 (11:43 -0400)]
mesa: Stub out GL_APPLE_object_purgeable

There's slots in the glapi static dispatch table (which is still
arguably ABI) which we need to preserve, but we can stop exposing the
extension string or doing anything in the added functions.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17425>

2 years agoir3: Use non-persp interpolation when appropriate for interpolateAtOffset.
Emma Anholt [Thu, 30 Jun 2022 21:10:50 +0000 (14:10 -0700)]
ir3: Use non-persp interpolation when appropriate for interpolateAtOffset.

Fixes dEQP-VK.draw.renderpass.linear_interpolation.offset_min_4_samples.

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

2 years agoir3: Clarify what's happening in the interpolateAtOffset() math.
Emma Anholt [Tue, 5 Jul 2022 17:15:07 +0000 (10:15 -0700)]
ir3: Clarify what's happening in the interpolateAtOffset() math.

nir_builder lets us build much cleaner code than we had (assuming that we
get a scalarizing after this).

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

2 years agofreedreno: Rename the "SIZE" regs for interpolateAtOffset to "CENTERRHW"
Emma Anholt [Tue, 5 Jul 2022 17:01:00 +0000 (10:01 -0700)]
freedreno: Rename the "SIZE" regs for interpolateAtOffset to "CENTERRHW"

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

2 years agonir+ir3: Rename load_size_ir3 to load_center_rhw_ir3.
Emma Anholt [Tue, 5 Jul 2022 16:51:58 +0000 (09:51 -0700)]
nir+ir3: Rename load_size_ir3 to load_center_rhw_ir3.

Now that we know what it does, it also explains what it's doing in
interpolateAtOffset in ir3.

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

2 years agoir3: Make sure to pass the interp_mode through in our load_bary lowering.
Emma Anholt [Thu, 30 Jun 2022 20:17:06 +0000 (13:17 -0700)]
ir3: Make sure to pass the interp_mode through in our load_bary lowering.

Fixes dEQP-VK.draw.renderpass.linear_interpolation.* in vkcts 1.3.3.0

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

2 years agoturnip: Refactor vertex input setup a little.
Emma Anholt [Thu, 16 Jun 2022 23:37:07 +0000 (16:37 -0700)]
turnip: Refactor vertex input setup a little.

The repeated reservation code could be moved into the function.

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

2 years agoturnip: Fix the reservation for vertex inputs.
Emma Anholt [Thu, 16 Jun 2022 23:37:07 +0000 (16:37 -0700)]
turnip: Fix the reservation for vertex inputs.

It was too large since 2cd30266f155 ("tu: Refactor VS DECODE/DEST to be
emitted in two pkt4"), so fix it and also give it a name next to the code
it relates to.

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

2 years agoturnip: Fix up per-stage additional size accounting.
Emma Anholt [Thu, 16 Jun 2022 23:31:00 +0000 (16:31 -0700)]
turnip: Fix up per-stage additional size accounting.

input_size is the dwords emitted (hard to tell because of all of the * 4 /
4 going on), and constant_data is emitted with the emit_program call too.

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

2 years agoturnip: Account for additional_cs_reserve_size for both bin and render.
Emma Anholt [Thu, 16 Jun 2022 23:29:51 +0000 (16:29 -0700)]
turnip: Account for additional_cs_reserve_size for both bin and render.

Both emit_program() calls will use this space.

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

2 years agoanv: move gfx12+ CCS_E clear color restriction
Lionel Landwerlin [Thu, 7 Jul 2022 19:36:28 +0000 (22:36 +0300)]
anv: move gfx12+ CCS_E clear color restriction

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17329>

2 years agoanv: track if images can be fast clear with non-zero color
Lionel Landwerlin [Fri, 1 Jul 2022 07:44:48 +0000 (10:44 +0300)]
anv: track if images can be fast clear with non-zero color

Because clear colors are stored as 4 32bit component values, there is
an issue if you try to format instance :

   - clearing in R16G16_UNORM
   - draw in R32_UINT

Clear will use 2 components of the clear color in dword0 & dword1.

While draw will use only one component of dword0.

This change uses the mutable format information to track whether clear
colors can be non-zero for fast clears.

With :

   - non mutable formats, we can fast clear with any color on Gfx > 8
   - mutable formats with incompatible component sizes, we can only
     fast clear with 0 color

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/5930
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17329>

2 years agoisl: add new helper for format component compatibility
Lionel Landwerlin [Fri, 1 Jul 2022 07:43:21 +0000 (10:43 +0300)]
isl: add new helper for format component compatibility

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: mesa-stable
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17329>

2 years agomailmap: update my email to Igalia
Eric Engestrom [Mon, 11 Jul 2022 14:03:53 +0000 (15:03 +0100)]
mailmap: update my email to Igalia

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

2 years agopvr: Make pvr_cmd_pack() macro clearly internal
Matt Coster [Wed, 29 Jun 2022 08:53:55 +0000 (09:53 +0100)]
pvr: Make pvr_cmd_pack() macro clearly internal

Add a double-underscore prefix to mark this macro as internal-only. It
should not be used directly, and only exists as a helper for the
pvr_csb_*() macros.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17359>

2 years agopvr: Remove pvr_cmd_struct() macro
Matt Coster [Wed, 29 Jun 2022 08:47:33 +0000 (09:47 +0100)]
pvr: Remove pvr_cmd_struct() macro

Motivated by comments on !17252; this macro adds nothing of value over
just using PVRX() directly.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17359>

2 years agopvr: Add a const qualifier to inline pvr_csb_*() helpers
Matt Coster [Wed, 29 Jun 2022 10:04:30 +0000 (11:04 +0100)]
pvr: Add a const qualifier to inline pvr_csb_*() helpers

These do not modify the input struct pvr_csb at all, so the function
signature should reflect this.

Signed-off-by: Matt Coster <matt.coster@imgtec.com>
Reviewed-by: Frank Binns <frank.binns@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17360>

2 years agobroadcom/compiler: don't over-estimate latency of TMU instructions
Iago Toral Quiroga [Fri, 8 Jul 2022 11:37:02 +0000 (13:37 +0200)]
broadcom/compiler: don't over-estimate latency of TMU instructions

Over-estimating latency can cause us to delay the critical paths of
the shader unnecessarily, producing larger QPU programs that take more
time to execute as a result (and it also adds register pressure) so
striking a balance is important. The thread switching model in V3D
is quite effective at hiding latency and usuallly we just need to
hint it to delay TMU instructions a little bit to find the best
compromise for performance.

The new latency numbers have been chosen empirically by testing
V3DV with Sponza and a few UE4 samples.

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

2 years agobroadcom/compiler: don't try to hide TMU latency at QPU scheduling
Iago Toral Quiroga [Fri, 8 Jul 2022 11:33:11 +0000 (13:33 +0200)]
broadcom/compiler: don't try to hide TMU latency at QPU scheduling

Based on empirical testing with Sponza and a few UE4 samples this is
consistently slightly benefitial for performance.

The most likely reason why this helps is that thrsw is probably
already quite effective at hiding latency and we are already trying
to hide latency at NIR scheduling and also via TMU pipelining, so
piling up on this when scheduling QPU typically ends up providing no
benefit at all for latency and is instead possibly preventing us to
unblock critical paths in the shader that depend on the TMU result,
requiring us to execute more cycles to complete the program.

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

2 years agoaco: fix packed 16bit fneg/fsat optimization
Daniel Schürmann [Thu, 7 Jul 2022 10:27:08 +0000 (12:27 +0200)]
aco: fix packed 16bit fneg/fsat optimization

Make sure that the Operand is '1.0.xx'.

Fixes: b03be30e07546b813acc1156407b964e68892beb ('aco: optimize packed fneg')
Reviewed-by: Rhys Perry <pendingchaos02@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17395>

2 years agoamd: Revert gfx10 addrlib changes
Tatsuyuki Ishi [Mon, 11 Jul 2022 06:08:46 +0000 (15:08 +0900)]
amd: Revert gfx10 addrlib changes

These broke a bunch of RADV VK CTS tests.
Revert the ADDR_SW_4KB_R_X changes from the commit to get CTS passing again.

Fixes: 3514b732445 ("amd: update addrlib - trivial changes")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6844
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17453>

2 years agoradv/shader_info: fix load_frag_coord and load_sample_pos read masks
Daniel Schürmann [Fri, 8 Jul 2022 10:57:32 +0000 (12:57 +0200)]
radv/shader_info: fix load_frag_coord and load_sample_pos read masks

Fixes: a8c471f962e3a86f0cb6a91f14090b0c8cfb73ff ('radv: gather more information about PS in the shader info pass')
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17417>

2 years agoradv: remove the radv_report_apu_as_dgpu workaround for Red Dead Redemption 2
Samuel Pitoiset [Fri, 8 Jul 2022 13:49:16 +0000 (15:49 +0200)]
radv: remove the radv_report_apu_as_dgpu workaround for Red Dead Redemption 2

This workaround looks actually broken. We added it in the past
because otherwise the game would just report 3GiB of video memory
(ie. size of GTT on SD). Though, with this workaround enabled, the
game explodes in memory easily.

One theory is that because we fake integrated GPUs as discrete GPUS,
and because we report 6GiB of VRAM (ie. driver redistributes memory
for small carveout), the game thinks there is 6GiB of VRAM only and
then keep allocating stuff.

People reported that the memory explosion is gone without this
workaround applied and I confirmed this myself.

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

2 years agor600/sfn: Add missing copyright information
Gert Wollny [Sun, 10 Jul 2022 21:51:12 +0000 (23:51 +0200)]
r600/sfn: Add missing copyright information

Signed-off-by: Gert Wollny <gert.wollny@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17450>

2 years agor300: Keep rc_rename_regs() from overflowing RC_REGISTER_MAX_INDEX
Pavel Ondračka [Thu, 7 Jul 2022 08:44:41 +0000 (10:44 +0200)]
r300: Keep rc_rename_regs() from overflowing RC_REGISTER_MAX_INDEX

This pass tries to move register usage closer to SSA, and for large
shaders this means we can overflow the register index, which only has
RC_REGISTER_INDEX_BITS size. This creates invalid code and leads to
crash at a later stage. Limit the pool of available registers to
RC_REGISTER_MAX_INDEX, currently is was two times the number of
shader instructions.

This means we'll fail the compile right away if we wanted more than
RC_REGISTER_MAX_INDEX temps, but when we've got that many we're
already well past how many instructions we can support anyway.

CC: mesa-stable
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/6017
Signed-off-by: Pavel Ondračka <pavel.ondracka@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17393>

2 years agonir/opt_shrink_vectors: Round to supported vec size
Alyssa Rosenzweig [Wed, 22 Jun 2022 19:58:16 +0000 (15:58 -0400)]
nir/opt_shrink_vectors: Round to supported vec size

The set of supported vector sizes in NIR has holes in it. For example, we
support vec5 and vec8, but not vec6 or vec7. However, this pass did not take
that into account, and would happily shrink a vec8 down to a vec7, causing NIR
validation to fail. Instead, the pass should round up to the next supported
vector size.

Fixes NIR validation fail in OpenCL's test_basic hiloeo subtest.

v2: Clamp -> round rename.

Signed-off-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17194>

2 years agomesa: fix SignalSemaphoreEXT behavior
Mike Blumenkrantz [Wed, 6 Jul 2022 16:21:34 +0000 (12:21 -0400)]
mesa: fix SignalSemaphoreEXT behavior

the EXT_external_object spec originally was underspecified with regards
to this function, leaving room for synchronization errors where:
* app calls SignalSemaphoreEXT to signal a semaphore
* mesa defers pipe_context::fence_server_signal with threaded context
* driver defers gpu submission
* SignalSemaphoreEXT has long since returned, app submits vk cmdbuf waiting on semaphore
* spec violation / device lost

to prevent this, the spec is being changed to:
1) require an implicit flush when calling SignalSemaphoreEXT
2) require that this implicit flush also forces GPU submission before SignalSemaphoreEXT returns

all affected drivers have been updated

fixes #6568

cc: mesa-stable

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

2 years agoAdd Adreno 616 and 620 to use turnip on these GPU's .
İlhan Atahan [Sat, 9 Jul 2022 13:08:00 +0000 (13:08 +0000)]
Add Adreno 616 and 620 to use turnip on these GPU's .

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

2 years agovc4: Add notes on the remaining dEQP failures.
Emma Anholt [Sun, 3 Jul 2022 15:01:28 +0000 (08:01 -0700)]
vc4: Add notes on the remaining dEQP failures.

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

2 years agovc4: Move previous existing 3D xfails up to the group of 3d xfails.
Emma Anholt [Sun, 3 Jul 2022 15:10:21 +0000 (08:10 -0700)]
vc4: Move previous existing 3D xfails up to the group of 3d xfails.

Clears up known issues from ones that should be investigated and
explained.

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

2 years agovc4: Disable OES_texture_3D being exposed.
Emma Anholt [Wed, 29 Jun 2022 05:06:11 +0000 (22:06 -0700)]
vc4: Disable OES_texture_3D being exposed.

The hardware doesn't support 3D textures.  We had been lying about 3D
texture level support in the past so that we got GL 2.1, but now reporting
levels==0 doesn't disable GL 2.1 (since we don't check for GL2 extensions
any more).  But, by not lying, we now fix the majority of the remaining
GLES2 deqp failures.

This regresses a few desktop GL piglits which get GL errors that they
notice instead of what would be silent rendering failures on 3D texturing
operations.

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

2 years agomesa/st: Disable OES_texture_3D for PIPE_CAP_MAX_TEXTURE_3D_LEVELS==0.
Emma Anholt [Wed, 29 Jun 2022 04:57:14 +0000 (21:57 -0700)]
mesa/st: Disable OES_texture_3D for PIPE_CAP_MAX_TEXTURE_3D_LEVELS==0.

This will be used for vc4, where incorrectly exposing 3D textures accounts
for most of the GLES2 conformance failures it has.  This leaves
EXT_texture3d exposed in the (already non-conformant) GL2.1 support it
exposes, which has always been a best-effort thing.

Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17350>

2 years agoutil: remove now unused debug_assert
Marek Olšák [Thu, 7 Jul 2022 17:30:44 +0000 (13:30 -0400)]
util: remove now unused debug_assert

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>

2 years agoChange all debug_assert calls to assert
Marek Olšák [Thu, 7 Jul 2022 17:29:53 +0000 (13:29 -0400)]
Change all debug_assert calls to assert

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>

2 years agoutil: remove our redefinition of assert
Marek Olšák [Thu, 7 Jul 2022 17:28:27 +0000 (13:28 -0400)]
util: remove our redefinition of assert

I think we can all agree that our own assert is unnecessary.

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

Acked-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Acked-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17403>

2 years agoci: add script for manage Mesa CI
David Heidelberg [Mon, 6 Jun 2022 16:25:48 +0000 (18:25 +0200)]
ci: add script for manage Mesa CI

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

2 years agodri: Check buffer height and avoid overflow
Marek Vasut [Sun, 15 May 2022 00:21:37 +0000 (02:21 +0200)]
dri: Check buffer height and avoid overflow

The dri2_allocate_buffer() can be called with arbitrary height, however
the struct pipe_resource .height0 member is uint16_t. Check height for
maximum size to avoid overflow. Note that .width0 is unsigned int, so
it does not have the same issue.

The uint16 limit comes from commit:
e6428092f5e ("gallium: decrease the size of pipe_resource - 64 -> 48 bytes")

The overflow can be triggered e.g. by requesting large BO:
```
gbm_bo_create(dev, 1, 640*480*4, GBM_FORMAT_R8, GBM_BO_USE_LINEAR);
```

Signed-off-by: Marek Vasut <marex@denx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/16513>

2 years agoradeonsi: fix random PS wave size
Marek Olšák [Wed, 29 Jun 2022 19:18:55 +0000 (15:18 -0400)]
radeonsi: fix random PS wave size

Fixes: b3b2f97f2e25b2c "radeonsi: add Wave32 heuristics and shader profiles"

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17410>

2 years agoac/surface: expose all 64K_R_X and 256K_R_X modifiers on gfx11
Marek Olšák [Tue, 28 Jun 2022 13:52:10 +0000 (09:52 -0400)]
ac/surface: expose all 64K_R_X and 256K_R_X modifiers on gfx11

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17410>

2 years agoamd: update addrlib - trivial changes
Marek Olšák [Sun, 3 Jul 2022 16:49:51 +0000 (12:49 -0400)]
amd: update addrlib - trivial changes

Reviewed-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17410>

2 years agoCI: Add dzn to debian vulkan/clang/release builds
Jesse Natalie [Fri, 8 Jul 2022 12:15:08 +0000 (05:15 -0700)]
CI: Add dzn to debian vulkan/clang/release builds

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

2 years agodzn: Use fabs on floating point input
Jesse Natalie [Fri, 8 Jul 2022 15:02:24 +0000 (08:02 -0700)]
dzn: Use fabs on floating point input

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

2 years agodzn: Re-order dzn_physical_device_desc so = { 0 } doesn't initialize a struct
Jesse Natalie [Fri, 8 Jul 2022 14:52:02 +0000 (07:52 -0700)]
dzn: Re-order dzn_physical_device_desc so = { 0 } doesn't initialize a struct

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

2 years agodzn: Fix comparison order for format enums
Jesse Natalie [Fri, 8 Jul 2022 14:33:04 +0000 (07:33 -0700)]
dzn: Fix comparison order for format enums

Fixes: 53a352e1 ("dzn: Provide a helper to check if 2 formats are compatible")
Reviewed-by: Boris Brezillon <boris.brezillon@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17423>

2 years agodzn: Disable Wunused-value for C++ files
Jesse Natalie [Fri, 8 Jul 2022 14:53:10 +0000 (07:53 -0700)]
dzn: Disable Wunused-value for C++ files

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

2 years agodzn: Only add Werror flags that the compiler supports
Jesse Natalie [Fri, 8 Jul 2022 14:20:23 +0000 (07:20 -0700)]
dzn: Only add Werror flags that the compiler supports

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

2 years agodzn: Re-order includes in dzn_nir to prevent TRUE redefinition
Jesse Natalie [Fri, 8 Jul 2022 14:15:18 +0000 (07:15 -0700)]
dzn: Re-order includes in dzn_nir to prevent TRUE redefinition

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

2 years agoradv: Expose VK_KHR_performance_query.
Bas Nieuwenhuizen [Sun, 8 May 2022 13:10:18 +0000 (15:10 +0200)]
radv: Expose VK_KHR_performance_query.

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