6e7a961d43
Sometimes we need to duplicate an existing drm_fb, e.g. when pageflipping to the same buffer to kickstart the repaint loop. To handle situations like these, and simplify resource management for dumb and cursor buffers, refcount drm_fb. drm_fb_get_from_bo has a path where it may reuse a drm_fb, if the BO has been imported and not released yet. As drm_fb_unref now relies on actual refcounting (backed up by asserts), we add a balancing drm_fb_ref() to the path where we return a reused drm_fb. Signed-off-by: Daniel Stone <daniels@collabora.com> Reviewed-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk>