Commit 7f507624 authored by Ben Skeggs's avatar Ben Skeggs

drm/nouveau: determine memory class for each client

Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent 832ca2ac
...@@ -127,6 +127,13 @@ static int ...@@ -127,6 +127,13 @@ static int
nouveau_cli_init(struct nouveau_drm *drm, const char *sname, nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
struct nouveau_cli *cli) struct nouveau_cli *cli)
{ {
static const struct nvif_mclass
mems[] = {
{ NVIF_CLASS_MEM_GF100, -1 },
{ NVIF_CLASS_MEM_NV50 , -1 },
{ NVIF_CLASS_MEM_NV04 , -1 },
{}
};
static const struct nvif_mclass static const struct nvif_mclass
mmus[] = { mmus[] = {
{ NVIF_CLASS_MMU_GF100, -1 }, { NVIF_CLASS_MMU_GF100, -1 },
...@@ -201,11 +208,20 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname, ...@@ -201,11 +208,20 @@ nouveau_cli_init(struct nouveau_drm *drm, const char *sname,
goto done; goto done;
} }
ret = nvif_mclass(&cli->mmu.object, mems);
if (ret < 0) {
NV_ERROR(drm, "No supported MEM class\n");
goto done;
}
cli->mem = &mems[ret];
if (1) { if (1) {
cli->vm = cli->vmm.vm; cli->vm = cli->vmm.vm;
nvxx_client(&cli->base)->vm = cli->vm; nvxx_client(&cli->base)->vm = cli->vm;
} }
return 0;
done: done:
if (ret) if (ret)
nouveau_cli_fini(cli); nouveau_cli_fini(cli);
......
...@@ -95,6 +95,7 @@ struct nouveau_cli { ...@@ -95,6 +95,7 @@ struct nouveau_cli {
struct nvif_device device; struct nvif_device device;
struct nvif_mmu mmu; struct nvif_mmu mmu;
struct nouveau_vmm vmm; struct nouveau_vmm vmm;
const struct nvif_mclass *mem;
struct nvkm_vm *vm; struct nvkm_vm *vm;
struct list_head head; struct list_head head;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment