overlay: Add support for using scalar calculations
Add support for using scalar calculations from custom library.
The calculation will override pipe configurations if required on
basis of format, scaling, split display etc.
Change-Id: I53c73431b70b5b339ad09c19ac8792f0fc96aaaa
diff --git a/liboverlay/overlayMdp.cpp b/liboverlay/overlayMdp.cpp
index 674e62d..b4058bd 100644
--- a/liboverlay/overlayMdp.cpp
+++ b/liboverlay/overlayMdp.cpp
@@ -20,6 +20,12 @@
#include "overlayUtils.h"
#include "overlayMdp.h"
#include "mdp_version.h"
+#include <overlay.h>
+
+#ifdef USES_QSEED_SCALAR
+#include <scale/scale.h>
+using namespace scale;
+#endif
#define HSIC_SETTINGS_DEBUG 0
@@ -39,13 +45,20 @@
namespace ovutils = overlay::utils;
namespace overlay {
-bool MdpCtrl::init(uint32_t fbnum) {
+bool MdpCtrl::init(uint32_t dpy) {
+ int fbnum = Overlay::getFbForDpy(dpy);
+ if( fbnum < 0 ) {
+ ALOGE("%s: Invalid FB for the display: %d",__FUNCTION__, dpy);
+ return false;
+ }
+
// FD init
if(!utils::openDev(mFd, fbnum,
Res::fbPath, O_RDWR)){
ALOGE("Ctrl failed to init fbnum=%d", fbnum);
return false;
}
+ mDpy = dpy;
return true;
}
@@ -57,6 +70,7 @@
mOrientation = utils::OVERLAY_TRANSFORM_0;
mDownscale = 0;
mForceSet = false;
+ mDpy = 0;
#ifdef USES_POST_PROCESSING
mPPChanged = false;
memset(&mParams, 0, sizeof(struct compute_params));
@@ -201,11 +215,22 @@
mdp_wrapper::dump("== Bad OVInfo is: ", mOVInfo);
mdp_wrapper::dump("== Last good known OVInfo is: ", mLkgo);
this->restore();
+#ifdef USES_QSEED_SCALAR
+ if(Overlay::getScalar()) {
+ Overlay::getScalar()->configAbort(mDpy);
+ }
+#endif
return false;
}
this->save();
}
+#ifdef USES_QSEED_SCALAR
+ if(Overlay::getScalar()) {
+ Overlay::getScalar()->configSet(mOVInfo, mDpy, mFd.getFD());
+ }
+#endif
+
return true;
}
@@ -371,4 +396,21 @@
return true;
}
+
+//// MdpData ////////////
+bool MdpData::init(uint32_t dpy) {
+ int fbnum = Overlay::getFbForDpy(dpy);
+ if( fbnum < 0 ) {
+ ALOGE("%s: Invalid FB for the display: %d",__FUNCTION__, dpy);
+ return false;
+ }
+
+ // FD init
+ if(!utils::openDev(mFd, fbnum, Res::fbPath, O_RDWR)){
+ ALOGE("Ctrl failed to init fbnum=%d", fbnum);
+ return false;
+ }
+ return true;
+}
+
} // overlay