libvirtual: Fix logic to detect DRC use case
We detect DRC based on the resolution of the external display. If the
external display has non-zero width/height then we know it was
previously configured during the same session and is going for DRC.
Change-Id: Iaa0b112370a95f2719738c991411776dcfe17f88
diff --git a/libvirtual/virtual.cpp b/libvirtual/virtual.cpp
index 5453e3a..ca64fad 100644
--- a/libvirtual/virtual.cpp
+++ b/libvirtual/virtual.cpp
@@ -177,13 +177,13 @@
uint32_t priW = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].xres;
uint32_t priH = mHwcContext->dpyAttr[HWC_DISPLAY_PRIMARY].yres;
- initResolution(extW, extH);
-
// Dynamic Resolution Change depends on MDP downscaling.
// MDP downscale property will be ignored to exercise DRC use case.
// If DRC is in progress, ext WxH will have non-zero values.
bool isDRC = (extW > 0) && (extH > 0);
+ initResolution(extW, extH);
+
if(!qdutils::MDPVersion::getInstance().is8x26()
&& (mHwcContext->mMDPDownscaleEnabled || isDRC)) {