summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nv84_crypt.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-11-03 03:06:43 +0300
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 08:11:30 +0300
commitd7facf9dc50acff69de9688088caa78b3cf69ebb (patch)
treec2ca30472f0ab46daa367ec798dd0dffe43fb6a1 /drivers/gpu/drm/nouveau/nv84_crypt.c
parent8f8a54482b008714ccfad15f4592b3802b80d479 (diff)
downloadlinux-d7facf9dc50acff69de9688088caa78b3cf69ebb.tar.xz
drm/nv84: move PCRYPT ISR out of nouveau_irq.c
Reviewed-by: Francisco Jerez <currojerez@riseup.net> 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.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nv84_crypt.c b/drivers/gpu/drm/nouveau/nv84_crypt.c
index f988b1a9d1d7..1cda0240f55d 100644
--- a/drivers/gpu/drm/nouveau/nv84_crypt.c
+++ b/drivers/gpu/drm/nouveau/nv84_crypt.c
@@ -24,6 +24,9 @@
#include "drmP.h"
#include "nouveau_drv.h"
+#include "nouveau_util.h"
+
+static void nv84_crypt_isr(struct drm_device *);
int
nv84_crypt_create_context(struct nouveau_channel *chan)
@@ -97,8 +100,11 @@ nv84_crypt_init(struct drm_device *dev)
nv_mask(dev, 0x000200, 0x00004000, 0x00000000);
nv_mask(dev, 0x000200, 0x00004000, 0x00004000);
+
+ nouveau_irq_register(dev, 14, nv84_crypt_isr);
nv_wr32(dev, 0x102130, 0xffffffff);
nv_wr32(dev, 0x102140, 0xffffffbf);
+
nv_wr32(dev, 0x10200c, 0x00000010);
return 0;
}
@@ -107,4 +113,25 @@ void
nv84_crypt_fini(struct drm_device *dev)
{
nv_wr32(dev, 0x102140, 0x00000000);
+ nouveau_irq_unregister(dev, 14);
+}
+
+static void
+nv84_crypt_isr(struct drm_device *dev)
+{
+ u32 stat = nv_rd32(dev, 0x102130);
+ u32 mthd = nv_rd32(dev, 0x102190);
+ u32 data = nv_rd32(dev, 0x102194);
+ u32 inst = nv_rd32(dev, 0x102188) & 0x7fffffff;
+ int show = nouveau_ratelimit();
+
+ if (show) {
+ NV_INFO(dev, "PCRYPT_INTR: 0x%08x 0x%08x 0x%08x 0x%08x\n",
+ stat, mthd, data, inst);
+ }
+
+ nv_wr32(dev, 0x102130, stat);
+ nv_wr32(dev, 0x10200c, 0x10);
+
+ nv50_fb_vm_trap(dev, show, "PCRYPT");
}