Fix ION_IOC_MAP error on old ion api during drm video playback

Video playback in the Google Play Video app would
result in an ION_IOC_MAP invalid argument error and
the app to display error 22.

This fixes some old ion api code left out with the
"display: Reconcile display HALs" commit which resulted
in the invalid arugment or an out of memory error.

This was found using a Nexus 4 (mako) and the Google Play Movies
app while attempting DRM video playback.

Change-Id: I2f7724515cbb7449086611fb79d042ea71d6eb39

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: qcomBSP: put check on new ionalloc

* prevent compile error when trying to init the same thing over

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: gralloc: Let gralloc_priv.h be overloaded by device trees

Adjustments to private_handle_t may be necessary for device-specific
blob compatibility, so don't enforce usage of the local header

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: Fallback to SF heap when IOMMU isn't available

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: gralloc: Add workaround for Jellybean camera drivers

* Arcee is smarter than I am, and discovered that we can simply swap
  two fields to ensure compatibility with Jellybean camera drivers
  having the metadata fields in the private_handle_t struct.
* Enable this by defining QCOM_BSP_CAMERA_ABI_HACK.

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: Add QCOM_BSP common_flag

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: display: Add flag to allow legacy allocations from MM heap

 * New devices with IOMMU use the MM heap exclusively for protected
   buffers. We need to support the old behavior for devices with legacy
   userspace.
 * Enable the old behavior with TARGET_DISPLAY_INSECURE_MM_HEAP.

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: gralloc: Use new ION API by default

This conditionally reverts commit b519bb2
and reverses the logic to use OLD_ION_API since NEW_ION_API
is the default.

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
msm8960: gralloc: Fix some differences with compatibility code

Signed-off-by: bmc08gt <brandon.mcansh@gmail.com>
copybit: Fix type conversion error for GCC 4.7

GCC 4.7 has stricter type conversion rules