msm_fb: display: change the location of wakeup timer call

There are two pathes (pan display and overlay commit) to commit
display buffer, so change the location of cpu timer wakup call to the
common pipe_commit function to make sure cpu get waked up around
vsync.

(cherry picked from commit ec339e96700b98faa170b06f73678f203c237291)

Change-Id: If48ffda185a0b600887f15c0999e650631ac28c8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
video: msm: Do not use disable_irq in the spin_lock_irqsave context

Both mdp_isr() and mdp_histogram_disable() uses the same
spin lock mdp_spin_lock variable.  One core waits for disabling
mdp_isr after acquiring mdp_spin_lock and other core in mdp_isr()
waits for spin lock mdp_spin_lock and dead lock between two cores.

(cherry picked from commit 946ca6389b8f8c70b62a2f1ab4d81b475395f7d8)

Change-Id: Ib5ca797932f2426943e737aa6556cf7d2523cac5
Signed-off-by: Prasad Sodagudi <psodagud@codeaurora.org>
Revert "msm_fb: display: add wfd clk ctrl in pipe_commit"

This reverts commit 6bc75a99cff8b369c973145dca7f659062924158.
Revert "msm_fb: dtv: Serve device off in a separate thread"

This reverts commit ea362313f05a29c4d2b5bd08c085e64999f6aa49.
Revert "msm_fb: display: return fail if pipe still staged"

This reverts commit a91bb0ba9868fa65375fc11cb3ec8753f110290e.
Revert "msm_fb: display: Program source address registers correctly"

This reverts commit 1845f092d81e2f92ff16aa5b830cdd16881a84c8.
msm_fb: display: Enable scaling bit while setting x-flip bit

To enable left-right flip x-scaling bit should be set for
MDP 4.2 and above versions. This fixes the issue when RGB layer
pipes are not properly rotated.

Change-Id: I0afae4aecde39ce3ac4dcbefc0bda93510e7d18a
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm_fb: display: blt always enabled for 720p,1080p, secure buf

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

Conflicts:

	drivers/video/msm/mdp4_overlay.c

Change-Id: Id25e3b577d5ef59d59e33755b943484603cb9a98
msm: Add support for APQ8064AB variant.

Update the call sites of cpu_is_apq8064() to include an
additional check for the APQ8064AB target where
appropriate.

Signed-off-by: Jay Chokshi <jchokshi@codeaurora.org>
(cherry picked from commit 11abd8bdf369e6ddaf5569e780f2c62180095653)

Change-Id: I3cc0ba7279ce6e111d1b87933a8f8251ca306830
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
msm: spm_devices: Fix failure to set vdd during cpu_up

To avoid a core vdd being set when the core could be executing the SPM
finite state machine, set the call to set vdd to execute on that
particular core using smp_call_function_single(). However, the call can
only be executed on a core thats online.

When a core is brought online, the acpuclk driver needs to ensure that
the core vdd is set correctly before the core can be brought online.
But, since smp_call_function_single() works on cores that are online,
the call to set vdd will fail and therefore the core will cannot be
onlined.

The error that would be seen when the kernel command line parameters has
maxcpus=2

[244.759529] saw_set_voltage: 8821_s0: msm_spm_set_vdd failed -6
[244.764687] acpuclk-8064 acpuclk-8064: regulator_set_voltage(krait2)(-6)
[244.771463] _cpu_up: attempt to bring up CPU 2 failed

It is safe to do a set the vdd of an offline core when called at cpu_up,
so bypass smp_call_function_single() and set the voltage of the core
directly from cpu0.

This chicken and egg problem will not be seen if the cores were
initialized by calling boot_secondary() at init.

CRs-fixed: 407553
Change-Id: Ifdc9a645b5a9715d0fda065b4b0c2bab056a3ade
Signed-off-by: Praveen Chidambaram <pchidamb@codeaurora.org>
(cherry picked from commit 8624ce7c52bba5acf7a2321690def8c732680199)

Signed-off-by: Dhivya Subramanian <dthiru@codeaurora.org>
wcnss: Notify Kernel suspend/resume to WCNSS

Notify WCNSS when the Kernel is suspended and also when it resumes.
Certain notifications from WCNSS are not required when Apps is
suspended.

Change-Id: I4e237d4793803798c599d4659bb2d7c0e496a393
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
(cherry picked from commit ed3f7dadb5e798e49da59a1d1cb4a3be5143f9a0)

Conflicts:

	drivers/net/wireless/wcnss/wcnss_wlan.c

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
wcnss: Remove enabling of CXO in suspend/resume

CXO was explicitly turned ON before writing into PMU registers, this
is not required now. WLAN driver will only send suspend/resume
notifications to WCNSS when it's is BMPS mode. And in this mode, Apps
can always access PMU register.

Change-Id: I6a2e59b541ecea16be9e9463f26add6b23d4bdb0
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
(cherry picked from commit f4cc9e59cd05af649f75d5c07f43ae7ed92b0172)

Signed-off-by: Ram Kumar Chakravarthy Chebathini <rcheba@codeaurora.org>
wcnss: Log CCPU registers in reset interrupt API

Reset interrupt is sent to Riva when host drivers fail to communicate
with Riva over SMD. So logging these CCPU registers helps to know the
failure reason at Riva.

Change-Id: Icccf6a5b0644fd75137602cc96b25dc8d392260a
CRs-Fixed: 418813
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: kgsl: Add the thread group leader ID to memory traces

Because we store process memory indexed by the thread group leader and
report pagefaults accordingly it helps reduce confusion to record the
TGID for the allocation in the memory trace messages.

Change-Id: Ic0dedbad79c7112c4a6746cea0941104519e495c
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: add userspace memory type to ftrace events

Add a "usage" field to memory allocation, mapping and
free ftrace events.

Change-Id: I673a9593650d5285b0abc8c94de8f9f80d3d449e
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: set userspace memory type on each memdesc

Userspace passes a set of values indicating how it
uses each buffer it allocates, which were previously
ignored. These are useful hints for debugging and
profiling applications. These flags will be exposed
through ftrace and debugfs in later patches.

Change-Id: Ie26c26e413c074dcd5dfa24d355443ee47c3cd6a
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: add per-process memory info to debugfs

Add a file for each process in debugfs named, kgsl/proc/<pid>/mem
which contains information about all memory allocations the process
has made.

Change-Id: Ice3f039d92cc1b1cdb5a6192808441ddfdf8abfb
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Revert "msm: kgsl: Add GFP_NORETRY to the page_alloc flags and handle errors"

This reverts commit 6e06132cf868b2dea049447cefced1a0656dd7ba. (reverted from commit e03046315c12f0c9b26f403c56fec5a5545bd384)

Change-Id: I13e39bbebc1eba07543ae8337c5f64515589d8e9
msm: kgsl: Enable "big page" memory allocations

Allow users to specify "big page" mode when allocating GPU
memory. This will attempt to allocate contigious units of 64k
bytes per instead of the usual PAGE_SIZE units.  If the allocation
fails, then automatically fall back to allocate the rest of the
region with 4K pages. This means that potentially any allocation
could be comprised of a mixture of 64k chunks and 4k chunks.

Change-Id: Ic0dedbadcf1f4b30a106f430dd2d87781ea54829
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
msm: kgsl: Cleanup memdesc flags

We had a ugly mix of flags from usersapce mixed in with internal flags
and the flags were stored in priv and the internal flags were stored
in flags and general confusion all around.

So, external (user) flags moved to memdesc->flags, internal bits moved
to ->priv and now we are ready to handle the full onslaught of user
specified flags.

Change-Id: Ic0dedbad2236ae353b31e5dcaa6ff551713abaf1
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>