Drm output functions

- Main Page
- Related Pages
- Modules
- Data Structures
- Files
- Examples

Functions
Drm output functions

Functions that deal with setup of outputs. More...

## Functions
EAPI Eina_Bool | ecore_drm2_outputs_create (Ecore_Drm2_Device *device)
| Iterate drm resources and create outputs.
EAPI void | ecore_drm2_outputs_destroy (Ecore_Drm2_Device *device)
| Destroy any created outputs.
EAPI const Eina_List * | ecore_drm2_outputs_get (Ecore_Drm2_Device *device)
| Get the list of outputs from a drm device.
EAPI int | ecore_drm2_output_dpms_get (Ecore_Drm2_Output *output)
| Get the dpms level of a given output.
EAPI void | ecore_drm2_output_dpms_set (Ecore_Drm2_Output *output, int level)
| Set the dpms level of a given output.
EAPI char * | ecore_drm2_output_edid_get (Ecore_Drm2_Output *output)
| Get the edid of a given output.
EAPI Eina_Bool | ecore_drm2_output_backlight_get (Ecore_Drm2_Output *output)
| Get if a given output has a backlight.
EAPI Ecore_Drm2_Output * | ecore_drm2_output_find (Ecore_Drm2_Device *device, int x, int y)
| Find an output at the given position.
EAPI void | ecore_drm2_output_dpi_get (Ecore_Drm2_Output *output, int *xdpi, int *ydpi)
| Get the dpi of a given output.
EAPI unsigned int | ecore_drm2_output_crtc_get (Ecore_Drm2_Output *output)
| Get the id of the crtc that an output is using.
EAPI Ecore_Drm2_Fb * | ecore_drm2_output_latest_fb_get (Ecore_Drm2_Output *output)
| Return the most recently set Ecore_Drm2_Fb for a given output.
EAPI Eina_Bool | ecore_drm2_output_primary_get (Ecore_Drm2_Output *output)
| Get if a given output is marked as the primary output.
EAPI void | ecore_drm2_output_primary_set (Ecore_Drm2_Output *output, Eina_Bool primary)
| Set a given output to be primary.
EAPI Eina_Bool | ecore_drm2_output_enabled_get (Ecore_Drm2_Output *output)
| Get if a given output is enabled.
EAPI void | ecore_drm2_output_enabled_set (Ecore_Drm2_Output *output, Eina_Bool enabled)
| Set if a given output is enabled.
EAPI void | ecore_drm2_output_physical_size_get (Ecore_Drm2_Output *output, int *w, int *h)
| Get the physical size of a given output.
EAPI const Eina_List * | ecore_drm2_output_modes_get (Ecore_Drm2_Output *output)
| Get a list of the modes supported on a given output.
EAPI void | ecore_drm2_output_mode_info_get (Ecore_Drm2_Output_Mode *mode, int *w, int *h, unsigned int *refresh, unsigned int *flags)
| Get information from an existing output mode.
EAPI Eina_Bool | ecore_drm2_output_mode_set (Ecore_Drm2_Output *output, Ecore_Drm2_Output_Mode *mode, int x, int y)
| Set a given mode to be used on a given output.
EAPI char * | ecore_drm2_output_name_get (Ecore_Drm2_Output *output)
| Get the name of a given output.
EAPI char * | ecore_drm2_output_model_get (Ecore_Drm2_Output *output)
| Get the model of a given output.
EAPI Eina_Bool | ecore_drm2_output_connected_get (Ecore_Drm2_Output *output)
| Get if a given output is connected.
EAPI Eina_Bool | ecore_drm2_output_cloned_get (Ecore_Drm2_Output *output)
| Get if a given output is cloned.
EAPI unsigned int | ecore_drm2_output_connector_type_get (Ecore_Drm2_Output *output)
| Get the connector type of a given output.
EAPI void | ecore_drm2_output_info_get (Ecore_Drm2_Output *output, int *x, int *y, int *w, int *h, unsigned int *refresh)
| Get the geometry and refresh rate for a given output.
EAPI Eina_Bool | ecore_drm2_output_possible_crtc_get (Ecore_Drm2_Output *output, unsigned int crtc)
| Get if an output can be used on a given crtc.
EAPI void | ecore_drm2_output_gamma_set (Ecore_Drm2_Output *output, uint16_t size, uint16_t *red, uint16_t *green, uint16_t *blue)
| Set the gamma level of an Ecore_Drm_Output.
EAPI int | ecore_drm2_output_supported_rotations_get (Ecore_Drm2_Output *output)
| Get the supported rotations of a given output.
EAPI Eina_Bool | ecore_drm2_output_rotation_set (Ecore_Drm2_Output *output, int rotation)
| Set a rotation on a given output.
EAPI int | ecore_drm2_output_rotation_get (Ecore_Drm2_Output *output)
| Get current output rotation.
EAPI void | ecore_drm2_output_user_data_set (Ecore_Drm2_Output *o, void *data)
| Set the user data for the output's page flip handler.
EAPI void * | ecore_drm2_output_user_data_get (Ecore_Drm2_Output *output)
| Get the user data for a given output.
EAPI unsigned int | ecore_drm2_output_subpixel_get (const Ecore_Drm2_Output *output)
| Get the subpixel state of the output.
EAPI void | ecore_drm2_output_relative_mode_set (Ecore_Drm2_Output *output, Ecore_Drm2_Relative_Mode mode)
| Set the relative mode for an output.
EAPI Ecore_Drm2_Relative_Mode | ecore_drm2_output_relative_mode_get (Ecore_Drm2_Output *output)
| Get the relative mode of an output.
EAPI void | ecore_drm2_output_relative_to_set (Ecore_Drm2_Output *output, const char *relative)
| Set which output a given output is relative to.
EAPI const char * | ecore_drm2_output_relative_to_get (Ecore_Drm2_Output *output)
| Get which output is relative to a given output.
EAPI void * | ecore_drm2_fb_bo_get (Ecore_Drm2_Fb *fb)
| Get the Framebuffer's gbm buffer object.
EAPI Eina_Bool | ecore_drm2_output_blanktime_get (Ecore_Drm2_Output *output, int sequence, long *sec, long *usec)
| Get the time of the last vblank.
EAPI Eina_Bool | ecore_drm2_output_pending_get (Ecore_Drm2_Output *output)
| Check if there's a pageflip in progress for an output.

## Detailed Description

Functions that deal with setup of outputs.

## Function Documentation

## ◆ ecore_drm2_outputs_create()

EAPI Eina_Bool ecore_drm2_outputs_create | ( | Ecore_Drm2_Device * | device | ) |

Iterate drm resources and create outputs.

Parameters

  device |

Returns
  EINA_TRUE on success, EINA_FALSE otherwise

Since
  1.18

References EEZE_UDEV_EVENT_ADD, EEZE_UDEV_EVENT_CHANGE, EEZE_UDEV_EVENT_REMOVE, EEZE_UDEV_TYPE_DRM, eeze_udev_watch_add(), EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_outputs_destroy()

EAPI void ecore_drm2_outputs_destroy | ( | Ecore_Drm2_Device * | device | ) |

Destroy any created outputs.

Parameters

  device |

Since
  1.18

References EINA_LIST_FREE, and EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_outputs_get()

EAPI const Eina_List * ecore_drm2_outputs_get | ( | Ecore_Drm2_Device * | device | ) |

Get the list of outputs from a drm device.

Parameters

  device |

Returns

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_dpms_get()

EAPI int ecore_drm2_output_dpms_get | ( | Ecore_Drm2_Output * | output | ) |

Get the dpms level of a given output.

Parameters

  output |

Returns
  Integer value representing the state of DPMS on a given output or -1 on error

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_dpms_set()

EAPI void ecore_drm2_output_dpms_set | ( | Ecore_Drm2_Output * | output,
|  | int | level
| ) |  |

Set the dpms level of a given output.

Parameters

  output |
  level |

Since
  1.18

References ecore_drm2_fb_flip(), EINA_SAFETY_ON_NULL_RETURN, and EINA_SAFETY_ON_TRUE_RETURN.

Referenced by ecore_drm2_output_enabled_set().

## ◆ ecore_drm2_output_edid_get()

EAPI char * ecore_drm2_output_edid_get | ( | Ecore_Drm2_Output * | output | ) |

Get the edid of a given output.

Parameters

  output |

Returns
  A string representing the edid

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_backlight_get()

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

Get if a given output has a backlight.

Parameters

  output |

Returns
  EINA_TRUE if this output has a backlight, EINA_FALSE otherwise

Since
  1.18

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_find()

EAPI Ecore_Drm2_Output * ecore_drm2_output_find | ( | Ecore_Drm2_Device * | device,
|  | int | x,
|  | int | y
| ) |  |

Find an output at the given position.

Parameters

  device |
  x |
  y |

Returns
  An Ecore_Drm2_Output which exists at the given coordinates, or NULL on failure

Since
  1.18

References EINA_LIST_FOREACH, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_dpi_get()

EAPI void ecore_drm2_output_dpi_get | ( | Ecore_Drm2_Output * | output,
|  | int * | xdpi,
|  | int * | ydpi
| ) |  |

Get the dpi of a given output.

Parameters

  output |
  xdpi |
  ydpi |

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN, and EINA_SAFETY_ON_TRUE_RETURN.

## ◆ ecore_drm2_output_crtc_get()

EAPI unsigned int ecore_drm2_output_crtc_get | ( | Ecore_Drm2_Output * | output | ) |

Get the id of the crtc that an output is using.

Parameters

  output |

Returns
  A valid crtc id or 0 on failure

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_latest_fb_get()

EAPI Ecore_Drm2_Fb * ecore_drm2_output_latest_fb_get | ( | Ecore_Drm2_Output * | output | ) |

Return the most recently set Ecore_Drm2_Fb for a given output.

This may be the currently scanned out buffer, a buffer currently being flipped to scanout, or a buffer that has been submit but may not actually ever hit scanout at all.

Parameters

  output |

Returns
  The latest Ecore_Drm2_Fb submit for this output, or NULL otherwise

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_primary_get()

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

Get if a given output is marked as the primary output.

Parameters

  output |

Returns
  EINA_TRUE if output is primary, EINA_FALSE otherwise

Since
  1.18

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_primary_set()

EAPI void ecore_drm2_output_primary_set | ( | Ecore_Drm2_Output * | output,
|  | Eina_Bool | primary
| ) |  |

Set a given output to be primary.

Parameters

  output |
  primary |

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_enabled_get()

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

Get if a given output is enabled.

Parameters

  output |

Returns
  EINA_TRUE if enabled, EINA_FALSE otherwise.

Since
  1.18

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_enabled_set()

EAPI void ecore_drm2_output_enabled_set | ( | Ecore_Drm2_Output * | output,
|  | Eina_Bool | enabled
| ) |  |

Set if a given output is enabled.

Parameters

  output |
  enabled |

Since
  1.18

References ecore_drm2_fb_flip(), ecore_drm2_output_dpms_set(), and EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_physical_size_get()

EAPI void ecore_drm2_output_physical_size_get | ( | Ecore_Drm2_Output * | output,
|  | int * | w,
|  | int * | h
| ) |  |

Get the physical size of a given output.

This function will give the physical size (in mm) of an output

Parameters

  output |
  *w |
  *h |

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_modes_get()

EAPI const Eina_List * ecore_drm2_output_modes_get | ( | Ecore_Drm2_Output * | output | ) |

Get a list of the modes supported on a given output.

Parameters

  output |

Returns
  An Eina_List of the modes supported for this output

Note
  The returned list should not be freed

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_mode_info_get()

EAPI void ecore_drm2_output_mode_info_get | ( | Ecore_Drm2_Output_Mode * | mode,
|  | int * | w,
|  | int * | h,
|  | unsigned int * | refresh,
|  | unsigned int * | flags
| ) |  |

Get information from an existing output mode.

Parameters

  mode |
  w |
  h |
  refresh |
  flags |

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_mode_set()

EAPI Eina_Bool ecore_drm2_output_mode_set | ( | Ecore_Drm2_Output * | output,
|  | Ecore_Drm2_Output_Mode * | mode,
|  | int | x,
|  | int | y
| ) |  |

Set a given mode to be used on a given output.

Parameters

  output |
  mode |
  x |
  y |

Returns
  EINA_TRUE on success, EINA_FALSE otherwise

Since
  1.18

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_output_name_get()

EAPI char * ecore_drm2_output_name_get | ( | Ecore_Drm2_Output * | output | ) |

Get the name of a given output.

Parameters

  output |

Returns
  A string representing the output's name. Caller should free this return.

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_model_get()

EAPI char * ecore_drm2_output_model_get | ( | Ecore_Drm2_Output * | output | ) |

Get the model of a given output.

Parameters

  output |

Returns
  A string representing the output's model. Caller should free this return.

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_connected_get()

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

Get if a given output is connected.

Parameters

  output |

Returns
  EINA_TRUE if connected, EINA_FALSE otherwise

Since
  1.18

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_cloned_get()

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

Get if a given output is cloned.

Parameters

  output |

Returns
  EINA_TRUE if cloned, EINA_FALSE otherwise.

Since
  1.18

References EINA_FALSE, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_connector_type_get()

EAPI unsigned int ecore_drm2_output_connector_type_get | ( | Ecore_Drm2_Output * | output | ) |

Get the connector type of a given output.

Parameters

  output |

Returns
  An unsigned integer representing the type of connector for this output

Since
  1.18

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_info_get()

EAPI void ecore_drm2_output_info_get | ( | Ecore_Drm2_Output * | output,
|  | int * | x,
|  | int * | y,
|  | int * | w,
|  | int * | h,
|  | unsigned int * | refresh
| ) |  |

Get the geometry and refresh rate for a given output.

Parameters

  output |
  *x |
  *y |
  *w |
  *h |
  *refresh |

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN, and EINA_SAFETY_ON_TRUE_RETURN.

## ◆ ecore_drm2_output_possible_crtc_get()

EAPI Eina_Bool ecore_drm2_output_possible_crtc_get | ( | Ecore_Drm2_Output * | output,
|  | unsigned int | crtc
| ) |  |

Get if an output can be used on a given crtc.

This function will loop the possible crtcs of an encoder to determine if a given output can be assigned to a given crtc

Parameters

  output |
  crtc |

Returns
  EINA_TRUE if the output can be assigned to given crtc, EINA_FALSE otherwise

Since
  1.18

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, EINA_SAFETY_ON_TRUE_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_output_gamma_set()

EAPI void ecore_drm2_output_gamma_set | ( | Ecore_Drm2_Output * | output,
|  | uint16_t | size,
|  | uint16_t * | red,
|  | uint16_t * | green,
|  | uint16_t * | blue
| ) |  |

Set the gamma level of an Ecore_Drm_Output.

This function will set the gamma of an Ecore_Drm2_Output

Parameters

  output | The Ecore_Drm2_Output to set the gamma level on
  size | The gamma table size to set
  red | The amount to scale the red channel
  green | The amount to scale the green channel
  blue | The amount to scale the blue channel

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN, and EINA_SAFETY_ON_TRUE_RETURN.

## ◆ ecore_drm2_output_supported_rotations_get()

EAPI int ecore_drm2_output_supported_rotations_get | ( | Ecore_Drm2_Output * | output | ) |

Get the supported rotations of a given output.

Parameters

  output |

Returns
  An integer representing possible rotations, or -1 on failure

Note
  This function will only return valid values if Atomic support is enabled as it requires hardware plane support.

Since
  1.19

References EINA_LIST_FOREACH, and EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_rotation_set()

EAPI Eina_Bool ecore_drm2_output_rotation_set | ( | Ecore_Drm2_Output * | output,
|  | int | rotation
| ) |  |

Set a rotation on a given output.

Parameters

  output |
  rotation |

Returns
  EINA_TRUE on success, EINA_FALSE otherwise

Note
  This function will only work if Atomic support is enabled as it requires hardware plane support.

Since
  1.19

References EINA_FALSE, EINA_LIST_FOREACH, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_output_rotation_get()

EAPI int ecore_drm2_output_rotation_get | ( | Ecore_Drm2_Output * | output | ) |

Get current output rotation.

Parameters

  output |

Returns
  An integer representing the output current rotation

Since
  1.22

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_user_data_set()

EAPI void ecore_drm2_output_user_data_set | ( | Ecore_Drm2_Output * | o,
|  | void * | data
| ) |  |

Set the user data for the output's page flip handler.

Parameters

  o | The output to update user data for
  data | The new user data pointer

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_user_data_get()

EAPI void * ecore_drm2_output_user_data_get | ( | Ecore_Drm2_Output * | output | ) |

Get the user data for a given output.

Parameters

  output | The output to get user data for

Returns
  The user data associated with given output

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_subpixel_get()

EAPI unsigned int ecore_drm2_output_subpixel_get | ( | const Ecore_Drm2_Output * | output | ) |

Get the subpixel state of the output.

Parameters

  output | the output

Returns
  The state value

Since
  1.20

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_relative_mode_set()

EAPI void ecore_drm2_output_relative_mode_set | ( | Ecore_Drm2_Output * | output,
|  | Ecore_Drm2_Relative_Mode | mode
| ) |  |

Set the relative mode for an output.

Parameters

  output | The output to set relative mode
  mode | The relative mode to set

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN.

## ◆ ecore_drm2_output_relative_mode_get()

EAPI Ecore_Drm2_Relative_Mode ecore_drm2_output_relative_mode_get | ( | Ecore_Drm2_Output * | output | ) |

Get the relative mode of an output.

Parameters

  output | The output to retrieve relative mode for

Returns
  The relative mode of a given output

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_output_relative_to_set()

EAPI void ecore_drm2_output_relative_to_set | ( | Ecore_Drm2_Output * | output,
|  | const char * | relative
| ) |  |

Set which output a given output is relative to.

Parameters

  output | The output for which to set relative
  relative | The output for which the first output is relative to

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN, and eina_stringshare_replace().

## ◆ ecore_drm2_output_relative_to_get()

EAPI const char * ecore_drm2_output_relative_to_get | ( | Ecore_Drm2_Output * | output | ) |

Get which output is relative to a given output.

Parameters

  output | The output for which to retrieve relative

Returns
  The name of the output which is relative to the given output or NULL

Since
  1.21

References EINA_SAFETY_ON_NULL_RETURN_VAL.

## ◆ ecore_drm2_fb_bo_get()

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

Get the Framebuffer's gbm buffer object.

Parameters

  fb | The framebuffer to query

Returns
  The gbm bo for the framebuffer

Since
  1.19

References EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_SAFETY_ON_TRUE_RETURN_VAL.

## ◆ ecore_drm2_output_blanktime_get()

EAPI Eina_Bool ecore_drm2_output_blanktime_get | ( | Ecore_Drm2_Output * | output,
|  | int | sequence,
|  | long * | sec,
|  | long * | usec
| ) |  |

Get the time of the last vblank.

Query the display hardware for the time of a vblank, potentially blocking.

If sequence is 0 the time of the last vblank will be immediately returned, if it's above zero that number of vblanks will pass before the function returns.

Parameters

  output |
  sequence |
  sec |
  usec |

Since
  1.20

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.

## ◆ ecore_drm2_output_pending_get()

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

Check if there's a pageflip in progress for an output.

Checks whether an output has submit a flip but not yet had a callback completion event for that flip yet.

Parameters

  output |

Returns
  Whether there's a flip in progress or not

Since
  1.20

References EINA_FALSE, EINA_SAFETY_ON_NULL_RETURN_VAL, and EINA_TRUE.