ion: Switch map/unmap dma api to sg_tables

Switch these api's from scatterlists to sg_tables

Change-Id: I8b99e39633df009d472ce24704fa26af7bb50fa2
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
ion: Add reserve function to ion

Rather than requiring each platform call memblock_remove or reserve
from the board file, add this to ion

Change-Id: Ie418a692c13e9e0cfe93ecc83d253d3ce860fc83
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>
gpu: ion: several bugfixes and enhancements of ION

1. Verifying if the size of memory allocation in ion_alloc() is aligned
by PAGE_SIZE at least. If it is not, this change makes the size to be
aligned by PAGE_SIZE.

2. Unmaps all mappings to the kernel and DMA address spaces when
destroying ion_buffer in ion_buffer_destroy(). This prevents leaks in
those virtual address spaces.

3. Makes the return value of ion_alloc() to be explicit Linux error code
when it fails to allocate a buffer.

4. Makes ion_alloc() implementation simpler. Removes 'goto' statement and
relavant call to ion_buffer_put().

5. Checks if the task is valid before calling put_task_struct() due
to failure on creating a ion client in ion_client_create().

6. Returns error when buffer allocation requested by userspace is failed.

Change-Id: I4fa9859f4a0b665fcb44e5c0da43c569732e93ae
Signed-off-by: KyongHo Cho <pullip.cho@samsung.com>
gpu: ion: Use alloc_pages instead of vmalloc from the system heap

With this change the ion_system_heap will only use kernel address
space when the memory is mapped into the kernel (rare case).

Change-Id: I8702cf89ffec0bd5c337bd88d7444013d4d94bc8
Signed-off-by: Rebecca Schultz Zavin <rebecca@android.com>