[Mesa-dev] [RFC v4 15/23] anv/wsi: Small code motion to prepare for modifiers

Louis-Francis Ratté-Boulianne lfrb at collabora.com
Mon Oct 16 07:04:25 UTC 2017


From: Daniel Stone <daniels at collabora.com>

Signed-off-by: Daniel Stone <daniels at collabora.com>
---
 src/intel/vulkan/anv_wsi.c | 12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/src/intel/vulkan/anv_wsi.c b/src/intel/vulkan/anv_wsi.c
index 97f8e10afc..607d2aa49d 100644
--- a/src/intel/vulkan/anv_wsi.c
+++ b/src/intel/vulkan/anv_wsi.c
@@ -178,11 +178,13 @@ anv_wsi_image_create(VkDevice device_h,
    struct anv_device *device = anv_device_from_handle(device_h);
    VkImage image_h;
    struct anv_image *image;
+   isl_tiling_flags_t isl_tiling = ISL_TILING_X_BIT;
+   VkImageTiling vk_tiling = VK_IMAGE_TILING_OPTIMAL;
 
    VkResult result;
    result = anv_image_create(anv_device_to_handle(device),
       &(struct anv_image_create_info) {
-         .isl_tiling_flags = ISL_TILING_X_BIT,
+         .isl_tiling_flags = isl_tiling,
          .stride = 0,
          .vk_info =
       &(VkImageCreateInfo) {
@@ -197,8 +199,7 @@ anv_wsi_image_create(VkDevice device_h,
          .mipLevels = 1,
          .arrayLayers = 1,
          .samples = 1,
-         /* FIXME: Need a way to use X tiling to allow scanout */
-         .tiling = VK_IMAGE_TILING_OPTIMAL,
+         .tiling = vk_tiling,
          .usage = (pCreateInfo->imageUsage |
                    VK_IMAGE_USAGE_COLOR_ATTACHMENT_BIT),
          .flags = 0,
@@ -237,10 +238,11 @@ anv_wsi_image_create(VkDevice device_h,
    assert(image->planes[0].offset == 0);
 
    struct anv_surface *surface = &image->planes[0].surface;
-   assert(surface->isl.tiling == ISL_TILING_X);
+   assert(isl_tiling & (1 << surface->isl.tiling));
 
    int ret = anv_gem_set_tiling(device, memory->bo->gem_handle,
-                                surface->isl.row_pitch, I915_TILING_X);
+                                surface->isl.row_pitch,
+                                isl_tiling_to_i915_tiling(surface->isl.tiling));
    if (ret) {
       /* FINISHME: Choose a better error. */
       result = vk_errorf(device->instance, device,
-- 
2.13.0



More information about the mesa-dev mailing list