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:
@ -251,7 +251,7 @@ init_dumb_buffer (MetaDrmBufferDumb *buffer_dumb,
|
||||
.handles = { create_arg.handle },
|
||||
.strides = { create_arg.pitch },
|
||||
};
|
||||
if (!meta_drm_buffer_ensure_fb_id (buffer, &fb_args, error))
|
||||
if (!meta_drm_buffer_do_ensure_fb_id (buffer, &fb_args, error))
|
||||
goto err_add_fb;
|
||||
|
||||
map_arg = (struct drm_mode_map_dumb) {
|
||||
|
Reference in New Issue
Block a user