aboutsummaryrefslogtreecommitdiffstats
path: root/src/intel/vulkan/anv_wsi.c
Commit message (Collapse)AuthorAgeFilesLines
* vulkan/wsi/radv: add initial prime support (v1.1)Dave Airlie2017-02-271-1/+4
| | | | | | | | | | | | | | | | | | | 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/x11: add support to detect if we can support rendering (v3)Dave Airlie2017-02-201-1/+1
| | | | | | | | | | | | | | | | | 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]>
* anv: wsi: report presentation error per image requestLionel Landwerlin2017-02-151-8/+15
| | | | | | | | | | | | | | | | vkQueuePresentKHR() takes VkPresentInfoKHR pointer and includes a pResults fields which must holds the results of all the images requested to be presented. Currently we're not filling this field. Also as a side effect we probably want to go through all the images rather than stopping on the first error. This commit also makes the QueuePresentKHR() implementation return the first error encountered. Signed-off-by: Lionel Landwerlin <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]> Cc: "17.0" <[email protected]>
* vulkan: Add new cast macros for VkIcd typesChad Versace2017-01-121-6/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We can't import the latest vk_icd.h because the new header breaks the Mesa build. This patch defines new casting macros, ICD_DEFINE_NONDISP_HANDLE_CASTS() and ICD_FROM_HANDLE(), which can handle both the old and new vk_icd.h, and will prevent the build from breaking when we update the header. In the old vk_icd.h, types were defined as: typedef struct _VkIcdFoo { ... } VkIcdFoo; Commit 6ebba1f6 in the Vulkan loader changed the above to typedef { ... } VkIcdFoo; because the old definitions violated the C and C++ specs. According to the specs, identifiers that begins with an underscore followed by an uppercase letter are reserved. (It's pedantic, I know), See the Github issue referenced below. References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/issues/7 References: https://github.com/KhronosGroup/Vulkan-LoaderAndValidationLayers/commit/6ebba1f630015af7a78767a15c1e74ba9b23601c Reviewed-by: Emil Velikov <[email protected]> Cc: [email protected]
* anv: fix segfault in anv_BindImageMemoryDave Airlie2016-11-231-1/+1
| | | | | | | | | | | | Since bind image memory started memsetting surfaces, the device node can't be NULL, since we lookup device->info.has_llc. Not sure why it ever was NULL before. Fixes some things on my Ivybridge. Reviewed-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* anv: Handle null in all destructorsJason Ekstrand2016-11-161-0/+6
| | | | | | | | | | This fixes a bunch of new CTS tests which look for exactly this. Even in the cases where we just call vk_free to free a CPU data structure, we still handle NULL explicitly. This way we're less likely to forget to handle NULL later should we actually do something less trivial. Cc: "13.0" <[email protected]> Reviewed-by: Dave Airlie <[email protected]>
* anv: Rework fencesJason Ekstrand2016-11-091-1/+1
| | | | | | | | | | | | | | | Our previous fence implementation was very simple. Fences had two states: signaled and unsignaled. However, this didn't properly handle all of the edge-cases that we need to handle. In order to handle the case where the client calls vkGetFenceStatus on a fence that has not yet been submitted via vkQueueSubmit, we need a three-status system. In order to handle the case where the client calls vkWaitForFences on fences which have not yet been submitted, we need more complex logic and a condition variable. It's rather annoying but, so long as the client doesn't do that, we should still hit the fast path and use i915_gem_wait to do all our waiting. Signed-off-by: Jason Ekstrand <[email protected]> Cc: "13.0" <[email protected]>
* anv/wsi: Set the fence to signaled in AcquireNextImageKHRJason Ekstrand2016-11-091-3/+10
| | | | | | Signed-off-by: Jason Ekstrand <[email protected]> Reviewed-by: Chad Versace <[email protected]> Cc: "13.0" <[email protected]>
* anv/wsi: remove all anv references from WSI common codeDave Airlie2016-10-191-19/+19
| | | | | | the WSI code should be now be clean for sharing. Reviewed-by: Jason Ekstrand <[email protected]>
* anv: move common wsi code to x11/wayland common files.Dave Airlie2016-10-191-1/+2
| | | | | | | Next task is to rename all the anv_ out of this, and move to a common location Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi/wayland: add callback to get device format properties.Dave Airlie2016-10-191-1/+7
| | | | | | This avoids having to know the toplevel API name. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi/wl: stop using device in more placesDave Airlie2016-10-191-2/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: move further away from passing anv displays aroundDave Airlie2016-10-191-9/+19
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: split image alloc/free out to separate fns.Dave Airlie2016-10-191-2/+119
| | | | | | | This moves these outside the wsi platform code, so we can reuse that code Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: switch to using VkDevice in swapchainDave Airlie2016-10-191-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: drop device from get formatDave Airlie2016-10-191-1/+1
| | | | | | Just use the wsi_device instead. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: remove device from get_support interfaceDave Airlie2016-10-191-1/+3
| | | | | | replace with wsi_device and allocator. Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi/x11: push anv_device out of the init/finish routinesDave Airlie2016-10-191-3/+3
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: abstract wsi interfaces away from device a bit more.Dave Airlie2016-10-191-6/+6
| | | | | | This is a step towards separating out the wsi code for sharing Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: drop device from get capsDave Airlie2016-10-191-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: drop get present modes device argDave Airlie2016-10-191-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* radv/anv/wsi: drop unneeded parameterDave Airlie2016-10-191-1/+1
| | | | Reviewed-by: Jason Ekstrand <[email protected]>
* anv: move to using vk_alloc helpers.Dave Airlie2016-10-191-1/+1
| | | | | | | This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <[email protected]> Signed-off-by: Dave Airlie <[email protected]>
* anv: resolve wayland-only buildEmil Velikov2016-05-301-0/+2
| | | | | | | | | | | Ensure that the final X11/XCB hunk is guarded by the correct macro. Otherwise we'll require the symbol even when building without said platform. Cc: Cedric Sodhi <[email protected]> Reported-by: Cedric Sodhi <[email protected]> Signed-off-by: Emil Velikov <[email protected]> Reviewed-by: Jason Ekstrand <[email protected]>
* anv/wsi: Make WSI per-physical-device rather than per-instanceJason Ekstrand2016-05-171-12/+15
| | | | | This better maps to the Vulkan object model and also allows WSI to at least know the hardware generation which is useful for format checks.
* anv: factor out the X11/XCB buildEmil Velikov2016-05-011-0/+4
| | | | | | | | | | | Similar to earlier commit - move all the common bits into a single place, thus improving readability and allowing us to see what's missing. Also don't forget to add the missing bits. This commit should allows us to build wayland only vulkan ;-) Signed-off-by: Emil Velikov <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* anv: kill of custom define HAVE_WAYLAND_PLATFORMEmil Velikov2016-05-011-2/+2
| | | | | | | Vulkan API already has equivalent, so simplify things as just use it. Signed-off-by: Emil Velikov <[email protected]> Acked-by: Jason Ekstrand <[email protected]>
* anv/wsi: Throttle rendering to no more than 2 frames aheadJason Ekstrand2016-03-111-0/+38
| | | | | | | | Right now, Vulkan apps can pretty easily DOS the GPU by simply submitting a lot of batches. This commit makes us wait until the rendering for earlier frames is comlete before continuing. By waiting 2 frames out, we can still keep the pipe reasonably full but without taking the entire system down. This is similar to what the GL driver does today.
* Move the intel vulkan driver to src/intel/vulkanJason Ekstrand2016-02-181-0/+196