]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
drm/nouveau/fb: merge more bits and pieces into oclass definitions
authorBen Skeggs <bskeggs@redhat.com>
Mon, 21 Oct 2013 00:26:04 +0000 (10:26 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 8 Nov 2013 05:39:52 +0000 (15:39 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
27 files changed:
drivers/gpu/drm/nouveau/core/subdev/fb/base.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv04.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv04.h [new file with mode: 0644]
drivers/gpu/drm/nouveau/core/subdev/fb/nv10.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv1a.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv36.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv41.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv44.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv46.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv47.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv49.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv4e.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.c
drivers/gpu/drm/nouveau/core/subdev/fb/nv50.h
drivers/gpu/drm/nouveau/core/subdev/fb/nv84.c
drivers/gpu/drm/nouveau/core/subdev/fb/nva3.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvaa.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvaf.c
drivers/gpu/drm/nouveau/core/subdev/fb/nvc0.c
drivers/gpu/drm/nouveau/core/subdev/fb/priv.h
drivers/gpu/drm/nouveau/core/subdev/fb/ramnv50.c
drivers/gpu/drm/nouveau/core/subdev/fb/ramnvc0.c

index dab4bdbbc190d57e49a1cdfe63a9ac592f573cd8..f009d8a39d9d70f4063ee8df300ba399682c093f 100644 (file)
@@ -133,6 +133,8 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine,
        if (ret)
                return ret;
 
+       pfb->memtype_valid = impl->memtype;
+
        ret = nouveau_object_ctor(nv_object(pfb), nv_object(pfb),
                                  impl->ram, NULL, 0, &ram);
        if (ret) {
index 3bf88210451ded81e85cc3a3318909cf9c330bf5..8309fe33fe847ed2f418cd13bbaad2dfd2b2de10 100644 (file)
  * Authors: Ben Skeggs
  */
 
-#include "priv.h"
+#include "nv04.h"
 
 #define NV04_PFB_CFG0                                          0x00100200
 
-struct nv04_fb_priv {
-       struct nouveau_fb base;
-};
-
 bool
 nv04_fb_memtype_valid(struct nouveau_fb *pfb, u32 tile_flags)
 {
@@ -57,11 +53,12 @@ nv04_fb_init(struct nouveau_object *object)
        return 0;
 }
 
-static int
+int
 nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
             struct nouveau_oclass *oclass, void *data, u32 size,
             struct nouveau_object **pobject)
 {
+       struct nv04_fb_impl *impl = (void *)oclass;
        struct nv04_fb_priv *priv;
        int ret;
 
@@ -70,18 +67,23 @@ nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        if (ret)
                return ret;
 
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
+       priv->base.tile.regions = impl->tile.regions;
+       priv->base.tile.init = impl->tile.init;
+       priv->base.tile.comp = impl->tile.comp;
+       priv->base.tile.fini = impl->tile.fini;
+       priv->base.tile.prog = impl->tile.prog;
        return 0;
 }
 
 struct nouveau_oclass *
-nv04_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x04),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
+nv04_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x04),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
                .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv04_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv04_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv04_ram_oclass,
+}.base.base;
diff --git a/drivers/gpu/drm/nouveau/core/subdev/fb/nv04.h b/drivers/gpu/drm/nouveau/core/subdev/fb/nv04.h
new file mode 100644 (file)
index 0000000..06ce71f
--- /dev/null
@@ -0,0 +1,55 @@
+#ifndef __NVKM_FB_NV04_H__
+#define __NVKM_FB_NV04_H__
+
+#include "priv.h"
+
+struct nv04_fb_priv {
+       struct nouveau_fb base;
+};
+
+int  nv04_fb_ctor(struct nouveau_object *, struct nouveau_object *,
+                 struct nouveau_oclass *, void *, u32,
+                 struct nouveau_object **);
+
+struct nv04_fb_impl {
+       struct nouveau_fb_impl base;
+       struct {
+               int regions;
+               void (*init)(struct nouveau_fb *, int i, u32 addr, u32 size,
+                            u32 pitch, u32 flags, struct nouveau_fb_tile *);
+               void (*comp)(struct nouveau_fb *, int i, u32 size, u32 flags,
+                            struct nouveau_fb_tile *);
+               void (*fini)(struct nouveau_fb *, int i,
+                            struct nouveau_fb_tile *);
+               void (*prog)(struct nouveau_fb *, int i,
+                            struct nouveau_fb_tile *);
+       } tile;
+};
+
+void nv10_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
+                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
+void nv10_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
+void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
+
+void nv20_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
+                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
+void nv20_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
+void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
+
+int  nv30_fb_init(struct nouveau_object *);
+void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
+                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
+
+void nv40_fb_tile_comp(struct nouveau_fb *, int i, u32 size, u32 flags,
+                      struct nouveau_fb_tile *);
+
+int  nv41_fb_init(struct nouveau_object *);
+void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
+
+int  nv44_fb_init(struct nouveau_object *);
+void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
+
+void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
+                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
+
+#endif
index ffed6085ae829c00e1b3a8195eed4ab143916949..ffb7ec6d97aa0bf2c13ae9b914464e24f59aa4a4 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv10_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv10_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
@@ -57,35 +53,19 @@ nv10_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
        nv_rd32(pfb, 0x100240 + (i * 0x10));
 }
 
-static int
-nv10_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv10_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv10_fb_tile_init;
-       priv->base.tile.fini = nv10_fb_tile_fini;
-       priv->base.tile.prog = nv10_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv10_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x10),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv10_fb_ctor,
+nv10_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x10),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = _nouveau_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv10_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv10_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv10_fb_tile_init,
+       .tile.fini = nv10_fb_tile_fini,
+       .tile.prog = nv10_fb_tile_prog,
+}.base.base;
index c67f52ffd651137dae1a8ee9b177ce4b06b88ac2..9159a5ccee930d21172884bf9f23972c222669b5 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv1a_fb_priv {
-       struct nouveau_fb base;
-};
-
-static int
-nv1a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv1a_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv10_fb_tile_init;
-       priv->base.tile.fini = nv10_fb_tile_fini;
-       priv->base.tile.prog = nv10_fb_tile_prog;
-       return 0;
-}
+#include "nv04.h"
 
 struct nouveau_oclass *
-nv1a_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x1a),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv1a_fb_ctor,
+nv1a_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x1a),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = _nouveau_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv10_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv10_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv10_fb_tile_init,
+       .tile.fini = nv10_fb_tile_fini,
+       .tile.prog = nv10_fb_tile_prog,
+}.base.base;
index 9bd3f1aa1e29697d1f70039aac5d2d2efbffaf96..f003c1b1893f48c1a115e55e835a749d98b41207 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv20_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv20_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
@@ -80,36 +76,20 @@ nv20_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
        nv_wr32(pfb, 0x100300 + (i * 0x04), tile->zcomp);
 }
 
-static int
-nv20_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv20_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv20_fb_tile_init;
-       priv->base.tile.comp = nv20_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv20_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x20),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv20_fb_ctor,
+nv20_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x20),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = _nouveau_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv20_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv20_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv20_fb_tile_init,
+       .tile.comp = nv20_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index 23b6aadc1911dce95266c6334e227c47dd1be5a4..f34f4223210b8552bc143f096bd8117ca216e158 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv25_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 static void
 nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
@@ -46,36 +42,20 @@ nv25_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
        }
 }
 
-static int
-nv25_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv25_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv20_fb_tile_init;
-       priv->base.tile.comp = nv25_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv25_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x25),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv25_fb_ctor,
+nv25_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x25),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = _nouveau_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv20_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv20_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv20_fb_tile_init,
+       .tile.comp = nv25_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index b747c72510eaeab870747168ef8733827d66d49f..69093f7151f01d168117098983a6812e9b3ff965 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv30_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv30_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
@@ -67,7 +63,7 @@ nv30_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
 }
 
 static int
-calc_bias(struct nv30_fb_priv *priv, int k, int i, int j)
+calc_bias(struct nv04_fb_priv *priv, int k, int i, int j)
 {
        struct nouveau_device *device = nv_device(priv);
        int b = (device->chipset > 0x30 ?
@@ -78,7 +74,7 @@ calc_bias(struct nv30_fb_priv *priv, int k, int i, int j)
 }
 
 static int
-calc_ref(struct nv30_fb_priv *priv, int l, int k, int i)
+calc_ref(struct nv04_fb_priv *priv, int l, int k, int i)
 {
        int j, x = 0;
 
@@ -95,7 +91,7 @@ int
 nv30_fb_init(struct nouveau_object *object)
 {
        struct nouveau_device *device = nv_device(object);
-       struct nv30_fb_priv *priv = (void *)object;
+       struct nv04_fb_priv *priv = (void *)object;
        int ret, i, j;
 
        ret = nouveau_fb_init(&priv->base);
@@ -124,36 +120,20 @@ nv30_fb_init(struct nouveau_object *object)
        return 0;
 }
 
-static int
-nv30_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv30_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv30_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv30_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x30),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv30_fb_ctor,
+nv30_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x30),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv30_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv20_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv20_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv30_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index 2131ba7b29c0cee145239032c029c5e69ecafd39..161b06e8fc3f75f31567054c3f68117e0691e93e 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv35_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 static void
 nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
@@ -47,36 +43,20 @@ nv35_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
        }
 }
 
-static int
-nv35_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv35_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv35_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv35_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x35),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv35_fb_ctor,
+nv35_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x35),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv30_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv20_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv20_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv35_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index 5e7749d19035c1299719ef779a9c5b331ef31550..2dd3d0aab6bb6434fdb780c1152f71453aa22324 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv36_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 static void
 nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
@@ -47,36 +43,20 @@ nv36_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
        }
 }
 
-static int
-nv36_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv36_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv36_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
 struct nouveau_oclass *
-nv36_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x36),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv36_fb_ctor,
+nv36_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x36),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv30_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv20_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv20_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv36_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index 3f84c822db914ffb2b097f2b8a776b7a76c87618..95a115ab0c860bc591f63033f6305c7f15fb0b59 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv40_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
@@ -50,7 +46,7 @@ nv40_fb_tile_comp(struct nouveau_fb *pfb, int i, u32 size, u32 flags,
 static int
 nv40_fb_init(struct nouveau_object *object)
 {
-       struct nv40_fb_priv *priv = (void *)object;
+       struct nv04_fb_priv *priv = (void *)object;
        int ret;
 
        ret = nouveau_fb_init(&priv->base);
@@ -61,37 +57,20 @@ nv40_fb_init(struct nouveau_object *object)
        return 0;
 }
 
-static int
-nv40_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv40_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 8;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv40_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv20_fb_tile_prog;
-       return 0;
-}
-
-
 struct nouveau_oclass *
-nv40_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x40),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv40_fb_ctor,
+nv40_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x40),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv40_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv40_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv40_ram_oclass,
+       .tile.regions = 8,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv40_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv20_fb_tile_prog,
+}.base.base;
index f555dc7505df24cc1f67dc2a2b2b3a1cc755e6e3..b239a8615599d92b22478295c6556a6bea86cd46 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv41_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
@@ -43,7 +39,7 @@ nv41_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
 int
 nv41_fb_init(struct nouveau_object *object)
 {
-       struct nv41_fb_priv *priv = (void *)object;
+       struct nv04_fb_priv *priv = (void *)object;
        int ret;
 
        ret = nouveau_fb_init(&priv->base);
@@ -54,37 +50,20 @@ nv41_fb_init(struct nouveau_object *object)
        return 0;
 }
 
-static int
-nv41_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv41_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 12;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv40_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
-       return 0;
-}
-
-
 struct nouveau_oclass *
-nv41_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x41),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv41_fb_ctor,
+nv41_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x41),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv41_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv41_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv41_ram_oclass,
+       .tile.regions = 12,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv40_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv41_fb_tile_prog,
+}.base.base;
index 69b81ad4f8e5a87d38ed19c37349324538024d78..d8478208a68117cc83ea66467905f98fed9474d7 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv44_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 static void
 nv44_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
@@ -52,7 +48,7 @@ nv44_fb_tile_prog(struct nouveau_fb *pfb, int i, struct nouveau_fb_tile *tile)
 int
 nv44_fb_init(struct nouveau_object *object)
 {
-       struct nv44_fb_priv *priv = (void *)object;
+       struct nv04_fb_priv *priv = (void *)object;
        int ret;
 
        ret = nouveau_fb_init(&priv->base);
@@ -64,36 +60,19 @@ nv44_fb_init(struct nouveau_object *object)
        return 0;
 }
 
-static int
-nv44_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv44_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 12;
-       priv->base.tile.init = nv44_fb_tile_init;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv44_fb_tile_prog;
-       return 0;
-}
-
-
 struct nouveau_oclass *
-nv44_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x44),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv44_fb_ctor,
+nv44_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x44),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv44_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv44_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv44_ram_oclass,
+       .tile.regions = 12,
+       .tile.init = nv44_fb_tile_init,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv44_fb_tile_prog,
+}.base.base;
index 61a278f3f1ce61a9779e0887e8370d2be2a53cef..a5b77514d35b7c4caa91660035e91b6b64c98b17 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv46_fb_priv {
-       struct nouveau_fb base;
-};
+#include "nv04.h"
 
 void
 nv46_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
@@ -44,36 +40,19 @@ nv46_fb_tile_init(struct nouveau_fb *pfb, int i, u32 addr, u32 size, u32 pitch,
        tile->pitch = pitch;
 }
 
-static int
-nv46_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv46_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 15;
-       priv->base.tile.init = nv46_fb_tile_init;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv44_fb_tile_prog;
-       return 0;
-}
-
-
 struct nouveau_oclass *
-nv46_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x46),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv46_fb_ctor,
+nv46_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x46),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv44_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv44_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv44_ram_oclass,
+       .tile.regions = 15,
+       .tile.init = nv46_fb_tile_init,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv44_fb_tile_prog,
+}.base.base;
index e7286bd9139e8799e83fa96715e84767b5a795b9..3bea142376bc2c4cce39aa685b266156e259fe37 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv47_fb_priv {
-       struct nouveau_fb base;
-};
-
-static int
-nv47_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv47_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 15;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv40_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
-       return 0;
-}
-
+#include "nv04.h"
 
 struct nouveau_oclass *
-nv47_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x47),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv47_fb_ctor,
+nv47_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x47),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv41_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv41_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv41_ram_oclass,
+       .tile.regions = 15,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv40_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv41_fb_tile_prog,
+}.base.base;
index f18df404bda6b105a67be8a1d91a63bfaca1294e..666cbd5d47f5313173ebc8e31e2b14472a337fc7 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv49_fb_priv {
-       struct nouveau_fb base;
-};
-
-static int
-nv49_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv49_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 15;
-       priv->base.tile.init = nv30_fb_tile_init;
-       priv->base.tile.comp = nv40_fb_tile_comp;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv41_fb_tile_prog;
-       return 0;
-}
-
+#include "nv04.h"
 
 struct nouveau_oclass *
-nv49_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x49),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv49_fb_ctor,
+nv49_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x49),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv41_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv49_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv49_ram_oclass,
+       .tile.regions = 15,
+       .tile.init = nv30_fb_tile_init,
+       .tile.comp = nv40_fb_tile_comp,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv41_fb_tile_prog,
+}.base.base;
index 14a47cbb6691e226dc7ff318d5a291fe1e012fed..42e64f364ec1787cd430362023567ff7353900a0 100644 (file)
  *
  */
 
-#include "priv.h"
-
-struct nv4e_fb_priv {
-       struct nouveau_fb base;
-};
-
-static int
-nv4e_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
-            struct nouveau_oclass *oclass, void *data, u32 size,
-            struct nouveau_object **pobject)
-{
-       struct nv4e_fb_priv *priv;
-       int ret;
-
-       ret = nouveau_fb_create(parent, engine, oclass, &priv);
-       *pobject = nv_object(priv);
-       if (ret)
-               return ret;
-
-       priv->base.memtype_valid = nv04_fb_memtype_valid;
-       priv->base.tile.regions = 12;
-       priv->base.tile.init = nv46_fb_tile_init;
-       priv->base.tile.fini = nv20_fb_tile_fini;
-       priv->base.tile.prog = nv44_fb_tile_prog;
-       return 0;
-}
+#include "nv04.h"
 
 struct nouveau_oclass *
-nv4e_fb_oclass = &(struct nouveau_fb_impl) {
-       .base.handle = NV_SUBDEV(FB, 0x4e),
-       .base.ofuncs = &(struct nouveau_ofuncs) {
-               .ctor = nv4e_fb_ctor,
+nv4e_fb_oclass = &(struct nv04_fb_impl) {
+       .base.base.handle = NV_SUBDEV(FB, 0x4e),
+       .base.base.ofuncs = &(struct nouveau_ofuncs) {
+               .ctor = nv04_fb_ctor,
                .dtor = _nouveau_fb_dtor,
                .init = nv44_fb_init,
                .fini = _nouveau_fb_fini,
        },
-       .ram = &nv4e_ram_oclass,
-}.base;
+       .base.memtype = nv04_fb_memtype_valid,
+       .base.ram = &nv4e_ram_oclass,
+       .tile.regions = 12,
+       .tile.init = nv46_fb_tile_init,
+       .tile.fini = nv20_fb_tile_fini,
+       .tile.prog = nv44_fb_tile_prog,
+}.base.base;
index 8577e3a10120fbdc64efae80f24f4113a4d24f56..cbc7f00c1278905bcf24b2c7f8dc548c6dce7a22 100644 (file)
@@ -43,7 +43,7 @@ nv50_fb_memtype[0x80] = {
        1, 0, 2, 0, 1, 0, 2, 0, 1, 1, 2, 2, 1, 1, 0, 0
 };
 
-static bool
+bool
 nv50_fb_memtype_valid(struct nouveau_fb *pfb, u32 memtype)
 {
        return nv50_fb_memtype[(memtype & 0xff00) >> 8] != 0;
@@ -259,7 +259,6 @@ nv50_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
                nv_warn(priv, "failed 0x100c08 page alloc\n");
        }
 
-       priv->base.memtype_valid = nv50_fb_memtype_valid;
        nv_subdev(priv)->intr = nv50_fb_intr;
        return 0;
 }
@@ -311,6 +310,7 @@ nv50_fb_oclass = &(struct nv50_fb_impl) {
                .init = nv50_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .base.memtype = nv50_fb_memtype_valid,
        .base.ram = &nv50_ram_oclass,
        .trap = 0x000707ff,
 }.base.base;
index a1a9420529908b48eb0055674dddca5df252408a..ada4eaa4fa430b448016873496d90ef2fefc0af4 100644 (file)
@@ -20,4 +20,7 @@ struct nv50_fb_impl {
        u32 trap;
 };
 
+void __nv50_ram_put(struct nouveau_fb *, struct nouveau_mem *);
+extern int nv50_fb_memtype[0x80];
+
 #endif
index 4ad25349f68931286afd8020844574e6deb77b18..cf0e767d38339c0360f2690e1a6b2bf3cdb5d8aa 100644 (file)
@@ -33,6 +33,7 @@ nv84_fb_oclass = &(struct nv50_fb_impl) {
                .init = nv50_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .base.memtype = nv50_fb_memtype_valid,
        .base.ram = &nv50_ram_oclass,
        .trap = 0x001d07ff,
 }.base.base;
index 8b52839ba80e7cebf5337e155acbdf551a881add..7557b31599fbd851256399ca97f7bc1ce53a43ee 100644 (file)
@@ -33,6 +33,7 @@ nva3_fb_oclass = &(struct nv50_fb_impl) {
                .init = nv50_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .base.memtype = nv50_fb_memtype_valid,
        .base.ram = &nv50_ram_oclass,
        .trap = 0x000d0fff,
 }.base.base;
index ce784ba9cbf4e14522ca48a7d78bb02dbfefef65..12e5c87aa3c1fb14a52f93622c5bad22be0ab8ee 100644 (file)
@@ -33,6 +33,7 @@ nvaa_fb_oclass = &(struct nv50_fb_impl) {
                .init = nv50_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .base.memtype = nv50_fb_memtype_valid,
        .base.ram = &nv50_ram_oclass,
        .trap = 0x001d07ff,
 }.base.base;
index aaa2e84732be758b70fda827f305eec36451e3ac..244740e572c3d841110f7179222d7cab28b25712 100644 (file)
@@ -33,6 +33,7 @@ nvaf_fb_oclass = &(struct nv50_fb_impl) {
                .init = nv50_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .base.memtype = nv50_fb_memtype_valid,
        .base.ram = &nv50_ram_oclass,
        .trap = 0x089d1fff,
 }.base.base;
index f10f3db17e23530a98a7c84cd3f9321f851bfdf1..7fa6a91a5866c8cfbc161b565081cd5f440204ec 100644 (file)
@@ -22,7 +22,7 @@
  * Authors: Ben Skeggs
  */
 
-#include "priv.h"
+#include "nv04.h"
 
 struct nvc0_fb_priv {
        struct nouveau_fb base;
@@ -83,8 +83,6 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        if (ret)
                return ret;
 
-       priv->base.memtype_valid = nvc0_fb_memtype_valid;
-
        priv->r100c10_page = alloc_page(GFP_KERNEL | __GFP_ZERO);
        if (priv->r100c10_page) {
                priv->r100c10 = pci_map_page(device->pdev, priv->r100c10_page,
@@ -97,7 +95,6 @@ nvc0_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
        return 0;
 }
 
-
 struct nouveau_oclass *
 nvc0_fb_oclass = &(struct nouveau_fb_impl) {
        .base.handle = NV_SUBDEV(FB, 0xc0),
@@ -107,5 +104,6 @@ nvc0_fb_oclass = &(struct nouveau_fb_impl) {
                .init = nvc0_fb_init,
                .fini = _nouveau_fb_fini,
        },
+       .memtype = nvc0_fb_memtype_valid,
        .ram = &nvc0_ram_oclass,
 }.base;
index af7ee02bb5e1596d72a57b938e968ef78d98c426..abd391e8051b7cb1361631b003ed00e916c8ee5e 100644 (file)
@@ -54,40 +54,13 @@ int  _nouveau_fb_fini(struct nouveau_object *, bool);
 struct nouveau_fb_impl {
        struct nouveau_oclass base;
        struct nouveau_oclass *ram;
+       bool (*memtype)(struct nouveau_fb *, u32);
 };
 
-struct nouveau_bios;
-int  nouveau_fb_bios_memtype(struct nouveau_bios *);
-
 bool nv04_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
+bool nv50_fb_memtype_valid(struct nouveau_fb *, u32 memtype);
 
-void nv10_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
-                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
-void nv10_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
-void nv10_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
-
-void nv20_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
-                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
-void nv20_fb_tile_fini(struct nouveau_fb *, int i, struct nouveau_fb_tile *);
-void nv20_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
-
-int  nv30_fb_init(struct nouveau_object *);
-void nv30_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
-                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
-
-void nv40_fb_tile_comp(struct nouveau_fb *, int i, u32 size, u32 flags,
-                      struct nouveau_fb_tile *);
-
-int  nv41_fb_init(struct nouveau_object *);
-void nv41_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
-
-int  nv44_fb_init(struct nouveau_object *);
-void nv44_fb_tile_prog(struct nouveau_fb *, int, struct nouveau_fb_tile *);
-
-void nv46_fb_tile_init(struct nouveau_fb *, int i, u32 addr, u32 size,
-                      u32 pitch, u32 flags, struct nouveau_fb_tile *);
-
-void __nv50_ram_put(struct nouveau_fb *, struct nouveau_mem *);
-extern int nv50_fb_memtype[0x80];
+struct nouveau_bios;
+int  nouveau_fb_bios_memtype(struct nouveau_bios *);
 
 #endif
index 903baff77fddcc20e8e2f18a6df808d66c0d316d..0b6e2b86d7a912fea4b6ada34533bb61603c3a75 100644 (file)
@@ -24,7 +24,8 @@
 
 #include <subdev/bios.h>
 #include <core/mm.h>
-#include "priv.h"
+
+#include "nv50.h"
 
 void
 __nv50_ram_put(struct nouveau_fb *pfb, struct nouveau_mem *mem)
index cf97c4de4a6b2911722da3b1799487f217cfb560..f81afb83a163f52a62a1329149589d029feed127 100644 (file)
@@ -26,6 +26,7 @@
 #include <subdev/ltcg.h>
 
 #include "priv.h"
+#include "nv50.h"
 
 extern const u8 nvc0_pte_storage_type_map[256];