[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/HWC2.h b/services/surfaceflinger/DisplayHardware/HWC2.h
index 70358a0..f96614f 100644
--- a/services/surfaceflinger/DisplayHardware/HWC2.h
+++ b/services/surfaceflinger/DisplayHardware/HWC2.h
@@ -37,8 +37,6 @@
#include <unordered_set>
#include <vector>
-#include "PowerAdvisor.h"
-
namespace android {
struct DisplayedFrameStats;
class Fence;
@@ -125,7 +123,6 @@
std::unique_ptr<android::Hwc2::Composer> mComposer;
std::unordered_set<Capability> mCapabilities;
std::unordered_map<hwc2_display_t, std::unique_ptr<Display>> mDisplays;
- android::Hwc2::impl::PowerAdvisor mPowerAdvisor;
bool mRegisteredCallback = false;
};
@@ -273,9 +270,8 @@
class Display : public HWC2::Display {
public:
- Display(android::Hwc2::Composer& composer, android::Hwc2::PowerAdvisor& advisor,
- const std::unordered_set<Capability>& capabilities, hwc2_display_t id,
- DisplayType type);
+ Display(android::Hwc2::Composer& composer, const std::unordered_set<Capability>& capabilities,
+ hwc2_display_t id, DisplayType type);
~Display() override;
// Required by HWC2
@@ -352,7 +348,6 @@
// this HWC2::Display, so these references are guaranteed to be valid for
// the lifetime of this object.
android::Hwc2::Composer& mComposer;
- android::Hwc2::PowerAdvisor& mPowerAdvisor;
const std::unordered_set<Capability>& mCapabilities;
hwc2_display_t mId;