Previously, the change of backlight sysfs node value will not trigger
notify updates if display is in static screen case. This will cause
delay or wrong configuration for assertive display. This patch fixes
the above issue by adding an update notify if backlight changes when
there are no display updates.
Change-Id: I1475896214a50dc1fa71739aa751b2e626d27adb
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
Current design of display driver (overlay) is no more
using the physically contiguous memory for normal display
functionality.
However, we still need to be backward compatible for any client
using the legacy implementation (eg. pan display) functionality.
As soon as there is a mmap call, the allocation happens from
system heap and gets removed once the references to frame buffer
driver becomes NULL.
With this change one can remove the physically contiguous memory
which gets allocated at the boot time and the usage of physically
contiguous memory is optimized.
Change-Id: I1b6040187bda8095007faa4d9df7dc046aa30c6e
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
In APQ8084, when BWC is enabled and source dimension of the pipe are
changed then MDP ahb clock gating needs to be disabled. Now once this
condition has passed, clock gating needs to be enabled again to save
power. Current implementation writes wrong value to the register which
handles this clk gating. The same register is used for controlling clock
gating of other source pipes like VIG1, RGB1 & DMA1. Because of this
wrong value, pipe was being forced off which internally results into
under-runs. Fix this issue by writing correct value in the clock gating
register.
Change-Id: I2f5568a1a90e4384da14fcee5a21494841c12ae6
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
This makes sure that the userspace correctly interprets the end
of the vsync timestamp.
CRs-Fixed: 639039
Change-Id: I8a0810283a42a9c39a3c8fe36b862bbfd3ecdbea
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Currently different drivers within MDSS, allocate dynamic memory using
kmalloc and then use explicit memset to zero out the content. Instead use
kzalloc API to achieve the same.
Change-Id: I09d3d5e5986206f90c97d4d04fc3a855c233a7ae
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Add panel ROI limitations on minimum width and height values
to the panel info sys_fs node.
Change-Id: I3297beb20e7f207a296e6cec114daf2305324898
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
Grouping calls to prepare and unprepare of clocks along with enable
and disable for saving power in the case of static screen on command
mode panels. This makes sure that corresponding source clocks are
also disabled allowing xo shutdown to happen.
On top of that bandwidth request and iommu enable was grouped with
enabling/disabling clocks so that all display related clocks are
disable in static screen allowing for xo shutdown to happen.
Change-Id: I2db3844cbab5c41ea1bb37f5a5ed76c3c63e3a1d
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
If handoff fails, the clock ref count becomes 0 and iommu
will get detached. In pan display path, since at that
particular instant iommu gets detached, we use physical
address. After this if iommu is again attached and physical
address is fetched, it can result in continuous IOMMU page
faults. To address this hold MDP clock ref count
in pan display path.
Change-Id: I2370b276acdced2cf22083eb80fcad1b2e454315
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Update the AD init compact structure with backlight attenuation
support.
Change-Id: I25cf939994d5138f1accf93b8f4bc130bd7ca59e
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
Pinctrl needs to be set to active state before we do the panel
reset during panel ON sequence. Similarly, it needs to be set to
suspend state after the GPIO IN_OUT registers are set to zero.
This change takes care of fixing this sequence.
Change-Id: I666068f88d4489acb0da261efb01e26929e42483
Signed-off-by: Padmanabhan Komanduru <pkomandu@codeaurora.org>
This adds the underflow color adjustment support on
8x10. Customer can order underflow color by modifying
the parameter in panel device tree.
Change-Id: I5a0ae73bceff26b810de6809beb540681c30247f
Signed-off-by: Shuo Yan <shuoy@codeaurora.org>
Overlay release allows multiple releases to happen by having
multiple bits set in overlay unset call. Fix logic to find
all pipes which match the bitmap.
Change-Id: I6a25a81fe4c437b5546537d48e250055357682f0
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
We were dereferencing a userspace pointer in kernel.
Change-Id: I128455904cd396690350fc6b784a8844d594539c
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Changing the error log to debug log in case SMP reserve fails
for rotation. The use case falls back to GPU. Same is being
done in case of mdp interface set path.
Change-Id: I00a9e05b3a04a87e354fd0e60ad900f4f71cdfc1
Signed-off-by: Vineet Bajaj <vbajaj@codeaurora.org>
Previously, we weren't handling histogram done interrupts for DSPP3 in
the interrupt handler. The handler now looks to handle those interrupts.
A helper function to parse the interrupt mask has been added to return
the correct histogram info block.
Change-Id: Ie469a4030b4f4f7ee8e4b8a766539c43f87504ac
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Currently if per pipe BW exceeds pre-defined limit, we add additional
vertical decimation to reduce BW. But this has inverse effect on quality.
To mitigate this issue, decimate further only if user has already
requested decimation else return an appropriate error which user can
detect and act upon it.
CRs-Fixed: 637971
Change-Id: I1c3b913036b7a1680d6c99b03d42f1204f71f89f
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Some video mode panels need to have the command mode
operation interleaved on the last line of the video stream.
Add support to enable this register via a panel dtsi property.
Change-Id: I3dfe36816d7602da4f66d09ea23ac9c6185f9858
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
To analyze issues like underruns and other timing issues
add xlogs. Add debugfs entry for xlog to enable or disable
logging and register dumping at run time.
Enable xlog: echo 1 > <debugfs>/mdp/xlog/enable
Enable register dump:
echo 1 > <debugfs>/mdp/xlog/reg_dump
Enable panic on error:
echo 1 > <debugfs>/mdp/xlog/panic
Get xlogs and register dump
cat <debugfs>/mdp/xlog/dump
Change-Id: I10c2993d9dde6ef16a37256928fff1239e6370ff
Signed-off-by: Raghavendra Ambadas <rambad@codeaurora.org>
[cip@codeaurora.org: Moved mdss_debug_xlog.c file location]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Set HDMI as primary panel if module command line contains hdmi
primary information.
Module cmd line is of format: panel=<lk_cfg>:<pan_intf>:<pan_intf_cfg>
For HDMI as primary, panel_intf would be "hdmi"
Change-Id: I25e37bb019a51c747c6c2a003bcf8d4ccc3a9f91
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
The tile control parameter is used by the Assertive Display
block to control merged mode or independent mode AD for
dual-pipe AD. However, in single pipe AD, the tile control
should always be set to zero.
Change-Id: I0dd3c3b716fd5156d9a0f9206911159d186fd9c7
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Current calculations apply one fudge factor to the final bandwidth
regardless if this is a result from the overlap or prefill calculation.
With this change the final bandwidth can be tuned up to apply a different
fudge factor when the bandwidth depends on the overlap calculation.
CRs-Fixed: 635005
Change-Id: Iaa9718bda3264a47bf70a2facba0d23e4b2414f3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Currently all entires into fb driver are synchronized with shutdown
context except fb ioctl context. fb ioctl is an asynchronous entry to
fb driver which can be called simultaneously from two different user
processes. Synchronize these fb ioctls and shutdown context to prevent
race condition.
Change-Id: I81ce48159fce69caabc3336d70df2bd15c4ee44b
CRs-Fixed: 640199
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
It is possible that for certain panels, not all four data lanes are
active. After configuring the lanes to Ultra Low Power State (ULPS),
only check the status of the active lanes since the lanes that are not
used will never enter ULPS.
Change-Id: I0da358f2bd24d4472cfccb6cca9ca8b26ffa8226
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
HDMI as primary will also be HPD interrupt based. Update
user space with cable connect/disconnect notifications.
Enable DDC power as done normally in HPD interrupt handling.
Change-Id: I96b63be5877f1cde38604bc4cdb2dfcdc674cb8f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Update hdmi to use common linux includes instead
of platform dependent header files. Also update
print statements to use platform independent
%p instead of %x when printing hexadecimal
addresses.
Change-Id: I4722f3f34a4ea23fda3f66eabddac58dfef1556c
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Move contents of msm_hdmi_audio_codec.h
directory to msm_hdmi.h in common linux
directory to remove platform dependence.
Change-Id: I6331073ba1e5e119770c5e8cb50f6ff677807292
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Currently mfd pointer is assigned in coming fb_event_callback,
which is possibly invoked in WFD case too. This should be
avoided since DSI check should only apply to primary display.
CRs-fixed: 639687
Signed-off-by: Ray Zhang <rayz@codeaurora.org>
Change-Id: I4592c62349dd7d34082b3e73f5cbb3b49e80dc9b
DSI PHY supports two regulator modes: LDO and DCDC.
While DCDC offers power efficiency, but it requires an
external inductor. So it is required to enable LDO mode
to save the extra PCB board cost.
Change-Id: I156ba8af7857743db5373a9e3f79d948cf9e1427
Signed-off-by: Mao Flynn <Flynn@codeaurora.org>
Fetch and store logic for macrotile format is different than linear
format. Update watermark level programming to accommodate these
differences.
Change-Id: Id0810bd1e56f9fca00de94f933c9e2db6dead83c
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
The postproc calib configuration address should always offset form
MDSS base, not MDP base. Also allow postproc calib ioctl to access
the MDSS version register.
Change-Id: I9dbf5a2a75a0a384e7f97efca49f1a75e5d01fc8
Signed-off-by: Ping Li <quicpingli@codeaurora.org>
This is to add the error handling logic to catch the wrong
overlay configuration from user space.
Change-Id: I59523de392dcd21309bfa9eb9a944047505df2a3
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
For smart panels, we observe abnormal waveforms and
unexpected voltage spikes on DSI data lanes when the cx
power rail goes to minimum voltage. Vote for the cx
regulator in mdp3 driver and control the voltage to
avoid frame shifting.
Change-Id: I8ce8d7621f903966f519da563a9c57701146be24
Signed-off-by: Shivaraj Shetty <shivaraj@codeaurora.org>
Define all the data associated with AVI infoframe. Write
the AVI infoframe data into registers in proper order.
Define and write into registers the AVI infoframe data
in a clean and readable format.
Change-Id: Id2bff5eb37aadcb4b5de86ff0dbba2a579ddf013
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Init phase should only be programmed to a non zero value only through
a user program. Default value of zero is programmed by the driver to
avoid hardware hangs
Change-Id: Iff99394d2f3a937c5bb4456c2f7ca5669a5c732b
Signed-off-by: Sree Sesha Aravind Vadrevu <svadrevu@codeaurora.org>
A pipe can only belong to either used list or cleanup list, to ensure
this refactor the list management by having only a single list head in
pipe structure. Also add a better name for the lock that should be used
for ensuring atomic access to these lists to prevent incorrect use of
these locks.
This also ensures that a pipe can only be freed on the fb device it was
allocated and prevents unexpected behavior when this is not the case.
Change-Id: Ib1c8ffefe51d837c2b30aa3734d37fee3c54cf1b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
At the time of dsi interrupt handler registration, there may be
a pending dsi interrupt. This can cause a dead-lock, as dsi clocks
and resources are not initialized properly yet.
Change-Id: I511d0776f5d7b500f0f32f2ae9d92ac031f8e613
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Correct the VIC code filled in the AVI infoframe
data byte 4. Re-arrange AVI infoframe LUT w.r.t.
the resolution for easy and clear implementation.
CRs-Fixed: 636294
Change-Id: I68e6097a0448b8b932cb5026e8a2b27ee359b8e6
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
In the chance that we get an interrupt for a histogram block that
is not enabled, we print an error message to alert of incorrect
functionality.
Change-Id: If99343fb2d385442d85b7d65c5c41fb48ccb2e25
Signed-off-by: Benet Clark <benetc@codeaurora.org>
In the cases where histogram bin collection does not return the expected
number of bins, we return an error, however we do not print any error
message saying which DSPP had failed bin collection. In order to know
which pipe the histogram failed on, we must add an extra log.
Change-Id: I1fb39e146cd3367d3b97f10174573a5207284652
Signed-off-by: Benet Clark <benetc@codeaurora.org>
In cases where frame-buffer compression(fbc) is enabled, the
compressed ratio for xres isn't considered. Add logic to correctly
account for fbc when needed.
Change-Id: I0eec90cbbe0a0ffaea94cf1c2d6231e6545403b6
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Fix bit offset for lossy RGB threshold in the lossy mode
FBC register. This fixes incorrect fbc parameters being set.
Change-Id: I5e772cc1a8244bad8a236dca561552c4eb516d98
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
Layer mixer 1 also supports framebuffer compression. This is
needed to support dual-dsi fbc enabled panels.
Change-Id: I1118298e89ce06ef14bbea1c47478f04e3050154
Signed-off-by: Siddhartha Agrawal <agrawals@codeaurora.org>
DSI branch clocks should only be enabled after removing the DSI clamps
when exiting the Ultra Low Power State (ULPS). If this is not enforced,
then the RCG for these clocks may not get turned on correctly which
may eventually lead to some display corruption. Fix this by
appropriately modifying ULPS exit sequence.
Change-Id: I5109dd140f8921256f95eb479dd33a73615d489f
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
DSI driver needs two different types of clocks for normal
operation - bus clocks and link clocks. The clock control function
enables/disables both these set of clocks together. However,
under certain circumstances, it is required to control just the
link clocks or the bus clocks. To support this, add separate
ref counts for link and bus clocks and modify the clock control
function to selectively control these clocks.
Change-Id: I25312131fc737b56dc15f4edf5e55a5824dad855
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Currently the DSI driver uses a two level reference counting for
the clocks used by the driver so as to ensure that the clocks are
correctly configured for dual-dsi use cases. However, this is not
necessary as the same can be achieved by using a single reference
count. Clean up the code to remove the sub-level ref counts and
add necessary error handling.
Change-Id: I6f1c1bfe83322dc0e1da3d757b6ca88cd629663e
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
When broadcast mode is enabled for dual dsi panels, the two dsi
controllers act in a master-slave configuration. A lot of configuration
in the driver requires special handling in such scenarios. Current
implementation has a lot of redundant code to check for broadcast mode
configurations. Rework the code to remove these and add a unified set of
APIs to query broadcast mode configurations.
Change-Id: I634f94266e8dce28bcaa897ef39e7c3ca9b558e5
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
If MDSS HW has more than 2 rotators and if the layer width is greater
than line buffer width then layer is divided into two and each half
can be rotated independently and asynchronously. Current implementation
sets up the configuration of both halves independently but the rotation
of second half is triggered only after first half is finished. Fix this
issue by making writeback_kickoff unblocking call and wait for the
rotation completion after all the rotations in the current session are
queued.
Change-Id: I90ff7feab7979037e596a3b8d8c9e6c138574e94
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Use a macro for the interrupt bits and
use bitwise complement instead of logical
negation when disabling HDMI CEC interrupt.
Using logical negation will evaluate to 0
which will set the entire register value to
0 instead of just bits 1, 3, and 7.
Change-Id: Ia6b6a48500b4cc149c4f6b91859bdcc6882a7244
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
There is deadlock scenario where work thread to turn clocks off is
trying to acquire DSI's mdp_busy lock while holding clk_mtx to turn
mdp clocks on. Meanwhile kickoff thread holds mdp_busy lock and
trying to acquire clk_mtx to turn on clock.
This patch ensure that clocks are kept on and work thread is not
scheduled while kickoff is in progress so that deadlock will not happen.
Change-Id: Iceb5db431a7f9f0e1f56a0e3c1ced2d08d762b86
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Currently MDSS HW can support maximum of 5 active ctl paths, so the size
of the container array holding all ctl paths is also 5. Now current code
has a limitation where it doesn't allow rotator2 to be used if number of
DSPP based interfaces are 4, which is the case for apq8084. This can lead
to sub-par performance when more than 1 rotator sessions are needed
simultaneously. Fix this by allowing last 2 spots of the ctl path
container array for rotator.
Change-Id: I40e968141d92ce6272072d9b5b8c59402d8a543c
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>