aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/nvc0_fence.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2013-02-13 22:43:21 -0500
committerBen Skeggs <bskeggs@redhat.com>2013-02-20 01:00:53 -0500
commit264ce192b3e7f45d0adb37bfbab2b01a3fbe6c30 (patch)
tree68ba7f61bc07f54378e562ce385f60dc814b4fad /drivers/gpu/drm/nouveau/nvc0_fence.c
parent827520ce06568f699dad275dcca61647cce08757 (diff)
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 b7def390d808..9566267fbc42 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)
81int 81int
82nvc0_fence_create(struct nouveau_drm *drm) 82nvc0_fence_create(struct nouveau_drm *drm)
83{ 83{
84 struct nouveau_fifo *pfifo = nouveau_fifo(drm->device); 84 int ret = nv84_fence_create(drm);
85 struct nv84_fence_priv *priv;
86 int ret;
87
88 priv = drm->fence = kzalloc(sizeof(*priv), GFP_KERNEL);
89 if (!priv)
90 return -ENOMEM;
91
92 priv->base.dtor = nv84_fence_destroy;
93 priv->base.suspend = nv84_fence_suspend;
94 priv->base.resume = nv84_fence_resume;
95 priv->base.context_new = nvc0_fence_context_new;
96 priv->base.context_del = nv84_fence_context_del;
97
98 init_waitqueue_head(&priv->base.waiting);
99 priv->base.uevent = true;
100
101 ret = nouveau_bo_new(drm->dev, 16 * (pfifo->max + 1), 0,
102 TTM_PL_FLAG_VRAM, 0, 0, NULL, &priv->bo);
103 if (ret == 0) { 85 if (ret == 0) {
104 ret = nouveau_bo_pin(priv->bo, TTM_PL_FLAG_VRAM); 86 struct nv84_fence_priv *priv = drm->fence;
105 if (ret == 0) { 87 priv->base.context_new = nvc0_fence_context_new;
106 ret = nouveau_bo_map(priv->bo);
107 if (ret)
108 nouveau_bo_unpin(priv->bo);
109 }
110 if (ret)
111 nouveau_bo_ref(NULL, &priv->bo);
112 } 88 }
113
114 if (ret)
115 nv84_fence_destroy(drm);
116 return ret; 89 return ret;
117} 90}