summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/drm/nouveau/core
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2014-12-03 18:19:58 +1000
committerBen Skeggs <bskeggs@redhat.com>2015-01-22 12:14:44 +1000
commit8d90d1ef88ddad5353888e9ecf1d30c75a5effff (patch)
tree16670ac9c6b79f1619583e2922bfcc3bd35183a4 /drivers/gpu/drm/nouveau/core
parent6f5cee5b57b09b260fd61ef116859f0240cff067 (diff)
downloadop-kernel-dev-8d90d1ef88ddad5353888e9ecf1d30c75a5effff.zip
op-kernel-dev-8d90d1ef88ddad5353888e9ecf1d30c75a5effff.tar.gz
drm/gf100-/bar: don't fill in bar->alloc until after all vm setup done
gpuobj has a condition of (bar && bar->alloc) around usage to avoid some nasty ordering issues (which, i've now been reminded to add a todo about fixing...) between bar and vm. The bar->alloc part of the condition isn't currently necessary (it used to be, another change made bar always NULL where it matters), so we got lucky. That won't be the case for much longer. Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/core')
-rw-r--r--drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
index 05a278b..8320ee0 100644
--- a/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
+++ b/drivers/gpu/drm/nouveau/core/subdev/bar/nvc0.c
@@ -153,8 +153,6 @@ nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
ret = nvc0_bar_init_vm(priv, &priv->bar[0], 3);
if (ret)
return ret;
- priv->base.alloc = nouveau_bar_alloc;
- priv->base.kmap = nvc0_bar_kmap;
}
/* BAR1 */
@@ -162,6 +160,10 @@ nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if (ret)
return ret;
+ if (has_bar3) {
+ priv->base.alloc = nouveau_bar_alloc;
+ priv->base.kmap = nvc0_bar_kmap;
+ }
priv->base.umap = nvc0_bar_umap;
priv->base.unmap = nvc0_bar_unmap;
priv->base.flush = nv84_bar_flush;
OpenPOWER on IntegriCloud