summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLily Ouyang <lily.ouyang@intel.com>2016-06-29 18:50:50 +0000
committerandroid-build-merger <android-build-merger@google.com>2016-06-29 18:50:50 +0000
commit9192c237dd988b01ddef696523951cdd13bf38da (patch)
tree8ffba4732d76dc682c2bcbb248c89931e0feebcd
parent7c69cfc2d77615cd3106ad6de6624f460535961d (diff)
parent609fefa70504b720cc0f501d618a72d551103a1f (diff)
downloadhwcomposer-9192c237dd988b01ddef696523951cdd13bf38da.tar.gz
Check whether the size be supported by HWC. Fall back to GLES if the size isn\'t be supported.
am: 609fefa705 Change-Id: I688d81388a7fb3f81a7e4d64069f5cedcc531bae
-rwxr-xr-xmoorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp11
1 files changed, 11 insertions, 0 deletions
diff --git a/moorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp b/moorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp
index a7fbe48..54b4aee 100755
--- a/moorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp
+++ b/moorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp
@@ -25,6 +25,9 @@
#define SPRITE_PLANE_MAX_STRIDE_TILED 16384
#define SPRITE_PLANE_MAX_STRIDE_LINEAR 16384
+#define SPRITE_PLANE_MAX_WIDTH 4096
+#define SPRITE_PLANE_MAX_HEIGHT 4096
+
#define OVERLAY_PLANE_MAX_STRIDE_PACKED 4096
#define OVERLAY_PLANE_MAX_STRIDE_LINEAR 8192
@@ -173,6 +176,14 @@ bool PlaneCapabilities::isScalingSupported(int planeType, HwcLayer *hwcLayer)
dstH = dest.bottom - dest.top;
if (planeType == DisplayPlane::PLANE_SPRITE || planeType == DisplayPlane::PLANE_PRIMARY) {
+ if ((dstW - 1) <= 0 || (dstH - 1) <= 0 ||
+ (dstW - 1) >= SPRITE_PLANE_MAX_WIDTH ||
+ (dstH - 1) >= SPRITE_PLANE_MAX_HEIGHT) {
+ // Should check size in isSizeSupported().
+ DLOGTRACE("invalid destination size: %d x %d, fall back to GLES", dstW, dstH);
+ return false;
+ }
+
// no scaling is supported
return ((srcW == dstW) && (srcH == dstH)) ? true : false;