Skip to content

iris: Deduplicate screens across file descriptors

Kenneth Graunke requested to merge kwg/mesa:iris-screen-dedup into main

This reverts both of the following commits:

  • 0a497eb1 ("iris: make resources take a ref on the screen object")
  • 7557f160 ("iris: share buffer managers accross screens")

Instead, it borrows the freedreno winsys code to deduplicate screens from similar file descriptors. This returns us to the simpler world where there is one screen and one bufmgr even if there are multiple dup'd file descriptors that ultimately are backed by the same drm device node.

However, the manywin demo continues to render correctly.

One issue with the previous approach was that it could lead to screen reference counting issues. If the screen needed to allocate a resource for whatever reason, then the screen would reference the resource, and that resource would reference the screen. Cue circular references, and neither object ever get freed. This is a useful thing to be able to support, and in fact will be required by my suballocator patches.

Merge request reports