platform/upstream/mesa.git
23 months agomesa/main: remove always-true define
Erik Faye-Lund [Wed, 24 Aug 2022 12:41:47 +0000 (14:41 +0200)]
mesa/main: remove always-true define

We don't include this header anwhere where BPTC_BLOCK_DECODE isn't
already true, so let's remove it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agozink: allow X32 -> A32
Erik Faye-Lund [Thu, 11 Aug 2022 10:32:16 +0000 (12:32 +0200)]
zink: allow X32 -> A32

The 32-bit per component pipe_formats are a bit different than the 8 and
16 bit formats, in that there's no UNORM or SNORM variants of them. So
let's just omit those variants.

While we're at it, update a comment that was already out-of-date anyway.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: enable bptc extension with fallback
Erik Faye-Lund [Wed, 10 Aug 2022 06:59:28 +0000 (08:59 +0200)]
mesa/st: enable bptc extension with fallback

This implements emulation of BPTC for all drivers that don't natively
support it in HW, similar to what we have for ETC and ASTC already. The
only significant difference is that we don't implement any transcoding
DRI-conf for it.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: implement fallback for bptc
Erik Faye-Lund [Wed, 10 Aug 2022 06:45:16 +0000 (08:45 +0200)]
mesa/st: implement fallback for bptc

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa: add _mesa_unpack_bptc-function
Erik Faye-Lund [Wed, 10 Aug 2022 09:16:28 +0000 (11:16 +0200)]
mesa: add _mesa_unpack_bptc-function

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa: add format-helper for bptc
Erik Faye-Lund [Wed, 10 Aug 2022 06:27:19 +0000 (08:27 +0200)]
mesa: add format-helper for bptc

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: add context-flag for bptc-support
Erik Faye-Lund [Wed, 10 Aug 2022 06:24:29 +0000 (08:24 +0200)]
mesa/st: add context-flag for bptc-support

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: do not use memcpy when using compressed fallback
Erik Faye-Lund [Thu, 11 Aug 2022 14:12:00 +0000 (16:12 +0200)]
mesa/st: do not use memcpy when using compressed fallback

If we're using the memcpy-path, we don't update the compressed image,
which will be needed if an application try to download the texture-image
again afterwards.

This isn't a problem yet, because none of the current compressed formats
with fallback are copyable as per the OpenGL 4.6 Core spec, table 8.14.
However, this is about to change, when we introduce fallback for BPTC
formats.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: avoid double-mapping if both images are the same
Erik Faye-Lund [Thu, 11 Aug 2022 09:07:52 +0000 (11:07 +0200)]
mesa/st: avoid double-mapping if both images are the same

If both src_image and dst_image are pointing to the same image, we'll
end up double mapping the image, which throws an assert in
st_texture_image_map.

So let's check if these images are the same, and avoid the extra mapping
in that case.

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/st: simplify st_compressed_format_fallback
Erik Faye-Lund [Wed, 10 Aug 2022 11:06:57 +0000 (13:06 +0200)]
mesa/st: simplify st_compressed_format_fallback

By looking at the format-layout, we can do switch-cases here instead of
serial calls to _mesa_is_format_foo(). This isn't a huge deal yet, but
this function is going to learn about a lot more formats soon...

Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/main: simplify implementation of _mesa_is_format_astc_2d
Erik Faye-Lund [Wed, 10 Aug 2022 10:29:07 +0000 (12:29 +0200)]
mesa/main: simplify implementation of _mesa_is_format_astc_2d

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agomesa/main: simplify implmementation of _mesa_is_format_etc2
Erik Faye-Lund [Wed, 10 Aug 2022 10:26:49 +0000 (12:26 +0200)]
mesa/main: simplify implmementation of _mesa_is_format_etc2

Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Acked-by: Marek Olšák <marek.olsak@amd.com>
Acked-by: Soroush Kashani <soroush.kashani@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18012>

23 months agovenus: Document VK_EXT_texture_compression_astc_hdr support
Chad Versace [Wed, 24 Aug 2022 23:49:11 +0000 (16:49 -0700)]
venus: Document VK_EXT_texture_compression_astc_hdr support

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

23 months agovenus: Enable VK_EXT_tooling_info
Chad Versace [Thu, 11 Aug 2022 00:49:46 +0000 (17:49 -0700)]
venus: Enable VK_EXT_tooling_info

Implement it locally with the common implementation.

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

23 months agovenus: Enable VK_EXT_private_data
Chad Versace [Thu, 11 Aug 2022 00:03:07 +0000 (17:03 -0700)]
venus: Enable VK_EXT_private_data

Implement it as hybrid native/passthrough as a workaround until venus
learns how to deep surgery on pNext chains. Eventually, we want to
implement it purely natively. For details, see the big code comment.

See: https://gitlab.freedesktop.org/virgl/virglrenderer/-/merge_requests/908
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Reviewed-by: Ryan Neph <ryanneph@google.com>
Signed-off-by: Chad Versace <chadversary@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18000>

23 months agovenus: Enable VK_KHR_format_feature_flags2
Chad Versace [Thu, 11 Aug 2022 01:43:02 +0000 (18:43 -0700)]
venus: Enable VK_KHR_format_feature_flags2

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

23 months agovenus: Enable VK_EXT_ycbcr_2plane_444_formats
Chad Versace [Thu, 11 Aug 2022 00:56:42 +0000 (17:56 -0700)]
venus: Enable VK_EXT_ycbcr_2plane_444_formats

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

23 months agovenus: Enable VK_EXT_texel_buffer_alignment
Chad Versace [Thu, 11 Aug 2022 00:39:24 +0000 (17:39 -0700)]
venus: Enable VK_EXT_texel_buffer_alignment

The patch looks asymmetic because the extension was promoted to 1.3 but
not its feature struct.

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

23 months agovenus: Enable VK_EXT_subgroup_size_control
Chad Versace [Thu, 11 Aug 2022 00:32:15 +0000 (17:32 -0700)]
venus: Enable VK_EXT_subgroup_size_control

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

23 months agovenus: Enable VK_KHR_zero_initialize_workgroup_memory
Chad Versace [Wed, 10 Aug 2022 23:05:06 +0000 (16:05 -0700)]
venus: Enable VK_KHR_zero_initialize_workgroup_memory

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

23 months agovenus: Enable VK_KHR_shader_terminate_invocation
Chad Versace [Wed, 10 Aug 2022 23:02:20 +0000 (16:02 -0700)]
venus: Enable VK_KHR_shader_terminate_invocation

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

23 months agovenus: Enable VK_KHR_shader_non_semantic_info
Chad Versace [Wed, 10 Aug 2022 22:57:41 +0000 (15:57 -0700)]
venus: Enable VK_KHR_shader_non_semantic_info

This extension has no Vulkan API, only SPIR-V API.

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

23 months agovenus: Enable VK_KHR_shader_integer_dot_product
Chad Versace [Wed, 10 Aug 2022 22:45:48 +0000 (15:45 -0700)]
venus: Enable VK_KHR_shader_integer_dot_product

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

23 months agovenus: Simplify vn_GetPhysicalDeviceProperties2
Chad Versace [Thu, 11 Aug 2022 19:50:17 +0000 (12:50 -0700)]
venus: Simplify vn_GetPhysicalDeviceProperties2

Reduce approximately 220 lines to 80.

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

23 months agovenus: Simplify vn_GetPhysicalDeviceFeatures2
Chad Versace [Thu, 11 Aug 2022 19:41:43 +0000 (12:41 -0700)]
venus: Simplify vn_GetPhysicalDeviceFeatures2

Reduce approximately 300 lines to 60.

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

23 months agovulkan: Make vk_copy_struct_guts() public
Chad Versace [Thu, 11 Aug 2022 19:16:32 +0000 (12:16 -0700)]
vulkan: Make vk_copy_struct_guts() public

Venus wants to copy struct guts too.

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

23 months agovenus: Sort passthrough extensions
Chad Versace [Wed, 10 Aug 2022 21:01:17 +0000 (14:01 -0700)]
venus: Sort passthrough extensions

Only the Vulkan 1.3 extensions were unsorted.

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

23 months agoaco: remove dead code for querying image size/samples/levels
Rhys Perry [Fri, 5 Aug 2022 13:11:44 +0000 (14:11 +0100)]
aco: remove dead code for querying image size/samples/levels

ac_nir_lower_resinfo() now lowers these.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

23 months agoradv: enable ac_nir_lower_resinfo for ACO
Rhys Perry [Fri, 5 Aug 2022 12:50:59 +0000 (13:50 +0100)]
radv: enable ac_nir_lower_resinfo for ACO

fossil-db (navi21):
Totals from 4022 (2.98% of 134913) affected shaders:
VGPRs: 207824 -> 205264 (-1.23%); split: -1.25%, +0.02%
CodeSize: 18486240 -> 18778488 (+1.58%); split: -0.00%, +1.58%
MaxWaves: 84398 -> 84882 (+0.57%)
Instrs: 3408968 -> 3470936 (+1.82%); split: -0.00%, +1.82%
Latency: 43493420 -> 43168394 (-0.75%); split: -1.57%, +0.82%
InvThroughput: 6911341 -> 6816816 (-1.37%); split: -1.41%, +0.05%
VClause: 88256 -> 82728 (-6.26%); split: -6.31%, +0.04%
SClause: 130061 -> 131526 (+1.13%); split: -0.39%, +1.51%
Copies: 219849 -> 238548 (+8.51%); split: -0.05%, +8.56%
Branches: 79168 -> 79174 (+0.01%); split: -0.00%, +0.01%
PreSGPRs: 180683 -> 184952 (+2.36%); split: -0.17%, +2.53%
PreVGPRs: 179716 -> 178956 (-0.42%)

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

23 months agonir/lower_tex: ignore width of cube textures
Rhys Perry [Fri, 5 Aug 2022 15:34:30 +0000 (16:34 +0100)]
nir/lower_tex: ignore width of cube textures

On AMD hardware, height is faster to access and we're already doing so.

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

23 months agoaco: add SCC clobber in build_cube_select
Rhys Perry [Fri, 5 Aug 2022 15:35:42 +0000 (16:35 +0100)]
aco: add SCC clobber in build_cube_select

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Cc: mesa-stable
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

23 months agonir/print: support nir_texop_descriptor_amd
Rhys Perry [Fri, 5 Aug 2022 15:34:09 +0000 (16:34 +0100)]
nir/print: support nir_texop_descriptor_amd

Signed-off-by: Rhys Perry <pendingchaos02@gmail.com>
Reviewed-by: Georg Lehmann <dadschoorse@gmail.com>
Fixes: 3098000e712 ("nir: add nir_texop_descriptor_amd")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17991>

23 months agoradeonsi: move set_patch_vertices into si_state_shaders.cpp
Marek Olšák [Tue, 23 Aug 2022 22:53:40 +0000 (18:53 -0400)]
radeonsi: move set_patch_vertices into si_state_shaders.cpp

it's a better place for it

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

23 months agoradeonsi: move patch_vertices-related tessellation updates out of si_draw
Marek Olšák [Tue, 23 Aug 2022 21:51:49 +0000 (17:51 -0400)]
radeonsi: move patch_vertices-related tessellation updates out of si_draw

This only depends on the patch_vertices and the TCS.

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

23 months agoradeonsi: remove 1 draw packet order codepath, keep the first one
Marek Olšák [Sun, 14 Aug 2022 13:12:03 +0000 (09:12 -0400)]
radeonsi: remove 1 draw packet order codepath, keep the first one

Multi-mode multi-draws will make it more complicated, so let's start with
simpler code.

I changed the order a little: I put the VBO update next to emit_draw_packets.

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

23 months agoradeonsi: cosmetic changes in si_emit_rasterizer_prim_state
Marek Olšák [Sun, 14 Aug 2022 12:50:31 +0000 (08:50 -0400)]
radeonsi: cosmetic changes in si_emit_rasterizer_prim_state

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

23 months agoradeonsi: set GS_STATE_OUTPRIM and PROVOKING_VTX_INDEX only when they change
Marek Olšák [Sun, 14 Aug 2022 12:20:01 +0000 (08:20 -0400)]
radeonsi: set GS_STATE_OUTPRIM and PROVOKING_VTX_INDEX only when they change

This moves setting those registers from an unconditional place in draw_vbo
into si_set_rasterized_prim (for draw_vbo), si_update_rasterized_prim
(for bind_xx_shader), and si_bind_rs_state.

It's a little more complicated than expected.

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

23 months agoradeonsi: precompute GS_OUT_PRIM in advance
Marek Olšák [Sun, 14 Aug 2022 10:55:19 +0000 (06:55 -0400)]
radeonsi: precompute GS_OUT_PRIM in advance

We don't have to do it every draw now if the rasterized prim type
doesn't change.

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

23 months agoradeonsi: unify the logic that sets rast_prim
Marek Olšák [Sun, 14 Aug 2022 10:46:09 +0000 (06:46 -0400)]
radeonsi: unify the logic that sets rast_prim

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

23 months agoradeonsi: move fixing ngg_culling into si_update_shaders
Marek Olšák [Sun, 14 Aug 2022 07:57:58 +0000 (03:57 -0400)]
radeonsi: move fixing ngg_culling into si_update_shaders

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

23 months agoradeonsi: remove the prim_restart_tri_strips_only option
Marek Olšák [Sun, 14 Aug 2022 07:43:54 +0000 (03:43 -0400)]
radeonsi: remove the prim_restart_tri_strips_only option

Not used enough, no difference in performance for Dirt Rally on 6800.
Move the variable down.

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

23 months agoradeonsi: move *rs to its only use in si_draw
Marek Olšák [Sun, 14 Aug 2022 07:27:53 +0000 (03:27 -0400)]
radeonsi: move *rs to its only use in si_draw

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

23 months agoradeonsi: make the primitive type constant with tessellation
Marek Olšák [Sun, 14 Aug 2022 06:52:34 +0000 (02:52 -0400)]
radeonsi: make the primitive type constant with tessellation

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

23 months agoradeonsi: don't pass num_patches via derived_tess_state, pass it via si_context
Marek Olšák [Sun, 14 Aug 2022 06:48:30 +0000 (02:48 -0400)]
radeonsi: don't pass num_patches via derived_tess_state, pass it via si_context

This removes the parameter from si_emit_derived_tess_state and uses
si_context to pass it. This rework is needed for multi-mode draws
where num_patches will be needed much later.

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

23 months agoradeonsi/ci: add skips of tests not built on Linux
Marek Olšák [Mon, 15 Aug 2022 06:56:57 +0000 (02:56 -0400)]
radeonsi/ci: add skips of tests not built on Linux

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

23 months agopanfrost: Use util/bitpack_helpers.h
Jason Ekstrand [Mon, 15 Aug 2022 14:29:11 +0000 (09:29 -0500)]
panfrost: Use util/bitpack_helpers.h

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>

23 months agoasahi: Use util/bitpack_helpers.h
Jason Ekstrand [Mon, 15 Aug 2022 14:17:37 +0000 (09:17 -0500)]
asahi: Use util/bitpack_helpers.h

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>

23 months agoutil: Add util_bitpack_[su]fixed_clamp helpers
Jason Ekstrand [Mon, 15 Aug 2022 14:13:17 +0000 (09:13 -0500)]
util: Add util_bitpack_[su]fixed_clamp helpers

These clamp the value to the fixed-point range instead of asserting.

Reviewed-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>

23 months agobroadcom: Use util/bitpack_helpers.h
Jason Ekstrand [Mon, 15 Aug 2022 14:07:02 +0000 (09:07 -0500)]
broadcom: Use util/bitpack_helpers.h

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>

23 months agoutil,intel: Pull the bit packing helpers from genxml to a common header
Jason Ekstrand [Mon, 15 Aug 2022 13:52:20 +0000 (08:52 -0500)]
util,intel: Pull the bit packing helpers from genxml to a common header

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18062>

23 months agozink: defer all compute shader creation
Mike Blumenkrantz [Tue, 30 Aug 2022 00:03:23 +0000 (20:03 -0400)]
zink: defer all compute shader creation

with other various changes, this should enable the entirety of compute
shader creation to occur in the compile thread

it also enables (slightly) simplifying shader create by moving cube check
out to the caller

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

23 months agozink: add function to check whether a shader has cube samplers
Mike Blumenkrantz [Mon, 15 Aug 2022 16:57:08 +0000 (12:57 -0400)]
zink: add function to check whether a shader has cube samplers

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

23 months agozink: generate sha1 for compute programs
Mike Blumenkrantz [Fri, 12 Aug 2022 17:28:32 +0000 (13:28 -0400)]
zink: generate sha1 for compute programs

this got broken in the move to u_live_shader_cache, which does not
handle compute programs and thus does not populate the shader's sha1

cc: mesa-stable

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

23 months agozink: init fbfetch/bindless ctx stuff on shader create
Mike Blumenkrantz [Mon, 15 Aug 2022 16:45:41 +0000 (12:45 -0400)]
zink: init fbfetch/bindless ctx stuff on shader create

deferring until later will be problematic for threads

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

23 months agozink: add a context pointer to zink_program struct
Mike Blumenkrantz [Mon, 15 Aug 2022 16:26:19 +0000 (12:26 -0400)]
zink: add a context pointer to zink_program struct

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

23 months agozink: add locking for descriptor layout caches
Mike Blumenkrantz [Mon, 15 Aug 2022 16:21:19 +0000 (12:21 -0400)]
zink: add locking for descriptor layout caches

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

23 months agozink: add partial async shader compile support
Mike Blumenkrantz [Fri, 12 Aug 2022 15:34:29 +0000 (11:34 -0400)]
zink: add partial async shader compile support

when compute shaders can be precompiled, they can be precompiled asynchronously
which allows the implementation of the parallel shader compile hooks

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

23 months agozink: add precompilation for compute shaders
Mike Blumenkrantz [Fri, 12 Aug 2022 15:23:22 +0000 (11:23 -0400)]
zink: add precompilation for compute shaders

for compute shaders that don't need spec constants or cube lowering,
precompiles are possible and can be performed immediately after disk
cache lookup completes

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

23 months agozink: move compute descriptor binds down in execution
Mike Blumenkrantz [Mon, 15 Aug 2022 17:18:58 +0000 (13:18 -0400)]
zink: move compute descriptor binds down in execution

this has to occur after the pipeline has been updated to account for
async compile

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

23 months agozink: add a param to allow zink_screen_update_pipeline_cache to run directly
Mike Blumenkrantz [Fri, 12 Aug 2022 15:30:08 +0000 (11:30 -0400)]
zink: add a param to allow zink_screen_update_pipeline_cache to run directly

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

23 months agozink: move compute pipeline cache update to caller
Mike Blumenkrantz [Fri, 12 Aug 2022 15:29:15 +0000 (11:29 -0400)]
zink: move compute pipeline cache update to caller

this is more flexible

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

23 months agozink: track whether shader has cube samplers
Mike Blumenkrantz [Fri, 12 Aug 2022 15:20:18 +0000 (11:20 -0400)]
zink: track whether shader has cube samplers

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

23 months agozink: use different key comparison for local_size-using compute pipelines
Mike Blumenkrantz [Fri, 12 Aug 2022 15:11:11 +0000 (11:11 -0400)]
zink: use different key comparison for local_size-using compute pipelines

this should be more correct

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

23 months agozink: stop zeroing local size if current compute doesn't use it
Mike Blumenkrantz [Fri, 12 Aug 2022 15:09:06 +0000 (11:09 -0400)]
zink: stop zeroing local size if current compute doesn't use it

this just complicates things for later compute updates

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

23 months agozink: remove use_local_size from compute pipeline state
Mike Blumenkrantz [Fri, 12 Aug 2022 14:25:08 +0000 (10:25 -0400)]
zink: remove use_local_size from compute pipeline state

this is redundant since pipeline state gets flagged on bind

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

23 months agozink: don't add compute base pipeline to hash table
Mike Blumenkrantz [Fri, 12 Aug 2022 15:00:02 +0000 (11:00 -0400)]
zink: don't add compute base pipeline to hash table

this is pointless since it has no lookup data

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

23 months agozink: merge compute program hash table onto program struct
Mike Blumenkrantz [Fri, 12 Aug 2022 14:57:05 +0000 (10:57 -0400)]
zink: merge compute program hash table onto program struct

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

23 months agozink: add a pipeline shortcut for basic compute programs
Mike Blumenkrantz [Fri, 12 Aug 2022 14:49:07 +0000 (10:49 -0400)]
zink: add a pipeline shortcut for basic compute programs

if there are no inline uniforms, nonseamless cubes, or local size use,
then this is the "base" pipeline object that can be reused without checking
the hash table

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

23 months agozink: add param to allow cache_get jobs to run directly
Mike Blumenkrantz [Fri, 12 Aug 2022 14:34:14 +0000 (10:34 -0400)]
zink: add param to allow cache_get jobs to run directly

this will be useful for precompiles

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

23 months agozink: don't call util_queue_fence_init in zink_screen_get_pipeline_cache()
Mike Blumenkrantz [Fri, 12 Aug 2022 14:33:01 +0000 (10:33 -0400)]
zink: don't call util_queue_fence_init in zink_screen_get_pipeline_cache()

this might accidentally clobber existing jobs

cc: mesa-stable

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

23 months agozink: add use_local_size flag to compute programs
Mike Blumenkrantz [Fri, 12 Aug 2022 14:23:09 +0000 (10:23 -0400)]
zink: add use_local_size flag to compute programs

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

23 months agozink: initialize cache_get_thread unconditionally
Mike Blumenkrantz [Thu, 11 Aug 2022 21:07:10 +0000 (17:07 -0400)]
zink: initialize cache_get_thread unconditionally

this can also be used for precompiles

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

23 months agozink: create compute programs from compute shaders directly
Mike Blumenkrantz [Thu, 11 Aug 2022 20:50:54 +0000 (16:50 -0400)]
zink: create compute programs from compute shaders directly

this simplifies the whole compute shader/program architecture and
also compiles compute shaders when apps maybe expect them to be compiled

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

23 months agozink: allow programs to solely manage descriptor deinit
Mike Blumenkrantz [Thu, 11 Aug 2022 20:45:23 +0000 (16:45 -0400)]
zink: allow programs to solely manage descriptor deinit

now that there's no context access, this is perfectly safe and also much simpler

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

23 months agozink: use screen param for zink_descriptor_program_deinit
Mike Blumenkrantz [Thu, 11 Aug 2022 20:44:50 +0000 (16:44 -0400)]
zink: use screen param for zink_descriptor_program_deinit

this better enables late destruction of programs

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

23 months agoci: disable the freedreno farm.
Marek Olšák [Tue, 30 Aug 2022 03:53:38 +0000 (23:53 -0400)]
ci: disable the freedreno farm.

It's busted.

Pushing directly. There are 6 MRs in the Marge queue and we don't have that
kind of time to wait for them to time out.

Acked-by: Rob Clark on IRC
23 months agoradv,lvp,anv: Delete pre-common dispatch leftover.
Tatsuyuki Ishi [Sun, 28 Aug 2022 13:13:04 +0000 (22:13 +0900)]
radv,lvp,anv: Delete pre-common dispatch leftover.

These functions are no longer used since the introduction of common
dispatch.

Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Acked-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18284>

23 months agoradv: Remove unused radv_deferred_queue_submission.
Tatsuyuki Ishi [Sun, 28 Aug 2022 13:06:36 +0000 (22:06 +0900)]
radv: Remove unused radv_deferred_queue_submission.

Has been stale since the common sync migration.

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

23 months agoradv: Remove unused functions.
Tatsuyuki Ishi [Sat, 27 Aug 2022 09:27:42 +0000 (18:27 +0900)]
radv: Remove unused functions.

Grep shows no usage.
Found by manual inspection.

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

23 months agowinsys/amdgpu: use cached GTT for command buffers and don't set the 32BIT flag
Marek Olšák [Wed, 17 Aug 2022 15:56:21 +0000 (11:56 -0400)]
winsys/amdgpu: use cached GTT for command buffers and don't set the 32BIT flag

This improves performance a lot in a few viewperf tests.

The 32-bit flag was unnecessary.

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

23 months agoegl: Remove some can't-happen supported API checks
Adam Jackson [Tue, 16 Aug 2022 01:46:19 +0000 (21:46 -0400)]
egl: Remove some can't-happen supported API checks

The only other thing this could be is OpenVG, which we never create.

Reviewed-by: Eric Engestrom <eric@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18128>

23 months agod3d12: Implement cap PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP
Sil Vilerino [Mon, 29 Aug 2022 16:43:03 +0000 (12:43 -0400)]
d3d12: Implement cap PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP

Reports d3d12 support for mapping all the contiguous planes.
This will be used by vaDeriveImage in the VA frontend

Fixes: a585d95803ca38d42b893603a85bf6442a54838a ("radeonsi/vcn: WA 10bit encoding crash in vaapi")

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18300>

23 months agogallium/va: vaDeriveImage to check PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP
Sil Vilerino [Mon, 29 Aug 2022 16:42:41 +0000 (12:42 -0400)]
gallium/va: vaDeriveImage to check PIPE_VIDEO_SUPPORTS_CONTIGUOUS_PLANES_MAP

vaDeriveImage should check if the underlying gallium driver can map contiguous planes
before skipping with disallowlist.

Fixes: a585d95803ca38d42b893603a85bf6442a54838a ("radeonsi/vcn: WA 10bit encoding crash in vaapi")

Reviewed-by: Ruijing Dong <ruijing.dong@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18300>

23 months agoradv: emit the guardband state separately from the scissor state
Samuel Pitoiset [Thu, 25 Aug 2022 09:01:43 +0000 (11:01 +0200)]
radv: emit the guardband state separately from the scissor state

Only re-emit the scissor state if viewports or scissors change, and
only re-emit the guardband state if viewports, line width or the
current rasterized primitive change.

This should reduce the number of emitted packets when only the line
width or the rasterized primitive change.

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

23 months agoradv: rework dirtying scissors when the line width changes
Samuel Pitoiset [Thu, 25 Aug 2022 08:46:51 +0000 (10:46 +0200)]
radv: rework dirtying scissors when the line width changes

The guardband state (part of scissors) needs to be re-emitted when
the line width changes. Given this is a dynamic state, it's not
necessary to look at the pipeline line width.

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

23 months agoradv: split emitting guardband into a separate helper
Samuel Pitoiset [Thu, 25 Aug 2022 07:47:24 +0000 (09:47 +0200)]
radv: split emitting guardband into a separate helper

This will be used to emit guardband separately from scissor.

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

23 months agoradv: remove useless parameter in si_write_scissors()
Samuel Pitoiset [Thu, 25 Aug 2022 07:41:14 +0000 (09:41 +0200)]
radv: remove useless parameter in si_write_scissors()

It always starts from 0.

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

23 months agoradv: make sure to emit BREAK_BATCH when color write enable is dynamic
Samuel Pitoiset [Thu, 25 Aug 2022 06:50:37 +0000 (08:50 +0200)]
radv: make sure to emit BREAK_BATCH when color write enable is dynamic

Color write enable can change CB_TARGET_MASK and emitting a BREAK_BATCH
seems needed for binning. Though, this was broken if this enable bit
changed dynamically for the same pipeline. Split the function to not
increase CPU overhead.

Found by inspection.

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

23 months agoradv: store binning settings into the physical device
Samuel Pitoiset [Thu, 25 Aug 2022 06:41:05 +0000 (08:41 +0200)]
radv: store binning settings into the physical device

To avoid re-computing this every time.

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

23 months agoturnip: Fix enabling of IB2 skipping.
Emma Anholt [Mon, 22 Aug 2022 16:37:25 +0000 (09:37 -0700)]
turnip: Fix enabling of IB2 skipping.

We weren't setting LOCAL, so unless freedreno GL had set it since the GPU
woke up, we wouldn't get it.

This requires moving the GLOBAL unsetting out of tile_store's IB, since it
would never be executed when it mattered, anyway.

No perf difference detected on gfxbench vk-5-normal, or ANGLE minecraft,
genshin, and pubg.

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

23 months agofreedreno/regs: Add a bit of documentation of what SKIP_IB2 does.
Emma Anholt [Mon, 22 Aug 2022 16:35:13 +0000 (09:35 -0700)]
freedreno/regs: Add a bit of documentation of what SKIP_IB2 does.

Based on @cwabbott's research.

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

23 months agoutil: Move detect_done out of struct util_cpu_caps_t
Yonggang Luo [Sat, 30 Jul 2022 04:40:55 +0000 (12:40 +0800)]
util: Move detect_done out of struct util_cpu_caps_t

Also util_cpu_caps are hided, not accessed directly now

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Use environment variable GALLIUM_OVERRIDE_CPU_CAPS to remove usage of util_cpu_...
Yonggang Luo [Thu, 25 Aug 2022 01:49:21 +0000 (09:49 +0800)]
util: Use environment variable GALLIUM_OVERRIDE_CPU_CAPS to remove usage of util_cpu_caps in translate_test.c

It's use extern struct util_cpu_caps_t util_cpu_caps that's violate the
restriction that we can not directly access util_cpu_caps

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agogallium: Fixes memory leak of translate_test.c
Yonggang Luo [Thu, 25 Aug 2022 15:04:59 +0000 (23:04 +0800)]
gallium: Fixes memory leak of translate_test.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agollvmpipe: Remove the hack for LLVM4 in lp_bld_init.c
Yonggang Luo [Tue, 23 Aug 2022 16:20:02 +0000 (00:20 +0800)]
llvmpipe: Remove the hack for LLVM4 in lp_bld_init.c

The main intention is remove usage of extern struct util_cpu_caps_t util_cpu_caps
so we can mark util_cpu_caps to be static latter

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Handling LP_FORCE_SSE2 in u_cpu_detect.c
Yonggang Luo [Tue, 23 Aug 2022 16:20:52 +0000 (00:20 +0800)]
util: Handling LP_FORCE_SSE2 in u_cpu_detect.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Handling GALLIUM_NOSSE in u_cpu_detect.c
Yonggang Luo [Sun, 7 Aug 2022 07:31:33 +0000 (15:31 +0800)]
util: Handling GALLIUM_NOSSE in u_cpu_detect.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Improve has_sse has_sse2 has_sse3 has_sse4_1 has_avx disable handling
Yonggang Luo [Sun, 7 Aug 2022 07:20:43 +0000 (15:20 +0800)]
util: Improve has_sse has_sse2 has_sse3 has_sse4_1 has_avx disable handling

This is the prepare for following changes:

* Handling GALLIUM_NOSSE in u_cpu_detect.c
* Handling LP_FORCE_SSE2 and LP_NATIVE_VECTOR_WIDTH in u_cpu_detect.c

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Rename util_cpu_detect to _util_cpu_detect_local
Yonggang Luo [Sat, 30 Jul 2022 04:36:45 +0000 (12:36 +0800)]
util: Rename util_cpu_detect to _util_cpu_detect_local

Add comment about _util_cpu_detect_local that it's can only be called by util_get_cpu_caps
Add comment about util_cpu_caps that it's can only by accessed by util_get_cpu_caps

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>

23 months agoutil: Remove unused rtasm_cpu_has_sse2
Yonggang Luo [Sun, 7 Aug 2022 06:32:49 +0000 (14:32 +0800)]
util: Remove unused rtasm_cpu_has_sse2

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Alyssa Rosenzweig <alyssa@collabora.com>
Reviewed-by: Jose Fonseca <jfonseca@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17803>