Dmitry Baryshkov
1161f5ca0a
drm/msm/a5xx: really check for A510 in a5xx_gpu_init
...
[ Upstream commit 736a932736 ]
The commit 010c8bbad2 ("drm: msm: adreno: Disable preemption on Adreno
510") added special handling for a510 (this SKU doesn't seem to support
preemption, so the driver should clamp nr_rings to 1). However the
gpu->revn is not yet set (it is set later, in adreno_gpu_init()) and
thus the condition is always false. Check config->rev instead.
Fixes: 010c8bbad2 ("drm: msm: adreno: Disable preemption on Adreno 510")
Reported-by: Adam Skladowski <a39.skl@gmail.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Adam Skladowski <a39.skl@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/531511/
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:41 +02:00
Dmitry Baryshkov
5cf95d123f
drm/msm/a6xx: don't set IO_PGTABLE_QUIRK_ARM_OUTER_WBWA with coherent SMMU
...
[ Upstream commit 38e27a6fbf ]
If the Adreno SMMU is dma-coherent, allocation will fail unless we
disable IO_PGTABLE_QUIRK_ARM_OUTER_WBWA. Skip setting this quirk for the
coherent SMMUs (like we have on sm8350 platform).
Fixes: 54af0ceb75 ("arm64: dts: qcom: sm8350: add GPU, GMU, GPU CC and SMMU nodes")
Reported-by: David Heidelberg <david@ixit.cz >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: David Heidelberg <david@ixit.cz >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Tested-by: Konrad Dybcio <konrad.dybcio@linaro.org > # SM8450 HDK
Patchwork: https://patchwork.freedesktop.org/patch/531562/
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:41 +02:00
Kuogee Hsieh
28eea78ebe
drm/msm/dpu: always clear every individual pending flush mask
...
[ Upstream commit 625cbb0770 ]
There are two tiers of pending flush control, top level and
individual hardware block. Currently only the top level of
flush mask is reset to 0 but the individual pending flush masks
of particular hardware blocks are left at their previous values,
eventually accumulating all possible bit values and typically
flushing more than necessary.
Reset all individual hardware block flush masks to 0 to avoid
accidentally flushing them.
Changes in V13:
-- rewording commit text
-- add an empty space line as suggested
Changes in V14:
-- add Fixes tag
Fixes: 73bfb790ac ("msm:disp:dpu1: setup display datapath for SC7180 target")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Patchwork: https://patchwork.freedesktop.org/patch/539508/
Link: https://lore.kernel.org/r/1685036458-22683-8-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:39 +02:00
Kuogee Hsieh
87b0af9f62
drm/msm/dpu: set DSC flush bit correctly at MDP CTL flush register
...
[ Upstream commit 12cef323c9 ]
The CTL_FLUSH register should be programmed with the 22th bit
(DSC_IDX) to flush the DSC hardware blocks, not the literal value of
22 (which corresponds to flushing VIG1, VIG2 and RGB1 instead).
Changes in V12:
-- split this patch out of "separate DSC flush update out of interface"
Changes in V13:
-- rewording the commit text
Changes in V14:
-- drop 'DSC" from "The DSC CTL_FLUSH register" at commit text
Fixes: 77f6da9048 ("drm/msm/disp/dpu1: Add DSC support in hw_ctl")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Patchwork: https://patchwork.freedesktop.org/patch/539496/
Link: https://lore.kernel.org/r/1685036458-22683-2-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:39 +02:00
Konrad Dybcio
009aafa450
drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK
...
[ Upstream commit a7129231ed ]
DPU5 and newer targets enable this unconditionally. Move it from the
SC7280 mask to the SC7180 one.
Fixes: 7e6ee55320 ("drm/msm/disp/dpu1: enable DATA_HCTL_EN for sc7280 target")
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/538159/
Link: https://lore.kernel.org/r/20230508-topic-hctl_en-v2-1-e7bea9f1f5dd@linaro.org
[DB: removed BIT(DPU_INTF_DATA_COMPRESS), which is not yet merged]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:36 +02:00
Vinod Polimera
de09822436
drm/msm/disp/dpu: get timing engine status from intf status register
...
[ Upstream commit e3969eadc8 ]
Recommended way of reading the interface timing gen status is via
status register. Timing gen status register will give a reliable status
of the interface especially during ON/OFF transitions. This support was
added from DPU version 5.0.0.
Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/524724/
Link: https://lore.kernel.org/r/1677774797-31063-6-git-send-email-quic_vpolimer@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: a7129231ed ("drm/msm/dpu: Set DPU_DATA_HCTL_EN for in INTF_SC7180_MASK")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:36 +02:00
Dmitry Baryshkov
6def16811b
drm/msm/dsi: don't allow enabling 14nm VCO with unprogrammed rate
...
[ Upstream commit 1e0a97f84d ]
If the dispcc uses CLK_OPS_PARENT_ENABLE (e.g. on QCM2290), CCF can try
enabling VCO before the rate has been programmed. This can cause clock
lockups and/or other boot issues. Program the VCO to the minimal PLL
rate if the read rate is 0 Hz.
Cc: Konrad Dybcio <konrad.dybcio@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reported-by: Vladimir Zapolskiy <vladimir.zapolskiy@linaro.org >
Reported-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Fixes: f079f6d999 ("drm/msm/dsi: Add PHY/PLL for 8x96")
Patchwork: https://patchwork.freedesktop.org/patch/534813/
Link: https://lore.kernel.org/r/20230501011257.3460103-1-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-07-11 19:39:35 +02:00
Dmitry Baryshkov
181295bfd8
drm/msm/a6xx: initialize GMU mutex earlier
...
[ Upstream commit 12abd735f0 ]
Move GMU mutex initialization earlier to make sure that it is always
initialized. a6xx_destroy can be called from ther failure path before
GMU initialization.
This fixes the following backtrace:
------------[ cut here ]------------
DEBUG_LOCKS_WARN_ON(lock->magic != lock)
WARNING: CPU: 0 PID: 58 at kernel/locking/mutex.c:582 __mutex_lock+0x1ec/0x3d0
Modules linked in:
CPU: 0 PID: 58 Comm: kworker/u16:1 Not tainted 6.3.0-rc5-00155-g187c06436519 #565
Hardware name: Qualcomm Technologies, Inc. SM8350 HDK (DT)
Workqueue: events_unbound deferred_probe_work_func
pstate: 60400005 (nZCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : __mutex_lock+0x1ec/0x3d0
lr : __mutex_lock+0x1ec/0x3d0
sp : ffff800008993620
x29: ffff800008993620 x28: 0000000000000002 x27: ffff47b253c52800
x26: 0000000001000606 x25: ffff47b240bb2810 x24: fffffffffffffff4
x23: 0000000000000000 x22: ffffc38bba15ac14 x21: 0000000000000002
x20: ffff800008993690 x19: ffff47b2430cc668 x18: fffffffffffe98f0
x17: 6f74616c75676572 x16: 20796d6d75642067 x15: 0000000000000038
x14: 0000000000000000 x13: ffffc38bbba050b8 x12: 0000000000000666
x11: 0000000000000222 x10: ffffc38bbba603e8 x9 : ffffc38bbba050b8
x8 : 00000000ffffefff x7 : ffffc38bbba5d0b8 x6 : 0000000000000222
x5 : 000000000000bff4 x4 : 40000000fffff222 x3 : 0000000000000000
x2 : 0000000000000000 x1 : 0000000000000000 x0 : ffff47b240cb1880
Call trace:
__mutex_lock+0x1ec/0x3d0
mutex_lock_nested+0x2c/0x38
a6xx_destroy+0xa0/0x138
a6xx_gpu_init+0x41c/0x618
adreno_bind+0x188/0x290
component_bind_all+0x118/0x248
msm_drm_bind+0x1c0/0x670
try_to_bring_up_aggregate_device+0x164/0x1d0
__component_add+0xa8/0x16c
component_add+0x14/0x20
dsi_dev_attach+0x20/0x2c
dsi_host_attach+0x9c/0x144
devm_mipi_dsi_attach+0x34/0xac
lt9611uxc_attach_dsi.isra.0+0x84/0xfc
lt9611uxc_probe+0x5b8/0x67c
i2c_device_probe+0x1ac/0x358
really_probe+0x148/0x2ac
__driver_probe_device+0x78/0xe0
driver_probe_device+0x3c/0x160
__device_attach_driver+0xb8/0x138
bus_for_each_drv+0x84/0xe0
__device_attach+0x9c/0x188
device_initial_probe+0x14/0x20
bus_probe_device+0xac/0xb0
deferred_probe_work_func+0x8c/0xc8
process_one_work+0x2bc/0x594
worker_thread+0x228/0x438
kthread+0x108/0x10c
ret_from_fork+0x10/0x20
irq event stamp: 299345
hardirqs last enabled at (299345): [<ffffc38bb9ba61e4>] put_cpu_partial+0x1c8/0x22c
hardirqs last disabled at (299344): [<ffffc38bb9ba61dc>] put_cpu_partial+0x1c0/0x22c
softirqs last enabled at (296752): [<ffffc38bb9890434>] _stext+0x434/0x4e8
softirqs last disabled at (296741): [<ffffc38bb989669c>] ____do_softirq+0x10/0x1c
---[ end trace 0000000000000000 ]---
Fixes: 4cd15a3e8b ("drm/msm/a6xx: Make GPU destroy a bit safer")
Cc: Douglas Anderson <dianders@chromium.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Douglas Anderson <dianders@chromium.org >
Patchwork: https://patchwork.freedesktop.org/patch/531540/
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-06-14 11:16:52 +02:00
Rob Clark
bfe752b137
drm/msm: Be more shouty if per-process pgtables aren't working
...
[ Upstream commit 5c054db54c ]
Otherwise it is not always obvious if a dt or iommu change is causing us
to fall back to global pgtable.
Signed-off-by: Rob Clark <robdclark@chromium.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/537359/
Link: https://lore.kernel.org/r/20230516222039.907690-2-robdclark@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-06-09 10:48:09 +02:00
Rob Clark
e304ff331f
drm/msm: Fix submit error-path leaks
...
[ Upstream commit 68dc6c2d5e ]
For errors after msm_submitqueue_get(), we need to drop the submitqueue
reference. Additionally after get_unused_fd() we need to drop the fd.
The ordering for dropping the queue lock and put_unused_fd() is not
important, so just move this all into out_post_unlock.
v2: Only drop queue ref if submit doesn't take it
v3: Fix unitialized submit ref in error path
v4: IS_ERR_OR_NULL()
Reported-by: pinkperfect2021@gmail.com
Fixes: f0de40a131 drm/msm: ("Reorder lock vs submit alloc")
Signed-off-by: Rob Clark <robdclark@chromium.org >
Patchwork: https://patchwork.freedesktop.org/patch/536073/
Link: https://lore.kernel.org/r/20230509203041.440619-1-robdclark@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:14 +01:00
Marijn Suijten
878d4ff2ae
drm/msm/dpu: Remove duplicate register defines from INTF
...
[ Upstream commit 202c044203 ]
The INTF_FRAME_LINE_COUNT_EN, INTF_FRAME_COUNT and INTF_LINE_COUNT
registers are already defined higher up, in the right place when sorted
numerically.
Fixes: 25fdd5933e ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/534231/
Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-8-27ce1a5ab5c6@somainline.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Marijn Suijten
9e1a191e88
drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo
...
[ Upstream commit 701f69183d ]
SM8550 exclusively has a DITHER sub-block inside the PINGPONG block and
no other registers, hence the DITHER name of the macro and a
corresponding PINGPONG block length of zero. However, the PP_BLK_ macro
name was typo'd to DIPHER rather than DITHER.
Fixes: efcd010772 ("drm/msm/dpu: add support for SM8550")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/534214/
Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-5-27ce1a5ab5c6@somainline.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Dmitry Baryshkov
97ae8728e7
drm/msm/dpu: split SM8550 catalog entry to the separate file
...
[ Upstream commit 9cc5479336 ]
Reviewed-by: Konrad DYbcio <konrad.dybcio@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/530824/
Link: https://lore.kernel.org/r/20230404130622.509628-8-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Dmitry Baryshkov
2edefb97c3
drm/msm/dpu: move UBWC/memory configuration to separate struct
...
[ Upstream commit fbbd8cce80 ]
UBWC and highest bank settings differ slightly between different DPU
units of the same generation, while the dpu_caps and dpu_mdp_cfg are
much more stable. To ease configuration reuse move ubwc_swizzle and
highest_bank_bit data to separate structure.
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/530820/
Link: https://lore.kernel.org/r/20230404130622.509628-7-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Konrad Dybcio
e67bb5f5c7
drm/msm/dpu: Allow variable INTF_BLK size
...
[ Upstream commit 8399a5ff18 ]
These blocks are of variable length on different SoCs. Set the
correct values where I was able to retrieve it from downstream
DTs and leave the old defaults (0x280) otherwise.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
[DB: fixed some lengths, split the INTF changes away]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/530816/
Link: https://lore.kernel.org/r/20230404130622.509628-4-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Konrad Dybcio
d1c896a0a6
drm/msm/dpu: Allow variable SSPP_BLK size
...
[ Upstream commit 8f940ddbc4 ]
These blocks are of variable length on different SoCs. Set the
correct values where I was able to retrieve it from downstream
DTs and leave the old defaults (0x1c8) otherwise.
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
[DB: fixed some of lengths, split the INTF changes away]
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/530814/
Link: https://lore.kernel.org/r/20230404130622.509628-3-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Dmitry Baryshkov
dd8acdc717
drm/msm/dpu: drop smart_dma_rev from dpu_caps
...
[ Upstream commit dcb3f7c904 ]
The code doesn't use dpu_caps::smart_dma_rev field. It checks if the
corresponding feature is enabled in the SSPP features. Drop the
smart_dma_rev field completely.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/527369/
Link: https://lore.kernel.org/r/20230316161653.4106395-31-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Dmitry Baryshkov
1d39a7bf72
drm/msm/dpu: populate SmartDMA features in hw catalog
...
[ Upstream commit 8b409996eb ]
Downstream driver uses dpu->caps->smart_dma_rev to update
sspp->cap->features with the bit corresponding to the supported SmartDMA
version. Upstream driver does not do this, resulting in SSPP subdriver
not enabling setup_multirect callback. Add corresponding SmartDMA SSPP
feature bits to dpu hw catalog.
Per Abhinav's request enable the SmartDMA features only on the platforms
where the multirect was actually verified visually (sdm845 and sm8250).
An (untested) enablement on the rest of the platforms comes in the next
patch.
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/527362/
Link: https://lore.kernel.org/r/20230316161653.4106395-29-dmitry.baryshkov@linaro.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Stable-dep-of: 701f69183d ("drm/msm/dpu: Fix PP_BLK_DIPHER -> DITHER typo")
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:13 +01:00
Marijn Suijten
899a8fd75b
drm/msm/dpu: Reindent REV_7xxx interrupt masks with tabs
...
[ Upstream commit 85340c0256 ]
Use tabs for consistency with the other interrupt register definitions,
rather than spaces.
Fixes: ed6154a136 ("drm/msm/disp/dpu1: add intf offsets for SC7280 target")
Fixes: 89688e2119 ("drm/msm/dpu: Add more of the INTF interrupt regions")
Fixes: 4a352c2fc1 ("drm/msm/dpu: Introduce SC8280XP")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/534212/
Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-4-27ce1a5ab5c6@somainline.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:12 +01:00
Marijn Suijten
1eafafcf09
drm/msm/dpu: Move non-MDP_TOP INTF_INTR offsets out of hwio header
...
[ Upstream commit e9d9ce5462 ]
These offsets do not fall under the MDP TOP block and do not fit the
comment right above. Move them to dpu_hw_interrupts.c next to the
repsective MDP_INTF_x_OFF interrupt block offsets.
Fixes: 25fdd5933e ("drm/msm: Add SDM845 DPU support")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org >
Reviewed-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/534203/
Link: https://lore.kernel.org/r/20230411-dpu-intf-te-v4-3-27ce1a5ab5c6@somainline.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:12 +01:00
Marijn Suijten
392940353e
drm/msm/dpu: Assign missing writeback log_mask
...
[ Upstream commit a432fc31f0 ]
The WB debug log mask ended up never being assigned, leading to writes
to this block to never be logged even if the mask is enabled in
dpu_hw_util_log_mask via debugfs.
Fixes: 84a33d0fd9 ("drm/msm/dpu: add dpu_hw_wb abstraction for writeback blocks")
Signed-off-by: Marijn Suijten <marijn.suijten@somainline.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/533860/
Link: https://lore.kernel.org/r/20230418-dpu-drop-useless-for-lookup-v3-1-e8d869eea455@somainline.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:12 +01:00
Srinivas Kandagatla
56aadce804
drm/msm/dp: unregister audio driver during unbind
...
[ Upstream commit 85c636284c ]
while binding the code always registers a audio driver, however there
is no corresponding unregistration done in unbind. This leads to multiple
redundant audio platform devices if dp_display_bind and dp_display_unbind
happens multiple times during startup. On X13s platform this resulted in
6 to 9 audio codec device instead of just 3 codec devices for 3 dp ports.
Fix this by unregistering codecs on unbind.
Signed-off-by: Srinivas Kandagatla <srinivas.kandagatla@linaro.org >
Fixes: d13e36d7d2 ("drm/msm/dp: add audio support for Display Port on MSM")
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/533324/
Link: https://lore.kernel.org/r/20230421145657.12186-1-srinivas.kandagatla@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:12 +01:00
Douglas Anderson
32d6a04694
drm/msm/dp: Clean up handling of DP AUX interrupts
...
[ Upstream commit b20566cdef ]
The DP AUX interrupt handling was a bit of a mess.
* There were two functions (one for "native" transfers and one for
"i2c" transfers) that were quite similar. It was hard to say how
many of the differences between the two functions were on purpose
and how many of them were just an accident of how they were coded.
* Each function sometimes used "else if" to test for error bits and
sometimes didn't and again it was hard to say if this was on purpose
or just an accident.
* The two functions wouldn't notice whether "unknown" bits were
set. For instance, there seems to be a bit "DP_INTR_PLL_UNLOCKED"
and if it was set there would be no indication.
* The two functions wouldn't notice if more than one error was set.
Let's fix this by being more consistent / explicit about what we're
doing.
By design this could cause different handling for AUX transfers,
though I'm not actually aware of any bug fixed as a result of
this patch (this patch was created because we simply noticed how odd
the old code was by code inspection). Specific notes here:
1. In the old native transfer case if we got "done + wrong address"
we'd ignore the "wrong address" (because of the "else if"). Now we
won't.
2. In the old native transfer case if we got "done + timeout" we'd
ignore the "timeout" (because of the "else if"). Now we won't.
3. In the old native transfer case we'd see "nack_defer" and translate
it to the error number for "nack". This differed from the i2c
transfer case where "nack_defer" was given the error number for
"nack_defer". This 100% can't matter because the only user of this
error number treats "nack defer" the same as "nack", so it's clear
that the difference between the "native" and "i2c" was pointless
here.
4. In the old i2c transfer case if we got "done" plus any error
besides "nack" or "defer" then we'd ignore the error. Now we don't.
5. If there is more than one error signaled by the hardware it's
possible that we'll report a different one than we used to. I don't
know if this matters. If someone is aware of a case this matters we
should document it and change the code to make it explicit.
6. One quirk we keep (I don't know if this is important) is that in
the i2c transfer case if we see "done + defer" we report that as a
"nack". That seemed too intentional in the old code to just drop.
After this change we will add extra logging, including:
* A warning if we see more than one error bit set.
* A warning if we see an unexpected interrupt.
* A warning if we get an AUX transfer interrupt when shouldn't.
It actually turns out that as a result of this change then at boot we
sometimes see an error:
[drm:dp_aux_isr] *ERROR* Unexpected DP AUX IRQ 0x01000000 when not busy
That means that, during init, we are seeing DP_INTR_PLL_UNLOCKED. For
now I'm going to say that leaving this error reported in the logs is
OK-ish and hopefully it will encourage someone to track down what's
going on at init time.
One last note here is that this change renames one of the interrupt
bits. The bit named "i2c done" clearly was used for native transfers
being done too, so I renamed it to indicate this.
Signed-off-by: Douglas Anderson <dianders@chromium.org >
Tested-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/520658/
Link: https://lore.kernel.org/r/20230126170745.v2.1.I90ffed3ddd21e818ae534f820cb4d6d8638859ab@changeid
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-24 17:30:03 +01:00
Konrad Dybcio
8d106ef117
drm/msm/adreno: adreno_gpu: Use suspend() instead of idle() on load error
...
commit 3eeca5e5f3 upstream.
The adreno_load_gpu() path is guarded by an error check on
adreno_load_fw(). This function is responsible for loading
Qualcomm-only-signed binaries (e.g. SQE and GMU FW for A6XX), but it
does not take the vendor-signed ZAP blob into account.
By embedding the SQE (and GMU, if necessary) firmware into the
initrd/kernel, we can trigger and unfortunate path that would not bail
out early and proceed with gpu->hw_init(). That will fail, as the ZAP
loader path will not find the firmware and return back to
adreno_load_gpu().
This error path involves pm_runtime_put_sync() which then calls idle()
instead of suspend(). This is suboptimal, as it means that we're not
going through the clean shutdown sequence. With at least A619_holi, this
makes the GPU not wake up until it goes through at least one more
start-fail-stop cycle. The pm_runtime_put_sync that appears in the error
path actually does not guarantee that because of the earlier enabling of
runtime autosuspend.
Fix that by using pm_runtime_put_sync_suspend to force a clean shutdown.
Test cases:
1. All firmware baked into kernel
2. error loading ZAP fw in initrd -> load from rootfs at DE start
Both succeed on A619_holi (SM6375) and A630 (SDM845).
Fixes: 0d997f95b7 ("drm/msm/adreno: fix runtime PM imbalance at gpu load")
Signed-off-by: Konrad Dybcio <konrad.dybcio@linaro.org >
Reviewed-by: Johan Hovold <johan+linaro@kernel.org >
Patchwork: https://patchwork.freedesktop.org/patch/530001/
Link: https://lore.kernel.org/r/20230330231517.2747024-1-konrad.dybcio@linaro.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:02:04 +02:00
Johan Hovold
8551c4b7c8
drm/msm: fix workqueue leak on bind errors
...
commit a75b49db65 upstream.
Make sure to destroy the workqueue also in case of early errors during
bind (e.g. a subcomponent failing to bind).
Since commit c3b790ea07 ("drm: Manage drm_mode_config_init with
drmm_") the mode config will be freed when the drm device is released
also when using the legacy interface, but add an explicit cleanup for
consistency and to facilitate backporting.
Fixes: 060530f1ea ("drm/msm: use componentised device support")
Cc: stable@vger.kernel.org # 3.15
Cc: Rob Clark <robdclark@gmail.com >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525093/
Link: https://lore.kernel.org/r/20230306100722.28485-9-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
9b92dc722a
drm/msm: fix missing wq allocation error handling
...
commit ca090c837b upstream.
Add the missing sanity check to handle workqueue allocation failures.
Fixes: c8afe684c9 ("drm/msm: basic KMS driver for snapdragon")
Cc: stable@vger.kernel.org # 3.12
Cc: Rob Clark <robdclark@gmail.com >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525102/
Link: https://lore.kernel.org/r/20230306100722.28485-8-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
e3401e07ba
drm/msm: fix vram leak on bind errors
...
commit 60d476af96 upstream.
Make sure to release the VRAM buffer also in a case a subcomponent fails
to bind.
Fixes: d863f0c7b5 ("drm/msm: Call msm_init_vram before binding the gpu")
Cc: stable@vger.kernel.org # 5.11
Cc: Craig Tatlor <ctatlor97@gmail.com >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525094/
Link: https://lore.kernel.org/r/20230306100722.28485-7-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
514b189bb3
drm/msm: fix drm device leak on bind errors
...
commit 214b09db61 upstream.
Make sure to free the DRM device also in case of early errors during
bind().
Fixes: 2027e5b341 ("drm/msm: Initialize MDSS irq domain at probe time")
Cc: stable@vger.kernel.org # 5.17
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525097/
Link: https://lore.kernel.org/r/20230306100722.28485-6-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
72092e3474
drm/msm: fix NULL-deref on irq uninstall
...
commit cd459c005d upstream.
In case of early initialisation errors and on platforms that do not use
the DPU controller, the deinitilisation code can be called with the kms
pointer set to NULL.
Fixes: f026e431cf ("drm/msm: Convert to Linux IRQ interfaces")
Cc: stable@vger.kernel.org # 5.14
Cc: Thomas Zimmermann <tzimmermann@suse.de >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525104/
Link: https://lore.kernel.org/r/20230306100722.28485-5-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
19fe79ae81
drm/msm: fix NULL-deref on snapshot tear down
...
commit a465353b92 upstream.
In case of early initialisation errors and on platforms that do not use
the DPU controller, the deinitilisation code can be called with the kms
pointer set to NULL.
Fixes: 98659487b8 ("drm/msm: add support to take dpu snapshot")
Cc: stable@vger.kernel.org # 5.14
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525099/
Link: https://lore.kernel.org/r/20230306100722.28485-4-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:58 +02:00
Johan Hovold
b8de0c4def
drm/msm/adreno: fix runtime PM imbalance at gpu load
...
commit 0d997f95b7 upstream.
A recent commit moved enabling of runtime PM to GPU load time (first
open()) but failed to update the error paths so that runtime PM is
disabled if initialisation of the GPU fails. This would trigger a
warning about the unbalanced disable count on the next open() attempt.
Note that pm_runtime_put_noidle() is sufficient to balance the usage
count when pm_runtime_put_sync() fails (and is chosen over
pm_runtime_resume_and_get() for consistency reasons).
Fixes: 4b18299b33 ("drm/msm/adreno: Defer enabling runpm until hw_init()")
Cc: stable@vger.kernel.org # 6.0
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Patchwork: https://patchwork.freedesktop.org/patch/524971/
Link: https://lore.kernel.org/r/20230303164807.13124-3-johan+linaro@kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org >
2023-05-17 14:01:57 +02:00
Geert Uytterhoeven
998ea24f19
drm/msm/dpu: Fix bit-shifting UB in DPU_HW_VER() macro
...
[ Upstream commit 4760be481d ]
With gcc-5 and CONFIG_UBSAN_SHIFT=y:
drivers/gpu/drm/msm/msm_mdss.c: In function 'msm_mdss_enable':
drivers/gpu/drm/msm/msm_mdss.c:296:2: error: case label does not reduce to an integer constant
case DPU_HW_VER_800:
^
drivers/gpu/drm/msm/msm_mdss.c:299:2: error: case label does not reduce to an integer constant
case DPU_HW_VER_810:
^
drivers/gpu/drm/msm/msm_mdss.c:300:2: error: case label does not reduce to an integer constant
case DPU_HW_VER_900:
^
This happens because for major revisions 8 or greather, the non-sign bit
of the major revision number is shifted into bit 31 of a signed integer,
which is undefined behavior.
Fix this by casting the major revision number to unsigned int.
Fixes: efcd010772 ("drm/msm/dpu: add support for SM8550")
Fixes: 4a352c2fc1 ("drm/msm/dpu: Introduce SC8280XP")
Fixes: 100d7ef699 ("drm/msm/dpu: add support for SM8450")
Signed-off-by: Geert Uytterhoeven <geert+renesas@glider.be >
Reviewed-by: Randy Dunlap <rdunlap@infradead.org >
Reviewed-by: Rob Clark <robdclark@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/525152/
Link: https://lore.kernel.org/r/20230306090633.65918-1-geert+renesas@glider.be
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:17:06 +09:00
Johan Hovold
3a4e6dc2a6
Revert "drm/msm: Fix failure paths in msm_drm_init()"
...
[ Upstream commit 652eadfde8 ]
This reverts commit 8636500300 .
A recent commit tried to address a drm device leak in the early
msm_drm_uninit() error paths but ended up making things worse.
Specifically, it moved the drm device reference put in msm_drm_uninit()
to msm_drm_init() which means that the drm would now be leaked on normal
unbind.
For reasons that were never spelled out, it also added kms NULL pointer
checks to a couple of helper functions that had nothing to do with the
paths modified by the patch.
Instead of trying to salvage this incrementally, let's revert the bad
commit so that clean and backportable fixes can be added in its place.
Fixes: 8636500300 ("drm/msm: Fix failure paths in msm_drm_init()")
Cc: Akhil P Oommen <quic_akhilpo@quicinc.com >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525092/
Link: https://lore.kernel.org/r/20230306100722.28485-3-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:17:06 +09:00
Johan Hovold
9078b43458
Revert "drm/msm: Add missing check and destroy for alloc_ordered_workqueue"
...
[ Upstream commit dfa70344d1 ]
This reverts commit 643b7d0869 .
A recent patch that tried to fix up the msm_drm_init() paths with
respect to the workqueue but only ended up making things worse:
First, the newly added calls to msm_drm_uninit() on early errors would
trigger NULL-pointer dereferences, for example, as the kms pointer would
not have been initialised. (Note that these paths were also modified by
a second broken error handling patch which in effect cancelled out this
part when merged.)
Second, the newly added allocation sanity check would still leak the
previously allocated drm device.
Instead of trying to salvage what was badly broken (and clearly not
tested), let's revert the bad commit so that clean and backportable
fixes can be added in its place.
Fixes: 643b7d0869 ("drm/msm: Add missing check and destroy for alloc_ordered_workqueue")
Cc: Jiasheng Jiang <jiasheng@iscas.ac.cn >
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/525107/
Link: https://lore.kernel.org/r/20230306100722.28485-2-johan+linaro@kernel.org
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:17:06 +09:00
Adam Skladowski
6fed8810f8
drm: msm: adreno: Disable preemption on Adreno 510
...
[ Upstream commit 010c8bbad2 ]
Downstream driver appears to not support preemption on A510 target,
trying to use one make device slow and fill log with rings related errors.
Set num_rings to 1 to disable preemption.
Suggested-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Fixes: e20c9284c8 ("drm/msm/adreno: Add support for Adreno 510 GPU")
Signed-off-by: Adam Skladowski <a39.skl@gmail.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/526898/
Link: https://lore.kernel.org/r/20230314221757.13096-1-a39.skl@gmail.com
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:17:02 +09:00
Johan Hovold
90f4dcccd5
drm/msm/adreno: drop bogus pm_runtime_set_active()
...
[ Upstream commit db7662d076 ]
The runtime PM status can only be updated while runtime PM is disabled.
Drop the bogus pm_runtime_set_active() call that was made after enabling
runtime PM and which (incidentally but correctly) left the runtime PM
status set to 'suspended'.
Fixes: 2c087a3366 ("drm/msm/adreno: Load the firmware before bringing up the hardware")
Signed-off-by: Johan Hovold <johan+linaro@kernel.org >
Patchwork: https://patchwork.freedesktop.org/patch/524972/
Link: https://lore.kernel.org/r/20230303164807.13124-4-johan+linaro@kernel.org
Signed-off-by: Rob Clark <robdclark@chromium.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:17:02 +09:00
Vinod Polimera
4bc0b6a7cf
drm/msm/disp/dpu: check for crtc enable rather than crtc active to release shared resources
...
[ Upstream commit b697569384 ]
According to KMS documentation, The driver must not release any shared
resources if active is set to false but enable still true.
Fixes: ccc862b957 ("drm/msm/dpu: Fix reservation failures in modeset")
Signed-off-by: Vinod Polimera <quic_vpolimer@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/524726/
Link: https://lore.kernel.org/r/1677774797-31063-5-git-send-email-quic_vpolimer@quicinc.com
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Signed-off-by: Sasha Levin <sashal@kernel.org >
2023-05-11 23:16:59 +09:00
Thomas Zimmermann
b3c9a04135
Merge drm/drm-fixes into drm-misc-fixes
...
Backmerging to get latest upstream.
Signed-off-by: Thomas Zimmermann <tzimmermann@suse.de >
2023-03-13 10:14:05 +01:00
Dave Airlie
3a43e30b8e
Merge tag 'drm-msm-fixes-2023-03-09' of https://gitlab.freedesktop.org/drm/msm into drm-fixes
...
msm-fixes for v6.3-rc2
- Fix for possible invalid ptr free in submit ioctl syncobj cleanup path.
- Synchronize GMU removal in driver teardown path
- a5xx preemption fixes
- Fix runpm imbalance at unbind
- DPU hw catalog fixes:
- set DPU_MDP_PERIPH_0_REMOVED for sc8280xp as this is another chipset
where the PERIPH_0 block of registers is not there
- fix the DPU features supported in QCM2290 by comparing it with the
downstream device tree
- fix the length of registers in the sc7180_ctl from 0xe4 to 0x1dc
- fix the max mixer line width for sm6115 and qcm2290 chipsets in the
DPU catalog
- fix the scaler version on sm8550, sc8280xp, sm8450, sm8250, sm8350
and sm6115. This was incorrectly populated on the SW version of the
scaler library and not the scaler HW version
- Drop dim layer support for msm8998 as its not indicated to be
supported in the downstream DTSI
- fix the DPU_CLK_CTRL bits for msm 8998 sspp blocks
- Use DPU_CLK_CTRL_DMA* prefix instead of DPU_CLK_CTRL_CURSOR*
for all chipsets for the DMA sspp blocks
- fix the ping-pong block base address for sc7280 in the DPU HW catalog
- Fix stack corruption issue in the dpu_hw_ctl_setup_blendstage() function
as it was causing a negative left shift by protecting against an invalid
index
- Clear the DSPP reservations in dpu_rm_release(). This was missed out and
as as result the DSPP was not released from the resource manager global
state.
Signed-off-by: Dave Airlie <airlied@redhat.com >
From: Rob Clark <robdclark@gmail.com >
Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvH+VH_Wx3mFMG51CMnoiU06CM-+-WMhM73M42Qx7Bp4A@mail.gmail.com
2023-03-10 05:52:10 +10:00
Randy Dunlap
a722511b18
drm/msm: DEVFREQ_GOV_SIMPLE_ONDEMAND is no longer needed
...
DRM_MSM no longer needs DEVFREQ_GOV_SIMPLE_ONDEMAND (since commit
dbd7a2a941 ("PM / devfreq: Fix build issues with devfreq disabled")
in linux-next), so remove that select from the DRM_MSM Kconfig file.
Fixes: 6563f60f14 ("drm/msm/gpu: Add devfreq tuning debugfs")
Signed-off-by: Randy Dunlap <rdunlap@infradead.org >
Cc: Rob Clark <robdclark@gmail.com >
Cc: Abhinav Kumar <quic_abhinavk@quicinc.com >
Cc: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Cc: Sean Paul <sean@poorly.run >
Cc: David Airlie <airlied@gmail.com >
Cc: Daniel Vetter <daniel@ffwll.ch >
Cc: linux-arm-msm@vger.kernel.org
Cc: dri-devel@lists.freedesktop.org
Cc: freedreno@lists.freedesktop.org
Reviewed-by: Rob Clark <robdclark@gmail.com >
Patchwork: https://patchwork.freedesktop.org/patch/523353/
Link: https://lore.kernel.org/r/20230220010428.16910-1-rdunlap@infradead.org
[rob: tweak commit message to make checkpatch.pl happy]
Signed-off-by: Rob Clark <robdclark@chromium.org >
2023-03-08 11:55:30 -08:00
Kalyan Thota
5ec498ba86
drm/msm/dpu: clear DSPP reservations in rm release
...
Clear DSPP reservations from the global state during
rm release
Fixes: e47616df00 ("drm/msm/dpu: add support for color processing blocks in dpu driver")
Signed-off-by: Kalyan Thota <quic_kalyant@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Patchwork: https://patchwork.freedesktop.org/patch/522443/
Link: https://lore.kernel.org/r/1676286704-818-2-git-send-email-quic_kalyant@quicinc.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:13 -08:00
Kuogee Hsieh
ce68153edb
drm/msm/disp/dpu: fix sc7280_pp base offset
...
At sc7280, pingpong block is used to management the dither effects
to reduce distortion at panel. Currently pingpong-0 base offset is
wrongly set at 0x59000. This mistake will not cause system to crash.
However it will make dither not work. This patch correct sc7280 ping
pong-0 block base offset.
Changes in v2:
-- add more details info n regrading of pingpong block at commit text
Fixes: 591e34a091 ("drm/msm/disp/dpu1: add support for display for SC7280 target")
Signed-off-by: Kuogee Hsieh <quic_khsieh@quicinc.com >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Reviewed-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/524332/
Link: https://lore.kernel.org/r/1677533800-3125-1-git-send-email-quic_khsieh@quicinc.com
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:12 -08:00
Dmitry Baryshkov
1c1ded39bf
drm/msm/dpu: fix stack smashing in dpu_hw_ctl_setup_blendstage
...
The rewritten dpu_hw_ctl_setup_blendstage() can lightly smash the stack
when setting the SSPP_NONE pipe. However it was unnoticed until the
kernel was tested under AOSP (with some kind of stack protection/check).
This fixes the following backtrace:
Unexpected kernel BRK exception at EL1
Internal error: BRK handler: 00000000f20003e8 [#1 ] PREEMPT SMP
Hardware name: Thundercomm Dragonboard 845c (DT)
pstate: a0400005 (NzCv daif +PAN -UAO -TCO -DIT -SSBS BTYPE=--)
pc : dpu_hw_ctl_setup_blendstage+0x26c/0x278 [msm]
lr : _dpu_crtc_blend_setup+0x4b4/0x5a0 [msm]
sp : ffffffc00bdcb720
x29: ffffffc00bdcb720 x28: ffffff8085debac0 x27: 0000000000000002
x26: ffffffd74af18320 x25: ffffff8083af75a0 x24: ffffffc00bdcb878
x23: 0000000000000001 x22: 0000000000000000 x21: ffffff8085a70000
x20: ffffff8083012dc0 x19: 0000000000000001 x18: 0000000000000000
x17: 000000040044ffff x16: 045000f4b5593519 x15: 0000000000000000
x14: 000000000000000b x13: 0000000000000001 x12: 0000000000000000
x11: 0000000000000001 x10: ffffffc00bdcb764 x9 : ffffffd74af06a08
x8 : 0000000000000001 x7 : 0000000000000001 x6 : 0000000000000000
x5 : ffffffc00bdcb878 x4 : 0000000000000002 x3 : ffffffffffffffff
x2 : ffffffc00bdcb878 x1 : 0000000000000000 x0 : 0000000000000002
Call trace:
dpu_hw_ctl_setup_blendstage+0x26c/0x278 [msm]
_dpu_crtc_blend_setup+0x4b4/0x5a0 [msm]
dpu_crtc_atomic_begin+0xd8/0x22c [msm]
drm_atomic_helper_commit_planes+0x80/0x208 [drm_kms_helper]
msm_atomic_commit_tail+0x134/0x6f0 [msm]
commit_tail+0xa4/0x1a4 [drm_kms_helper]
drm_atomic_helper_commit+0x170/0x184 [drm_kms_helper]
drm_atomic_commit+0xac/0xe8
drm_mode_atomic_ioctl+0xbf0/0xdac
drm_ioctl_kernel+0xc4/0x178
drm_ioctl+0x2c8/0x608
__arm64_sys_ioctl+0xa8/0xec
invoke_syscall+0x44/0x104
el0_svc_common.constprop.0+0x44/0xec
do_el0_svc+0x38/0x98
el0_svc+0x2c/0xb4
el0t_64_sync_handler+0xb8/0xbc
el0t_64_sync+0x1a0/0x1a4
Code: 52800016 52800017 52800018 17ffffc7 (d4207d00)
Fixes: 4488f71f63 ("drm/msm/dpu: simplify blend configuration")
Reported-by: Amit Pundir <amit.pundir@linaro.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Tested-by: Amit Pundir <amit.pundir@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/523778/
Link: https://lore.kernel.org/r/20230223095708.3688148-1-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:11 -08:00
Dmitry Baryshkov
d6181c18d5
drm/msm/dpu: don't use DPU_CLK_CTRL_CURSORn for DMA SSPP clocks
...
DPU driver has been using the DPU_CLK_CTRL_CURSOR prefix for the DMA
SSPP blocks used for the cursor planes. This has lead to the confusion
at least for the MSM8998 platform. In preparation to supporting the
cursor SSPP blocks, use proper enum values to index DMA SSPP clock
controls.
Reviewed-by: Neil Armstrong <neil.armstrong@linaro.org >
Tested-by: Neil Armstrong <neil.armstrong@linaro.org > # on SM8550 on top of next-20230116
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Patchwork: https://patchwork.freedesktop.org/patch/522228/
Link: https://lore.kernel.org/r/20230211231259.1308718-14-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:11 -08:00
Dmitry Baryshkov
0abb6a24aa
drm/msm/dpu: fix clocks settings for msm8998 SSPP blocks
...
DMA2 and DMA3 planes on msm8998 should use corresponding DMA2 and DMA3
clocks rather than CURSOR0/1 clocks (which are used for the CURSOR
planes). Correct corresponding SSPP declarations.
Fixes: 94391a14fc ("drm/msm/dpu1: Add MSM8998 to hw catalog")
Cc: AngeloGioacchino Del Regno <angelogioacchino.delregno@somainline.org >
Cc: Jami Kettunen <jami.kettunen@somainline.org >
Reviewed-by: Marijn Suijten <marijn.suijten@somainline.org >
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522230/
Link: https://lore.kernel.org/r/20230211231259.1308718-13-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:10 -08:00
Dmitry Baryshkov
a5045b00a6
drm/msm/dpu: drop DPU_DIM_LAYER from MIXER_MSM8998_MASK
...
The msm8998 doesn't seem to support DIM_LAYER, so drop it from
the supported features mask.
Fixes: 2d8a4edb67 ("drm/msm/dpu: use feature bit for LM combined alpha check")
Fixes: 94391a14fc ("drm/msm/dpu1: Add MSM8998 to hw catalog")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522231/
Link: https://lore.kernel.org/r/20230211231259.1308718-12-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:09 -08:00
Dmitry Baryshkov
38164e990a
drm/msm/dpu: correct sm6115 scaler
...
QSEED4 is a newer variant of QSEED3LITE, which should be used on
sm6115. Fix the used feature masks.
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Fixes: 3581b7062c ("drm/msm/disp/dpu1: add support for display on SM6115")
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522219/
Link: https://lore.kernel.org/r/20230211231259.1308718-11-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:09 -08:00
Dmitry Baryshkov
03c0c3cb22
drm/msm/dpu: correct sm8250 and sm8350 scaler
...
QSEED4 is a newer variant of QSEED3LITE, which should be used on
sm8250 and sm8350. Fix the DPU caps structure and used feature masks.
Fixes: d21fc5dfc3 ("drm/msm/dpu1: add support for qseed3lite used on sm8250")
Fixes: 0e91bcbb00 ("drm/msm/dpu: Add SM8350 to hw catalog")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522229/
Link: https://lore.kernel.org/r/20230211231259.1308718-10-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:08 -08:00
Dmitry Baryshkov
c7da17b678
drm/msm/dpu: correct sm8450 scaler
...
QSEED4 is a newer variant of QSEED3LITE, which should be used on
sm8450. Fix the used feature masks.
Fixes: 100d7ef699 ("drm/msm/dpu: add support for SM8450")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522215/
Link: https://lore.kernel.org/r/20230211231259.1308718-9-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:07 -08:00
Dmitry Baryshkov
b3587cb645
drm/msm/dpu: correct sc8280xp scaler
...
QSEED4 is a newer variant of QSEED3LITE, which should be used on
sc8280xp. Fix the DPU caps structure and used feature masks.
Fixes: 4a352c2fc1 ("drm/msm/dpu: Introduce SC8280XP")
Signed-off-by: Dmitry Baryshkov <dmitry.baryshkov@linaro.org >
Reviewed-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
Patchwork: https://patchwork.freedesktop.org/patch/522217/
Link: https://lore.kernel.org/r/20230211231259.1308718-8-dmitry.baryshkov@linaro.org
Signed-off-by: Abhinav Kumar <quic_abhinavk@quicinc.com >
2023-03-03 10:04:07 -08:00