forked from enlightenment/efl
ecore-drm: Add API function to return an output crtc buffer id
Summary: This adds an API function to return an output's crtc buffer id @feature Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
parent
e11be98ed0
commit
63ff8eaf3d
|
@ -505,6 +505,20 @@ EAPI void ecore_drm_output_size_get(Ecore_Drm_Device *dev, int output, int *w, i
|
|||
*/
|
||||
EAPI void ecore_drm_outputs_geometry_get(Ecore_Drm_Device *dev, int *x, int *y, int *w, int *h);
|
||||
|
||||
/**
|
||||
* Get the crtc buffer of an output
|
||||
*
|
||||
* This function will return the default buffer id for an output
|
||||
*
|
||||
* @param output The Ecore_Drm_Output to get the default buffer of
|
||||
*
|
||||
* @return The id of the default buffer for this output
|
||||
*
|
||||
* @ingroup Ecore_Drm_Output_Group
|
||||
* @since 1.15
|
||||
*/
|
||||
EAPI unsigned int ecore_drm_output_crtc_buffer_get(Ecore_Drm_Output *output);
|
||||
|
||||
/* TODO: Doxy */
|
||||
EAPI Eina_Bool ecore_drm_inputs_create(Ecore_Drm_Device *dev);
|
||||
EAPI void ecore_drm_inputs_destroy(Ecore_Drm_Device *dev);
|
||||
|
|
|
@ -1054,3 +1054,21 @@ ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, uint16_t *r,
|
|||
if (drmModeCrtcSetGamma(output->dev->drm.fd, output->crtc_id, size, r, g, b))
|
||||
ERR("Failed to set output gamma: %m");
|
||||
}
|
||||
|
||||
EAPI unsigned int
|
||||
ecore_drm_output_crtc_buffer_get(Ecore_Drm_Output *output)
|
||||
{
|
||||
drmModeCrtc *crtc;
|
||||
unsigned int id = 0;
|
||||
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(output, 0);
|
||||
EINA_SAFETY_ON_NULL_RETURN_VAL(output->crtc, 0);
|
||||
|
||||
if (!(crtc = drmModeGetCrtc(output->dev->drm.fd, output->crtc_id)))
|
||||
return 0;
|
||||
|
||||
id = crtc->buffer_id;
|
||||
drmModeFreeCrtc(crtc);
|
||||
|
||||
return id;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue