Earlier, camera preview buffers were of NV21(YCrCb_420_SP)
and the video buffers were of NV12_VENUS(YCbCr_420_SP_VENUS)
format. Now that the video encoder has support for NV21,
both the camera and video buffers can be of NV21_VENUS
(YCrCb_420_SP_VENUS) format.
If the preview and video buffer sizes are the same, CPP
double pass to generate video and preview buffers can be
avoided and the buffers can now be generated within a
single pass with CPP duplication thereby saving power.
Add support in kernel for NV12_VENUS format to achieve
the same.
Change-Id: Ia0ee0155faaa5ba6d5cafbc0529428734eaf37e5
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Incorrect HW revision check in MDSS drier is leading to
boot up failure for 8996 v2. This change fixes it.
Change-Id: I9c45387e48abcd48eec1dcb9fe9fda9a408c58d5
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Reduce dependency between hw cursor updates and display commit.
Configure the cursor pipes and flush immediately, rather than
waiting for the commit. This would enable multiple cursor updates
within a single vsync. However, the screen update would happen
only after vsync, which would pick the latest cursor update. The
restriction is that after the first cursor update, a display commit
is required to stage the cursor pipes.
Change-Id: I666856c88b8e2decac6578237e9b93b106378ffa
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
mdss_mdp_wfd_wait_for_finish was returning positive value causing
false failures in atomic validate of wfd.
Change-Id: Idbb8c3a22040d3c8b0f31fa7be8143261ccbfb85
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
There could be multiple references to the framebuffer, when
releasing the last one the panel should be blanked. When blanking the
panel we should make sure that panel update has finished (wait for panel
idle), however this wait should be done only if it will lead to a
change in the panel. Avoid this wait if there are more than one ref
counts which means that panel won't be blanked.
Change-Id: I22ffd25cfc6d0512d006a979613610314772a27e
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Pipe is marked dirty if it was newly allocated during validate. This
prevents unintentional staging for dirty pipes to HW. However when
the same pipe is used again with good configuration, dirty flag should
be reset. This is missing and leads to skipping of certain layers and
flooding of error logs. Fix this by resting dirty flag when pipe is
successfully validated.
Change-Id: I2d64ecbaaa8968ee7322270c93f5bf5c3e5c90e9
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Return EBADSLT error for pipe allocation failures due to priority
mismatch. This isolation helps the client to identify and allocate
pipes to layers efficiently.
Change-Id: I601bd4880ade8313be3b870ca4551b40ebb7d00b
Signed-off-by: Jeykumar Sankaran <jsanka@codeaurora.org>
There are situations where mdss_mdp_rotator_release_all is called
and rotator session manager is not initialized. Added error
checking to prevent crashing.
Change-Id: I104fa88dd41bb4bad3a0402cf6955c85f640e384
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Two new DCS types, compression_mode (0x03) and pps (0x0a)
are introduced to support DCS (Display Stream Compression).
Add process those two new dcs types to support DSC.
Change-Id: Ibbd90c7c84598ba24a5919174bb547e851cc4754
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
180 and 270 degree rotations simply consist of some combination of
90 degree, up down flip, and left right flip. The checks for
these basic operations are above the code being removed in this patch.
These explicit checks misclassifies 90 degree rotation as 270
degree rotation, and only left right flip as 180 and 270 degree
rotation.
Change-Id: I1ce547f83e350869ec0f3a1ab3be2fd7f2be752c
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
mdss_mdp_mixer_pipe_update function performs two tasks, one it stages
pipe onto mixer's stage_pipe container for next frame and it also
un-stages same pipe from previous stage if different. When source split
is enabled, pipe can be on left blend or right blend of a given stage.
Now between consecutive frame, pipe can change the z_order and it can
change its blend as well. However current implementation of pipe update
function has an issue where it doesn't un-stage the pipe if its blend
changes between consecutive frames. Check the example below.
* Frame N, pipe X is on right blend, odd index, at z_order 1
* Frame N+1, pipe X is on left blend, even index, at z_order 2
Now when mdss_mdp_mixer_pipe_update is called for Frame (N+1), it should
stage pipe X at z_order 2 and on left blend. It also need to remove the
pipe from right blend of the z_order 1. Due to the bug 2nd task is not
performed and it leads to above error message. There were no side effects
of this bug except for the transient error log.
Change-Id: I0d6b4d9574b8ea9229754199250e2ce795ca2e12
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
For more accurate clk rate calculations we need to know
which rotator item is assigned to which rotator block.
Change-Id: I5cb8a50728600af10d1a97ffd582269e82623f90
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
While reporting for the resolution details, do not check if
down stream data is valid or not as not all transmitter
configurations have down stream device attached.
Change-Id: I498b94956f0ddbae0dff22d323f8299ff1ecb262
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
The number of cursor pipe structures allocated was mistakenly
set to the number of ViG pipes. Fix the issue to allocate it to the
number of cursor pipes.
Change-Id: I88185a97c64767ad993997d7e4b5398526068222
Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
Pass the secure pixel vmid for secure context banks in domain
attributes before calling attach for both mdss and rotator
SMMUs.
Change-Id: Ide25821d85c2e912cd91b8e206277456d4c78f3d
Signed-off-by: Shalaj Jain <shalajj@codeaurora.org>
SCM call to unlock the registers is not required for
msm8996 target. However, such call during resume
prints multiple error messages when GDSC is toggled. This
change adds mdss hw capability option to handle the
case.
Change-Id: I6084d0e1e2b7d08c853e44ee2c6e276cc47f1244
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Remove extra print for function name in debug module.
Change-Id: Ic7327bcedb2254b2bc4b7655138289a19605f935
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
"vdd-cx" is optional regulator and usage of incorrect API
returns the dummy regulator. Display driver tries to
enable/disable this regulator on each suspend/resume and
prints error based on return value. This change uses
correct API for optional regulator to avoid unnecessary
error messages on each suspend/resume.
Change-Id: I51df98fd32702e4de83c5ecc5311f176f82818e1
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
MDSS hardware on msm8996 target supports RGBX UBWC format
because it handles the RGBA and RGBX formats in same manner.
This change adds the RGBX UBWC format support with
compression ratio information.
Change-Id: I674d136496910e017d4c21d56b62def7eff0562e
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
When source split is used, pipe can be staged on two mixers or it can
be staged on right blend of a mixer. It is also possible that same pipe
is used at different z_order in consecutive frames. When pipe's z_order
is changed and it goes from two mixers to single mixer or right blend to
left blend or any other such variations, pipe needs to un-stage properly.
Fix issues in current code by correcting order of state assignments.
Change-Id: I5b26cc98186183713b7a187673bcb30440d14145
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Buffer lists are protected by list_lock to prevent multiple threads from
modifying the list. Locks are missing in a few places which may lead to
potential concurrent access and lead to corruption. Add proper locking
to prevent this.
CRs-Fixed: 806684
Change-Id: I95c5ebbb5cd9c11c38ea9be0826f3b8748632a5b
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Overlay buffer allocations are marked as kmemleak because the base
pointer is not being tracked, rather these are tracked as part of a
list. Add kmemleak_not_leak to prevent false positives.
Change-Id: I3c54c15b6d73d3aece8e28b7723e0cf9c4953be5
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
[cip@codeaurora.org: Resolved merge conflict]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Uninitialized panel_name array can cause the invalid string
comparison between "NON_PANEL" and uninitialized value. Fix this
by initialized the array with null string.
CRs-fixed: 790201
Change-Id: I18486db909e5d41e39b5e6052c8c7c760ae8d4b4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Change Ic07deab12aa43bc4f61762303ed367fe3131389f,
msm: mdss: enable source split with dual-dsi partial update,
introduced the problem of only half screen getting updated for
4k HMDI. Since HDMI does not have a slave controller, it was not
configuring the src_split_req flag correctly. 4k HDMI uses both
left and right mixers controlled by a single ctl. Fix the issue
by setting the src_split_req appropriately.
Change-Id: I333afd85ae5dc88610c352b557a834526bafcdfd
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Enable mode switch to occur if atomic commit is being used.
Previously feature was implemented for prepare/commit pairings.
Change-Id: I5eb1b5512a695fd6412e30728eabe129159d7d96
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
It is possible for rotator to drop alpha value from RGBA8888
or to add don't care to RGB888.
Change-Id: I17b6ba7a4d793c4f77be5cb5e98a3b9aa59e90f4
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
The writeback block in the rotator supports ubwc output.
This change enables the client to specify ubwc input and
output format.
Change-Id: Ic9aee90b0edd2128383ecb03cdf7882cd8c8e3e1
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Left panel stays in sleep-in mode if clocks are not
turned on for both controllers. Enable clock
before sending commands and skip clamp controller
for command mode panel support on msm8996.
Change-Id: I8d6c6f9253407d1b6fd8001a00be4876a006deea
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
In HDMI Tx controller version 4 and beyond, HDCP registers have been
moved out of secure domain and can be accessed directly, in an
address range of their own. Add support to map this address range and
access these registers directly if we are running on HDMI controller
version 4 and above.
Change-Id: I2d790bf60f42055ba3e10d0ec82812be292826a3
Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
[cip@codeaurora.org: Removed arch/arm/boot/dts/qcom/msm8996-mdss.dtsi]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Currently, fb split height and width are calculated before setting
the split mode in overlay init function. This leads to bootup issues
when dual dsi panel is used with destination split is enabled. Hence
correct those values in overlay init while assigning the split mode.
Change-Id: I93108a60be9c6f7a63b6743daafd50743792573f
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Current code does not program the panic luts
for the cursor pipes. Adding cursor pipes to
the panic luts programming.
Change-Id: Id17f5006d5344e8fd9363bcf4ff8bff2fa07cc5a
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Increase the prefetch lines and disable
the bandwidth calculations during vertical
blanking for 8992 and 8996 if the vertical timings
plus prefetch are enough.
Change-Id: I94f72a43c95f0574e2165810b9c20d50af1fecdb
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Adjust prefill BW equations to update the
latency buffer size for 8996.
Change-Id: Iddcd6fad01025dcfd17b41d3ed2f98b03b7b08fc
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
When pipe_assign calls pipe_init_config it determines
if the pipe is for use by real time client based on info
pipes left mixer. This value was not properly assigned
prior to this call.
Change-Id: If5edf449b8e501f9400d81477fcc12a8285e1172
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Add new xlog messages to aid in debugging of MDSS issues. Some of the new
messages include information regarding mixer configuration, write-back
configuration at start and finish of the operation, pipe configuration
and pixel extensions etc. Also remove old mixer reg xlog and report xlog
from mdp_clk_ctrl only once to prevent flooding.
Conflicts:
drivers/video/msm/mdss/mdss_mdp_ctl.c
Change-Id: I11fd63a220b1ccd102dcd48d3878cf96fc91bc5f
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
This change adjusts the qos luts to be configured
depending on the pixel format of the pipe.
Change-Id: I5a7830cf554ddd34aee7415df694674cf1e981a3
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Mixer setup can be called from multiple contexts and not all may call
mixer set roi which sets valid_roi flag. However with partial update
there is a requirement that for a given ctl path, roi is not valid
because there is no update on that mixer. In such cases, valid_roi will
be false and we should ignore setting up the mixer. So to cover all
cases, initialize valid_roi to true when ctl path is setup first time.
Change-Id: I85ae4ce8711f0fcdf771d18b4896a8f61398ead5
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
The ov_lock is meant to protect overlay/display pipeline.
Rotator has a different lock which synchronizes its resources.
Remove the ov_lock for rotator ioctl calls.
Change-Id: Ie38bb796c3430951636f8c6888bca4cfc8194aaf
Signed-off-by: Adrian Salido-Moreno <adrianm@codeaurora.org>
Current revision check to enable rotator limit does not
include 8996. Add this target so the ot limits feature
can be enabled for 8996.
Change-Id: I68d552a736158da6d568e556beea91de321111d8
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Current code selects the vbif nrt to program the ot
limits based on the chipset version only. This is
wrong for the real time clients and the writeback
read; those clients should select vbif rt.
This change corrects this behavior and selects the
corret vbif according to the client.
Change-Id: Ie2b640878767d425e430e33942fd17a80b3bf3f1
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
When a VIG pipe is destroyed or reinitialized, the PP related
parameters stored inside the pipe structure are cleared. There
was an issue with clearing the parameters. The histogram structure
was set to 0, causing a problem with histogram-related mutex and spinlock.
Rather than resetting the whole PP structure to 0, this change adds
support to only clear PP config enable flags and dirty flags. The
histogram structure is disabled but not cleared, avoiding a need to
reinitialize the histogram synchronization resources.
Change-Id: I286b528436a457b9580c3a4c2c24cc8a31dacabf
Signed-off-by: Benet Clark <benetc@codeaurora.org>
Due to the increase in the mdp overlay struct size, the stack size
limitation for functions is exceeded in apq8084, when the struct is
is declared as a local variable. Fix issue by using heap memory for
overlay struct instead of stack memory.
Change-Id: I245b96b0a7633fb01d26c464a08a3a1b24e9e084
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Starting with patch Ic07deab12aa43bc4f61762303ed367fe3131389f,
msm: mdss: enable source split with dual-dsi partial update, valid_roi
check was added when doing mixer setup to prevent incorrect HW
configurations. However valid_roi is not set for a ctl path for rotator.
Because of this params_changed value for rotator mixer is not getting
reset which leads to data overflow for variable params_changed. This
overflow prevents prepare_rotation function to be called which in turn
leads to data mismatch errors. Fix this issue by moving valid_roi check
after rotator is serviced during mixer setup.
Change-Id: Iae2585dcf3d593ad9ce22a6c394e17249bc5f1f4
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Display panels can be in a bad state which is most likely caused by
ESD shocks. Display s/w has the ability to detect panel state and if
it is bad, s/w reset and recover the panel from that bad state. For
the testability purpose, this change simulates a panel dead state, for
example:
adb shell 'echo 5 > /sys/devices/virtual/graphics/fb0/msm_fb_panel_status'
will simulate a display dead state after 5 detections, which is about
25 seconds if the esd detection feature is enabled with periodic
detections every 5 seconds.
Change-Id: Ia28e80ffcbfe45a59ae65e0e26b558a467b50863
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
When pingpong split is enabled, single DSPP drives the two DSI
panels and bandwidth needs to be adjusted based on the complete
panel width. In the existing implementation, only left half of the
panel is being considered for bandwidth vote. This change addresses
issue with bandwidth calculations when pingpong split is enabled.
Change-Id: I24ab9dee80c75f25f8c41501f6b635d98de512a2
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
(cherry picked from commit 812bbe33e782cde79f7b56ac417aa11597fecfe3)
[veeras@codeaurora.org: Resolve merge conflict in mdss_mdp_ctl.c]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Do not retry sending CEC messages from software
as the CEC driver programs the hardware to
retry sending messages in the case of failure and
update software with an interrupt. This is needed
to pass CEC compliance where TE checks for the
max number of message send retries.
Change-Id: I35d4d2b54ced8b98b9681b2df4bf82f03d5f33b1
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
AD stores a backlight level in a variable for its processing
called ad_bl_level. This needs to be initialized to the actual
backlight level at the start.
Missing this initialization and doing the backlight calculation
for AD will cause an error and ad_bl_level will never be
updated to a non zero value. This change makes sure the
ad_bl_level is set to a non zero value in all cases.
Change-Id: I285332613ffcc1d6c94247b7c9bd89f054c80d4c
Signed-off-by: Ping Li <pingli@codeaurora.org>
When pingpong split is enabled, single DSPP output is driving two
interfaces and MDP clock has to be 2x times the pixel clock. In the
current implementation, pingpong split is not considered in the MDP
clock calculations. This change accounts for pingpong split and update
MDP clock accordingly.
Change-Id: I85a86fa747c908f76bd01faf36fe310d502e2121
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
(cherry picked from commit 9aa39bfd928b40fa8f8b87b099dbb39d964be41f)
[veeras@codeaurora.org: Resolve merge conflict in mdss_mdp_ctl.c]
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Current implementation incorrectly handles the transitions from display
low power modes to display off. This could lead to DSI panel and
regulators not getting properly turned off. Fix this issue by ensuring
that DSI interface is correctly shut down during this transition.
Change-Id: I7c20c04d20fd2f443c61b83f229ce4bd2b46f814
Signed-off-by: Aravind Venkateswaran <aravindh@codeaurora.org>
Variable ad_bl_level is used only by AD functions now,
and can be protected with ad_lock alone. Earlier it
was used outside of AD functions as well and protected
by bl_lock. Using bl_lock causing synchonization delays
with display thread hence we now use ad_lock.
Change-Id: I2ec98236c3fedee1eb4d8f8a851256ab66ab3026
Signed-off-by: Krishna Chaitanya Parimi <cparimi@codeaurora.org>