author | Stark Li <stark.li@amlogic.com> | 2017-02-16 11:37:41 (GMT) |
---|---|---|
committer | Frank Chen <frank.chen@amlogic.com> | 2017-02-24 11:04:21 (GMT) |
commit | a8d56bbbe86e91a6ff158990a24587a9698bedbc (patch) | |
tree | 0929830d32237700a41a610ee645130e0c87f577 | |
parent | 7ec8463991673f4a6895a7e0eca56545b61611b2 (diff) | |
download | gralloc-a8d56bbbe86e91a6ff158990a24587a9698bedbc.zip gralloc-a8d56bbbe86e91a6ff158990a24587a9698bedbc.tar.gz gralloc-a8d56bbbe86e91a6ff158990a24587a9698bedbc.tar.bz2 |
PD#138788: add secure layer usage flag
Change-Id: I4d9df62beb2a00cb5009f1cc6f8af5441af37e6e
-rw-r--r-- | alloc_ion.cpp | 12 | ||||
-rw-r--r-- | gralloc_priv.h | 1 |
2 files changed, 13 insertions, 0 deletions
diff --git a/alloc_ion.cpp b/alloc_ion.cpp index 57f0862..f290974 100644 --- a/alloc_ion.cpp +++ b/alloc_ion.cpp @@ -49,8 +49,16 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand #define ION_HEAP_SECURE_MASK 1 + bool secureOrProtectedLayer = false; + if (usage & GRALLOC_USAGE_AML_SECURE) + { + secureOrProtectedLayer = true; + // usage &= ~GRALLOC_USAGE_AML_SECURE; + } + if (usage & GRALLOC_USAGE_PROTECTED) { + secureOrProtectedLayer = true; usage &= ~GRALLOC_USAGE_PROTECTED; } /* Select heap type based on usage hints */ @@ -170,6 +178,10 @@ int alloc_backend_alloc(alloc_device_t* dev, size_t size, int usage, buffer_hand { hnd->flags |= private_handle_t::PRIV_FLAGS_CONTINUOUS_BUF; } + if (secureOrProtectedLayer) + { + hnd->flags |= private_handle_t::PRIV_FLAGS_SECURE_PROTECTED; + } return 0; } else diff --git a/gralloc_priv.h b/gralloc_priv.h index 3bf2d81..b11eed2 100644 --- a/gralloc_priv.h +++ b/gralloc_priv.h @@ -195,6 +195,7 @@ struct private_handle_t PRIV_FLAGS_CURSOR = 0x00000040, PRIV_FLAGS_OSD_VIDEO_OMX = 0x00000080, PRIV_FLAGS_CONTINUOUS_BUF = 0x00000100, + PRIV_FLAGS_SECURE_PROTECTED = 0x00000200, }; enum |