forked from enlightenment/efl
ecore-drm: Added internal function to set output brightness level
Summary: Added _ecore_drm_output_brightness_set function to set brightness level Signed-off-by: vivek <vivek.ellur@samsung.com> Reviewers: devilhorns Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D1499
This commit is contained in:
parent
73bf20fe4e
commit
9b84f98e27
|
@ -296,6 +296,9 @@ _ecore_drm_output_brightness_get(Ecore_Drm_Backlight *backlight)
|
|||
const char *brightness = NULL;
|
||||
double ret;
|
||||
|
||||
if (!(backlight) || !(backlight->device))
|
||||
return 0;
|
||||
|
||||
brightness = eeze_udev_syspath_get_sysattr(backlight->device, "brightness");
|
||||
if (!brightness) return 0;
|
||||
|
||||
|
@ -312,6 +315,9 @@ _ecore_drm_output_actual_brightness_get(Ecore_Drm_Backlight *backlight)
|
|||
const char *brightness = NULL;
|
||||
double ret;
|
||||
|
||||
if (!(backlight) || !(backlight->device))
|
||||
return 0;
|
||||
|
||||
brightness = eeze_udev_syspath_get_sysattr(backlight->device, "actual_brightness");
|
||||
if (!brightness) return 0;
|
||||
|
||||
|
@ -328,6 +334,9 @@ _ecore_drm_output_max_brightness_get(Ecore_Drm_Backlight *backlight)
|
|||
const char *brightness = NULL;
|
||||
double ret;
|
||||
|
||||
if (!(backlight) || !(backlight->device))
|
||||
return 0;
|
||||
|
||||
brightness = eeze_udev_syspath_get_sysattr(backlight->device, "max_brightness");
|
||||
if (!brightness) return 0;
|
||||
|
||||
|
@ -338,6 +347,19 @@ _ecore_drm_output_max_brightness_get(Ecore_Drm_Backlight *backlight)
|
|||
return ret;
|
||||
}
|
||||
|
||||
static double
|
||||
_ecore_drm_output_brightness_set(Ecore_Drm_Backlight *backlight, double brightness_val)
|
||||
{
|
||||
Eina_Bool ret = EINA_FALSE;
|
||||
|
||||
if (!(backlight) || !(backlight->device))
|
||||
return ret;
|
||||
|
||||
ret = eeze_udev_syspath_set_sysattr(backlight->device, "brightness", brightness_val);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
static Ecore_Drm_Backlight *
|
||||
_ecore_drm_output_backlight_init(Ecore_Drm_Output *output EINA_UNUSED, uint32_t conn_type)
|
||||
{
|
||||
|
|
Loading…
Reference in New Issue