surfaceflinger: do not check HWC2::Capability::SkipValidate
HWC2::Capability::SkipValidate is not defined in HIDL. We cannot
check against it.
Besides, presentOrValidate is equivalent to validate in HIDL when
the underlying hwcomposer2 implementation does not support the cap.
There is not need to check against it.
Bug: 70407085
Test: boots
Change-Id: Ib0c11e99ce3389ad555605de18e194d9b51b2bc0
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
index b096a3a..a16c040 100644
--- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp
+++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp
@@ -444,10 +444,16 @@
HWC2::Error error = HWC2::Error::None;
- // First try to skip validate altogether if the HWC supports it.
+ // First try to skip validate altogether when there is no client
+ // composition. When there is client composition, since we haven't
+ // rendered to the client target yet, we should not attempt to skip
+ // validate.
+ //
+ // displayData.hasClientComposition hasn't been updated for this frame.
+ // The check below is incorrect. We actually rely on HWC here to fall
+ // back to validate when there is any client layer.
displayData.validateWasSkipped = false;
- if (hasCapability(HWC2::Capability::SkipValidate) &&
- !displayData.hasClientComposition) {
+ if (!displayData.hasClientComposition) {
sp<android::Fence> outPresentFence;
uint32_t state = UINT32_MAX;
error = hwcDisplay->presentOrValidate(&numTypes, &numRequests, &outPresentFence , &state);