#include <drm/drm_atomic.h>
#include <drm/drm_atomic_helper.h>
#include <drm/drm_atomic_state_helper.h>
#include <drm/drm_atomic_uapi.h>
#include <drm/drm_crtc.h>
#include <drm/drm_drv.h>
#include <drm/drm_fourcc.h>
#include <drm/drm_kunit_helpers.h>
#include <drm/drm_mode.h>
#include <drm/drm_modeset_helper_vtables.h>
#include <drm/drm_plane.h>
#include <kunit/test.h>
#include "../vc4_drv.h"
#include "vc4_mock.h"
struct pv_muxing_priv { … };
static bool check_fifo_conflict(struct kunit *test,
const struct drm_atomic_state *state)
{ … }
struct encoder_constraint { … };
#define ENCODER_CONSTRAINT(_type, ...) …
static bool __check_encoder_constraints(const struct encoder_constraint *constraints,
size_t nconstraints,
enum vc4_encoder_type type,
unsigned int channel)
{ … }
static const struct encoder_constraint vc4_encoder_constraints[] = …;
static const struct encoder_constraint vc5_encoder_constraints[] = …;
static bool check_vc4_encoder_constraints(enum vc4_encoder_type type, unsigned int channel)
{ … }
static bool check_vc5_encoder_constraints(enum vc4_encoder_type type, unsigned int channel)
{ … }
static struct vc4_crtc_state *
get_vc4_crtc_state_for_encoder(struct kunit *test,
const struct drm_atomic_state *state,
enum vc4_encoder_type type)
{ … }
static bool check_channel_for_encoder(struct kunit *test,
const struct drm_atomic_state *state,
enum vc4_encoder_type type,
bool (*check_fn)(enum vc4_encoder_type type, unsigned int channel))
{ … }
struct pv_muxing_param { … };
static void vc4_test_pv_muxing_desc(const struct pv_muxing_param *t, char *desc)
{ … }
#define PV_MUXING_TEST(_name, _mock_fn, _check_fn, ...) …
#define VC4_PV_MUXING_TEST(_name, ...) …
#define VC5_PV_MUXING_TEST(_name, ...) …
static const struct pv_muxing_param vc4_test_pv_muxing_params[] = …;
KUNIT_ARRAY_PARAM(vc4_test_pv_muxing,
vc4_test_pv_muxing_params,
vc4_test_pv_muxing_desc);
static const struct pv_muxing_param vc4_test_pv_muxing_invalid_params[] = …;
KUNIT_ARRAY_PARAM(vc4_test_pv_muxing_invalid,
vc4_test_pv_muxing_invalid_params,
vc4_test_pv_muxing_desc);
static const struct pv_muxing_param vc5_test_pv_muxing_params[] = …;
KUNIT_ARRAY_PARAM(vc5_test_pv_muxing,
vc5_test_pv_muxing_params,
vc4_test_pv_muxing_desc);
static const struct pv_muxing_param vc5_test_pv_muxing_invalid_params[] = …;
KUNIT_ARRAY_PARAM(vc5_test_pv_muxing_invalid,
vc5_test_pv_muxing_invalid_params,
vc4_test_pv_muxing_desc);
static void drm_vc4_test_pv_muxing(struct kunit *test)
{ … }
static void drm_vc4_test_pv_muxing_invalid(struct kunit *test)
{ … }
static int vc4_pv_muxing_test_init(struct kunit *test)
{ … }
static struct kunit_case vc4_pv_muxing_tests[] = …;
static struct kunit_suite vc4_pv_muxing_test_suite = …;
static struct kunit_case vc5_pv_muxing_tests[] = …;
static struct kunit_suite vc5_pv_muxing_test_suite = …;
static void drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable(struct kunit *test)
{ … }
static void drm_test_vc5_pv_muxing_bugs_stable_fifo(struct kunit *test)
{ … }
static void
drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable_too_many_crtc_state(struct kunit *test)
{ … }
static struct kunit_case vc5_pv_muxing_bugs_tests[] = …;
static struct kunit_suite vc5_pv_muxing_bugs_test_suite = …;
kunit_test_suites(…);