Skip to content

llvmpipe / softpipe: Do not leak mapping of display-target resources

For shader resources that are backed by a display target (DT) and have it mmap'd for use in samplers/images/textures, actually unmap the DT when its mapping is not used anymore.

In particular, this fixes the situation where the DRM auth state of the running process would not be released even though the GBM/DRM based EGLContext/EGLDisplay is fully shut down and all file descriptors to the DRM node have been closed. This happened because leaking the mmap of a dmabuf-imported GBM/EGLImage (e.g. when used as a fragment shader texture input) caused the kernel-side file description to the DRM node not to be released, and consequently the process holding on to its DRM auth state. Once that process is terminated, DRM auth would be released of course. However, there are use cases (e.g. continuous integration testing scenarios), where a single process needs to repeatedly set up and tear down a full KMS/EGL context (and render some testing scenario in between). For those cases, resource shutdown needs to release its DRM auth state properly, so the next iteration of tests can again become DRM master in the same process. With this MR, this use case is fixed and works as expected.

Merge request reports

Loading