summaryrefslogtreecommitdiffstats
path: root/ips/tangier/TngDisplayQuery.cpp
diff options
context:
space:
mode:
authorAndy Qiu <junhai.qiu@intel.com>2014-09-10 18:33:00 -0700
committerEd Tam <etam@google.com>2014-09-12 17:48:55 -0700
commitaf3bf2227c951a59e2dcc44ab90790d247225375 (patch)
tree5d86ac2803d6552e9ce9e35010dff3237b41a9c3 /ips/tangier/TngDisplayQuery.cpp
parent9f04a62c6e8c91ebeb199986ae11fc5107492df2 (diff)
downloadandroid_hardware_intel_img_hwcomposer-af3bf2227c951a59e2dcc44ab90790d247225375.tar.gz
android_hardware_intel_img_hwcomposer-af3bf2227c951a59e2dcc44ab90790d247225375.tar.bz2
android_hardware_intel_img_hwcomposer-af3bf2227c951a59e2dcc44ab90790d247225375.zip
support 480/576 mode.
Bug: 17391301 BZ: 222162 Change-Id: I96ac2695455723978f5a7c4fb5b5f74c4719580f Signed-off-by: Andy Qiu <junhai.qiu@intel.com>
Diffstat (limited to 'ips/tangier/TngDisplayQuery.cpp')
-rwxr-xr-x[-rw-r--r--]ips/tangier/TngDisplayQuery.cpp26
1 files changed, 26 insertions, 0 deletions
diff --git a/ips/tangier/TngDisplayQuery.cpp b/ips/tangier/TngDisplayQuery.cpp
index e2daa58..13350aa 100644..100755
--- a/ips/tangier/TngDisplayQuery.cpp
+++ b/ips/tangier/TngDisplayQuery.cpp
@@ -19,6 +19,7 @@
#include <hal_public.h>
#include <DisplayQuery.h>
#include <khronos/openmax/OMX_IntelVideoExt.h>
+#include <Hwcomposer.h>
namespace android {
@@ -57,6 +58,31 @@ uint32_t DisplayQuery::queryNV12Format()
return HAL_PIXEL_FORMAT_NV12;
}
+bool DisplayQuery::forceFbScaling(int device)
+{
+ // RGB planes don't support scaling. Panel fitter can be used to scale frame buffer to device's resolution
+ // if scaling factor is less than 1.5. Otherwise, GPU scaling is needed on RGB buffer, or hardware overlay
+ // scaling is needed on NV12 buffer
+
+ // this needs to work together with kernel driver. Panel fitter needs to be disabled if scaling factor is greater
+ // than 1.5
+
+ uint32_t width, height;
+ if (!Hwcomposer::getInstance().getDrm()->getDisplayResolution(device, width, height)) {
+ return false;
+ }
+
+ if (DEFAULT_DRM_FB_WIDTH / (float)width > 1.5) {
+ return true;
+ }
+
+ if (DEFAULT_DRM_FB_HEIGHT / (float)height > 1.5) {
+ return true;
+ }
+
+ return false;
+}
+
} // namespace intel
} // namespace android