summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_fence.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-02-14 13:43:21 +1000
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 16:00:53 +1000
commit264ce192b3e7f45d0adb37bfbab2b01a3fbe6c30 (patch)
tree68ba7f61bc07f54378e562ce385f60dc814b4fad /drivers/gpu/drm/nouveau/nvc0_fence.c
parent827520ce06568f699dad275dcca61647cce08757 (diff)
downloadop-kernel-dev-264ce192b3e7f45d0adb37bfbab2b01a3fbe6c30.zip
op-kernel-dev-264ce192b3e7f45d0adb37bfbab2b01a3fbe6c30.tar.gz
drm/nv84-/fence: prepare for emit/sync support of sysram sequences
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvc0_fence.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvc0_fence.c33
1 files changed, 3 insertions, 30 deletions
diff --git a/drivers/gpu/drm/nouveau/nvc0_fence.c b/drivers/gpu/drm/nouveau/nvc0_fence.c
index b7def39..9566267 100644
--- a/drivers/gpu/drm/nouveau/nvc0_fence.c
+++ b/drivers/gpu/drm/nouveau/nvc0_fence.c
@@ -81,37 +81,10 @@ nvc0_fence_context_new(struct nouveau_channel *chan)
int
nvc0_fence_create(struct nouveau_drm *drm)
{
- struct nouveau_fifo *pfifo = nouveau_fifo(drm->device);
- struct nv84_fence_priv *priv;
- int ret;
-
- priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL);
- if (!priv)
- return -ENOMEM;
-
- priv->base.dtor = nv84_fence_destroy;
- priv->base.suspend = nv84_fence_suspend;
- priv->base.resume = nv84_fence_resume;
- priv->base.context_new = nvc0_fence_context_new;
- priv->base.context_del = nv84_fence_context_del;
-
- init_waitqueue_head(&priv->base.waiting);
- priv->base.uevent = true;
-
- ret = nouveau_bo_new(drm->dev, 16 * (pfifo->max + 1), 0,
- TTM_PL_FLAG_VRAM, 0, 0, NULL, &priv->bo);
+ int ret = nv84_fence_create(drm);
if (ret == 0) {
- ret = nouveau_bo_pin(priv->bo, TTM_PL_FLAG_VRAM);
- if (ret == 0) {
- ret = nouveau_bo_map(priv->bo);
- if (ret)
- nouveau_bo_unpin(priv->bo);
- }
- if (ret)
- nouveau_bo_ref(NULL, &priv->bo);
+ struct nv84_fence_priv *priv = drm->fence;
+ priv->base.context_new = nvc0_fence_context_new;
}
-
- if (ret)
- nv84_fence_destroy(drm);
return ret;
}
OpenPOWER on IntegriCloud