[SurfaceFlinger] Refine expensive rendering trigger.
Previously we turned on expensive rendering when color mode is DISPLAY_P3
because wide color gamut implies V0_SCRGB dataspace with FP16 pixel format,
which can't be handled by hardware composer and it's also very expensive in GPU
composition. Now that DISPLAY_P3 color mode doesn't have this implication, we
should move the code to only trigger it if we hit GPU composition in DISPLAY_P3
color mode.
BUG: 114226412
Test: Build, flash and boot.
Test: Verify by modifying WCG to scRGB and checking GPU frequency.
Change-Id: Ia3d3c14574e9ac628497d2f9733e6dd84a2ed01d
diff --git a/services/surfaceflinger/DisplayHardware/PowerAdvisor.h b/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
index 573a1a9..5aa1f22 100644
--- a/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
+++ b/services/surfaceflinger/DisplayHardware/PowerAdvisor.h
@@ -22,10 +22,12 @@
#undef HWC2_INCLUDE_STRINGIFICATION
#undef HWC2_USE_CPP11
+#include <unordered_set>
+
#include <android/hardware/power/1.3/IPower.h>
#include <utils/StrongPointer.h>
-#include <unordered_set>
+#include "DisplayIdentification.h"
namespace android {
namespace Hwc2 {
@@ -34,7 +36,7 @@
public:
virtual ~PowerAdvisor();
- virtual void setExpensiveRenderingExpected(hwc2_display_t displayId, bool expected) = 0;
+ virtual void setExpensiveRenderingExpected(DisplayId displayId, bool expected) = 0;
};
namespace impl {
@@ -48,12 +50,12 @@
PowerAdvisor();
~PowerAdvisor() override;
- void setExpensiveRenderingExpected(hwc2_display_t displayId, bool expected) override;
+ void setExpensiveRenderingExpected(DisplayId displayId, bool expected) override;
private:
sp<V1_3::IPower> getPowerHal();
- std::unordered_set<hwc2_display_t> mExpensiveDisplays;
+ std::unordered_set<DisplayId> mExpensiveDisplays;
bool mNotifiedExpensiveRendering = false;
bool mReconnectPowerHal = false;
};