On smart panels, Early Clock Gating (ECG), is initiated when current
frame transfer is finished and no new frame update is queued. To track
these two different states, driver maintains the state machine
for HW transfer and SW's new frame update. Currently SW state machine is
cleared only after HW transfer has started. Now in normal scenarios SW
state should be cleared before HW is finished and if there is no new
frame update queued then ECG will be initiated. However due to CPU
scheduling, thread that needs to clear SW state got preempted. In the
meantime HW finished the transfer and updated its state machine in the
interrupt context. Since at this moment SW state wasn't cleared, ECG
was not initiated. Avoid this situation by clearing SW state before HW
transfer is started.
CRs-fixed: 941832
Change-Id: I44828c6077eb8729162127b521f4fd4add2e3bcb
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
This change enables clock update method as default for sharp
WQXGA panel for changing refresh rate of panel.
Change-Id: I08f1a4ee446318174824dbd26dcf9682dbabddc9
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
It is possible to change the refresh rate of the panel by
changing the byte clock and pixel clock to the required panel supported
frequency. This change adds support to program dynamic refresh
registers and trigger the dynamic refresh interrupt. Once the current
frame is done, hardware ensures that the change in clock frequency is
taken effect within the vertical blanking period.
Change-Id: I3a1e0eb478c34111e94f977088c20e9a50c4ef25
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Populate the AFE topology for the RTAC
voice and device structures which allows
retrival of AFE topologies for RTAC
clients.
Change-Id: Ib47e6b04cdfe7146315a800a3f54f9932d54cadc
Signed-off-by: Ben Romberger <bromberg@codeaurora.org>
vsync_handler added in lp2 (doze_suspend) power
state enables the vsync on hardware. That can lead
to unclocked register access because device can go
in pm_suspend in this power state. This change blocks
the vsync_handler processing in lp2 power state.
Change-Id: I4386baa6bc2f8303928edade79108b4983f66f42
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Expose the bandwidth limits and status of bandwidth
limit request to the userspace through sysfs entries.
Change-Id: I697138546689e8d9943c3e5ff47ae6a924b8ddfb
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
WCD9335 can transport data to and from device through I2S and I2C.
Update the change to support I2S/I2C interface.
Change-Id: Ifdec293510adf685410a4fb6ef6a3e939c4ee04b
Signed-off-by: Deven Patel <cdevenp@codeaurora.org>
Add support for NT35950 4K DSC command mode panel. This panel
support DSC with 3:1 compression ratio.
Crs-Fixed: 922330
Change-Id: I6b0c2913851ec948ae84931396276c929bf63b7f
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
struct kgsl_mmu is a static member of struct kgsl_device so we can
use the usual container_of trick to get the device from a mmu
pointer rather than carry around an unneeded back reference.
Change-Id: Ic0dedbad7ff22e598b03d980dfbb738374ed5a7a
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
The MMU code does most of its magic by way of device specific MMU
and pagetable functions. Add macros to make it easier for developers
to verify that hooks exist before calling them.
Change-Id: Ic0dedbadf74682adebec1a973384e1d3bbf4f79e
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
a5xx_post_start() is currently only used for either an A530 workaround
OR preemption. If neither are allocated then memory is allocated in
the ringbuffer for no reason and it confuses everybody.
Change-Id: Ic0dedbad7615ba0593da5eb701cc5943877883f4
Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org>
Reduce the VDD_GFX CPR max aging adjustment from 25 mV to 15 mV.
Aging characterization has shown that at most 15 mV of additional
supply voltage is required as the device ages.
Change-Id: Ia96ff89afea16df6bfae9471a65dbf1a421b3f45
Signed-off-by: David Collins <collinsd@codeaurora.org>
Reduce the VDD_APCC CPR max aging adjustment from 25 mV to 15 mV.
Aging characterization has shown that at most 15 mV of additional
supply voltage is required as the device ages. Also lower the
open-loop adjustment for each corner by 10 mV (except for
apc1_vreg) for CPR revisions 3 - 7. The open-loop voltage had
previously been increased by the 25 mV max aging adjustment
amount to ensure that there was room for the closed-loop voltage
to increase based upon aging. The lower open-loop voltage allows
for LDO operation at a lower voltage which saves power in some
scenarios.
Change-Id: I9951fa60999673896c81447341b06d683dbcf285
Signed-off-by: David Collins <collinsd@codeaurora.org>
The vsync_retire worker registers for vsync_handler and
removes it when client requests power_off. It may
possible that vsync_handler is removed from list
through two different contexts. One from worker thread
and other from ctl_stop_sub call. Such race condition
can lead to list corruption. Ideally, ov_off should
wait for retire worker flush before calling ctl_stop
to avoid such race condition.
Change-Id: I7d68d67d1fe1df07e568a5f40db745ce155d7d14
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This support is needed to enable GSO (Generic Segmentation
Offload).
Change-Id: Ib6e7a5a5f3139697e0b6c68782134377a7bb2dc6
Signed-off-by: Ravi Gummadidala <rgummadi@codeaurora.org>
Save mdp/rotator buffers' smmu domain and DMA
direction information for debugging purpose.
Change-Id: Ica05a90e7a139e8d2259f669530aea75d86c93e9
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
In OBS, enable/disable UART IRQ during power management operations
to allow the device to enter low power modes.
Change-Id: I8479d6bc867c4ecb34adf83cd62b01f6fb60fef8
Signed-off-by: Naveen Kaje <nkaje@codeaurora.org>
Add sysfs node s3d_mode for stereo 3d support,
configure vendor info frame when 3d mode is set and
current video mode can support it. Output edid_3d_modes
in sysfs node in correct format.
Set 1 to s3d_mode will enable side by side, 2 for top
bottom, 3 for framepacking, 0 for 2d.
Change-Id: I634da4ffbd4e7994113d805c3c8facef3c9a5a25
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Disable idle pc during unblank, because LPM could introduce
big delay from waiting for DSI DMA.
Change-Id: Id11bf3f3015fa1ea4b22d1e1c2abd380cd8b65a2
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
If there are concurrent sysfs reads of snapshot binary
there can be a race condition where the snapshot data
is prematurely free'd by one reader while the other reader
is still reading it. Fix this by proper refcounting using
an atomic.
CRs-Fixed: 902816
Change-Id: I7a156c3a22f5475df0394ae30328d0fd6140f3da
Signed-off-by: Harshdeep Dhatt <hdhatt@codeaurora.org>
Move the qcom specific device tree files to the arch/arm/boot/dts
directory, and add a symlink from arch/arm64/boot/dts/qcom to said
files.
Signed-off-by: David Keitel <dkeitel@codeaurora.org>
MHI driver stack logging to the private IPC log buffer can be quite
expensive from a MIPS perspective. Enable such MHI logging
if and only if such logging is desired in defconfig.
Change-Id: I4a16eedc2424d250129b1b44a91d1fa32be399f5
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Certain corner cases have been identified in the MHI core power management
state machine whereby the driver state can go out of sync with the
device.
The cases are as follows: During in MHI resume operation the device
is not guaranteed to be fully recovered from LPM as the framework
requires. This causes RPM suspend to potentially be invoked
on a device which is still going through a resume state.
During RPM suspend action, if said action is cancelled a timing
window exists where previously cached commands are not played back
to the device. This causes a rotting command issue, when said commands
are never acknowledged causing a non recoverable timeout error on the
client channels.
During an RPM suspend operation, a timing window exists where
the device may be transitioning to M2 when the M3 is set. This causes
a device error which is non recoverable except by a full reset.
CRs-Fixed: 856202
Change-Id: I232365ba77b02b9aec87fef4cecc3d991243afe2
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Do a read after write for M3 to flush the write to the
device.
Change-Id: I0cf8c8a9dcf3599614351e1289f4b56a0fe32289
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Initialize the transaction status return code for the client
to a known value.
CRs-Fixed: 836433
Change-Id: I8023bd29b6ce36f69dfc3d2844803696eacadeb1
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Eliminate race condition whereby the device could go into
a low power mode before the host has finished initializing.
CRs-Fixed: 836441
Change-Id: I9957e87b1bfe956963c1f74f0a02d6714e9afcbe
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Initialize the client interrupt moderation capabilities to enable
correct marking of TRE moderation flags.
CRs-Fixed: 850216
Change-Id: Ic7a51fd1f089a847f225f23202183033352d0761
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Replace dma_to_virt and virt_to_dma with mhi_p2v_addr and mhi_v2p_addr
Change-Id: Ibda473254040cbd1f5fdf9eb463c14996d5fe12a
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Remove assertion on runtime pm resume return code.
A failure to resume may imply an ongoing change in
overall system state rather than a device failure.
Change-Id: Ic7aecc200e2d13f0771fd683e0070b0c2f9da467
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable MHI IPC verbose logs to facilitate debugging.
This will not pollute the kernel main log.
Change-Id: I8178227c7377284ce8e7dc4c3825a3cce6f5e3df
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
MHI WAKE transition must use runtime PM to transition the
device to operational state.
Previously MHI would enable the device transparent to runtime PM,
eventually locking up the entire state machine.
CRs-Fixed: 825891
Change-Id: I264533fe46a42394634e22d737324288ba387bf3
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
MHI clients should not be notified of ESOC shutdown notifications,
since MDM communication is still necessary after such a notification
is received.
Change-Id: I4075b56e1f8666dea63949db7a62bd1698dc9df8
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Remove incorrect logging during the MHI_DISABLED notifier.
Change-Id: I35b31ff448be03cd76a848e25391a825d79cabe9
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Parse MHI ring information from DT instead of statically allocating
data structure.
This is necessary as different platforms support different
configurations.
Change-Id: I59cd660459d627f93479a11257653611070fd3a4
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Remove unused MHI data structure and reorganize the main
MHI context data structure for easier debugging.
Change-Id: I2658bef7fcda95181bf8d80f58991277cf854449
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable MHI reset for dynamic recovery of MHI transport errors.
CRs-Fixed: 797757
Change-Id: I522503ab12d90d5391884772952960201f3585fb
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
CPU write buffer must be flushed before a DMA operation
is signaled to the device.
CRs-Fixed: 812602
Change-Id: I304671fd1a403d6d897b47641910bc112310b674
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable M2 power state transition exit through
CLKREQ GPIO assertion due to MHI doorbell write.
CRs-Fixed: 733370
Change-Id: I27b425ee305fc9c044812a8b15c76970987a5dae
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable NER support for MHI core. MHI core now enables
only event rings required for used channels. This saves
a substantial amount of system memory.
Change-Id: I3b9d63875cf117fba2ac062f831da1899b355e2c
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable log level sysfs attribute for MHI UCI
to enable different verbosity levels at runtime to the IPC log.
CRs-Fixed: 734010
Change-Id: I866b5bebb08257ac120de565a7b2a83b8e831a1a
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Remove dead code from the MHI driver. Currently there is no
usecase for the MHI STOP and NOP commands and this codepath is not
being touched.
Change-Id: I6cd96e28b9f46aca8014bbe4d2f2aa701f40b08b
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable large buffer sizes for SAHARA to reduce number
of data transfers by a factor of 12.
CRs-Fixed: 800039
Change-Id: Ica59ae4e3eae3b7c64222d36a8bc5033928ae631
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Flush pending PCIe writes after setting D3 hot and after
setting M2. This will ensure that no writes will bring the link
down as it is being turned off.
CRs-Fixed: 755658
Change-Id: If2ca4575f833ede77d6a14e1e2bf5a86d1c28218
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable queue TRE function for treating both command and transfer
TREs in the same codepath. This simplifies the flow of processing TREs
and facilitates debugging.
Change-Id: I8dc1dec4e0e23b7b36982cc0ace957a1b43aa6da
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Currently on UCI open, if the transport is not ready, the open
is succeeded in hopes that the transport becomes ready in the future.
Increase transparency between UCI clients and MHI such that
when the transport is not ready the UCI client is notified
and can react accordingly.
Change-Id: Iacc85e9aa68be9cde152a3fc2bfe9d0c6f6f6b62
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Assert when an event is received for a channel which is empty.
This is a fatal transport error.
Change-Id: I0249f97480ebc3ca8d3e98c10e35a0eb040215a4
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
This reverts commit e38c1ec36984945d60d02002eae5e615d1b9b6aa.
This commit can generate a link down in M2 state where the doorbell
is flushed while the link is down.
Change-Id: If29db648f0c6d2b0bd7a3d3a9b0f31ae5512c4eb
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>
Enable runtime PM in the MHI driver to increase transparency
between kernel and device driver and synchronize runtime PM
actions with system wide power states.
Change-Id: I8b87c2ed7b0be8a4cf9568ac1fb772eebe416dc6
Signed-off-by: Andrei Danaila <adanaila@codeaurora.org>