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

Commit 38295e77 authored by Fabien Sanglard's avatar Fabien Sanglard
Browse files

Create forceHwcCopyForVirtualDisplay in configStore

Change-Id: I69ff735a0263cb19d8208867943329357be49d4a
parent caae0cc6
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
@@ -76,4 +76,12 @@ interface ISurfaceFlingerConfigs {
     * present fences.
     */
    presentTimeOffsetFromVSyncNs() generates(OptionalInt64 value);

    /*
     * Some hardware can do RGB->YUV conversion more efficiently in hardware
     * controlled by HWC than in hardware controlled by the video encoder.
     * This instruct VirtualDisplaySurface to use HWC for such conversion on
     * GL composition.
     */
    useHwcForRGBtoYUV() generates(OptionalBool value);
};
+10 −1
Original line number Diff line number Diff line
@@ -79,8 +79,17 @@ Return<void> SurfaceFlingerConfigs::presentTimeOffsetFromVSyncNs(presentTimeOffs
      return Void();
}

// Methods from ::android::hidl::base::V1_0::IBase follow.
Return<void> SurfaceFlingerConfigs::useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) {
    bool value = false;
#ifdef FORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
    value = true;
#endif
    _hidl_cb({true, value});
    LOG(INFO) << "SurfaceFlinger forceHwcForRGBtoYUV: " << value;
    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
@@ -31,6 +31,7 @@ struct SurfaceFlingerConfigs : public ISurfaceFlingerConfigs {
    Return<void> hasWideColorDisplay(hasWideColorDisplay_cb _hidl_cb) override;
    Return<void> hasHDRDisplay(hasHDRDisplay_cb _hidl_cb) override;
    Return<void> presentTimeOffsetFromVSyncNs(presentTimeOffsetFromVSyncNs_cb _hidl_cb) override;
    Return<void> useHwcForRGBtoYUV(useHwcForRGBtoYUV_cb _hidl_cb) override;

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

+4 −0
Original line number Diff line number Diff line
@@ -34,3 +34,7 @@ ifneq ($(PRESENT_TIME_OFFSET_FROM_VSYNC_NS),)
else
    LOCAL_CFLAGS += -DPRESENT_TIME_OFFSET_FROM_VSYNC_NS=0
endif

ifeq ($(TARGET_FORCE_HWC_FOR_VIRTUAL_DISPLAYS),true)
    LOCAL_CFLAGS += -DFORCE_HWC_COPY_FOR_VIRTUAL_DISPLAYS
endif