From 67b342efc761046a22b73c327837479b58613a41 Mon Sep 17 00:00:00 2001 From: Ben Skeggs Date: Tue, 1 May 2012 10:14:07 +1000 Subject: drm/nouveau/fifo: remove all the "special" engine hooks All the places this stuff is actually needed tends to be chipset-specific anyway, so we're able to just inline the register bashing instead. The parts of the common code that still directly touch PFIFO temporarily have conditionals, these will be removed in subsequent commits that will refactor the fifo modules into engine modules like graph/mpeg etc. Signed-off-by: Ben Skeggs --- drivers/gpu/drm/nouveau/nouveau_channel.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c') diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c index 5762547ed8af..9f4a5c5d5903 100644 --- a/drivers/gpu/drm/nouveau/nouveau_channel.c +++ b/drivers/gpu/drm/nouveau/nouveau_channel.c @@ -190,7 +190,8 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, chan->user_get_hi = 0x60; /* disable the fifo caches */ - pfifo->reassign(dev, false); + if (dev_priv->card_type < NV_C0) + nv_wr32(dev, NV03_PFIFO_CACHES, 0); /* Construct initial RAMFC for new channel */ ret = pfifo->create_context(chan); @@ -199,7 +200,8 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret, return ret; } - pfifo->reassign(dev, true); + if (dev_priv->card_type < NV_C0) + nv_wr32(dev, NV03_PFIFO_CACHES, 1); /* Insert NOPs for NOUVEAU_DMA_SKIPS */ ret = RING_SPACE(chan, NOUVEAU_DMA_SKIPS); @@ -304,7 +306,8 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan) nouveau_channel_idle(chan); /* boot it off the hardware */ - pfifo->reassign(dev, false); + if (dev_priv->card_type < NV_C0) + nv_wr32(dev, NV03_PFIFO_CACHES, 0); /* destroy the engine specific contexts */ for (i = NVOBJ_ENGINE_NR - 1; i >= 0; i--) { @@ -315,7 +318,8 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan) pfifo->destroy_context(chan); } - pfifo->reassign(dev, true); + if (dev_priv->card_type < NV_C0) + nv_wr32(dev, NV03_PFIFO_CACHES, 1); /* aside from its resources, the channel should now be dead, * remove it from the channel list -- cgit v1.2.3