Commit 8d90d1ef authored by Ben Skeggs's avatar Ben Skeggs

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: default avatarBen Skeggs <bskeggs@redhat.com>
parent 6f5cee5b
...@@ -153,8 +153,6 @@ nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -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); ret = nvc0_bar_init_vm(priv, &priv->bar[0], 3);
if (ret) if (ret)
return ret; return ret;
priv->base.alloc = nouveau_bar_alloc;
priv->base.kmap = nvc0_bar_kmap;
} }
/* BAR1 */ /* BAR1 */
...@@ -162,6 +160,10 @@ nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -162,6 +160,10 @@ nvc0_bar_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
if (ret) if (ret)
return 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.umap = nvc0_bar_umap;
priv->base.unmap = nvc0_bar_unmap; priv->base.unmap = nvc0_bar_unmap;
priv->base.flush = nv84_bar_flush; priv->base.flush = nv84_bar_flush;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment