Miscellaneous optimization on HWC
BZ: 97852
1) new lockDataBuffer and unlockDataBuffer to avoid frequent memory allocation and de-allocation
2) move hotplug control and vsync control to HotplugEventObserver and VsyncEventObserver to make them self-contained
3) new event queue to handle hotplug event, video event and phone event
4) dynamic vsync source management can be easily disabled or enabled. (disabling it will cause UI hang)
5) eliminate using of "goto" design
6) make destructor virtual, not necessary for derived class but is a common practice
7) disable overlay use when video playback starts, to avoid potential scrambled RGB overlay
8) vsync status is committed only when it is scussefully enabled or disabled
9) fix memory leak (DataBuffer allocated but not released)
10) many other small improvements
Change-Id: I43eeb5c4ea4f991c5d68de14d4fe73ea4a55bb4c
Signed-off-by: Andy Qiu <junhai.qiu@intel.com>
Reviewed-on: http://android.intel.com:8080/113693
Tested-by: Patel, Hitesh K <hitesh.k.patel@intel.com>
Reviewed-by: Patel, Hitesh K <hitesh.k.patel@intel.com>
Reviewed-by: buildbot <buildbot@intel.com>
Tested-by: buildbot <buildbot@intel.com>
diff --git a/include/VirtualDevice.h b/include/VirtualDevice.h
index 5c0e295..6f47a86 100644
--- a/include/VirtualDevice.h
+++ b/include/VirtualDevice.h
@@ -45,7 +45,6 @@
CachedBuffer(BufferManager *mgr, buffer_handle_t handle);
~CachedBuffer();
BufferManager *manager;
- DataBuffer *buffer;
BufferMapper *mapper;
};
struct Configuration {
@@ -82,8 +81,8 @@
virtual bool commit(hwc_display_contents_1_t *display,
IDisplayContext *context);
- virtual bool vsyncControl(int enabled);
- virtual bool blank(int blank);
+ virtual bool vsyncControl(bool enabled);
+ virtual bool blank(bool blank);
virtual bool getDisplayConfigs(uint32_t *configs,
size_t *numConfigs);
virtual bool getDisplayAttributes(uint32_t config,