summaryrefslogtreecommitdiff
path: root/merrifield/common/devices/PhysicalDevice.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'merrifield/common/devices/PhysicalDevice.cpp')
-rw-r--r--merrifield/common/devices/PhysicalDevice.cpp22
1 files changed, 20 insertions, 2 deletions
diff --git a/merrifield/common/devices/PhysicalDevice.cpp b/merrifield/common/devices/PhysicalDevice.cpp
index 601b63e..f4072a7 100644
--- a/merrifield/common/devices/PhysicalDevice.cpp
+++ b/merrifield/common/devices/PhysicalDevice.cpp
@@ -17,6 +17,7 @@
#include <Hwcomposer.h>
#include <Drm.h>
#include <PhysicalDevice.h>
+#include <cutils/properties.h>
namespace android {
namespace intel {
@@ -32,7 +33,8 @@ PhysicalDevice::PhysicalDevice(uint32_t type, Hwcomposer& hwc, DeviceControlFact
mConnected(false),
mBlank(false),
mDisplayState(DEVICE_DISPLAY_ON),
- mInitialized(false)
+ mInitialized(false),
+ mFpsDivider(1)
{
CTRACE();
@@ -341,7 +343,8 @@ bool PhysicalDevice::updateDisplayConfigs()
// don't bail out as it is not a fatal error
}
// use active fb dimension as config width/height
- DisplayConfig *config = new DisplayConfig(mode.vrefresh,
+ // add display config vfresh/mFpsDivider to lower FPS
+ DisplayConfig *config = new DisplayConfig(mode.vrefresh/mFpsDivider,
mode.hdisplay,
mode.vdisplay,
dpiX, dpiY);
@@ -395,6 +398,16 @@ bool PhysicalDevice::updateDisplayConfigs()
bool PhysicalDevice::initialize()
{
CTRACE();
+ char prop[PROPERTY_VALUE_MAX];
+ char *retptr;
+
+ if (property_get("hwc.fps_divider", prop, "1") > 0) {
+ uint32_t divider = strtoul(prop, &retptr, 10);
+ if (*retptr == '\0' && divider > 1 && divider < 60) {
+ mFpsDivider = divider;
+ ALOGI("%s display, setting HWC FPS divider to %d", mName, mFpsDivider);
+ }
+ }
if (mType != DEVICE_PRIMARY && mType != DEVICE_EXTERNAL) {
ETRACE("invalid device type");
@@ -509,6 +522,11 @@ void PhysicalDevice::dump(Dump& d)
mLayerList->dump(d);
}
+uint32_t PhysicalDevice::getFpsDivider()
+{
+ return mFpsDivider;
+}
+
bool PhysicalDevice::setPowerMode(int mode)
{
// TODO: set proper power modes for HWC 1.4