To apply HAL ABI Versioning, existing interface file is devided.
Below is a description of the purpose of header files.
hal-device-display-types.h
-> Common data types like structures or enums used between the device-display
HAL-API and HAL-BACKEND
hal-device-display-interface-1.h
-> Declaration of functions to be implemented in the device-display HAL-BACKEND(Major version 1),
as well as definitions of data structures used between the HAL-API and HAL-BACKEND(Major version 1)
hal-device-display-interface.h
-> Includes the hal-device-display-interface-[major].h files for each supported
major version.
hal-device-display.h
-> Declaration of the device-display HAL-API functions
Change-Id: I1caecf577cea48d2bf9303e083b3fdf072469ecf
Signed-off-by: Yunhee Seo <yuni.seo@samsung.com>
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_DEVICE_DISPLAY_INTERFACE_1_H__
+#define __HAL_DEVICE_DISPLAY_INTERFACE_1_H__
+
+#include "hal-device-display-types.h"
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+typedef struct _hal_backend_device_display_funcs {
+ /* Control display brightness */
+ int (*get_max_brightness)(int *brightness);
+ int (*get_brightness)(int *brightness);
+ int (*set_brightness)(int brightness);
+ int (*set_multi_brightness)(int brightness, int step, int delay);
+
+ /* Control display brightness by sensor */
+ int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
+
+ /* Control display state */
+ int (*get_state)(enum display_state *state);
+ int (*set_state)(enum display_state state);
+
+ /* Control image effect */
+ int (*get_image_effect)(enum display_image_effect *effect);
+ int (*set_image_effect)(enum display_image_effect effect);
+
+ /* Control panel mode */
+ int (*get_panel_mode)(enum display_panel_mode *mode);
+ int (*set_panel_mode)(enum display_panel_mode mode);
+
+ /* Control AOD mode */
+ int (*get_aod_mode)(enum display_aod_mode *mode);
+
+ /* Control AOD brightness */
+ int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
+
+ /* Control display frame rate */
+ int (*get_max_frame_rate)(int *rate);
+ int (*get_min_frame_rate)(int *rate);
+ int (*get_frame_rate)(int *rate);
+ int (*set_frame_rate)(int rate);
+
+ /* Control display white balance */
+ int (*set_white_balance)(enum hal_display_white_balance, int value);
+ int (*get_white_balance)(enum hal_display_white_balance, int *value);
+
+ /* Control display rotation angle */
+ int (*get_rotation_angle)(int display_index, enum hal_device_display_rotation_angle *angle);
+ int (*set_rotation_angle)(int display_index, enum hal_device_display_rotation_angle angle,
+ enum hal_device_display_rotation_direction direction);
+} hal_backend_device_display_funcs;
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DISPLAY_INTERFACE_1_H__ */
*/
-#ifndef __HAL_DEVICE_DISPLAY_INTERFACE__
-#define __HAL_DEVICE_DISPLAY_INTERFACE__
+#ifndef __HAL_DEVICE_DISPLAY_INTERFACE_H__
+#define __HAL_DEVICE_DISPLAY_INTERFACE_H__
-#ifdef __cplusplus
-extern "C" {
-#endif
+#include "hal-device-display-types.h"
+#include "hal-device-display-interface-1.h"
-enum display_state {
- DISPLAY_ON, /* In use */
- DISPLAY_STANDBY, /* Blanked, low power */
- DISPLAY_SUSPEND, /* Blanked, lower power */
- DISPLAY_OFF, /* Shut off, awaiting activity */
- DISPLAY_DETACH, /* Detached display at runtime */
-};
-
-enum display_image_effect {
- DISPLAY_IMAGE_EFFECT_STANDARD, /* No effect */
- DISPLAY_IMAGE_EFFECT_NEGATIVE, /* Negative effect */
- DISPLAY_IMAGE_EFFECT_GREY, /* Grey effect */
- DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE, /* Grey Negative effect */
- DISPLAY_IMAGE_EFFECT_MAX,
-};
-
-enum display_panel_mode {
- DISPLAY_PANEL_MODE_STANDARD, /* Standard mode */
- DISPLAY_PANEL_MODE_OUTDOOR, /* Outdoor mode */
- DISPLAY_PANEL_MODE_CONTENTS, /* Contents adaptive brightness control mode */
- DISPLAY_PANEL_MODE_LOWPOWER, /* Low power mode */
-};
-
-enum display_aod_mode {
- DISPLAY_AOD_MODE_OFF,
- DISPLAY_AOD_MODE_ON,
-};
-
-enum hal_display_white_balance {
- HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
- HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
- HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
- HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
-};
-
-enum hal_device_display_rotation_angle {
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
- HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
-};
-
-enum hal_device_display_rotation_direction {
- HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
- HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
-};
-
-typedef struct _hal_backend_device_display_funcs {
- /* Control display brightness */
- int (*get_max_brightness)(int *brightness);
- int (*get_brightness)(int *brightness);
- int (*set_brightness)(int brightness);
- int (*set_multi_brightness)(int brightness, int step, int delay);
-
- /* Control display brightness by sensor */
- int (*get_auto_brightness)(float lmax, float lmin, float light, int *brightness);
-
- /* Control display state */
- int (*get_state)(enum display_state *state);
- int (*set_state)(enum display_state state);
-
- /* Control image effect */
- int (*get_image_effect)(enum display_image_effect *effect);
- int (*set_image_effect)(enum display_image_effect effect);
-
- /* Control panel mode */
- int (*get_panel_mode)(enum display_panel_mode *mode);
- int (*set_panel_mode)(enum display_panel_mode mode);
-
- /* Control AOD mode */
- int (*get_aod_mode)(enum display_aod_mode *mode);
-
- /* Control AOD brightness */
- int (*get_aod_brightness)(int *max, int *normal, int *min, int *charging);
-
- /* Control display frame rate */
- int (*get_max_frame_rate)(int *rate);
- int (*get_min_frame_rate)(int *rate);
- int (*get_frame_rate)(int *rate);
- int (*set_frame_rate)(int rate);
-
- /* Control display white balance */
- int (*set_white_balance)(enum hal_display_white_balance, int value);
- int (*get_white_balance)(enum hal_display_white_balance, int *value);
-
- /* Control display rotation angle */
- int (*get_rotation_angle)(int display_index, enum hal_device_display_rotation_angle *angle);
- int (*set_rotation_angle)(int display_index, enum hal_device_display_rotation_angle angle, enum hal_device_display_rotation_direction direction);
-} hal_backend_device_display_funcs;
-
-#ifdef __cplusplus
-}
-#endif
-#endif /* __HAL_DEVICE_DISPLAY_INTERFACE__ */
+#endif /* __HAL_DEVICE_DISPLAY_INTERFACE_H__ */
--- /dev/null
+/*
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd All Rights Reserved
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef __HAL_DEVICE_DISPLAY_TYPES_H__
+#define __HAL_DEVICE_DISPLAY_TYPES_H__
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+enum display_state {
+ DISPLAY_ON, /* In use */
+ DISPLAY_STANDBY, /* Blanked, low power */
+ DISPLAY_SUSPEND, /* Blanked, lower power */
+ DISPLAY_OFF, /* Shut off, awaiting activity */
+ DISPLAY_DETACH, /* Detached display at runtime */
+};
+
+enum display_image_effect {
+ DISPLAY_IMAGE_EFFECT_STANDARD, /* No effect */
+ DISPLAY_IMAGE_EFFECT_NEGATIVE, /* Negative effect */
+ DISPLAY_IMAGE_EFFECT_GREY, /* Grey effect */
+ DISPLAY_IMAGE_EFFECT_GREY_NEGATIVE, /* Grey Negative effect */
+ DISPLAY_IMAGE_EFFECT_MAX,
+};
+
+enum display_panel_mode {
+ DISPLAY_PANEL_MODE_STANDARD, /* Standard mode */
+ DISPLAY_PANEL_MODE_OUTDOOR, /* Outdoor mode */
+ DISPLAY_PANEL_MODE_CONTENTS, /* Contents adaptive brightness control mode */
+ DISPLAY_PANEL_MODE_LOWPOWER, /* Low power mode */
+};
+
+enum display_aod_mode {
+ DISPLAY_AOD_MODE_OFF,
+ DISPLAY_AOD_MODE_ON,
+};
+
+enum hal_display_white_balance {
+ HAL_DISPLAY_WHITE_BALANCE_R_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_G_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_B_GAIN,
+ HAL_DISPLAY_WHITE_BALANCE_R_OFFSET,
+ HAL_DISPLAY_WHITE_BALANCE_G_OFFSET,
+ HAL_DISPLAY_WHITE_BALANCE_B_OFFSET,
+};
+
+enum hal_device_display_rotation_angle {
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN = -1,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 = 0,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 = 90,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 = 180,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 = 270,
+};
+
+enum hal_device_display_rotation_direction {
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
+};
+
+#ifdef __cplusplus
+}
+#endif
+#endif /* __HAL_DEVICE_DISPLAY_TYPES_H__ */