Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 228589
b: refs/heads/master
c: d908175
h: refs/heads/master
i:
  228587: e92f549
v: v3
  • Loading branch information
Ben Skeggs authored and Francisco Jerez committed Dec 8, 2010
1 parent e91aa4a commit 2250e49
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 22 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 395a31ec7ed9b02c5412f4405acbd6fceacca0fc
refs/heads/master: d908175cca901b95ba1628428b216e6e7188e8fb
22 changes: 1 addition & 21 deletions trunk/drivers/gpu/drm/nouveau/nouveau_channel.c
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
struct nouveau_channel *chan;
unsigned long flags;
int user, ret;
int ret;

/* allocate and lock channel structure */
chan = kzalloc(sizeof(*chan), GFP_KERNEL);
Expand Down Expand Up @@ -160,23 +160,6 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
}

nouveau_dma_pre_init(chan);

/* Locate channel's user control regs */
if (dev_priv->card_type < NV_40)
user = NV03_USER(chan->id);
else
if (dev_priv->card_type < NV_50)
user = NV40_USER(chan->id);
else
user = NV50_USER(chan->id);

chan->user = ioremap(pci_resource_start(dev->pdev, 0) + user,
PAGE_SIZE);
if (!chan->user) {
NV_ERROR(dev, "ioremap of regs failed.\n");
nouveau_channel_put(&chan);
return -ENOMEM;
}
chan->user_put = 0x40;
chan->user_get = 0x44;

Expand Down Expand Up @@ -356,9 +339,6 @@ nouveau_channel_del(struct kref *ref)
struct nouveau_channel *chan =
container_of(ref, struct nouveau_channel, ref);

if (chan->user)
iounmap(chan->user);

kfree(chan);
}

Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv04_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -129,6 +129,11 @@ nv04_fifo_create_context(struct nouveau_channel *chan)
if (ret)
return ret;

chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
NV03_USER(chan->id), PAGE_SIZE);
if (!chan->user)
return -ENOMEM;

spin_lock_irqsave(&dev_priv->context_switch_lock, flags);

/* Setup initial state */
Expand Down Expand Up @@ -173,6 +178,10 @@ nv04_fifo_destroy_context(struct nouveau_channel *chan)
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);

/* Free the channel resources */
if (chan->user) {
iounmap(chan->user);
chan->user = NULL;
}
nouveau_gpuobj_ref(NULL, &chan->ramfc);
}

Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv10_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,11 @@ nv10_fifo_create_context(struct nouveau_channel *chan)
if (ret)
return ret;

chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
NV03_USER(chan->id), PAGE_SIZE);
if (!chan->user)
return -ENOMEM;

/* Fill entries that are seen filled in dumps of nvidia driver just
* after channel's is put into DMA mode
*/
Expand Down
5 changes: 5 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv40_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -47,6 +47,11 @@ nv40_fifo_create_context(struct nouveau_channel *chan)
if (ret)
return ret;

chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
NV40_USER(chan->id), PAGE_SIZE);
if (!chan->user)
return -ENOMEM;

spin_lock_irqsave(&dev_priv->context_switch_lock, flags);

nv_wi32(dev, fc + 0, chan->pushbuf_base);
Expand Down
9 changes: 9 additions & 0 deletions trunk/drivers/gpu/drm/nouveau/nv50_fifo.c
Original file line number Diff line number Diff line change
Expand Up @@ -261,6 +261,11 @@ nv50_fifo_create_context(struct nouveau_channel *chan)
}
ramfc = chan->ramfc;

chan->user = ioremap(pci_resource_start(dev->pdev, 0) +
NV50_USER(chan->id), PAGE_SIZE);
if (!chan->user)
return -ENOMEM;

spin_lock_irqsave(&dev_priv->context_switch_lock, flags);

nv_wo32(ramfc, 0x48, chan->pushbuf->cinst >> 4);
Expand Down Expand Up @@ -327,6 +332,10 @@ nv50_fifo_destroy_context(struct nouveau_channel *chan)
spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);

/* Free the channel resources */
if (chan->user) {
iounmap(chan->user);
chan->user = NULL;
}
nouveau_gpuobj_ref(NULL, &ramfc);
nouveau_gpuobj_ref(NULL, &chan->cache);
}
Expand Down

0 comments on commit 2250e49

Please sign in to comment.