Module: Mesa
Branch: master
Commit: 9573bd70e1e7e32527d9c40716174c30fcc9720e
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=9573bd70e1e7e32527d9c40716174c30fcc9720e

Author: Dave Airlie <[email protected]>
Date:   Tue Aug 15 15:35:52 2017 +1000

radv/wsi: Compute correct row_pitch for GFX9.

(commit split out by Bas Nieuwenhuizen)

Fixes: 65477bae9cf "radv: enable GFX9 on radv"
Reviewed-by: Bas Nieuwenhuizen <[email protected]>

---

 src/amd/vulkan/radv_wsi.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/src/amd/vulkan/radv_wsi.c b/src/amd/vulkan/radv_wsi.c
index adc4311112..aa44b7d78a 100644
--- a/src/amd/vulkan/radv_wsi.c
+++ b/src/amd/vulkan/radv_wsi.c
@@ -154,6 +154,7 @@ radv_wsi_image_create(VkDevice device_h,
        VkImage image_h;
        struct radv_image *image;
        int fd;
+       RADV_FROM_HANDLE(radv_device, device, device_h);
 
        result = radv_image_create(device_h,
                                   &(struct radv_image_create_info) {
@@ -211,7 +212,6 @@ radv_wsi_image_create(VkDevice device_h,
         * or the fd for the linear image if a copy is required.
         */
        if (!needs_linear_copy || (needs_linear_copy && linear)) {
-               RADV_FROM_HANDLE(radv_device, device, device_h);
                RADV_FROM_HANDLE(radv_device_memory, memory, memory_h);
                if (!radv_get_memory_fd(device, memory, &fd))
                        goto fail_alloc_memory;
@@ -224,7 +224,11 @@ radv_wsi_image_create(VkDevice device_h,
        *memory_p = memory_h;
        *size = image->size;
        *offset = image->offset;
-       *row_pitch = surface->u.legacy.level[0].nblk_x * surface->bpe;
+
+       if (device->physical_device->rad_info.chip_class >= GFX9)
+               *row_pitch = surface->u.gfx9.surf_pitch * surface->bpe;
+       else
+               *row_pitch = surface->u.legacy.level[0].nblk_x * surface->bpe;
        return VK_SUCCESS;
  fail_alloc_memory:
        radv_FreeMemory(device_h, memory_h, pAllocator);

_______________________________________________
mesa-commit mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to