sde: Transition to safe mode in case of resource failures

1. No Pipe resources available for any display, move to safe mode
   composition for all displays, so that strategy manager selects
   the composition mode which requires optimal resource.
2. Move back to normal mode once all the displays are configured
   successfully with the resources for the current drawcycle.

Change-Id: Ic66d893a6ba50eb88cf8c70dae4df3772d47e1a0
diff --git a/displayengine/include/utils/constants.h b/displayengine/include/utils/constants.h
index 4b18ed6..7d7a39c 100644
--- a/displayengine/include/utils/constants.h
+++ b/displayengine/include/utils/constants.h
@@ -43,6 +43,9 @@
 
 #define ROUND_UP(number, step) ((((number) + ((step) - 1)) / (step)) * (step))
 
+#define SET_BIT(value, bit) ((value) | (1 << (bit)))
+#define CLEAR_BIT(value, bit) ((value) & (~(1 << (bit))))
+
 namespace sde {
 
   const int kThreadPriorityUrgent = -9;