arm/dt: msm8974: Increase "ib" values for VIDC DDR bandwidth request

As per the recommendation by performance team, update the
"ib" values for DDR BW requests. This change fixes the
display under-runs seen during video playback.

Change-Id: I137814c82b257b8c751dab9df4f705e43fd5643e
Signed-off-by: Vinay Kalia <vkalia@codeaurora.org>
sync: Limit logging to particular fence on timeout and error

Signed-off-by: Prabhat Awasthi <pawasthi@codeaurora.org>
Change-Id: I5bd7d62260666cdd2a32212f0e828d2d5d7d7bba
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: increase adsp heap size for msm8974

For hevc hybrid codec, adsp heap size needs to be increased to
64MB to support 1080p video.

Change-Id: I3812cc2f0204f18fbade9ae41d8e784909055569
Signed-off-by: Arun Menon <avmenon@codeaurora.org>
ARM: dts: Enable additional GDSC collapse modes based on HW version

8974v2.2 supports additional collapse modes for Oxili, Venus,
and MDSS. Move the device-tree parameters that disable the modes
to version-specific files. Some MDSS collapse modes should still
remain disabled, even on v2.2.  All collapse modes are supported
on 8974Pro.

Change-Id: Ic9f1c057d16042d9a9c339dc5786cf35301169f0
Signed-off-by: Matt Wagantall <mattw@codeaurora.org>
ARM: dts: msm: modify memory reservation requirements for tmc-etr on 8974

The CoreSight TMC-ETR driver is modified to meet its coherent memory
allocation requirement using dma_alloc_coherent api instead of custom
allocate_contiguous_ebi function. Add support to the device tree to
specify this memory requirement.

Also retain the dt entry to allocate contiguous memory via
allocate_contiguous_ebi api until the corresponding driver changes go
in to prevent breaking TMC-ETR functionality.

Change-Id: I67b4813ab45d520311765500513ea265fb33188e
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: modify memory reservation requirements for tmc-etr on 9625

The CoreSight TMC-ETR driver now meets its coherent memory allocation
requirement using dma_alloc_coherent api instead of custom
allocate_contiguous_ebi function. Add support to the device tree to
specify this memory requirement.

Also retain the dt entry to allocate contiguous memory via
allocate_contiguous_ebi api until the corresponding driver changes go
in to prevent breaking TMC-ETR functionality.

Change-Id: I7e6288ad8a7c7583636ef221888e1774ba40d3ba
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: modify memory reservation requirements for tmc-etr on 8226

The CoreSight TMC-ETR driver now meets its coherent memory allocation
requirement using dma_alloc_coherent api instead of custom
allocate_contiguous_ebi function. Add support to the device tree to
specify this memory requirement.

Also retain the dt entry to allocate contiguous memory via
allocate_contiguous_ebi api until the corresponding driver changes go
in to prevent breaking TMC-ETR functionality.

Change-Id: I0aaab3aa2d79aac0c8cc523fe33e00ca55e0fac7
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: modify memory reservation requirements for tmc-etr on 8610

The CoreSight TMC-ETR driver now meets its coherent memory allocation
requirement using dma_alloc_coherent api instead of custom
allocate_contiguous_ebi function. Add support to the device tree to
specify this memory requirement.

Also retain the dt entry to allocate contiguous memory via
allocate_contiguous_ebi api until the corresponding driver changes go
in to prevent breaking TMC-ETR functionality.

Change-Id: I96785e3f876b1745ed84610cd2d85a1756bf671c
Signed-off-by: Aparna Das <adas@codeaurora.org>
coresight: add lpae support for coresight tmc driver

Modify the CoreSight TMC driver for LPAE so that it can support
ETR physical addresses greater than 32 bits when LPAE is enabled.

Change-Id: I6db2c98c4db70262ab45f7ff11fe2a6846259f8a
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
coresight: Add support for byte counter interrupt feature

The CoreSight block can produce an interrupt on transfer of
programmed number of bytes to ETR-memory. Use this feature
to provide an interface to manage the byte counter value and
to collect a continuous data stream from userspace.

Change-Id: Ic00c9b19483be566d0f05005936b4a6ff7ab52f1
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
coresight: use dma_alloc_coherent for allocating tmc-etr memory

The CoreSight TMC driver when configured for ETR requires uncached
memory in RAM to which it routes trace data. In order to allocate
this memory replace existing allocate_contiguous_ebi api with
dma_alloc_coherent api which is the linux standard of allocating
memory.

Change-Id: I59f88009f2abed95fd9b81ea92a7d484b9d6b833
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: remove contiguous etr memory reservation support for 8974

The TMC driver now uses dma_alloc_coherent api to allocate contiguous
memory instead of allocate_contiguous_ebi when configured for ETR. This
eliminates need to specify EBI memory reservation requirement, remove
the same from dt.

Change-Id: I689613002b65e7c84938f89ce9794d2a165d9aeb
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: remove contiguous etr memory reservation support for 9625

The TMC driver now uses dma_alloc_coherent api to allocate contiguous
memory instead of allocate_contiguous_ebi when configured for ETR. This
eliminates need to specify EBI memory reservation requirement, remove
the same from dt.

Change-Id: Ief2aefb02f6dbdec6e5d65f76f6769baa9899650
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: remove contiguous etr memory reservation support for 8226

The TMC driver now uses dma_alloc_coherent api to allocate contiguous
memory instead of allocate_contiguous_ebi when configured for ETR. This
eliminates need to specify EBI memory reservation requirement, remove
the same from dt.

Change-Id: I77f4bf41372311b87c3d8bb4dc0fdc1a989c750c
Signed-off-by: Aparna Das <adas@codeaurora.org>
ARM: dts: msm: remove contiguous etr memory reservation support for 8610

The TMC driver now uses dma_alloc_coherent api to allocate contiguous
memory instead of allocate_contiguous_ebi when configured for ETR. This
eliminates need to specify EBI memory reservation requirement, remove
the same from dt.

Change-Id: I269be8e8d3ecfa10e5a26841e88d939c3be0248a
Signed-off-by: Aparna Das <adas@codeaurora.org>
coresight: enable flush-on-flushin for periodic flush to usb

Periodic flushing for ETR to USB uses ETR flush-on-FLUSHIN
external input. Hence, enable flush-on-FLUSHIN by default when
enabling ETR to USB transfers and work around the manual flush
failure by skipping it during ETR to USB disable. Adjust the
periodic flush threshold to the maximum value in order to
reduce the overhead when there is no data to be transferred.

CRs-Fixed: 461885
Change-Id: Ie3a1bbc80e017f187af56fcfdfb52297ba9aa72d
Signed-off-by: Pratik Patel <pratikp@codeaurora.org>
ARM: dts: msm: remove ebi cache dump reservation for 8974

The cache dump driver no longer uses the deprecated ebi memory
reservation api to reserve memory. As such, remove the
reservation from the device tree.

Change-Id: Ib016094da95c0dbc4520b9e3ed657487b180c853
Signed-off-by: Pushkar Joshi <pushkarj@codeaurora.org>
msm: msm_bus: Change priority overrides based on master configuration

When BIMC master enables BKE (in limiter mode), priority override
should be disabled since master is getting limited bandwidth.
However when BKE is disabled, make sure priority overrides are enabled
if master is in fixed mode.
Also enable the bke bit as part of switching QOS modes.

Change-Id: I318b3542f3f5da5685d5641701e0b6c8fc64732c
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Sagar Dharia <sdharia@codeaurora.org>
msm: msm_bus: Changes for QOS computation at BIMC

Modify the computation of dynamic QOS parameters for BIMC. The bandwidth
paramter was incorrectly assumed to be in beats/s, it is infact in bytes/s
so there is no need to take bus width into account.
Also change resolution for statically prgrammed grant period to nano second
from micro second since each tick of the QOS clock is in the nano second
range.

Change-Id: Iad9ebc7837b769f8cd9c4215cb102f6916c0845d
Signed-off-by: Girish Mahadevan <girishm@codeaurora.org>
Signed-off-by: Amir Vajid <avajid@codeaurora.org>