platform/upstream/mesa.git
12 months agoegl: unify dri2_egl_display creation
Mike Blumenkrantz [Tue, 10 Oct 2023 11:47:23 +0000 (07:47 -0400)]
egl: unify dri2_egl_display creation

this is the same for all platforms

no functional changes

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

12 months agoradeonsi: Add tracepoints in radeonsi driver
Saroj Kumar [Mon, 17 Jul 2023 15:33:02 +0000 (21:03 +0530)]
radeonsi: Add tracepoints in radeonsi driver

Add initialization code for u_trace and tracepoints in the
driver code.

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

12 months agoradeonsi: Add u_trace init code in radeonsi
Saroj Kumar [Mon, 17 Jul 2023 15:14:53 +0000 (20:44 +0530)]
radeonsi: Add u_trace init code in radeonsi

Add u_trace initialization and callbacks in new files si_utrace.h/c

Change si_context in si_pipe.h to add si_ds_queue and u_trace to
collect traces.

Add si_record_ts function in si_gfx_cs.c to add timestamp in command
stream.

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

12 months agoradeonsi: Add perfetto support in radeonsi
Saroj Kumar [Mon, 17 Jul 2023 14:51:29 +0000 (20:21 +0530)]
radeonsi: Add perfetto support in radeonsi

Add perfetto code in new files si_perfetto.h/cc which add tracepoint
begin and end event and calls to the generated code from python
si_tracepoints.py

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

12 months agoradv: Wait for bottom of pipe in ACE gang wait postamble.
Timur Kristóf [Wed, 18 Oct 2023 13:41:40 +0000 (15:41 +0200)]
radv: Wait for bottom of pipe in ACE gang wait postamble.

This makes sure that the semaphore is only written when all work
on the compute queue is finished.

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

12 months agoradv: Add queue family argument to some functions.
Timur Kristóf [Wed, 18 Oct 2023 13:37:21 +0000 (15:37 +0200)]
radv: Add queue family argument to some functions.

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

12 months agoradv: Use new WRITE_DATA helper in more places.
Timur Kristóf [Wed, 18 Oct 2023 13:07:01 +0000 (15:07 +0200)]
radv: Use new WRITE_DATA helper in more places.

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

12 months agoradv: Refactor WRITE_DATA helper function.
Timur Kristóf [Wed, 18 Oct 2023 12:29:55 +0000 (14:29 +0200)]
radv: Refactor WRITE_DATA helper function.

Create a version of this function that takes a CS and queue family.
move it to radv_cs.h so it can be called from multiple other files.

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

12 months agoradv: Move radv_cp_wait_mem to radv_cs.h and add queue family argument.
Timur Kristóf [Mon, 16 Oct 2023 08:25:06 +0000 (10:25 +0200)]
radv: Move radv_cp_wait_mem to radv_cs.h and add queue family argument.

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

12 months agoradv: Only call si_cp_dma_wait_for_idle on GFX and ACE queues.
Timur Kristóf [Fri, 29 Sep 2023 15:47:40 +0000 (17:47 +0200)]
radv: Only call si_cp_dma_wait_for_idle on GFX and ACE queues.

This command is only supported on GFX and ACE.

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

12 months agoradv: Use const on vi_alpha_is_on_msb arguments.
Timur Kristóf [Fri, 29 Sep 2023 12:12:01 +0000 (14:12 +0200)]
radv: Use const on vi_alpha_is_on_msb arguments.

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

12 months agoradv: Use const device argument in radv_sdma_copy_buffer.
Timur Kristóf [Thu, 5 Oct 2023 23:27:10 +0000 (01:27 +0200)]
radv: Use const device argument in radv_sdma_copy_buffer.

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

12 months agoradv: Rename SDMA file to radv_sdma.c
Timur Kristóf [Tue, 26 Sep 2023 09:34:42 +0000 (11:34 +0200)]
radv: Rename SDMA file to radv_sdma.c

It already contains more than just the buffer image copies.

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

12 months agonvk: Implement VK_EXT_dynamic_rendering_unused_attachments
Faith Ekstrand [Thu, 19 Oct 2023 12:16:38 +0000 (07:16 -0500)]
nvk: Implement VK_EXT_dynamic_rendering_unused_attachments

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

12 months agonvk: Enable descriptorIndexing
Faith Ekstrand [Thu, 19 Oct 2023 12:26:10 +0000 (07:26 -0500)]
nvk: Enable descriptorIndexing

This is the Vulkan 1.2 equivalent of VK_EXT_descriptor_indexing
extension enable.

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

12 months agonvk: Advertise shaderOutputLayer and shaderOutputViewportIndex
Faith Ekstrand [Thu, 19 Oct 2023 12:27:45 +0000 (07:27 -0500)]
nvk: Advertise shaderOutputLayer and shaderOutputViewportIndex

We already advertise the extension but it's moved into feature bits in
Vulkan 1.2 and we didn't have those turned on.

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

12 months agonvk: Re-arrange Vulkan 1.2 features to match the header
Faith Ekstrand [Thu, 19 Oct 2023 12:25:27 +0000 (07:25 -0500)]
nvk: Re-arrange Vulkan 1.2 features to match the header

Also, conditional render ended up in the Vulkan 1.2 section which is
wrong.

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

12 months agofeatures: Mark VK_EXT_attachment_feedback_loop_layout done for NVK
Faith Ekstrand [Thu, 19 Oct 2023 12:53:52 +0000 (07:53 -0500)]
features: Mark VK_EXT_attachment_feedback_loop_layout done for NVK

Fixes: c93b30daa373 ("nvk: Advertise VK_EXT_attachment_feedback_loop_layout")
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25812>

12 months agonvk: Advertise VK_EXT_attachment_feedback_loop_layout
Faith Ekstrand [Thu, 19 Oct 2023 08:07:16 +0000 (03:07 -0500)]
nvk: Advertise VK_EXT_attachment_feedback_loop_layout

We don't need to do anything with the layout.

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

12 months agoanv: uninitialize queues before utrace
Lionel Landwerlin [Thu, 19 Oct 2023 08:00:49 +0000 (11:00 +0300)]
anv: uninitialize queues before utrace

We need to shut down the runtime queue threads before tearing down
anything else.

Gets rid of helgrind errors like this :

==212772== Possible data race during write of size 4 at 0xADCBFB0 by thread #1
==212772== Locks held: 1, at address 0x6B8F260
==212772==    at 0x8AC3EFF: simple_mtx_destroy (simple_mtx.h:97)
==212772==    by 0x8ACB24D: intel_ds_device_fini (intel_driver_ds.cc:603)
==212772==    by 0x6CBD4D4: anv_device_utrace_finish (anv_utrace.c:471)
==212772==    by 0x6C71577: anv_DestroyDevice (anv_device.c:3679)
==212772==    by 0x6B2F1E2: loader_layer_destroy_device (loader.c:4358)
==212772==    by 0x6B3F10B: vkDestroyDevice (trampoline.c:983)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: cc5843a573 ("anv: implement u_trace support")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10010
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25805>

12 months agoci/freedreno: Generalize the implicit_unmap timeouts.
Eric Anholt [Thu, 19 Oct 2023 08:37:51 +0000 (10:37 +0200)]
ci/freedreno: Generalize the implicit_unmap timeouts.

dedicated_alloc.image caused a job flake today.

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

12 months agoanv: don't uninitialize bvh_bo_pool is not initialized
Lionel Landwerlin [Thu, 19 Oct 2023 06:46:14 +0000 (09:46 +0300)]
anv: don't uninitialize bvh_bo_pool is not initialized

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 3e8d2617e1 ("anv: use buffer pools for BVH build buffers")
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/10009
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25802>

12 months agoci/zink: Cut zink-lvp coverage in half.
Eric Anholt [Wed, 18 Oct 2023 17:42:39 +0000 (19:42 +0200)]
ci/zink: Cut zink-lvp coverage in half.

It's taking 23 minutes of deqp-runner time.

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

12 months agoci/freedreno: Move skqp testing to a618.
Eric Anholt [Wed, 18 Oct 2023 14:33:41 +0000 (16:33 +0200)]
ci/freedreno: Move skqp testing to a618.

The limozeen runners are quite under-committed, while we had 10 jobs
running for our 9 cheza runners, causing an unnecessary wait even when the
farms were idle.

I've removed the old 630 skqp bits, so we can just track what's being
tested on 618.  618 had skqp toml and xfails laying around alreaady.

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

12 months agoci/freedreno: Fold a630_egl into a630_gl.
Eric Anholt [Wed, 18 Oct 2023 14:16:00 +0000 (16:16 +0200)]
ci/freedreno: Fold a630_egl into a630_gl.

The GL job was only taking 5 minutes in deqp, and egl is 2 minutes.  Saves
a boot, and gets us closer to starting all a630 jobs at the same time if
the farm was idle.

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

12 months agoci/iris: Drop parallel on kbl piglit to 2.
Eric Anholt [Wed, 18 Oct 2023 13:44:28 +0000 (15:44 +0200)]
ci/iris: Drop parallel on kbl piglit to 2.

We have only 6 of these boards since one died in May, and 7 jobs allocated
to them.  So you ended up with a 5 minute delay on each pipeline with an
otherwise-idle farm while you waited for the first batch of jobs to
complete so you could get the last one started.  It turns out that piglit
was taking 3 minutes of runtime each, so we can just shard piglit 2 ways,
stay under runtime, and not over-allocate the farm

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

12 months agoci/bare-metal: Default our boards to a 20-minute timeout for the whole job.
Eric Anholt [Wed, 18 Oct 2023 13:34:59 +0000 (15:34 +0200)]
ci/bare-metal: Default our boards to a 20-minute timeout for the whole job.

If the test time is 10 minutes, and boot is 1.5 minutes, that gives you
8.5 minutes of slop for intermittent costs like container download.

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

12 months agoci/bare-metal: Drop the 2 vs 1 exit code from poe_run.
Eric Anholt [Wed, 18 Oct 2023 13:25:44 +0000 (15:25 +0200)]
ci/bare-metal: Drop the 2 vs 1 exit code from poe_run.

This exit code was used for the intra-job retries on the other bare-metal
run scripts, but poe_run doesn't do that.

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

12 months agoci: Stop doing internal retries in bare-metal.
Eric Anholt [Wed, 18 Oct 2023 13:18:40 +0000 (15:18 +0200)]
ci: Stop doing internal retries in bare-metal.

We have job-level retry on failure now, and will continue to need to in
order to work around fd.o infrastructure flakes.  If we stop doing retry
inside the job, then we can crank down the gitlab-level timeouts on test
jobs to be closer to our CI guidelines and avoid blocking a runner for an
hour when things go wrong (for example, cheza #16 failing to boot in a
recognized way and continuously looping due to the intra-job retry).
Plus, the job logs will be more readable when you don't have two boots in
one job, and we'll get the flakes surfaced in our monitoring dashboards.

If internal retries were really doing useful work we may see an increase
in flakes as a result of this.  I'm committing to turning off boards or
reducing coverage as necessary to handle this.

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

12 months agoci/zink: Only test half of piglit pre-merge on anv.
Eric Anholt [Wed, 18 Oct 2023 13:04:57 +0000 (15:04 +0200)]
ci/zink: Only test half of piglit pre-merge on anv.

Unfortunately we're at 16 minutes of runtime for this job, which is much
too far past our guidelines.

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

12 months agozink: fix legacy depth texture rewriting for single component reads
Mike Blumenkrantz [Wed, 18 Oct 2023 16:21:02 +0000 (12:21 -0400)]
zink: fix legacy depth texture rewriting for single component reads

if only a single component is read, this instruction can (and must) be
rewritten to use that component since depth sampling in vulkan is single-component

cc: mesa-stable

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

12 months agozink: update pointer for GPL pipeline cache entry formats
Mike Blumenkrantz [Wed, 18 Oct 2023 15:31:31 +0000 (11:31 -0400)]
zink: update pointer for GPL pipeline cache entry formats

this otherwise points to ctx->gfx_pipeline_state.rendering_formats,
which is broken for background compiles

cc: mesa-stable

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

12 months agonir/lower_fragcolor: preserve location_frac
Mike Blumenkrantz [Wed, 18 Oct 2023 16:20:37 +0000 (12:20 -0400)]
nir/lower_fragcolor: preserve location_frac

this otherwise breaks component-based outputs

cc: mesa-stable

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

12 months agovenus: Enable VK_EXT_graphics_pipeline_library behind debug flag
Lina Versace [Thu, 10 Aug 2023 23:32:27 +0000 (16:32 -0700)]
venus: Enable VK_EXT_graphics_pipeline_library behind debug flag

Until the performance issues get resolved, enable the extension
if `VN_DEBUG=gpl`.

Also enable the required (and trivial) VK_KHR_pipeline_library.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Do pipeline fixes for VK_EXT_graphics_pipeline_library
Lina Versace [Thu, 3 Aug 2023 21:23:27 +0000 (14:23 -0700)]
venus: Do pipeline fixes for VK_EXT_graphics_pipeline_library

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Refactor pipeline fixup into two stages
Lina Versace [Thu, 3 Aug 2023 21:11:38 +0000 (14:11 -0700)]
venus: Refactor pipeline fixup into two stages

Function vn_fix_graphics_pipeline_create_infos() had two interleaved
phases: discovery of needed fixes, and application of those fixes.
Move the discovery phase into new function
vn_find_graphics_pipeline_create_info_fixes(). The two-phase approach
will be simplify the implementation of VK_EXT_graphics_pipeline_library.

No intended change in behavior.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Renames for VkGraphicsPipelineCreateInfo fixes
Lina Versace [Thu, 3 Aug 2023 20:37:24 +0000 (13:37 -0700)]
venus: Renames for VkGraphicsPipelineCreateInfo fixes

Use a more consistent naming scheme for everything. Follow-up patches
will implement VK_EXT_graphics_pipeline_library, which will make the
code significantly more complex, in which better names will make the
code more readable.

Except for replacing `any_fix` with `erase.mask`, this patch does modify
any procedural code. It merely renames structs and fields.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Add enum vn_pipeline_type
Lina Versace [Fri, 9 Jun 2023 23:45:03 +0000 (16:45 -0700)]
venus: Add enum vn_pipeline_type

No change in behavior.  Prepares for storing more state in graphics
libraries for VK_EXT_graphics_pipeline_library.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Use VkImageAspectFlags in vn_subpass
Lina Versace [Fri, 9 Jun 2023 23:29:21 +0000 (16:29 -0700)]
venus: Use VkImageAspectFlags in vn_subpass

No intended change in behavior. This little improvement will help
vn_pipeline track its graphics state more accurately.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Drop incorrectly-used always-true pipeline vars
Lina Versace [Fri, 4 Aug 2023 18:11:28 +0000 (11:11 -0700)]
venus: Drop incorrectly-used always-true pipeline vars

When writing vn_fix_graphics_pipeline_create_info() long ago, I defined
some always-true dummy vars that represented some
VkGraphicsPipelineLibraryFlagsEXT. In the conditions that decide which
state to fixup, I used the dummy vars.

My intent was that this would ease the implementation of
VK_EXT_graphics_pipeline_library, because some of the GPL fixup logic
would already be present.  I was wrong. After I studied GPL more,
I discovered that the conditions were using the dummy vars incorrectly.
The incorrect usage produced no bugs, because the vars are always true.

Delete the dummy vars.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Fix subpass attachments
Lina Versace [Fri, 9 Jun 2023 23:08:04 +0000 (16:08 -0700)]
venus: Fix subpass attachments

We must check for VK_ATTACHMENT_UNUSED.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Fix crash when VkGraphicsPipelineCreateInfo::layout is missing
Lina Versace [Thu, 3 Aug 2023 20:17:07 +0000 (13:17 -0700)]
venus: Fix crash when VkGraphicsPipelineCreateInfo::layout is missing

With VK_EXT_graphics_pipeline_library, the layout may be omitted or
ignored in incomplete pipelines.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Erase pViewports and pScissors in fewer cases
Lina Versace [Fri, 4 Aug 2023 16:35:58 +0000 (09:35 -0700)]
venus: Erase pViewports and pScissors in fewer cases

We should avoid erasing VkGraphicsPipelineCreateInfo when possible
because the erasure add cpu overhead. Do not erase pViewports if
viewportCount is 0. Do not erase pScissors if scissorCount is 0.

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agovenus: Sync protocol for VK_EXT_graphics_pipeline_library
Lina Versace [Mon, 9 Oct 2023 18:47:30 +0000 (11:47 -0700)]
venus: Sync protocol for VK_EXT_graphics_pipeline_library

Signed-off-by: Lina Versace <linyaa@google.com>
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/22419>

12 months agoasahi: flush denorms on exact fmin/fmax
Karol Herbst [Wed, 18 Oct 2023 12:58:58 +0000 (14:58 +0200)]
asahi: flush denorms on exact fmin/fmax

Reviewed-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Signed-off-by: Karol Herbst <kherbst@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25788>

12 months agoac: Add rudimentary implementation of printing SDMA IBs.
Timur Kristóf [Fri, 6 Oct 2023 00:49:42 +0000 (02:49 +0200)]
ac: Add rudimentary implementation of printing SDMA IBs.

This isn't meant to be exhaustive and only prints the packets
and fields which were interesting to me during debugging the
RADV transfer queue implementation.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agoac: Print IP type for IBs.
Timur Kristóf [Mon, 16 Oct 2023 11:07:46 +0000 (13:07 +0200)]
ac: Print IP type for IBs.

This makes it clearer what is what when reading IBs
for debugging purposes.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agoac: Rename ac_do_parse_ib to parse_pkt3_ib.
Timur Kristóf [Fri, 13 Oct 2023 21:40:20 +0000 (23:40 +0200)]
ac: Rename ac_do_parse_ib to parse_pkt3_ib.

This function only parses PKT3 packets, not other types.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agoac: Add amd_ip_type argument to ac_parse_ib and ac_parse_ib_chunk.
Timur Kristóf [Fri, 6 Oct 2023 00:13:30 +0000 (02:13 +0200)]
ac: Add amd_ip_type argument to ac_parse_ib and ac_parse_ib_chunk.

The current parser only supports PKT3 packets, but not all HW IP
types use this format. This makes it possible to support more
than one format depending on the IP type.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agoac: Clarify SDMA opcode defines.
Timur Kristóf [Tue, 26 Sep 2023 09:53:00 +0000 (11:53 +0200)]
ac: Clarify SDMA opcode defines.

Make the naming of these defines consistent with others.
And add a few new opcodes and related definitions.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agoac/gpu_info: Add some SDMA related information.
Timur Kristóf [Mon, 25 Sep 2023 12:27:45 +0000 (14:27 +0200)]
ac/gpu_info: Add some SDMA related information.

SDMA only supports sparse resources on GFX9+.
SDMA only supports DCC and HTILE on GFX10+.

Signed-off-by: Timur Kristóf <timur.kristof@gmail.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25769>

12 months agofrontends/va: Implement vaMapBuffer2
David Rosca [Mon, 9 Oct 2023 15:28:06 +0000 (17:28 +0200)]
frontends/va: Implement vaMapBuffer2

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

12 months agopvr: Enable VK_KHR_uniform_buffer_standard_layout
Vlad Schiller [Thu, 7 Sep 2023 09:04:03 +0000 (10:04 +0100)]
pvr: Enable VK_KHR_uniform_buffer_standard_layout

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25708>

12 months agopvr: Enable KHR_image_format_list
Vlad Schiller [Tue, 29 Aug 2023 09:56:27 +0000 (10:56 +0100)]
pvr: Enable KHR_image_format_list

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25707>

12 months agopvr: Enable VK_EXT_scalar_block_layout
Vlad Schiller [Tue, 12 Sep 2023 09:08:44 +0000 (10:08 +0100)]
pvr: Enable VK_EXT_scalar_block_layout

Signed-off-by: Vlad Schiller <vlad-radu.schiller@imgtec.com>
Reviewed-by: Matt Coster <matt.coster@imgtec.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25706>

12 months agoradeonsi/ci: update failures and flakes
Marek Olšák [Wed, 18 Oct 2023 02:13:34 +0000 (22:13 -0400)]
radeonsi/ci: update failures and flakes

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

12 months agoradeonsi/ci: enable GLES CTS in the runner
Marek Olšák [Wed, 18 Oct 2023 01:44:31 +0000 (21:44 -0400)]
radeonsi/ci: enable GLES CTS in the runner

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

12 months agoradeonsi/ci: enable GTF tests in the runner
Marek Olšák [Wed, 18 Oct 2023 01:46:38 +0000 (21:46 -0400)]
radeonsi/ci: enable GTF tests in the runner

These are closed-source CTS tests we have always been building.

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

12 months agoradeonsi/ci: update the runner for new build scripts
Marek Olšák [Wed, 18 Oct 2023 00:55:09 +0000 (20:55 -0400)]
radeonsi/ci: update the runner for new build scripts

Needed for the new build scripts at:
  https://github.com/marekolsak/marek-build
which is needed for:
- updating deqp to main
- updating glcts to opengl-cts-4.6.3

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

12 months agozink: ignore unacquired swapchain images during end-of-frame flush
Mike Blumenkrantz [Wed, 18 Oct 2023 12:15:18 +0000 (08:15 -0400)]
zink: ignore unacquired swapchain images during end-of-frame flush

> Use of a presentable image must: occur only after the image is returned by flink:vkAcquireNextImageKHR, and before it is released by flink:vkQueuePresentKHR.
> This includes transitioning the image layout and rendering commands.

fixes #10005

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

12 months agoci: bump DEQP_FRACTION for some jobs
Samuel Pitoiset [Mon, 16 Oct 2023 07:49:49 +0000 (09:49 +0200)]
ci: bump DEQP_FRACTION for some jobs

Otherwise it can't complete in a reasonable amount of time.

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

12 months agoci: bump the number of tests per group from 500 to 5000 for Vulkan drivers
Samuel Pitoiset [Thu, 12 Oct 2023 11:27:29 +0000 (13:27 +0200)]
ci: bump the number of tests per group from 500 to 5000 for Vulkan drivers

Except for lvp which already forces 1.

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

12 months agoci: update CTS to vulkan-cts-1.3.7.0
Samuel Pitoiset [Fri, 29 Sep 2023 15:00:02 +0000 (17:00 +0200)]
ci: update CTS to vulkan-cts-1.3.7.0

This contains many new tests, especially shader object tests.

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

12 months agonvk: Advertise VK_EXT_primitive_topology_list_restart
Faith Ekstrand [Wed, 18 Oct 2023 10:56:15 +0000 (05:56 -0500)]
nvk: Advertise VK_EXT_primitive_topology_list_restart

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

12 months agonvk: Implement VK_EXT_image_sliced_view_of_3d
Faith Ekstrand [Wed, 18 Oct 2023 08:32:59 +0000 (03:32 -0500)]
nvk: Implement VK_EXT_image_sliced_view_of_3d

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

12 months agoanv: track render targets & render area changes separately
Lionel Landwerlin [Wed, 18 Oct 2023 07:54:01 +0000 (10:54 +0300)]
anv: track render targets & render area changes separately

The following instructions :
   - 3DSTATE_VIEWPORT_STATE_POINTERS_SF_CLIP
   - 3DSTATE_VIEWPORT_STATE_POINTERS_CC
   - 3DSTATE_SCISSOR_STATE_POINTERS

do not care about the content/format/count of the render targets, only
the size of the render area and count of viewport/scissor.

By tracking render targets & render area we can reduce the emission of
those instructions.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25778>

12 months agoanv: reuse local variable for gfx state
Lionel Landwerlin [Wed, 18 Oct 2023 07:49:01 +0000 (10:49 +0300)]
anv: reuse local variable for gfx state

No functional change.

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Emma Anholt <emma@anholt.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25778>

12 months agonvk: Advertise VK_KHR_workgroup_memory_explicit_layout
Faith Ekstrand [Tue, 17 Oct 2023 14:27:50 +0000 (09:27 -0500)]
nvk: Advertise VK_KHR_workgroup_memory_explicit_layout

It's all done for us in NIR.

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

12 months agoradeonsi: Fix plane size in si_copy_multi_plane_texture
David Rosca [Wed, 30 Aug 2023 12:17:21 +0000 (14:17 +0200)]
radeonsi: Fix plane size in si_copy_multi_plane_texture

Size was wrong and also need to scale sbox xy.

Fixes: 4f047c9583a ("radeonsi: Copy all planes with multi-plane staging textures")

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

12 months agoradv/rt: Use nir_shader_instructions_pass for lower_rt_instructions
Konstantin Seurer [Tue, 12 Sep 2023 18:43:34 +0000 (20:43 +0200)]
radv/rt: Use nir_shader_instructions_pass for lower_rt_instructions

Reviewed-by: Daniel Schürmann <daniel@schuermann.dev>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25187>

12 months agonvk: Enable VK_EXT_load_store_op_none
Sid Pranjale [Tue, 17 Oct 2023 20:12:38 +0000 (01:42 +0530)]
nvk: Enable VK_EXT_load_store_op_none

VK_ATTACHMENT_STORE_OP_NONE_EXT is already supported via VK_KHR_dynamic_rendering, logic dictates it shouldn't need much else for VK_ATTACHMENT_LOAD_OP_NONE_EXT.
CTS is passing with the following results on dEQP-VK.renderpass*.load_store_op_none.* tests
Test run totals:
  Passed:        78/110 (70.9%)
  Failed:        0/110 (0.0%)
  Not supported: 32/110 (29.1%)
  Warnings:      0/110 (0.0%)
  Waived:        0/110 (0.0%)

Requires !24596 to achieve parity with proprietary driver

Closes #9638

Signed-off-by: Sid Pranjale <sidpranjale127@protonmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25771>

12 months agollvmpipe: Compile a nop texture function for unsupported configurations
Konstantin Seurer [Mon, 9 Oct 2023 14:16:22 +0000 (16:16 +0200)]
llvmpipe: Compile a nop texture function for unsupported configurations

Fixes a crash in Quake II RTX. Maybe the texture sample codegen will be
more robust in the future so we do not need to work around its
limitations here.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25617>

12 months agoutil: improve BITFIELD_MASK and BITFIELD64_MASK on clang
Chia-I Wu [Mon, 16 Oct 2023 17:02:50 +0000 (10:02 -0700)]
util: improve BITFIELD_MASK and BITFIELD64_MASK on clang

gcc is able to optimize away either the modulo or the logical and.  This
makes no difference to gcc.

clang is only able to optimize away the logical and.  This allows clang
to generate faster code for BITFIELD_MASK.

As for BITFIELD64_MASK, this also makes no difference to clang except it
fixes a compile error for BITFIELD64_MASK(64):

  error: shift count >= width of type [-Werror,-Wshift-count-overflow]

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

12 months agomesa: don't pass Infs to the shader via gl_Fog.scale
Marek Olšák [Wed, 20 Sep 2023 13:57:03 +0000 (09:57 -0400)]
mesa: don't pass Infs to the shader via gl_Fog.scale

This is for GLSL versions where Infs are undefined.

It also helps piglit/glsl-fs-fogscale that breaks when we move the fragment
shader code into the vertex shader across interpolation.

Acked-by: Pierre-Eric Pelloux-Prayer <pierre-eric.pelloux-prayer@amd.com>
Acked-by: Jesse Natalie on IRC
Acked-by: Erico Nunes on Gitlab
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25391>

12 months agoglsl: Remove lower_discard().
Emma Anholt [Thu, 17 Aug 2023 18:23:35 +0000 (11:23 -0700)]
glsl: Remove lower_discard().

Replaced by the new NIR pass.

i915g results:
total instructions in shared programs: 510678 -> 510714 (<.01%)
total temps in shared programs: 30429 -> 30426 (<.01%)

rv370 results:
total instructions in shared programs: 737649 -> 737656 (<.01%)
instructions in affected programs: 82 -> 89 (8.54%)
total temps in shared programs: 112093 -> 112094 (<.01%)
temps in affected programs: 6 -> 7 (16.67%)

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

12 months agonir: Flatten ifs with discards in nir_opt_peephole_select for HW without CF.
Emma Anholt [Tue, 3 Oct 2023 17:04:04 +0000 (10:04 -0700)]
nir: Flatten ifs with discards in nir_opt_peephole_select for HW without CF.

i915g and r300-r400 don't have if statements, and discards are all
nir_intrinsic_discard_if.  We can flatten those discards here, saving a
separate GLSL pass to try to do so.

i915g:
GAINED: shaders/closed/xcom-enemy-unknown/413.shader_test FS

rv370:
GAINED: shaders/closed/xcom-enemy-unknown/12.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/122.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/132.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/145.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/146.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/19.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/413.shader_test FS
GAINED: shaders/closed/xcom-enemy-unknown/415.shader_test FS

Closes: #9918
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24763>

12 months agoi915: Make I915_DEBUG=fs log shaders that fail to link due to CF.
Emma Anholt [Thu, 17 Aug 2023 18:50:50 +0000 (11:50 -0700)]
i915: Make I915_DEBUG=fs log shaders that fail to link due to CF.

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

12 months agolavapipe: VK_EXT_nested_command_buffer
Mike Blumenkrantz [Mon, 2 Oct 2023 12:14:27 +0000 (08:14 -0400)]
lavapipe: VK_EXT_nested_command_buffer

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

12 months agozink: add automatic swapchain readback using heuristics
Mike Blumenkrantz [Mon, 16 Oct 2023 19:45:41 +0000 (15:45 -0400)]
zink: add automatic swapchain readback using heuristics

in cases where apps (stupidly) do swapbuffers->blitframebuffer, there's
no functional way to (legitimately) perform readback on the just-presented
vk image, which leads to the existing acquire+present loop dance

this adds a counter threshold which, when exceeded, begins copying the
scanout image for swapchains to provide local readback on images without
the massive perf penalty of roundtrips

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

12 months agozink: fix readback_present locking
Mike Blumenkrantz [Mon, 16 Oct 2023 17:23:24 +0000 (13:23 -0400)]
zink: fix readback_present locking

queue needs to always be locked and presentation fence should be waited on

cc: mesa-stable

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

12 months agozink: use screen destructor for creation fails
Mike Blumenkrantz [Wed, 11 Oct 2023 16:16:52 +0000 (12:16 -0400)]
zink: use screen destructor for creation fails

this should be more robust

fixes https://github.com/pal1000/mesa-dist-win/issues/155

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

12 months agozink: reorder glsl_type_singleton_init_or_ref call
Mike Blumenkrantz [Wed, 11 Oct 2023 16:16:14 +0000 (12:16 -0400)]
zink: reorder glsl_type_singleton_init_or_ref call

this enables the screen destructor to be used on failure cases

cc: mesa-stable

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

12 months agozink: don't destroy uninitialized disk cache thread
Mike Blumenkrantz [Wed, 11 Oct 2023 16:15:35 +0000 (12:15 -0400)]
zink: don't destroy uninitialized disk cache thread

cc: mesa-stable

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

12 months agozink: don't destroy any simple_mtx_t objects during screen destroy
Mike Blumenkrantz [Wed, 11 Oct 2023 16:11:45 +0000 (12:11 -0400)]
zink: don't destroy any simple_mtx_t objects during screen destroy

these don't allocate anything on init, but they assert if destroy is
called without an init, which is annoying for error handling

cc: mesa-stable

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

12 months agozink: add some checks to determine whether queue is init on screen destroy
Mike Blumenkrantz [Wed, 11 Oct 2023 16:10:56 +0000 (12:10 -0400)]
zink: add some checks to determine whether queue is init on screen destroy

cc: mesa-stable

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

12 months agoiris: Support parameter queries for main planes
Robert Mader [Sat, 7 Oct 2023 17:45:03 +0000 (19:45 +0200)]
iris: Support parameter queries for main planes

In order to return correct offsets, strides and possibly other
parameters. This is relevant for formats like NV12 and P010 where
the second plane, when produced by the Intel VAAPI decoder, uses the
same FD like the first one, but with an offset.

Right now there are only two modifiers with well defined indices
of auxiliary planes for semi-planar formats according to the local
copy of drm_fourcc.h, `I915_FORMAT_MOD_Y_TILED_GEN12_MC_CCS` and
`I915_FORMAT_MOD_4_TILED_MTL_MC_CCS`, sharing the same layout.
Assume that future `MC_CCS` modifiers will get defined accordingly
for now.

Cc: mesa-stable
Tested-by: Nanley Chery <nanley.g.chery@intel.com>
Reviewed-by: Nanley Chery <nanley.g.chery@intel.com>
Closes: https://gitlab.freedesktop.org/mesa/mesa/-/issues/9952
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25603>

12 months agoegl: error out if we can't find an EGLDevice in _eglFindDevice()
Leandro Ribeiro [Mon, 4 Sep 2023 16:34:27 +0000 (13:34 -0300)]
egl: error out if we can't find an EGLDevice in _eglFindDevice()

Follow up of "egl/drm: get compatible render-only device fd for kms-only
device". Now we can properly error out when we don't find the EGLDevice
in _eglFindDevice().

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agoegl/drm: get compatible render-only device fd for kms-only device
Leandro Ribeiro [Mon, 4 Sep 2023 16:53:12 +0000 (13:53 -0300)]
egl/drm: get compatible render-only device fd for kms-only device

Things have been working by accident for split display/render SoCs when
using the GBM platform.

The device fd given to the GBM platform may be associated with a
KMS-only device, so _eglFindDevice() should find nothing (because the
global EGLDevice list only has render-capable devices). The only thing
making it work is that we don't error out when we go through the
EGLDevice list and can't find the device we are looking for. We simply
return the last EGLDevice from the list.

This patch fixes that. Now we look for a compatible render-only device
for the KMS-only in the GBM platform.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agoloader: add loader_is_device_render_capable()
Leandro Ribeiro [Fri, 22 Sep 2023 01:01:32 +0000 (22:01 -0300)]
loader: add loader_is_device_render_capable()

Add helper function to check if a device is render-capable.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agokmsro: try to use only compatible render-capable devices
Leandro Ribeiro [Mon, 16 Oct 2023 15:42:11 +0000 (12:42 -0300)]
kmsro: try to use only compatible render-capable devices

Since commit "pipe-loader: add
pipe_loader_get_compatible_render_capable_device_fd()", we have a
function to query a render-only driver that is available and is
compatible with the KMS-only device.

So start to use it, instead of selecting whatever render-only driver is
available to use.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agodri: add queryCompatibleRenderOnlyDeviceFd() to __DRI_MESA extension
Leandro Ribeiro [Thu, 17 Aug 2023 20:01:32 +0000 (17:01 -0300)]
dri: add queryCompatibleRenderOnlyDeviceFd() to __DRI_MESA extension

With this change we are able to query the render node fd of a
render-only device compatible with a given KMS-only device (at the
egl/dri2 level).

It uses pipe_loader_get_compatible_render_capable_device_fd(), which was
added in commit "pipe-loader: add
pipe_loader_get_compatible_render_capable_device_fd()".

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agopipe-loader: add pipe_loader_get_compatible_render_capable_device_fd()
Leandro Ribeiro [Thu, 17 Aug 2023 21:20:50 +0000 (18:20 -0300)]
pipe-loader: add pipe_loader_get_compatible_render_capable_device_fd()

pipe_loader_get_compatible_render_capable_device_fd() receives the fd of
a KMS-only platform device, find a compatible render-only device that is
available and returns the fd of its DRM render node.

This function will be helpful to fix a long standing issue that is
preventing us to add support for EGL_EXT_device_drm_render_node for
split display/render SoCs. And it will also help KMSRO to select a
render-only driver that we are sure that is compatible, because
currently KMSRO uses whatever render-only driver is available.

In sort, in the EGL GBM platform case, the GBM device may be created
with a KMS-only device. The information of what render driver will be
selected by KMSRO is not available before creating the EGLDevice global
list. Without this information we don't have a render node to use in the
EGL_EXT_device_drm_render_node query. We've tried to fix this before,
but failed. See [1-2].

For the moment, this function only works for platform KMS-only devices.
For other types of KMS-only devices, we'll need to add more heuristics.

[1] Detailed explanation of the issue:
https://gitlab.freedesktop.org/mesa/mesa/-/issues/5591

[2] Previous attempt to fix:
https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12796

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agoloader: add driver list as parameter in loader_open_render_node_platform_device()
Leandro Ribeiro [Wed, 27 Sep 2023 20:35:27 +0000 (17:35 -0300)]
loader: add driver list as parameter in loader_open_render_node_platform_device()

In a later commit in this series, we'll need to open the first supported
render-only platform device that we can find.

In order to avoid calling loader_open_render_node_platform_device()
multiple times (what is quite expensive), change this function to take a
driver list (instead of a single driver name) as parameter.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agoloader: rename loader_open_render_node() to loader_open_render_node_platform_device()
Leandro Ribeiro [Thu, 21 Sep 2023 19:34:25 +0000 (16:34 -0300)]
loader: rename loader_open_render_node() to loader_open_render_node_platform_device()

This function ignore devices that are not on the platform bus. So rename
it to better reflect that.

Signed-off-by: Leandro Ribeiro <leandro.ribeiro@collabora.com>
Reviewed-by: Simon Ser <contact@emersion.fr>
Reviewed-by: Daniel Stone <daniels@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/24825>

12 months agovenus: properly expose KHR_external_fence/sempahore_fd
Yiwei Zhang [Tue, 17 Oct 2023 00:18:46 +0000 (17:18 -0700)]
venus: properly expose KHR_external_fence/sempahore_fd

Summary:
1. hide those extensions for vtest since there's no export support
2. do block waiting upon export without implicit fencing support

Fixes: 68a478870d2 ("venus: expose KHR_external_fence/sempahore_fd extensions")
Signed-off-by: Yiwei Zhang <zzyiwei@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25633>

12 months agonvk: Implement VK_EXT_depth_bias_control
Faith Ekstrand [Tue, 17 Oct 2023 13:24:50 +0000 (08:24 -0500)]
nvk: Implement VK_EXT_depth_bias_control

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

12 months agonvk: Re-sort device features
Faith Ekstrand [Tue, 17 Oct 2023 14:31:32 +0000 (09:31 -0500)]
nvk: Re-sort device features

Vulkan versions, then KHR, then EXT, then vendor.

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

12 months agonvk: Add a nvk_cmd_buffer_dirty_render_pass() helper
Faith Ekstrand [Tue, 17 Oct 2023 13:28:45 +0000 (08:28 -0500)]
nvk: Add a nvk_cmd_buffer_dirty_render_pass() helper

This makes the dirtying work properly in the case where dynamic
rendering is being used.

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

12 months agoanv: set ComputeMode.PixelAsyncComputeThreadLimit = 4
Felix DeGrood [Wed, 13 Sep 2023 20:56:59 +0000 (20:56 +0000)]
anv: set ComputeMode.PixelAsyncComputeThreadLimit = 4

Heuristic-based optimization throttling CCS work (async compute).
Without throttling, background compute work consumes all threads,
deminishing performance gains by running dispatch in parallel with
3D work.

Optimization is heuristics based, meaning a workload might slow
down when using async compute.

Best value: PixelAsyncComputeThreadLimit = 4. On DG2, this
equates to a max CCS thread occupancy of 37.5%.

Reviewed-by: Sagar Ghuge <sagar.ghuge@intel.com>
Reviewed-by: José Roberto de Souza <jose.souza@intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/25508>

12 months agonir/algebraic: use only signed_zero_preserve_* for addition by 0 patterns, etc.
Marek Olšák [Thu, 21 Sep 2023 02:28:31 +0000 (22:28 -0400)]
nir/algebraic: use only signed_zero_preserve_* for addition by 0 patterns, etc.

Some GLSL versions will set inf_preserve but not the other flags.
Additions by 0 only affect signed zeros.

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