android: ion: add buffer protection
authorCho KyongHo <pullip.cho@samsung.com>
Sun, 11 Feb 2018 08:08:35 +0000 (17:08 +0900)
committerSangwook Ju <sw.ju@samsung.com>
Mon, 14 May 2018 10:45:23 +0000 (19:45 +0900)
commitd6061861f64f1e9ff821d1ddc054c50e64142f35
treecfe5c092f62b6f4b69dbbc460a0580d81ada205b
parent7e825b8e000c8008454a1206429ab3dd958b53cf
android: ion: add buffer protection

DRM video contents need protection of the decrypted video stream from
copying to insecure buffer. For the protection from copying, Exynos
SoC provides H/W based protection. Since H/W has limitation of
resources, the H/W needs the types of buffer protection, some special
limitation to alignments and limits to the memory pool to serve buffer
protection.
Every memory pool needs buffer protection should be specified in the
flattened device tree under 'reserved-memory' node like cma heaps and
carveout heaps. The heaps needs protection should have 'ion,secure'
boolean property that specifies buffers from the heap may needs buffer
protection. They also need 'ion,protection_id' which specifies the
types of buffer protection.
Buffers from the secure heaps are not protected unless users gives ION
ION_FLAG_PROTECTED flag. non-secure heaps just ignore the flag.

Change-Id: Ibef18c3fde7d628c2298abb95e71379c67cf7471
Signed-off-by: Cho KyongHo <pullip.cho@samsung.com>
drivers/staging/android/ion/Makefile
drivers/staging/android/ion/ion.c
drivers/staging/android/ion/ion.h
drivers/staging/android/ion/ion_buffer_protect.c [new file with mode: 0644]
drivers/staging/android/ion/ion_carveout_heap.c
drivers/staging/android/ion/ion_cma_heap.c
drivers/staging/android/ion/ion_exynos.h
drivers/staging/android/ion/ion_fdt_exynos.c
drivers/staging/android/uapi/ion.h