summaryrefslogtreecommitdiff
path: root/src/intel/vulkan/anv_wsi_x11.c
AgeCommit message (Collapse)AuthorFilesLines
2018-10-26vulkan: drop always-true paramEric Engestrom1-2/+0
Signed-off-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-10-24anv: Allow presenting via a different GPUAlex Smith1-2/+2
anv_GetPhysicalDeviceSurfaceSupportKHR will already return success for this, but anv_GetPhysicalDevice{Xcb,Xlib}PresentationSupportKHR do not. Apps which check for presentation support via the latter (all Feral Vulkan games at least) will therefore fail. This allows me to render on an Intel GPU and present to a display connected to an AMD card (tested HD 530 + Vega 64). v2: Rebase on current master. Signed-off-by: Alex Smith <asmith@feralinteractive.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2018-10-18vulkan/wsi: Use VK_EXT_pci_bus_info for DRM fd matchingJason Ekstrand1-2/+2
This lets us avoid passing the DRM fd around all over the place and gets us closer to layer utopia. Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Eric Engestrom <eric.engestrom@intel.com>
2018-10-18vulkan/wsi: Store the instance allocator in wsi_deviceJason Ekstrand1-2/+0
We already have wsi_device and we know the instance allocator at wsi_device_init time so there's no need to pass it into the physical device queries. This also fixes a memory allocation domain bug that can occur if CreateSwapchain gets called prior to any queries (not likely) in which case the cached connection gets allocated off the device instead of the instance. Reviewed-by: Eric Engestrom <eric.engestrom@intel.com> Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
2017-02-27vulkan/wsi/radv: add initial prime support (v1.1)Dave Airlie1-2/+2
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 <bas@basnieuwenhuizen.nl> Tested-by: Mike Lothian <mike@fireburn.co.uk> Signed-off-by: Dave Airlie <airlied@redhat.com>
2017-02-20vulkan/wsi/x11: add support to detect if we can support rendering (v3)Dave Airlie1-2/+6
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 <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-19anv/wsi: remove all anv references from WSI common codeDave Airlie1-8/+5
the WSI code should be now be clean for sharing. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv: move common wsi code to x11/wayland common files.Dave Airlie1-842/+2
Next task is to rename all the anv_ out of this, and move to a common location Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: split out surface creation to avoid instance APIDave Airlie1-18/+41
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: move further away from passing anv displays aroundDave Airlie1-15/+7
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: split image alloc/free out to separate fns.Dave Airlie1-122/+17
This moves these outside the wsi platform code, so we can reuse that code Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: switch to using VkDevice in swapchainDave Airlie1-5/+4
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi/x11: more refactoring to use generic handlesDave Airlie1-27/+43
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi/x11: start refactoring out the image allocation/free functionalityDave Airlie1-22/+52
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: drop device from get formatDave Airlie1-1/+1
Just use the wsi_device instead. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: remove device from get_support interfaceDave Airlie1-2/+3
replace with wsi_device and allocator. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi/x11: abstract WSI interface from internals.Dave Airlie1-9/+24
This allows the API and the internals to be split, and the internals shared. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi/x11: push anv_device out of the init/finish routinesDave Airlie1-10/+12
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: abstract wsi interfaces away from device a bit more.Dave Airlie1-9/+9
This is a step towards separating out the wsi code for sharing Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi/x11: push device out of x11 connection fns.Dave Airlie1-11/+12
just pass the allocator/wsi_interface instead. Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: drop device from get capsDave Airlie1-1/+0
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv/wsi: drop get present modes device argDave Airlie1-1/+0
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19radv/anv/wsi: drop unneeded parameterDave Airlie1-1/+0
Reviewed-by: Jason Ekstrand <jason@jlekstrand.net>
2016-10-19anv: move to using vk_alloc helpers.Dave Airlie1-11/+11
This moves all the alloc/free in anv to the generic helpers. Acked-by: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-14anv/wsi: fix apps that acquire multiple images up frontDave Airlie1-0/+1
This fix was found in the radv codebase when running dota2, no idea if anyone has reported it on anv, but the same problem occurs. Once an image is acquired we need to mark it busy. Acked-by: Edward O'Callaghan <funfunctor@folklore1984.net> Cc: "12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-14anv: initialise and increment send_sbcDave Airlie1-0/+2
At least set this to not be uninitialised memory. Cc: "12.0" <mesa-stable@lists.freedesktop.org> Signed-off-by: Dave Airlie <airlied@redhat.com>
2016-10-06anv/wsi: Advertise UNORM formats as well as sRGBJason Ekstrand1-0/+1
Because WSI images are created with VkImageCreateInfo::flags explicitly set to 0, they don't ever have the VK_IMAGE_CREATE_MUTABLE_FORMAT_BIT set. This means that you can't create an image view of it with a different format so applications can't render directly in sRGB (without automatic encoding) unless we actually advertise UNORM formats. There are a lot of applications that want to do their own sRGB conversion, so we should allow for that. We do, however, make UNORM come after sRGB in the list so that the default for dumb apps that just grab the first thing is to render in linear and let the sRGB conversion happen automatically. Signed-off-by: Jason Ekstrand <jason@jlekstrand.net>
2016-08-15anv/x11: Add support for Xlib platformKevin Strasser1-12/+70
Some applications continue to use the Xlib client library and expect that VK_KHR_xlib_surface will be available in the driver. Service these applications by converting the Display pointer to xcb_connection_t and use the existing xcb code in the driver. Signed-off-by: Kevin Strasser <kevin.strasser@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-07-04anv/wsi: create swapchain images using specified image usageLionel Landwerlin1-1/+2
The image usage specified by the caller of vkCreateSwapchainKHR should be passed onto the internal image creation. Otherwise the driver might later crash when the user tries to use the image as a combined sampler even though the creation was explicitly created with VK_IMAGE_USAGE_TRANSFER_SRC_BIT. Leaving the previous VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT as this might be expected even if the swapchain is created without any flag. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Jason Ekstrand <jason@jlekstrand.net> Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96791 Cc: "12.0" <mesa-stable@lists.freedesktop.org>
2016-05-17anv/wsi: Use vk_format_info for asserts rather than anv_formatJason Ekstrand1-1/+2
2016-05-17anv/wsi: Make WSI per-physical-device rather than per-instanceJason Ekstrand1-19/+21
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.
2016-03-11anv/x11: Reset the SHM fence before presenting the pixmapJason Ekstrand1-0/+2
This seems to fix the flicker issue that I was seeing with dota2
2016-03-11anv/x11: Add present supportKristian Høgsberg Kristensen1-42/+146
The old DRI3 implementation just used CopyArea instead of present. We still don't support all the MST fancyness, but it should at least avoid some copies and allow for. v2 (Jason Ekstrand): - Better object cleanup and destruction - Handle the CONFIGURE_NOTIFY event and return OUT_OF_DATE when needed - Track dirtyness via IDLE_NOTIFY rather than interating through the images sequentially
2016-03-11anv/x11: Split image creation into a helper functionJason Ekstrand1-108/+142
This lets us clean up error handling and make it correct.
2016-02-22anv/x11: Free swapchain images and memory on destroyKristian Høgsberg Kristensen1-1/+5
2016-02-18Move the intel vulkan driver to src/intel/vulkanJason Ekstrand1-0/+758