OMAP: TILER: Add bounds checking on format inputs

Added bounds checking to validate incoming tiler format.

Change-Id: Icd791cc294ecb1838afb3f91451626debd59c29e
Signed-off-by: Andy Gross <andy.gross@ti.com>
OMAP4: TILER: Add variable alignment allocation API

Added tiler_alloc_block_area_aligned API to allow
for variable alignment when allocating when using the kernel
APIs.

Change-Id: I2f3c44675a3fa1b2c6dfef21ccdd9bcac2f1d0e5
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: TILER: Add offset parameter for allocation

Add offset parameter for use in tiler_alloc_block_area_aligned.
This allows a user to get a tiler allocation with a specific
alignment and offset.

Change-Id: I8b1b9dd17bc9def124ea92cbbede2f3c56823387
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: TILER: Adds func to fill the virt. sizes

Adds public tiler_fill_virt_array() that deals with
non-page-aligned addresses correctly.

Change-Id: I31f4aa9a2e81cd84e393529b6534674811f99563
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: ION/TILER: Expose virtual stride and size

Added an interface to query the virtual stride and size
from the tiler buffer via an ION handle.

Change-Id: Iac756475236d3463b1aeaa6e29767ba03e758851
Signed-off-by: Andy Gross <andy.gross@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
Signed-off-by: Hemant Hariyani <hemanthariyani@ti.com>

Conflicts:
	include/linux/omap_ion.h
OMAP: TILER: validate input width and height

Add validation of input width and height to ensure that it does
not exceed maximum pixel width and height for the specific format.

Validate maximum length for 1D allocations.

Change-Id: I64b00f93a312ae715a040da28a0b0fe663afa9d8
Signed-off-by: Andy Gross <andy.gross@ti.com>
OMAP: TILER: Optimize placement for NV12 buffers

This patch changes the behaviour when allocating 2D buffers.  If
the required alignment is less than 4KiB and a security token is set,
the allocation will be flagged specifically for this format.  All
subsequent buffers of the same format and size will be placed inside
this area until the area is exhausted.

For NV12 allocations, this means that all Y allocations will share
one area, and the UV allocations will share another.

Change-Id: I13d29257c0cbab627c2938d4623557918448ee86
Signed-off-by: Andy Gross <andy.gross@ti.com>
OMAP4: Tiler non-page-aligned support

Implements a way for the client drivers to use
non-page aligned and in case of 4430/4460
non-co-aligned YUV planes for buffers with
NV12 format.

Change-Id: Ie368980821311957c508a4d9c05d9087bc91d0dd
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: Makes Y & UV tiler planes co-aligned

Change-Id: Iffde93b494cbe61882c4dc8674ca9f1e77a20888
Signed-off-by: Tony Zlatinski <x0146664@ti.com>
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>
OMAP4: ION: Use the correct virtual TILER size

Fixes the ION TILER HEAP allocation function
to correctly obtain the tiler virtual pages
and size when dealing with non-page aligned
tiler allocations.

Change-Id: I59e05aa26b572ed52b7f7d8c653bc6184f6c274d
Signed-off-by: Atanas (Tony) Zlatinski <zlatinski@gmail.com>

Conflicts:
	drivers/gpu/ion/omap/omap_tiler_heap.c
gpu: ion: group heap allocations by id in the debugfs

Multiple ion heaps can have the same type.  These heaps will have
separate debugfs files, but any allocation for a heap with the same
type will be listed in them.

Change-Id: Iad2f660c539e151d62e76f8f99ecc9ad80b16dd5
Signed-off-by: Lajos Molnar <lajos@ti.com>
Singed-off-by: Dima Svetlov <svetlov@ti.com>
ION: Added support for getting ion phys without client

In order to dereference the ion_handles passed from user side
to kernel, there should be support for api without client identity.
This patch adds this support.

Change-Id: I95d0d460c9e0ad202d14e7620b82e1fa9d48f746
Signed-off-by: Sunita Nadampalli <sunitan@ti.com>
Signed-off-by: Lajos Molnar <lajos@ti.com>
Signed-off-by: Dima Svetlov <svetlov@ti.com>
ion: add support for tiler reservation heap

The tiler reservation heap is for allocating TILER address space, but
not the underlying pages.  The idea is to allocate TILER address space
and one or more ION buffers from the system heap, and map system heap
buffers into the allocated TILER address space.

Change-Id: Ibd53ab811259cabec87384cf2ab4f99c0cbdca23
Signed-off-by: David Schleef <ds@ti.com>

Conflicts:
	drivers/gpu/ion/omap/omap_tiler_heap.c