vulkan/wsi/radv: add initial prime support (v1.1)

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>
This commit is contained in:
Dave Airlie
2016-11-23 12:59:55 +10:00
parent 336b05c49a
commit f695735ed6
10 changed files with 225 additions and 21 deletions

View File

@@ -94,7 +94,7 @@ VkResult anv_GetPhysicalDeviceSurfaceSupportKHR(
return iface->get_support(surface, &device->wsi_device,
&device->instance->alloc,
queueFamilyIndex, device->local_fd, pSupported);
queueFamilyIndex, device->local_fd, false, pSupported);
}
VkResult anv_GetPhysicalDeviceSurfaceCapabilitiesKHR(
@@ -142,6 +142,8 @@ static VkResult
x11_anv_wsi_image_create(VkDevice device_h,
const VkSwapchainCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks* pAllocator,
bool different_gpu,
bool linear,
VkImage *image_p,
VkDeviceMemory *memory_p,
uint32_t *size,
@@ -272,6 +274,7 @@ VkResult anv_CreateSwapchainKHR(
alloc = &device->alloc;
VkResult result = iface->create_swapchain(surface, _device,
&device->instance->physicalDevice.wsi_device,
device->instance->physicalDevice.local_fd,
pCreateInfo,
alloc, &anv_wsi_image_fns,
&swapchain);