Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit d78f6b34 authored by Steven Thomas's avatar Steven Thomas
Browse files

Add useVrFlinger() method to SurfaceFlinger ConfigStore

Add useVrFlinger() method to SurfaceFlinger ConfigStore, which is
used to ensure we only start vr flinger on Daydream ready devices.

Bug: 35885165

Test: Checked for "SurfaceFlinger UseVrFlinger" in the logs,
confirmed it only shows up for Daydream ready devices.

Change-Id: I3c39b1f094e28f06b510171fc0968cf71f5d5550
parent b902fd15
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -96,4 +96,12 @@ interface ISurfaceFlingerConfigs {
     * mechanism which significantly reduces buffer processing latency.
     */
    hasSyncFramework() generates(OptionalBool value);

    /*
     * Return true if surface flinger should use vr flinger for compatible vr
     * apps, false otherwise. Devices that will never be running vr apps should
     * return false to avoid extra resource usage. Daydream ready devices must
     * return true for full vr support.
     */
    useVrFlinger() generates (OptionalBool value);
};
+12 −0
Original line number Diff line number Diff line
@@ -111,6 +111,18 @@ Return<void> SurfaceFlingerConfigs::maxVirtualDisplaySize(maxVirtualDisplaySize_
  return Void();
}

Return<void> SurfaceFlingerConfigs::useVrFlinger(useVrFlinger_cb _hidl_cb) {
    bool value = false;
    bool specified = false;
#ifdef USE_VR_FLINGER
    value = true;
    specified = true;
#endif
    _hidl_cb({specified, value});
    LOG(INFO) << "SurfaceFlinger UseVrFlinger: " << (value ? "true" : "false");
    return Void();
}

// Methods from ::android::hidl::base::V1_0::IBase follow.
ISurfaceFlingerConfigs* HIDL_FETCH_ISurfaceFlingerConfigs(const char* /* name */) {
    return new SurfaceFlingerConfigs();
+1 −0
Original line number Diff line number Diff line
@@ -34,6 +34,7 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
    Return<void> useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) override;
    Return<void> maxVirtualDisplaySize(maxVirtualDisplaySize_cb _hidl_cb) override;
    Return<void> hasSyncFramework(hasSyncFramework_cb _hidl_cb) override;
    Return<void> useVrFlinger(useVrFlinger_cb _hidl_cb) override;

    // Methods from ::android::hidl::base::V1_0::IBase follow.

+4 −0
Original line number Diff line number Diff line
@@ -46,3 +46,7 @@ endif
ifeq ($(TARGET_RUNNING_WITHOUT_SYNC_FRAMEWORK),true)
    LOCAL_CFLAGS += -DRUNNING_WITHOUT_SYNC_FRAMEWORK
endif

ifneq ($(USE_VR_FLINGER),)
    LOCAL_CFLAGS += -DUSE_VR_FLINGER
endif