• Kristian H. Kristensen's avatar
    Reland "exo: Set the gfx::NativePixmapHandle modifier" · 94b79589
    Kristian H. Kristensen authored
    The original CL didn't account for most clients passing modifier 0 to
    mean "don't know modifier".  The 0 modifier is DRM_FORMAT_MOD_LINEAR,
    while DRM_FORMAT_MOD_INVALID is to be used to indicate that the client
    doesn't know the modifier and triggers the legacy implicit layout
    discovery:
    
    https://gitlab.freedesktop.org/wayland/wayland-protocols/-/blob/master/unstable/linux-dmabuf/linux-dmabuf-unstable-v1.xml#L133
    
    Specifically, what broke was Intel GPUs using tiled buffers and
    importing those as EGLImages without specifying a modifier.  Without a
    modifier, the GLES driver will get the tiling information from the
    kernel.  One we started forwarding the DRM_FORMAT_MOD_LINEAR modifier
    coming from the clients, that would take precedence and the driver
    would view the buffer as linear, even though it was tiled.
    
    We'll have to fix the various clients, but in the interim, we can add
    support for non-linear modifiers by treating 0 as
    DRM_FORMAT_MOD_INVALID like before.  This does the right thing for
    linear buffers for all GPUs and keeps the mismatch in the Intel case
    working.  At the same time it allows modifier-aware clients to pass in
    explicit modifiers so that we can enable more efficient buffer
    layouts.
    
    BUG=b:145579089, b:79682290, b:162704898, chromium:1112017
    TEST=wayland_rects_client --use-drm=msm and verify modifiers get passed
    
    Change-Id: Ib00d4d6fe96e957c1f66205f2f5f515c09f3aabd
    Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2340164
    Commit-Queue: Kristian H. Kristensen <hoegsberg@chromium.org>
    Reviewed-by: default avatarDaniele Castagna <dcastagna@chromium.org>
    Cr-Commit-Position: refs/heads/master@{#795280}
    94b79589
zwp_linux_dmabuf.cc 10.4 KB