soc: mediatek: add cmdq support of mtk-mmsys config API for mt8195 vdosys1
authorNancy.Lin <nancy.lin@mediatek.com>
Fri, 13 Jan 2023 10:44:30 +0000 (18:44 +0800)
committerMatthias Brugger <matthias.bgg@gmail.com>
Wed, 25 Jan 2023 15:05:15 +0000 (16:05 +0100)
commit8af1f6b5bccb61edc40c3c00cefa7be07c1e5a91
tree2901ca0798345d302a8c7ac0486509abfa2564a8
parent3dd20b715c4483ae5d8ddb22cbc8e116944094e4
soc: mediatek: add cmdq support of mtk-mmsys config API for mt8195 vdosys1

Add cmdq support for mtk-mmsys config API.
The mmsys config register settings need to take effect with the other
HW settings(like OVL_ADAPTOR...) at the same vblanking time.

If we use CPU to write the mmsys reg, we can't guarantee all the
settings can be written in the same vblanking time.
Cmdq is used for this purpose. We prepare all the related HW settings
in one cmdq packet. The first command in the packet is "wait stream done",
and then following with all the HW settings. After the cmdq packet is
flush to GCE HW. The GCE waits for the "stream done event" to coming
and then starts flushing all the HW settings. This can guarantee all
the settings flush in the same vblanking.

Signed-off-by: Nancy.Lin <nancy.lin@mediatek.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Reviewed-by: CK Hu <ck.hu@mediatek.com>
Tested-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Tested-by: Bo-Chen Chen <rex-bc.chen@mediatek.com>
Link: https://lore.kernel.org/r/20230113104434.28023-8-nancy.lin@mediatek.com
Signed-off-by: Matthias Brugger <matthias.bgg@gmail.com>
drivers/soc/mediatek/mtk-mmsys.c
include/linux/soc/mediatek/mtk-mmsys.h