Commit 9ff6df49 authored by Michael Walle's avatar Michael Walle Committed by Chun-Kuang Hu
Browse files

drm/mediatek: dpi/dsi: Fix possible_crtcs calculation



mtk_find_possible_crtcs() assumes that the main path will always have
the CRTC with id 0, the ext id 1 and the third id 2. This is only true
if the paths are all available. But paths are optional (see also
comment in mtk_drm_kms_init()), e.g. the main path might not be enabled
or available at all. Then the CRTC IDs will shift one up, e.g. ext will
be 0 and the third path will be 1.

To fix that, dynamically calculate the IDs by the presence of the paths.

While at it, make the return code a signed one and return -ENODEV if no
path is found and handle the error in the callers.

Fixes: 5aa8e764 ("drm/mediatek: dpi/dsi: Change the getting possible_crtc way")
Suggested-by: default avatarNícolas F. R. A. Prado <nfraprado@collabora.com>
Signed-off-by: default avatarMichael Walle <mwalle@kernel.org>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240606092122.2026313-1-mwalle@kernel.org/


Signed-off-by: default avatarChun-Kuang Hu <chunkuang.hu@kernel.org>
parent 45b70f71
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment