Mediatek DRM Fixes - 20231211

1. mtk_disp_gamma: Fix breakage due to merge issue
2. fix kernel oops if no crtc is found
3. Add spinlock for setting vblank event in atomic_begin
4. Fix access violation in mtk_drm_crtc_dma_dev_get
drm/mediatek: Fix access violation in mtk_drm_crtc_dma_dev_get

Add error handling to check NULL input in
mtk_drm_crtc_dma_dev_get function.

While display path is not configured correctly, none of crtc is
established. So the caller of mtk_drm_crtc_dma_dev_get may pass
input parameter *crtc as NULL, Which may cause coredump when
we try to get the container of NULL pointer.

Fixes: cb1d6bcca542 ("drm/mediatek: Add dma dev get function")
Signed-off-by: Stuart Lee <>
Reviewed-by: AngeloGioacchino DEl Regno <>
Tested-by: Macpaul Lin <>
Signed-off-by: Chun-Kuang Hu <>
1 file changed