summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPirama Arumuga Nainar <pirama@google.com>2015-06-19 17:29:01 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2015-06-19 17:29:01 +0000
commit6b3e1831ee29f23452816752a9bb87fca5a8b013 (patch)
tree8ca4b050d66b5c0a3bf7c809136b56d7a1823ecc
parenteb98e0375e5ec89c5f3960472d5cdf3e734e3656 (diff)
parent31c406a5991858d68886d35b6e9bf03acc0b3288 (diff)
downloadrs-6b3e1831ee29f23452816752a9bb87fca5a8b013.tar.gz
Merge "Avoid clobbering of YUV layout for flexible formats" into mnc-dev
-rw-r--r--driver/rsdAllocation.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/driver/rsdAllocation.cpp b/driver/rsdAllocation.cpp
index 94efab24..790005d7 100644
--- a/driver/rsdAllocation.cpp
+++ b/driver/rsdAllocation.cpp
@@ -252,6 +252,15 @@ static void UploadToBufferObject(const Context *rsc, const Allocation *alloc) {
static size_t DeriveYUVLayout(int yuv, Allocation::Hal::DrvState *state) {
+#ifndef RS_COMPATIBILITY_LIB
+ // For the flexible YCbCr format, layout is initialized during call to
+ // Allocation::ioReceive. Return early and avoid clobberring any
+ // pre-existing layout.
+ if (yuv == HAL_PIXEL_FORMAT_YCbCr_420_888) {
+ return 0;
+ }
+#endif
+
// YUV only supports basic 2d
// so we can stash the plane pointers in the mipmap levels.
size_t uvSize = 0;
@@ -286,11 +295,6 @@ static size_t DeriveYUVLayout(int yuv, Allocation::Hal::DrvState *state) {
uvSize += state->lod[1].stride * state->lod[1].dimY;
state->yuv.step = 2;
break;
-#ifndef RS_COMPATIBILITY_LIB
- case HAL_PIXEL_FORMAT_YCbCr_420_888:
- // This will be filled in by ioReceive()
- break;
-#endif
default:
rsAssert(0);
}