drm/vc4: tests: Introduce a mocking infrastructure
authorMaxime Ripard <maxime@cerno.tech>
Thu, 1 Dec 2022 15:11:48 +0000 (16:11 +0100)
committerMaxime Ripard <maxime@cerno.tech>
Thu, 8 Dec 2022 08:56:56 +0000 (09:56 +0100)
commitf759f5b53f1caf734bdffcb9519d4edd877b017f
tree2cf006f4295577581a3b5df7b383f085f703e6da
parent640dbcc91dec76aeeae782d97f0e8ed3c65b58f6
drm/vc4: tests: Introduce a mocking infrastructure

In order to test the current atomic_check hooks we need to have a DRM
device that has roughly the same capabilities and layout that the actual
hardware. We'll also need a bunch of functions to create arbitrary
atomic states.

Let's create some helpers to create a device that behaves like the real
one, and some helpers to maintain the atomic state we want to check.

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Reviewed-by: Maíra Canal <mcanal@igalia.com>
Link: https://lore.kernel.org/r/20221123-rpi-kunit-tests-v3-17-4615a663a84a@cerno.tech
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
12 files changed:
drivers/gpu/drm/vc4/Kconfig
drivers/gpu/drm/vc4/Makefile
drivers/gpu/drm/vc4/tests/.kunitconfig [new file with mode: 0644]
drivers/gpu/drm/vc4/tests/vc4_mock.c [new file with mode: 0644]
drivers/gpu/drm/vc4/tests/vc4_mock.h [new file with mode: 0644]
drivers/gpu/drm/vc4/tests/vc4_mock_crtc.c [new file with mode: 0644]
drivers/gpu/drm/vc4/tests/vc4_mock_output.c [new file with mode: 0644]
drivers/gpu/drm/vc4/tests/vc4_mock_plane.c [new file with mode: 0644]
drivers/gpu/drm/vc4/vc4_crtc.c
drivers/gpu/drm/vc4/vc4_drv.c
drivers/gpu/drm/vc4/vc4_drv.h
drivers/gpu/drm/vc4/vc4_txp.c