platform/upstream/mesa.git
22 months agovulkan: Provide a vk_image_create_get_format_list() helper
Boris Brezillon [Fri, 1 Jul 2022 17:53:34 +0000 (19:53 +0200)]
vulkan: Provide a vk_image_create_get_format_list() helper

Some drivers need to know the full list of formats that can be used
when VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT or
VK_IMAGE_CREATE_BLOCK_TEXEL_VIEW_COMPATIBLE_BIT is set (dozen needs
that at least). While VkImageFormatListCreateInfo is a nice way to
get the actual of formats the user intends to use at view creation time,
this paramter is optional, and when it's missing, we need to know the
full list of compatible formats if we want things to work properly.

Provide a helper that hides all the complexity and return a format list
even when VkImageFormatListCreateInfo is missing.

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

22 months agovulkan: Automatically generate helpers to retrieve format information
Boris Brezillon [Fri, 1 Jul 2022 17:42:30 +0000 (19:42 +0200)]
vulkan: Automatically generate helpers to retrieve format information

In Vulkan, formats are classified in compatible groups, allowing
formats to be cast to other formats in the same group. Some drivers
might need to have access to the full compatible format list, so let's
auto-generate helpers to allow that.

Acked-by: Jesse Natalie <jenatali@microsoft.com>
Reviewed-by: Jason Ekstrand <jason.ekstrand@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17339>

22 months agodzn: Query D3D12_FEATURE_DATA_D3D12_OPTIONS12
Boris Brezillon [Thu, 30 Jun 2022 14:15:51 +0000 (07:15 -0700)]
dzn: Query D3D12_FEATURE_DATA_D3D12_OPTIONS12

Needed to detect whether relaxed format casting is supported or not.

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

22 months agodocs: use code-block
Erik Faye-Lund [Wed, 19 Oct 2022 10:59:09 +0000 (12:59 +0200)]
docs: use code-block

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs: eg -> e.g.
Erik Faye-Lund [Thu, 3 Nov 2022 11:18:13 +0000 (12:18 +0100)]
docs: eg -> e.g.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs/gallium: glsl -> GLSL
Erik Faye-Lund [Thu, 3 Nov 2022 10:08:53 +0000 (11:08 +0100)]
docs/gallium: glsl -> GLSL

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs/gallium: fixup broken markup
Erik Faye-Lund [Thu, 3 Nov 2022 10:04:49 +0000 (11:04 +0100)]
docs/gallium: fixup broken markup

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs: remove spurious backtick
Erik Faye-Lund [Wed, 2 Nov 2022 20:08:27 +0000 (21:08 +0100)]
docs: remove spurious backtick

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs: fix a couple of links
Erik Faye-Lund [Thu, 3 Nov 2022 08:41:35 +0000 (09:41 +0100)]
docs: fix a couple of links

This was broken RST syntax, and lead to a couple of rogue cite-tags in
the rendered HTML.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs: use inline-code instead of default role
Erik Faye-Lund [Wed, 2 Nov 2022 19:50:58 +0000 (20:50 +0100)]
docs: use inline-code instead of default role

A single backtick escaped string in Sphinx refers to the "default role"
which is vague, and in practice ends up producing the HTML cite-element.
That's almost certainly not what these uses wanted.

A bunch of these would probably be better served using appropriate roles
instead of inline-code markup, but this is almost certainly what was
meant here instead. Let's not let perfect be the enemy of good here, and
just do what was intended. Using the right roles everywhere is a big
task.

I usually don't do changes like these to the relnotes, but in this case
there were a *single* article that had these mistakes. I assume that was
an early bug in the script that generateg the relnotes. Let's patch it,
so we don't get misrendering if we change the default-role.

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agodocs: consistently use single-quotes in config
Erik Faye-Lund [Wed, 2 Nov 2022 19:12:25 +0000 (20:12 +0100)]
docs: consistently use single-quotes in config

Reviewed-by: Yonggang Luo <luoyonggang@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19494>

22 months agoci: Uprev kernel to 6.0
Tomeu Vizoso [Wed, 12 Oct 2022 07:54:35 +0000 (09:54 +0200)]
ci: Uprev kernel to 6.0

And also enable some kconfigs needed by existing Qualcomm-based
Chromebooks and also a new model: kingoftown.

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

22 months agoVERSION: fix version as it will be a new year
Eric Engestrom [Fri, 4 Nov 2022 14:30:55 +0000 (14:30 +0000)]
VERSION: fix version as it will be a new year

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

22 months agoRevert "ci: Collabora farm maintanance"
David Heidelberg [Fri, 4 Nov 2022 05:15:20 +0000 (06:15 +0100)]
Revert "ci: Collabora farm maintanance"

Farm is up again.

This reverts commit e0c577d5227fa6aaa061b3f388711fb24d6fc146.

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

22 months agoCI: convert to use the new S3 server instead of the legacy minio
Benjamin Tissoires [Thu, 13 Oct 2022 19:25:38 +0000 (21:25 +0200)]
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.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>

22 months agoci: Update ci-fairy in CI, rootfs and containers
Guilherme Gallo [Thu, 20 Oct 2022 06:03:08 +0000 (03:03 -0300)]
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

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>

22 months agoci: Update piglit-traces tests expectations
Guilherme Gallo [Mon, 24 Oct 2022 18:29:09 +0000 (15:29 -0300)]
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.

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

22 months agoci: Update piglit with s3 support
Guilherme Gallo [Mon, 31 Oct 2022 10:13:16 +0000 (11:13 +0100)]
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.

Signed-off-by: Guilherme Gallo <guilherme.gallo@collabora.com>
Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>

22 months agoci: re-enable scheduled pipelines for git cache
Benjamin Tissoires [Fri, 14 Oct 2022 07:50:40 +0000 (09:50 +0200)]
ci: re-enable scheduled pipelines for git cache

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19076>

22 months agozink/ci: add another subtest to the list of known failures for radv
Martin Roukala (né Peres) [Fri, 4 Nov 2022 07:02:06 +0000 (09:02 +0200)]
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: 53721827ea1c ("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>

22 months agobroadcom/compiler: drop unused v3d_compile parameter for nir pass
Iago Toral Quiroga [Fri, 4 Nov 2022 08:51:33 +0000 (09:51 +0100)]
broadcom/compiler: drop unused v3d_compile parameter for nir pass

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

22 months agov3dv: use vk_alloc instead of malloc
Iago Toral Quiroga [Fri, 4 Nov 2022 08:17:08 +0000 (09:17 +0100)]
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>

22 months agov3dv: vkCmdWaitEvents2 takes an array of VkDependencyInfo
Iago Toral Quiroga [Fri, 4 Nov 2022 08:01:01 +0000 (09:01 +0100)]
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>

22 months agozink/ci: mark another test as fixed after the frontend caching series
Martin Roukala (né Peres) [Wed, 2 Nov 2022 13:41:46 +0000 (15:41 +0200)]
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: 4e14da056d62 ("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>

22 months agoci: uprev vkd3d-proton to v2.7
Samuel Pitoiset [Thu, 3 Nov 2022 10:19:59 +0000 (11:19 +0100)]
ci: uprev vkd3d-proton to v2.7

For up-to-date vkd3d-proton testsuite.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Acked-by: Martin Roukala (né Peres) <martin.roukala@mupuf.org>
Acked-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19499>

22 months agoradv: fix setting MIN_LOD for texture descriptors on GFX11
Samuel Pitoiset [Thu, 3 Nov 2022 02:56:00 +0000 (02:56 +0000)]
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>

22 months agoci: Collabora farm maintanance
David Heidelberg [Thu, 3 Nov 2022 19:28:37 +0000 (20:28 +0100)]
ci: Collabora farm maintanance

Signed-off-by: David Heidelberg <david.heidelberg@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19511>

22 months agomicrosoft/spirv2dxil: Lower sample pos for fragment shaders
Jesse Natalie [Wed, 2 Nov 2022 16:37:40 +0000 (09:37 -0700)]
microsoft/spirv2dxil: Lower sample pos for fragment shaders

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

22 months agod3d12: Move lower_sample_pos to microsoft/compiler
Jesse Natalie [Wed, 2 Nov 2022 16:37:20 +0000 (09:37 -0700)]
d3d12: Move lower_sample_pos to microsoft/compiler

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

22 months agoac: fix IB parsing for Stoney
Marek Olšák [Fri, 21 Oct 2022 19:30:53 +0000 (15:30 -0400)]
ac: fix IB parsing for Stoney

We need to pass the family to register parsing functions.

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

22 months agoac/gpu_info: simplify how has_accelerated_dot_product is set
Marek Olšák [Fri, 21 Oct 2022 19:08:15 +0000 (15:08 -0400)]
ac/gpu_info: simplify how has_accelerated_dot_product is set

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

22 months agoamd/registers: regenerate gfx11 headers from amd-staging-drm-next
Marek Olšák [Fri, 21 Oct 2022 19:03:22 +0000 (15:03 -0400)]
amd/registers: regenerate gfx11 headers from amd-staging-drm-next

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

22 months agoamd/registers: describe allowed register ranges better
Marek Olšák [Fri, 21 Oct 2022 19:00:03 +0000 (15:00 -0400)]
amd/registers: describe allowed register ranges better

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

22 months agoamd/registers: fix parse_kernel_headers.py warnings by adding missing enums
Marek Olšák [Fri, 21 Oct 2022 18:01:31 +0000 (14:01 -0400)]
amd/registers: fix parse_kernel_headers.py warnings by adding missing enums

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

22 months agoac/llvm: remove unnecessary gfx11 condition for nir_intrinsic_store_buffer_amd
Marek Olšák [Fri, 28 Oct 2022 21:14:55 +0000 (17:14 -0400)]
ac/llvm: remove unnecessary gfx11 condition for nir_intrinsic_store_buffer_amd

ac_build_buffer_store_dword is responsible for this.

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

22 months agodzn: Set Agility SDK parameters and update test expectations
Jesse Natalie [Mon, 31 Oct 2022 17:49:00 +0000 (10:49 -0700)]
dzn: Set Agility SDK parameters and update test expectations

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

22 months agod3d12: Set Agility SDK parameters and update test expectations
Jesse Natalie [Mon, 31 Oct 2022 17:48:50 +0000 (10:48 -0700)]
d3d12: Set Agility SDK parameters and update test expectations

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

22 months agoci/windows: Bump test image tag
Jesse Natalie [Mon, 29 Aug 2022 03:02:39 +0000 (20:02 -0700)]
ci/windows: Bump test image tag

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>

22 months agoci/windows: Enable developer mode for test container
Jesse Natalie [Sun, 28 Aug 2022 01:42:09 +0000 (18:42 -0700)]
ci/windows: Enable developer mode for test container

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>

22 months agoci/windows: Get DXIL.dll (and DXCompiler.dll) from GitHub and put it in System32
Jesse Natalie [Sun, 28 Aug 2022 01:24:13 +0000 (18:24 -0700)]
ci/windows: Get DXIL.dll (and DXCompiler.dll) from GitHub and put it in System32

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>

22 months agoci/windows: Download updated WARP and copy to piglit/vk-gl-cts
Jesse Natalie [Tue, 18 Oct 2022 17:11:08 +0000 (10:11 -0700)]
ci/windows: Download updated WARP and copy to piglit/vk-gl-cts

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>

22 months agoci/windows: Download DirectX Agility SDK and copy to piglit/vk-gl-cts
Jesse Natalie [Sun, 28 Aug 2022 01:17:37 +0000 (18:17 -0700)]
ci/windows: Download DirectX Agility SDK and copy to piglit/vk-gl-cts

Reviewed-by: Giancarlo Devich <gdevich@microsoft.com>
Reviewed-by: Sil Vilerino <sivileri@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19178>

22 months agomicrosoft/compiler: Fix feature flag handling for 64-bit bitcasts
Jesse Natalie [Tue, 1 Nov 2022 22:29:53 +0000 (15:29 -0700)]
microsoft/compiler: Fix feature flag handling for 64-bit bitcasts

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

22 months agohasvk: fix android build and reported API version
Mauro Rossi [Tue, 1 Nov 2022 14:34:22 +0000 (15:34 +0100)]
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>

22 months agoradv: Use spirv1.5 instead of vulkan1.2
Friedrich Vock [Wed, 2 Nov 2022 18:52:09 +0000 (19:52 +0100)]
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>

22 months agotu: VK_EXT_extended_dynamic_state3 is finished
Connor Abbott [Mon, 10 Oct 2022 18:23:04 +0000 (20:23 +0200)]
tu: VK_EXT_extended_dynamic_state3 is finished

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

22 months agotu: Implement extendedDynamicState3ColorWriteMask
Connor Abbott [Fri, 30 Sep 2022 16:42:14 +0000 (18:42 +0200)]
tu: Implement extendedDynamicState3ColorWriteMask

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

22 months agotu: Implement extendedDynamicState3ColorBlendEquation
Connor Abbott [Fri, 30 Sep 2022 16:19:18 +0000 (18:19 +0200)]
tu: Implement extendedDynamicState3ColorBlendEquation

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

22 months agotu: Make tu_pipeline::dynamic_state_mask 64-bit
Connor Abbott [Wed, 5 Oct 2022 16:42:52 +0000 (18:42 +0200)]
tu: Make tu_pipeline::dynamic_state_mask 64-bit

We're running out.

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

22 months agofreedreno: Make BIT() 64-bit
Connor Abbott [Wed, 5 Oct 2022 16:27:02 +0000 (18:27 +0200)]
freedreno: Make BIT() 64-bit

In turnip we were using this a lot with the dynamic state enum, and
we're running out of space there because we're needing to add more and
more dynamic states that don't correspond to draw states. Make it
64-bit-safe so we don't need to rewrite everything in turnip. In the
case where the thing being operated on is 32-bit the compiler can
usually optimize it away, as can be seen with the release build size
before and after:

before:
   text    data     bss     dec     hex filename
5404913  293592   22744 5721249  574ca1 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so
   text    data     bss     dec     hex filename
13981320         498550  205000 14684870         e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so

after:
   text    data     bss     dec     hex filename
5404969  293592   22744 5721305  574cd9 /home/cwabbott/build/mesa-release/lib64/libvulkan_freedreno.so
   text    data     bss     dec     hex filename
13981320         498550  205000 14684870         e012c6 /home/cwabbott/build/mesa-release/lib64/dri/msm_dri.so

In the end the only changes is an additional ~50 bytes of text in
turnip.

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

22 months agotu: Implement extendedDynamicState3ColorBlendEnable
Connor Abbott [Fri, 30 Sep 2022 15:41:49 +0000 (17:41 +0200)]
tu: Implement extendedDynamicState3ColorBlendEnable

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

22 months agotu: Remove blend dependency on attachment format
Connor Abbott [Fri, 30 Sep 2022 15:31:02 +0000 (17:31 +0200)]
tu: Remove blend dependency on attachment format

This matches freedreno, still passes all the tests, and will make
dynamic blend easier because we can compute more up-front.

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

22 months agotu: Implement extendedDynamicState3SampleLocationsEnable
Connor Abbott [Fri, 30 Sep 2022 14:21:11 +0000 (16:21 +0200)]
tu: Implement extendedDynamicState3SampleLocationsEnable

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

22 months agotu: Clamp sample locations
Connor Abbott [Fri, 30 Sep 2022 13:53:42 +0000 (15:53 +0200)]
tu: Clamp sample locations

This was missed in the initial implementation and fixes extreme sample
locations like (1.0, 1.0).

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

22 months agotu: Implement extendedDynamicState3ProvokingVertexMode
Connor Abbott [Fri, 30 Sep 2022 12:33:15 +0000 (14:33 +0200)]
tu: Implement extendedDynamicState3ProvokingVertexMode

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

22 months agotu: Implement extendedDynamicState3LineRasterizationMode
Connor Abbott [Fri, 30 Sep 2022 12:18:05 +0000 (14:18 +0200)]
tu: Implement extendedDynamicState3LineRasterizationMode

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

22 months agotu: Impement extendedDynamicState3RasterizationStream
Connor Abbott [Fri, 30 Sep 2022 12:07:17 +0000 (14:07 +0200)]
tu: Impement extendedDynamicState3RasterizationStream

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

22 months agotu: Rename RASTERIZER_DISCARD state to PC_RASTER_CNTL
Connor Abbott [Fri, 30 Sep 2022 10:48:34 +0000 (12:48 +0200)]
tu: Rename RASTERIZER_DISCARD state to PC_RASTER_CNTL

It also contains the rasterization stream.

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

22 months agotu: Implement extendedDynamicState3DepthClipNegativeOneToOne
Connor Abbott [Fri, 30 Sep 2022 10:42:27 +0000 (12:42 +0200)]
tu: Implement extendedDynamicState3DepthClipNegativeOneToOne

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

22 months agotu: Implement extendedDynamicState3AlphaToOneEnable
Connor Abbott [Fri, 30 Sep 2022 09:53:25 +0000 (11:53 +0200)]
tu: Implement extendedDynamicState3AlphaToOneEnable

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

22 months agotu: Implement extendedDynamicState3AlphaToCoverageEnable
Connor Abbott [Fri, 30 Sep 2022 09:48:34 +0000 (11:48 +0200)]
tu: Implement extendedDynamicState3AlphaToCoverageEnable

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

22 months agotu: Implement extendedDynamicState3RasterizationSamples
Connor Abbott [Thu, 29 Sep 2022 16:59:02 +0000 (18:59 +0200)]
tu: Implement extendedDynamicState3RasterizationSamples

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

22 months agotu: Set default sample mask to all 1's
Connor Abbott [Thu, 29 Sep 2022 16:55:56 +0000 (18:55 +0200)]
tu: Set default sample mask to all 1's

This avoids a dependency on the sample count in the blend state, and
seems to work. Otherwise, we'd need to make blend dynamic if samples is
dynamic and record whether the sample mask was NULL, which is a lot more
complicated.

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

22 months agotu: Split up tu6_update_msaa()
Connor Abbott [Thu, 29 Sep 2022 16:14:38 +0000 (18:14 +0200)]
tu: Split up tu6_update_msaa()

Most of the time we will only be updating either the number of samples
or whether it should be disabled, not both, and we don't need to compare
both. With pipelines we were comparing both, but with dynamic
rasterization samples we want to only update disable when binding the
pipeline and only update samples when calling
vkCmdSetRasterizationSamplesEXT(). Stop optimizing the uncommon case
where both are changed when binding a pipeline, and split it into 2
parts while sharing the common part that records and emits the state
packet.

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

22 months agotu: Don't use rasterizationSamples when enabling sample shading
Connor Abbott [Thu, 29 Sep 2022 15:58:59 +0000 (17:58 +0200)]
tu: Don't use rasterizationSamples when enabling sample shading

From the spec language, it seems like this change wasn't strictly
required and is just an optimization for when minSampleShading would
be small enough to allow one sample per pixel. However
rasterizationSamples will soon possibly be dynamic, and I don't think we
should keep this around.

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

22 months agotu: Implement extendedDynamicState3SampleMask
Connor Abbott [Thu, 29 Sep 2022 15:58:12 +0000 (17:58 +0200)]
tu: Implement extendedDynamicState3SampleMask

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

22 months agotu: Implement extendedDynamicState3LogicOpEnable
Connor Abbott [Thu, 29 Sep 2022 15:25:06 +0000 (17:25 +0200)]
tu: Implement extendedDynamicState3LogicOpEnable

This is a little tricky because now we always have to store the
translated logicOp in the pipeline, regardless of whether it's enabled
or not, because the enable/disable may now be dynamic even if the
logicOp is not.

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

22 months agotu: Implement extendedDynamicState3Depth*Enable
Connor Abbott [Thu, 29 Sep 2022 14:21:26 +0000 (16:21 +0200)]
tu: Implement extendedDynamicState3Depth*Enable

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

22 months agotu: Implement extendedDynamicState3TessellationDomainOrigin
Connor Abbott [Thu, 29 Sep 2022 12:04:54 +0000 (14:04 +0200)]
tu: Implement extendedDynamicState3TessellationDomainOrigin

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

22 months agotu: Implement extendedDynamicState3PolygonMode
Connor Abbott [Thu, 29 Sep 2022 11:43:46 +0000 (13:43 +0200)]
tu: Implement extendedDynamicState3PolygonMode

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

22 months agotu: Combine GRAS_SU_CNTL drawstate with rast draw state
Connor Abbott [Wed, 28 Sep 2022 16:12:17 +0000 (18:12 +0200)]
tu: Combine GRAS_SU_CNTL drawstate with rast draw state

Emit GRAS_SU_CNTL, GRAS_CL_CNTL, the polygon mode, and the VRS registers
in one draw state. We're running out of draw states, and this saves a
draw state while preparing us for the rest of the rasterization state to
be dynamic.

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

22 months agotu: VK_EXT_extended_dynamic_state3 boilerplate
Connor Abbott [Thu, 29 Sep 2022 10:51:40 +0000 (12:51 +0200)]
tu: VK_EXT_extended_dynamic_state3 boilerplate

Enable the extension but don't enable anything yet.

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

22 months agotu: tu: Clear patchControlPoints dirty state with static patchControlPoints
Connor Abbott [Mon, 10 Oct 2022 20:19:39 +0000 (22:19 +0200)]
tu: tu: Clear patchControlPoints dirty state with static patchControlPoints

Noticed by inspection after the previous issue.

Fixes: 68f3c38c801 ("tu: Implement extendedDynamicState2PatchControlPoints")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/18912>

22 months agotu: Ignore line stipple dynamic state
Connor Abbott [Fri, 21 Oct 2022 11:59:20 +0000 (13:59 +0200)]
tu: Ignore line stipple dynamic state

At least in the current Vulkan spec there is no validation language
saying that it isn't valid to set this state if stippled lines aren't
supported, so it seems we have to just ignore it. Ignore it if the user
specifies a dynamic line stipple state and don't emit warnings if they
call CmdSetLineStippleEXT because zink will do this.

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

22 months agotu: Clear viewport dirty state with static viewports
Connor Abbott [Mon, 10 Oct 2022 20:05:00 +0000 (22:05 +0200)]
tu: Clear viewport dirty state with static viewports

Vulkan allows the user to set extraneous dynamic state which then gets
ignored if a pipeline with static state is bound. We weren't
implementing this correctly for viewports because we weren't clearing
the dirty bit, but it was happening to work until changes for dynamic
depth negative-one-to-one broke
dEQP-VK.pipeline.*.depth.depth_clip_control.d32_sfloat_less_viewport_before_static.

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

22 months agoradv/rra: Print invalid node types
Konstantin Seurer [Tue, 1 Nov 2022 19:31:22 +0000 (20:31 +0100)]
radv/rra: Print invalid node types

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Friedrich Vock <friedrich.vock@gmx.de>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19465>

22 months agointel: Add and use intel_gem_get_context_param()
José Roberto de Souza [Wed, 5 Oct 2022 16:41:10 +0000 (09:41 -0700)]
intel: Add and use intel_gem_get_context_param()

Again sharing the same function across all Intel drivers.

There is still two additional DRM_IOCTL_I915_GEM_CONTEXT_GETPARAM
calls, one in intel/dev and other in perf.
The first one can't call intel_gem_get_context_param() because of the
build order of libs and the second one because it sets the size
parameter.

Will revisit those calls in future but this is already an improvement.

v2:
- using intel_gem_get_context_param() for the recently added query for
I915_CONTEXT_PARAM_PROTECTED_CONTENT

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

22 months agointel: Add and use intel_gem_set_context_param()
José Roberto de Souza [Wed, 5 Oct 2022 16:10:24 +0000 (09:10 -0700)]
intel: Add and use intel_gem_set_context_param()

Again sharing the same function across all Intel drivers.

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

22 months agointel: Add and use intel_gem_destroy_context()
José Roberto de Souza [Wed, 5 Oct 2022 15:49:26 +0000 (08:49 -0700)]
intel: Add and use intel_gem_destroy_context()

Again sharing the same function across all Intel drivers.

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

22 months agointel: Add and use intel_gem_create_context()
José Roberto de Souza [Wed, 5 Oct 2022 15:20:47 +0000 (08:20 -0700)]
intel: Add and use intel_gem_create_context()

Add intel_gem_create_context() to common/intel_gem.c/h and use it
on Iris, Crocus, ANV and HASVK.

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

22 months agointel: Refactor intel_gem_create_context_engines()
José Roberto de Souza [Wed, 5 Oct 2022 15:20:07 +0000 (08:20 -0700)]
intel: Refactor intel_gem_create_context_engines()

This function was returning a int but there was no meaninfull errno
code being returned, also context_id is a uint32_t what would be
problematic if i915 even returned 2147483648(-1).

So here changing the return type and add context_id pointer parameter.

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

22 months agoiris: Do not set I915_CONTEXT_PARAM_RECOVERABLE twice
José Roberto de Souza [Thu, 27 Oct 2022 16:57:30 +0000 (09:57 -0700)]
iris: Do not set I915_CONTEXT_PARAM_RECOVERABLE twice

For the protected context path, it was already set.

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

22 months agointel/common: Add and use intel_gem_create_context_ext()
José Roberto de Souza [Thu, 27 Oct 2022 16:55:39 +0000 (09:55 -0700)]
intel/common: Add and use intel_gem_create_context_ext()

v2:
- added flag mask bit to enable context protected and recoverable
v3:
- added enum intel_gem_create_context_flags

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

22 months agoetnaviv: warn when imported TS buffer is the same as color buffer
Lucas Stach [Tue, 25 Oct 2022 16:38:12 +0000 (18:38 +0200)]
etnaviv: warn when imported TS buffer is the same as color buffer

Color and TS buffers are allocated separately for each etnaviv resource, so
getting the same base and TS buffer at import time is unexpected and a strong
hint at the application doing something wrong, like passing in the same GEM
handle for all planes on a GBM import. Print a warning to give the user some
feedback.

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

22 months agoetnaviv: add support for sharing the TS buffer
Lucas Stach [Wed, 28 Oct 2020 19:13:45 +0000 (20:13 +0100)]
etnaviv: add support for sharing the TS buffer

This adds support for sharing the TS buffer, which up until now has been
an internal implementation detail, with the outside world. This mainly
improves performance with a GPU compositor present, but on i.MX8M also
direct to display use-cases benefit.

The impact of this change depends on the GPU generation:
- old GPUs with a single pipe won't see any difference
- GC2000 can skip the TS resolve in the client and will benefit from a
  more efficient blit into the sampler compatible format when the client
  buffer contains cleared tiles
- GC3000 can directly sample with TS support, so saves both write and read
  memory bandwidth when the client buffer contains cleared tiles
- GC7000 with compression support can keep the client buffer in compressed
  format, thus saving both read and write bandwidth even for fully filled
  client buffers
- GC7000 coupled to a display unit supporting the compression format (DCSS
  on i.MX8M) does not even need to uncompress the render buffer for display
  so will see significant bandwidth saving even when GPU compositing is
  bypassed

There is a slight complication in that the tile clear color isn't part of
the TS buffer, but is programmed into state registers in the GPU. To handle
this externally shared TS buffers now contain a software metadata area,
where the clear color is stored by the driver, so the receiving end of the
TS buffer can retrieve the clear color from this area.

The compression format is handled in the same way by storing it in the SW
meta area. While we can derive the compression format from the color buffer
format in most cases, some users, like weston, expect that they can "upgrade"
ARGB to XRGB color formats. While this works with plain color formats, as
it's just masking a channel, the compression format differs when alpha is in
use. Receivers of the TS buffer should thus not try to infer the compression
format from the color buffer format, but instead fetch it from the SW meta.

The import/export handling of the TS buffer is modelled after the Intel iris
driver: we add a separate plane for the TS buffer and fold it into the base
resource after the import.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

22 months agoetnaviv: canonicalize modifier on import
Lucas Stach [Fri, 14 Oct 2022 14:16:49 +0000 (16:16 +0200)]
etnaviv: canonicalize modifier on import

Unknown modifiers are currently squashed down to linear when transforming
the modifier into our interal layout representation. However, the only real
modifier that we expect to see, which isn't Vivante specific or LINEAR, is
the INVALID modifier. Treat this modifier as linear and reject any other
unexpected modifiers.

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

22 months agodrm-uapi: bump headers
Lucas Stach [Tue, 23 Mar 2021 10:41:55 +0000 (11:41 +0100)]
drm-uapi: bump headers

From drm-next at the following commit:

    commit 7f7a942c0a338c4a2a7b359bdb2b68e9896122ec
    Merge: 0a20a3ea4259 ddcb8fa6514f
    Author: Dave Airlie <airlied@redhat.com>
    Date:   Thu Oct 27 14:44:02 2022 +1000

        Merge tag 'drm-next-20221025' of git://linuxtv.org/pinchartl/media into drm-next

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

22 months agoetnaviv: allocate TS memory from KMS when resource bind is SCANOUT
Lucas Stach [Wed, 13 Jul 2022 18:48:33 +0000 (20:48 +0200)]
etnaviv: allocate TS memory from KMS when resource bind is SCANOUT

Some display engines are able to resolve fast clear and/or compression
on the fly and need access to the TS buffer to do so. As they might
have restrictions on which memory they can access, allocate the TS
buffer memory from the KMS side when the resource should be SCANOUT
capable.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

22 months agoetnaviv: rework modifier queries
Lucas Stach [Wed, 13 Jul 2022 18:14:57 +0000 (20:14 +0200)]
etnaviv: rework modifier queries

Rework the loops in the modifier queries to make them a bit more
straight-forward and use less local variables. Those loops get
much more complex as more variations of the modifiers get added,
so the simplification done here is an attempt to keep the complexity
at bay.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

22 months agoetnaviv: correct comment about tile status size
Lucas Stach [Sat, 13 Aug 2022 13:59:22 +0000 (15:59 +0200)]
etnaviv: correct comment about tile status size

The earlier understanding of how tile status tracks the color/depth
surface was wrong and the TS size calculations have long been fixed,
as we now know that color/depth tiles have a fixed size in bytes and
thus don't depend on the surface format. But nobody changed the comment
explaining how TS works, so it's still around as a trap for the reader.

Reword the comment to not confuse people that aren't intimately
familiar with the inner workings of tile status.

Signed-off-by: Lucas Stach <l.stach@pengutronix.de>
Tested-by: Guido Günther <agx@sigxcpu.org>
Reviewed-by: Christian Gmeiner <christian.gmeiner@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/9780>

22 months agodocs: make the "amber" branch's name explicit
Eric Engestrom [Thu, 3 Nov 2022 16:49:53 +0000 (16:49 +0000)]
docs: make the "amber" branch's name explicit

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

22 months agomesa: Add test to prevent windows.h to be included in shared headers
Yonggang Luo [Wed, 2 Nov 2022 20:53:07 +0000 (04:53 +0800)]
mesa: Add test to prevent windows.h to be included in shared headers

This test is hand crafted by running command
find | grep .*h$ >../headers.txt
under src directory, and using find replace to creating
the file list and then removed the files should not be directly included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomesa: #include "util/glheader.h" instead GL/gl.h in shared code
Yonggang Luo [Wed, 2 Nov 2022 19:11:38 +0000 (03:11 +0800)]
mesa: #include "util/glheader.h" instead GL/gl.h in shared code

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomapi: #include "util/glheader.h" instead of #include "GL/gl.h"
Yonggang Luo [Wed, 2 Nov 2022 19:09:12 +0000 (03:09 +0800)]
mapi: #include "util/glheader.h" instead of #include "GL/gl.h"

Also add macro to guard windows.h won't be included

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agoglapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly
Yonggang Luo [Wed, 2 Nov 2022 16:16:36 +0000 (00:16 +0800)]
glapi: #include "util/glheader.h" in glapi_priv.h and glapitable.h directly

So that we do not need define GLAPIENTRY repeatedly, always using the
GLAPIENTRY macro comes from GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h
Yonggang Luo [Wed, 2 Nov 2022 14:43:19 +0000 (22:43 +0800)]
mesa: Move glheader.h from mesa/main/glheader.h to util/glheader.h

So it's can be accessed in broader places

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomesa: sync GLAPIENTRY with KHRONOS_APIENTRY in GL/gl.h
Yonggang Luo [Wed, 2 Nov 2022 16:04:55 +0000 (00:04 +0800)]
mesa: sync GLAPIENTRY with KHRONOS_APIENTRY in GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomesa: BUILD_GL32 is not used anymore
Yonggang Luo [Wed, 2 Nov 2022 16:04:08 +0000 (00:04 +0800)]
mesa: BUILD_GL32 is not used anymore

Remove usage of BUILD_GL32 in GL/gl.h

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agomesa: Remove out-dated comment in common_x86.c
Yonggang Luo [Thu, 3 Nov 2022 14:44:44 +0000 (22:44 +0800)]
mesa: Remove out-dated comment in common_x86.c

Follow up: 8e3696137f2 ("remove final imports.h and imports.c bits")

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>

22 months agoutil: Prevent glheader.h from including <windows.h> by defining APIENTRY
Yonggang Luo [Wed, 2 Nov 2022 16:00:55 +0000 (00:00 +0800)]
util: Prevent glheader.h from including <windows.h> by defining APIENTRY

When APIENTRY is not defined, GL/gl.h and GL/glext.h will automatically
include <windows.h>, so we save the macro APIENTRY by push_macro and then
define APIENTRY before include of GL/gl.h and GL/glext.h.
After that we use pop_macro to recover the previous macro again.

Because windows.h is not included by glheader.h, mesa/main/errors.c needs
to include <windows.h> directly to prevent the following error:
errors.c:98:10: error: implicit declaration of function 'OutputDebugStringA' [-Werror=implicit-function-declaration]
   98 |          OutputDebugStringA(buf);

Signed-off-by: Yonggang Luo <luoyonggang@gmail.com>
Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Acked-by: Brian Paul brianp@vmware.com
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/19472>