Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 269627
b: refs/heads/master
c: 4600522
h: refs/heads/master
i:
  269625: f2806e6
  269623: 922ffd3
v: v3
  • Loading branch information
Ben Skeggs committed Sep 20, 2011
1 parent 0ecbd7f commit bbc4097
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 51beb428e4e0a158a47863cb68069ba57ed6ec7d
refs/heads/master: 4600522a8f93dda05e5fa8bd5261e6c6e888dafa
42 changes: 42 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nvd0_display.c
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,44 @@ evo_kick(u32 *push, struct drm_device *dev, int id)
/******************************************************************************
* IRQ
*****************************************************************************/
static void
nvd0_display_intr(struct drm_device *dev)
{
u32 intr = nv_rd32(dev, 0x610088);

if (intr & 0x00000002) {
u32 stat = nv_rd32(dev, 0x61009c);
int chid = ffs(stat) - 1;
if (chid >= 0) {
u32 mthd = nv_rd32(dev, 0x6101f0 + (chid * 12));
u32 data = nv_rd32(dev, 0x6101f4 + (chid * 12));
u32 unkn = nv_rd32(dev, 0x6101f8 + (chid * 12));

NV_INFO(dev, "EvoCh: chid %d mthd 0x%04x data 0x%08x "
"0x%08x 0x%08x\n",
chid, (mthd & 0x0000ffc), data, mthd, unkn);
nv_wr32(dev, 0x61009c, (1 << chid));
nv_wr32(dev, 0x6101f0 + (chid * 12), 0x90000000);
}

intr &= ~0x00000002;
}

if (intr & 0x01000000) {
u32 stat = nv_rd32(dev, 0x6100bc);
nv_wr32(dev, 0x6100bc, stat);
intr &= ~0x01000000;
}

if (intr & 0x02000000) {
u32 stat = nv_rd32(dev, 0x6108bc);
nv_wr32(dev, 0x6108bc, stat);
intr &= ~0x02000000;
}

if (intr)
NV_INFO(dev, "PDISP: unknown intr 0x%08x\n", intr);
}

/******************************************************************************
* Init
Expand Down Expand Up @@ -190,6 +228,7 @@ nvd0_display_destroy(struct drm_device *dev)

pci_free_consistent(pdev, PAGE_SIZE, disp->evo[0].ptr, disp->evo[0].handle);
nouveau_gpuobj_ref(NULL, &disp->mem);
nouveau_irq_unregister(dev, 26);

dev_priv->engine.display.priv = NULL;
kfree(disp);
Expand All @@ -208,6 +247,9 @@ nvd0_display_create(struct drm_device *dev)
return -ENOMEM;
dev_priv->engine.display.priv = disp;

/* setup interrupt handling */
nouveau_irq_register(dev, 26, nvd0_display_intr);

/* hash table and dma objects for the memory areas we care about */
ret = nouveau_gpuobj_new(dev, NULL, 4 * 1024, 0x1000, 0, &disp->mem);
if (ret)
Expand Down

0 comments on commit bbc4097

Please sign in to comment.