diff options
author | Lily Ouyang <lily.ouyang@intel.com> | 2016-06-29 19:05:12 +0000 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-06-29 19:05:12 +0000 |
commit | 1a2fc7b3f362ce483b0aaeae7bdee1f8154d8456 (patch) | |
tree | 7d2a28b7a05b16babfcc8688465f4a70121d6d87 | |
parent | a0f5036b92fdf613b1965e643df1d3277804d00a (diff) | |
parent | 790f1db0614a912f85681892f6b68d7927f05d98 (diff) | |
download | hwcomposer-1a2fc7b3f362ce483b0aaeae7bdee1f8154d8456.tar.gz |
Check whether the size be supported by HWC. Fall back to GLES if the size isn\\\'t be supported. am: 609fefa705 am: 9192c237dd
am: 790f1db061
Change-Id: Iee687fc1a44f0ee32a7b6b7a3f810f95b371534b
-rwxr-xr-x | moorefield_hdmi/ips/anniedale/PlaneCapabilities.cpp | 11 |
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; |