Commit 834a712b authored by Ben Skeggs's avatar Ben Skeggs Committed by Dave Airlie
Browse files

drm/nouveau/fb/tu102-: prepare for GSP-RM



- add (initial) R535 implementation of FB, need VRAM size etc for boot
- expose a way to "wrap" vram at a specific address/size as a standard
  nvkm_memory allocation, which will be used to write PTEs etc for RM-
  defined memory regions

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20230918202149.4343-11-skeggsb@gmail.com
parent a613e7f3
Loading
Loading
Loading
Loading
+3 −3
Original line number Diff line number Diff line
@@ -158,8 +158,8 @@ struct nvkm_ram {
	struct nvkm_ram_data target;
};

int
nvkm_ram_get(struct nvkm_device *, u8 heap, u8 type, u8 page, u64 size,
int nvkm_ram_wrap(struct nvkm_device *, u64 addr, u64 size, struct nvkm_memory **);
int nvkm_ram_get(struct nvkm_device *, u8 heap, u8 type, u8 page, u64 size,
		 bool contig, bool back, struct nvkm_memory **);

struct nvkm_ram_func {
+2 −0
Original line number Diff line number Diff line
@@ -36,6 +36,8 @@ nvkm-y += nvkm/subdev/fb/tu102.o
nvkm-y += nvkm/subdev/fb/ga100.o
nvkm-y += nvkm/subdev/fb/ga102.o

nvkm-y += nvkm/subdev/fb/r535.o

nvkm-y += nvkm/subdev/fb/ram.o
nvkm-y += nvkm/subdev/fb/ramnv04.o
nvkm-y += nvkm/subdev/fb/ramnv10.o
+5 −0
Original line number Diff line number Diff line
@@ -22,6 +22,8 @@
#include "gf100.h"
#include "ram.h"

#include <subdev/gsp.h>

static const struct nvkm_fb_func
ga100_fb = {
	.dtor = gf100_fb_dtor,
@@ -38,5 +40,8 @@ ga100_fb = {
int
ga100_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{
	if (nvkm_gsp_rm(device->gsp))
		return r535_fb_new(&ga100_fb, device, type, inst, pfb);

	return gf100_fb_new_(&ga100_fb, device, type, inst, pfb);
}
+4 −0
Original line number Diff line number Diff line
@@ -22,6 +22,7 @@
#include "gf100.h"
#include "ram.h"

#include <subdev/gsp.h>
#include <engine/nvdec.h>

static u64
@@ -59,6 +60,9 @@ ga102_fb = {
int
ga102_fb_new(struct nvkm_device *device, enum nvkm_subdev_type type, int inst, struct nvkm_fb **pfb)
{
	if (nvkm_gsp_rm(device->gsp))
		return r535_fb_new(&ga102_fb, device, type, inst, pfb);

	return gf100_fb_new_(&ga102_fb, device, type, inst, pfb);
}

+3 −0
Original line number Diff line number Diff line
@@ -6,6 +6,9 @@
#include <subdev/therm.h>
struct nvkm_bios;

int r535_fb_new(const struct nvkm_fb_func *,
		struct nvkm_device *, enum nvkm_subdev_type, int inst, struct nvkm_fb **);

struct nvkm_fb_func {
	void *(*dtor)(struct nvkm_fb *);
	u32 (*tags)(struct nvkm_fb *);
Loading