drm-buffer: Keep track of handle as well

This handle is used by the legacy KMS API; lets avoid having to have GBM
specific code where this is done by letting the MetaDrmBuffer API, that
already has this information, expose it.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2275>
This commit is contained in:
Jonas Ådahl
2022-02-08 15:58:33 +01:00
committed by Marge Bot
parent d19700604b
commit 22d11eb9cb
6 changed files with 17 additions and 0 deletions

View File

@ -53,6 +53,7 @@ typedef struct _MetaDrmBufferPrivate
MetaDrmBufferFlags flags;
uint32_t fb_id;
uint32_t handle;
} MetaDrmBufferPrivate;
G_DEFINE_ABSTRACT_TYPE_WITH_PRIVATE (MetaDrmBuffer, meta_drm_buffer,
@ -152,6 +153,8 @@ meta_drm_buffer_do_ensure_fb_id (MetaDrmBuffer *buffer,
}
priv->fb_id = fb_id;
priv->handle = fb_args->handle;
return TRUE;
}
@ -185,6 +188,14 @@ meta_drm_buffer_get_fb_id (MetaDrmBuffer *buffer)
return priv->fb_id;
}
uint32_t
meta_drm_buffer_get_handle (MetaDrmBuffer *buffer)
{
MetaDrmBufferPrivate *priv = meta_drm_buffer_get_instance_private (buffer);
return priv->handle;
}
int
meta_drm_buffer_get_width (MetaDrmBuffer *buffer)
{