drm/vc4: backport 27e0a194a2 and b3bf19552e

Get the KUnit tests passing.

Signed-off-by: Maíra Canal <mcanal@igalia.com>
This commit is contained in:
Maíra Canal
2024-08-06 12:02:52 -03:00
committed by Dom Cobley
parent 58947314fa
commit 21ca238c7b
2 changed files with 10 additions and 10 deletions

View File

@@ -35,16 +35,14 @@ struct drm_plane *vc4_mock_find_plane_for_crtc(struct kunit *test,
return NULL; return NULL;
} }
struct vc4_dummy_plane {
struct vc4_plane plane;
};
struct vc4_dummy_plane *vc4_dummy_plane(struct kunit *test,
struct drm_device *drm,
enum drm_plane_type type);
struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm, struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
enum drm_plane_type type); enum drm_plane_type type);
struct drm_plane *
vc4_mock_atomic_add_plane(struct kunit *test,
struct drm_atomic_state *state,
struct drm_crtc *crtc);
struct vc4_dummy_crtc { struct vc4_dummy_crtc {
struct vc4_crtc crtc; struct vc4_crtc crtc;
}; };

View File

@@ -1,5 +1,6 @@
// SPDX-License-Identifier: GPL-2.0 // SPDX-License-Identifier: GPL-2.0
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_kunit_helpers.h> #include <drm/drm_kunit_helpers.h>
#include <drm/drm_atomic_uapi.h> #include <drm/drm_atomic_uapi.h>
#include <drm/drm_plane.h> #include <drm/drm_plane.h>
@@ -33,9 +34,10 @@ struct drm_plane *vc4_dummy_plane(struct kunit *test, struct drm_device *drm,
KUNIT_ASSERT_EQ(test, type, DRM_PLANE_TYPE_PRIMARY); KUNIT_ASSERT_EQ(test, type, DRM_PLANE_TYPE_PRIMARY);
plane = drm_kunit_helper_create_primary_plane(test, drm, plane = drm_kunit_helper_create_primary_plane(test, drm,
NULL, &vc4_dummy_plane_funcs,
NULL, &vc4_dummy_plane_helper_funcs,
NULL, 0, vc4_dummy_plane_formats,
ARRAY_SIZE(vc4_dummy_plane_formats),
NULL); NULL);
KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane); KUNIT_ASSERT_NOT_ERR_OR_NULL(test, plane);