Changes to support DP display as primary. The connector should
indicate the display type as primary to the drm library.
Change-Id: Ib5f6d9d72e8c42f88d38e06ed504848b8fc52029
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Soutrik Mukhopadhyay <quic_mukhopad@quicinc.com>
Signed-off-by: Sankeerth Billakanti <quic_sbillaka@quicinc.com>
Signed-off-by: Nilesh Laad <quic_nlaad@quicinc.com>
Add support to send PPS command with every frame for DP.
This is needed to satisfy the requirement of certain bridge
chips which need the PPS to be sent every frame.
Change-Id: I8711dff41e60d8b1e1c515a5d34a370a2409ce14
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
Currently, in SST mode, sink edid is read once after hpd
and reused on subsequent mode enumeration calls. But in
MST mode, there is no caching and the driver re-reads the
edid from the sink on every get_modes call for each monitor.
Each read takes more than 500ms causing unnecessary delays
during MST enumeration.
This change reads the edid once per hpd and uses the
cached data on subsequent calls.
Change-Id: I27545a44b9f9bd40000dde60735815f9c47fa54c
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
This change adds more debug logs and event logs to MST callflows
to help with MST stability issues.
Change-Id: I9053eab5932487fccce522cc17ed2e9fb8d887ab
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Enhance logging in dp mst functions by adding connector ids to
better identify operations for different streams and add more
trace logs.
Change-Id: Iaf5c67105c7af82fc5118674ddde5aef2319a611
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
A mode switch on a real monitor can be triggered by forcing the new
mode using debugfs and initiating an hpd_irq. Due to a missing
check for simulator state, the current driver calls the hpd_irq
callback for simulator even for a real monitor. This change adds
this check.
Change-Id: I13480eccd27eac2f9df3dd766d0445c0a5ea9b2c
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
DP MST driver registers bridge callback functions with the DRM framework.
mst_lock is used for synchronization of the mst bridge functions. These
functions call into dp_display where a session lock is obtained for
the display. HPD callbacks, on the other hand, are first handled by
dp_display. During these callbacks, dp_display takes a session lock
first before calling into DP MST driver layer. Currently, the DP MST
layer waits on mst_lock which can result in a deadlock.
This change removes the usage of mst_lock inside hpd callback functions
and just uses the session lock for synchronization.
Change-Id: I7ec338004eef43ac0f1e1f092463e9915cd60684
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
The simulation case uses dp_mst_sim_detect_port which
calls the drm detect port function after checking
the mst state. The non simulation case calls the drm
function directly.
This leads to cases in the disconnect path where
connectors are detected while being unregistered.
This solution merges the simulation and non simulation
cases by using the same detect port function, where a
check for mst state is performed before calling the
drm function.
Change-Id: I4a93001131beda54f8146bd50edc036924c94ab1
Signed-off-by: Sudarsan Ramesh <sudarame@codeaurora.org>
When DRM property objects are created, the DRM framework attaches a
dellocator which can eventually free the object when the last reference
is removed from it. The framework can only do this before the driver is
registered. If a property is created after the registration then the
framework is unable to attach a deallocator causing a memory leak during
tear down.
The current DP driver creates a new colorspace property whenever a
new dp connector is initialized. It creates a base connector at probe
time prior to registration. But then it also creates new connectors,
post registration, whenever a new MST dongle is attached to the
topology, causing memory leaks.
This change limits the property creation to the base connector and
attaches the same object to MST connectors to avoid memory leak.
Change-Id: Ib97dc7aac260b4f3f96c1097f58bd276c68501f8
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
On hpd low signaling, if MST is enabled, then the dp driver should
send the uevent to usermode and wait for the displays to be turned
off before destroying the connectors. In the current mst driver,
hpd low handling is a monolithic step. This change breaks this
into two separate callbacks into the mst driver so the display
driver can wait for usermode completion between these two steps.
When processing hpd low in sim mode, the mst driver uses the drm
framework's the port detection function. When hpd unplug is signaled
to the usermode, it checks the port status before disabling it. But
since the port hasn't been destroyed yet, the framework reports that
the port as still connected. This causes the driver to timeout while
waiting for the the displays to be disabled. This change adds a
wrapper which will report the port status as disconnected when hpd
low is signaled.
Change-Id: I1c59a4878018a300f258bd67c36d1cf4eaf5f67b
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
MST simulation ports can be removed either through HPD unplug, which
removes all ports on the branch device or through hpd irq, which
removed individual ports. In the current driver, the mst state
on the topology manager is being cleared prematurely. This results
in incorrect port status values being reported when the usermode
queries the status prior to disabling the corresponding displays.
So in its current state, on a HPD unplug, the display is disabled
but the port objects are not cleaned up and new ports are added
on every replug. On hpd irq, not all references are removed on
the port object and also the connectors are prematurely being
removed from the connector list. Additionally, when the last
port is removed, the mst state is cleared on the topology manager,
which destroys the branch device. Once the branch device is
destroyed, the ports cannot be added anymore and this leaves the
MST driver in an invalid state.
This change adds a new helper to remove the port and update the
connector list. It also moves the clearing of mst state to hpd
disconnect callback where the branch device can be safely destroyed.
Change-Id: I3400006a47cc8ab5876809a19b711e3b26be857c
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
When adding a new MST sim port check if the branch device was
destroyed already to avoid dereferencing a null pointer.
Change-Id: I8e6f82c5a6772a9b85d24feca52368da2027e96d
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
sde_connector_init will return an ERR_PTR if connector
creation failed, so need to use IS_ERR_OR_NULL to check
the return value.
Change-Id: I4fee5a624261898bbd079c54705e6eaebc71bac6
Signed-off-by: Yuan Zhao <yzhao@codeaurora.org>
Current dp_mst_bridge has variables that are accessed by both
check phase and commit phase, which causes racing issues. This
change will add private state to dp_mst_bridge to separate check
phase and commit phase.
Furthermore, this change is a partial rollback of commit 2446602565ec
("drm/msm/dp: add private state to dp_mst_bridge") where active_enc_cnt
is removed. In this change we retain the encoder availability check in
mode_valid.
Change-Id: I8ac05cf5f1755375e4e9f34e42dbaea1d23bac64
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Sankeerth Billakanti <sbillaka@codeaurora.org>
The single "port" refcount has been split in 2 on 5.4. MST sim
layer is only getting the topology refcount but never initializes
or obtains references for the memory allocated for this port.
Add the new refcount logic required on 5.4 to MST sim layer.
Change-Id: I6e25c048fa26352c4fb718996514a1ca91432408
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Enable compilation of DP MST feature. Also ported drm mst implementation to
use updated API definitions. Changes to the API include; removal of hotplug
callback; separate refcounting for topology and memory allocation in mst
port; pass the entire port instead of slot count in
atomic_release_vcpi_slots API.
Change-Id: I951c2978339229ea7e124c2addc114ea5d3cbb3d
Signed-off-by: Rajkumar Subbiah <rsubbia@codeaurora.org>
Update the definition of the atomic_check function for
DisplayPort connectors to align with the DRM upstream changes.
Change-Id: Id942c8ef16ae773540c4bc7221e0b784354a527c
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
As overall display driver is moving away from hard-coded compression
ratios, prepare the DP driver for the same by removing the usage of
the compression ratio enum.
Change-Id: I298db7d20baed8afec9f96dff8c7e950702bfec9
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
This change enforces dp, dsi and the sde drivers to use the
drm framework defined dsc_config data structure. As a part of this,
it introduces the sde_dsc_helper API to configure the dsc params
and creating a PPS command. Earlier each driver implemented it's
private versions leading to duplication of code. Additionaly the
helper api supports DSC spec 1.2 422 and 420 mode.
Change-Id: I25933fab08cdabbc6787079926885d1a78945e97
Signed-off-by: Abhijit Kulkarni <kabhijit@codeaurora.org>
This snapshot change adds downstream support
for drm 5.x+(msm_lahaina branch) linux kernel.
Change-Id: Ia691c95da155a00e449c91a2f1a5b20a8e71aed4
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
The mst topology manager set may fail for various
reasons. Ensure that the return codes are checked
and stop execution when failure cases are
detected.
CRs-Fixed: 2520932
Change-Id: I95c4caf403d0960525d931bf67560e800a3691ae
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
For crtcs attached to mst connectors, vcpi slots
are being allocated whether or not that crtc is
currently active. This will cause leaks during
lastclose when the crtc is inactive, because the
slots will get allocated, but never freed.
Check if the crtc state is active before
proceeding to allocate vcpi slots for that mst
connector.
CRs-Fixed: 2520907
Change-Id: I359738868e9bc72163f9e33204ff6cd7f0143b09
Signed-off-by: Xiaowen Wu <wxiaowen@codeaurora.org>
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
Adding prefixes for error, debug and info
messages in dp files. To enable debug logs
run "echo 0x100 > /sys/module/drm/parameters/debug"
CRs-Fixed: 2493739
Change-Id: Ibf509e837f527be6bff6b7a1c34b0cde2921b388
Signed-off-by: Satya Rama Aditya Pinapala <psraditya30@codeaurora.org>
Create a data structure to maintain available hardware resources
and track capabilities. This data structure is used to send
the current available resources and caps information to
connector ops get_mode_info, get_modes and validate_mode to
process the display mode.
Change-Id: If38fc628ee5ab4729821f88c0050ab45375187b8
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Improve dp mst simulator mode by adding support
for up to 8 connectors, the ability to add and
remove ports dynamically, and allowing for
different EDIDs for each connector.
CRs-Fixed: 2459530
Change-Id: I945e3292a7e5150ab7a6bbe0addc4f4f46d58e82
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
Perform mst phy operations during suspend/resume
to allow sinks to be in a correct state. A usbpd
api must also be called before and after the phy
operations to allow the system to go into deep
suspend and resume in a timely manner.
CRs-Fixed: 2363921
Change-Id: Ie21ef9b1caf2044e598466373a6059d2a1e5e58c
Signed-off-by: Fuad Hossain <fhossain@codeaurora.org>
Add a release operation to free the mst port object when
the object refcount becomes zero.
Change-Id: If628e6da7ccf90d334574ed0f627788fb0a1fa2f
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
This change brings msm display driver including sde,
dp, dsi, rotator, dsi pll and dp pll from base 4.19 kernel
project. It is first source code snapshot from base kernel project.
Change-Id: Iec864c064ce5ea04e170f24414c728684002f284
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>