linux/drivers/gpu/drm/vc4/tests/vc4_test_pv_muxing.c

// SPDX-License-Identifier: GPL-2.0

#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 =;

/* See
 * https://lore.kernel.org/all/[email protected]/
 * and
 * https://lore.kernel.org/dri-devel/[email protected]/
 */
static void drm_test_vc5_pv_muxing_bugs_subsequent_crtc_enable(struct kunit *test)
{}

/*
 * This test makes sure that we never change the FIFO of an active HVS
 * channel if we disable a FIFO with a lower index.
 *
 * Doing so would result in a FIFO stall and would disrupt an output
 * supposed to be unaffected by the commit.
 */
static void drm_test_vc5_pv_muxing_bugs_stable_fifo(struct kunit *test)
{}

/*
 * Test that if we affect a single output, only the CRTC state of that
 * output will be pulled in the global atomic state.
 *
 * This is relevant for two things:
 *
 *   - If we don't have that state at all, we are unlikely to affect the
 *     FIFO muxing. This is somewhat redundant with
 *     drm_test_vc5_pv_muxing_bugs_stable_fifo()
 *
 *   - KMS waits for page flips to occur on all the CRTC found in the
 *     CRTC state. Since the CRTC is unaffected, we would over-wait, but
 *     most importantly run into corner cases like waiting on an
 *     inactive CRTC that never completes.
 */
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();