[Bug 111568] Image corruption with vkCmdCopyImage into I915_FORMAT_MOD_Y_TILED_CCS-tiled swapchain image

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Fri Sep 6 05:38:08 UTC 2019


https://bugs.freedesktop.org/show_bug.cgi?id=111568

            Bug ID: 111568
           Summary: Image corruption with vkCmdCopyImage into
                    I915_FORMAT_MOD_Y_TILED_CCS-tiled swapchain image
           Product: Mesa
           Version: 19.1
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: NEW
          Severity: not set
          Priority: not set
         Component: Drivers/Vulkan/intel
          Assignee: intel-3d-bugs at lists.freedesktop.org
          Reporter: mesa at felixdoerre.de
        QA Contact: intel-3d-bugs at lists.freedesktop.org
                CC: jason at jlekstrand.net

Created attachment 145271
  --> https://bugs.freedesktop.org/attachment.cgi?id=145271&action=edit
Vulkan Api trace showing a wronly copied imaged.

I am using a laptop with: "Intel(R) HD Graphics P630 (Kaby Lake GT2)"

When using Vulkan with gonme-wayland the Xwayland server(version 1.20.4)
reports compatibility with all the DRM modifiers, implemented in mesa:
      DRM_FORMAT_MOD_LINEAR,
      I915_FORMAT_MOD_X_TILED,
      I915_FORMAT_MOD_Y_TILED,
      I915_FORMAT_MOD_Y_TILED_CCS,

The mesa intel vulkan driver reports the following two formats for support with
an X11-swapchain (created through xwayland):
 VK_FORMAT_B8G8R8A8_UNORM
 VK_FORMAT_B8G8R8A8_SRGB

In
https://gitlab.freedesktop.org/mesa/mesa/blob/master/src/intel/isl/isl_format.c
we can see that only the UNORM-format supports CCS compression on my hardware
(I have devinfo->gen=9)
   SF(  Y,   Y,   x,   Y,   Y,   Y,   Y,   x,  60,  70,   x,  90,  
B8G8R8A8_UNORM)
   SF(  Y,   Y,   x,   x,   Y,   Y,   x,   x,   x,   x,   x, 100,  
B8G8R8A8_UNORM_SRGB)

When the application now chooses "VK_FORMAT_B8G8R8A8_UNORM" as swapchain image
format, the WSI-part offers all 4 DRM-modifiers to anv_image.c which chooses
I915_FORMAT_MOD_Y_TILED_CCS based on this scoring function:
https://gitlab.freedesktop.org/mesa/mesa/blob/55c912883c9b3624ee060fe1a0232cf71e329d80/src/intel/vulkan/anv_image.c#L524

The application creates a second (normal, LINEAR-tiled, same VkFormat (of
VK_FORMAT_B8G8R8A8_UNORM))-image with the same size as the swapchain-image and
loads data into it my memory-mapping it (I chose an all-white image).
Afterwards it copies the image data into the swapchain image with
`VkCmdCopyImage`.

When this picture is presented however it is corrupted. (I see only a few white
dots on black background). I presume this is caused by the code that does
`VkCmdCopyImage` not correctly handling conversion based on CCS-tiling.

I have created a small Java-LWJGL-Vulkan application that deterministically
reproduces the problem and recorded a Vulkan apitrace (attached). If you would
prefer the java-Application for testing I could provide it.

-- 
You are receiving this mail because:
You are the QA Contact for the bug.
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/intel-3d-bugs/attachments/20190906/862168b9/attachment.html>


More information about the intel-3d-bugs mailing list