drivers/gpu/drm/nouveau/nouveau_drv.h

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nouveau_drv.h

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nouveau_drv.h
Extension
.h
Size
10081 bytes
Lines
408
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 nouveau_drm_tile {
	struct nouveau_fence *fence;
	bool used;
};

enum nouveau_drm_object_route {
	NVDRM_OBJECT_NVIF = NVIF_IOCTL_V0_OWNER_NVIF,
	NVDRM_OBJECT_USIF,
	NVDRM_OBJECT_ABI16,
	NVDRM_OBJECT_ANY = NVIF_IOCTL_V0_OWNER_ANY,
};

enum nouveau_drm_handle {
	NVDRM_CHAN    = 0xcccc0000, /* |= client chid */
	NVDRM_NVSW    = 0x55550000,
};

struct nouveau_cli {
	struct nvif_client base;
	struct nouveau_drm *drm;
	struct mutex mutex;

	struct nvif_device device;
	struct nvif_mmu mmu;
	struct nouveau_vmm vmm;
	struct nouveau_vmm svm;
	struct {
		struct nouveau_uvmm *ptr;
		bool disabled;
	} uvmm;

	struct nouveau_sched *sched;

	const struct nvif_mclass *mem;

	struct list_head head;
	void *abi16;
	struct list_head objects;
	char name[32];

	struct work_struct work;
	struct list_head worker;
	struct mutex lock;
};

struct nouveau_cli_work {
	void (*func)(struct nouveau_cli_work *);
	struct nouveau_cli *cli;
	struct list_head head;

	struct dma_fence *fence;
	struct dma_fence_cb cb;
};

static inline struct nouveau_uvmm *
nouveau_cli_uvmm(struct nouveau_cli *cli)
{
	return cli ? cli->uvmm.ptr : NULL;
}

static inline struct nouveau_uvmm *
nouveau_cli_uvmm_locked(struct nouveau_cli *cli)
{
	struct nouveau_uvmm *uvmm;

	mutex_lock(&cli->mutex);
	uvmm = nouveau_cli_uvmm(cli);
	mutex_unlock(&cli->mutex);

	return uvmm;
}

static inline struct nouveau_vmm *
nouveau_cli_vmm(struct nouveau_cli *cli)
{
	struct nouveau_uvmm *uvmm;

	uvmm = nouveau_cli_uvmm(cli);
	if (uvmm)
		return &uvmm->vmm;

	if (cli->svm.cli)
		return &cli->svm;

	return &cli->vmm;
}

static inline void
__nouveau_cli_disable_uvmm_noinit(struct nouveau_cli *cli)
{

Annotation

Implementation Notes