sdm: Add option to defer video mode retire fence

Per the HWC2 header the present(retire) fence should be signaled at
the vsync when the result of composition of *this* frame starts to
appear (for video-mode panels). In our current implementation,
the retire fence timeline is the same as the release fence
timeline for video mode, so the retire fence that we get at present()
signals when the next frame comes in to replace the current one.
Hence, for video mode panels, we need to defer the retire fence
to meet the header requirements.

Change-Id: Ia84c9f14ba5c3667c4cad996027638f1f074914f
CRs-Fixed: 1050596
diff --git a/common.mk b/common.mk
index 6b3e2e9..ae0a6cc 100644
--- a/common.mk
+++ b/common.mk
@@ -1,9 +1,14 @@
 #Common headers
 display_top := $(call my-dir)
 
+#Common C flags
+common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
+common_flags += -Wconversion -Wall -Werror
+
 use_hwc2 := false
 ifeq ($(TARGET_USES_HWC2), true)
     use_hwc2 := true
+    common_flags += -DVIDEO_MODE_DEFER_RETIRE_FENCE
 endif
 
 common_includes := $(display_top)/libqdutils
@@ -16,9 +21,6 @@
 #Common libraries external to display HAL
 common_libs := liblog libutils libcutils libhardware
 
-#Common C flags
-common_flags := -DDEBUG_CALC_FPS -Wno-missing-field-initializers
-common_flags += -Wconversion -Wall -Werror
 ifneq ($(TARGET_USES_GRALLOC1), true)
     common_flags += -isystem $(display_top)/libgralloc
 else