Commit Graph

17 Commits

Author SHA1 Message Date
Jason Ekstrand 124848bf9e vulkan/wsi: Support tiled CPU images
Some drivers such as lavapipe are 100% fine with using linear for WSI
images.  Most HW drivers, however, would rather render tiled and eat a
blit.

Reviewed-by: Jesse Natalie <jenatali@microsoft.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/17388>
2022-07-07 11:44:19 -05:00
Jason Ekstrand 384c31425a lavapipe: Use the common AcquireNextImage implementation
The only reason for the wrapper was so that we could dummy signal the
semaphore and fence.  Now that the WSI code always dos this for us, we
can drop our wrapper.

Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4037>
2022-06-10 01:33:12 +00:00
Jason Ekstrand dbfb0b4989 lavapipe: Go back to manually signaling in lvp_AcquireNextImage2()
When porting lavapipe to the common sync framework, I stole the dummy
sync signal_for_memory idea from RADV but didn't actually do it
correctly.  Unless you set wsi_device::signal_semaphore_with_memory and
wsi_device::signal_fence_with_memory, it doesn't actually signal
anything.  If you do set those, it works but also results in dummy
syncs being created for present fences which we see as signals.  We
could choose to just skip those like RADV does but that's too magic.
Instead, have our own AcquireNextImage2() again which sets dummy syncs.

Fixes: 3b547a9b58 ("lavapipe: Switch to the common sync framework")
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15774>
2022-04-06 18:30:51 +00:00
Jason Ekstrand 3b547a9b58 lavapipe: Switch to the common sync framework
The common Vulkan sync framework will do most of the queueing for us.
It will even sort out timeline semaphore dependencies and ensure
everything executes in-order.  All we have to do is make sure our
vk_sync type implements VK_SYNC_FEATURE_WAIT_PENDING.  This lets us get
rid of a big pile of code.

Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/15651>
2022-04-06 00:38:22 +00:00
Dave Airlie 604ed15e56 lavapipe: handle non-timeline semaphores wait/signal.
When llvmpipe is allowed execute fragment shaders overlapping
with other stuff, we have to start using the pipe fences.

With presentation, the acquire path needs to signal a semaphore
that can be waited on by the user, so add support for passing
signal/wait semaphores for non-timeline in, and just put a
fence pointer in the semaphore for that case.

This fixes rendering once we allow overlapping rasterization.

Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14923>
2022-02-21 03:52:02 +00:00
Jason Ekstrand 006633c043 lavapipe: Use vk_instance_get_proc_addr_unchecked for WSI
It exists precisely to handle this case without the driver looking up
trampolines itself.  This is nearly identical to what ANV does.

Reviewed-by: Dylan Baker <dylan@pnwbakers.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13156>
2021-10-29 23:12:32 +00:00
Jason Ekstrand 8c4d78c764 lavapipe: Use the common WSI wrappers
Reviewed-by: Emma Anholt <emma@anholt.net>
Reviewed-By: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13234>
2021-10-13 00:06:15 +00:00
Dave Airlie f389f963ee lavapipe: fix fence handling around wsi submission
My previous fix was incorrect, properly fix things so that
fences in acquire get a proper timeline set.

Fixes: 028591954a ("lvp/fence: quick fix to previous commit.")
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13218>
2021-10-06 20:52:09 +00:00
Mike Blumenkrantz 032d4a0e7d lavapipe: rework queue to use u_queue
this simplifies the entire queue mechanism and makes it more consistent:
previously some cases (e.g., null cmdbuf submission) would immediately
be marked as finished, which meant that fences could theoretically become
desynchronized, breaking application assumptions

Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/12071>
2021-07-29 00:06:10 +00:00
Georg Lehmann adbd63e24d lavapipe: Add a missing VKAPI_ATTR.
Signed-off-by: Georg Lehmann's avatarGeorg Lehmann <dadschoorse@gmail.com>
Reviewed-by: Mike Blumenkrantz <michael.blumenkrantz@gmail.com>
Reviewed-by: Dave Airlie <airlied@redhat.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11114>
2021-07-01 17:09:02 +00:00
Michel Zou 2ef3dca476 vulkan/lavapipe: add missing VKAPI_ATTR/CALL
Acked-by: Jose Fonseca <jfonsec@vmware.com>
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8823>
2021-02-09 19:21:03 +00:00
Dave Airlie ed9e75950b lavapipe: use common dispatch layer.
This moves lavapipe over to using the new common dispatch layer code.

v2 (Jason Ekstrand):
 - Less pointless messing around with python and meson

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
2021-02-01 18:54:24 +00:00
Dave Airlie ce98c8f7af lavapipe: add missing wsi entrypoint.
Add support for GetPhysicalDeviceSurfaceFormats2KHR which is helpful
to make the new dispatch code work.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
2021-02-01 18:54:24 +00:00
Dave Airlie fd3c665df0 lavapipe: move to subclassing instance/physical device.
This doesn't use any of the features yet, just moves to subclassing.

Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/8676>
2021-02-01 18:54:24 +00:00
Dave Airlie f246456538 lavapipe: fix wsi acquire fences
Fixes:
dEQP-VK.wsi.xcb.swapchain.acquire.too_many

Cc: "20.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7705>
2020-11-24 06:50:24 +10:00
Dave Airlie 0d90c7cbc4 lavapipe: fixup device allocate + enable private data
I'd only half ported private memory support, finish the job.

Cc: "20.3" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Roland Scheidegger <sroland@vmware.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/7705>
2020-11-24 06:50:21 +10:00
Dave Airlie e94fd4cc65 lavapipe: rename vallium to lavapipe
Just a cooler name, and a lot easier to search for. thanks Marek

Acked-by: Marek Olšák <marek.olsak@amd.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/6921>
2020-10-01 00:23:40 +00:00
Renamed from src/gallium/frontends/vallium/val_wsi.c (Browse further)