Change to make the vsync IOCTL no wait during the disable sequence.
This is to increase the performance. Handle the synchronization of
vsync interrupt using state variables in drivers from now.
Change-Id: Ia5ec14493f233a95f21d01ea627200a6c278239f
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Handle enabling/disabling the vsync interrupt and mdp clock
enabling/disabling in a better way on MDP 3.03 targets. This
will avoid target crashes due to unclocked register access.
CRs-fixed: 388751
Change-Id: I5c4a409772464ce7d06869374dcba5ad7e335955
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
When mdp commits a buffer to play, functions inside pan display, e.g.
mdp4_overlay_mdp_perf_upd are based on the current state of play, so
extending mutex to the scope of pan display to avoid race conditions.
Change-Id: I2e55567fd21de3738be066a2dee298d8122f12a3
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Disable IRQ for DSI_CMD_TERM was already called in the isr.
Removing the extra call present in the cmds_rx API's.
Change-Id: I0000dd3166beb2a3b0c788327e1d7520e0c11a13
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Add wait4videodone to commit dcs commands to dsi controller
while video engine is busy so that dcs commands will be
transmitted to panel at next beginning of BLLP.
Change-Id: I7ca40124813452f25a60f899437aeb9bce6feb14
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Pipe is not un-staged from mixer when it is unset.
It expects a pan_display() to un-stage it out of mixer.
Return fail at overlay_set() if pipe was still stage
at mixer.
CRs-fixed: 399193, 393979
Change-Id: I562f6e133bb239b30f4f53669dbf1cc5ddf80d02
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
There has VG1 pipe commit (pan display) happen after system
suspended. This left VG1 still staged up at mdp mixer. Once timing
generator is enabled at resume, VG1 pipe start fetching contents from
address 0 since VG1 has not yet be configured. This cause page fault.
This patch has sanity check at system suspend to make sure no any pipe
stage up at mixer after suspend.
Change-Id: Idcf974ceb4afe2a3ec55b9603b700fa497f84045
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
For the panels that have low v_back_porch, if h/w FIR scaling is used,
during vbp time, mdp clk should be fast enough to output a line from 4
input lines. MDP rate equation for very small scaling, e.g. 1 or 2
pixels' upscaling or downscaling cannot cover this case, where
underruns are seen on those panels.
Change-Id: I4f35f98c2c1bc4ef04dfee193427bd3ff674945d
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
MDP4.1 blend operation registers are not double buffered and
take effect as soon as they are configured. Configuring these
registers at any place other than between dma and vsync produce
flickers as new blend values would get applied to previous
mixer configurations. Configure blend operation registers just
after dma is over, before vsync.
Change-Id: I377c11222f7a0cd77e98e90edec6e2e1dc0c17ca
Signed-off-by: Pradeep Jilagam <pjilagam@codeaurora.org>
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Update LPA platform driver to register restart callback.
The implementation of the callback is to issue a pending buffer
written by the application to restart the session when the dequeue
process is stopped due to underrun issue.
The callback is triggered from ALSA core when the framework
detects that the renderer stopped pulling data but the application
is still writing data. It runs in atomic context.
Fixes:
-A disturbance was heard when switching from one song
to the other, or when the song is paused for greater
than 3 seconds and then resumed
-This was due to the previous value of the track
volume being used in the lpa driver
-This was fixed by setting 0 as the initial volume
Change-Id: I035760937d032038fb3f3383dc87ecbdc5f4700d
Signed-off-by: Subhash Chandra Bose Naripeddy <snariped@codeaurora.org>
If actual_freq of gpu is not updated when a gpu floor
is set, TZ is unaware of the gpu frequency change and
computations are based on an incorrect value. By setting
actual_freq, TZ is notified of the new gpu frequency at
the next idle exit.
Change-Id: Ifc69996ef309ed4f8a5d46a2048757e57dd1a8ec
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 81599d50a0d122c52c966279640d6d8c64def656)
The active and leakage energy offsets for each frequency are
best left configurable from userspace to make tuning easier.
Change-Id: I435a30d46cc02861dd7e8371b21d0433c0aa6a28
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 8104d6dde814e8dbb4f91a3e37a19627e7512f50)
It is desirable for performance reasons to be able to run dcvs
with different algorithm parameters depending on the number of
CPUs that are online. The algorithm parameters are already replicated
per-CPU, but all CPUs operate in DCVS with the same parameters at
any given time.
These per-CPU parameters now correspond to the total number of CPUs
online. For example, if 2 CPUs are online, the algorithm parameters
for CPU2 are used.
Change-Id: If308a2fa949ac669823e759e0fd8e2cdbf6e4c03
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit c48381e2336125410549d7df1425dc8009c0c495)
Performance is enhanced if the GPU frequency is floored at its
maximum nominal frequency when multiple CPUs are online.
Change-Id: Ib6bfd5007d660064844876b06f552f4d8c84865c
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 749f301c94312d2ec827c67cecb858e02383c8ab)
Once a gpu calls stop_sink and is no longer participating in dcvs, we
should not call set_floor_frequency callbacks for that gpu.
Change-Id: I3cde82dc9975bcb37f065ea7ab8eb88a8f7fc933
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 77c66a3c6c27729aa0594b2f1b140aaf8f556b67)
If there is a pending frequency update when a core stops
acting as a dcvs sink, it should just be dropped, rather
than trying to honor that last frequency request.
Change-Id: Iac30cc7e06a8a70eecc4da712fdf160b788a7c2c
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 016af00bf66bb267cab573131598edbf83204f3f)
Temperature updates should not be sent continuously just
because a core has registered with dcvs. Instead, start
and stop the updates when the core starts and stops as a
dcvs frequency sink.
Change-Id: If7721f523eb44026c421dd7ec4fa3975bc65cd09
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 4eb5d7cf22bbea963251ff70a7b4e28a2d883b77)
To avoid spending a lot of time at once in the cpu hotremove
path, do not perform multiple hotremoves back to back.
Change-Id: I78a643f73718e4e08786193c71bbe2237aa790d2
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 9c0aa035f7aeac1b1039125bf27d51d11861fa03)
System performance is enhanced if the gpu frequency is given a
minimum corresponding to various frequency levels of CPU 0.
Change-Id: Iba168d708524fc8ef164428bb5f4e0631a499342
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 682c7a01c1d86518cdc7bec25cb413498811137b)
Target reset happens when trying to do a ion_unmap_iommu
on the above fd, which was never mapped. Added a check for
non-zero virtual address.
Change-Id: I9a4d81eea6ee0cdbe3e8bbcb0c1d05c005680555
CRs-Fixed: 394779
Signed-off-by: Srinu Gorle <sgorle@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
DCVS only expects a core to be registered once and kgsl reregisters
the core every time the policy changes. Kgsl should only do the
sink start and stop every time and only do the register the first time.
Change-Id: Id54f078d6013586899bf85fc2462e6c473ffc6b5
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
(cherry picked from commit 229d24c088699c5f7a3591e5335dcc1668e5e913)
CPU frequencies can differ between different revisions, so create
the table of cpu frequencies dynamically based on data from
acpuclock rather than using a fixed table.
Some of the data in the table comes from sync points that will be
implemented between CPU and GPU frequencies. The sync points are
defined here, but the sync implementation itself will come in a
subsequent commit.
Change-Id: I24cf17b199df1e5d064c1894b269e49118b39ac7
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit f9a8749b17961be653e9cbb426b1b72cada7f61c)
It is not necessary to run these threads at a realtime
priority level.
Change-Id: I8c6492f22e803811db5757c51beeeb81f93f32b6
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 8862f41f1c632ba84f0a21e8045d70278fd67fd3)
It is useful to be able to toggle at runtime whether
particular DCVS points are used as transient levels. This
adds a sysfs node per core which when read returns a list
of the currently enabled DCVS transient levels. Writing
the frequency of a DCVS transient level toggles whether it
is enabled or not.
Change-Id: I69ebb6974e97efa832798047259b9acdfd08aa7c
Signed-off-by: Steve Muckle <smuckle@codeaurora.org>
(cherry picked from commit 2f6db34b3216695d4f624d2204d5e1356e62c3d5)
This patch ensures that camera is recovered by propogating the
error event when sensor is pulled off.
Change-Id: I4147e02342c2538db8337d3e04735cf97b2d7635
Signed-off-by: Azam Sadiq Pasha Kapatrala Syed <akapatra@codeaurora.org>
Set the defualt IOMMU count to two for the GPU.
If the device is 8960 (ie not 8960PRO), set the IOMMU
count to one and let kgsl take care of initializing only
one IOMMU device.
Change-Id: I736a6d6744c4359ec5cc923d6eddd652451c81a1
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Gopal Goberu <ggober@codeaurora.org>
The graphics 3d ports need to be separately halted/unhalted.
Facilitate this by mapping to separate external IDs.
Change-Id: I88221ba574267ffcc42d1b30df3c77647df3df8f
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Neha Pandey <nehap@codeaurora.org>
CONFIG_MSM_WFD needs to be set to build wfd driver.
Change-Id: I9d3ee99998fe284bfaad59dc15f44a295fe9f0e4
Signed-off-by: Arun Menon <menon@codeaurora.org>
(cherry picked from commit dbea05705f5ac5fe266f3cf75cc839e53bbb67fa)
To make sure for each writeback play the reg is configured and avoid
mdp hang.
Change-Id: I29bdc31f27accca84e7add126c1c1e3c8a78fa15
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 36ca4e992dc5c75a2dd709969db850aa02e7c6e7)
Add the logic for wfd writeback interface. It already presents on
other display interfaces.
Change-Id: I389be77ec18041e260d0e71940586e86f1841ff8
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
(cherry picked from commit 3df55288659cfa826e9ad89cb38a8b722b2ae20f)
pm8917 dsi regualators missing the dsi pll client which is causing
the clock warnings while system suspend
Change-Id: I9ffa310df81b66d3adf8c272666c4d3d9f933103
Signed-off-by: Nagamalleswararao Ganji <nganji@codeaurora.org>
(cherry picked from commit c2e5752d280d1ab8fb3efe341fcb3a56c7bd1a65)
(cherry picked from commit 30f86aa5c694215b89965b633330af4459f1c4e3)
MSM8930 with PMIC8917 does not support HDMI. This change
ensures that HDMI clocks are not set/reset as part of the
MDP GDHS sequence for this particular cofiguration.
Change-Id: I020a87b5c96df3c75b47aa13b65da0f03eb60b00
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
(cherry picked from commit 67d033439cd3d632a062b76bb6e74a5819c99851)
(cherry picked from commit d49ea2e1924bde3d67e8bb9195cc81c88a119d69)
This change handles panel updates for WFD panel via
overlay_commit interface, along with conglomeration of
some common code across pan_update and overlay_commit ioctls
Signed-off-by: Kalyan Thota <kalyant@codeaurora.org>
Conflicts:
drivers/video/msm/mdp4_overlay.c
drivers/video/msm/msm_fb.c
include/linux/msm_mdp.h
Change-Id: I9e332856782c59ab598bb388a2ec482076746ad2
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
Overlay_play() adds a pipe into pending queue and pan_display()
will commit those pipes to hardware and empty queue. This patch
will make sure queue is empty at suspend so that no unexpected
pipes will be commited to hardware by pan_display() at resume.
Otherwise, iommu page fault may happen.
Change-Id: Iafdf469c6cdbf5d469c9dee114555a8d1adb9c66
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Conflicts:
drivers/video/msm/mdp4_overlay_dsi_cmd.c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
To improve performance, hardware vsync event at mdp driver
is passed to framework so that both composition and frame
update are aligned at vsync event. This patch will upgrade
wfd to incorporate vsync driven frame push in consistence
with other interfaces.
Change-Id: If088826ec387446301f1f6acc311d909edb04163
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
(cherry picked from commit d74db5fcf24a223570137087aa5632593b315fcc)
Conflicts:
drivers/video/msm/mdp4_overlay.c
drivers/video/msm/mdp4_overlay_writeback.c
Signed-off-by: Sudhir Sharma <sudsha@codeaurora.org>
When subsystem restart is called and the restart level is one the device
will reboot. It was earlier set up to just print out a warning message.
Change-Id: I7a652d64d71bbd7ab8de33e97c01bf3c4c2c7e4b
Signed-off-by: Ameya Thakur <ameyat@codeaurora.org>
Always rest the ts_cmp_enable when an interrupt is received
from the GPU. This keeps legacy code that is not using
per context timestamps correctly updated. No effect is
seen with mainline code using per context timestamps.
CRs-fixed: 418172
Change-Id: I7f29086d4885571bdb165c0e759dc6ffc40b554f
Signed-off-by: Carter Cooper <ccooper@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
When the sysfs entry for max clock is updated, set it immediately for the
devices that has no power scale policy. This prevents the device from
running with undesired clock.
Change-Id: I3211234f6d2afe4c2de115dace70b332d2b30f21
CRs-fixed: 408963
Signed-off-by: Ranjhith Kalisamy <ranjhith@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
With 8974, bandwidth requests are exceeding integer size.
Update ab and ib to ensure values over 4Gbps can be requested.
For 64-bit support, there are four changes in this patch:
Changes in the bus driver structures and functions to
update ab and ib values to uint64.
Updates in client drivers to ensure that the bus APIs
are called with the right types.
Updates to the device-tree. Device-tree nodes don't
provide a clean mechanism to read a combination of u32
and u64 variables within the same property name. So, the
ab and ib values must be specified in kbps instead of
bytes/sec from the device tree. The bus driver function
will convert the ab and ib values read from device-tree
to Mbps.
Change the existing property names to make them consistent
with the convention used by the new property name, which
abides to the Device Tree convention.
Change-Id: Ib0a6db0e221af366c61c51cc21ac722f02cb7a34
CRs-Fixed: 408786
Signed-off-by: Gagan Mac <gmac@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Populate bus vectors for the audio ocmem driver with use of new
bus device tree APIs.
Change-Id: If965c269706763a3a67b22243f265429f23427d6
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Fix issues when alloc grow, shrink requests received while display
off/on. Add return statement to the audio/voice workqueue for the safe
exit.
Change-Id: Ifda7823f68ef0f26b9fe781c4c509c7633291169
CRs-fixed: 404445
Signed-off-by: Phani Kumar Uppalapati <phanik@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Adreno idle detection during a hang was being obstructed when
called from adreno_waittimestamp(). The variable active_cnt which
was meant to protect the device from going into suspend while
doing a waittimestamp was being set and was preventing the
check of rbbm_status register which was leading to a false hang
detection, where, if the rbbm_status register value had been
probed the device would have been found to be idle. We fix this by
having a separate function is_adreno_rbbm_status_idle() which checks
this register and report whether the core is idle or not. And we call
this function instead of the generic adreno_isidle() inside
adreno_hang_detect(). Doing this fixes at least one scenario of false
hang detection.
CRs-fixed: 406631
Change-Id: I44b5446769eaa361cca63674f700153ee3faff45
Signed-off-by: Harsh Vardhan Dwivedi <hdwivedi@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Prevent the iommu fault handler from clearing the stalled status
of GPU on page fault. This will cause a GPU hang and print out
the snapshot that will help in fault analysis.
Change-Id: I9dcab83a098a988f86a0c03c46b0dbe6624de937
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Allow users to specify "big page" mode when allocating GPU
memory. This will attempt to allocate contigious units of 64k
bytes per instead of the usual PAGE_SIZE units. If the allocation
fails, then automatically fall back to allocate the rest of the
region with 4K pages. This means that potentially any allocation
could be comprised of a mixture of 64k chunks and 4k chunks.
Change-Id: Ib92c0c099d3b10ba54dbb864c5f977f8df4912f2
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
io_fraction is set to max so that io_wait gets reported
for DCVS so that MP decision won't offline cores
during GPU activity.
Change-Id: I39db72dd9c443069675a8a1b1f4e17d8928625b8
Signed-off-by: Suman Tatiraju <sumant@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Add a file for each process in debugfs named, kgsl/proc/<pid>/mem
which contains information about all memory allocations the process
has made.
Change-Id: Ice3f039d92cc1b1cdb5a6192808441ddfdf8abfb
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Add a "usage" field to memory allocation, mapping and
free ftrace events.
Change-Id: I673a9593650d5285b0abc8c94de8f9f80d3d449e
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>
Userspace passes a set of values indicating how it
uses each buffer it allocates, which were previously
ignored. These are useful hints for debugging and
profiling applications. These flags will be exposed
through ftrace and debugfs in later patches.
Change-Id: Ie26c26e413c074dcd5dfa24d355443ee47c3cd6a
Signed-off-by: Shubhraprakash Das <sadas@codeaurora.org>
Signed-off-by: Jeremy Gebben <jgebben@codeaurora.org>
Signed-off-by: Rajeev Kulkarni <krajeev@codeaurora.org>