Commit graph

1330 commits

Author SHA1 Message Date
Guchun Chen
b8e0c667eb drm: sde: Check commit's validity when starting splash handoff
User maybe send null commit with invalid frame buffer
to kernel, so early splash's handoff should wait for
one valid commit coming with active fb.

CRs-Fixed: 2225630
Change-Id: I5ef0809791d697be264787ebe7a6ec58704cb310
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-05-17 14:24:00 +08:00
Camus Wong
96d45e5dad [drm/sde/hdmi] move scrambler setup from mode-set to pre-enable
when mode-set is called, HDP core is not enabled yet and scrambler
is not working. Move scrambler setup to pre-enable stage will fix
this problem.

Change-Id: I85d0ac22c6b789a9c0f6288b06cabf3225c20b45
Signed-off-by: Camus Wong <camusw@codeaurora.org>
2018-05-15 18:37:17 -04:00
Guchun Chen
c96659a88a drm: msm: improve early splash mechanism
Early RVC will keep running even if all display's splash
in bootloader are stopped. So kernel splash handoff
mechanism needs to be modified to match the scenario.

CRs-Fixed: 2225630
Change-Id: I0e00403f6cae0401ea23465f78cf092abfa2a611
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-05-05 20:09:00 +08:00
Guchun Chen
6fb8f903df drm: msm: read SDE registers for splash case
Read sde registers like layer mixer and ctrl information
from bootloader when early splash is enabled in bootloader.
These information will be updated to kernel resource
manager to let bootloader and kernel use the same hardware
setting.

CRs-Fixed: 2225630
Change-Id: I0e971de1992b380e30933f476b1a7e185ce0ad96
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
Signed-off-by: Camus Wong <camusw@codeaurora.org>
2018-05-05 19:01:48 +08:00
Guchun Chen
06af1c706e drm: msm: hw ctl needs to care reserved pipe
When kernel operates hw ctls, early RVC in bootloader
can also co-exist to update hardware registers. So it's
needed to care the reserved pipe by early RVC before
kernel starts to handle ctl setup.

CRs-Fixed: 2225630
Change-Id: I2df06350a44bd128dfb89cc0668c41d2edfb26a6
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-05-05 18:54:34 +08:00
Linux Build Service Account
bf3bda0f81 Merge "drm/msm/hdmi: partial revert for hdmi->power_on changes" 2018-05-04 16:11:21 -07:00
Linux Build Service Account
2223ffa69b Merge "drm/msm/sde: increase gpu input fence timeout to 10 seconds" 2018-05-01 06:26:41 -07:00
Linux Build Service Account
e6e01da7c4 Merge "drm: msm: add uevent handler to release pipes" 2018-05-01 06:26:39 -07:00
Linux Build Service Account
8517b96791 Merge "drm: msm: add early splash support on triple displays" 2018-05-01 06:26:38 -07:00
Dhaval Patel
36a4671970 drm/msm/sde: increase gpu input fence timeout to 10 seconds
GPU hardware may take longer time to process the complex
workload rendering. 2 seconds might not be enough to
finish the processing. Increase this timeout to 10seconds
for allowing GPU to render complex scene.

Change-Id: Iab3462e2bcddc8d303a6012a632d465d1508ebf8
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2018-04-24 11:38:11 +05:30
Guchun Chen
b5f1a490e8 drm: msm: add uevent handler to release pipes
To achieve glitch-free purpose for early RVC case, the pipes are set
to be unavailable to user Apps. So after splash handoff is done, kernel
needs to tell user Apps the update via this uevent. User Apps will get
this event and start further operation accordingly.

CRs-Fixed: 2225630
Change-Id: I96f023d72dea9c359730d0313e65e87cf9dc1fbc
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-04-23 01:53:14 -07:00
Guchun Chen
10d7d4f65a drm: msm: add early splash support on triple displays
This patch is to support early splash on triple displays
including DSI-HDMI displays and native HDMI display, for
auto products.

CRs-Fixed: 2225630
Change-Id: I4de17eabbf2b2caf1354390f327ba7b761dc313f
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
Signed-off-by: Camus Wong <camusw@codeaurora.org>
2018-04-23 16:39:21 +08:00
Guchun Chen
7cc625f159 drm: msm: reserve drm resource for early RVC
When early RVC is enabled in bootloader, the pipes on the display
which RVC is on should not be available to uers' Apps. That means,
user should not touch and allocate the pipe for other Apps before
RVC exits. For this purpose, this patch reads the reserved pipe
information from device tree, and reports pipe availability to
user from kernel side.
In additional, user's layer mixer stage will decrease by 1 to
let RVC's layer stays on top before it exits.

CRs-Fixed: 2225630
Change-Id: Id4530afb82da52aecdf5aa48c8fbd59313da236b
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-04-21 22:40:19 +08:00
Navid Bahrani
b0b537aaca drm/msm/hdmi: partial revert for hdmi->power_on changes
hdmi->power_on is not properly set for pluggable platforms
leading to an incorrect return value from cable_status() call.
This partially reverts some changes from two previous commits
touching hdmi->power_on

Change-Id: Icd2d331eaed72950ab027424aaf9e1e6b901a205
Signed-off-by: Navid Bahrani <nbahrani@codeaurora.org>
2018-04-20 14:25:51 -07:00
Suprith Malligere Shankaregowda
8604e9806f drm: msm: fix potential NULL pointer dereference
adding NULL check before dereferencing a pointer.

Change-Id: I260b016abdcb16f5b16e58671ed208df21c99a46
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
2018-04-09 05:40:01 -07:00
Camus Wong
d3fd31550b [drm/sde] fix uninitialized src/dst size in sde plane
SDE plane src/dst size is uninitialized and programmed to hw when
only color format is changed. This change will only configure hw
when src/dst size is calculated.

Change-Id: I5953f899a2c503b1d8f2577c28a67711b9ed9a67
Signed-off-by: Camus Wong <camusw@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
2018-04-05 23:52:59 -07:00
Linux Build Service Account
d83747f35c Merge "drm: msm: fix potential NULL pointer dereference" 2018-04-02 01:45:27 -07:00
Rahul Sharma
b86526c85e drm/msm: check hpd_off flag only for pluggable displays
This change will wrap the 'hpd_off' flag with pluggable displays.
In non-pluggable display case 'hpd_off' flag prevents disabling
of HPD clocks and hence display subsystem doesn't got into suspend
state.

Change-Id: I28ade8fb60a60a15f1d23009de63bbf9f10c7c77
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
2018-03-27 22:01:10 -07:00
Guchun Chen
f42176b693 drm: msm: fix potential NULL pointer dereference
Add checker before using pointers, to avoid NULL pointer
dereference happens.

CRs-Fixed: 2202957
Change-Id: I99930e1e9477130fcfceadad3f3a2ff5c9e89cda
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-03-27 12:37:35 +08:00
Camus Wong
bc5c74d801 DRM: SDE: Fixing the power up sequence with early splash
If the splash clean up is trigger, the MDP core power on call should
be skipped.  MDP core already turned on in sde_kms_hw_init() if splash
handoff enabled.

Change-Id: Ie19c4eb2d0455b0c19615e3bb29aae4b4c6c8abf
Signed-off-by: Camus Wong <camusw@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
2018-03-23 00:08:11 -07:00
Linux Build Service Account
ed6f6fd1c1 Merge "drm/msm: refine hdmi bridge implementation" 2018-03-22 12:23:13 -07:00
Linux Build Service Account
fc187e817f Merge "drm/msm/sde: store mdss irq status in case of irq storm" 2018-03-19 03:35:38 -07:00
Linux Build Service Account
0cf11fbe38 Merge "drm/msm/sde: take irq callback lock before reading cb list" 2018-03-19 03:35:36 -07:00
Linux Build Service Account
af36d13ab9 Merge "drm: smmu: fix smmu map failure" 2018-03-19 03:35:35 -07:00
Camus Wong
a4d84e9fa8 drm/msm: refine hdmi bridge implementation
This change fixes an unclocked hdmi register access while going
to suspend state.

When splash is enabled on HDMI interface & we are going to turn
on the hdmi bridge power. Context of sde_hdmi connector is found
to be NULL because connector was not initialized yet and we never
called sde_hdmi_core_enable which enables hpd clocks.

Now when going to suspend system would be calling clock unprepare
for clocks which were never enabled. Hence hdmi clock gets unbalanced
and resulted in unclocked access to one of the hdmi register during
disabling vblank.

Adding struct sde_hdmi as a member of struct sde_hdmi_bridge and remove
dependency on sde connector to get the hdmi display object.

Change-Id: If96324fd5152ab0e721dfd38e93a68321a615455
Signed-off-by: Camus Wong <camusw@codeaurora.org>
Signed-off-by: Rahul Sharma <rahsha@codeaurora.org>
Signed-off-by: Suprith Malligere Shankaregowda <supgow@codeaurora.org>
2018-03-19 10:33:30 +05:30
Lloyd Atkinson
c9b913882d drm/msm/sde: store mdss irq status in case of irq storm
Store the last MDSS IRQ status value to help identify the source
of any erroneous IRQs that might cause an IRQ storm. Also, check
return codes on IRQ mapping or handling and report any unhandled
IRQs to the IRQ system.

Change-Id: I585c97c01736216556eb389bda79548c1fda2b64
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
2018-03-16 17:26:58 -07:00
Lloyd Atkinson
3c6964a08c drm/msm/sde: take irq callback lock before reading cb list
Take the callback spinlock before checking whether the callback
table list is empty. This resolves a race condition where the
callback list could be empty during the servicing of an
interrupt.

Change-Id: I8d59c0211526173ce98c8ca2dac36ec4743dc8f8
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-16 17:26:21 -07:00
Lakshmi Narayana Kalavala
1f9861ad38 drm/msm: limit sde_dbg_dump output to current entries
Update the sde_dbg_dump function to only dump event log
entries up to the time the dump is initiated, and increase
the number of recorded event log entries.

This places a limit on the total number of entries that are
output to the dmesg log even if more entries would have been
added while the dump is executing (e.g., interrupt events),
while still allowing the extra events to be recorded properly.

Change-Id: I66f850d21a2d0217f9049facffce074831b7e17d
Signed-off-by: Clarence Ip <cip@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-16 17:25:34 -07:00
Lakshmi Narayana Kalavala
89ddcc12a1 drm/msm: add input sanitization on debug dump debugfs
Add checks to debugfs input parameters in sde debug dump debugfs
entries.

Change-Id: Iea170b75c1eb9aa46366662d36e677cb3251830b
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-16 17:24:54 -07:00
Lakshmi Narayana Kalavala
ac94b019c3 drm/msm/sde: add debugfs nodes for underruns debug
This change adds debugfs nodes for debugging underruns,
after this change following commands are supported:
1. To enable the underrun ftrace:
	echo 1 > /d/tracing/events/sde/sde_encoder_underrun/enable
2. To enable feature that disables the ftraces once the
	underrun happens:
	echo 1 > /d/dri/0/debug/dbg_ctrl
3. To enable the panic in the device when underrun happens:
	echo 2 > /d/dri/0/debug/dbg_ctrl
4. To enable both of the above options:
	echo 3 > /d/dri/0/debug/dbg_ctrl

Change-Id: Id9f407edb0908a5f8454f08d63c356dc8f04d353
Signed-off-by: Ingrid Gallardo <ingridg@codeaurora.org>
Signed-off-by: Jayant Shekhar <jshekhar@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-16 17:23:52 -07:00
Linux Build Service Account
a915fa29fa Merge "drm/msm/sde: add validation checks for source split" 2018-03-16 01:55:52 -07:00
Linux Build Service Account
8353ae1eaf Merge "drm/msm: move display and event threads to realtime priority" 2018-03-16 01:55:49 -07:00
Linux Build Service Account
56fe93b3ca Merge "drm/msm: init enum properties to default value" 2018-03-15 05:43:39 -07:00
Linux Build Service Account
0ae3ca513a Merge "drm/msm/sde: propagate the cdm block length from the catalog" 2018-03-15 05:43:37 -07:00
Linux Build Service Account
91892844ac Merge "drm/msm/sde: add ubwc equivalent tile formats" 2018-03-15 05:43:25 -07:00
Linux Build Service Account
ab30123fe2 Merge "drm: msm: dsi: fix potential NULL pointer dereference" 2018-03-15 05:43:23 -07:00
Linux Build Service Account
65b05aeab8 Merge "drm/msm : add null check on framebuffer in cleanup" 2018-03-15 05:43:20 -07:00
Linux Build Service Account
58b0d29d48 Merge "drm: msm: dsi: fix local variable not initialized issue" 2018-03-15 05:42:51 -07:00
Linux Build Service Account
b542fae9ea Merge "drm/msm/sde: fix flush configuration for physical encoder" 2018-03-15 05:42:49 -07:00
Linux Build Service Account
05a93365d7 Merge "drm: msm: sde: fix potential NULL pointer dereference" 2018-03-15 05:42:43 -07:00
Guchun Chen
e453eb66bc drm: smmu: fix smmu map failure
In concurrency test, smmu map failure appears in a low possibility.
This is caused by virtual address conflict. Display driver calls
different smmu map APIs to do map with the same domain, while the
virtual address allocation happens separately, one in dmp-mapping.c,
and another one is in msm_gem_vam.c. This could not gurantee the
virtual addresses by different callers are different in the same
mmu domain, if they are the same, the virtual address will possibily
be mapped twice, hence conflict happens.

The change is to fix this:
1. Remove the map calling for early splash buffer from msm_smmu_map.
2. Introduce one new map API early_splash_map/unmap, dedicated for
memory mapping for early splash usercase.

CRs-Fixed: 2198827
Change-Id: I8e632f1971998a14c362b5bf0ae9a5522a5a1bff
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-03-14 11:48:38 +08:00
Guchun Chen
2768f69bba drm: msm: sde: fix potential NULL pointer dereference
Pointer should be checked after returning from function or being
passed from other function. So add checker for this to avoid NULL
pointer dereference.

Change-Id: Ie86f47230b50433e08259ee5f6bbb52bedf749b1
CRs-Fixed: 2202957
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-03-13 13:46:27 +08:00
Guchun Chen
0932f23cdb drm: msm: dsi: fix local variable not initialized issue
Local variable in function should be initialized before using it.

Change-Id: I061b10913182ed11b7a8cdb1baab900ac7e10ea6
CRs-Fixed: 2202957
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-03-13 12:06:23 +08:00
Guchun Chen
e4cf6c8465 drm: msm: dsi: fix potential NULL pointer dereference
Add checker to confirm the pointer is not NULL first, to avoid
NULL pointer dereference happens.

Change-Id: Id9060725037be235303bbc0a82d91d3d2008245c
CRs-Fixed: 2202957
Signed-off-by: Guchun Chen <guchunc@codeaurora.org>
2018-03-13 11:59:13 +08:00
Clarence Ip
777a58fa41 drm/msm: init enum properties to default value
Initialize DRM/KMS enumeration properties to the first
defined value rather than 0 since enumeration properties
are meant to store the actual value rather than simply
an enumeration index.

Change-Id: I23dd62308a2d3a45c763090b6f0557634ed49d63
Signed-off-by: Clarence Ip <cip@codeaurora.org>
2018-03-09 14:28:51 -08:00
Camus Wong
654000d2d7 [drm-sde] remove additional release fence offset
Remove additional release fence offset to fix deadlock between
graphics and display when only two buffers are used.

Change-Id: Ifc94dae28484e13fae6cb9a7dfd19c1cb13c7c20
Signed-off-by: Camus Wong <camusw@codeaurora.org>
2018-03-09 16:20:40 -05:00
Lakshmi Narayana Kalavala
5d1c2b0226 drm/msm : add null check on framebuffer in cleanup
Add null check on pointer to fb before dereferencing.

CRs-Fixed: 2124966
Change-Id: Ic88aee498c432c8e9350f2d2fad538acd2a9b37f
Signed-off-by: Harsh Sahu <hsahu@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-09 12:28:08 -08:00
Lakshmi Narayana Kalavala
47f361f8fc drm/msm: move display and event threads to realtime priority
Display thread processes the work assigned by HAL for
screen update. Current logic selects the thread priority
to default and causes the frame drop. This patch moves
the display thread to realtime priority to process the display
work items at realtime. Event thread must follow the
display thread priority to avoid frame_pending counters
beyond 2.

Change-Id: I9154b749550cee52da1d16d22a8418676325e769
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-08 13:07:48 -08:00
Lakshmi Narayana Kalavala
4f2aa096ba drm/msm: support shutdown sequence on msm driver
Add shutdown sequence in msm driver to turn off
all connectors/bridge gracefully. That will allow
the graceful shutdown for dsi panel.

Change-Id: I055bd57a45706478c785b7a3c41bf7623dd8d2e7
Signed-off-by: Dhaval Patel <pdhaval@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-08 13:07:14 -08:00
Lloyd Atkinson
9b8a81b479 drm/msm/sde: propagate the cdm block length from the catalog
Add the missing CDM block length parsed by the hardware catalog
into the hardware block data structure so that the debug dump
region can be properly registered.

Change-Id: I395164960484ede34a781785b4ed0e2a60ef0e50
Signed-off-by: Lloyd Atkinson <latkinso@codeaurora.org>
Signed-off-by: Lakshmi Narayana Kalavala <lkalaval@codeaurora.org>
2018-03-08 13:03:23 -08:00