Commit Graph

24 Commits

Author SHA1 Message Date
Amine Najahi
08358fd857 disp: msm: remove use of drm_display_mode vrefresh
Use of drm_display_mode vrefresh is being deprecated in
upstream DRM framework. Downstream driver need to use
drm_mode_vrefresh API from now on.

This change removes dependency on drm_display_mode vrefresh
and replaces it with drm_mode_vrefresh API in SDE, DSI and
DP driver. In addition, it also modifies drm_display_mode clock
to align with upstream approach where an uncompressed mode clock
is required to match drm_mode_vrefresh API.

Change-Id: Ie972a2e140adfd81c4e68df8e7bc69feaaca22e1
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2021-01-13 16:08:27 -05:00
Lei Chen
ab3f86f918 disp: msm: use connector properties to expose and set panel mode
Expose panel mode from kernel to SDM with SDE connector property
CONNECTOR_PROP_MODE_INFO and set panel mode from SDM to kernel
with SDE connector property CONNECTOR_PROP_SET_PANEL_MODE for
avoiding private change in upstream code in QGKI kernel.

Change-Id: I0629dad9399967cc1118ac02ce30597076ca367d
Signed-off-by: Lei Chen <chenlei@codeaurora.org>
2021-01-13 23:40:22 +08:00
Samantha Tran
0c08cb1fb5 disp: msm: update parameters for drm_bridge_attach
Commit a25b988ff83f ("drm/bridge: Extend bridge API to
disable connector creation") and commit ee68c743f8d0 ("drm: Stop
including drm_bridge.h from drm_crtc.h) add additional input flags.
This change adds fixes to the drm bridge attach API and includes
relevant drm_bridge header files.

Change-Id: I85e84eaff7df2995243896108a217fae81716b63
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-16 17:27:46 -08:00
Samantha Tran
16cc165833 disp: msm: obtain bridge from bridge chain
Commit 05193dc38197 ("drm/bridge: Make the bridge chain
a double-linked list") creates a bridge chain linked
list. This change updates the relevant changes to msm
driver to use the list to find the bridge associated to
the encoder.

Change-Id: I59eb2910be96f4fff7bdbeb040d6ad204c41d747
Signed-off-by: Samantha Tran <samtran@codeaurora.org>
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2020-12-16 17:24:59 -08:00
Abhinav Kumar
6db41ed532 disp: msm: dp: add support for continuous PPS command
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>
2020-11-24 18:16:28 -05:00
Rajkumar Subbiah
9522cd1382 disp: msm: dp: use base connector properties for mst connectors
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>
2020-08-17 21:20:04 -04:00
Amine Najahi
ed868466f5 disp: msm: dp: Extend mode filtering to support 8K
Currently DP driver determines if a mode is DSC capable
based on a DTSI entry and the required number of DSC
to support it. This approach does not scale when there
is an overlap in DSC requirement between DSI displays
and external DP display, thus causing one of the display to
report modes that cannot be supported.

This change compares the resources reserved for DP driver
calculated at initialization time and the currently available
ones to determine the correct number of resources that DP driver
can use. It also adds DSC and topology filtering logic and moves
DSC hardware specific from DP driver to SDE driver.

Change-Id: I8e601de33422b7c6d786826f7bfe152c4af8a6b5
Signed-off-by: Amine Najahi <anajahi@codeaurora.org>
2020-06-09 09:17:38 -04:00
Dhaval Patel
83860f0642 disp: msm: pass free dsc and lm availability info to dp
Primary and secondary dsi displays are built-in displays
and they are supported during all concurrency usecases
without resource allocation failure. DP mode filter
logic should provide supported mode information based
on free mdp resources after dsi resource assignment.

Change-Id: I3a9637a91ea1ffcc31997e25caff7f13605283ac
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
2020-06-07 22:57:26 -07:00
Tatenda Chipeperekwa
6a68c684bd disp: msm: dp: exit stream enable on cable disconnect
Exit stream enable on cable disconnect considering that the
controller and display modules would have transitioned to aborted
state. It is possible that the disconnect might have prevented
the link clock from being enabled, so we have to skip any register
programming in the link clock domain. We remove the unprepare
call from the DRM wrapper error handling since that path can lead
to unclocked register access when the link clock is not enabled.

Change-Id: I92595c0824193df63c2746bc8cd644f59c33604a
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2020-05-19 08:19:15 -07:00
Narendra Muppalla
218244e58b disp: msm: update rm topology mapping tables
This change updates resource topology mapping tables and includes
logic to compare compression types for dsc vs vdc.

Change-Id: I1735edeb07aec8ed0065f84ac0824c58158412f3
Signed-off-by: Narendra Muppalla <NarendraM@codeaurora.org>
2020-05-04 22:47:11 -07:00
Tatenda Chipeperekwa
51805afe28 disp: msm: dp: compile MST feature based on display config
Add a compile time flag for the MST feature that will allow
selectively enabling the feature.

Change-Id: I8bf288277c7af00c3cf254a8c757151559e0a010
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2020-03-12 18:07:11 -07:00
Steve Cohen
1470b1605c disp: msm: dp: fix null check in atomic_check
Fix an invalid pointer check on input parameters.

Change-Id: I899e19e578d4d337e49da9084875bfd1917efe59
Signed-off-by: Steve Cohen <cohens@codeaurora.org>
2020-02-14 23:35:19 -05:00
Tatenda Chipeperekwa
cf71a83fba disp: msm: dp: update the definition of atomic_check function
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>
2020-02-10 11:34:43 -08:00
Abhinav Kumar
27844b7b60 disp: msm: dp: remove usage of compression ratio enum from DP driver
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>
2020-01-29 13:46:46 -08:00
Narendra Muppalla
d1d9ae8b19 Disp: Snapshot change for lahaina display driver
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>
2019-11-24 12:30:51 -08:00
Tatenda Chipeperekwa
da892c0b91 disp: msm: update topology based on clock requirement
Update the topology allocation by considering the required
mode clock (vtotal x htotal x fps * fudge factor). Modes with
a clock that exceeds the maximum SDE clock will be denoted as
requiring a topology that uses two layer mixers.

Change-Id: I3c773598b0d79cb6fea9d3a0e04d89ff84d67e13
Signed-off-by: Tatenda Chipeperekwa <tatendac@codeaurora.org>
2019-09-20 14:39:54 -07:00
Samantha Tran
c00bf10768 disp: msm: add proper null checks and propagate error
Fix possible null pointer dereferencing and propagate error
code during early return.

Signed-off-by: Samantha Tran <samtran@codeaurora.org>
2019-08-06 14:47:18 -07:00
qctecmdr
c70f647143 Merge "disp: msm: dp: correct the resolution width check in get_mode_info" 2019-08-02 13:42:29 -07:00
Abhinav Kumar
14e02e4b02 disp: msm: dp: add colorspace property for MSM DP
Add the colorspace property for DP controller for MSM. Also, change
the default method to send the colorimetry information to the sink
from MISC bits of MSA to VSC SDP packets if the sink supports it. This
helps to avoid dynamic switches between the packet types for sending
the colorimetry information during BT2020 and DCI-P3 use-cases.

Change-Id: I7ddf879a187b023fcf7404d64028e4d19b031119
Signed-off-by: Abhinav Kumar <abhinavk@codeaurora.org>
2019-07-24 17:24:27 -07:00
Satya Rama Aditya Pinapala
aacd9e9585 disp: msm: dp: adding prefix for logs
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>
2019-07-23 09:14:04 -07:00
Sankeerth Billakanti
9d0591d86f disp: msm: dp: correct the resolution width check in get_mode_info
Use two layer mixers only if the resolution of the display exceeds
the linewidth of the given layer mixer.

Change-Id: I1892587816c0718280765353df7eabf82d6d7a18
2019-07-23 04:13:13 -07:00
Nilaan Gunabalachandran
98434934c6 disp: msm: dp: filter modes based on sde resource availability
Not considering the currently available sde resources and
caps while filtering/validating a mode will report unavailable
modes and result in an atomic commit failure.
DP should calculate the number of required lms and verify
if lms/3dmux are available before a validating a mode.

Change-Id: Idadcc655c30f5a831c47cf22b60085052b5b9fcd
Signed-off-by: Nilaan Gunabalachandran <ngunabal@codeaurora.org>
2019-07-02 17:34:55 -04:00
Nilaan Gunabalachandran
d92000cdd4 disp: msm: add resource caps structure and api changes
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>
2019-07-02 17:34:49 -04:00
Narendra Muppalla
3709853456 Display drivers kernel project initial snapshot
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>
2019-04-14 22:20:59 -07:00