SF: Use CompositionInfo to program HWComposer

Bug: 112259502
Test: cts -m CtsViewTestCases
      SurfaceFlinger_test
      vrflinger_test

Change-Id: Ib0fea4e325473e552efbf4d974661d795d302244
diff --git a/services/surfaceflinger/LayerBE.cpp b/services/surfaceflinger/LayerBE.cpp
index 9c6534e..f389b57 100644
--- a/services/surfaceflinger/LayerBE.cpp
+++ b/services/surfaceflinger/LayerBE.cpp
@@ -43,7 +43,9 @@
 }
 
 void LayerBE::onLayerDisplayed(const sp<Fence>& releaseFence) {
-    mLayer->onLayerDisplayed(releaseFence);
+    if (mLayer) {
+        mLayer->onLayerDisplayed(releaseFence);
+    }
 }
 
 void LayerBE::clear(RE::RenderEngine& engine) {