1
0
Fork 0
Commit graph

12 commits

Author SHA1 Message Date
Ivan Molodetskikh
690b8806dd backends/native: Change uint32_t modifiers to uint64_t
They were erroneously cast to uint32_t. In particular this prevented the
invalid modifier from working as it is equal to a 64-bit -1.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2322>
2022-03-06 16:56:27 +03:00
Jonas Ådahl
b3dffb43b3 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>
2021-10-18 17:33:33 +02:00
Jonas Ådahl
a1266e19f4 drm-buffer: Add API to export buffer file descriptor
Practically ends up in gbm_bo_get_fd(). For dumb buffer, an
'unsupported' error is returned.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1854>
2021-10-18 17:33:33 +02:00
Jonas Ådahl
6ba86366b3 drm-buffer: Replace 'use-modifier' boolean with flags
This lets us add more customization to the buffer instance without
adding more boolean arguments.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1854>
2021-10-18 17:33:33 +02:00
Jonas Ådahl
e078718180 drm-buffer: Add getters for more metadata
Mostly calls into gbm_bo_* API, or something somewhat similar when on
dumb buffers. Added API are:

 * get offset for plane
 * get bpp (bits per pixel)
 * get modifier

This will allow users of MetaDrmBuffer to avoid having to "extract" the
gbm_bo to get these metadata.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1854>
2021-10-18 17:33:33 +02:00
Ivan Molodetskikh
1116b14f38 backends/native: Get rendering and swap timings during scanout
Scanout doesn't go through the usual path of compositing and doing
eglSwapBuffers, therefore it doesn't hit the timestamp query placed in
that path. Instead, get the timings by binding the scanout buffer to an
FBO and doing a timestamp query on the FBO.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1762>
2021-07-13 08:09:42 +00:00
Jonas Ådahl
10c4bc6e3f drm-buffer: Create from MetaDeviceFile instead of MetaKmsDevice
The DRM buffers aren't really tied to mode setting, so they shouldn't
need to have an associated mode setting device. Now that we have a
device file level object that can fill this role, port over
MetaDrmBuffer and friends away from MetaKmsDevice to MetaDeviceFile.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1828>
2021-07-07 21:03:26 +02:00
Jonas Ådahl
84bde805fe 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>
2021-01-22 16:47:08 +00:00
Jonas Ådahl
91ac64bb44 drm-buffer: Make the "types" actual types
There is no reason why we should have an internal type enum when we have
all the infrastructure to just use multiple GObject types. Also there
was no code sharing between the old "types", the only common API was
getting the framebuffer ID, so lets make that a vfunc.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/584
2019-05-21 14:55:38 +00:00
Jonas Ådahl
ed56edc7ba drm-buffer: Remove useless soft-asserts
If triggered, many would result in crashes later anyway, so lets change
those to asserts. Some are simply useless, so remove those.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/584
2019-05-21 14:55:38 +00:00
Jonas Ådahl
6eeba2434a drm-buffer: Clean up file descriptor variable naming
Nowhere else is it called 'drm_fd' so lets not get rid of this
inconsistency.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/584
2019-05-21 14:55:38 +00:00
Jonas Ådahl
7fb7b28cd6 kms-buffer: Rename to MetaDrmBuffer
MetaKms* will be a dedicated namespace, which MetaKmsBuffer doesn't fit
under.

https://gitlab.gnome.org/GNOME/mutter/merge_requests/584
2019-05-21 14:55:38 +00:00
Renamed from src/backends/native/meta-kms-buffer.c (Browse further)