drm/nouveau/imem/nv04: directly embed nvkm_instobj into nv04_instobj
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
This commit is contained in:
parent
49814f62a2
commit
87717e7f28
|
@ -24,7 +24,6 @@
|
||||||
#define nv04_instmem(p) container_of((p), struct nv04_instmem, base)
|
#define nv04_instmem(p) container_of((p), struct nv04_instmem, base)
|
||||||
#include "priv.h"
|
#include "priv.h"
|
||||||
|
|
||||||
#include <core/memory.h>
|
|
||||||
#include <core/ramht.h>
|
#include <core/ramht.h>
|
||||||
|
|
||||||
struct nv04_instmem {
|
struct nv04_instmem {
|
||||||
|
@ -35,10 +34,10 @@ struct nv04_instmem {
|
||||||
/******************************************************************************
|
/******************************************************************************
|
||||||
* instmem object implementation
|
* instmem object implementation
|
||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
#define nv04_instobj(p) container_of((p), struct nv04_instobj, memory)
|
#define nv04_instobj(p) container_of((p), struct nv04_instobj, base.memory)
|
||||||
|
|
||||||
struct nv04_instobj {
|
struct nv04_instobj {
|
||||||
struct nvkm_memory memory;
|
struct nvkm_instobj base;
|
||||||
struct nv04_instmem *imem;
|
struct nv04_instmem *imem;
|
||||||
struct nvkm_mm_node *node;
|
struct nvkm_mm_node *node;
|
||||||
};
|
};
|
||||||
|
@ -103,6 +102,7 @@ nv04_instobj_dtor(struct nvkm_memory *memory)
|
||||||
mutex_lock(&iobj->imem->base.subdev.mutex);
|
mutex_lock(&iobj->imem->base.subdev.mutex);
|
||||||
nvkm_mm_free(&iobj->imem->heap, &iobj->node);
|
nvkm_mm_free(&iobj->imem->heap, &iobj->node);
|
||||||
mutex_unlock(&iobj->imem->base.subdev.mutex);
|
mutex_unlock(&iobj->imem->base.subdev.mutex);
|
||||||
|
nvkm_instobj_dtor(&iobj->imem->base, &iobj->base);
|
||||||
return iobj;
|
return iobj;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -126,10 +126,10 @@ nv04_instobj_new(struct nvkm_instmem *base, u32 size, u32 align, bool zero,
|
||||||
|
|
||||||
if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL)))
|
if (!(iobj = kzalloc(sizeof(*iobj), GFP_KERNEL)))
|
||||||
return -ENOMEM;
|
return -ENOMEM;
|
||||||
*pmemory = &iobj->memory;
|
*pmemory = &iobj->base.memory;
|
||||||
|
|
||||||
nvkm_memory_ctor(&nv04_instobj_func, &iobj->memory);
|
nvkm_instobj_ctor(&nv04_instobj_func, &imem->base, &iobj->base);
|
||||||
iobj->memory.ptrs = &nv04_instobj_ptrs;
|
iobj->base.memory.ptrs = &nv04_instobj_ptrs;
|
||||||
iobj->imem = imem;
|
iobj->imem = imem;
|
||||||
|
|
||||||
mutex_lock(&imem->base.subdev.mutex);
|
mutex_lock(&imem->base.subdev.mutex);
|
||||||
|
@ -214,7 +214,7 @@ nv04_instmem = {
|
||||||
.rd32 = nv04_instmem_rd32,
|
.rd32 = nv04_instmem_rd32,
|
||||||
.wr32 = nv04_instmem_wr32,
|
.wr32 = nv04_instmem_wr32,
|
||||||
.memory_new = nv04_instobj_new,
|
.memory_new = nv04_instobj_new,
|
||||||
.persistent = false,
|
.persistent = true,
|
||||||
.zero = false,
|
.zero = false,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue