msm_fb: display: fix incorrect MDP formats components unpack pattern

Many of MDP input formats don't have correct unpack pattern, so image
displayed on screen is not in the actual format set.

CRs-fixed: 339114,337040
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
(cherry picked from commit c5638f898324df37e40e402d208b0e97337d536b)

Change-Id: I66a404db039502d0511cd3d7dc34e81c0eca1d61
Signed-off-by: Gopal G Goberu <ggober@codeaurora.org>
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
drivers: base: reset genlock to original import

Original commit id: 29f66af8a0558025275e8897e54418bca65dbe08
base: genlock: Properly destroy handle resources

The resources allocated for a handle were not being freed on device
release.  This included releasing the lock.  Unfortunately, the
lock release had a fput() too many which was screwing up the
reference counting on the file descriptors.  When attaching a lock,
we only need the file pointer for a short time so fput() it back
immediately.  That way, only there will only be one reference to
the lock per process, and the process will be responsible for
closing the fd directly and the fput() in genlock_release_lock
is no longer needed.

CRs-fixed: 322645
Change-Id: Ic0dedbad55300a2f8463c800cf8361719583b0b8
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Avoid a race condition when releasing locks

Avoid a race condition if a lock gets released by all owners
but a process fails to close a lock file descriptor and tries
to reuse it.  Clearing the pointers to the data will ensure
that attaching a dead lock will return an error.

Change-Id: Ic0dedbadd693c7a22b027052cdd247370b28a7c5
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Add error messages for failure cases

Signed-off-by: Naomi Luis <nluis@codeaurora.org>
Change-Id: I833e480abfc11ce4aa00a5ae46144895429a0339
base: genlock: Check for instances where handle is NULL

Check for the possibility of NULL handles passed into the
in-kernel API functions and return error where appropriate.
There is a non-zero chance that the private_data will be
cleared while the FD is still active, so check in the ioctl()
function as well.

(cherry picked from commit a73ed097420c53451e843ae61d9aadc8fefabc94)

Change-Id: If481b98a6a2ab01ab788c23bffe9df7ab8bc6aee
CRs-fixed: 332835
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
base: genlock: Remove genlock_release_lock and associated ioctl

Allowing a lock to be asynchronously released while a handle
was still active turned out to be too dangerous to use in a
multi-threaded environment and it served no pratical
purpose anyway.  Handles now hold an attached lock until they
are destroyed.

(cherry picked from commit 4df70a254d9ddea0ee4bede39d4d12e6360e5b99)

Change-Id: I969ac3cf84c5982cc7c03c5651c7fe328567c02b
CRs-fixed: 333141
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>

Conflicts:

	Documentation/genlock.txt
base: genlock: Use a signed long for the result from wait_timeout

interruptible_wait_timeout returns a signed long, so make sure that
we use a signed long to hold the result. Using an unsigned value would
horribly misinterpet an error such as -ERESTARTSYS.

CRs-Fixed: 341347
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
(cherry picked from commit be669bc92358653a46c63f2352e6d981f9ed3bdf)

Change-Id: Ifcf555f8719f9c74fdb6d8b5cf2a32582988335b
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
base: genlock: allow synchronization with a single gralloc handle

In order to support synchronization in a process with a single
gralloc handle we require the ability to write lock a buffer
while it is already read locked by the same handle. This change
extends the concept of an exclusive write lock or recursive read
locks to a genlock handle (rather than the genlock lock).
Genlock cannot provide deadlock protection because the same
handle can be used simultaneously by a producer and consumer.
In practice an error will still be generated when the timeout
expires.

CRs-fixed: 356263

Signed-off-by: Jeff Boody <jboody@codeaurora.org>
(cherry picked from commit 6d9076fe46bcba71986a25cf357e71a4d83958c1)

Change-Id: I5d02591586023f4b622915522e2e038c16c9f2f2
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
base: genlock: remove BIT macro usage

The BIT macro is not defined for !_KERNEL_ resulting in compile errors.

CRs-fixed: 356263
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
(cherry picked from commit 0977510e0f72b2f1a24f41d5154c2f1b80c96d9a)

Change-Id: Iaf188a1af838c98ca30ce216d7be8ddf85db700c
Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
Revert "base: genlock: allow synchronization with a single gralloc handle"

This reverts commit 1f869ac8cda0e2703bb5e51008ef34b38aaac2d8.

Conflicts:

	include/linux/genlock.h
usb: gadget: Use CAF USB gadget at tag M8960AAAAANLYA1534

Includes following changes:

usb: core: use CAF USB core at M8960AAAAANLYA1534

char: diag: use CAF diag at M8960AAAAANLYA1534

usb: gadget: use CAF USB gadget at M8960AAAAANLYA1534

usb: host: use CAF USB host at M8960AAAAANLYA1534

usb: misc: use CAF USB misc at M8960AAAAANLYA1534

usb: serial: use CAF USB serial at M8960AAAAANLYA1534

arm: msm: update ville for CAF USB gadget
ville: update defconfig for CAF USB
usb: core: remove dangling reference to undefined variable
video: msm: remove msm_8x60 directory
gpu: msm: remove device-specific adreno directory
msm: iommu_domains: add IOMMU domain enums
gpu: ion: Delay unmapping from IOMMU.

Due to limitations in the multimedia architecure
clients might not know when a buffer can be unmapped
from the IOMMU. In addition, the multimedia architecture
causes unnecessary mappings/unmappings for the same buffers
which reduces framerates.

Add logic to delay unmapping from the IOMMU
until buffer memory is freed and unmap any outstanding
mappings to avoid virtual memory address space leak.

(cherry picked from commit b36765960a60150af1c0faea0e0535123d40f90e)

Change-Id: Ic19d79328c48ea5a22bc7ac7f0bd6c54fb9de543
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>

Conflicts:

	include/linux/ion.h
gpu: ion: Add API to do cache operations

Clients need to be able to do cache operations
on ION buffers in the kernel. Add API to
flush, invalidate, or invalidate and flush the
cache of an ION buffer.

(cherry picked from commit 41f8579a79c1a6513577465cd376fb5b1bf4cab2)

Change-Id: I9a00fec1bd891f730b448d06f10be07bd79b3011
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: board: fix compile for vidc