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

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

File Facts

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

// SPDX-License-Identifier: MIT
#include "ram.h"

#include <subdev/bios.h>

static const struct nvkm_ram_func
gp102_ram = {
	.init = gp100_ram_init,
};

int
gp102_ram_new(struct nvkm_fb *fb, struct nvkm_ram **pram)
{
	enum nvkm_ram_type type = nvkm_fb_bios_memtype(fb->subdev.device->bios);
	const u32 rsvd_head = ( 256 * 1024); /* vga memory */
	const u32 rsvd_tail = (1024 * 1024); /* vbios etc */
	u64 size = fb->func->vidmem.size(fb);
	int ret;

	ret = nvkm_ram_new_(&gp102_ram, fb, type, size, pram);
	if (ret)
		return ret;

	nvkm_mm_fini(&(*pram)->vram);

	return nvkm_mm_init(&(*pram)->vram, NVKM_RAM_MM_NORMAL,
			    rsvd_head >> NVKM_RAM_MM_SHIFT,
			    (size - rsvd_head - rsvd_tail) >> NVKM_RAM_MM_SHIFT,
			    1);

}

Annotation

Implementation Notes