linux/drivers/gpu/drm/i915/i915_utils.c

// SPDX-License-Identifier: MIT
/*
 * Copyright © 2019 Intel Corporation
 */

#include <linux/device.h>

#include <drm/drm_drv.h>

#include "i915_drv.h"
#include "i915_reg.h"
#include "i915_utils.h"

void add_taint_for_CI(struct drm_i915_private *i915, unsigned int taint)
{}

#if IS_ENABLED(CONFIG_DRM_I915_DEBUG)
static unsigned int i915_probe_fail_count;

int __i915_inject_probe_error(struct drm_i915_private *i915, int err,
			      const char *func, int line)
{
	if (i915_probe_fail_count >= i915_modparams.inject_probe_failure)
		return 0;

	if (++i915_probe_fail_count < i915_modparams.inject_probe_failure)
		return 0;

	drm_info(&i915->drm, "Injecting failure %d at checkpoint %u [%s:%d]\n",
		 err, i915_modparams.inject_probe_failure, func, line);

	i915_modparams.inject_probe_failure = 0;
	return err;
}

bool i915_error_injected(void)
{
	return i915_probe_fail_count && !i915_modparams.inject_probe_failure;
}

#endif

void cancel_timer(struct timer_list *t)
{}

void set_timer_ms(struct timer_list *t, unsigned long timeout)
{}

bool i915_vtd_active(struct drm_i915_private *i915)
{}

bool i915_direct_stolen_access(struct drm_i915_private *i915)
{}