fget_light was deprecated, made the switch to fdget.
Change-Id: I52a032f26002300a1bf58573ff40fcc84c35d74e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
[cip@codeaurora.org: Replace f_dentry with f_path.dentry]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
IOMMU APIs are changing in 3.14 kernel. ION IOMMU calls, such as
ion_unmap_iommu, are being deprecated. While transition to new
APIs calling msm_map_dma_buf is an intermediate stage when
transitioning to new APIs.
Change-Id: I7fb11575d3924073fa9917be32ac2f92634f2e13
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
In order to prevent trace compilation warning, need to explicitly setup
compile include directive to search current source folder for header
files.
Change-Id: Ic17f841c88d911498d914f5339c99d2cb1ae3d1a
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Changing all instances of sysfs_dirent -> kernfs_node.
Additionally parameters passed into sysfs_get_dirent changed
which is corrected in this patch.
Change-Id: I06ce0b6af0d88248fb8019a68fd637bd6ce5b12e
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Inline function usleep translating to usleep_range no longer
provided in 3.14 kernel. Moving all usleep in display code
to use usleep_range.
Change-Id: Ie2a465107f83beaedb82380ca8d57c1d9190ec7f
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
In porting Id726a65b5641b57c0edd3ba33f2e5b3f68aff643
misspelt header file that was change. This patch corrects
that mistake.
Change-Id: I6755b102742e663f272b10f3b9804493e81ac28f
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Removing all calls to kgsl_drm, as it is no longer supported
in 3.14 kernel.
Change-Id: I835a946d6b032f47121e19b6ddb8629e672088ea
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
INIT_COMPLETION is removed from 3.14 kernel. Replacing with
reinit_completion.
Change-Id: I64c43e313ff4e07dc7900bdce155f8c55e5ed420
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
The DSI branch blocks needs to be on in order to issue a DSI software
reset. Commit e8c272ba5c3f23e6cece61bde7834cab7922a1d4 introduced the
change which moved the DSI software reset prior to enabling the DSI
branch clocks in order to support the idle power collapse feature.
This is not correct since a soft reset is not required at all when
resuming from an idle power collapsed state. Fix this by moving the
software reset to the DSI on sequence.
Change-Id: I663a44d04650f686ba98ea0b1fb7ab2ea29a3bcc
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Whenever the display always-on feature is enabled, it is possible
that the display pipeline can be in an intermediate state between being
fully interactive to fully turned off. In the current implementation, a
number of state transition decisions are made based on whether the
display pipeline is on or not. Instead of explicitly checking for the
panel power state, define generic helper functions which classify the
panel power state into three different stages - interactive, low-power
and off. Replace any existing check for the panel power state with these
newly defined helper functions.
Change-Id: I4d6dd883ea6aca8abd57fa048a79e0c88da09a95
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Add a new panel power state to represent a panel low power mode. Add a
new sysfs node to control when to configure the panel into this new
mode.
Change-Id: I7df8bf63470bec893c6b7481678f00ce76b6875c
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Currently a panel either be in a powered on state or a powered off
state. However, it is possible for panels to be configured in an
intermediate low-power state where the panel is always kept on. In
order to support such use-cases, it is necessary to add the concept
of panel power states in MDSS so that each software layer can
independently maintain it's state and manage transitions between them.
This change just refactors the driver with only two existing power
states - panel on and panel off.
Change-Id: I49d1fda506761546c5e22d9106c5177e75053a81
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
After configuration is done, save the acquired fences,
release the kickoff and ov_lock, then wait for the cached
fences. This way the next prepare will not be blocked by
waiting for acquired fences.
Change-Id: Id6f5b30e0d20cd59bd0aebf71af7cb47ecb1cf5b
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
MDP clock requirement for rotator depends solely on source dimensions,
rot_clk = (src_w * src_h * fps). Fix current calculations where MDP clock
rate is incorrectly calculated as rot_clk = (dst_h * dst_h *fps). New
calculations are valid even when down-scale is done along with rotation.
Change-Id: I30d98b7a62beeb3a559a9c5f26de43c014fd25fd
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
In 8939, MDSS has two AXI Ports one for real time client and the other
for non-real time clients. Bandwidth required on each of the port changes
according to the use case which necessitates the voting to separate on two
different ports. Separate vote is calculated for RT clients and NRT clients
which will be voted on respective ports.
Change-Id: If3d3d670c19a03d5d9659db6e3630a2958744f07
Signed-off-by: Vishnuvardhan Prodduturi <vproddut@codeaurora.org>
In ESD thread implementation using DSI status read method,
currently we check the read value of only one register from
the panel. For NT35596 panel, the expected read back value
for the health status register is 8 bytes. Add support for
ESD status for this NT35596 panel accordingly.
Change-Id: Icc2ba4d662facb79432a07f72064db57d2e5dd8a
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
It is possible that fb_open and fb_release APIs are called
from different processes for same file node. fb_release
finds correct process through file descriptor node in
such scenario and releases respective ref count. However,
overlay_release API tries to release the pipes associated
with current process id. This check fails to find correct
resources and does not release any pipe. This change calls
overlay release API with respective process id to release
all pipes associated with it.
Change-Id: Icc176032401483e05f347d3c08a4b344f61686f2
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Add null check to fix potential null dereferences in driver.
Change-Id: I913d4a8e5dc3e61e534243ab77d788ad64815b28
Signed-off-by: Charles Bin <cbin@codeaurora.org>
MDSS GDSC can be turned off, or power-collased for command mode panels
in static screen use-cases. In the current implementation, the power
collapse is triggered by a worker thread in the interface driver
whenever it enters the idle state. However, MDP driver already
registers pm_runtime callbacks for idle and suspend notifications and
also maintains a count of active overlay sessions. It is much simpler
and cleaner to trigger idle-power collapse based on that. This also
avoids unnecessary synchronization issues pertaining to the power
collapse worker thread.
Change-Id: I198e6d7685e5ef6eed7cd06a77fa76435940b805
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Ferrum uses DSI 6G, and there is no need to compile dsi v2
driver for this target. Update Makefile to take care of this.
Change-Id: Ifbbb320fd908bbdca5825cac7164b68b18360316
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Set the default mdp clk rate to be used in mdp_probe at max supported.
For certain targets such as 8939 which support destination split and
use 2k panel the minimum clock rate required will be 320MHz. This will
apply only until first update comes from the userspace.
Change-Id: Ia4bf56401eaec86ffd8338b5dd0c8b730ad4b1fc
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
There are cases where the irq trigger may get delayed for more than
expected, in such cases the ping pong done status may have been updated
by MDP hw. Add additional check to see if this has been triggered even
though interrupt wasn't scheduled for pingpong done.
Change-Id: I4730d166d95f238f4525eab2b5c99be40b30699b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Remove null checks that were causing false warnings
for potential null dereferences in driver.
Change-Id: I3a097c926da47d897e8c8e4fe39808436c413f70
Signed-off-by: Charles Bin <cbin@codeaurora.org>
WB interfaces' fetch XIN clients are connected to
Non-RealTime(NRT) VBIF on certain MDSS hardware. DMA
line mode fetch is connected to RealTime(RT) VBIF
while block mode fetch is connected to NRT VBIF on
such hardware. This change upgrades the driver to
support such MDSS hardware with NRT VBIF by updating
respective register space. It also selects RT vs NRT
VBIF client for DMA pipe based on operation mode.
Change-Id: Ia1680c2748ec0c9ef521df010ecfbcec78f5114f
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Modify watermark levels and prefill BW calculation
to be set based on the minimum prefill buffer bytes from
the SMP. Add debugfs property to dynamically tune the minimum
bytes for debugging.
Change-Id: I3af1e3468eaab56d3a8eea5fe456d7af547d3244
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
The PWM implementation has been reconfigured so that pwm_enable only
needs to be called once for the life of the MDSS driver. The new
implementation allows the driver to call pwm_config in order to change
the backlight without needing to disable and enable. The backlight PWM
driver is disabled when the panel is turned off, and reenabled when the
panel comes up.
Change-Id: Ieba05921b53eb1cf686aaa2751f9cc3650522bb7
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Add support for panels that are mounted in flipped
orientation. Supported orientations are horizontal
flip, vertical flip and both.
Change-Id: I648c276edd739562b36b264efd296ecad4b424dc
Signed-off-by: Prashant Nukala <pnukala@codeaurora.org>
MDSS driver reserves initial ctl path for primary display
for reduced wb interfaces. It uses rest ctl path for
other displays. Follow same allocation for mixer
path also.
Change-Id: I1bb079ae9a916a0addcb7ca8b16e4853f1bcab6a
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This check is supposed to be used to get the max between overlap and
prefill bandwidth value. This value is used when calculating the ib
bandwidth value to request when bus bandwidth is updated. Having a value
that is too low results in mdp underrun.
Change-Id: Ie1302737f004d8e030f8d61c75d4301fe99b1069
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Starting with commit a702d63198e3524740be22b66ce1933064174019, the
continuous splash screen feature flag for the secondary panel was also
disabled along with that of the primary panel. However, this should only
be done after notifying the interface drivers about the transition from
the splash screen to the boot animation. This is needed as the DSI panel
driver relies on this flag to avoid unnecessarily configuring the DSI
lanes in to the ultra low power state during this transition.
Change-Id: I59d312248c579d27913f23dc23e9c91a99549725
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Flicker is seen on wfd while rotation is done.
To prevent this, shared lock should be acquired properly
in case of READY event for wfd in display commit thread.
Change-Id: I0803eeb4d4f1d6283a6addaf40c435fded538718
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
When MDSS idle power collapse feature is enabled in conjunction
with the DSI Ultra Low Power State (ULPS) feature, it is possible
that the MDSS GDSC can be turned off once the DSI lanes are in ULPS
mode. When ULPS mode is subsequently exited, the DSI controller
should be reset prior to executing the DSI ULPS sequence so that
the exit sequence conforms with MIPI D-PHY specifications. However,
this could sometimes lead to DSI lanes not being in the stop state
after exiting ULPS leading to DSI command transmission failures.
To address that issue, force the DSI lanes to be in stop state upon
exiting ULPS.
CRs-Fixed: 696325
Change-Id: I8f4696b89ae19488b5372831f2dc98d2a352c750
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
MDSS is power-collapsed in idle screen cases using the pm runtime
framework. However, it is possible that the runtime PM status may
not match with the post-system sleep status when the device is
resumed. This sometimes leads to the inconsistencies in MDSS
idle-power collapse upon system resume. To address this issue,
reset the runtime PM status in the pm resume handler.
Change-Id: I5696ce6c154f2898b82e70119d3d9a2be79b59b7
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Hardware cursor within mdss from mdss v1.5 onwards is
programmed within the SSPP interface and is no longer
a separate dedicated stage in the layer mixer. Cursor
needs to be staged onto the existing layer mixer stages
and always at the top level available. From this version
onwards, cursors are expected to be programmed through
the overlay interface by the user.
Change-Id: Ia225dd92079e0153e9677ff035cf8531e62d5554
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Add support to notify HAL to avoid mdp composition so as to
reduce bw voting and to turn off clock to help thermal
mitigation when needed.
Change-Id: If86f49deae220a2e7ee2db224f010269cbbba7c4
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
For rotator path, display driver can release the rotator
bandwidth once the rotator finished processing. In some
scenarios this results in more power consumption since more
interrupts are generated to release the bandwidth.
This change disables the bandwidth release for the rotator path
and add a debugfs node to dynamically enable the feature if
needed.
To enable the bw release for rotator:
echo 1 > "<debugfs>/mdp/perf/enable_rotator_bw_release"
To disable the bw release for rotator (default):
echo 0 > "<debugfs>/mdp/perf/enable_rotator_bw_release"
Change-Id: If147b8fb202edcb389fe85e78f8d61d2a98cef95
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
[cip@codeaurora.org: Use debugfs_create_u32 for
enable_rotator_bw_release debugfs]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
For command mode panels, driver can release the bandwidth once
the frame is transferred to the panel and no more processing is
done in the display driver; in some scenarios this results in
more power consumption since more interrupts are generated.
This change disables the bandwidth release for command mode panels
and add a debugfs node to dynamically enable the feature if needed
for debugging purposes.
To enable the bw release:
echo 1 > "<debugfs>/mdp/perf/enable_bw_release"
To disable the bw release (default):
echo 0 > "<debugfs>/mdp/perf/enable_bw_release"
Change-Id: I61670606f1cf52b8d889678e6ffe7d0e911771e7
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
[cip@codeaurora.org: Create u32 debugfs for enable_bw_release]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Fix to prevent potential null dereferences and array overflows
in the display driver.
Change-Id: Icb6ee09692406aff994965c683473f006420fe71
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
There are a couple postprocessing features that are LUT based features,
and they require a lot of register accesses to configure the hardware.
During the first resume display commit, when all registers are
reconfigured, if any of the LUT based PP features are enabled, then we
will request maximum bus bandwidth to speed up the accesses.
Change-Id: I17a8c0f563db3a3715c170dbcd5666b0ee567b01
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Histogram read and histogram LUT writes vote for additional
bandwidth on mdss ahb clocks for speeding up the register access.
This is not required on 8916 and 8939 targets.
Restricting the call for vote based on dts property.
Change-Id: I944e07c80c678ef75bd7e4e0270be6a23becce00
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>
Fix potential null dereferences and buffer overflows in driver.
Change-Id: Ibce1bb120207e0a54ac9bd53de9952bd6ac8d0fe
Signed-off-by: Charles Bin <cbin@codeaurora.org>
Setting up vsync_retire_handler needs accessing hardware, move it into
commit thread so that buf_sync ioctl has no hardware related operation.
Change-Id: I646b5fa5f103bf07e409c41842b59ac2ed204c83
Signed-off-by: Ken Zhang <kenz@codeaurora.org>
Currently, MDP fetches only at the vertical backporch.
All through the vertical front porch, hardware sits idle
doing nothing. Starting from MDP v1.5, hardware has the
capability to fetch at the programmable line in the vertical
front porch.
Change-Id: Ib2482fa610acdfc5cbf944415a344c11f313bc81
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
In use-cases where scaling is required in one direction
and not on other, scalar extension parameter will be set
to update the scale register. Add proper check to this enable
scale bit only in the required direction.
Change-Id: I5527f22c83fe456d0124af12516c5bdb240e80a9
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
mdp_busy flag is used to serialze kickoff operations by ensuring
that any pending kickoffs are first completed before issuing any
new kickoffs. This avoids any potential mpd_busy_wait timeouts.
Therefore, for normal operations (partial update disabled), mdp_busy
flag should always be set. However, when partial update is enabled,
width and height of panel's ROI need to be checked before setting
mdp_busy flag. Otherwise mdp_busy_wait will timeout since no update
will be sent to the panel. In addition, perform roi merge from both
panels if roi-merge is enabled to decide whether column and page address
has changed. If it was changed, then new column and page address need
to be sent to the panel.
CRs-Fixed: 692382
Change-Id: Ib0070b84a626afffd4c51a65f59bc97aae1d8994
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Move bandwidth control to panel on and off functions
to speed up the clock control.
CRs-Fixed: 673613
Change-Id: Ib3828687ab54fb7a5aad7e97dec46c6e76a7311a
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Add parameter in debugfs to avoid using prefill
calculations for the bandwidth vote.
Change-Id: I7e1d748128335e6ced4d094d77544005e393e218
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
MDSS_XLOG_TOUT_HANDLER() is for debug purpose. It acquires
a mutex and thus should not be called from an interrupt
context. Move this call to a thread context instead.
CRs-Fixed: 692386
Change-Id: I631ffa4c972b66991eb65ad0de294378e0d3f266
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
If brightness node is written prior to unblank by surfaceflinger
the backlight level being applied would not be correct. The
stored value is also overwritten.
Passing the correct unset backlight value during unblank.
Change-Id: I430bc759e09ecc6dfbc616af47fbc953aa542b9a
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>