drm_hwcomposer: Always perform a setcrtc initially

Always do a setcrtc on the first set(), this ensures things
are set up the way we expect them to be.

Signed-off-by: Sean Paul <seanpaul@chromium.org>
Change-Id: I4279d4de64339e72f0e7f9b315b2b9695704c78c
diff --git a/hwcomposer.cpp b/hwcomposer.cpp
index dac7ed4..c06bd00 100644
--- a/hwcomposer.cpp
+++ b/hwcomposer.cpp
@@ -67,6 +67,7 @@
 	int active_config;
 	uint32_t active_crtc;
 	int active_pipe;
+	bool initial_modeset_required;
 
 	struct hwc_worker set_worker;
 
@@ -200,6 +201,12 @@
 	drmModeCrtcPtr crtc;
 	drmModeModeInfoPtr m;
 
+	if (hd->initial_modeset_required) {
+		*modeset_required = true;
+		hd->initial_modeset_required = false;
+		return 0;
+	}
+
 	crtc = drmModeGetCrtc(hd->ctx->fd, hd->active_crtc);
 	if (!crtc) {
 		ALOGE("Failed to get crtc for display %d", hd->display);
@@ -1125,6 +1132,7 @@
 	hd->display = display;
 	hd->active_config = -1;
 	hd->active_pipe = -1;
+	hd->initial_modeset_required = true;
 	hd->connector_id = connector_id;
 
 	ret = sw_sync_timeline_create();