drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/rm.h
Extension
.h
Size
6947 bytes
Lines
192
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 nvkm_rm_impl {
	const struct nvkm_rm_wpr *wpr;
	const struct nvkm_rm_api *api;
};

struct nvkm_rm {
	struct nvkm_device *device;
	const struct nvkm_rm_gpu *gpu;
	const struct nvkm_rm_wpr *wpr;
	const struct nvkm_rm_api *api;
};

struct nvkm_rm_wpr {
	u32 os_carveout_size;
	u32 base_size;
	u64 heap_size_min;
	u32 heap_size_non_wpr;
	u32 rsvd_size_pmu;
	bool offset_set_by_acr;
};

struct nvkm_rm_api {
	const struct nvkm_rm_api_gsp {
		void (*set_rmargs)(struct nvkm_gsp *, bool resume);
		int (*set_system_info)(struct nvkm_gsp *);
		int (*get_static_info)(struct nvkm_gsp *);
		bool (*xlat_mc_engine_idx)(u32 mc_engine_idx, enum nvkm_subdev_type *, int *inst);
		void (*drop_send_user_shared_data)(struct nvkm_gsp *);
		void (*drop_post_nocat_record)(struct nvkm_gsp *);
		u32 (*sr_data_size)(struct nvkm_gsp *);
	} *gsp;

	const struct nvkm_rm_api_rpc {
		void *(*get)(struct nvkm_gsp *, u32 fn, u32 argc);
		void *(*push)(struct nvkm_gsp *gsp, void *argv,
			      enum nvkm_gsp_rpc_reply_policy policy, u32 repc);
		void (*done)(struct nvkm_gsp *gsp, void *repv);
	} *rpc;

	const struct nvkm_rm_api_ctrl {
		void *(*get)(struct nvkm_gsp_object *, u32 cmd, u32 params_size);
		int (*push)(struct nvkm_gsp_object *, void **params, u32 repc);
		void (*done)(struct nvkm_gsp_object *, void *params);
	} *ctrl;

	const struct nvkm_rm_api_alloc {
		void *(*get)(struct nvkm_gsp_object *, u32 oclass, u32 params_size);
		void *(*push)(struct nvkm_gsp_object *, void *params);
		void (*done)(struct nvkm_gsp_object *, void *params);

		int (*free)(struct nvkm_gsp_object *);
	} *alloc;

	const struct nvkm_rm_api_client {
		int (*ctor)(struct nvkm_gsp_client *, u32 handle);
	} *client;

	const struct nvkm_rm_api_device {
		int (*ctor)(struct nvkm_gsp_client *, struct nvkm_gsp_device *);
		void (*dtor)(struct nvkm_gsp_device *);

		struct {
			int (*ctor)(struct nvkm_gsp_device *, u32 handle, u32 id,
				    nvkm_gsp_event_func, struct nvkm_gsp_event *);
			void (*dtor)(struct nvkm_gsp_event *);
		} event;
	} *device;

	const struct nvkm_rm_api_fbsr {
		int (*suspend)(struct nvkm_gsp *, bool runtime);
		void (*resume)(struct nvkm_gsp *);
	} *fbsr;

	const struct nvkm_rm_api_disp {
		int (*get_static_info)(struct nvkm_disp *);
		int (*get_supported)(struct nvkm_disp *, unsigned long *display_mask);
		int (*get_connect_state)(struct nvkm_disp *, unsigned display_id);
		int (*get_active)(struct nvkm_disp *, unsigned head, u32 *display_id);

		int (*bl_ctrl)(struct nvkm_disp *, unsigned display_id, bool set, int *val);

		struct {
			int (*get_caps)(struct nvkm_disp *, int *link_bw, bool *mst, bool *wm);
			int (*set_indexed_link_rates)(struct nvkm_outp *);
		} dp;

		struct {
			int (*set_pushbuf)(struct nvkm_disp *, s32 oclass, int inst,
					   struct nvkm_memory *);
			int (*dmac_alloc)(struct nvkm_disp *, u32 oclass, int inst, u32 put_offset,

Annotation

Implementation Notes