rotation angle means "physical display" angle.
Clients can rotate display or check current display angle.
API
-hal_device_display_get_rotation_angle
-hal_device_display_set_rotation_angle
enum
-hal_device_display_rotation_angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_UNKNOWN : It can be seen in laid device
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_0 : Initial display rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_90 : 90° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_180 : 180° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_270 : 270° rotation angle
HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_360 : 360° rotation angle
-hal_device_display_rotation_direction
HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE : Rotate clockwise direction
HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE : Rotate counter clockwise direction
Change-Id: I617f42466218a0a7f579c5d331a818e534cf173c
Signed-off-by: TaeminYeom <taemin.yeom@samsung.com>
Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com>
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,
+ HAL_DEVICE_DISPLAY_ROTATION_ANGLE_DEGREE_360 = 360,
+};
+
+enum hal_device_display_rotation_direction {
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_CLOCKWISE,
+ HAL_DEVICE_DISPLAY_ROTATION_DIRECTION_COUNTER_CLOCKWISE,
+};
+
typedef struct _hal_backend_display_funcs {
/* Control display brightness */
int (*get_max_brightness)(int *brightness);
/* 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_display_funcs;
#ifdef __cplusplus
int hal_device_display_set_frame_rate(int rate);
int hal_device_display_set_white_balance(enum hal_display_white_balance, int value);
int hal_device_display_get_white_balance(enum hal_display_white_balance, int* value);
+int hal_device_display_get_rotation_angle(int display_index, enum hal_device_display_rotation_angle *angle);
+int hal_device_display_set_rotation_angle(int display_index, enum hal_device_display_rotation_angle angle,
+ enum hal_device_display_rotation_direction direction);
#ifdef __cplusplus
}
return -ENODEV;
return hal_display_funcs->get_white_balance(white_balance_type, value);
-}
\ No newline at end of file
+}
+
+int hal_device_display_get_rotation_angle(int display_index, enum hal_device_display_rotation_angle *angle)
+{
+ int ret;
+
+ if (!hal_display_funcs && !hal_initialized) {
+ if ((ret = hal_device_display_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_display_funcs ||
+ !hal_display_funcs->get_rotation_angle)
+ return -ENODEV;
+
+ return hal_display_funcs->get_rotation_angle(display_index, angle);
+}
+
+int hal_device_display_set_rotation_angle(int display_index,
+ enum hal_device_display_rotation_angle angle,
+ enum hal_device_display_rotation_direction direction)
+{
+ int ret;
+
+ if (!hal_display_funcs && !hal_initialized) {
+ if ((ret = hal_device_display_get_backend()) < 0)
+ return ret;
+ }
+
+ if (!hal_display_funcs ||
+ !hal_display_funcs->set_rotation_angle)
+ return -ENODEV;
+
+ return hal_display_funcs->set_rotation_angle(display_index, angle, direction);
+}