drivers/gpu/drm/xe/xe_uc_fw.h
Source file repositories/reference/linux-study-clean/drivers/gpu/drm/xe/xe_uc_fw.h
File Facts
- System
- Linux kernel
- Corpus path
drivers/gpu/drm/xe/xe_uc_fw.h- Extension
.h- Size
- 5003 bytes
- Lines
- 198
- 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/errno.habi/uc_fw_abi.hxe_macros.hxe_uc_fw_types.h
Detected Declarations
struct drm_printerfunction xe_uc_fw_rsa_offsetfunction xe_uc_fw_change_statusfunction xe_uc_fw_status_to_errorfunction __xe_uc_fw_statusfunction xe_uc_fw_is_supportedfunction xe_uc_fw_is_enabledfunction xe_uc_fw_is_disabledfunction xe_uc_fw_is_availablefunction xe_uc_fw_is_loadablefunction xe_uc_fw_is_loadedfunction xe_uc_fw_is_runningfunction xe_uc_fw_is_overriddenfunction xe_uc_fw_is_in_error_statefunction xe_uc_fw_sanitizefunction __xe_uc_fw_get_upload_sizefunction xe_uc_fw_get_upload_size
Annotated Snippet
#ifndef _XE_UC_FW_H_
#define _XE_UC_FW_H_
#include <linux/errno.h>
#include "abi/uc_fw_abi.h"
#include "xe_macros.h"
#include "xe_uc_fw_types.h"
struct drm_printer;
int xe_uc_fw_init(struct xe_uc_fw *uc_fw);
size_t xe_uc_fw_copy_rsa(struct xe_uc_fw *uc_fw, void *dst, u32 max_len);
int xe_uc_fw_upload(struct xe_uc_fw *uc_fw, u32 offset, u32 dma_flags);
int xe_uc_fw_check_version_requirements(struct xe_uc_fw *uc_fw);
void xe_uc_fw_print(struct xe_uc_fw *uc_fw, struct drm_printer *p);
static inline u32 xe_uc_fw_rsa_offset(struct xe_uc_fw *uc_fw)
{
return sizeof(struct uc_css_header) + uc_fw->ucode_size + uc_fw->css_offset;
}
#if IS_ENABLED(CONFIG_DRM_XE_DEBUG_GUC)
void xe_uc_fw_change_status(struct xe_uc_fw *uc_fw, enum xe_uc_fw_status status);
#else
static inline void xe_uc_fw_change_status(struct xe_uc_fw *uc_fw,
enum xe_uc_fw_status status)
{
uc_fw->__status = status;
}
#endif
static inline
const char *xe_uc_fw_status_repr(enum xe_uc_fw_status status)
{
switch (status) {
case XE_UC_FIRMWARE_NOT_SUPPORTED:
return "N/A";
case XE_UC_FIRMWARE_UNINITIALIZED:
return "UNINITIALIZED";
case XE_UC_FIRMWARE_DISABLED:
return "DISABLED";
case XE_UC_FIRMWARE_SELECTED:
return "SELECTED";
case XE_UC_FIRMWARE_MISSING:
return "MISSING";
case XE_UC_FIRMWARE_ERROR:
return "ERROR";
case XE_UC_FIRMWARE_AVAILABLE:
return "AVAILABLE";
case XE_UC_FIRMWARE_INIT_FAIL:
return "INIT FAIL";
case XE_UC_FIRMWARE_LOADABLE:
return "LOADABLE";
case XE_UC_FIRMWARE_LOAD_FAIL:
return "LOAD FAIL";
case XE_UC_FIRMWARE_TRANSFERRED:
return "TRANSFERRED";
case XE_UC_FIRMWARE_RUNNING:
return "RUNNING";
case XE_UC_FIRMWARE_PRELOADED:
return "PRELOADED";
}
return "<invalid>";
}
static inline int xe_uc_fw_status_to_error(const enum xe_uc_fw_status status)
{
switch (status) {
case XE_UC_FIRMWARE_NOT_SUPPORTED:
return -ENODEV;
case XE_UC_FIRMWARE_UNINITIALIZED:
return -EACCES;
case XE_UC_FIRMWARE_DISABLED:
return -EPERM;
case XE_UC_FIRMWARE_MISSING:
return -ENOENT;
case XE_UC_FIRMWARE_ERROR:
return -ENOEXEC;
case XE_UC_FIRMWARE_INIT_FAIL:
case XE_UC_FIRMWARE_LOAD_FAIL:
return -EIO;
case XE_UC_FIRMWARE_SELECTED:
return -ESTALE;
case XE_UC_FIRMWARE_AVAILABLE:
case XE_UC_FIRMWARE_LOADABLE:
case XE_UC_FIRMWARE_TRANSFERRED:
case XE_UC_FIRMWARE_RUNNING:
case XE_UC_FIRMWARE_PRELOADED:
return 0;
Annotation
- Immediate include surface: `linux/errno.h`, `abi/uc_fw_abi.h`, `xe_macros.h`, `xe_uc_fw_types.h`.
- Detected declarations: `struct drm_printer`, `function xe_uc_fw_rsa_offset`, `function xe_uc_fw_change_status`, `function xe_uc_fw_status_to_error`, `function __xe_uc_fw_status`, `function xe_uc_fw_is_supported`, `function xe_uc_fw_is_enabled`, `function xe_uc_fw_is_disabled`, `function xe_uc_fw_is_available`, `function xe_uc_fw_is_loadable`.
- 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.