Drm framebuffer functions

Functions
Drm framebuffer functions

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...

## Detailed Description

Functions that deal with setup of framebuffers.

## Function Documentation

## ◆ ecore_drm2_fb_create()

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.

Parameters

  dev |
  width |
  height |
  depth |
  bpp |
  format |

Returns
  A newly create framebuffer object, or NULL on failure

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL, ERR, MAP_FAILED, MAP_SHARED, mmap(), and PROT_WRITE.

## ◆ ecore_drm2_fb_data_get()

EAPI void* ecore_drm2_fb_data_get | ( | Ecore_Drm2_Fb * | fb | ) |

Get a framebuffer's mmap'd data.

Parameters

  fb |

Returns
  The mmap'd area of the framebuffer or NULL on failure

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

## ◆ ecore_drm2_fb_size_get()

EAPI unsigned int ecore_drm2_fb_size_get | ( | Ecore_Drm2_Fb * | fb | ) |

Get a framebuffer's size.

Parameters

  fb |

Returns
  size of the framebuffers' mmap'd data or 0 on failure

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

## ◆ ecore_drm2_fb_stride_get()

EAPI unsigned int ecore_drm2_fb_stride_get | ( | Ecore_Drm2_Fb * | fb | ) |

Get a framebuffer's stride.

Parameters

  fb |

Returns
  stride of the framebuffer or 0 on failure

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

## ◆ ecore_drm2_fb_dirty()

EAPI void ecore_drm2_fb_dirty | ( | Ecore_Drm2_Fb * | fb,
|  | Eina_Rectangle * | rects,
|  | unsigned int | count
| ) |  |

Mark regions of a framebuffer as dirty.

Parameters

  fb |
  rects |
  count |

Since
  1.18

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.

## ◆ ecore_drm2_fb_flip()

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.

Parameters

  fb |
  output |

Returns
  The result of drmModePageFlip function call

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

Referenced by ecore_drm2_output_dpms_set(), and ecore_drm2_output_enabled_set().

## ◆ ecore_drm2_fb_flip_complete()

EAPI Eina_Bool ecore_drm2_fb_flip_complete | ( | Ecore_Drm2_Output * | output | ) |

Must be called by a page flip handler when the flip completes.

Parameters

  output |

Returns
  Whether there's an undisplayed buffer still in the queue.

Since
  1.18

References ecore_main_loop_thread_safe_call_async(), EINA_FALSE, EINA_LIST_FOREACH_SAFE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_fb_busy_get()

EAPI Eina_Bool ecore_drm2_fb_busy_get | ( | Ecore_Drm2_Fb * | fb | ) |

Return the Ecore_Drm2_Fb's busy status.

Parameters

  fb |

Returns
  The busy status

Since
  1.19

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

## ◆ ecore_drm2_fb_release()

EAPI Eina_Bool ecore_drm2_fb_release | ( | Ecore_Drm2_Output * | o,
|  | Eina_Bool | panic
| ) |  |

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.

Parameters

  o | The output to force release
  panic | Try to release even buffers committed to scanout

Returns
  EINA_TRUE if a buffer was released

Since
  1.19

References DBG, EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_fb_dmabuf_import()

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.

Parameters

  dev |
  width |
  height |
  depth |
  bpp |
  format |
  strides |
  dmabuf_fd |
  dmabuf_fd_count |

Returns
  A newly created framebuffer object, or NULL on failure

Since
  1.20

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_fb_discard()

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.

Parameters

  fb |

Since
  1.20

References EINA_SAFETY_ON_NULL_RETURN, EINA_SAFETY_ON_TRUE_RETURN, and EINA_TRUE.

## ◆ ecore_drm2_fb_status_handler_set()

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.

Parameters

  fb | The fb to register the callback on
  handler | The function to handle the callback
  data | The user data to pass to the callback

Since
  1.20