Merge "Make VR HWC DPI a configurable property" into oc-dr1-dev am: 281a0c26c0
am: c0df4a029b
Change-Id: Ib1c6fabbb4962b0e8895b6252de63713311ad1d4
diff --git a/services/vr/hardware_composer/impl/vr_hwc.cpp b/services/vr/hardware_composer/impl/vr_hwc.cpp
index 9bbb7f3..861114d 100644
--- a/services/vr/hardware_composer/impl/vr_hwc.cpp
+++ b/services/vr/hardware_composer/impl/vr_hwc.cpp
@@ -15,6 +15,7 @@
*/
#include "impl/vr_hwc.h"
+#include <cutils/properties.h>
#include <private/dvr/display_client.h>
#include <ui/Fence.h>
@@ -352,7 +353,14 @@
break;
case IComposerClient::Attribute::DPI_X:
case IComposerClient::Attribute::DPI_Y:
- *outValue = 300 * 1000; // 300dpi
+ {
+ constexpr int32_t kDefaultDPI = 300;
+ int32_t dpi = property_get_int32("ro.vr.hwc.dpi", kDefaultDPI);
+ if (dpi <= 0) {
+ dpi = kDefaultDPI;
+ }
+ *outValue = 1000 * dpi;
+ }
break;
default:
return Error::BAD_PARAMETER;