ecore-drm: Add API function to set output gamma

Summary: This commit adds new API for setting gamma of an Ecore_Drm_Output

@feature

Signed-off-by: Chris Michael <cp.michael@samsung.com>
This commit is contained in:
Chris Michael 2015-04-07 12:24:07 -04:00 committed by Stefan Schmidt
parent f3edc3b20e
commit 0885834b68
2 changed files with 28 additions and 0 deletions

View File

@ -331,6 +331,22 @@ EAPI Eina_Stringshare *ecore_drm_output_make_get(Ecore_Drm_Output *output);
*/
EAPI void ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level);
/**
* Set the gamma level of an Ecore_Drm_Output
*
* This function will set the gamma of an Ecore_Drm_Output
*
* @param output The Ecore_Drm_Output to set the gamma level on
* @param size The gamma table size to set
* @param r The amount to scale the red channel
* @param g The amount to scale the green channel
* @param b The amount to scale the blue channel
*
* @ingroup Ecore_Drm_Output_Group
* @since 1.15
*/
EAPI void ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b);
/**
* Get the pointer position of Ecore_Drm_Device
*

View File

@ -1089,3 +1089,15 @@ ecore_drm_output_dpms_set(Ecore_Drm_Output *output, int level)
drmModeConnectorSetProperty(output->dev->drm.fd, output->conn_id,
output->dpms->prop_id, level);
}
EAPI void
ecore_drm_output_gamma_set(Ecore_Drm_Output *output, uint16_t size, uint16_t *r, uint16_t *g, uint16_t *b)
{
EINA_SAFETY_ON_NULL_RETURN(output);
EINA_SAFETY_ON_NULL_RETURN(output->crtc);
if (output->gamma != size) return;
if (drmModeCrtcSetGamma(output->dev->drm.fd, output->crtc_id, size, r, g, b))
ERR("Failed to set output gamma: %m");
}