msm: display: fb blend setting via MSMFB_METADATA_SET ioctl

MSMFB_METADATA_SET ioctl is added for the fb user to pass
in additional infomation rather than using reserved
fields.
User can set pre-multiplied alpha for the frame buffer via this
ioctl, overlay blend setting will take this into account.

Change-Id: Ic2f6236d84691fb03174ec479874c6928489ea30
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
mm: Hold a file reference in madvise_remove

commit 9ab4233dd08036fe34a89c7dc6f47a8bf2eb29eb upstream.

Otherwise the code races with munmap (causing a use-after-free
of the vma) or with close (causing a use-after-free of the struct
file).

The bug was introduced by commit 90ed52ebe481 ("[PATCH] holepunch: fix
mmap_sem i_mutex deadlock")

Cc: Hugh Dickins <hugh@veritas.com>
Cc: Miklos Szeredi <mszeredi@suse.cz>
Cc: Badari Pulavarty <pbadari@us.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Signed-off-by: Andy Lutomirski <luto@amacapital.net>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
[bwh: Backported to 3.2:
 - Adjust context
 - madvise_remove() calls vmtruncate_range(), not do_fallocate()]
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
msm: camera: Remove unused code used to map userspace buffers.

Remove MSM_CAM_IOCTL_SET_MEM_MAP_INFO IOCTL support, since the
usage of this IOCTL is now depreciated.

Change-Id: I8d0c99874ae9bd87aaaa10e039f2511a6dd20775
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
base: genlock: handle error while creating lock/handle inode

A lock/handle inode is required in order to successfully create a
new lock/handle. Failure to report the lock/handle inode error can
result in errors for subsequent function calls.

Change-Id: I622af24e695f4781c4dbf46363931a7da09df677
Signed-off-by: Jeff Boody <jboody@codeaurora.org>
gpu: ion: fix some missing defines for ion mini upgrade

Change-Id: Iaa23687f1014c03b9064239b291a6b4200de26d4
Signed-off-by: Mitchel Humpherys <mitchelh@codeaurora.org>
msm_fb : Avoid wait for vsync when Timing Generator is off

Add checks for Timing Generator enable status before waiting
for vsync from it. This will avoid race conditions during
suspend-resume scenarios.

CRs-fixed: 406752

Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
(cherry picked from commit 282a601efdb0a74b5f65a881f4e4b638d0ef9cee)

Change-Id: I9c0c2bf5e48f59c69c6928c15779b172e9ed2dc1
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
msm_fb: display: Make sysfs read request interruptible

Change blocking sysfs read request to be interruptible and protect
vsync timestamp value to prevent corruption.

Change-Id: I370ced4f271e5f1d2c248bed06131c0623d7223f
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb : Add timeout while waiting for vsync event

Avoid eternal wait for vsync event when client tries to
read the corresponding sysfs entry. This will avoid hangs when
client tries to read in corner cases where the Timing
Generator or the clock or IRQ gets disabled.

CRs-fixed: 406752
Change-Id: I773687220b868823a9e4bfdae74361ee6487c5c6
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm_fb: display: Create sysfs entries in mdp_probe for MDP4 targets

vsync sysfs entries should be created in mdp_probe instead of
creating in panel on. This avoids waiting for the first event
control in framework

Change-Id: I3b6987555a2318f1bd36be253349611e051ca58d
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
 msm_fb: display: Create sysfs entries in mdp_probe for MDP3
 targets

vsync sysfs entries should be created in mdp_probe instead of
creating in panel on. This avoids waiting for the first event
control in framework

Change-Id: I18b05b8d2a65d489afc6e3274ec8dc7a5b9a5f9a
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp_dma_dsi_video.c
msm-fb: Fix sysfs node creation in mdp_probe for MDP3 targets

-vsync_init null check not required for mdp3 target before
 creating sysfs node.
-Set vsync suspend and resume flags appropriately in mdp_on
 for mdp3.

CRs-Fixed: 393243
Change-Id: I3366df7385ca8e2ae15053c3e58332f8e32ce0cd
Signed-off-by: Pawan Kumar <pavaku@codeaurora.org>