diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2015-08-20 14:54:19 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2015-08-28 12:40:40 +1000 |
commit | 9d498e0f7a5ece8f61c8a174b40668a2621a82e3 (patch) | |
tree | b4ede5e2fb34147754dcba948f74014972aaeaa0 /drivers/gpu/drm/nouveau/nvkm/engine/ce | |
parent | 8f0649b5c6e70ec18122255690e39f010c12a614 (diff) | |
download | talos-obmc-linux-9d498e0f7a5ece8f61c8a174b40668a2621a82e3.tar.gz talos-obmc-linux-9d498e0f7a5ece8f61c8a174b40668a2621a82e3.zip |
drm/nouveau/falcon: convert user classes to new-style nvkm_object
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/ce')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c | 69 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c | 38 |
2 files changed, 22 insertions, 85 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c index 6faf38e3dbbc..3abab3992e7c 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gf100.c @@ -25,51 +25,7 @@ #include <engine/falcon.h> #include "fuc/gf100.fuc3.h" -/******************************************************************************* - * Copy object classes - ******************************************************************************/ - -static struct nvkm_oclass -gf100_ce0_sclass[] = { - { 0x90b5, &nvkm_object_ofuncs }, - {}, -}; - -static struct nvkm_oclass -gf100_ce1_sclass[] = { - { 0x90b8, &nvkm_object_ofuncs }, - {}, -}; - -/******************************************************************************* - * PCE context - ******************************************************************************/ - -static struct nvkm_ofuncs -gf100_ce_context_ofuncs = { - .ctor = _nvkm_falcon_context_ctor, - .dtor = _nvkm_falcon_context_dtor, - .init = _nvkm_falcon_context_init, - .fini = _nvkm_falcon_context_fini, - .rd32 = _nvkm_falcon_context_rd32, - .wr32 = _nvkm_falcon_context_wr32, -}; - -static struct nvkm_oclass -gf100_ce0_cclass = { - .handle = NV_ENGCTX(CE0, 0xc0), - .ofuncs = &gf100_ce_context_ofuncs, -}; - -static struct nvkm_oclass -gf100_ce1_cclass = { - .handle = NV_ENGCTX(CE1, 0xc0), - .ofuncs = &gf100_ce_context_ofuncs, -}; - -/******************************************************************************* - * PCE engine/subdev functions - ******************************************************************************/ +#include <nvif/class.h> static int gf100_ce_init(struct nvkm_object *object) @@ -89,8 +45,12 @@ gf100_ce_init(struct nvkm_object *object) } static const struct nvkm_falcon_func -gf100_ce_func = { +gf100_ce0_func = { .intr = gt215_ce_intr, + .sclass = { + { -1, -1, FERMI_DMA }, + {} + } }; static int @@ -101,15 +61,13 @@ gf100_ce0_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_falcon *ce; int ret; - ret = nvkm_falcon_create(&gf100_ce_func, parent, engine, oclass, + ret = nvkm_falcon_create(&gf100_ce0_func, parent, engine, oclass, 0x104000, true, "PCE0", "ce0", &ce); *pobject = nv_object(ce); if (ret) return ret; nv_subdev(ce)->unit = 0x00000040; - nv_engine(ce)->cclass = &gf100_ce0_cclass; - nv_engine(ce)->sclass = gf100_ce0_sclass; nv_falcon(ce)->code.data = gf100_ce_code; nv_falcon(ce)->code.size = sizeof(gf100_ce_code); nv_falcon(ce)->data.data = gf100_ce_data; @@ -117,6 +75,15 @@ gf100_ce0_ctor(struct nvkm_object *parent, struct nvkm_object *engine, return 0; } +static const struct nvkm_falcon_func +gf100_ce1_func = { + .intr = gt215_ce_intr, + .sclass = { + { -1, -1, FERMI_DECOMPRESS }, + {} + } +}; + static int gf100_ce1_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, @@ -125,15 +92,13 @@ gf100_ce1_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_falcon *ce; int ret; - ret = nvkm_falcon_create(&gf100_ce_func, parent, engine, oclass, + ret = nvkm_falcon_create(&gf100_ce1_func, parent, engine, oclass, 0x105000, true, "PCE1", "ce1", &ce); *pobject = nv_object(ce); if (ret) return ret; nv_subdev(ce)->unit = 0x00000080; - nv_engine(ce)->cclass = &gf100_ce1_cclass; - nv_engine(ce)->sclass = gf100_ce1_sclass; nv_falcon(ce)->code.data = gf100_ce_code; nv_falcon(ce)->code.size = sizeof(gf100_ce_code); nv_falcon(ce)->data.data = gf100_ce_data; diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c index 1a15b8d6fece..35e4d578b153 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/ce/gt215.c @@ -28,37 +28,7 @@ #include <core/client.h> #include <core/enum.h> -/******************************************************************************* - * Copy object classes - ******************************************************************************/ - -static struct nvkm_oclass -gt215_ce_sclass[] = { - { 0x85b5, &nvkm_object_ofuncs }, - {} -}; - -/******************************************************************************* - * PCE context - ******************************************************************************/ - -static struct nvkm_oclass -gt215_ce_cclass = { - .handle = NV_ENGCTX(CE0, 0xa3), - .ofuncs = &(struct nvkm_ofuncs) { - .ctor = _nvkm_falcon_context_ctor, - .dtor = _nvkm_falcon_context_dtor, - .init = _nvkm_falcon_context_init, - .fini = _nvkm_falcon_context_fini, - .rd32 = _nvkm_falcon_context_rd32, - .wr32 = _nvkm_falcon_context_wr32, - - }, -}; - -/******************************************************************************* - * PCE engine/subdev functions - ******************************************************************************/ +#include <nvif/class.h> static const struct nvkm_enum gt215_ce_isr_error_name[] = { @@ -93,6 +63,10 @@ gt215_ce_intr(struct nvkm_falcon *ce, struct nvkm_fifo_chan *chan) static const struct nvkm_falcon_func gt215_ce_func = { .intr = gt215_ce_intr, + .sclass = { + { -1, -1, GT212_DMA }, + {} + } }; static int @@ -111,8 +85,6 @@ gt215_ce_ctor(struct nvkm_object *parent, struct nvkm_object *engine, return ret; nv_subdev(ce)->unit = 0x00802000; - nv_engine(ce)->cclass = >215_ce_cclass; - nv_engine(ce)->sclass = gt215_ce_sclass; nv_falcon(ce)->code.data = gt215_ce_code; nv_falcon(ce)->code.size = sizeof(gt215_ce_code); nv_falcon(ce)->data.data = gt215_ce_data; |