drm/sun4i: hdmi: Consolidate atomic_check and mode_valid
authorMaxime Ripard <mripard@kernel.org>
Thu, 22 Feb 2024 18:14:21 +0000 (19:14 +0100)
committerMaxime Ripard <mripard@kernel.org>
Mon, 26 Feb 2024 09:33:18 +0000 (10:33 +0100)
commit358e76fd613a762bdba18b6b9fb0469a481de3a3
tree7cd3545b3602a5e4ffb3cc660557fd7b1445df63
parentc6686f274d5ede72a18e2680e844a4c5f5855401
drm/sun4i: hdmi: Consolidate atomic_check and mode_valid

atomic_check and mode_valid do not check for the same things which can
lead to surprising result if the userspace commits a mode that didn't go
through mode_valid. Let's merge the two implementations into a function
called by both.

Acked-by: Sui Jingfeng <sui.jingfeng@linux.dev>
Reviewed-by: Jernej Skrabec <jernej.skrabec@gmail.com>
Signed-off-by: Maxime Ripard <mripard@kernel.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20240222-kms-hdmi-connector-state-v7-35-8f4af575fce2@kernel.org
drivers/gpu/drm/sun4i/sun4i_hdmi_enc.c