aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core/engine/mpeg
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2012-07-14 05:09:17 -0400
committerBen Skeggs <bskeggs@redhat.com>2012-10-02 23:12:52 -0400
commit3863c9bc887e9638a9d905d55f6038641ece78d6 (patch)
tree923decce50fc9f0ed28e04d5ad83d6518162bad0 /drivers/gpu/drm/nouveau/core/engine/mpeg
parent8a9b889e668a5bc2f4031015fe4893005c43403d (diff)
drm/nouveau/instmem: completely new implementation, as a subdev module
v2 (Ben Skeggs): - some fixes for 64KiB PAGE_SIZE - fix porting issues in (currently unused) nv41/nv44 pciegart code Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core/engine/mpeg')
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c8
-rw-r--r--drivers/gpu/drm/nouveau/core/engine/mpeg/nv50.c10
2 files changed, 8 insertions, 10 deletions
diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
index eb5455fed1b..a0258c76685 100644
--- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
+++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv31.c
@@ -74,8 +74,8 @@ nv40_mpeg_context_new(struct nouveau_channel *chan, int engine)
74 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 74 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
75 nv_mask(dev, 0x002500, 0x00000001, 0x00000000); 75 nv_mask(dev, 0x002500, 0x00000001, 0x00000000);
76 if ((nv_rd32(dev, 0x003204) & 0x1f) == chan->id) 76 if ((nv_rd32(dev, 0x003204) & 0x1f) == chan->id)
77 nv_wr32(dev, 0x00330c, ctx->pinst >> 4); 77 nv_wr32(dev, 0x00330c, ctx->addr >> 4);
78 nv_wo32(chan->ramfc, 0x54, ctx->pinst >> 4); 78 nv_wo32(chan->ramfc, 0x54, ctx->addr >> 4);
79 nv_mask(dev, 0x002500, 0x00000001, 0x00000001); 79 nv_mask(dev, 0x002500, 0x00000001, 0x00000001);
80 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags); 80 spin_unlock_irqrestore(&dev_priv->context_switch_lock, flags);
81 81
@@ -90,7 +90,7 @@ nv40_mpeg_context_del(struct nouveau_channel *chan, int engine)
90 struct nouveau_gpuobj *ctx = chan->engctx[engine]; 90 struct nouveau_gpuobj *ctx = chan->engctx[engine];
91 struct drm_device *dev = chan->dev; 91 struct drm_device *dev = chan->dev;
92 unsigned long flags; 92 unsigned long flags;
93 u32 inst = 0x80000000 | (ctx->pinst >> 4); 93 u32 inst = 0x80000000 | (ctx->addr >> 4);
94 94
95 spin_lock_irqsave(&dev_priv->context_switch_lock, flags); 95 spin_lock_irqsave(&dev_priv->context_switch_lock, flags);
96 nv_mask(dev, 0x00b32c, 0x00000001, 0x00000000); 96 nv_mask(dev, 0x00b32c, 0x00000001, 0x00000000);
@@ -224,7 +224,7 @@ nv31_mpeg_isr_chid(struct drm_device *dev, u32 inst)
224 continue; 224 continue;
225 225
226 ctx = dev_priv->channels.ptr[i]->engctx[NVOBJ_ENGINE_MPEG]; 226 ctx = dev_priv->channels.ptr[i]->engctx[NVOBJ_ENGINE_MPEG];
227 if (ctx && ctx->pinst == inst) 227 if (ctx && ctx->addr == inst)
228 break; 228 break;
229 } 229 }
230 spin_unlock_irqrestore(&dev_priv->channels.lock, flags); 230 spin_unlock_irqrestore(&dev_priv->channels.lock, flags);
diff --git a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv50.c b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv50.c
index 47d37a2f478..4e3292ed80c 100644
--- a/drivers/gpu/drm/nouveau/core/engine/mpeg/nv50.c
+++ b/drivers/gpu/drm/nouveau/core/engine/mpeg/nv50.c
@@ -47,7 +47,6 @@ static int
47nv50_mpeg_context_new(struct nouveau_channel *chan, int engine) 47nv50_mpeg_context_new(struct nouveau_channel *chan, int engine)
48{ 48{
49 struct drm_device *dev = chan->dev; 49 struct drm_device *dev = chan->dev;
50 struct drm_nouveau_private *dev_priv = dev->dev_private;
51 struct nouveau_gpuobj *ramin = chan->ramin; 50 struct nouveau_gpuobj *ramin = chan->ramin;
52 struct nouveau_gpuobj *ctx = NULL; 51 struct nouveau_gpuobj *ctx = NULL;
53 int ret; 52 int ret;
@@ -60,15 +59,15 @@ nv50_mpeg_context_new(struct nouveau_channel *chan, int engine)
60 return ret; 59 return ret;
61 60
62 nv_wo32(ramin, CTX_PTR(dev, 0x00), 0x80190002); 61 nv_wo32(ramin, CTX_PTR(dev, 0x00), 0x80190002);
63 nv_wo32(ramin, CTX_PTR(dev, 0x04), ctx->vinst + ctx->size - 1); 62 nv_wo32(ramin, CTX_PTR(dev, 0x04), ctx->addr + ctx->size - 1);
64 nv_wo32(ramin, CTX_PTR(dev, 0x08), ctx->vinst); 63 nv_wo32(ramin, CTX_PTR(dev, 0x08), ctx->addr);
65 nv_wo32(ramin, CTX_PTR(dev, 0x0c), 0); 64 nv_wo32(ramin, CTX_PTR(dev, 0x0c), 0);
66 nv_wo32(ramin, CTX_PTR(dev, 0x10), 0); 65 nv_wo32(ramin, CTX_PTR(dev, 0x10), 0);
67 nv_wo32(ramin, CTX_PTR(dev, 0x14), 0x00010000); 66 nv_wo32(ramin, CTX_PTR(dev, 0x14), 0x00010000);
68 67
69 nv_wo32(ctx, 0x70, 0x00801ec1); 68 nv_wo32(ctx, 0x70, 0x00801ec1);
70 nv_wo32(ctx, 0x7c, 0x0000037c); 69 nv_wo32(ctx, 0x7c, 0x0000037c);
71 dev_priv->engine.instmem.flush(dev); 70 nvimem_flush(dev);
72 71
73 chan->engctx[engine] = ctx; 72 chan->engctx[engine] = ctx;
74 return 0; 73 return 0;
@@ -93,7 +92,6 @@ nv50_mpeg_object_new(struct nouveau_channel *chan, int engine,
93 u32 handle, u16 class) 92 u32 handle, u16 class)
94{ 93{
95 struct drm_device *dev = chan->dev; 94 struct drm_device *dev = chan->dev;
96 struct drm_nouveau_private *dev_priv = dev->dev_private;
97 struct nouveau_gpuobj *obj = NULL; 95 struct nouveau_gpuobj *obj = NULL;
98 int ret; 96 int ret;
99 97
@@ -107,7 +105,7 @@ nv50_mpeg_object_new(struct nouveau_channel *chan, int engine,
107 nv_wo32(obj, 0x04, 0x00000000); 105 nv_wo32(obj, 0x04, 0x00000000);
108 nv_wo32(obj, 0x08, 0x00000000); 106 nv_wo32(obj, 0x08, 0x00000000);
109 nv_wo32(obj, 0x0c, 0x00000000); 107 nv_wo32(obj, 0x0c, 0x00000000);
110 dev_priv->engine.instmem.flush(dev); 108 nvimem_flush(dev);
111 109
112 ret = nouveau_ramht_insert(chan, handle, obj); 110 ret = nouveau_ramht_insert(chan, handle, obj);
113 nouveau_gpuobj_ref(NULL, &obj); 111 nouveau_gpuobj_ref(NULL, &obj);