display: Add exclusive dim timeout 66/309866/7 accepted/tizen/7.0/unified/20240419.171523
authorYoungjae Cho <y0.cho@samsung.com>
Wed, 17 Apr 2024 12:03:55 +0000 (21:03 +0900)
committerYoungjae Cho <y0.cho@samsung.com>
Thu, 18 Apr 2024 04:48:52 +0000 (13:48 +0900)
commitf16df4622da85f31521b837e272fd1216835b0d9
tree1f1887eec7cc802358616cc8b8851aad37287581
parent62ab1583c56aa292884b44535b3fd8212fcc5ed4
display: Add exclusive dim timeout

Timeout for dim had always been derived from screen timeout in a ratio
LCD_DIM_TIMEOUT, which is 30% of total screen timeout, naturally in
turn, the remaining 70% is given to normal timeout.

Introduced a new timeout, exclusive dim timeout, that fixes dim timeout
by itself. It is -1 by default, meaning disabled. If it is nonnegative
value, dim timeout is fixed to the value regardless of the screen timeout.
In such case, as dim timeout doesn't share screen timeout, normal timeout
consumes the entire screen timeout as a result.

The exclusive dim timeout is controlled by vconf 'db/setting/timeout_dim'
and it takes time in second.

For example,
 1. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = -1
     => Normal(10.5s) + Dim(4.5s)
    : Work as before. The screen timeout is splitted into 7:3,
      normal state consumes 10.5s and dim state 4.5s.

 2. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = 5
     => Normal(15s) + Dim(5s)
    : The exclusive dim timeout is 5s. The screen timeout, 15s, is not
      given to dim state. Therefore normal state solely consumes the
      entire 15s. After consuming up its 15s, it changes state to dim
      and the dim starts consuming its exclusive timeout, 5s.

 3. db/setting/lcd_backlight_normal = 15
    db/setting/timeout_dim = 0
     => Normal(15s) + Dim(0s)
    : Same as above except that the exclusive dim timeout is 0s.
      It effectively skips dim state.

Change-Id: Id345c7a8cae21c3dd56208185109ee738dccd909
Signed-off-by: Youngjae Cho <y0.cho@samsung.com>
plugins/iot-headed/display/core.c
plugins/mobile/display/core.c
plugins/tv/display/core.c
plugins/wearable/display/core.c
src/display/setting.c
src/display/setting.h