drivers/gpu/drm/amd/display/dmub/dmub_srv.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/display/dmub/dmub_srv.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/display/dmub/dmub_srv.h
Extension
.h
Size
35241 bytes
Lines
1147
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

struct dmub_region {
	uint32_t base;
	uint32_t top;
};

/**
 * struct dmub_window - dmub hw cache window
 * @off: offset to the fb memory in gpu address space
 * @r: region in uc address space for cache window
 */
struct dmub_window {
	union dmub_addr offset;
	struct dmub_region region;
};

/**
 * struct dmub_fb - defines a dmub framebuffer memory region
 * @cpu_addr: cpu virtual address for the region, NULL if invalid
 * @gpu_addr: gpu virtual address for the region, NULL if invalid
 * @size: size of the region in bytes, zero if invalid
 */
struct dmub_fb {
	void *cpu_addr;
	uint64_t gpu_addr;
	uint32_t size;
};

/**
 * struct dmub_srv_region_params - params used for calculating dmub regions
 * @inst_const_size: size of the fw inst const section
 * @bss_data_size: size of the fw bss data section
 * @vbios_size: size of the vbios data
 * @fw_bss_data: raw firmware bss data section
 */
struct dmub_srv_region_params {
	uint32_t inst_const_size;
	uint32_t bss_data_size;
	uint32_t vbios_size;
	const uint8_t *fw_inst_const;
	const uint8_t *fw_bss_data;
	const enum dmub_window_memory_type *window_memory_type;
	const struct dmub_fw_meta_info *fw_info;
};

/**
 * struct dmub_srv_fw_meta_info_params - params used for fetching fw meta info from fw_image
 * @inst_const_size: size of the fw inst const section
 * @bss_data_size: size of the fw bss data section
 * @fw_inst_const: raw firmware inst const section
 * @fw_bss_data: raw firmware bss data section
 * @custom_psp_footer_size: custom psp footer size to use when indexing for fw meta info
 */
struct dmub_srv_fw_meta_info_params {
	uint32_t inst_const_size;
	uint32_t bss_data_size;
	const uint8_t *fw_inst_const;
	const uint8_t *fw_bss_data;
	uint32_t custom_psp_footer_size;
};

/**
 * struct dmub_srv_region_info - output region info from the dmub service
 * @fb_size: required minimum fb size for all regions, aligned to 4096 bytes
 * @num_regions: number of regions used by the dmub service
 * @regions: region info
 *
 * The regions are aligned such that they can be all placed within the
 * same framebuffer but they can also be placed into different framebuffers.
 *
 * The size of each region can be calculated by the caller:
 * size = reg.top - reg.base
 *
 * Care must be taken when performing custom allocations to ensure that each
 * region base address is 256 byte aligned.
 */
struct dmub_srv_region_info {
	uint32_t fb_size;
	uint32_t gart_size;
	uint8_t num_regions;
	struct dmub_region regions[DMUB_WINDOW_TOTAL];
	uint32_t verified_psp_footer_size;
};

/**
 * struct dmub_srv_memory_params - parameters used for driver fb setup
 * @region_info: region info calculated by dmub service
 * @cpu_fb_addr: base cpu address for the framebuffer
 * @cpu_inbox_addr: base cpu address for the gart
 * @gpu_fb_addr: base gpu virtual address for the framebuffer
 * @gpu_inbox_addr: base gpu virtual address for the gart

Annotation

Implementation Notes