Initialize the return value before using or returning to user space
to avoid returning uninitialised values to user space.
Change-Id: Iac43744830d725cf69120603befc3e4dd758d031
Signed-off-by: Ping Li <pingli@codeaurora.org>
When there is no data available for pixel extensions from user end,
calculate software pixel extensions with zero initial phase.
Change-Id: I8876b27e4265b39374d5520684028aaaf005d7e8
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
mmagic ahb clock vote is handled through bus driver
on thulium target. Any module which uses AHB clock
has to add its vote on mmagic ahb clock. This
change adds this vote for MDP, DSI, SMMU and
HDMI modules.
Change-Id: Ibd8d7e7396f26dc13a0b7700c01c3d3dba839ae4
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Invalid input/output format error checks in rotator module
is causing rotation request failure or wrong error message
print. This change fixes such invalid checks in rotator
module.
Change-Id: I0f5f19b65c6017dd16deaa09715d29335e551b01
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
MDP, DSI, HDMI and PLL modules turn on mdp gdsc independently.
It is illegal to turn on mdp gdsc without turning on mmagic
gdsc on thulium target. This change adds mmagic vote
for these modules.
Change-Id: I765fcc42477b9e46d0da48cb0cf5b298f58b7815
[veeras@codeaurora.org: As part of 3.18 upgrade,
remove msmthulium-mdss-pll.dtsi, msmthulium-mdss.dtsi changes
from this gerit]
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Fix NV12 UBWC buffer support by setting YUV format
bit in format register and correct plane address.
Change-Id: I013e0855ae6c2f990d0d5d6386b9949f475c0ad1
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
This reverts commit 37eb5c3f566e8fe554815b45e58b1992730f3e38.
Storing UBWC planes in UBWC buffer format configures the
wrong stride for meta planes and bitstream planes. It also
tries to set the buffer address on each data_check call. This
sets invalid Y bitstream address.
Change-Id: I8e91f25a22ed9db278d7a334c4732d709566a32a
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
CEA-861-F specification defines new video formats which are supported in
the hdmi 2.0 specification.
Change-Id: I5bf017835ea7c5e472e91c0d663f6f0083a87854
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
During split display case, the 2nd dsi ctrl's phy/pll registers are
programmed at same time as 1st ctrl programmed since both controller
share pll0. Therefore they have to be reset at same time also.
Change-Id: Ifb2007c4efd619cd5f08a0fc64fd66f22d62efcd
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
DTD (Detailed Timing Descriptor) provides full resolution timing
details. Currently we compare these details with our resolution
data base to find a match. This is not needed as DTD has complete
details. Once parsing of resolution is done, just add this as a
new resolution.
Change-Id: I0d6c101c96a6bc8c0ff8fe63c17bf233d52dad7f
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Do not set invalid or unknown resolution received through
continuous splash screen, set the default resolution instead.
Change-Id: I61358edaf3039d99acd77f4ae0edf3c9e24721f5
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Current frame-buffer driver gets shutdown call back and it turns the
display off. Once shutdown call-back is received, any subsequent
frame-buffer opens are rejected and an error log is generated. Now
user-land display clients are not aware of shutdown and they keep
opening the frame-buffer devices repeatedly ignoring the failures and
notifications sent by the driver. Due to this, excessive logging is
observed which in turn leads to watch-dog bite and a crash. Prevent
this by generating error log only once and keep sending sysfs
notification for every rejected frame-buffer open.
Change-Id: I9df6cb708a2d6c986a31324540a3d040dffbcdfc
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Using fb mmap, we can get a buffer from ion handle,
or from a fixed adress physical continuous memory.
Earlier if mmap is called more than once then ion
handle won't be NULL and fb would allocate using
physical continuous memory. Fix this to ensure the
type of fb allocation is correct by storing fb map
type.
Conflicts:
drivers/video/msm/mdss/mdss_fb.h
Change-Id: I2b47b08b7fcb06f8220fcfe8852f5c2e37ade628
Signed-off-by: Mao Flynn <Flynn@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
The dma pipe selection is done by client. Earlier,
the driver was trying to allocate a free dma pipe and check
if the allocated pipe matching with the selection. Instead,
it is now assigning the pipe directly.
Change-Id: Ie3f239a02b0da1e598efe755329c1e5d9746166f
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
MDSS module needs turn on mmagic AXI clock on thulium target
when it tries to fetch data or write data to output buffers.
This change adds that support.
Change-Id: I3e84046274d377c30028608217247bdfb32bc341
[veeras@codeaurora.org: As part of 3.18 upgrade,
remove msmthulium-mdss.dtsi changes from this commit]
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
SMMUv2 clients needs to enable the mmagic gdsc before
creating mapping or attaching context bank. It can disable
the GDSC when context banks are detached. Display module
enables mmagic gdsc before creating secure & unsecure
context bank mapping for MDP and rotation clients during
probe. This GDSC is also turned on and off when clients
tries to attach context banks and detach respectively.
Change-Id: Iee3c93d440388693d83cc57ca001408d95c9654b
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
User-land program can configure idle_time as zero when they want to
disable idle_time notifications. In the current implementation, driver
does not modify current idle timer if idle_time is zero but it may still
send the notification if the previous timer expires. Prevent this
notification if idle_time is set as zero.
Change-Id: Ib35b71a1f6c7f13f3efc28cf48a8c6bd6aaa0fa2
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Reset HDCP engine during HDCP reauthentication. This will
prevent HDCP engine from going into a bad state of
continuous authentication failures.
Change-Id: I727857c23673c55d77144d63fc4de2c89d6ec5a6
Signed-off-by: Casey Piper <cpiper@codeaurora.org>
Width and height are not properly calculated when decimation
is involved. When there is scaling on a pipe, the required number
of pixels are wrongly programmed resulting in pipe hangs and
leading to TLB SYNC issues. This change handles proper
calculation of decimated width and height.
Change-Id: Iadc4b201b32dda3dba6afe23070f349677be417c
Signed-off-by: Jeevan Shriram <jshriram@codeaurora.org>
These delays are corresponding to the h/w documentation update.
Change-Id: I8d782e470960e6b8eb4f7428aedf4702544890d3
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
This error indicates that the new refresh rate was not dynamically
changed. The error has to be handled.
Change-Id: I0e1f0490d2207d7214cfd67dcb80a0db383e496e
Signed-off-by: Huaibin Yang <huaibiny@codeaurora.org>
Make sure the LAB/IBB regulators are available
before start using them. In addition, fix the
regulator_disable error return path.
CRs-Fixed: 778471
Change-Id: I0a8c3b1f7f13c2699ad58b9c8302c992d076b89d
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
The frame done notification is required even for kickoff without
output buffer. This happens for pan-display path, where a kickoff
can be triggered without output buffer queueing first. By notifying
the frame done event, it allows the client to release retire fence
properly.
Change-Id: Ia29acf58819641e84a58061f9c06ee74cf1bec06
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Starting new atomic commit IOCTL implementation, driver expects user-land
to send each input layers's destination x in full panel co-ordinate system
unlike previously this was required only when source-split feature was
enabled. As an example, in dual-dsi configuration where each panel is of
1280 width then any layer going to only right panel needs to have their
dst_x at-least 1280. Now internally driver manipulates this if source-split
is enabled or not. However current implementation sends back this modified
dst_x backs to user-land which in turn comes to driver in subsequent IOCTL
calls and leads to unexpected behaviour. Fix this by sending original dst_x
back to user-land program.
Change-Id: I962cfa15e4dc7e905e42330f808edb31d33ffdf2
Signed-off-by: Ujwal Patel <ujwalp@codeaurora.org>
Set iommu domain attributes for mdp and rot clients
after domain is attached. This will disable the "coherent
table walk" feature based on SMMUv2 recommendation.
Change-Id: I43af775dcd5bf242c90da4d70e2ad917a11f022f
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
The rotator buffer validation was in the kernel work
queue thread. If the validation fails, there is no way
to notify this failure. This change moves the validation
in the user thread, which allows user to handle the failure
more gracefully.
Change-Id: I21a18de7d96e705fc36339658a27299e9fc607b6
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
This is to expose rotator device capabilities (number of
write-back blocks, downscale support) through sysfs node.
Change-Id: I6b62c7293f6e69ee5945fed0b9275d07a477cfba
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Read HW revision before configuring the PHY when
continuous splash is not enabled and fix the thulium
target phy configuration.
Change-Id: Iadaef93b6d31adee4c54f0b75f7343bd01223dfe
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Num of bus path configuraiton represents the RT and
NRT paths. Fix the realtime paths calculation.
Change-Id: I5b3657d51e60bcfeb51cbbc220e121a2a4dc4d84
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
During validate, prevent asymmetrical downscale factor work
from being accepted.
Change-Id: Idc2989cbd5ced5cdb93e74e22446d3519f4c0813
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Client may use null commit to clean-up h/w resources. This is
to enable null commit for wifi display atomic commit use case.
Change-Id: Id1048049c0b747833a2b871bd9becf1ff04e44c1
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Earlier, rotation operation was handled as part of overlay API.
This creates a dedicated rotation device driver, which makes
rotation operation separate from frame buffer device.
Change-Id: I1cf99be03606fd43f97db386a6a55c01f1a058d4
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
[cip@codeaurora.org: Moved new file locations,
updated sync.h/sw_sync.h includes]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
The HDCP 2.2 feature was being initialized only if QFPROM keys are present.
This is not required for HDCP 2.2, only for 1.4. Instead, added gating for
initialization of HDCP 2.2 feature by the version of HDMI Tx controller.
HDMI Tx controller version 4.0.0 and above supports HDCP 2.2 auth.
Change-Id: I7f2fae06ed09f3fde638faa416c926a038edbd76
Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
Too much downscaling or upscaling results in bandwidth issues
due to hardware limitation. Fix return error code for such cases.
Change-Id: I4bf405bc278ebd6fdadb2f81faa68b7fec67e517
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Currently, HDMI driver has HPD (Hot Plug Detect) work to handle HPD
interrupts and power off work to handle the Tx power off. Power off
work waits for HPD work to finish if in progress. In case of suspend,
this can lead to a dead lock or power off work might starve for long
time HPD work may take some time to finish resulting in suspend or next
resume to timeout.
Power off work was added to unblock the user thread as it used to take
a long time waiting for audio engine to finish. That part of the code
has been moved to HPD work. Now power off can be synchronous with the
call as now it doesn't account for the delay. This removes the dependency
on other work.
Also, use a separate mutex for power on/off. The existing mutex is being
used in large number of places which are not related. During suspend/resume
use of mutex in places like sysfs read/write might result in longer hold of
the mutex resulting in power off delay which eventually may timeout the
suspend or resume.
Change-Id: Ie1e461f6cb7f90d440bfd203b935cd7dea069b5e
Signed-off-by: Ajay Singh Parmar <aparmar@codeaurora.org>
Add dsi phy related supporting functions to configure
timing registers of both data and clock lanes of phy
interface.
Change-Id: I185c26ff2b9f11d9b30f4fee42bc730b69098f0f
Signed-off-by: Kuogee Hsieh <khsieh@codeaurora.org>
Add N and CTS values needed for audio clock regeneration when using 594MHz
pixel clock. These values are recommended by HDMI 2.0 specification.
Change-Id: I3866492b1f767ef22ab91acc763589d692bc6aa7
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>
Add the support for atomic commet wfd use case, where
the output buffer is specific in the atomic commit
structure.
Change-Id: I261392df132d4321daccb05d6ba7f5d9ea622236
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
[cip@codeaurora.org: Moved new file locations,
updated sync.h/sw_sync.h include]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Store UBWC plane information in UBWC buffer format
instead of MDP buffer format. This cleans up logic
for input data check and simplifies the MDP plane
configuration.
Change-Id: I0a72238d0110fe88aec394f8f6248ba46fab92b7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Commit call should move unassigned pipes to cleanup list before
calling kickoff because it supports "validate + commit"
functionality.
Change-Id: Ia4d690a451b2ba770f285918d46d9118fcaeacce
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
There are different programming interfaces in different hardware
revisions. This change abstracts the writeback block, so that
the client does not need to deal with the differences.
Change-Id: I3f49ee1f2e003655dbef0d3281d9c9ad95cdb327
Signed-off-by: Xiaoming Zhou <zhoux@codeaurora.org>
Histogram LUT (PA LUTv) can be enabled by the 32/64 bit user-space
clients. 32 bit user-space client will take the compat ioctl path.
This change adds support for 32 bit clients for Hist LUT feature in
MDSS driver.
Change-Id: Ibbe3d37fdebba9aa46845660e62cf4d812af5866
Signed-off-by: Benet Clark <benetc@codeaurora.org>
In order to provide more reusable code, and prevent unnecessary
debugging removing union as memory saving is insignificant.
Change-Id: I5da68c64c0bf09157738fbec1feb6adde5af42a2
[veeras@codeaurora.org: Resolve merge conflict in msm_mdp_ext.h by
retaining the version in this file]
Signed-off-by: Terence Hampson <thampson@codeaurora.org>
Signed-off-by: Veera Sundaram Sankaran <veeras@codeaurora.org>
Source surface post processing(sspp) pipes support post processing
features in thulium. If user-space client is 32 bit and kernel is 64
bit compat ioctl path will be taken. Change updates the driver in
compat path to support 32 bit clients for sspp features.
Change-Id: Iaa07f40520f115348ac3af4c9eeb5690ed78e2dd
Signed-off-by: Gopikrishnaiah Anandan <agopik@codeaurora.org>
Handles messaging with a connected HDCP 2.2 capable receiver, in order to
send and receive HDCP 2.2 authentication messages. This includes sending
HDCP Tx messages to the receiver, polling the receiver for expected
messages, and monitoring the receiver status. The receiver authentication
status is used by the HDMI Tx driver to determine whether HDCP 2.2 content
can be sent to the connected receiver.
Change-Id: I12ae6427e8b61259989a670bf9856464a3109774
Signed-off-by: Alhad Purnapatre <alhadp@codeaurora.org>
[cip@codeaurora.org: Moved mdss_hdmi_hdcp2p2.c file location]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Atomic commit IOCTL adds validate and commit layer support
for framebuffer driver clients. Clients sends the validate
request with layer list for each display to put layers
in validate list. Once layers are validated; clients sends
the commit request for all validated layers. Validate
request may fail while commit must not fail because clients have
no fallback mechanism for commit failure.
If clients calls the atomic commit without validate request
then commit will validate all the layers before kickoff. In
such situation; commit may fail due to validate failure.
Change-Id: I9e9b27d1021292c8cafc624d40e7417a2028116a
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
[cip@codeaurora.org: Moved mdss_mdp_layer.c file location,
updated sync.h/sw_sync.h include]
Signed-off-by: Clarence Ip <cip@codeaurora.org>
When using yuv420 as output pixel format, extpclk must run at half the
frequency since the bits per pixel of yuv420 is half of rgb888
Change-Id: I6c8271a42a3f259da20b268a0e67f34f5f23eb6e
Signed-off-by: Vinu Deokaran <vinud@codeaurora.org>