summaryrefslogtreecommitdiffstats
path: root/src/vulkan/wsi
Commit message (Collapse)AuthorAgeFilesLines
* vulkan/wsi: Initialize individual WSI interfaces in wsi_device_initJason Ekstrand2017-12-043-14/+52
| | | | | | | | Now that we have anv_device_init/finish functions, there's no reason to have the individual driver do any more work than that. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Drop some unneeded cruft from the APIJason Ekstrand2017-12-043-21/+8
| | | | | | | | This drops the unneeded callbacks struct as well as the queue_get_family callback we were using before we'd pulled QueuePresent inside. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add wrappers for all of the surface queriesJason Ekstrand2017-12-043-35/+148
| | | | | | | This lets us move wsi_interface to wsi_common_private.h Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Drop the can_handle_different_gpu parameter from get_supportJason Ekstrand2017-12-043-7/+0
| | | | | | | Both anv and radv can handle prime now. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Move wsi_swapchain to wsi_common_private.hJason Ekstrand2017-12-042-45/+47
| | | | | | | The drivers no longer poke at this directly. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a helper for AcquireNextImageJason Ekstrand2017-12-042-0/+22
| | | | | | | | | Unfortunately, due to the fact that AcquireNextImage does not take a queue, the ANV trick for triggering the fence won't work in general. We leave dealing with the fence up to the caller for now. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: move swapchain create/destroy to common codeDave Airlie2017-12-042-0/+50
| | | | | | | | | | v2 (Jason Ekstrand): - Rebase - Alter the names of the helpers to better match the vulkan entrypoints - Use the helpers in anv Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Move prime blitting into queue_presentJason Ekstrand2017-12-045-62/+19
| | | | | | | | This lets us save a QueueSubmit and it also makes prime a lot less X11-specific. Also, it means we can only wait on the semaphores once instead of on every blit. Reviewed-by: Dave Airlie <[email protected]>
* vulkan/wsi: Move get_images into common codeJason Ekstrand2017-12-044-49/+34
| | | | | | | | | This moves bits out of all four corners (anv, radv, x11, wayland) and into the wsi common code. We also switch to using an outarray to ensure we get our return code right. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Set a proper pWaitDstStageMask on the dummy submitJason Ekstrand2017-12-041-0/+17
| | | | | | | | Neither mesa driver really cares, but we should set it none the less for the sake of correctness. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Only wait on semaphores on the first swapchainJason Ekstrand2017-12-041-2/+7
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Refactor result handling in queue_presentJason Ekstrand2017-12-041-26/+28
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* radv/wsi: Move the guts of QueuePresent to wsi commonDave Airlie2017-12-042-0/+88
| | | | | | | | | | | | v2 (Jason Ekstrand): - Better comit message - Rebase - Re-indent to follow wsi_common style - Drop the unneeded _swapchain from the newly added helper - Make the clone more true to the original (as per the rebase) Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a WSI_FROM_HANDLE macroJason Ekstrand2017-12-041-0/+3
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Do image creation in common codeJason Ekstrand2017-12-045-59/+144
| | | | | | | | | | | This uses the mock extension created in a previous commit to tell the driver that the image it's just been asked to create is, in fact, a window system image with whatever assumptions that implies. There was a lot of redundant code between the two drivers to do basically exactly the same thing. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Implement prime in a completely generic wayJason Ekstrand2017-12-045-61/+443
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a mock image creation extensionJason Ekstrand2017-12-041-0/+18
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add wsi_swapchain_init/finish functionsJason Ekstrand2017-12-046-4/+82
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a wsi_device_init functionJason Ekstrand2017-12-043-0/+40
| | | | | | | | This gives the opportunity to collect some function pointers if we'd like which will be very useful in future. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi/x11: Handle the geometry check earlier in create_swapchainJason Ekstrand2017-12-041-9/+10
| | | | | | | | | This fixes a potential leak if allocating the swapchain fails. Since geometry checking and bit-depth fetching is self-contained, it makes sense to just do it first so we can delete the geometry reply. Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a wsi_image structureDaniel Stone2017-12-043-61/+41
| | | | | | | | | | | | | This is used to hold information about the allocated image, rather than an ever-growing function argument list. v2 (Jason Ekstrand): - Rename wsi_image_base to wsi_image Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: use function ptr definitions from the spec.Dave Airlie2017-12-042-4/+4
| | | | | | | This just seems cleaner, and we may expand this in future. Signed-off-by: Dave Airlie <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* meson: move wayland_drm_protocol generation to wayland-drmDylan Baker2017-10-201-14/+0
| | | | | | | | | | | These files are needed by both vulkan wayland-wsi and by egl wayland-wsi, since the XML file is in src/egl/wayland/wayland-drm and we can include this directory in such a way that it will be loaded before egl and vulkan this allows us to avoid multiple calls to the same generator. Signed-off-by: Dylan Baker <[email protected]> Reviewed-and-Tested-by: Eric Engestrom <[email protected]>
* vulkan/wsi: Free the event in x11_manage_fifo_queues().Henri Verbeet2017-10-171-0/+1
| | | | | | | | Cc: [email protected] Signed-off-by: Henri Verbeet <[email protected]> Fixes: e73d136a023 ("vulkan/wsi/x11: Implement FIFO mode.") Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]
* meson: split and simplify dependenciesDylan Baker2017-10-161-1/+9
| | | | | | | | | | | | | Rather than group dependencies in complex groups, use a flatter structure with split dependencies to avoid checking for the same dependencies twice. v2: - Fix building vulkan drivers without gallium or dri drivers v3: - Drop TODO comment that is done - Fix typo in commit message Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]>
* meson: Add build Intel "anv" vulkan driverDylan Baker2017-09-271-0/+71
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This allows building and installing the Intel "anv" Vulkan driver using meson and ninja, the driver has been tested against the CTS and has seems to pass the same series of tests (they both segfault when the CTS tries to run wayland wsi tests). There are still a mess of TODO, XXX, and FIXME comments in here. Those are mostly for meson bugs I'm trying to fix, or for additional things to implement for other drivers/features. I have configured all intermediate libraries and optional tools to not build by default, meaning they will only be built if they're pulled in as a dependency of a target that will actually be installed) this allows us to avoid massive if chains, while ensuring that only the bits that need to be built are. v2: - enable anv, x11, and wayland by default - add configure option to disable valgrind v3: - fix typo in meson_options (Nicholas) v4: - Remove dead code (Eric) - Remove change to generator that was from v0 (Eric) - replace if chain with loop (Eric) - Fix typos (Eric) - define HAVE_DLOPEN for both libdl and builtin dl cases (Eric) v5: - rebase on util string buffer implementation Signed-off-by: Dylan Baker <[email protected]> Reviewed-by: Eric Anholt <[email protected]> (v4)
* vulkan/wsi/wayland: Return better error messagesJason Ekstrand2017-09-271-21/+36
| | | | | Reviewed-by: Daniel Stone <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Copy wl_proxy objects from oldSwapchain if availableJason Ekstrand2017-09-271-6/+33
| | | | | | | This should save us some round trips while resizing. Reviewed-by: Daniel Stone <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Stop caching Wayland displaysJason Ekstrand2017-09-271-107/+54
| | | | | | | | | | | | | | | | | | | We originally implemented caching to avoid unneeded round-trips to the compositor when querying surface capabilities etc. to set up the swapchain. Unfortunately, this doesn't work if vkDestroyInstance is called after the Wayland connection has been dropped. In this case, we end up trying to clean up already destroyed wl_proxy objects which leads to crashes. In particular most of dEQP-VK.wsi.wayland is crashing thanks to this problem. This commit gets rid of the cache and simply embeds the wsi_wl_display struct in the swapchain. While we're at it, we can get rid of the wl_event_queue that we were storing in the swapchain because we can just use the one in the embedded wsi_wl_display. Reviewed-by: Daniel Stone <[email protected]> Bugzilla: https://bugs.freedesktop.org/102578 Cc: [email protected]
* vulkan/wsi/wayland: Refactor wsi_wl_display codeJason Ekstrand2017-09-271-14/+33
| | | | | | | | We convert it over to an inti/finish model and make create/destroy wrappers for the former. Reviewed-by: Daniel Stone <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Stop printing out the DRM deviceJason Ekstrand2017-09-261-1/+0
| | | | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]> Cc: [email protected]
* util/vulkan: Move Vulkan utilities to src/vulkan/utilAlex Smith2017-06-063-3/+3
| | | | | | | | | | | | | We have Vulkan utilities in both src/util and src/vulkan/util. The latter seems a more appropriate place for Vulkan-specific things, so move them there. v2: Android build system changes (from Tapani Pälli) Signed-off-by: Alex Smith <[email protected]> Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Eric Engestrom <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* vulkan/wsi/wayland: Fix proxy wrappers for swapchain recreationPhilipp Zabel2017-05-201-3/+10
| | | | | | | | | | | | | | Before the swapchain event queue is destroyed, all proxy objects that reference it must be dropped. Otherwise we risk a use-after-free if a frame callback event or buffer release events are received afterwards. This happens when an application destroys and recreates a swapchain in FIFO mode between two frames without using the VkSwapchainCreateInfoKHR::oldSwapchain mechanism to keep the old swapchain until after the next redraw. Fixes: 5034c615582a ("vulkan/wsi/wayland: Use proxy wrappers for swapchain") Signed-off-by: Philipp Zabel <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Use proxy wrappers for swapchainDaniel Stone2017-05-191-16/+36
| | | | | | | | | | | | | | Though most swapchain operations used a queue, they were racy in that the object was created with the queue only set later, meaning that its event could potentially be dispatched from the default queue in between these two steps. Use proxy wrappers to avoid this race, also assigning wl_buffers created for the swapchain to the event queue. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Use per-display event queueDaniel Stone2017-05-191-12/+32
| | | | | | | | | | Calling random callbacks on the display's event queue is hostile, as we may call into client code when it least expects it. Create our own event queue, one per wsi_wl_display, and use that for the registry. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Remove roundtrip when creating imageDaniel Stone2017-05-191-1/+0
| | | | | | | | | | | | | There's no need to call wl_display_roundtrip() after trying to create a buffer through wl_drm; if it succeeds then everything is fine, and if it fails, then we get a fatal protocol error so can't recover anyway. Additionally, doing a roundtrip on the default / main application queue, is destructive anyway, so would need to be its own queue. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected]
* vulkan: Fix Wayland uninitialised registryDaniel Stone2017-05-191-4/+5
| | | | | | | | | Untangle the exit cleanup paths so we don't try to use the registry variable before it's been initialised. Signed-off-by: Daniel Stone <[email protected]> Reviewed-by: Lionel Landwerlin <[email protected]> Cc: [email protected]
* vulkan/wsi/wayland: Add support for VK_KHR_get_surface_capabilities2Jason Ekstrand2017-05-161-0/+38
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/wsi/x11: Add support for VK_KHR_get_surface_capabilities2Jason Ekstrand2017-05-161-0/+32
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/wsi: Add get_capabilities2 and get_formats2d interface pointersJason Ekstrand2017-05-161-0/+8
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/wsi: Use vk_outarray for surface_get_formatsJason Ekstrand2017-05-162-30/+21
| | | | Reviewed-by: Samuel Iglesias Gonsálvez <[email protected]>
* vulkan/wsi/wayland: Pass damage through to the compositorJason Ekstrand2017-04-031-1/+15
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: Plumb present regions through the common codeJason Ekstrand2017-04-033-3/+6
| | | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Daniel Stone <[email protected]> Acked-by: Dave Airlie <[email protected]>
* vulkan/wsi: Fix some line wrappingJason Ekstrand2017-04-031-1/+4
| | | | | Reviewed-by: Lionel Landwerlin <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan/wsi: Generate wayland protocol headers separately from EGLJason Ekstrand2017-03-132-1/+3
| | | | | | | | | | | | | | | | Previously, we were depending on EGL for generating the headers and providing the protocol symbols. However, since neither Vulkan driver actually wants to link against EGL, this is kind of pointless. It also creates a weird build dependency. v2 [Jason] - Add missing wsi/ prefix, MKDIR_GEN v3 [Emil Velikov] - include BUILT_SOURCES/generation rules outside of conditional Reviewed-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* vulkan/wsi: Improve the DRI3 error messageJacob Lifshay2017-03-011-10/+41
| | | | | | | | | | | | | | | | | This commit improves the message by telling them that they could probably enable DRI3. More importantly, it includes a little heuristic to check to see if we're running on AMD or NVIDIA's proprietary X11 drivers and, if we are, doesn't emit the warning. This way, users with both a discrete card and Intel graphics don't get the warning when they're just running on the discrete card. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=99715 Co-authored-by: Jason Ekstrand <[email protected]> Reviewed-by: Kai Wasserbäch <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Tested-by: Rene Lindsay <[email protected]> Acked-by: Dave Airlie <[email protected]> Cc: "17.0" <[email protected]>
* vulkan/wsi/radv: add initial prime support (v1.1)Dave Airlie2017-02-274-5/+69
| | | | | | | | | | | | | | | | | | | This is a complete rewrite of my previous rfc patches. This adds the ability to present to a different GPU that rendering using a driver side operation that can copy from the tiled to linear shared image. This does prime support completely in the swapchain present code, and each queue has a precreated command buffer for each image and for the each queue family. This means presenting should work on graphics and compute queues and transfer in the future. v1.1: initialise needs_linear_copy in swapchain. Reviewed-by: Bas Nieuwenhuizen <[email protected]> Tested-by: Mike Lothian <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* vulkan/wsi: move image count to shared structure.Dave Airlie2017-02-233-26/+24
| | | | | | | | | For prime support I need to access this, so move it in advance. [airlied: fix int->uint32_t] Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* vulkan: Combine wsi and util makefilesDylan Baker2017-02-222-62/+0
| | | | Reviewed-by: Matt Turner <[email protected]>
* vulkan/wsi/x11: add support to detect if we can support rendering (v3)Dave Airlie2017-02-205-1/+74
| | | | | | | | | | | | | | | | | This adds support to radv_GetPhysicalDeviceXlibPresentationSupportKHR and radv_GetPhysicalDeviceXcbPresentationSupportKHR to check if the local device file descriptor is compatible with the descriptor retrieved from the X server via DRI3. This will stop radv binding to an X server until we have prime support in place. Hopefully apps use this API before trying to render things. v2: drop unneeded function, don't leak memory. (jekstrand) v3: also check in surface_get_support callback. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>