drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv49.c

Source file repositories/reference/linux-study-clean/drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv49.c

File Facts

System
Linux kernel
Corpus path
drivers/gpu/drm/nouveau/nvkm/subdev/fb/ramnv49.c
Extension
.c
Size
1803 bytes
Lines
49
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

#include "ramnv40.h"

int
nv49_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
{
	struct nvkm_device *device = fb->subdev.device;
	u32  size = nvkm_rd32(device, 0x10020c) & 0xff000000;
	u32 fb914 = nvkm_rd32(device, 0x100914);
	enum nvkm_ram_type type = NVKM_RAM_TYPE_UNKNOWN;
	int ret;

	switch (fb914 & 0x00000003) {
	case 0x00000000: type = NVKM_RAM_TYPE_DDR1 ; break;
	case 0x00000001: type = NVKM_RAM_TYPE_DDR2 ; break;
	case 0x00000002: type = NVKM_RAM_TYPE_GDDR3; break;
	case 0x00000003: break;
	}

	ret = nv40_ram_new_(fb, type, size, pram);
	if (ret)
		return ret;

	(*pram)->parts = (nvkm_rd32(device, 0x100200) & 0x00000003) + 1;
	return 0;
}

Annotation

Implementation Notes