drm_hwcomposer: Allow NULL crtcs in display composition
In cases where we have displays which do not have a mode,
the crtc will be NULL. This shouldn't fail the composition
initialization.
Change-Id: I1a6acb72cd3f614b5a7c854ba61be1539efa4bea
Signed-off-by: Sean Paul <seanpaul@chromium.org>
diff --git a/drmcomposition.cpp b/drmcomposition.cpp
index fad131d..3612972 100644
--- a/drmcomposition.cpp
+++ b/drmcomposition.cpp
@@ -54,11 +54,10 @@
ALOGE("Failed to allocate new display composition\n");
return -ENOMEM;
}
+
+ // If the display hasn't been modeset yet, this will be NULL
DrmCrtc *crtc = drm_->GetCrtcForDisplay(display);
- if (!crtc) {
- ALOGE("Failed to find crtc for display %d", display);
- return -ENODEV;
- }
+
int ret = composition_map_[(*iter)->display()]->Init(drm_, crtc, importer_);
if (ret) {
ALOGE("Failed to init display composition for %d", (*iter)->display());