drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/amd/amdgpu/amdgpu_mes.h
Extension
.h
Size
18273 bytes
Lines
558
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 amdgpu_mes {
	struct amdgpu_device            *adev;

	struct mutex                    mutex_hidden;

	struct ida                      doorbell_ida;

	spinlock_t                      queue_id_lock;

	uint32_t			sched_version;
	uint32_t			kiq_version;
	uint32_t			fw_version[AMDGPU_MAX_MES_PIPES];
	bool                            enable_legacy_queue_map;

	uint32_t                        total_max_queue;
	uint32_t                        max_doorbell_slices;

	uint64_t                        default_process_quantum;
	uint64_t                        default_gang_quantum;

	struct amdgpu_ring              ring[AMDGPU_MAX_MES_INST_PIPES];
	spinlock_t                      ring_lock[AMDGPU_MAX_MES_INST_PIPES];

	const struct firmware           *fw[AMDGPU_MAX_MES_PIPES];

	/* mes ucode */
	struct amdgpu_bo		*ucode_fw_obj[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t			ucode_fw_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];
	uint32_t			*ucode_fw_ptr[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        uc_start_addr[AMDGPU_MAX_MES_PIPES];

	/* mes ucode data */
	struct amdgpu_bo		*data_fw_obj[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t			data_fw_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];
	uint32_t			*data_fw_ptr[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        data_start_addr[AMDGPU_MAX_MES_PIPES];

	/* eop gpu obj */
	struct amdgpu_bo		*eop_gpu_obj[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        eop_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];

	void                            *mqd_backup[AMDGPU_MAX_MES_INST_PIPES];
	struct amdgpu_irq_src	        irq[AMDGPU_MAX_MES_INST_PIPES];

	uint32_t                        vmid_mask_gfxhub;
	uint32_t                        vmid_mask_mmhub;
	uint32_t                        gfx_hqd_mask[AMDGPU_MES_MAX_GFX_PIPES];
	uint32_t                        compute_hqd_mask[AMDGPU_MES_MAX_COMPUTE_PIPES];
	uint32_t                        sdma_hqd_mask[AMDGPU_MES_MAX_SDMA_PIPES];
	uint32_t                        aggregated_doorbells[AMDGPU_MES_PRIORITY_NUM_LEVELS];

	uint32_t                        sch_ctx_offs[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        sch_ctx_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        *sch_ctx_ptr[AMDGPU_MAX_MES_INST_PIPES];
	uint32_t                        query_status_fence_offs[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        query_status_fence_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t                        *query_status_fence_ptr[AMDGPU_MAX_MES_INST_PIPES];

	uint32_t			saved_flags;

	/* initialize kiq pipe */
	int                             (*kiq_hw_init)(struct amdgpu_device *adev,
                                                   uint32_t xcc_id);
	int                             (*kiq_hw_fini)(struct amdgpu_device *adev,
                                                   uint32_t xcc_id);

	/* MES doorbells */
	uint32_t			db_start_dw_offset;
	uint32_t			num_mes_dbs;
	unsigned long			*doorbell_bitmap;

	/* MES event log buffer */
	uint32_t			event_log_size;
	struct amdgpu_bo	*event_log_gpu_obj;
	uint64_t			event_log_gpu_addr;
	void				*event_log_cpu_addr;

	/* ip specific functions */
	const struct amdgpu_mes_funcs   *funcs;

	/* mes resource_1 bo*/
	struct amdgpu_bo    *resource_1[AMDGPU_MAX_MES_PIPES];
	uint64_t            resource_1_gpu_addr[AMDGPU_MAX_MES_PIPES];
	void                *resource_1_addr[AMDGPU_MAX_MES_PIPES];

	int				hung_queue_db_array_size;
	int				hung_queue_hqd_info_offset;
	struct amdgpu_bo		*hung_queue_db_array_gpu_obj[AMDGPU_MAX_MES_INST_PIPES];
	uint64_t			hung_queue_db_array_gpu_addr[AMDGPU_MAX_MES_INST_PIPES];
	void				*hung_queue_db_array_cpu_addr[AMDGPU_MAX_MES_INST_PIPES];

Annotation

Implementation Notes