hwc: Source Split layers always if indicated by driver
Source Split layers always if the driver indicates so by setting
the src_split_always in the capabilities sysfs node.
This is applicable to layers whose width > mixer's width, since
MDP clk rate is dependent on max(mixer_width, layer_width).
This feature can be enabled if the panel height is more than a
certain empirically derived value. Splitting always in those
cases can help with a lower voltage.
Change-Id: If9b33f11ca4132eb77416c26819f7473c65d3b08
diff --git a/libqdutils/mdp_version.cpp b/libqdutils/mdp_version.cpp
index 96ed4d2..bc63ddf 100644
--- a/libqdutils/mdp_version.cpp
+++ b/libqdutils/mdp_version.cpp
@@ -88,6 +88,7 @@
mLowBw = 0;
mHighBw = 0;
mSourceSplit = false;
+ mSourceSplitAlways = false;
mRGBHasNoScalar = false;
updatePanelInfo();
@@ -306,6 +307,30 @@
free(line);
fclose(sysfsFd);
}
+
+ if(mSourceSplit) {
+ memset(sysfsPath, 0, sizeof(sysfsPath));
+ snprintf(sysfsPath , sizeof(sysfsPath),
+ "/sys/class/graphics/fb0/msm_fb_src_split_info");
+
+ sysfsFd = fopen(sysfsPath, "rb");
+ if (sysfsFd == NULL) {
+ ALOGE("%s: Opening file %s failed with error %s", __FUNCTION__,
+ sysfsPath, strerror(errno));
+ return false;
+ } else {
+ line = (char *) malloc(len);
+ if((read = getline(&line, &len, sysfsFd)) != -1) {
+ if(!strncmp(line, "src_split_always",
+ strlen("src_split_always"))) {
+ mSourceSplitAlways = true;
+ }
+ }
+ free(line);
+ fclose(sysfsFd);
+ }
+ }
+
ALOGD_IF(DEBUG, "%s: mMDPVersion: %d mMdpRev: %x mRGBPipes:%d,"
"mVGPipes:%d", __FUNCTION__, mMDPVersion, mMdpRev,
mRGBPipes, mVGPipes);
@@ -371,6 +396,10 @@
return mSourceSplit;
}
+bool MDPVersion::isSrcSplitAlways() const {
+ return mSourceSplitAlways;
+}
+
bool MDPVersion::isRGBScalarSupported() const {
return (!mRGBHasNoScalar);
}
diff --git a/libqdutils/mdp_version.h b/libqdutils/mdp_version.h
index e862d2d..8bb9c39 100644
--- a/libqdutils/mdp_version.h
+++ b/libqdutils/mdp_version.h
@@ -140,6 +140,7 @@
unsigned long getLowBw() { return mLowBw; }
unsigned long getHighBw() { return mHighBw; }
bool isSrcSplit() const;
+ bool isSrcSplitAlways() const;
bool isRGBScalarSupported() const;
bool is8x26();
bool is8x74v2();
@@ -170,6 +171,8 @@
unsigned long mLowBw; //kbps
unsigned long mHighBw; //kbps
bool mSourceSplit;
+ //Additional property on top of source split
+ bool mSourceSplitAlways;
bool mRGBHasNoScalar;
};
}; //namespace qdutils