drm-buffer: Don't always generate fb_id on construction

It might not be needed by the user of the buffer, so don't always
require it up front. Instead make sure that any user that needs it first
calls "meta_drm_buffer_ensure_fb_id()" to create the ID.

Only the plain gbm implementation creates the ID lazilly, the other
still does it on construction due to the objects used to create them
only existing during construction.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1854>
This commit is contained in:
Jonas Ådahl
2021-05-05 14:35:48 +02:00
parent a1266e19f4
commit b3dffb43b3
8 changed files with 49 additions and 23 deletions

View File

@ -421,6 +421,9 @@ process_plane_assignment (MetaKmsImplDevice *impl_device,
buffer = plane_assignment->buffer;
if (buffer && !meta_drm_buffer_ensure_fb_id (buffer, error))
return FALSE;
meta_topic (META_DEBUG_KMS,
"[atomic] Assigning %s plane (%u, %s) to %u, "
"%hdx%hd+%hd+%hd -> %dx%d+%d+%d",