Skip to content

Commit

Permalink
drm/nouveau/fb: remove ram oclass argument from base fb constructor
Browse files Browse the repository at this point in the history
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
  • Loading branch information
Ben Skeggs committed Nov 8, 2013
1 parent 9ca3037 commit 8613e73
Show file tree
Hide file tree
Showing 24 changed files with 135 additions and 107 deletions.
13 changes: 7 additions & 6 deletions drivers/gpu/drm/nouveau/core/subdev/fb/base.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,10 @@
* Authors: Ben Skeggs
*/

#include "subdev/fb.h"
#include "subdev/bios.h"
#include "subdev/bios/bit.h"
#include <subdev/bios.h>
#include <subdev/bios/bit.h>

#include "priv.h"

int
nouveau_fb_bios_memtype(struct nouveau_bios *bios)
Expand Down Expand Up @@ -106,9 +107,9 @@ _nouveau_fb_dtor(struct nouveau_object *object)

int
nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, struct nouveau_oclass *ramcls,
int length, void **pobject)
struct nouveau_oclass *oclass, int length, void **pobject)
{
struct nouveau_fb_impl *impl = (void *)oclass;
static const char *name[] = {
[NV_MEM_TYPE_UNKNOWN] = "unknown",
[NV_MEM_TYPE_STOLEN ] = "stolen system memory",
Expand All @@ -133,7 +134,7 @@ nouveau_fb_create_(struct nouveau_object *parent, struct nouveau_object *engine,
return ret;

ret = nouveau_object_ctor(nv_object(pfb), nv_object(pfb),
ramcls, NULL, 0, &ram);
impl->ram, NULL, 0, &ram);
if (ret) {
nv_fatal(pfb, "error detecting memory configuration!!\n");
return ret;
Expand Down
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv04.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv04_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv04_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -75,12 +75,13 @@ nv04_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv04_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x04),
.ofuncs = &(struct nouveau_ofuncs) {
nv04_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x04),
.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;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv10.c
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ nv10_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv10_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv10_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -79,12 +79,13 @@ nv10_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv10_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x10),
.ofuncs = &(struct nouveau_ofuncs) {
nv10_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x10),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv10_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = _nouveau_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv10_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv1a.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ nv1a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv1a_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv1a_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -52,12 +52,13 @@ nv1a_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv1a_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x1a),
.ofuncs = &(struct nouveau_ofuncs) {
nv1a_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x1a),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv1a_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = _nouveau_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv10_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv20.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ nv20_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv20_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv20_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -103,12 +103,13 @@ nv20_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv20_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x20),
.ofuncs = &(struct nouveau_ofuncs) {
nv20_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x20),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv20_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = _nouveau_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv20_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv25.c
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ nv25_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv25_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv20_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -69,12 +69,13 @@ nv25_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv25_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x25),
.ofuncs = &(struct nouveau_ofuncs) {
nv25_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x25),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv25_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = _nouveau_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv20_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv30.c
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ nv30_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv30_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv20_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -147,12 +147,13 @@ nv30_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv30_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x30),
.ofuncs = &(struct nouveau_ofuncs) {
nv30_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x30),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv30_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv30_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv20_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv35.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ nv35_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv35_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv20_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -70,12 +70,13 @@ nv35_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv35_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x35),
.ofuncs = &(struct nouveau_ofuncs) {
nv35_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x35),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv35_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv30_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv20_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv36.c
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ nv36_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv36_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv20_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -70,12 +70,13 @@ nv36_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}

struct nouveau_oclass *
nv36_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x36),
.ofuncs = &(struct nouveau_ofuncs) {
nv36_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x36),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv36_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv30_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv20_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv40.c
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ nv40_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv40_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv40_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -85,12 +85,13 @@ nv40_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,


struct nouveau_oclass *
nv40_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x40),
.ofuncs = &(struct nouveau_ofuncs) {
nv40_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x40),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv40_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv40_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv40_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv41.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ nv41_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv41_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv41_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -78,12 +78,13 @@ nv41_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,


struct nouveau_oclass *
nv41_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x41),
.ofuncs = &(struct nouveau_ofuncs) {
nv41_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x41),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv41_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv41_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv41_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv44.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ nv44_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv44_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv44_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -87,12 +87,13 @@ nv44_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,


struct nouveau_oclass *
nv44_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x44),
.ofuncs = &(struct nouveau_ofuncs) {
nv44_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x44),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv44_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv44_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv44_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv46.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ nv46_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv46_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv44_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -67,12 +67,13 @@ nv46_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,


struct nouveau_oclass *
nv46_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x46),
.ofuncs = &(struct nouveau_ofuncs) {
nv46_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x46),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv46_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv44_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv44_ram_oclass,
}.base;
11 changes: 6 additions & 5 deletions drivers/gpu/drm/nouveau/core/subdev/fb/nv47.c
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ nv47_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nv47_fb_priv *priv;
int ret;

ret = nouveau_fb_create(parent, engine, oclass, &nv41_ram_oclass, &priv);
ret = nouveau_fb_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
Expand All @@ -54,12 +54,13 @@ nv47_fb_ctor(struct nouveau_object *parent, struct nouveau_object *engine,


struct nouveau_oclass *
nv47_fb_oclass = &(struct nouveau_oclass) {
.handle = NV_SUBDEV(FB, 0x47),
.ofuncs = &(struct nouveau_ofuncs) {
nv47_fb_oclass = &(struct nouveau_fb_impl) {
.base.handle = NV_SUBDEV(FB, 0x47),
.base.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv47_fb_ctor,
.dtor = _nouveau_fb_dtor,
.init = nv41_fb_init,
.fini = _nouveau_fb_fini,
},
};
.ram = &nv41_ram_oclass,
}.base;
Loading

0 comments on commit 8613e73

Please sign in to comment.