diff options
| author | 2017-12-21 07:28:32 +0000 | |
|---|---|---|
| committer | 2017-12-21 07:28:32 +0000 | |
| commit | 45f9c3871b45a7b60c6895526a7d3df07d73efcd (patch) | |
| tree | 544739e561f00b6e6f7a1cf51706006ffc0cf701 | |
| parent | af24c0d24640df7dc1c422d8758d09bf80486ce6 (diff) | |
| parent | c770d27ff06873ccca5067c709e280270de2806a (diff) | |
Merge "surfaceflinger: do not check HWC2::Capability::SkipValidate"
am: c770d27ff0
Change-Id: I5f054808abb74bc7852621ba47e9ec6b8f516e44
5 files changed, 18 insertions, 6 deletions
diff --git a/services/surfaceflinger/DisplayHardware/HWComposer.cpp b/services/surfaceflinger/DisplayHardware/HWComposer.cpp index b096a3ae57..a16c040bc2 100644 --- a/services/surfaceflinger/DisplayHardware/HWComposer.cpp +++ b/services/surfaceflinger/DisplayHardware/HWComposer.cpp @@ -444,10 +444,16 @@ status_t HWComposer::prepare(DisplayDevice& displayDevice) { 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); diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp index 561db8dd0d..07b8cc0b0d 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.cpp @@ -157,6 +157,10 @@ FakeComposerClient::FakeComposerClient() FakeComposerClient::~FakeComposerClient() {} +bool FakeComposerClient::hasCapability(hwc2_capability_t /*capability*/) { + return false; +} + void FakeComposerClient::removeClient() { ALOGV("removeClient"); // TODO: Ahooga! Only thing current lifetime management choices in diff --git a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h index 294abb2c59..dd384c0829 100644 --- a/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h +++ b/services/surfaceflinger/tests/fakehwc/FakeComposerClient.h @@ -45,6 +45,8 @@ public: FakeComposerClient(); virtual ~FakeComposerClient(); + bool hasCapability(hwc2_capability_t capability) override; + void removeClient() override; void enableCallback(bool enable) override; uint32_t getMaxVirtualDisplayCount() override; diff --git a/services/vr/hardware_composer/impl/vr_hwc.cpp b/services/vr/hardware_composer/impl/vr_hwc.cpp index fd271d0fe2..d5664d5751 100644 --- a/services/vr/hardware_composer/impl/vr_hwc.cpp +++ b/services/vr/hardware_composer/impl/vr_hwc.cpp @@ -232,7 +232,7 @@ VrHwc::VrHwc() {} VrHwc::~VrHwc() {} -bool VrHwc::hasCapability(Capability /* capability */) const { return false; } +bool VrHwc::hasCapability(hwc2_capability_t /* capability */) { return false; } void VrHwc::removeClient() { std::lock_guard<std::mutex> guard(mutex_); diff --git a/services/vr/hardware_composer/impl/vr_hwc.h b/services/vr/hardware_composer/impl/vr_hwc.h index fce9a063e0..eff721b501 100644 --- a/services/vr/hardware_composer/impl/vr_hwc.h +++ b/services/vr/hardware_composer/impl/vr_hwc.h @@ -196,8 +196,6 @@ class VrHwc : public IComposer, public ComposerBase, public ComposerView { VrHwc(); ~VrHwc() override; - bool hasCapability(Capability capability) const; - Error setLayerInfo(Display display, Layer layer, uint32_t type, uint32_t appId); Error setClientTargetMetadata( @@ -207,6 +205,8 @@ class VrHwc : public IComposer, public ComposerBase, public ComposerView { const IVrComposerClient::BufferMetadata& metadata); // ComposerBase + bool hasCapability(hwc2_capability_t capability) override; + void removeClient() override; void enableCallback(bool enable) override; |