msm: mdss: Add missing BL lock around BL-related info

The bl_updated variable requires the BL lock. Otherwise, it can be
corrupted and cause backlight issues.

Change-Id: I55eb4b8d525765ede4f27a404f5c3f1f0b446719
Signed-off-by: Benet Clark <benetc@codeaurora.org>
msm: mdss: control backlight level during blank and unblank events

Add code to set the backlight level to zero for blank event
and restore the backlight level to its previous value during
unblank event. This will fix any unexpected panel flicker
that might show up on the screen during panel ON sequence.

CRs-Fixed: 608091
Change-Id: I871a067b0cc40d893b8b7e5a25103ebb914f9b7a
Signed-off-by: Chandan Uddaraju <chandanu@codeaurora.org>
Signed-off-by: Benet Clark <benetc@codeaurora.org>
mdss: Dynamic timeout calculation for cmd stop

Time out condition was hard coded to 60 fps. If dynamic fps
feature was used, an invalid timeout might occur.

Change-Id: I0abe52416c10ef4ae0af6f541d22c66f6c8a6b5e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: mdss: make the mdss debugfs implementation generic

Remove the core specific details in the debugfs implementation via
a defined debug interface.

Change-Id: I2bf9ac47e0121f1f269d8d82274143d760305526
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: disable MDP hw underflow recovery

When MDP underflows, hardware will automatically try to issue a reset to
recover from it. Potential issue has been identified when reset happens
on two video interfaces at the same time which may lead to a hw lockup.
To avoid such situations disable the hardware underflow recovery, MDP
will still automatically recover at the beginning of next frame.

Change-Id: I3473486e229e67f6213db83a0ecb34333a977d4f
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
msm: mdss: allow assertive display on write back framebuffer

Reserve a mixer that supports AD to be used for write back and expose a
sysfs node for frame buffer devices which are able to support AD.

Change-Id: I0598a686d251444fc40bb8073ac50750036be7fe
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: mdss: Fix debugfs string overwrite

If more than one display paths are active, like split display or external
mirroring, and stat debugfs node is read then debug data for only one
display is shown. Fix this by using correct offsets.

Change-Id: Ia8b36eb3105f6df8f096ff544b82cc49c9b31a48
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
msm: mdss: Initialize right mixer ROI for split control

This change initializes ROI of the right mixer on dual DSI panels
to its complete resolution. This will ensure that the right mixer
composes to its full resolution when partial update feature is not
enabled / applicable.

CRs-Fixed: 556185
Change-Id: I3c2f2b9a220dc223ef66475d6f6cbfc18c4a67db
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
msm: mdss: Block postprocessing updates during DTM

When calibration tool requests the fb driver to enter in
Display Tuning Mode (DTM), PostProcessing blocks should
not update the HSIC, Memory color, Six Zone colors, etc.
Updating them during DTM conflicts the update from
calibration tool.

Change-Id: I11fcac57a651581d85e771911f83b2fdd9c3c681
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: mdss: Add update notify for backlight change in static screen

Previously, the change of backlight sysfs node value will not trigger
notify updates if display is in static screen case. This will cause
delay or wrong configuration for assertive display. This patch fixes
the above issue by adding an update notify if backlight changes when
there are no display updates.

Change-Id: I1475896214a50dc1fa71739aa751b2e626d27adb
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
msm: mdss: enable fb_split feature for dual-dsi panels

Currently fb_split feature is limited to dual-pipe but single
interface, i.e eDP 2560x1600, panels. Extend use of this feature
to dual-dsi panels as well and by default enable equal split to
support dual-dsi portrait panels, i.e 1600x2560. Default settings
will be over-ridden by split settings from device tree if available.

Change-Id: I38279e1af7dcd1278fa203f51b8b33f82d0848af
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: mdss: check for fb node refcount before calling null commit

Add a frame buffer reference count check before calling
null commit to release the free list pipes. This avoids
unnecessary flickering on screen if a process tries to open
and close the fb node without performing any operation.

Change-Id: I96b824edccf27f0ddb796c420ef1feb49f65ddea
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
msm: display: only release kickoff when no cleanup pipe

If there is some pipe to clean up, need wait for it be done to
make sure the pipe can be used for the second cycle and recover
mode can be executed.

Change-Id: Ifb3fdb152bc4bbf367b3d272aa0c88b1a0650c19
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Neti Ravi Kumar <ravineti@codeaurora.org>
msm: mdss: Add support to configure the video mode interleave bit

Some video mode panels need to have the command mode
operation interleaved on the last line of the video stream.
Add support to enable this register via a panel dtsi property.

Change-Id: I3dfe36816d7602da4f66d09ea23ac9c6185f9858
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
msm: mdss: Calculate plane size correctly for H2V1/H1V2 rotation

Currently, chroma sample is calculated after calculation of plane
size and stride in case of rotation in H2V1/H1V2 formats. Fix
this to correct chroma sample before plane sizes and stride are
calculated.

Change-Id: I851d61034b465d48fd21bb4a015c103457dc7936
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
msm: mdss: fix the pack alignment of MDP output for RGB666 format

Currently for RGB666 format, the MDP output is set as LSB aligned
and banding artifacts are observed due to this. Set the MDP output
to be MSB aligned to avoid these artifacts and for the display
to show up fine with RGB666 format.

Change-Id: Id8b7bf03218dd0ea70ada34912afd092e239b89f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
msm: kgsl: Add a flag to mark user mapped GPU buffers

Add a flag in /sys/kernel/debug/kgsl/kgsl-3do/proc/<pid>/mem
file to indicate for each GPU buffer if it is mapped to userspace
in <pid> or not.

CRs-fixed: 634962

Conflicts:

	drivers/gpu/msm/kgsl_debugfs.c

Change-Id: I8abda74ef5656aca6b1c0315af8deb77460fa5a9
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
arm: mach-msm: Remove the unused rmt_storage code

The rmt_storage module is no longer used.
Remove the unused module and cleanup the makefile and kconfig.

CRs-Fixed: 549951
Change-Id: Ie9ebaa2209ea9fa0df05dc892504fcb882f00f29
Signed-off-by: Nikhilesh Reddy <reddyn@codeaurora.org>
msm-camera: Reset ISPIF h/w

Reseting ISPIF hardware after ISPIF is stopped without frame
boundaries.Enabling all clocks for same.

Change-Id: I3712a2af9a3011769e14fab14ddaa5a32f6bcb90
Signed-off-by: Megha Tak <mtak@codeaurora.org>
cma: Add support for memory limits

Currently, when dynamically placing regions CMA will allow the memory
to be placed anywhere, including highmem. Due to system restrictions,
regions may need to be placed in a smaller range. Add support to
devicetree to allow these regions to have an upper bound on where they
will be placed.

Change-Id: Ib4ae194cbb6389e1091e7e04cfd331e9ab67ad05
Signed-off-by: Laura Abbott <lauraa@codeaurora.org>
[skhiani@codeaurora.org: Resolve merge conflicts]
Signed-off-by: Susheel Khiani <skhiani@codeaurora.org>