Create forceHwcCopyForVirtualDisplay in configStore

Change-Id: I69ff735a0263cb19d8208867943329357be49d4a
This commit is contained in:
Fabien Sanglard 2017-03-14 11:43:18 -07:00
parent caae0cc641
commit 38295e77b8
4 changed files with 23 additions and 1 deletions

View file

@ -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);
};

View file

@ -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();
}

View file

@ -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.

View file

@ -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