diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c index cd5e9cdca1cf..44021d1395d3 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gv100.c @@ -21,11 +21,35 @@ */ #include "priv.h" +#include <core/gpuobj.h> +#include <core/object.h> + #include <nvif/class.h> +static int +gv100_ce_cclass_bind(struct nvkm_object *object, struct nvkm_gpuobj *parent, int align, + struct nvkm_gpuobj **pgpuobj) +{ + struct nvkm_device *device = object->engine->subdev.device; + u32 size; + + /* Allocate fault method buffer (magics come from nvgpu). */ + size = nvkm_rd32(device, 0x104028); /* NV_PCE_PCE_MAP */ + size = 27 * 5 * (((9 + 1 + 3) * hweight32(size)) + 2); + size = roundup(size, PAGE_SIZE); + + return nvkm_gpuobj_new(device, size, align, true, parent, pgpuobj); +} + +const struct nvkm_object_func +gv100_ce_cclass = { + .bind = gv100_ce_cclass_bind, +}; + static const struct nvkm_engine_func gv100_ce = { .intr = gp100_ce_intr, + .cclass = &gv100_ce_cclass, .sclass = { { -1, -1, VOLTA_DMA_COPY_A }, {} |