Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c0df4a02 authored by Kevin Schoedel's avatar Kevin Schoedel Committed by android-build-merger
Browse files

Merge "Make VR HWC DPI a configurable property" into oc-dr1-dev

am: 281a0c26

Change-Id: I3ec8cc3bea80ab946c7576f9de2c470ace2fb72f
parents 43c8b437 281a0c26
Loading
Loading
Loading
Loading
+9 −1
Original line number Diff line number Diff line
@@ -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 @@ Error VrHwc::getDisplayAttribute(Display display, Config config,
      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;