]> git.proxmox.com Git - mirror_ubuntu-disco-kernel.git/commitdiff
drm/nv04-nv40/instmem: remove parent deref hack
authorBen Skeggs <bskeggs@redhat.com>
Wed, 24 Apr 2013 07:38:38 +0000 (17:38 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 26 Apr 2013 05:38:00 +0000 (15:38 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.c
drivers/gpu/drm/nouveau/core/subdev/instmem/nv04.h
drivers/gpu/drm/nouveau/core/subdev/instmem/nv40.c

index f5bbd3834116de53043e8fb65c1ae4590bb6f333..932c93b486e6c2270f0fdfddb73d72991f5f8ba6 100644 (file)
@@ -93,7 +93,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent,
                   u32 size, u32 align, struct nouveau_object **pobject)
 {
        struct nouveau_object *engine = nv_object(imem);
-       struct nv04_instmem_priv *priv = (void *)(imem);
        int ret;
 
        ret = nouveau_object_ctor(parent, engine, &nv04_instobj_oclass,
@@ -101,14 +100,6 @@ nv04_instmem_alloc(struct nouveau_instmem *imem, struct nouveau_object *parent,
        if (ret)
                return ret;
 
-       /* INSTMEM itself creates objects to reserve (and preserve across
-        * suspend/resume) various fixed data locations, each one of these
-        * takes a reference on INSTMEM itself, causing it to never be
-        * freed.  We drop all the self-references here to avoid this.
-        */
-       if (unlikely(!priv->created))
-               atomic_dec(&engine->refcount);
-
        return 0;
 }
 
@@ -154,7 +145,6 @@ nv04_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        if (ret)
                return ret;
 
-       priv->created = true;
        return 0;
 }
 
index 7983d8d9b3585b2932a5fa29bc40355847f9c448..b15b61310236608e88a1bc2b89f58b70f3705f48 100644 (file)
@@ -9,7 +9,6 @@
 
 struct nv04_instmem_priv {
        struct nouveau_instmem base;
-       bool created;
 
        void __iomem *iomem;
        struct nouveau_mm heap;
index da64253201ef3dee20635c67e96f37d0480a2ad1..5aef79748527c6c6beb3e8efb3d0d1d8e6237c8f 100644 (file)
@@ -106,7 +106,6 @@ nv40_instmem_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        if (ret)
                return ret;
 
-       priv->created = true;
        return 0;
 }