OSDN Git Service

configstore: add startGraphicsAllocatorService
authorChia-I Wu <olv@google.com>
Tue, 11 Apr 2017 22:17:24 +0000 (15:17 -0700)
committerChia-I Wu <olv@google.com>
Wed, 12 Apr 2017 03:57:26 +0000 (20:57 -0700)
Add ISurfaceFlingerConfigs::startGraphicsAllocatorService to control
whether SurfaceFlinger should start IAllocator service.

Bug: 36462585
Test: boots
Change-Id: I421413673246cc7c552bc9eeeb7a9ce2783faf9e

configstore/1.0/ISurfaceFlingerConfigs.hal
configstore/1.0/default/SurfaceFlingerConfigs.cpp
configstore/1.0/default/SurfaceFlingerConfigs.h
configstore/1.0/default/surfaceflinger.mk

index dcc9bbb..5f975bd 100644 (file)
@@ -108,4 +108,10 @@ interface ISurfaceFlingerConfigs {
      * FramebufferSurface.
      */
     maxFrameBufferAcquiredBuffers() generates(OptionalInt64 value);
+
+    /**
+     * Returns true if surface flinger should start
+     * hardware.graphics.allocator@2.0::IAllocator service.
+     */
+    startGraphicsAllocatorService() generates(OptionalBool value);
 };
index 70bd803..9c134ef 100644 (file)
@@ -112,6 +112,16 @@ Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
     return Void();
 }
 
+Return<void> SurfaceFlingerConfigs::startGraphicsAllocatorService(
+    startGraphicsAllocatorService_cb _hidl_cb) {
+    bool value = false;
+#ifdef START_GRAPHICS_ALLOCATOR_SERVICE
+    value = true;
+#endif
+    _hidl_cb({true, value});
+    return Void();
+}
+
 }  // namespace implementation
 }  // namespace V1_0
 }  // namespace configstore
index 9300511..17a424e 100644 (file)
@@ -35,6 +35,8 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
     Return<void> hasSyncFramework(hasSyncFramework_cb _hidl_cb) override;
     Return<void> useVrFlinger(useVrFlinger_cb _hidl_cb) override;
     Return<void> maxFrameBufferAcquiredBuffers(maxFrameBufferAcquiredBuffers_cb _hidl_cb) override;
+    Return<void> startGraphicsAllocatorService(
+        startGraphicsAllocatorService_cb _hidl_cb) override;
 
     // Methods from ::android::hidl::base::V1_0::IBase follow.
 
index 9e3d4d4..3ce768a 100644 (file)
@@ -50,3 +50,7 @@ endif
 ifneq ($(NUM_FRAMEBUFFER_SURFACE_BUFFERS),)
     LOCAL_CFLAGS += -DNUM_FRAMEBUFFER_SURFACE_BUFFERS=$(NUM_FRAMEBUFFER_SURFACE_BUFFERS)
 endif
+
+ifneq ($(SF_START_GRAPHICS_ALLOCATOR_SERVICE),)
+    LOCAL_CFLAGS += -DSTART_GRAPHICS_ALLOCATOR_SERVICE
+endif