Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit af793b8c authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/fb: move comptag init out of ram submodule



Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 7ef44bee
Loading
Loading
Loading
Loading
+11 −1
Original line number Diff line number Diff line
@@ -100,6 +100,7 @@ static int
nvkm_fb_oneinit(struct nvkm_subdev *subdev)
{
	struct nvkm_fb *fb = nvkm_fb(subdev);
	u32 tags = 0;

	if (fb->func->ram_new) {
		int ret = fb->func->ram_new(fb, &fb->ram);
@@ -115,7 +116,16 @@ nvkm_fb_oneinit(struct nvkm_subdev *subdev)
			return ret;
	}

	return 0;
	/* Initialise compression tag allocator.
	 *
	 * LTC oneinit() will override this on Fermi and newer.
	 */
	if (fb->func->tags) {
		tags = fb->func->tags(fb);
		nvkm_debug(subdev, "%d comptags\n", tags);
	}

	return nvkm_mm_init(&fb->tags, 0, 0, tags, 1);
}

static int
+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
static const struct nv50_fb_func
g84_fb = {
	.ram_new = nv50_ram_new,
	.tags = nv20_fb_tags,
	.trap = 0x001d07ff,
};

+1 −0
Original line number Diff line number Diff line
@@ -27,6 +27,7 @@
static const struct nv50_fb_func
gt215_fb = {
	.ram_new = gt215_ram_new,
	.tags = nv20_fb_tags,
	.trap = 0x000d0fff,
};

+8 −0
Original line number Diff line number Diff line
@@ -77,8 +77,16 @@ nv20_fb_tile_prog(struct nvkm_fb *fb, int i, struct nvkm_fb_tile *tile)
	nvkm_wr32(device, 0x100300 + (i * 0x04), tile->zcomp);
}

u32
nv20_fb_tags(struct nvkm_fb *fb)
{
	const u32 tags = nvkm_rd32(fb->subdev.device, 0x100320);
	return tags ? tags + 1 : 0;
}

static const struct nvkm_fb_func
nv20_fb = {
	.tags = nv20_fb_tags,
	.tile.regions = 8,
	.tile.init = nv20_fb_tile_init,
	.tile.comp = nv20_fb_tile_comp,
+1 −0
Original line number Diff line number Diff line
@@ -44,6 +44,7 @@ nv25_fb_tile_comp(struct nvkm_fb *fb, int i, u32 size, u32 flags,

static const struct nvkm_fb_func
nv25_fb = {
	.tags = nv20_fb_tags,
	.tile.regions = 8,
	.tile.init = nv20_fb_tile_init,
	.tile.comp = nv25_fb_tile_comp,
Loading