native: Consolidate DRM buffer management to MetaDrmBuffer types
This commit consolidates DRM buffer management to the MetaDrmBuffer types, where the base type handles the common functionality (such as managing the framebuffer id using drmModeAdd*/RMFb()), and the sub types their corresponding type specific behavior. This means that drmModeAdd*/RmFB() handling is moved from meta-gpu-kms.c to meta-drm-buffer.c; dumb buffer allocation/management from meta-renderer-native.c. Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1488>
This commit is contained in:
@ -1,5 +1,6 @@
|
||||
/*
|
||||
* Copyright (C) 2018 Canonical Ltd.
|
||||
* Copyright (C) 2019-2020 Red Hat Inc.
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or
|
||||
* modify it under the terms of the GNU General Public License as
|
||||
@ -31,16 +32,14 @@ G_DECLARE_DERIVABLE_TYPE (MetaDrmBuffer,
|
||||
META, DRM_BUFFER,
|
||||
GObject)
|
||||
|
||||
struct _MetaDrmBufferClass
|
||||
{
|
||||
GObjectClass parent_class;
|
||||
|
||||
uint32_t (* get_fb_id) (MetaDrmBuffer *buffer);
|
||||
};
|
||||
|
||||
MetaDrmBuffer *
|
||||
meta_drm_buffer_new_from_dumb (uint32_t dumb_fb_id);
|
||||
|
||||
uint32_t meta_drm_buffer_get_fb_id (MetaDrmBuffer *buffer);
|
||||
|
||||
int meta_drm_buffer_get_width (MetaDrmBuffer *buffer);
|
||||
|
||||
int meta_drm_buffer_get_height (MetaDrmBuffer *buffer);
|
||||
|
||||
int meta_drm_buffer_get_stride (MetaDrmBuffer *buffer);
|
||||
|
||||
uint32_t meta_drm_buffer_get_format (MetaDrmBuffer *buffer);
|
||||
|
||||
#endif /* META_DRM_BUFFER_H */
|
||||
|
Reference in New Issue
Block a user