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/core/layer_buffer.h b/displayengine/include/core/layer_buffer.h
index e6dcf1c..421ab87 100644
--- a/displayengine/include/core/layer_buffer.h
+++ b/displayengine/include/core/layer_buffer.h
@@ -106,7 +106,8 @@
struct LayerBufferFlags {
uint64_t secure : 1; //!< This flag shall be set by client to indicate that the buffer need
//!< to be handled securely.
-
+ uint64_t video : 1; //!< This flag shall be set by client to indicate that the buffer is
+ //!< video/ui buffer
LayerBufferFlags() : secure(0) { }
};
diff --git a/displayengine/include/core/layer_stack.h b/displayengine/include/core/layer_stack.h
index fddfa8e..e361ac7 100644
--- a/displayengine/include/core/layer_stack.h
+++ b/displayengine/include/core/layer_stack.h
@@ -93,10 +93,13 @@
@sa LayerBuffer
*/
struct LayerFlags {
- uint64_t skip : 1; //!< This flag shall be set by client to indicate that this layer will be
- //!< handled by GPU. Device Device will not consider it for composition.
-
- LayerFlags() : skip(0) { }
+ uint64_t skip : 1; //!< This flag shall be set by client to indicate that this layer will be
+ //!< handled by GPU. Display Device will not consider it for composition.
+ uint64_t updating : 1; //!< This flag shall be set by client to indicate that this is updating/
+ //!< non-updating. so strategy manager will mark them for SDE/GPU
+ //!< composition respectively when the layer stack qualifies for cache
+ //!< based composition.
+ LayerFlags() : skip(0), updating(0) { }
};
/*! @brief This structure defines flags associated with a layer stack. The 1-bit flag can be set to
diff --git a/displayengine/include/private/strategy_interface.h b/displayengine/include/private/strategy_interface.h
index 7050929..f14fbfb 100644
--- a/displayengine/include/private/strategy_interface.h
+++ b/displayengine/include/private/strategy_interface.h
@@ -75,11 +75,13 @@
@sa GetNextStrategy
*/
struct StrategyConstraints {
- bool gpu_only; //!< Select GPU only composition for this layer stack.
+ bool safe_mode; //!< In this mode, strategy manager chooses the composition strategy
+ //!< that requires minimum number of pipe for the current frame. i.e.,
+ //!< video only composition, secure only composition or GPU composition
uint32_t max_layers; //!< Maximum number of layers that shall be programmed on hardware for the
//!< given layer stack.
- StrategyConstraints() : gpu_only(false), max_layers(kNumLayersMax) { }
+ StrategyConstraints() : safe_mode(false), max_layers(kNumLayersMax) { }
};
/*! @brief Flag to denote that GPU composition is performed for the given layer stack.
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;
diff --git a/displayengine/include/utils/debug.h b/displayengine/include/utils/debug.h
index 10d5ea6..0691dfc 100644
--- a/displayengine/include/utils/debug.h
+++ b/displayengine/include/utils/debug.h
@@ -46,9 +46,9 @@
namespace sde {
enum LogTag {
- kTagNone = 0, //!< Log tag name is not specified.
- kTagCore, //!< Log is tagged for display core.
- kTagStrategy, //!< Log is tagged for composition strategy.
+ kTagNone = 0, // Log tag name is not specified.
+ kTagCore, // Log is tagged for display core.
+ kTagStrategy, // Log is tagged for composition strategy.
};
class Debug {