drm/nouveau/ltc: init comptag mm in fb subdev
A single location for the MM allows us to share allocation logic. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
Родитель
b1e839f3b3
Коммит
6cd7670c1e
|
@ -14,7 +14,6 @@ struct nvkm_ltc {
|
|||
|
||||
u32 num_tags;
|
||||
u32 tag_base;
|
||||
struct nvkm_mm tags;
|
||||
struct nvkm_mm_node *tag_ram;
|
||||
|
||||
int zbc_min;
|
||||
|
|
|
@ -28,7 +28,8 @@
|
|||
int
|
||||
nvkm_ltc_tags_alloc(struct nvkm_ltc *ltc, u32 n, struct nvkm_mm_node **pnode)
|
||||
{
|
||||
int ret = nvkm_mm_head(<c->tags, 0, 1, n, n, 1, pnode);
|
||||
struct nvkm_fb *fb = ltc->subdev.device->fb;
|
||||
int ret = nvkm_mm_head(&fb->tags, 0, 1, n, n, 1, pnode);
|
||||
if (ret)
|
||||
*pnode = NULL;
|
||||
return ret;
|
||||
|
@ -37,7 +38,8 @@ nvkm_ltc_tags_alloc(struct nvkm_ltc *ltc, u32 n, struct nvkm_mm_node **pnode)
|
|||
void
|
||||
nvkm_ltc_tags_free(struct nvkm_ltc *ltc, struct nvkm_mm_node **pnode)
|
||||
{
|
||||
nvkm_mm_free(<c->tags, pnode);
|
||||
struct nvkm_fb *fb = ltc->subdev.device->fb;
|
||||
nvkm_mm_free(&fb->tags, pnode);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -118,7 +120,6 @@ nvkm_ltc_dtor(struct nvkm_subdev *subdev)
|
|||
{
|
||||
struct nvkm_ltc *ltc = nvkm_ltc(subdev);
|
||||
struct nvkm_ram *ram = ltc->subdev.device->fb->ram;
|
||||
nvkm_mm_fini(<c->tags);
|
||||
if (ram)
|
||||
nvkm_mm_free(&ram->vram, <c->tag_ram);
|
||||
return ltc;
|
||||
|
|
|
@ -152,7 +152,8 @@ gf100_ltc_flush(struct nvkm_ltc *ltc)
|
|||
int
|
||||
gf100_ltc_oneinit_tag_ram(struct nvkm_ltc *ltc)
|
||||
{
|
||||
struct nvkm_ram *ram = ltc->subdev.device->fb->ram;
|
||||
struct nvkm_fb *fb = ltc->subdev.device->fb;
|
||||
struct nvkm_ram *ram = fb->ram;
|
||||
u32 tag_size, tag_margin, tag_align;
|
||||
int ret;
|
||||
|
||||
|
@ -197,7 +198,8 @@ gf100_ltc_oneinit_tag_ram(struct nvkm_ltc *ltc)
|
|||
}
|
||||
|
||||
mm_init:
|
||||
return nvkm_mm_init(<c->tags, 0, 0, ltc->num_tags, 1);
|
||||
nvkm_mm_fini(&fb->tags);
|
||||
return nvkm_mm_init(&fb->tags, 0, 0, ltc->num_tags, 1);
|
||||
}
|
||||
|
||||
int
|
||||
|
|
|
@ -45,7 +45,7 @@ gp100_ltc_oneinit(struct nvkm_ltc *ltc)
|
|||
ltc->ltc_nr = nvkm_rd32(device, 0x12006c);
|
||||
ltc->lts_nr = nvkm_rd32(device, 0x17e280) >> 28;
|
||||
/*XXX: tagram allocation - TBD */
|
||||
return nvkm_mm_init(<c->tags, 0, 0, 0, 1);
|
||||
return 0;
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
Загрузка…
Ссылка в новой задаче