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/crypt | |
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/crypt')
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/crypt/nv84.c | 24 | ||||
-rw-r--r-- | drivers/gpu/drm/nouveau/core/engine/crypt/nv98.c | 24 |
2 files changed, 2 insertions, 46 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/crypt/nv84.c b/drivers/gpu/drm/nouveau/core/engine/crypt/nv84.c index 2e04b96..b974905 100644 --- a/drivers/gpu/drm/nouveau/core/engine/crypt/nv84.c +++ b/drivers/gpu/drm/nouveau/core/engine/crypt/nv84.c @@ -37,10 +37,6 @@ struct nv84_crypt_priv { struct nouveau_engine base; }; -struct nv84_crypt_chan { - struct nouveau_engctx base; -}; - /******************************************************************************* * Crypt object classes ******************************************************************************/ @@ -87,29 +83,11 @@ nv84_crypt_sclass[] = { * PCRYPT context ******************************************************************************/ -static int -nv84_crypt_context_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nv84_crypt_chan *priv; - int ret; - - ret = nouveau_engctx_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 nv84_crypt_cclass = { .handle = NV_ENGCTX(CRYPT, 0x84), .ofuncs = &(struct nouveau_ofuncs) { - .ctor = nv84_crypt_context_ctor, + .ctor = _nouveau_engctx_ctor, .dtor = _nouveau_engctx_dtor, .init = _nouveau_engctx_init, .fini = _nouveau_engctx_fini, diff --git a/drivers/gpu/drm/nouveau/core/engine/crypt/nv98.c b/drivers/gpu/drm/nouveau/core/engine/crypt/nv98.c index e7f6bb6..21986f3 100644 --- a/drivers/gpu/drm/nouveau/core/engine/crypt/nv98.c +++ b/drivers/gpu/drm/nouveau/core/engine/crypt/nv98.c @@ -40,10 +40,6 @@ struct nv98_crypt_priv { struct nouveau_falcon base; }; -struct nv98_crypt_chan { - struct nouveau_falcon_chan base; -}; - /******************************************************************************* * Crypt object classes ******************************************************************************/ @@ -58,29 +54,11 @@ nv98_crypt_sclass[] = { * PCRYPT context ******************************************************************************/ -static int -nv98_crypt_context_ctor(struct nouveau_object *parent, - struct nouveau_object *engine, - struct nouveau_oclass *oclass, void *data, u32 size, - struct nouveau_object **pobject) -{ - struct nv98_crypt_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_oclass nv98_crypt_cclass = { .handle = NV_ENGCTX(CRYPT, 0x98), .ofuncs = &(struct nouveau_ofuncs) { - .ctor = nv98_crypt_context_ctor, + .ctor = _nouveau_falcon_context_ctor, .dtor = _nouveau_falcon_context_dtor, .init = _nouveau_falcon_context_init, .fini = _nouveau_falcon_context_fini, |