]> www.infradead.org Git - users/jedix/linux-maple.git/commit
drm/mediatek: Fix missing configuration flags in mtk_crtc_ddp_config()
authorJason-JH.Lin <jason-jh.lin@mediatek.com>
Tue, 27 Aug 2024 14:55:19 +0000 (22:55 +0800)
committerChun-Kuang Hu <chunkuang.hu@kernel.org>
Thu, 29 Aug 2024 14:40:05 +0000 (14:40 +0000)
commitfe30bae552ce27b9fefe0b12db1544e73d07325f
tree9d2185ad71e90e4ba098b45fe2b3b32220c4c0b5
parentd79ae4766ca65f718f171ed40dc57476a481624f
drm/mediatek: Fix missing configuration flags in mtk_crtc_ddp_config()

In mtk_crtc_ddp_config(), mtk_crtc will use some configuration flags to
generate instructions to cmdq_handle, such as:
  state->pending_config
  mtk_crtc->pending_planes
  plane_state->pending.config
  mtk_crtc->pending_async_planes
  plane_state->pending.async_config

These configuration flags may be set to false when a GCE IRQ comes calling
ddp_cmdq_cb(). This may result in missing prepare instructions,
especially if mtk_crtc_update_config() with the flase need_vblank (no need
to wait for vblank) cases.

Therefore, the mtk_crtc->config_updating flag is set at the beginning of
mtk_crtc_update_config() to ensure that these configuration flags won't be
changed when the mtk_crtc_ddp_config() is preparing instructions.
But somehow the ddp_cmdq_cb() didn't use the mtk_crtc->config_updating
flag to prevent those pending config flags from being cleared.

To avoid missing the configuration when generating the config instruction,
the config_updating flag should be added into ddp_cmdq_cb() and be
protected with spin_lock.

Fixes: 7f82d9c43879 ("drm/mediatek: Clear pending flag when cmdq packet is done")
Signed-off-by: Jason-JH.Lin <jason-jh.lin@mediatek.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Reviewed-by: Fei Shao <fshao@chromium.org>
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240827-drm-fixup-0819-v3-1-4761005211ec@mediatek.com/
Link: https://patchwork.kernel.org/project/dri-devel/patch/20240827-drm-fixup-0819-v3-2-4761005211ec@mediatek.com/
Signed-off-by: Chun-Kuang Hu <chunkuang.hu@kernel.org>
drivers/gpu/drm/mediatek/mtk_crtc.c