drm_hwcomposer: Propagate PlanStage error
All existing stage planers(PlanStageGreedy, PlanStageProtected,
PlanStageHiSi) silently ignore if they couldn't allocate a drmplane
for a drmhwclayer and return success.
That doesn't go well with the assumptions from ValidateDisplay,
where if the atomic check succeeds we just assume that we could do
Device composition for a maximum of num_of_drm_planes layers. But,
since we silently dropped some drmhwclayer we never put those in the
atomic check and we won't put it in the final atomic commit, so we end
up with a wrong composition on the screen.
What this proposes is propagating the error, which will make
ValidateDisplay to fallback on client composition.
Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
diff --git a/platformhisi.cpp b/platformhisi.cpp
index 0e12ef1..bf4033b 100644
--- a/platformhisi.cpp
+++ b/platformhisi.cpp
@@ -158,8 +158,10 @@
// We don't have any planes left
if (ret == -ENOENT)
break;
- else if (ret)
+ else if (ret) {
ALOGE("Failed to emplace layer %zu, dropping it", i->first);
+ return ret;
+ }
}
/*
* If we only have one layer, but we didn't emplace anything, we