Remove and redefine panel mode getter/setter.
These functions are added below display-panel.
int display_panel_set_panel_mode(enum display_panel_mode mode);
int display_panel_get_panel_mode(enum display_panel_mode *mode);
-> With display_panel_mode enum type, it is possible to get and set panel mode type.
Change-Id: Ideb2a6867e79ae7f9e7a51cb6386edcc32244cf4
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
return 0;
}
-static int get_panel_mode(enum display_panel_mode *mode)
-{
- int ret;
- enum display_panel_mode val;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_get_panel_mode(&val);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Get panel mode is not supported.");
- else
- _E("Failed to get panel mode(%d)", ret);
-
- return ret;
- }
-
- *mode = val;
-
- return 0;
-}
-
-static int set_panel_mode(enum display_panel_mode mode)
-{
- int ret;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_set_panel_mode(mode);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Set panel mode is not supported.");
- else
- _E("Failed to set panel mode(%d)", ret);
-
- return ret;
- }
-
- return 0;
-}
-
static int get_frame_rate(int *rate)
{
if (!rate)
.get_brightness = get_brightness,
.restore_brightness_func = restore_brightness_func,
.get_brightness_by_light_sensor = get_brightness_by_light_sensor,
- .get_panel_mode = get_panel_mode,
- .set_panel_mode = set_panel_mode,
.get_frame_rate = get_frame_rate,
.set_frame_rate = set_frame_rate,
.transit_state = backlight_transit_state,
return 0;
}
-static int get_panel_mode(enum display_panel_mode *mode)
-{
- int ret;
- enum display_panel_mode val;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_get_panel_mode(&val);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Get panel mode is not supported.");
- else
- _E("Failed to get panel mode(%d)", ret);
-
- return ret;
- }
-
- *mode = val;
-
- return 0;
-}
-
-static int set_panel_mode(enum display_panel_mode mode)
-{
- int ret;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_set_panel_mode(mode);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Set panel mode is not supported.");
- else
- _E("Failed to set panel mode(%d)", ret);
-
- return ret;
- }
-
- return 0;
-}
-
static int get_frame_rate(int *rate)
{
if (!rate)
.get_brightness = get_brightness,
.restore_brightness_func = restore_brightness_func,
.get_brightness_by_light_sensor = get_brightness_by_light_sensor,
- .get_panel_mode = get_panel_mode,
- .set_panel_mode = set_panel_mode,
.get_frame_rate = get_frame_rate,
.set_frame_rate = set_frame_rate,
.transit_state = backlight_transit_state,
return 0;
}
-static int get_panel_mode(enum display_panel_mode *mode)
-{
- int ret;
- enum display_panel_mode val;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_get_panel_mode(&val);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Get panel mode is not supported.");
- else
- _E("Failed to get panel mode(%d)", ret);
-
- return ret;
- }
-
- *mode = val;
-
- return 0;
-}
-
-static int set_panel_mode(enum display_panel_mode mode)
-{
- int ret;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_set_panel_mode(mode);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Set panel mode is not supported.");
- else
- _E("Failed to set panel mode(%d)", ret);
-
- return ret;
- }
-
- return 0;
-}
-
static int get_frame_rate(int *rate)
{
if (!rate)
.get_brightness = get_brightness,
.restore_brightness_func = restore_brightness_func,
.get_brightness_by_light_sensor = get_brightness_by_light_sensor,
- .get_panel_mode = get_panel_mode,
- .set_panel_mode = set_panel_mode,
.get_frame_rate = get_frame_rate,
.set_frame_rate = set_frame_rate,
.transit_state = backlight_transit_state,
return 0;
}
-static int get_panel_mode(enum display_panel_mode *mode)
-{
- int ret;
- enum display_panel_mode val;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_get_panel_mode(&val);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Get panel mode is not supported.");
- else
- _E("Failed to get panel mode(%d)", ret);
-
- return ret;
- }
-
- *mode = val;
-
- return 0;
-}
-
-static int set_panel_mode(enum display_panel_mode mode)
-{
- int ret;
-
- if (!display_dev_available) {
- _E("There is no display device.");
- return -ENOENT;
- }
-
- ret = hal_device_display_set_panel_mode(mode);
- if (ret < 0) {
- if (ret == -ENODEV)
- _E("Set panel mode is not supported.");
- else
- _E("Failed to set panel mode(%d)", ret);
-
- return ret;
- }
-
- return 0;
-}
-
static int get_frame_rate(int *rate)
{
if (!rate)
.get_brightness = get_brightness,
.restore_brightness_func = restore_brightness_func,
.get_brightness_by_light_sensor = get_brightness_by_light_sensor,
- .get_panel_mode = get_panel_mode,
- .set_panel_mode = set_panel_mode,
.get_frame_rate = get_frame_rate,
.set_frame_rate = set_frame_rate,
.transit_state = backlight_transit_state,
int (*get_brightness_raw)(int *val);
void (*restore_brightness_func)(void);
int (*get_brightness_by_light_sensor)(float lmax, float lmin, float light, int *brt);
- int (*get_panel_mode)(enum display_panel_mode *mode);
- int (*set_panel_mode)(enum display_panel_mode mode);
int (*get_frame_rate)(int *rate);
int (*set_frame_rate)(int rate);
int (*transit_state)(int state);
*effect = val;
return 0;
+}
+
+/* FIXME: This function is deprecated, should be fixed after plugin refactoring */
+int display_panel_set_panel_mode(enum display_panel_mode mode)
+{
+ int ret;
+
+ if (!display_is_hal_backend_available()) {
+ _E("There is no display device.");
+ return -ENOENT;
+ }
+
+ ret = hal_device_display_set_panel_mode(mode);
+ if (ret < 0) {
+ if (ret == -ENODEV)
+ _E("Set panel mode is not supported.");
+ else
+ _E("Failed to set panel mode(%d)", ret);
+ return ret;
+ }
+
+ return 0;
+}
+
+/* FIXME: This function is deprecated, should be fixed after plugin refactoring */
+int display_panel_get_panel_mode(enum display_panel_mode *mode)
+{
+ int ret;
+ enum display_panel_mode val;
+
+ if (!mode)
+ return -EINVAL;
+
+ if (!display_is_hal_backend_available()) {
+ _E("There is no display device.");
+ return -ENOENT;
+ }
+
+ ret = hal_device_display_get_panel_mode(&val);
+ if (ret < 0) {
+ if (ret == -ENODEV)
+ _E("Get panel mode is not supported.");
+ else
+ _E("Failed to get panel mode(%d)", ret);
+ return ret;
+ }
+
+ *mode = val;
+
+ return 0;
}
\ No newline at end of file
/* Deprecated functions */
int display_panel_set_image_effect(enum display_image_effect effect);
int display_panel_get_image_effect(enum display_image_effect *effect);
+int display_panel_set_panel_mode(enum display_panel_mode mode);
+int display_panel_get_panel_mode(enum display_panel_mode *mode);
#endif /* __DISPLAY_PANEL_H__ */
\ No newline at end of file