aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nv84_crypt.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2011-03-31 13:44:16 +1000
committerBen Skeggs <bskeggs@redhat.com>2011-05-16 10:47:52 +1000
commit4ea52f8974392b39ffb192fd31de80dc65b52657 (patch)
tree594e2a1cc6649768ee23bcb9958b091f8c0ea0c3 /drivers/gpu/drm/nouveau/nv84_crypt.c
parent475feffabe7d42d3333bf9a17167f38f3c467d11 (diff)
downloadkernel_samsung_smdk4412-4ea52f8974392b39ffb192fd31de80dc65b52657.zip
kernel_samsung_smdk4412-4ea52f8974392b39ffb192fd31de80dc65b52657.tar.gz
kernel_samsung_smdk4412-4ea52f8974392b39ffb192fd31de80dc65b52657.tar.bz2
drm/nouveau: move engine object creation into per-engine hooks
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nv84_crypt.c')
-rw-r--r--drivers/gpu/drm/nouveau/nv84_crypt.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv84_crypt.c b/drivers/gpu/drm/nouveau/nv84_crypt.c
index fabc7fd..4918f4e 100644
--- a/drivers/gpu/drm/nouveau/nv84_crypt.c
+++ b/drivers/gpu/drm/nouveau/nv84_crypt.c
@@ -26,6 +26,7 @@
#include "nouveau_drv.h"
#include "nouveau_util.h"
#include "nouveau_vm.h"
+#include "nouveau_ramht.h"
static void nv84_crypt_isr(struct drm_device *);
@@ -84,6 +85,28 @@ nv84_crypt_destroy_context(struct nouveau_channel *chan)
atomic_dec(&chan->vm->pcrypt_refs);
}
+int
+nv84_crypt_object_new(struct nouveau_channel *chan, u32 handle, u16 class)
+{
+ struct drm_device *dev = chan->dev;
+ struct drm_nouveau_private *dev_priv = dev->dev_private;
+ struct nouveau_gpuobj *obj = NULL;
+ int ret;
+
+ ret = nouveau_gpuobj_new(dev, chan, 16, 16, NVOBJ_FLAG_ZERO_FREE, &obj);
+ if (ret)
+ return ret;
+ obj->engine = 5;
+ obj->class = class;
+
+ nv_wo32(obj, 0x00, class);
+ dev_priv->engine.instmem.flush(dev);
+
+ ret = nouveau_ramht_insert(chan, handle, obj);
+ nouveau_gpuobj_ref(NULL, &obj);
+ return ret;
+}
+
void
nv84_crypt_tlb_flush(struct drm_device *dev)
{