While handling dsi_gen_read_status, status buffer
was xlogging without checking for its max size.
Add proper conditional check to xlog status buffer.
Change-Id: Ia5a1fe18de123d2911c31ae79492b96f67e1273d
Signed-off-by: Narender Ankam <nankam@codeaurora.org>
Validate the Gamma correction feature with all bound condition.
This change corrects the Gamma LUT block bound condition.
Change-Id: I3fc460b6a6e2e76f7c07b649e1db1e01ce208476
Signed-off-by: Ch Ganesh Kumar <chganesh@codeaurora.org>
Use routines defined in uaccess.h (like put_user, get_user)
while accessing user space buffers. Otherwise this leads to
userspace access violation when PAN is enabled.
Change-Id: Iea16e347ee71f0845711a21b6b9b01e16a6ab619
Signed-off-by: Nirmal Abraham <nabrah@codeaurora.org>
Add check for spi client while using
ion_import_dma_fd during mdp3_get_img.
Change-Id: Ibd882725eb191454612397c2f2d6e5b28a712043
Signed-off-by: Arun kumar <akanak@codeaurora.org>
In mdp debugfs, pipe, mixer, buffers and ctl information
is dumped. While dumping pipe buffer information using
pipe's buffer list, acquire list lock mutex.
Change-Id: Ibd26cc1484fb08ae7d0852f405100f6bbfa707de
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
For downscaling a 32 BPP surface with scale ratio greater than
or equal to 3.5, it is recommended to increase the mdp core clock
by 10%. This is to avoid any stalls on the bus during high concurreny
scenarios.
Change-Id: I77c8c25c73e4232271a93397e52798a6d5d74cf3
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
Hflip is not supported on cursor pipes as there
is no flip buffer in the hardware. Invalidate
any commit request for cursor hflip.
Change-Id: I4b0ad28caffb75a4bd5a928a90daa6aa59f51848
Signed-off-by: Animesh Kishore <animeshk@codeaurora.org>
Avoid allocating mixers LM0 and LM1 to external display and
writeback as they are allocated to primary display first.
Change-Id: I343a70dca2e664e5c9765fa2f0b933714b747b4a
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
During resolution switch, the vsync is disabled just before the switch
as part of ctrl stop, but it is not enabled back after the switch. This
change keeps track of vsync before the switch and handles it
appropriately after the switch.
Change-Id: I3eed93d7f7635217bac3c19c61f68154cacef56e
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Remove wait for vsync in display commit if both PCC and DDIC
need to update for external backlight feature.
Change-Id: I57aeb48acba24e0ca3fff21b1117e48fe452028b
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
With DSC enabled in the panel interface, the horizontal resolution is
smaller than the panel width due to the compression. Correcting the
time_of_line and total_line calculation by calling the proper macro.
CRs-Fixed: 2048339
Change-Id: I36c1b9d30d5a440dfef4b4638f4f3ebf807782c8
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
For larger panel with longer vertical resolution, it is possible that
bandwidth requirement is much higher during downscaling usecase. Current
bandwidth calculation for compression ratio adjustment only use 32-bit
and it is shown that overflow can happen, and is required to change to
use 64-bit variable as input and output.
CRs-Fixed: 2045602
Change-Id: I817e9d55fb6e24e686513327d00f7efd08ac717f
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
There can be cases where MDP is resuming at default fps
and in between dfps update comes before unblank is completed.
This might result in mismatch in fps and blanking
settings in MDP and DSI. Hence avoid any fps update until
unblank is finished.
Change-Id: If4fed28b1d706f38c39fba06fa786eac6d9ed8c8
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
In bandwidth limit read function, 'buf' array
elements might be used uninitialized. Ensure
the array elements are initialized.
Change-Id: I210c73b14327436296a844fc5ebd47ccc02bf5fb
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
After cdm has been used, need to reset cdm block,
or the next HDMI device will be affected by the
cdm config.
Change-Id: I4eb879202cc3547d9149b3352377c3395ebfe6b3
Signed-off-by: zhaoyuan <yzhao@codeaurora.org>
Add checks before accessing the array to fix potential
issues such as array index out of bounds error.
Change-Id: I42d0f8e72f8848de6ca2f143f115f39256144ec0
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
If a low power mode switch is initiated while a kickoff is
in progress, the panel could be turned off before the
current frame transfer is completed causing a display hang.
This change recognizes this case and waits for the current
frame to finish before initiating the power state switch.
Change-Id: Ieea32acd67c56a7ed8a83ff92c3b49ad76d70086
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Initialize external backlight level to -1 when fb probe.
This is to make sure the external backlight level is
invalid the first time overlay kickoff.
CRs-Fixed: 2021142
Change-Id: I973b184903cdb5b378326b23ca5c958e4b868c76
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
During continuous splash handoff on video mode panels, the
cleanup is currently performed only on the master control. This
causes occasional memory fault in dual control configurations.
This change calls cleanup on both master and slave controls
if applicable.
Change-Id: If0bcad0686efd5f2aba0efa6992e1d348aca213f
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Scaling is not allowed for layers with solid-fill.
Add checks in validate call to fail such cases.
Change-Id: I02cb2d129d27c6173429fd02b5ff84702936d98e
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
During the resolution switch use case where the active resolution
needs prefetch but the new resolution doesnot require it, currently
programmable fetch blocks are not disabled if not in use.
Change-Id: Ib5ea8ef75308132f5530aaf35aaea53858ea94a2
Signed-off-by: Raviteja Tamatam <travitej@codeaurora.org>
Fix ref counting of the secure buffers. This change releases
the ref count on the secure buffers during the free operation.
This allows the buffers to be ref counted until hw has done
fetching from the buffers.
CRs-Fixed: 2012323
Change-Id: Ic24c39e75d502ed73453d0c6d78fd76448737697
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
1. Add support to update backlight when display commit. Backlight
level is sent from userspace. And sync to set PP config, kickoff,
and set backlight in the same vsync period.
2. Add support to get current backlight level through sysfs node.
Change-Id: Icf264299ecf8edd3831938745a471c2655c23542
Signed-off-by: Xu Yang <yangxu@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
During continuous splash handoff the pipes are unstaged and the
timing engine is being turned off. But this change is not
being flushed. Right after that we release the splash memory
and this sometimes causes a memory fault. This change adds
the necessary flush.
Change-Id: Ia78359fd8159a7217ffc4f0192788f295ac3504c
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
vbp_min is calculated as 0 because variable is incorrectly
compared. Fix this to correct prefill bw calculation.
Change-Id: I80c3db2898111b5e8acdccc35af745dde30c0509
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
When disabling the clocks that MDP depends on during an ON to OFF
transition, it is necessary to reverse the clock enabling sequence.
Otherwise, the MDSS AHB clock will stuck in a halt state and cannot
be turned off.
CRs-Fixed: 2004996
Change-Id: I0da7df14e2084701c95fd08585b9a41e0a8cb653
Signed-off-by: Benjamin Chan <bkchan@codeaurora.org>
This fix adds notification of idle power collapse to user space
for cmd mode panels. Without this fix user space has no
knowledge of reprogramming the QSEED3 LUTs after idle power
collapse, this needs to be done with the user space knowledge
to keep it's LUT bank offset in sync with the HW used LUT bank
offset.
Change-Id: Ia1fbd07da8c8c854a74cf5dad62f5ec2d1fc962e
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
When autorefresh is enabled, any kickoff that
gets processed needs to wait to make sure the
transfer is on-going before continuing
the commit; current driver only waits for
autorefresh interrupt but this doesn't
guarantee that transfer is already on-going.
This change waits for the write pointer,
to make sure a transfer is on-going.
Change-Id: I247b3aad8f2f6ea8954d54f34492e293f80f99d4
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Current driver read if any nrt vbif is present
and if it is not, the number of qos priority
levels gets wiped out, causing the driver
not to program the vbif qos priority levels for
the rt client. Fix this problem by making sure
that if a vbif nrt does not exist in the platform,
driver only ignore the nrt settings, but keeps
programming the vbif rt.
Change-Id: I2fe5eea5a2ff852b22a59cdb0139b17f3dd7c494
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
After continuous splash reconfiguration, when turning off the
clocks ping pong split configuration is not handled properly.
Pingpong split uses single controller and dual context, so
the second context of the same controller should be used
instead of the slave controller.
Change-Id: Ibafdfd0aba4e0f02f141d60cb8866f353137a3ce
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
This change fixes unitilized local variable being used and
checks for the valid format in concurrent writeback case before
using the format parameters.
CRs-Fixed: 1110015
Change-Id: I61a3e20af1d0a4db7a7db454ae35b810639744ae
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
During transition from ultra low power mode to
low power mode, tear check is not reconfigured,
which can cause problems during the doze mode
use case. Fix this problem by making sure
that tearcheck gets reconfigured.
Change-Id: I5dc0dd78d98c768ef70c795ac974bb4574c55a0f
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
When performing right-only update on a dual LM single display mode with
3D Mux enabled, the right mixer's ping pong buffer should be used.
Change-Id: Ib530d7503ca46a01198cc88de5312635bd84a6fb
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
During secure to non secure transition the commit contains
only non-secure layers and there is no null commit in between.
This change correctly validates such commit and allows non secure layers
only and the driver then performs the functionality to transition to
non-secure state.
CRs-Fixed: 1110585
Change-Id: Ic1d32f0d04d8ee860844f59fd99707dbdb78838f
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
Sequence to disable autorefresh when handoff is
done to the kernel is missing to wait for the
previous transaction to finish. This change
makes sure any previous on-going transaction
finishes before disabling autorefresh.
Change-Id: I547aea5cc82989d03963b2153e2561092fd7b36c
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
For split display panels, when panel has 180 flip or HFLIP,
the source layers needs to be swapped instead of the mixers.
SDM will take care of the source swap and rectangle
recalculations.
This change is to remove the mixer swap, and to expose the panel
flip property through sysfs, so that SDM can flip the source
layers to maintain pipe priority.
Change-Id: I47a7dd38dc1e45dd3f7edbd189c9403900b74eea
Signed-off-by: Krishna Chaitanya Devarakonda <kdevarak@codeaurora.org>
If MDP fence timeout happens, then to handle it gracefully
we stage border fill. In this regard as the mixer config has
now changed, then ctl flush has to be set.
Starting for Ia510fc6377c5b328cb4225a4725275d86b72dbff, ctl
flush bits were getting reset. Fix this in case mixer is
setup again with borderfill.
Change-Id: I12f60472e8f0f5630e239fb4b4026fda0d2f7cba
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Considers DSI0 and DSI1 as separate displays even if
split display is enabled. So the number of displays
are calculated as 2 whereas the driver considers this
as a single display. This causes MDP clocks to remain
ON. This change corrects number of displays calculated
by checking for split display.
Change-Id: Ie0d3dbbcb93cc86b88a8b903fd1f7ccd89a8a871
Signed-off-by: Krishna Srinivas <krisrini@codeaurora.org>
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Signed-off-by: Abhijith Desai <desaia@codeaurora.org>
While switching between panel resolutions with DSC on/off
the variable that is used to flag the reconfiguration
can be overwritten if the roi_changed flag is not true.
Change-Id: I2e3041c848aafbc7a348fca7ce450a4fadd0e8d7
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Add NULL checks before accessing potential null pointers. Also, fix
uninitialised variables in MDP driver as they can be accessed with
incorrect values.
Change-Id: Id8a551fd3bc147c800ee1c98c2bc2b6f3bf6d380
Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org>
Current clock driver requires that before enabling
the core clock after power collapse, the set rate
must be called. Ensure this sequence by always calling
the set rate for the mdp core clock before enable.
Change-Id: I872f18235b0b1685dfdee3de99827d031077a012
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
When servicing NOTIFY_UPDATE_STOP command, if the notify object
was uninitialized then mutex lock is obtained on one object but
unlock is done on a different object. This change fixes it.
CRs-Fixed: 1088059
Change-Id: I66cbe48b7f4910228a6af57610a8427fea7fd1f2
Signed-off-by: Naseer Ahmed <naseer@codeaurora.org>
Current display driver prints warnings and errors within
the mdss spinlock. This causes in random cases to hold the
spinlock for long time when multiple errors are printed;
Fix this by moving the print of warning and error messages
outside of the spinlock.
Change-Id: I09359b528b4742f72a76690930f3d0ed90bb2caa
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>