Skip to content

tegra: Support framebuffer modifier unaware applications

Thierry Reding requested to merge tagr/mesa:detile into main

Applications that are not aware of framebuffer modifiers cannot be expected to deal with buffers that are not pitch-linear. Make sure that these applications work correctly by allocating a separate, pitch-linear copy of the framebuffer to which we can do de-tiling blits on ->flush_resource() to meet the applications assumptions.

Note that this only works if the applications end up properly synchronizing their render jobs via eglSwapBuffers() (or something equivalent that ends up calling ->flush_resource() on the scanout buffer. Unfortunately this doesn't work with X because by default X will render to a front-buffer and never ends up flushing any of the underlying resources.

Ironically, X works fine if we don't enforce a de-tiling blit, but only by accident. The reason is that even when X doesn't allocate a GBM buffer object using framebuffer modifiers, it will query the framebuffer modifier of that buffer and pass the modifier to the DRM_IOCTL_MODE_ADDFB2 IOCTL, which will result in the right KMS framebuffer setup on Tegra.

Signed-off-by: Thierry Reding

Merge request reports