msm_fb: display: add fput_light to frame buffer

Frame buffer's (fb0) ref_count's need to be balanced. overlay_play()
increases fb0's ref_count (fget_light). This patch will decrease fb0's
ref_count by calling fput_light after commit.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Iliyan Malchev <malchev@google.com>
msm_fb: display: Consolidate commit ioctls

Overlay commit and display commit were two separate
ioctls doing similar things. This change consolidates
the two into one display commit ioctl. With this, we
can use the RGB0 pipe with an IOMMU framebuffer.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
msm_fb: display: remove background invert alpha option for alpha drop pipe

When the blended background pipe has dropped alpha and it is going to
be blended with foreground pipe on the next stage,
MDP4_BLEND_BG_ALPHA_FG_CONST is taken. Foreground alpha constant is
0xFF, so we need to use this alpha value to show background, instead
of its inverted value.

Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: add per stage alpha drop detection

Currently, alpha drop detection is done per frame which
means multiple blending stages share same alpha drop status
which does not reflect the alpha effect truly on each blending
stage. This patch enforces that the alpha drop detection
is done per blending stage so that alpha effect is applied
properly at each blending stage.

Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>

Conflicts:

	drivers/video/msm/mdp4_overlay.c
msm_fb: display: mdp4 version assigned at board file

The mdp4 version reflects mdp's capability and is referred to at
many places. Currently, it is acquired by reading mdp version
register. Since the MDP version is defined in the board file,
this patch uses that version at probe time.

Change-Id: Iae2db1fb8609cb80f3705b5e47d3fefedc15fec5
Signed-off-by: Kuogee Hsieh <khsieh@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>
prima: release v3.2.1.13

    git://codeaurora.org/external/wlan/prima.git

    8cfd26d wlan: Release 3.2.1.13
    148c518 Update csrRoamInitGlobals() to support static linking
    fff59a1 Send EDCA Parameters After Reassoc
    c7f1b8f Populate Correct Scan Mode for Roam
    c9990e6 Fix driver hang in csrRoamRoamingStateDisassocRspProcessor
    d1ef85b Remove call to palStopTimer for preauth
    a31968f Insure that LFR BG scanning is not performed for any non-Infra association
    96a9106 Only flush non-P2P results from scan cache prior to LFR scan
    ac37d9d De-register lookup UP indication during pre-auth
    def1bff Improve convergence of LFR roam candidate scan algorithm
    3774f3b Dump neighbor state info when scan is not allowed
    524cf61 wlan: Release 3.2.1.12
    70e619c Conditionally invoke driver restart API
    556271d Notify the Kernel suspend to WCNSS
    8aef3d0 Update restart driver API to support statically linked WLAN driver
    f9f6457 wlan: Release 3.2.1.11i
    d5b0e74 Post proper response to SME when reassoc is rejected
    e6c5a60 wlan: Release 3.2.1.11i
    bd2182f Post proper response to SME when reassoc is rejected

Signed-off-by: Iliyan Malchev <malchev@google.com>
Revert "USB: ensure parent device is resumed for child's system-resume"

This reverts commit de86e6482897db0006151ae9154f181e75f5ab2c.

Commit 7c8527ce ("PM: Prevent runtime suspend during system resume")
fixes the general issue of a parent device being prematurely
runtime suspended before a child device is resumed. It does so
by moving the pm_runtime_put_sync() call from the device_resume()
stage to device_complete(), which happens to act on the devices
in reverse (children before parent) order.

Thus when usb_resume() is called by device_resume(), we know its
parent will be runtime PM enabled and its usage counter is still
non-zero. This obviates the need to do an additional
pm_runtime_get_sync() before calling usb_resume_both() as the
device and its interfaces now have the opportunity to increment
the parent's power.child_count if necessary without fear of
having a runtime suspended parent.

CRs-fixed: 396041
Change-Id: I793ddfbb9bd88634f45f0c1e570a5d616248e3a8
Signed-off-by: Jack Pham <jackp@codeaurora.org>