ARM: dts: msm: Update device tree with memory map information for 8974 pro

Update the device tree in order to be aligned with the latest memory
map. As the venus, adsp and wconnect images are relocatable, reclaim
the memory that was previously occupied by non relocatable images of
these subsystems.

Change-Id: I553e57412ef6868eac97874f3300982a029fe971
Signed-off-by: Neeti Desai <neetid@codeaurora.org>
msm: kgsl: Use the right set of flags for issuing user commands

KGSL_CMD_FLAGS_EOF is both a valid command flag from the user and
a valid internal flag for the ringbuffer submit code.  This is
the only flag that can do this - the other internal flags either
have different meanings or aren't valid user flags.  Use an internal
register to store the command flags in adreno_ringbuffer_issueibcmds
so we don't accidently end up sending in the wrong control flags to the
ringbuffer code.

CRs-fixed: 546449
Change-Id: Ic0dedbadb9245002a60aa54cb51d35d98b9cb531
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Don't use uninitialized values in hang detection

Under some circumstances some of the registers used for hang detection
are not defined (usually because the hardware doesn't support them).
The hang detect code properly skips those registers when reading the
hardware but the corresponding offsets in the destination array are
still compared to detect a hang.  Since the array was defined on the
stack and those particular members were never read from the hardware
the values could be non zero a real GPU hang could be missed.

Skip the undefined hang detect registers in all three for() loops
where the list of hang detect registers are used.

CRs-fixed: 540224
Change-Id: Ic0dedbad6e654e3a4e6db5468eac698e91e7f32b
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: vidc: Supress non fatal Session errors

FW sends SESSION_ERROR for various reasons. The session error
might not be fatal always. This is conveyed using event_data1.
Driver needs to process this message and supress non fatal
errors and reports only fatal errors to clients.

Change-Id: If9ded26977805e2c2299ef1c4a63212d2679495c
Signed-off-by: Praneeth Paladugu <ppaladug@codeaurora.org>
sync: signal pt before sync_timeline object gets destroyed

There is a race condition

Assume we have *one* sync_fence object, with *one* sync_pt
which belongs to *one* sync_timeline, given this condition,
sync_timeline->kref will have two counts, one for sync_timeline
(implicit) and another for sync_pt.

Assume following is the situation on CPU

Theead-1 : (Thread which calls sync_timeline_destroy())
  -> (some function calls)
   -> sync_timeline_destory()
    -> sync_timeline_signal() (CPU is inside this
function after putting reference to sync_timeline)

At this time Thread-2 comes and does following

Thread-2 : (fclose on fence fd)
> sync_fence_release() -> because of fclose() on fence object
 -> sync_fence_free()
  -> sync_pt_free()
   -> kref_put(&pt->parent->kref, sync_timeline_free);
    -> sync_timeline_free() (CPU is inside this because
this time kref will be zero after _put)

Thread-2 will free sync_timeline object before Thread-1
has finished its work inside sync_timeline_signal.

With this change we signals all sync_pt before putting
reference to sync_timeline object.

Change-Id: I66d7359cc5dca0352fda49f81953028e98b95993
Signed-off-by: Prakash Kamliya <pkamliya@codeaurora.org>
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
ARM: dts: msm: tune LPM parameters for 8610v1 and v2

Tune low power mode parameters such as "latency",
"time overhead", "steady state power" and "energy
overhead" for 8610v1 and v2.

CRs-fixed: 506262
Change-Id: I817b4082bfbd30ab9a9fe61bbf11b09367842127
Signed-off-by: Murali Nalajala <mnalajal@codeaurora.org>
ARM: dt: msm8974pro: Update GPU frequency tables

Update the GPU frequency tables to take advantage of new power levels.

Change-Id: Ic0dedbadc646b859bba88155d2ac5659184ae130
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
clocksource: Add new feature flag CLOCK_SOURCE_SUSPEND_NONSTOP

Some x86 processors have a TSC clocksource, which continues to run
even when system is suspended. Also most OMAP platforms have a
32 KHz timer which has similar capability. Add a feature flag so that
it could be utilized.

CRs-fixed: 536881
Change-Id: I863678fec5a3021158240f2c5b144c552ba0b16a
Signed-off-by: Feng Tang <feng.tang@intel.com>
Signed-off-by: John Stultz <john.stultz@linaro.org>
Git-repo: git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
Git-commit: 5caf4636259ae3af0efbb9bfc4cd97874b547c7d
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
mm: Update is_vmalloc_addr to account for vmalloc savings

is_vmalloc_addr current assumes that all vmalloc addresses
exist between VMALLOC_START and VMALLOC_END. This may not be
the case when interleaving vmalloc and lowmem. Update the
is_vmalloc_addr to properly check for this.

Change-Id: I5def3d6ae1a4de59ea36f095b8c73649a37b1f36
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
msm: audio: qdsp6v2: Zero the cfg stack var

Write zeroes into the stack variable cfg to ensure
no previously written stack data is sent to
user-space.

Change-Id: Ie571949e3613c9e5a916b23e1dc19605496d9dbf
CRs-Fixed: 551574
Signed-off-by: Kenneth Westfield <kwestfie@codeaurora.org>
msm:camera: Add support for AV time stamp for VT call

For vt call we need to update the camera buffers with AVTimer
timestamp instead of normal kernel time stamp to prevent
AV sync issues

Change-Id: I4aecf03c45b7dc36c255b122385cee561c7ae40f
Signed-off-by: Abhishek Kondaveeti <akondave@codeaurora.org>
Signed-off-by: Alok Kediya <kediya@codeaurora.org>
msm: 8x10 BKE settings patch

For the display we limit BW to 300MBps when the request is 800MBps
VFE at P3, MDP DMA at P2, MDP PPP at P1

CRs-Fixed: 506183

Change-Id: Ie00ad942d8d78be07ad4e90ff6f4fe6247d2743a
Signed-off-by: Saurabh Saxena <ssaxen@codeaurora.org>
msm: mdss: hdmi: Proper CEC line busy check

Checks the CEC (Consumer Electronics Control) line for availability
properly so that in case of line being busy it can send re-try
request.

CRs-Fixed: 552367
Change-Id: I75dae23738d791de9a75b78a14e62cd3c40fa2c4
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
ARM: dts: apq: enable dsi device node for dragonboard8074

Enable dsi panel device nodes by default so
they are available for the respective controllers
to initialize when required. This allows to implement
the ability to override the choice of default primary
display panel which can be used for panel characterization
purposes.

Change-Id: I32bbf28f77761ca9d62cf3e3ce31f99033e1fb3c
Signed-off-by: Asaf Penso <apenso@codeaurora.org>
ASoC: wcd9320: remove hard coded mad mic bias

Currently MICBIAS1 is hard coded as bias needs to be turned on
by MAD HW. Expose a control to user space to set MIC input needs
be used by MAD. Based on the mic, set the correct mic bias to be
used by MAD HW by scanning machine audio routes.

CRs-Fixed: 538266
Change-Id: Ib85be87e50554b9587f7bafb5b58333a88df6766
Signed-off-by: Kiran Kandi <kkandi@codeaurora.org>
msm: camera2: cpp: Reset MICRO block before clock enable

The MICRO can be triggered to enter in bad state when the
corresponding clock is enabled. This patch resets MICRO block and
then enables clock.

Change-Id: I08128211e561026eed76041e73fa971ba369576a
Signed-off-by: Rajakumar Govindaram <rajakuma@codeaurora.org>
defconfig: enable imx132 sensor

enable imx132 sensor as front camera sensor.

Change-Id: Ib8751f44043e30447d694447e5e9b40a84356d4e
Signed-off-by: Xu Han <hanxu@codeaurora.org>
ARM: dts: msm: Enable flash for imx135 on mtp and fluid

Flash is enabled for camera sensor imx135 on 8974 mtp and fluid
devices.

Change-Id: Ic8bc74e8a76d156cb7c6f1bc6ff502b76d010e0b
Signed-off-by: Xu Han <hanxu@codeaurora.org>
msm: mdss: Validate input argument

MDP kernel function allocates memory using one of the input
parameters. Add sanity check for this input parameter to
ensure proper memory allocation.

Change-Id: Ib7ff3b02e818c0d2a623fb3428fb93cc5bd8e41e
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
msm: mdss: fix double sync fence put in buf sync function

If an error occurs after setting acquire fds, the list of sync fences
will be put for cleanup. However if mdss_fb_wait_for_fence() is called
this will also wait and clear the list of fences, since we are relying
on local variable for cleanup, it may not reflect the state after the
function call. Fix this by maintaining the proper state of the list.

CRs-fixed: 548042
Change-Id: I4885eb393ac9bd2b4818292b9a60f53fb4baacc8
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>