display: Change setter for attribute SET_CURRENT_STATE 80/297380/4
authorYoungjae Cho <y0.cho@samsung.com>
Thu, 17 Aug 2023 10:37:59 +0000 (19:37 +0900)
committerChanwoo Choi <cw00.choi@samsung.com>
Fri, 18 Aug 2023 01:23:03 +0000 (01:23 +0000)
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 <y0.cho@samsung.com>
src/display/resource-display.c

index 3fd2d3d..54d97c6 100644 (file)
@@ -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;