diff options
author | Lily Ouyang <lily.ouyang@intel.com> | 2016-06-23 13:48:26 +0800 |
---|---|---|
committer | The Android Automerger <android-build@google.com> | 2016-06-29 19:05:45 -0700 |
commit | 1a3d791b5de5c5b9dbae70a779a1a400743755c1 (patch) | |
tree | 8ffba4732d76dc682c2bcbb248c89931e0feebcd | |
parent | 9412c79795a90a3eb66be72c342cb4ff0ce30627 (diff) | |
download | hwcomposer-nougat-mr0.5-release.tar.gz |
Check whether the size be supported by HWC.android-cts-7.0_r9android-cts-7.0_r8android-cts-7.0_r7android-cts-7.0_r6android-cts-7.0_r5android-cts-7.0_r4android-cts-7.0_r33android-cts-7.0_r32android-cts-7.0_r31android-cts-7.0_r30android-cts-7.0_r3android-cts-7.0_r29android-cts-7.0_r28android-cts-7.0_r27android-cts-7.0_r26android-cts-7.0_r25android-cts-7.0_r24android-cts-7.0_r23android-cts-7.0_r22android-cts-7.0_r21android-cts-7.0_r20android-cts-7.0_r2android-cts-7.0_r19android-cts-7.0_r18android-cts-7.0_r17android-cts-7.0_r16android-cts-7.0_r15android-cts-7.0_r14android-cts-7.0_r13android-cts-7.0_r12android-cts-7.0_r11android-cts-7.0_r10android-cts-7.0_r1android-7.0.0_r9android-7.0.0_r8android-7.0.0_r7android-7.0.0_r6android-7.0.0_r5android-7.0.0_r4android-7.0.0_r36android-7.0.0_r35android-7.0.0_r34android-7.0.0_r33android-7.0.0_r32android-7.0.0_r31android-7.0.0_r30android-7.0.0_r3android-7.0.0_r29android-7.0.0_r28android-7.0.0_r27android-7.0.0_r24android-7.0.0_r21android-7.0.0_r19android-7.0.0_r17android-7.0.0_r15android-7.0.0_r14android-7.0.0_r13android-7.0.0_r12android-7.0.0_r11android-7.0.0_r10android-7.0.0_r1nougat-releasenougat-mr0.5-releasenougat-cts-releasenougat-bugfix-release
Fall back to GLES if the size isn't be supported.
Bug: 29267608
BZ: IMINAN-50487
Change-Id: I542d29556d2e082c7e7630e0023bf660126b2094
Signed-off-by: Lily Ouyang <lily.ouyang@intel.com>
-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; |