Merge "sf: Fix issue with dequeueBuffer when multiple display present"

This commit is contained in:
Treehugger Robot 2020-05-11 20:05:02 +00:00 committed by Gerrit Code Review
commit fa5cda8260
2 changed files with 11 additions and 1 deletions

View file

@ -470,7 +470,7 @@ Error Display::getName(std::string* outName) const
Error Display::getRequests(HWC2::DisplayRequest* outDisplayRequests,
std::unordered_map<HWC2::Layer*, LayerRequest>* outLayerRequests) {
uint32_t intDisplayRequests;
uint32_t intDisplayRequests = 0;
std::vector<Hwc2::Layer> layerIds;
std::vector<uint32_t> layerRequests;
auto intError = mComposer.getDisplayRequests(

View file

@ -3415,6 +3415,7 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& displayDevice,
const Region bounds(displayState.bounds);
const DisplayRenderArea renderArea(displayDevice);
const bool hasClientComposition = getHwComposer().hasClientComposition(displayId);
const bool hasFlipClientTargetRequest = getHwComposer().hasFlipClientTargetRequest(displayId);
ATRACE_INT("hasClientComposition", hasClientComposition);
bool applyColorMatrix = false;
@ -3480,6 +3481,15 @@ bool SurfaceFlinger::doComposeSurfaces(const sp<DisplayDevice>& displayDevice,
if (applyColorMatrix) {
clientCompositionDisplay.colorTransform = displayState.colorTransformMat;
}
} else if (hasFlipClientTargetRequest) {
buf = display->getRenderSurface()->dequeueBuffer(&fd);
if (buf == nullptr) {
ALOGW("Dequeuing buffer for display [%s] failed, bailing out of "
"client composition for this frame",
displayDevice->getDisplayName().c_str());
return false;
}
}
/*