Functions that deal with setup of framebuffers. More...
Functions | |
EAPI Ecore_Drm2_Fb * | ecore_drm2_fb_create (Ecore_Drm2_Device *dev, int width, int height, int depth, int bpp, unsigned int format) |
Create a new framebuffer object. More... | |
EAPI void * | ecore_drm2_fb_data_get (Ecore_Drm2_Fb *fb) |
Get a framebuffer's mmap'd data. More... | |
EAPI unsigned int | ecore_drm2_fb_size_get (Ecore_Drm2_Fb *fb) |
Get a framebuffer's size. More... | |
EAPI unsigned int | ecore_drm2_fb_stride_get (Ecore_Drm2_Fb *fb) |
Get a framebuffer's stride. More... | |
EAPI void | ecore_drm2_fb_dirty (Ecore_Drm2_Fb *fb, Eina_Rectangle *rects, unsigned int count) |
Mark regions of a framebuffer as dirty. More... | |
EAPI int | ecore_drm2_fb_flip (Ecore_Drm2_Fb *fb, Ecore_Drm2_Output *output) |
Schedule a pageflip to the given Ecore_Drm2_Fb. More... | |
EAPI Eina_Bool | ecore_drm2_fb_flip_complete (Ecore_Drm2_Output *output) |
Must be called by a page flip handler when the flip completes. More... | |
EAPI Eina_Bool | ecore_drm2_fb_busy_get (Ecore_Drm2_Fb *fb) |
Return the Ecore_Drm2_Fb's busy status. More... | |
EAPI Eina_Bool | ecore_drm2_fb_release (Ecore_Drm2_Output *o, Eina_Bool panic) |
Try to force a framebuffer release for an output. More... | |
EAPI Ecore_Drm2_Fb * | ecore_drm2_fb_dmabuf_import (Ecore_Drm2_Device *dev, int width, int height, int depth, int bpp, unsigned int format, unsigned int strides[4], int dmabuf_fd[4], int dmabuf_fd_count) |
Import a dmabuf object as a Framebuffer. More... | |
EAPI void | ecore_drm2_fb_discard (Ecore_Drm2_Fb *fb) |
Discard a framebuffer object. More... | |
EAPI void | ecore_drm2_fb_status_handler_set (Ecore_Drm2_Fb *fb, Ecore_Drm2_Fb_Status_Handler handler, void *data) |
Register a callback for buffer status updates. More... | |
Functions that deal with setup of framebuffers.
EAPI Ecore_Drm2_Fb * ecore_drm2_fb_create | ( | Ecore_Drm2_Device * | dev, |
int | width, | ||
int | height, | ||
int | depth, | ||
int | bpp, | ||
unsigned int | format | ||
) |
Create a new framebuffer object.
dev | |
width | |
height | |
depth | |
bpp | |
format |
References EINA_SAFETY_ON_NULL_RETURN_VAL, ERR, MAP_FAILED, MAP_SHARED, mmap(), and PROT_WRITE.
EAPI void * ecore_drm2_fb_data_get | ( | Ecore_Drm2_Fb * | fb | ) |
Get a framebuffer's mmap'd data.
fb |
References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.
EAPI unsigned int ecore_drm2_fb_size_get | ( | Ecore_Drm2_Fb * | fb | ) |
Get a framebuffer's size.
fb |
References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.
EAPI unsigned int ecore_drm2_fb_stride_get | ( | Ecore_Drm2_Fb * | fb | ) |
Get a framebuffer's stride.
fb |
References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.
EAPI void ecore_drm2_fb_dirty | ( | Ecore_Drm2_Fb * | fb, |
Eina_Rectangle * | rects, | ||
unsigned int | count | ||
) |
Mark regions of a framebuffer as dirty.
fb | |
rects | |
count |
References alloca(), EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, _Eina_Rectangle::h, _Eina_Rectangle::w, WRN, _Eina_Rectangle::x, and _Eina_Rectangle::y.
EAPI int ecore_drm2_fb_flip | ( | Ecore_Drm2_Fb * | fb, |
Ecore_Drm2_Output * | output | ||
) |
Schedule a pageflip to the given Ecore_Drm2_Fb.
The caller is responsible for running a page flip handler and calling ecore_drm2_fb_flip_complete() when it completes.
fb | |
output |
References EINA_SAFETY_ON_NULL_RETURN_VAL.
Referenced by ecore_drm2_output_dpms_set(), and ecore_drm2_output_enabled_set().
Must be called by a page flip handler when the flip completes.
output |
References ecore_main_loop_thread_safe_call_async(), EINA_FALSE, EINA_LIST_FOREACH_SAFE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
Return the Ecore_Drm2_Fb's busy status.
fb |
References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.
Try to force a framebuffer release for an output.
This tries to release the next or optionally pending, or current buffer from the output. If successful there will be a release callback to the registered handler, and the fb will no longer be flagged busy.
Releasing buffers committed to scanout will potentially cause flicker, so this is only done when the panic flag is set.
o | The output to force release |
panic | Try to release even buffers committed to scanout |
References DBG, EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EAPI Ecore_Drm2_Fb * ecore_drm2_fb_dmabuf_import | ( | Ecore_Drm2_Device * | dev, |
int | width, | ||
int | height, | ||
int | depth, | ||
int | bpp, | ||
unsigned int | format, | ||
unsigned int | strides[4], | ||
int | dmabuf_fd[4], | ||
int | dmabuf_fd_count | ||
) |
Import a dmabuf object as a Framebuffer.
dev | |
width | |
height | |
depth | |
bpp | |
format | |
strides | |
dmabuf_fd | |
dmabuf_fd_count |
References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.
EAPI void ecore_drm2_fb_discard | ( | Ecore_Drm2_Fb * | fb | ) |
Discard a framebuffer object.
Decreases the refcount on a fb object. It will be destroyed when it's no longer attached to scanout or otherwise in use.
fb |
References EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, and EINA_TRUE.
EAPI void ecore_drm2_fb_status_handler_set | ( | Ecore_Drm2_Fb * | fb, |
Ecore_Drm2_Fb_Status_Handler | handler, | ||
void * | data | ||
) |
Register a callback for buffer status updates.
When a flip completes ecore_drm2 may release a buffer. Use this callback if you need to do bookkeeping or locking on buffer release.
Additionally, an fb may be placed on scanout or removed from scanout by evas. When this happens a compositor needs to ensure the buffers aren't released back to a client while they're on scanout.
fb | The fb to register the callback on |
handler | The function to handle the callback |
data | The user data to pass to the callback |