zoan37 <[email protected]> 於 2026年10月11日週日 上午12:43寫道: > > mtk_crtc_update_output() finds the private data of the display > controller (mmsys) that a CRTC belongs to with > > priv->all_drm_private[drm_crtc_index(crtc)] > > but all_drm_private[] has one entry per mmsys (mmsys_dev_num entries), > not one per CRTC. mtk_crtc_create() gets the right entry from its > priv_data_index argument, and the two only agree when every mmsys > drives exactly one CRTC and the CRTCs are created in mmsys order. > > When a CRTC with connector routes sits on an mmsys that drives more > than one CRTC, the lookup reads past the end of all_drm_private[] (or > picks another mmsys' data), and the route component taken from that > data's ddp_comp[] array is bogus. On an MT8189 board with connector > routes on the external display path (CRTC 1 on the only mmsys), the > first HDMI hotplug oopsed in the compositor's atomic commit. > > With the route tables currently in the tree (only MT8188 VDOSYS0, whose > main path is always CRTC 0 and all_drm_private[0]) the two indices > happen to match, so nothing in-tree hits this yet. It triggers as soon > as routes are used on a path that is not the first CRTC of the first > mmsys. > > Remember the mmsys private data mtk_crtc_create() used for the CRTC and > use it in mtk_crtc_update_output().
Applied to mediatek-drm-fixes [1], thanks. [1] https://git.kernel.org/pub/scm/linux/kernel/git/chunkuang.hu/linux.git/log/?h=mediatek-drm-fixes Regards, Chun-Kuang. > > Fixes: 01389b324c97 ("drm/mediatek: Add connector dynamic selection > capability") > Assisted-by: LLM > Signed-off-by: zoan37 <[email protected]> > ---
