drm/modes: Add a function to generate analog display modes
authorMaxime Ripard <maxime@cerno.tech>
Thu, 17 Nov 2022 09:28:49 +0000 (10:28 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 24 Nov 2022 11:42:39 +0000 (12:42 +0100)
commit4fcd238560ee6724d6edcae95820bdf7f2e40ab1
treeb09152213700d11923405f7cbced32eb6b550462
parent7d63cd8526f1b70d1438b1aa90620cde941162c3
drm/modes: Add a function to generate analog display modes

Multiple drivers (meson, vc4, sun4i) define analog TV 525-lines and
625-lines modes in their drivers.

Since those modes are fairly standard, and that we'll need to use them
in more places in the future, it makes sense to move their definition
into the core framework.

However, analog display usually have fairly loose timings requirements,
the only discrete parameters being the total number of lines and pixel
clock frequency. Thus, we created a function that will create a display
mode from the standard, the pixel frequency and the active area.

Tested-by: Mateusz Kwiatkowski <kfyatek+publicgit@gmail.com>
Acked-in-principle-or-something-like-that-by: Daniel Vetter <daniel.vetter@ffwll.ch>
Link: https://lore.kernel.org/r/20220728-rpi-analog-tv-properties-v10-6-256dad125326@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
drivers/gpu/drm/drm_modes.c
drivers/gpu/drm/tests/Makefile
drivers/gpu/drm/tests/drm_modes_test.c [new file with mode: 0644]
include/drm/drm_modes.h