[Mesa-dev] [PATCH 11/14] vulkan/wsi: Rename needs_linear_copy to different_gpu
Daniel Stone
daniels at collabora.com
Fri Jul 21 13:42:14 UTC 2017
That's what it actually means; the fact it generally means a linear copy
is requires is incidental.
Signed-off-by: Daniel Stone <daniels at collabora.com>
---
src/amd/vulkan/radv_wsi.c | 10 +++++-----
src/intel/vulkan/anv_wsi.c | 2 +-
src/vulkan/wsi/wsi_common.h | 4 ++--
src/vulkan/wsi/wsi_common_wayland.c | 2 +-
src/vulkan/wsi/wsi_common_x11.c | 6 +++---
5 files changed, 12 insertions(+), 12 deletions(-)
diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index a406056fff..a131265d3a 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -228,7 +228,7 @@ static VkResult
radv_wsi_image_create(VkDevice device_h,
const VkSwapchainCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks* pAllocator,
- bool linear,
+ bool different_gpu,
struct wsi_image_base *wsi_image)
{
VkResult result = VK_SUCCESS;
@@ -241,7 +241,7 @@ radv_wsi_image_create(VkDevice device_h,
if (result != VK_SUCCESS)
return result;
- if (linear) {
+ if (different_gpu) {
result = radv_wsi_image_alloc(device_h, pCreateInfo, pAllocator,
false, &wsi_image->linear_image,
&wsi_image->linear_memory);
@@ -399,7 +399,7 @@ VkResult radv_CreateSwapchainKHR(
for (unsigned i = 0; i < ARRAY_SIZE(swapchain->fences); i++)
swapchain->fences[i] = VK_NULL_HANDLE;
- if (swapchain->needs_linear_copy) {
+ if (swapchain->different_gpu) {
result = radv_wsi_create_prime_command_buffers(device, alloc,
swapchain);
if (result != VK_SUCCESS)
@@ -433,7 +433,7 @@ void radv_DestroySwapchainKHR(
radv_DestroyFence(_device, swapchain->fences[i], pAllocator);
}
- if (swapchain->needs_linear_copy)
+ if (swapchain->different_gpu)
radv_wsi_free_prime_command_buffers(device, swapchain);
swapchain->destroy(swapchain, alloc);
@@ -506,7 +506,7 @@ VkResult radv_QueuePresentKHR(
1, &swapchain->fences[0]);
}
- if (swapchain->needs_linear_copy) {
+ if (swapchain->different_gpu) {
int idx = (queue->queue_family_index * swapchain->image_count) + pPresentInfo->pImageIndices[i];
cs = radv_cmd_buffer_from_handle(swapchain->cmd_buffers[idx])->cs;
} else
diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index c772438219..81818b4590 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -172,7 +172,7 @@ static VkResult
anv_wsi_image_create(VkDevice device_h,
const VkSwapchainCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks* pAllocator,
- bool linear,
+ bool different_gpu,
struct wsi_image_base *wsi_image)
{
struct anv_device *device = anv_device_from_handle(device_h);
diff --git a/src/vulkan/wsi/wsi_common.h b/src/vulkan/wsi/wsi_common.h
index ee0fb8357a..006ba4ed3b 100644
--- a/src/vulkan/wsi/wsi_common.h
+++ b/src/vulkan/wsi/wsi_common.h
@@ -49,7 +49,7 @@ struct wsi_image_fns {
VkResult (*create_wsi_image)(VkDevice device_h,
const VkSwapchainCreateInfoKHR *pCreateInfo,
const VkAllocationCallbacks *pAllocator,
- bool linear,
+ bool different_gpu,
struct wsi_image_base *image_p);
void (*free_wsi_image)(VkDevice device,
const VkAllocationCallbacks *pAllocator,
@@ -66,7 +66,7 @@ struct wsi_swapchain {
VkCommandPool cmd_pools[3];
VkPresentModeKHR present_mode;
uint32_t image_count;
- bool needs_linear_copy;
+ bool different_gpu;
VkResult (*destroy)(struct wsi_swapchain *swapchain,
const VkAllocationCallbacks *pAllocator);
diff --git a/src/vulkan/wsi/wsi_common_wayland.c b/src/vulkan/wsi/wsi_common_wayland.c
index 22d7785a7a..462fc2a5a9 100644
--- a/src/vulkan/wsi/wsi_common_wayland.c
+++ b/src/vulkan/wsi/wsi_common_wayland.c
@@ -801,7 +801,7 @@ wsi_wl_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
chain->base.image_fns = image_fns;
chain->base.present_mode = pCreateInfo->presentMode;
chain->base.image_count = num_images;
- chain->base.needs_linear_copy = false;
+ chain->base.different_gpu = false;
chain->extent = pCreateInfo->imageExtent;
chain->vk_format = pCreateInfo->imageFormat;
chain->drm_format = wl_drm_format_for_vk_format(chain->vk_format, alpha);
diff --git a/src/vulkan/wsi/wsi_common_x11.c b/src/vulkan/wsi/wsi_common_x11.c
index 456a649bb6..07823171cc 100644
--- a/src/vulkan/wsi/wsi_common_x11.c
+++ b/src/vulkan/wsi/wsi_common_x11.c
@@ -961,7 +961,7 @@ x11_image_init(VkDevice device_h, struct x11_swapchain *chain,
result = chain->base.image_fns->create_wsi_image(device_h,
pCreateInfo,
pAllocator,
- chain->base.needs_linear_copy,
+ chain->base.different_gpu,
&image->base);
if (result != VK_SUCCESS)
return result;
@@ -1116,9 +1116,9 @@ x11_surface_create_swapchain(VkIcdSurfaceBase *icd_surface,
free(geometry);
- chain->base.needs_linear_copy = false;
+ chain->base.different_gpu = false;
if (!wsi_x11_check_dri3_compatible(conn, local_fd))
- chain->base.needs_linear_copy = true;
+ chain->base.different_gpu = true;
chain->event_id = xcb_generate_id(chain->conn);
xcb_present_select_input(chain->conn, chain->event_id, chain->window,
--
2.13.2
More information about the mesa-dev
mailing list