Skip to content

Commit

Permalink
[datapipe] Do not prefilter display state requests. Fixes JB#37393
Browse files Browse the repository at this point in the history
During ongoing transition we might already have aslo the next transition
queued. In situations like this, not running the request through the
datapipe might lead into leaving the display in incorrec state.

Still do the logging of display state requests that potentially power
up thed display in elevated priority, but do never skip the datapipe
execution that drives the lower level display state machine.

Signed-off-by: Simo Piiroinen <simo.piiroinen@jollamobile.com>
  • Loading branch information
spiiroin committed Jan 18, 2017
1 parent bd0ef6c commit 4c0f8f9
Showing 1 changed file with 12 additions and 11 deletions.
23 changes: 12 additions & 11 deletions datapipe.h
Expand Up @@ -244,8 +244,10 @@ void mce_datapipe_quit(void);
#define mce_datapipe_req_display_state(state_) do {\
display_state_t cur_target = datapipe_get_gint(display_state_next_pipe);\
display_state_t req_target = (display_state_t)(state_);\
/* Use elevated logginng verbosity for requests that \
* are likely to result in display power up. */ \
int level = LL_DEBUG; \
if( cur_target != req_target ) {\
int level = LL_DEBUG; \
switch( req_target ) {\
case MCE_DISPLAY_ON:\
case MCE_DISPLAY_LPM_ON:\
Expand All @@ -254,17 +256,16 @@ void mce_datapipe_quit(void);
default:\
break;\
}\
mce_log(level, "display state req: %s",\
display_state_repr(req_target));\
execute_datapipe(&display_state_req_pipe,\
GINT_TO_POINTER(req_target),\
USE_INDATA, CACHE_OUTDATA);\
}\
else {\
/* TODO: double check request handling and remove this logging */\
mce_log(LL_WARN, "ignoring display state req: %s",\
display_state_repr(req_target));\
}\
mce_log(level, "display state req: %s",\
display_state_repr(req_target));\
/* But the request must always be fed to the datapipe \
* because during already ongoing transition something \
* else might be already queued up and we want't the \
* last request to reach the queue to "win". */ \
execute_datapipe(&display_state_req_pipe,\
GINT_TO_POINTER(req_target),\
USE_INDATA, CACHE_OUTDATA);\
} while(0)

#endif /* _DATAPIPE_H_ */

0 comments on commit 4c0f8f9

Please sign in to comment.