drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.h- Extension
.h- Size
- 10107 bytes
- Lines
- 315
- 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.
- 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.
- Defines or uses C structs; map object ownership, embedded links, reference counts, and lock ownership.
Dependency Surface
linux/sizes.hlinux/types.hintel_uc_fw_abi.hintel_device_info.hi915_gem.hi915_vma.h
Detected Declarations
struct drm_printerstruct drm_i915_privatestruct intel_gtstruct intel_uc_fw_verstruct intel_uc_fw_filestruct intel_uc_fwenum intel_uc_fw_statusenum intel_uc_fw_typefunction intel_uc_fw_change_statusfunction intel_uc_fw_status_to_errorfunction __intel_uc_fw_statusfunction intel_uc_fw_is_supportedfunction intel_uc_fw_is_enabledfunction intel_uc_fw_is_availablefunction intel_uc_fw_is_loadablefunction intel_uc_fw_is_loadedfunction intel_uc_fw_is_runningfunction intel_uc_fw_is_in_errorfunction intel_uc_fw_is_overriddenfunction intel_uc_fw_sanitizefunction __intel_uc_fw_get_upload_sizefunction intel_uc_fw_get_upload_size
Annotated Snippet
struct intel_uc_fw_ver {
u32 major;
u32 minor;
u32 patch;
u32 build;
};
/*
* The firmware build process will generate a version header file with major and
* minor version defined. The versions are built into CSS header of firmware.
* i915 kernel driver set the minimal firmware version required per platform.
*/
struct intel_uc_fw_file {
const char *path;
struct intel_uc_fw_ver ver;
};
/*
* This structure encapsulates all the data needed during the process
* of fetching, caching, and loading the firmware image into the uC.
*/
struct intel_uc_fw {
enum intel_uc_fw_type type;
union {
const enum intel_uc_fw_status status;
enum intel_uc_fw_status __status; /* no accidental overwrites */
};
struct intel_uc_fw_file file_wanted;
struct intel_uc_fw_file file_selected;
bool user_overridden;
size_t size;
struct drm_i915_gem_object *obj;
/**
* @needs_ggtt_mapping: indicates whether the fw object needs to be
* pinned to ggtt. If true, the fw is pinned at init time and unpinned
* during driver unload.
*/
bool needs_ggtt_mapping;
/**
* @vma_res: A vma resource used in binding the uc fw to ggtt. The fw is
* pinned in a reserved area of the ggtt (above the maximum address
* usable by GuC); therefore, we can't use the normal vma functions to
* do the pinning and we instead use this resource to do so.
*/
struct i915_vma_resource vma_res;
struct i915_vma *rsa_data;
u32 rsa_size;
u32 ucode_size;
u32 private_data_size;
u32 dma_start_offset;
bool has_gsc_headers;
};
/*
* When we load the uC binaries, we pin them in a reserved section at the top of
* the GGTT, which is ~18 MBs. On multi-GT systems where the GTs share the GGTT,
* we also need to make sure that each binary is pinned to a unique location
* during load, because the different GT can go through the FW load at the same
* time (see uc_fw_ggtt_offset() for details).
* Given that the available space is much greater than what is required by the
* binaries, to keep things simple instead of dynamically partitioning the
* reserved section to make space for all the blobs we can just reserve a static
* chunk for each binary.
*/
#define INTEL_UC_RSVD_GGTT_PER_FW SZ_2M
#ifdef CONFIG_DRM_I915_DEBUG_GUC
void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_status status);
#else
static inline void intel_uc_fw_change_status(struct intel_uc_fw *uc_fw,
enum intel_uc_fw_status status)
{
uc_fw->__status = status;
}
#endif
static inline
const char *intel_uc_fw_status_repr(enum intel_uc_fw_status status)
{
switch (status) {
case INTEL_UC_FIRMWARE_NOT_SUPPORTED:
return "N/A";
case INTEL_UC_FIRMWARE_UNINITIALIZED:
return "UNINITIALIZED";
Annotation
- Immediate include surface: `linux/sizes.h`, `linux/types.h`, `intel_uc_fw_abi.h`, `intel_device_info.h`, `i915_gem.h`, `i915_vma.h`.
- Detected declarations: `struct drm_printer`, `struct drm_i915_private`, `struct intel_gt`, `struct intel_uc_fw_ver`, `struct intel_uc_fw_file`, `struct intel_uc_fw`, `enum intel_uc_fw_status`, `enum intel_uc_fw_type`, `function intel_uc_fw_change_status`, `function intel_uc_fw_status_to_error`.
- Atlas domain: Driver Families / drivers/gpu.
- Implementation status: source implementation candidate.
Implementation Notes
- This generated page is the file-by-file coverage layer; curated subsystem chapters should link here when they synthesize a multi-file control flow.
- Core OS pages should be promoted from atlas-only to deep-reviewed when they explain data structures, invariants, locking, lifecycle, and C implementation snippets.
- Driver-family pages are intentionally pattern-oriented unless they are part of the selected PCIe/NVMe representative device path.