msm_fb: display: check pipes queued before enter wait_for_completion

Timing generator will not be turned on if there are no pipes queued.
Therefore wait_for_completion may never be completed if there have
no pipes queued.

Change-Id: Iafba086e4ba20b31470c9fd385c4f5c474ecadcf
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Mayank Goyal <goyalm@codeaurora.org>
msm_mdp: Add Venus color format support to MDP header file

Add Venus color format which is supported by newer platforms.

Change-Id: I2451375b9fb91cd4d4776cae4c5444902db5479e
Signed-off-by: Sushil Chauhan <sushilchauhan@codeaurora.org>
spi_qsd: Support delay per transfer if requested by the client

Client has ability to request delay per transfer through SPI
framework. SPI controller driver needs to put this delay after every
transfer. However, this also means that multiple transfers per message
cannot be combined to be able to insert this delay per transfer.
CS will be de-asserted after completion of each transfer
on older version of QUP/SPI core.

CRs-fixed: 416186
Change-Id: Id9266ce7043e020fa7e1233c66baba30ba3d496c
Signed-off-by: Gilad Avidov <gavidov@codeaurora.org>
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
Signed-off-by: Alok Chauhan <alokc@codeaurora.org>
(cherry picked from commit 525593d47c425c666bdbe73c592fd5ff37cf622e)

Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
defconfig: msm8960-perf: Enable SYNC and SW_SYNC

Change-Id: I09188c88c3d8a1602b75ee5dd792fc0139ca6da3
Signed-off-by: Vince Leung <vincentl@codeaurora.org>
msm: camera: Copy the frame_id from the diverted frame.

When a frame diverted to daemon for postprocessing is being
sent to user, copy the frame_id from the diverted frame along
with the timestamp information. Otherwise user will not be able
to match this frame with other frames based on its frame_id.

Change-Id: I1d2ed83361ca90e89d27925830cae08226d05483
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
Signed-off-by: Ninad Patgaonkar <ninadp@codeaurora.org>
msm: camera: Add missing frame_id copy from diverted frame.

When a frame diverted to daemon for postprocessing is being
sent to user, copy the frame_id from the diverted frame along
with the timestamp information.

Change-Id: I268148e28f8b055fceb13acf57336ce671c0c3d0
Signed-off-by: Kiran Kumar H N <hurlisal@codeaurora.org>
Merge "msm: camera: Copy the frame_id from the diverted frame."
Merge "msm: camera: Add missing frame_id copy from diverted frame."
gpu: ion: Request highmem pages for IOMMU heap

When allocating pages for IOMMU heap it is advantageous
to try to allocate pages from highmem in addition to
lowmem since clients using the IOMMU heap can use
either highmem or lowmem.

CRs-fixed: 430457
Change-Id: Ifc794fc344c67dd53d8f7cebf86536ab9d44ed6c
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
gpu: ion: Use writecombine for uncached mappings

When we map ion buffers as uncached we want to map them as
uncached but still be able to use buffering of transactions
since turning off buffering has a severe performance impact.

Change-Id: I5a09ac34bd3ce3f001d10d9efd71d140f632564d
Signed-off-by: Olav Haugan <ohaugan@codeaurora.org>
msm: kgsl: Define unique values for context flags

Use BIT to define all context related flags. This ensures
that these flags are unique and is easier to maintain. Also,
fix spelling of CTXT_FLAGS_BEING_DESTOYED to
CTXT_FLAGS_BEING_DESTROYED

Change-Id: I866c67b9c5d59d6117e31714756af3106018f9cb
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
msm: kgsl: Check for valid pointer before dereferencing

Check to make sure that there is a valid context pointer before
dereferencing it when adding commands to the ringbuffer.

Change-Id: Icf9824de8f62a28cdeeef4378246d9fb334d39fa
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
msm: kgsl: Add support to use timestamps from userspace for an issue

Use timestamp from userspace instead of incrementing context's last
issued timestamp. This allows userspace to defer submissions to KGSL.

Change-Id: I2a104f97420f73dac3bbd23464e92e6ea9d92869
Signed-off-by: Vijay Krishnamoorthy <adivarah@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm: kgsl: Add a flag to context struct for bad timestamp waits

If the userspace calls the waittimestamp ioctl with an invalid
timestamp for a context then set a flag indicating that the ioctl
was called with an invalid ts. If the flag is set then do not
print error message about this ioctl being called with an invalid
timestamp. This is required to prevent the kernel log from
spamming with error messages and causing a watchdog.

CRs-fixed: 374586

Change-Id: Iffa5c13d74ed90b78f88aba5c4c0e0f908eeaa19
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
msm: kgsl: Move the adreno WPTR poke logic to the hang detection

Sometimes a write to CP_WPTR fails to latch on A20x GPUs. In the past
we worked around this by writing to WPTR numerous times in the various
loops that waited for GPU activity.  Consolidate these disparate calls
by moving the poke into the hang detect function.  If the core is idle
but the RPTR != WPTR, then rewrite the WPTR and go back through the
loop again.

Change-Id: Ic0dedbad474c7884c2467fe050d8afe673588add
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
msm: kgsl: Support user specified timeouts in adreno_waittimestamp

We have always allowed the user to specify a timeout in waittimestamp
but we never obeyed it.  Reorgaize the function to be less convoluted
and support a user specified timeout (or spin forever if 0 is passed).

Change-Id: Ic0dedbadbc368336d05b14d66829205631046515
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
diag: Add logs & events streaming support for DCI

Diag driver is adding a new feature to stream logs & events to a
user space application on Linux processor. This will eliminate
need to connect QXDM to receive diag traffic.
This is known as Diag Consumer Interface (DCI).

Change-Id: I7983bb7d9b8a0429ebbee290868c8bd0e562953f
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
diag: Add fixes for DCI

1) Fix an issue where after running a DCI app and exiting it,
 second app does not receive any DCI data. Issue was due to
 incorrect state of a flag used by SMD channel.

2) Add a mutex around shared data structures like cumulative masks.
Multiple clients may want to change DCI mask at the same time, so
mutex will prevent any corruption

3) Add support for health commands. The client request how many logs
were dropped and received.

Change-Id: Ica12b3c93aa4dda9b04aa13cd5a9f8dbc412148c
Signed-off-by: Shalabh Jain <shalabhj@codeaurora.org>
diag: DCI Multi-Client Crash Fix & Cummulative Log and Event Mask Fix

Clearing the DCI Log and Event Masks did not change the cummulative
masks properly. This fix updates the masks whenever there is a change
in the log and event masks. Also, this fixes a NULL pointer issue
when there is more than one DCI Client

Change-Id: Ia92751ffb7a12b65fd81725257746d732804d6ae
Signed-off-by: Ravi Aravamudhan <aravamud@codeaurora.org>
diag: Rename QDSP to LPASS

QDSP can be used as modem and does not always mean LPASS. This variable
is used for LPASS functionality, thus renaming it to LPASS.

Change-Id: Id4ca0ff57deff5605836d3e215496138287308d5
Signed-off-by: Ashay Jaiswal <ashayj@codeaurora.org>