From 3bb6ca7925386cf626e2531be9c620bffe2ff9c5 Mon Sep 17 00:00:00 2001 From: Youngjae Cho Date: Thu, 17 Aug 2023 19:37:59 +0900 Subject: [PATCH] display: Change setter for attribute SET_CURRENT_STATE The operation of the display_state_set_current() is interfered by the existing operation display_state_transition_do_state_transition(). As both are accessing and modifying same underlying data, and they can be working at the same time, the data could be corrupted by each other during their operation. Therefore, use only one for set state. However, all of them should be fixed to display_state_set_current() eventually. Change-Id: I635eb5e8537302647d120ca4f6ef005f09dc1a07 Signed-off-by: Youngjae Cho --- src/display/resource-display.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/display/resource-display.c b/src/display/resource-display.c index 3fd2d3d..54d97c6 100644 --- a/src/display/resource-display.c +++ b/src/display/resource-display.c @@ -27,6 +27,7 @@ #include "shared/common.h" #include "display-state-transition.h" #include "display-backlight.h" +#include "device-interface.h" typedef union { int32_t i32; @@ -51,7 +52,13 @@ static int set_tuple2_display_attr_data(int resource_id, enum deviced_display_state state = *(enum deviced_display_state *) data1; enum deviced_event event = *(enum deviced_event *) data2; - return display_state_set_current(state, event); + /** + * FIXME: Need to change it to display_state_set_current() + */ + if (event == DEVICED_EVENT_DISPLAY_SCREEN_TIMEOUT) + return display_state_transition_do_state_transition(state, EVENT_TIMEOUT); + else + return display_state_transition_do_state_transition(state, EVENT_INPUT); } default: return -EINVAL; -- 2.7.4