overlay: writeback: Align secure allocations to 1M

In the writeback path, when memory is allocated and managed by
writeback, make sure the input size is aligned to 1M if the
request is for a secure allocation

Change-Id: Ia10f1b6811b81f075b221e0fa025447a77a1e02c
diff --git a/liboverlay/overlayWriteback.cpp b/liboverlay/overlayWriteback.cpp
index f711ca6..1d58ece 100644
--- a/liboverlay/overlayWriteback.cpp
+++ b/liboverlay/overlayWriteback.cpp
@@ -31,10 +31,15 @@
 #include "overlayWriteback.h"
 #include "mdpWrapper.h"
 
+#define SIZE_1M 0x00100000
+
 namespace overlay {
 
 //=========== class WritebackMem ==============================================
 bool WritebackMem::manageMem(uint32_t size, bool isSecure) {
+    if(isSecure) {
+        size = utils::align(size, SIZE_1M);
+    }
     if(mBuf.bufSz() == size) {
         return true;
     }