Revert "Add heap_mask and old api support to ion"

This reverts commit 111cc5316c6bd9444d054604bcec5a5bc3abf0af.
Revert "More old ioctl support"

This reverts commit 7241399b535a49a48f46ad18659461e7688c4561.
Revert "msm: ion: add support for old ioctl ion"

This reverts commit 87ec75d56fe1aac98ea48469c888e85d7d2ba3b6.
Revert "Revert "updating ION headers to support JB_chocolate kernel and mr 1 HAL""

This reverts commit 4e701a3ff9c18abc8ce57a31da62b16d2c721155.
gpu: ion: repurpose flags field for heap_mask and caching

In the latest Ion API, userspace clients specify the heap_mask for an
allocation in the `heap_mask' field of the ion_allocation_data
structure, and they specify caching in the `flags' field. Before, the
heap_mask was in the `flags' field and caching was specified with the
O_DSYNC file open flag.

We would like to support the new API without actually updating Ion. To
do this, | the heap_mask back into the flags field on an allocation
ioctl (since the internal kernel APIs still expect to see it
there). Also make sure that caching is taken from the buffer flags
field rather than the O_DSYNC file flag.

Change-Id: I872afb40d9bf7c49bb31f19c5e9726ac714ef850
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm: ion: Only return Ion flags in ion_handle_get_flags

Since the ion_buffer.flags field is shared between the actual Ion
flags as well as the Ion heap mask, make sure that we're only
returning flags. The heap_mask bits should be masked off.

Change-Id: Ibdaf0ea374b7b80a036bddd11d19c4bafa173ef6
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
gpu: ion: move msm-specific ioctls to custom_ioctl

To avoid collisions with future ioctls that may be added to ion,
msm-specific ioctls should use the `custom_ioctl' interface provided
by struct ion_device, as originally intended.

Change-Id: Ic36f1ff37ce79926482942f70d466acf95c9c170
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>

Conflicts:
	drivers/gpu/ion/ion.c
	drivers/gpu/ion/msm/msm_ion.c
gpu: ion: Add backwards compatibility ioctls

 * Backwards-compatibiity ioctls for pre-MR1 userspace
 * Original patch by Oliver Gjoneski (detule) for D2

Change-Id: Ica119c27df564a5975ecabc9c00859a9fa8b2d7c