drivers/gpu/drm/i915/i915_utils.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/i915_utils.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/i915/i915_utils.c
Extension
.c
Size
1181 bytes
Lines
47
Domain
Driver Families
Bucket
drivers/gpu
Inferred role
Driver Families: implementation source
Status
source implementation candidate

Why This File Exists

Repeatable hardware-adapter layer. Deep compatibility for every driver is out of scope; this atlas records patterns, probe lifecycles, bus glue, IRQ/DMA usage, and links back to core abstractions.

Dependency Surface

Detected Declarations

Annotated Snippet

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

#include <linux/device.h>

#include <drm/drm_drv.h>
#include <drm/drm_print.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)
{
	drm_notice(&i915->drm, "CI tainted: %#x by %pS\n",
		   taint, __builtin_return_address(0));

	__add_taint_for_CI(taint);
}

bool i915_vtd_active(struct drm_i915_private *i915)
{
	if (device_iommu_mapped(i915->drm.dev))
		return true;

	/* Running as a guest, we assume the host is enforcing VT'd */
	return i915_run_as_guest();
}

bool i915_direct_stolen_access(struct drm_i915_private *i915)
{
	/*
	 * Wa_22018444074
	 *
	 * Access via BAR can hang MTL, go directly to GSM/DSM,
	 * except for VM guests which won't have access to it.
	 *
	 * Normally this would not work but on MTL the system firmware
	 * should have relaxed the access permissions sufficiently.
	 * 0x138914==0x1 indicates that the firmware has done its job.
	 */
	return IS_METEORLAKE(i915) && !i915_run_as_guest() &&
		intel_uncore_read(&i915->uncore, MTL_PCODE_STOLEN_ACCESS) == STOLEN_ACCESS_ALLOWED;
}

Annotation

Implementation Notes