summaryrefslogtreecommitdiffstats
path: root/src/vulkan
Commit message (Collapse)AuthorAgeFilesLines
* meson: Use consistent styleDylan Baker2018-01-111-2/+4
| | | | | | | | | | | | | | | | | | | | Currently the meosn build has a mix of two styles: arg : [foo, ... bar], and arg : [ foo, ..., bar, ] For consistency let's pick one. I've picked the later style, which I think is more readable, and is more common in the mesa code base. v2: - fix commit message Acked-by: Eric Engestrom <[email protected]> Signed-off-by: Dylan Baker <[email protected]>
* vulkan/wsi: free cmd poolsDave Airlie2017-12-281-0/+1
| | | | | | | | | | | We destroy the pools but don't free the container. This fixes: dEQP-VK.wsi.xlib.swapchain.simulate_oom* Fixes: d50937f137 (vulkan/wsi: Implement prime in a completely generic way) Reviewed-by: Bas Nieuwenhuizen <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* android: fix vulkan driver buildTapani Pälli2017-12-181-2/+3
| | | | | | | fixes undefined references by adding missing wsi common API Signed-off-by: Tapani Pälli <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* 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-047-4/+83
| | | | | Reviewed-by: Dave Airlie <[email protected]> Reviewed-by: Chad Versace <[email protected]>
* vulkan/wsi: Add a wsi_device_init functionJason Ekstrand2017-12-044-0/+41
| | | | | | | | 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]>
* vulkan: Update the XML and headers to 1.0.66Jason Ekstrand2017-11-271-15/+56
| | | | Acked-by: Dave Airlie <[email protected]>
* vulkan: Update headers and registry to 1.0.64Alex Smith2017-10-261-26/+133
| | | | | Acked-by: Dave Airlie <[email protected]> Signed-off-by: Alex Smith <[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: update headers & registry to VK 1.0.63Andres Rodriguez2017-10-211-84/+180
| | | | | Signed-off-by: Andres Rodriguez <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[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]>
* vulkan: util: add macros to extract extension/offset number from enumsLionel Landwerlin2017-10-061-0/+6
| | | | | | | | | v2: Simplify offset enum computation (Jason) v3: capitalize macros (Chad) Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* meson: Add build Intel "anv" vulkan driverDylan Baker2017-09-273-0/+140
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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]
* vulkan: enum generator: Generate entries for extended enumsJason Ekstrand2017-09-221-8/+40
| | | | Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: Stop using iterparseJason Ekstrand2017-09-221-26/+10
| | | | | | | | While using iterparse is potentially a little more efficient, the Vulkan registry XML is not large and using regular element tree simplifies the parsing logic substantially. Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: generate extension number definesLionel Landwerlin2017-09-221-4/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | New extensions can introduce additional enums. Most of the new enums will have disjoint numbers from the initial enums. For example new formats introduced by VK_IMG_format_pvrtc : VK_FORMAT_ASTC_10x8_UNORM_BLOCK = 177, VK_FORMAT_ASTC_10x8_SRGB_BLOCK = 178, VK_FORMAT_ASTC_10x10_UNORM_BLOCK = 179, VK_FORMAT_ASTC_10x10_SRGB_BLOCK = 180, VK_FORMAT_ASTC_12x10_UNORM_BLOCK = 181, VK_FORMAT_ASTC_12x10_SRGB_BLOCK = 182, VK_FORMAT_ASTC_12x12_UNORM_BLOCK = 183, VK_FORMAT_ASTC_12x12_SRGB_BLOCK = 184, VK_FORMAT_PVRTC1_2BPP_UNORM_BLOCK_IMG = 1000054000, VK_FORMAT_PVRTC1_4BPP_UNORM_BLOCK_IMG = 1000054001, VK_FORMAT_PVRTC2_2BPP_UNORM_BLOCK_IMG = 1000054002, VK_FORMAT_PVRTC2_4BPP_UNORM_BLOCK_IMG = 1000054003, VK_FORMAT_PVRTC1_2BPP_SRGB_BLOCK_IMG = 1000054004, VK_FORMAT_PVRTC1_4BPP_SRGB_BLOCK_IMG = 1000054005, VK_FORMAT_PVRTC2_2BPP_SRGB_BLOCK_IMG = 1000054006, VK_FORMAT_PVRTC2_4BPP_SRGB_BLOCK_IMG = 1000054007, It's obvious we can't have a single table for handling those anymore. Fortunately the enum values actually contain the number of the extension that introduced the new enums. So we can build an indirection table off the extension number and then index by subtracting the first enum of the the format enum value. This change makes the extension number available in the generated enum code. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: make registry more flexibleLionel Landwerlin2017-09-221-9/+9
| | | | | | | | | It will be used to store extension numbers as well. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: sort enums by namesLionel Landwerlin2017-09-221-1/+2
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* vulkan: enum generator: align function declarations/prototypesLionel Landwerlin2017-09-221-21/+21
| | | | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Reviewed-by: Dylan Baker <[email protected]>
* configure.ac: split the wayland client/server confusionEmil Velikov2017-09-191-1/+1
| | | | | | | | | | | | | | | | | | | | At the moment wayland-clients, such as the Vulkan drivers were over-linking against libwayland-server.so. That went unnoticed, since both client and server code uses the wl*interface symbols, which are present in both libwayland-client.so and libwayland-server.so. I've looked at correcting that, although that's orthogonal to this fix. Note: wayland-egl does _not_ depend on wayland-client, although it does need wayland-egl.h. There's no distinct package that provides it (I have a WIP on the topic) so current solution will do for now. v2: Rebase with the "...inline wayland_drm_buffer_get" patch removed. Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Daniel Stone <[email protected]>
* vulkan: automake: add vk_android_native_buffer.h in the source listJuan A. Suarez Romero2017-09-191-0/+1
| | | | | | | | | | | | | | | | | Fixes: CCLD libvulkan_wsi.la ar: `u' modifier ignored since `D' is the default (see `U') ../../../../src/vulkan/util/vk_enum_to_str.c:26:45: fatal error: vulkan/vk_android_native_buffer.h: No such file or directory compilation terminated. make[5]: *** [util/vk_enum_to_str.lo] Error 1 When running `make distcheck`. v2: Fix commit title (Emil) Reviewed-by: Emil Velikov <[email protected]>
* vulkan/registry: Feed vk_android_native_buffer.xml to gen_enum_to_str.pyChad Versace2017-09-183-5/+33
| | | | | | Tested on Android and Fedora. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/util: Teach gen_enum_to_str.py to parse mutliple XML filesChad Versace2017-09-181-8/+11
| | | | | | | | | | | | | To give the script multiple XML files, call it like so: gen_enum_to_str.py --xml a.xml --xml b.xml --xml c.xml ... The script parses the XML files in the given order. This will allow us to feed the script XML files for extensions that are missing from the official vk.xml, such as VK_ANDROID_native_buffer. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan/registry: Add VK_ANDROID_native_bufferChad Versace2017-09-181-0/+52
| | | | | | | | | | | | | | | The VK_ANDROID_native_buffer extension is missing from the official vk.xml. This patch defines the extension in a separate, minimal XML file: vk_android_native_buffer.xml. I chose to add the extension to a new XML file instead of adding it to the official vk.xml in order to avoid conflicts each time we sync the vk.xml from Khronos. This should be only a temporary solution until Jesse Hall is persuaded to add it to the official vk.xml. Reviewed-by: Tapani Pälli <[email protected]>
* vulkan: update headers & registry to VK 1.0.61Lionel Landwerlin2017-09-151-92/+448
| | | | | Signed-off-by: Lionel Landwerlin <[email protected]> Acked-by: Jason Ekstrand <[email protected]>