aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nouveau_channel.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2010-10-19 06:06:01 -0400
committerBen Skeggs <bskeggs@redhat.com>2010-12-03 00:06:58 -0500
commitbd2e597de8dbd000a3977871f15cb81e2925d63e (patch)
tree4e3fbd24cbc262566cb93dc743cf6b14405eae21 /drivers/gpu/drm/nouveau/nouveau_channel.c
parentb8c157d3a9a13871742c8a8d3d4598c3791ed5f5 (diff)
drm/nv84: add support for the PCRYPT engine
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nouveau_channel.c')
-rw-r--r--drivers/gpu/drm/nouveau/nouveau_channel.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nouveau_channel.c b/drivers/gpu/drm/nouveau/nouveau_channel.c
index 76033c509d35..8f2df6beb893 100644
--- a/drivers/gpu/drm/nouveau/nouveau_channel.c
+++ b/drivers/gpu/drm/nouveau/nouveau_channel.c
@@ -112,6 +112,7 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
112 struct drm_nouveau_private *dev_priv = dev->dev_private; 112 struct drm_nouveau_private *dev_priv = dev->dev_private;
113 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; 113 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
114 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; 114 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
115 struct nouveau_crypt_engine *pcrypt = &dev_priv->engine.crypt;
115 struct nouveau_channel *chan; 116 struct nouveau_channel *chan;
116 unsigned long flags; 117 unsigned long flags;
117 int user, ret; 118 int user, ret;
@@ -214,6 +215,14 @@ nouveau_channel_alloc(struct drm_device *dev, struct nouveau_channel **chan_ret,
214 return ret; 215 return ret;
215 } 216 }
216 217
218 if (pcrypt->create_context) {
219 ret = pcrypt->create_context(chan);
220 if (ret) {
221 nouveau_channel_put(&chan);
222 return ret;
223 }
224 }
225
217 /* Construct inital RAMFC for new channel */ 226 /* Construct inital RAMFC for new channel */
218 ret = pfifo->create_context(chan); 227 ret = pfifo->create_context(chan);
219 if (ret) { 228 if (ret) {
@@ -280,6 +289,7 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan)
280 struct drm_nouveau_private *dev_priv = dev->dev_private; 289 struct drm_nouveau_private *dev_priv = dev->dev_private;
281 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo; 290 struct nouveau_fifo_engine *pfifo = &dev_priv->engine.fifo;
282 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph; 291 struct nouveau_pgraph_engine *pgraph = &dev_priv->engine.graph;
292 struct nouveau_crypt_engine *pcrypt = &dev_priv->engine.crypt;
283 unsigned long flags; 293 unsigned long flags;
284 int ret; 294 int ret;
285 295
@@ -328,6 +338,8 @@ nouveau_channel_put_unlocked(struct nouveau_channel **pchan)
328 /* destroy the engine specific contexts */ 338 /* destroy the engine specific contexts */
329 pfifo->destroy_context(chan); 339 pfifo->destroy_context(chan);
330 pgraph->destroy_context(chan); 340 pgraph->destroy_context(chan);
341 if (pcrypt->destroy_context)
342 pcrypt->destroy_context(chan);
331 343
332 pfifo->reassign(dev, true); 344 pfifo->reassign(dev, true);
333 345