diff options
author | Ben Skeggs <bskeggs@redhat.com> | 2012-11-22 13:27:37 +1000 |
---|---|---|
committer | Ben Skeggs <bskeggs@redhat.com> | 2012-11-29 09:58:04 +1000 |
commit | 43598875b35fdd3f699954078b7df24b5647a27a (patch) | |
tree | c069b8e45c0162807cfac11bd11b663d245e108d /drivers/gpu/drm/nouveau/core/engine/copy | |
parent | e5e454f918051e4ff4be98777ee25437d48c3a1e (diff) | |
download | op-kernel-dev-43598875b35fdd3f699954078b7df24b5647a27a.zip op-kernel-dev-43598875b35fdd3f699954078b7df24b5647a27a.tar.gz |
drm/nouveau/core: implement shortcut for simple engctx construction
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/engine/copy')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/copy/nva3.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/copy/nve0.c | 24 |
3 files changed, 3 insertions, 69 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nva3.c b/drivers/gpu/drm/nouveau/core/engine/copy/nva3.c index f849b69..283248c 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nva3.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nva3.c @@ -38,10 +38,6 @@ struct nva3_copy_priv { struct nouveau_falcon base; }; -struct nva3_copy_chan { - struct nouveau_falcon_chan base; -}; - /******************************************************************************* * Copy object classes ******************************************************************************/ @@ -56,29 +52,11 @@ nva3_copy_sclass[] = { * PCOPY context ******************************************************************************/ -static int -nva3_copy_context_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nva3_copy_chan *priv; - int ret; - - ret = nouveau_falcon_context_create(parent, engine, oclass, NULL, 256, - 0, NVOBJ_FLAG_ZERO_ALLOC, &priv); - *pobject = nv_object(priv); - if (ret) - return ret; - - return 0; -} - static struct nouveau_oclass nva3_copy_cclass = { .handle = NV_ENGCTX(COPY0, 0xa3), .ofuncs = &(struct nouveau_ofuncs) { - .ctor = nva3_copy_context_ctor, + .ctor = _nouveau_falcon_context_ctor, .dtor = _nouveau_falcon_context_dtor, .init = _nouveau_falcon_context_init, .fini = _nouveau_falcon_context_fini, diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c b/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c index ffd9bb8..b3ed273 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nvc0.c @@ -35,10 +35,6 @@ struct nvc0_copy_priv { struct nouveau_falcon base; }; -struct nvc0_copy_chan { - struct nouveau_falcon_chan base; -}; - /******************************************************************************* * Copy object classes ******************************************************************************/ @@ -59,27 +55,9 @@ nvc0_copy1_sclass[] = { * PCOPY context ******************************************************************************/ -static int -nvc0_copy_context_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nvc0_copy_chan *priv; - int ret; - - ret = nouveau_falcon_context_create(parent, engine, oclass, NULL, 256, - 256, NVOBJ_FLAG_ZERO_ALLOC, &priv); - *pobject = nv_object(priv); - if (ret) - return ret; - - return 0; -} - static struct nouveau_ofuncs nvc0_copy_context_ofuncs = { - .ctor = nvc0_copy_context_ctor, + .ctor = _nouveau_falcon_context_ctor, .dtor = _nouveau_falcon_context_dtor, .init = _nouveau_falcon_context_init, .fini = _nouveau_falcon_context_fini, diff --git a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c index 889f1f07..dbbe9e8 100644 --- a/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c +++ b/drivers/gpu/drm/nouveau/core/engine/copy/nve0.c @@ -33,10 +33,6 @@ struct nve0_copy_priv { struct nouveau_engine base; }; -struct nve0_copy_chan { - struct nouveau_engctx base; -}; - /******************************************************************************* * Copy object classes ******************************************************************************/ @@ -51,27 +47,9 @@ nve0_copy_sclass[] = { * PCOPY context ******************************************************************************/ -static int -nve0_copy_context_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nve0_copy_chan *priv; - int ret; - - ret = nouveau_engctx_create(parent, engine, oclass, NULL, 256, - 256, NVOBJ_FLAG_ZERO_ALLOC, &priv); - *pobject = nv_object(priv); - if (ret) - return ret; - - return 0; -} - static struct nouveau_ofuncs nve0_copy_context_ofuncs = { - .ctor = nve0_copy_context_ctor, + .ctor = _nouveau_engctx_ctor, .dtor = _nouveau_engctx_dtor, .init = _nouveau_engctx_init, .fini = _nouveau_engctx_fini, |