msm: camera: Maintain buffer queue in isp buf manager

we encountered a problem where we are trying to free one
of buffers from previous ion session and this is resulting
in a BUG_ON because of mismatch of ion_handles.

Inorder to avoid this we are now maintaining a queue for
all the buffers during prepare buf and we unprepare only
if the buffer is present in this queue.

Change-Id: Id40840b54930d4f90458ad2c888c5c7853ec239b
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
msm: camera: check buffer validity in isp buf mgr

When someone asks for buffer from isp_buf_mgr, check
if buffer is valid. This is done by verifying if it is
present in the list of buffers for this session.

This will potentially avoid few kinds of page faults.

Change-Id: Ica4724769b9dd4532ddfe468b6a4309f1968812b
Signed-off-by: Aditya Jonnalagadda <ajonnala@codeaurora.org>
defconfig: msm8974: Disable CONFIG_MSM_L2_ERP_1BIT_PANIC

Single-bit L2 parity errors are fully correctable. Continue to log
these errors, but no longer panic on them.

Unrecoverable errors will continue to be treated as fatal.

Change-Id: I82e0407daaad1e177770216abbbe54e702490277
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
wcnss: Add two registers to wcnss dump

When a WDI timeout or Watchdog bite happens at WCNSS, certain WCNSS
registers are logged for debug purpose.  Add alarms txctl and alarms
tactl registers to the dump

Change-Id: Id79345666dd7e5b3d43b13fff5d8230e4fd38655
CRs-fixed: 587892
Acked-by: Yuanyuan Liu <yuanliu@qca.qualcomm.com>
Signed-off-by: Sameer Thalappil <sameert@codeaurora.org>
msm: mdss: Distinguish BL_DCS_CMD from DCS_CMD on 8x10

BL_DCS_CMD should be sent in HS mode on 8x10 as that could
reduce the dcs command transfer time in blank period.

Change-Id: I841dc788808ea10848f0b06d5b3f4fa010f51b17
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
msm: mdss: fix overlay set issue on 8x10

The driver was assuming the color format and resolution
of the overlay to be the same as frame buffer.  This
causes page fault and corruption if the client is using
a different color format or resolution.   The change is
to re-configure the dma pipe if the overlay configuration
is different from the default.

Change-Id: Ic7558811a3015a416b2428fb0d626bf13663e528
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: mdss: allow histogram stop operation while display is off

After the display is off, the user space can still call histogram
stop operation.

Change-Id: I5c28b3e7e0529319de9d22ca49bdd606994cf7fd
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
mdp3: Enable sw vsync when dma is not active

Recently in an attempt to enhance sync event reporting we
prevented sw vsync when dma is turned of from toggleing display
off and on.

Change-Id: I71c9be55d36dc92e513d9f5ead4d1e42157285c6
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
msm: vidc: Send ABORT in FLUSH command from the Client

When session error is sent to the client, client issues FLUSH
and release buffers commands. But as instance state is INVALID,
these commands are never sent to the firmware, instead FLUSH
DONE and Release buffer done are sent back to client even
though firmware might be working on these buffers which may
result into page faults.
This change fixes the issue by sending ABORT command to the
firmware at the time when driver receives FLUSH command. Then
firmware will release all buffers, clean up session and send
ABORT_DONE back to the driver.

CRs-fixed: 592920
Change-Id: Ie4c79a312d2336c68b858f5f5e2a85331cf55f7b
Signed-off-by: Deepak Verma <dverma@codeaurora.org>
msm: mdss: set the mdp core clock rate on 8x10

During the kernel initialization, we need to set
rate on the mdp core clock rate.  Otherwise, the
core clock rate is at its minimum, causing display
under-run on large panels.

Change-Id: Idcd69a758cbf3022f8ad6590b021f21dad5972b1
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
msm: kgsl: Do not log by default if context not found in FT detection

Fault tolerance timer runs every 50ms and there are times when we
do not find valid context in memstore, this is not a useful log and
do not log this in kernel log by default.

Change-Id: If62823fbf97dd24200929aefa2a2923aea1af4aa
Signed-off-by: Tarun Karra <tkarra@codeaurora.org>
msm: kgsl: Fix mem leak when page allocation fails

Page allocation may fail during OOM condition. Update
sglen and size to correct value (allocated) so that
they get freed in kgsl_sharedmem_free().

Change-Id: I1aa0ca77bb767523dfcf0f6cc3a21eac2b6b80e4
Signed-off-by: Hareesh Gundu <hareeshg@codeaurora.org>
msm: vidc: add sleep of 100us before clock disable

ARM9 execute following sequence when venus is idle
1. Disable ARM9 watchdog
2. Set bit 30 of A_VENUS_CPU_CS_SCIACMDARG0 register
   to indicate venus is idle
3. Write HFI_MSG_SYS_IDLE to message queue
4. Raise interrupt to host
5. ARM9 execute wait for interrupt instruction to go
   into low power state. This will internally drain the
   ARM9 write buffer which can generate bus transaction.
6. ARM9 in idle

Host clock gate venus based on following sequence
1. Host receive HFI_MSG_SYS_IDLE from the msg queue
2. Host check both cmd / msg queue are empty by
   comparing the queue read/write pointers.
3. Host check bit 30 of A_VENUS_CPU_CS_SCIACMDARG0
   register to confirm it indicate idle
4. Host clock gate whole venus

As the host clock gate venus in step 4, ARM9 is still
in step 5&6. The sleep will ensure that step 5 and 6
are completed before host clock gates venus.

CRs-Fixed: 589417
CRs-Fixed: 595251
Change-Id: Idf1f788718adea2dacceca97afa4ba4fe4562ddd
Signed-off-by: Vikash Garodia <vgarodia@codeaurora.org>
msm: mdss: Fix software overfetch during video playback

Bottom border of video is greenish, due to unnecessary
code to disable overfetch at the bottom. Remove this
unnecessary code.

CRs-Fixed: 588809
Change-Id: I57002af21d0d53de96da7b277f44b8bc4f7072a0
Signed-off-by: Mayank Chopra <makchopra@codeaurora.org>
Merge "msm: mdss: Fix software overfetch during video playback"
Merge "msm: kgsl: Do not log by default if context not found in FT detection"
Merge "msm: mdss: Distinguish BL_DCS_CMD from DCS_CMD on 8x10"
Merge "mdp3: Enable sw vsync when dma is not active"
Merge "msm: camera: Maintain buffer queue in isp buf manager"
Merge "msm: camera: check buffer validity in isp buf mgr"