From 49cdbcbad6142bd738d27cbd8dc063ac9a35a464 Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Gallo Filho Date: Tue, 10 Sep 2024 21:15:30 -0300 Subject: drm/tests: Add test for drm_framebuffer_check_src_coords() Add a parametrized test for the drm_framebuffer_check_src_coords function. Signed-off-by: Carlos Eduardo Gallo Filho Acked-by: Maxime Ripard Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-6-gcarlos@disroot.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_framebuffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/drm/drm_framebuffer.c') diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 888aadb6a4ac..9cd85ac789bb 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -99,6 +99,7 @@ int drm_framebuffer_check_src_coords(uint32_t src_x, uint32_t src_y, return 0; } +EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_framebuffer_check_src_coords); /** * drm_mode_addfb - add an FB to the graphics configuration -- cgit From 2735d5e4060960c7bd06698b0a1990c7d42c762e Mon Sep 17 00:00:00 2001 From: Carlos Eduardo Gallo Filho Date: Tue, 10 Sep 2024 21:15:33 -0300 Subject: drm/tests: Add test for drm_framebuffer_init() Add three KUnit test cases for the drm_framebuffer_init function: 1. Test if expected values are being set after drm_framebuffer_init() call. 2. Try to init a framebuffer without setting its format. 3. Try calling drm_framebuffer_init() with mismatch of the drm_device passed at the first argument and the one pointed by fb->dev. Signed-off-by: Carlos Eduardo Gallo Filho Link: https://patchwork.freedesktop.org/patch/msgid/20240911001559.28284-9-gcarlos@disroot.org Signed-off-by: Maxime Ripard --- drivers/gpu/drm/drm_framebuffer.c | 1 + 1 file changed, 1 insertion(+) (limited to 'drivers/gpu/drm/drm_framebuffer.c') diff --git a/drivers/gpu/drm/drm_framebuffer.c b/drivers/gpu/drm/drm_framebuffer.c index 9cd85ac789bb..47e6e8577b62 100644 --- a/drivers/gpu/drm/drm_framebuffer.c +++ b/drivers/gpu/drm/drm_framebuffer.c @@ -839,6 +839,7 @@ void drm_framebuffer_free(struct kref *kref) fb->funcs->destroy(fb); } +EXPORT_SYMBOL_FOR_TESTS_ONLY(drm_framebuffer_free); /** * drm_framebuffer_init - initialize a framebuffer -- cgit