summaryrefslogtreecommitdiff
path: root/sdm/include
diff options
context:
space:
mode:
authorSushil Chauhan <sushilchauhan@codeaurora.org>2018-05-02 14:02:27 -0700
committerSushil Chauhan <sushilchauhan@codeaurora.org>2018-05-04 14:24:03 -0700
commite1591472b9f413a88b87bcc4ea4972a1aeddbbf2 (patch)
tree3158cf02ce8a1e37d0a0e0fa900fbd2fbd1831c7 /sdm/include
parentfdb37a6befd589ff44aa230fb45d4213d4570812 (diff)
downloaddisplay-e1591472b9f413a88b87bcc4ea4972a1aeddbbf2.tar.gz
sdm: Avoid fb_id creation and removal in each frame
- Cache the <handle_id, fb_id> map in SDM layer. - Registry finds the handle_id in layer map. If it is found, then mapped fb_id is programmed to DRM driver. Else fb_id is created and it is added in map for the given handle_id key. This map is cleared and fb_ids are removed, when the SDM layer gets deleted. - "vendor.display.disable_fbid_cache" system prop needs to be set to disable the fb_id caching in SDM. So, fb_id will be removed and created for each SDM layer in every draw cycle. CRs-Fixed: 2235202 Change-Id: I1d6c7fbc1fc5c1f9afad36cf49f17bc8c5322fe5
Diffstat (limited to 'sdm/include')
-rw-r--r--sdm/include/core/buffer_allocator.h1
-rw-r--r--sdm/include/core/layer_buffer.h6
-rw-r--r--sdm/include/core/layer_stack.h6
3 files changed, 13 insertions, 0 deletions
diff --git a/sdm/include/core/buffer_allocator.h b/sdm/include/core/buffer_allocator.h
index 6d77bcde..6731b770 100644
--- a/sdm/include/core/buffer_allocator.h
+++ b/sdm/include/core/buffer_allocator.h
@@ -70,6 +70,7 @@ struct AllocatedBufferInfo {
uint32_t aligned_height = 0; //!< Specifies aligned allocated buffer height in pixels.
LayerBufferFormat format = kFormatInvalid; // Specifies buffer format for allocated buffer.
uint32_t size = 0; //!< Specifies the size of the allocated buffer.
+ uint64_t id = 0; //!< Specifies the Id of the allocated buffer.
};
/*! @brief Holds the information about the input/output configuration of an output buffer.
diff --git a/sdm/include/core/layer_buffer.h b/sdm/include/core/layer_buffer.h
index 649dda4a..28a7497b 100644
--- a/sdm/include/core/layer_buffer.h
+++ b/sdm/include/core/layer_buffer.h
@@ -278,6 +278,7 @@ struct LayerBuffer {
UbwcCrStatsVector ubwc_crstats[NUM_UBWC_CR_STATS_LAYERS] = {};
//! < UBWC Compression ratio,stats. Stored as a vector of pair of
//! of (tile size, #of tiles)
+ uint64_t handle_id = 0;
};
// This enum represents buffer layout types.
@@ -287,6 +288,11 @@ enum BufferLayout {
kTPTiled //!< Tightly Packed data
};
+class LayerBufferObject {
+public:
+ virtual ~LayerBufferObject() {};
+};
+
} // namespace sdm
#endif // __LAYER_BUFFER_H__
diff --git a/sdm/include/core/layer_stack.h b/sdm/include/core/layer_stack.h
index 3dd1c6f4..ae82bda3 100644
--- a/sdm/include/core/layer_stack.h
+++ b/sdm/include/core/layer_stack.h
@@ -36,6 +36,7 @@
#include <vector>
#include <utility>
+#include <unordered_map>
#include "layer_buffer.h"
#include "sdm_types.h"
@@ -304,6 +305,10 @@ struct LayerSolidFill {
uint32_t alpha = 0; //!< Alpha value
};
+struct LayerBufferMap {
+ std::unordered_map<uint64_t, std::shared_ptr<LayerBufferObject>> buffer_map;
+};
+
/*! @brief This structure defines display layer object which contains layer properties and a drawing
buffer.
@@ -376,6 +381,7 @@ struct Layer {
Lut3d lut_3d = {}; //!< o/p - Populated by SDM when tone mapping is
//!< needed on this layer.
LayerSolidFill solid_fill_info = {}; //!< solid fill info along with depth.
+ std::shared_ptr<LayerBufferMap> buffer_map = nullptr; //!< Map of handle_id and fb_id.
};
/*! @brief This structure defines a layer stack that contains layers which need to be composed and