Commit e7c29683 authored by Ben Skeggs's avatar Ben Skeggs
Browse files

drm/nouveau/mpeg: namespace + nvidia gpu names (no binary change)



The namespace of NVKM is being changed to nvkm_ instead of nouveau_,
which will be used for the DRM part of the driver.  This is being
done in order to make it very clear as to what part of the driver a
given symbol belongs to, and as a minor step towards splitting the
DRM driver out to be able to stand on its own (for virt).

Because there's already a large amount of churn here anyway, this is
as good a time as any to also switch to NVIDIA's device and chipset
naming to ease collaboration with them.

A comparison of objdump disassemblies proves no code changes.
Signed-off-by: default avatarBen Skeggs <bskeggs@redhat.com>
parent e3c71eb2
#ifndef __NOUVEAU_MPEG_H__
#define __NOUVEAU_MPEG_H__
#include <core/engine.h>
#ifndef __NVKM_MPEG_H__
#define __NVKM_MPEG_H__
#include <core/engctx.h>
struct nouveau_mpeg_chan {
struct nouveau_engctx base;
struct nvkm_mpeg_chan {
struct nvkm_engctx base;
};
#define nouveau_mpeg_context_create(p,e,c,g,s,a,f,d) \
nouveau_engctx_create((p), (e), (c), (g), (s), (a), (f), (d))
#define nouveau_mpeg_context_destroy(d) \
nouveau_engctx_destroy(&(d)->base)
#define nouveau_mpeg_context_init(d) \
nouveau_engctx_init(&(d)->base)
#define nouveau_mpeg_context_fini(d,s) \
nouveau_engctx_fini(&(d)->base, (s))
#define _nouveau_mpeg_context_dtor _nouveau_engctx_dtor
#define _nouveau_mpeg_context_init _nouveau_engctx_init
#define _nouveau_mpeg_context_fini _nouveau_engctx_fini
#define _nouveau_mpeg_context_rd32 _nouveau_engctx_rd32
#define _nouveau_mpeg_context_wr32 _nouveau_engctx_wr32
struct nouveau_mpeg {
struct nouveau_engine base;
};
#define nvkm_mpeg_context_create(p,e,c,g,s,a,f,d) \
nvkm_engctx_create((p), (e), (c), (g), (s), (a), (f), (d))
#define nvkm_mpeg_context_destroy(d) \
nvkm_engctx_destroy(&(d)->base)
#define nvkm_mpeg_context_init(d) \
nvkm_engctx_init(&(d)->base)
#define nvkm_mpeg_context_fini(d,s) \
nvkm_engctx_fini(&(d)->base, (s))
#define _nvkm_mpeg_context_dtor _nvkm_engctx_dtor
#define _nvkm_mpeg_context_init _nvkm_engctx_init
#define _nvkm_mpeg_context_fini _nvkm_engctx_fini
#define _nvkm_mpeg_context_rd32 _nvkm_engctx_rd32
#define _nvkm_mpeg_context_wr32 _nvkm_engctx_wr32
#define nouveau_mpeg_create(p,e,c,d) \
nouveau_engine_create((p), (e), (c), true, "PMPEG", "mpeg", (d))
#define nouveau_mpeg_destroy(d) \
nouveau_engine_destroy(&(d)->base)
#define nouveau_mpeg_init(d) \
nouveau_engine_init(&(d)->base)
#define nouveau_mpeg_fini(d,s) \
nouveau_engine_fini(&(d)->base, (s))
#define _nouveau_mpeg_dtor _nouveau_engine_dtor
#define _nouveau_mpeg_init _nouveau_engine_init
#define _nouveau_mpeg_fini _nouveau_engine_fini
extern struct nouveau_oclass nv31_mpeg_oclass;
extern struct nouveau_oclass nv40_mpeg_oclass;
extern struct nouveau_oclass nv44_mpeg_oclass;
extern struct nouveau_oclass nv50_mpeg_oclass;
extern struct nouveau_oclass nv84_mpeg_oclass;
extern struct nouveau_ofuncs nv31_mpeg_ofuncs;
extern struct nouveau_oclass nv31_mpeg_cclass;
extern struct nouveau_oclass nv31_mpeg_sclass[];
extern struct nouveau_oclass nv40_mpeg_sclass[];
void nv31_mpeg_intr(struct nouveau_subdev *);
void nv31_mpeg_tile_prog(struct nouveau_engine *, int);
int nv31_mpeg_init(struct nouveau_object *);
extern struct nouveau_ofuncs nv50_mpeg_ofuncs;
int nv50_mpeg_context_ctor(struct nouveau_object *, struct nouveau_object *,
struct nouveau_oclass *, void *, u32,
struct nouveau_object **);
void nv50_mpeg_intr(struct nouveau_subdev *);
int nv50_mpeg_init(struct nouveau_object *);
#include <core/engine.h>
struct nvkm_mpeg {
struct nvkm_engine base;
};
#define nvkm_mpeg_create(p,e,c,d) \
nvkm_engine_create((p), (e), (c), true, "PMPEG", "mpeg", (d))
#define nvkm_mpeg_destroy(d) \
nvkm_engine_destroy(&(d)->base)
#define nvkm_mpeg_init(d) \
nvkm_engine_init(&(d)->base)
#define nvkm_mpeg_fini(d,s) \
nvkm_engine_fini(&(d)->base, (s))
#define _nvkm_mpeg_dtor _nvkm_engine_dtor
#define _nvkm_mpeg_init _nvkm_engine_init
#define _nvkm_mpeg_fini _nvkm_engine_fini
extern struct nvkm_oclass nv31_mpeg_oclass;
extern struct nvkm_oclass nv40_mpeg_oclass;
extern struct nvkm_oclass nv44_mpeg_oclass;
extern struct nvkm_oclass nv50_mpeg_oclass;
extern struct nvkm_oclass g84_mpeg_oclass;
extern struct nvkm_ofuncs nv31_mpeg_ofuncs;
extern struct nvkm_oclass nv31_mpeg_cclass;
extern struct nvkm_oclass nv31_mpeg_sclass[];
extern struct nvkm_oclass nv40_mpeg_sclass[];
void nv31_mpeg_intr(struct nvkm_subdev *);
void nv31_mpeg_tile_prog(struct nvkm_engine *, int);
int nv31_mpeg_init(struct nvkm_object *);
extern struct nvkm_ofuncs nv50_mpeg_ofuncs;
int nv50_mpeg_context_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
struct nvkm_object **);
void nv50_mpeg_intr(struct nvkm_subdev *);
int nv50_mpeg_init(struct nvkm_object *);
#endif
......@@ -109,7 +109,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -138,7 +138,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -167,7 +167,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -196,7 +196,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -225,7 +225,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -283,7 +283,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
......@@ -371,7 +371,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &nv84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MPEG ] = &g84_mpeg_oclass;
device->oclass[NVDEV_ENGINE_MSPDEC ] = &nv98_mspdec_oclass;
device->oclass[NVDEV_ENGINE_MSVLD ] = &nv98_msvld_oclass;
device->oclass[NVDEV_ENGINE_MSPPP ] = &nv98_msppp_oclass;
......
......@@ -2,4 +2,4 @@ nvkm-y += nvkm/engine/mpeg/nv31.o
nvkm-y += nvkm/engine/mpeg/nv40.o
nvkm-y += nvkm/engine/mpeg/nv44.o
nvkm-y += nvkm/engine/mpeg/nv50.o
nvkm-y += nvkm/engine/mpeg/nv84.o
nvkm-y += nvkm/engine/mpeg/g84.o
......@@ -21,30 +21,22 @@
*
* Authors: Ben Skeggs
*/
#include <core/os.h>
#include <core/engctx.h>
#include <subdev/mmu.h>
#include <subdev/bar.h>
#include <subdev/timer.h>
#include <engine/mpeg.h>
struct nv84_mpeg_priv {
struct nouveau_mpeg base;
struct g84_mpeg_priv {
struct nvkm_mpeg base;
};
struct nv84_mpeg_chan {
struct nouveau_mpeg_chan base;
struct g84_mpeg_chan {
struct nvkm_mpeg_chan base;
};
/*******************************************************************************
* MPEG object classes
******************************************************************************/
static struct nouveau_oclass
nv84_mpeg_sclass[] = {
static struct nvkm_oclass
g84_mpeg_sclass[] = {
{ 0x8274, &nv50_mpeg_ofuncs },
{}
};
......@@ -53,16 +45,16 @@ nv84_mpeg_sclass[] = {
* PMPEG context
******************************************************************************/
static struct nouveau_oclass
nv84_mpeg_cclass = {
static struct nvkm_oclass
g84_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x84),
.ofuncs = &(struct nouveau_ofuncs) {
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_mpeg_context_ctor,
.dtor = _nouveau_mpeg_context_dtor,
.init = _nouveau_mpeg_context_init,
.fini = _nouveau_mpeg_context_fini,
.rd32 = _nouveau_mpeg_context_rd32,
.wr32 = _nouveau_mpeg_context_wr32,
.dtor = _nvkm_mpeg_context_dtor,
.init = _nvkm_mpeg_context_init,
.fini = _nvkm_mpeg_context_fini,
.rd32 = _nvkm_mpeg_context_rd32,
.wr32 = _nvkm_mpeg_context_wr32,
},
};
......@@ -71,32 +63,32 @@ nv84_mpeg_cclass = {
******************************************************************************/
static int
nv84_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
g84_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
struct nv84_mpeg_priv *priv;
struct g84_mpeg_priv *priv;
int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv);
ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
nv_subdev(priv)->unit = 0x00000002;
nv_subdev(priv)->intr = nv50_mpeg_intr;
nv_engine(priv)->cclass = &nv84_mpeg_cclass;
nv_engine(priv)->sclass = nv84_mpeg_sclass;
nv_engine(priv)->cclass = &g84_mpeg_cclass;
nv_engine(priv)->sclass = g84_mpeg_sclass;
return 0;
}
struct nouveau_oclass
nv84_mpeg_oclass = {
struct nvkm_oclass
g84_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x84),
.ofuncs = &(struct nouveau_ofuncs) {
.ctor = nv84_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor,
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = g84_mpeg_ctor,
.dtor = _nvkm_mpeg_dtor,
.init = nv50_mpeg_init,
.fini = _nouveau_mpeg_fini,
.fini = _nvkm_mpeg_fini,
},
};
......@@ -21,35 +21,30 @@
*
* Authors: Ben Skeggs
*/
#include "nv31.h"
#include <core/client.h>
#include <core/os.h>
#include <core/engctx.h>
#include <core/handle.h>
#include <engine/fifo.h>
#include <subdev/instmem.h>
#include <subdev/fb.h>
#include <subdev/timer.h>
#include <subdev/instmem.h>
#include <engine/fifo.h>
#include <engine/mpeg.h>
#include <engine/mpeg/nv31.h>
/*******************************************************************************
* MPEG object classes
******************************************************************************/
static int
nv31_mpeg_object_ctor(struct nouveau_object *parent,
struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
nv31_mpeg_object_ctor(struct nvkm_object *parent,
struct nvkm_object *engine,
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
struct nouveau_gpuobj *obj;
struct nvkm_gpuobj *obj;
int ret;
ret = nouveau_gpuobj_create(parent, engine, oclass, 0, parent,
20, 16, 0, &obj);
ret = nvkm_gpuobj_create(parent, engine, oclass, 0, parent,
20, 16, 0, &obj);
*pobject = nv_object(obj);
if (ret)
return ret;
......@@ -62,9 +57,9 @@ nv31_mpeg_object_ctor(struct nouveau_object *parent,
}
static int
nv31_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
nv31_mpeg_mthd_dma(struct nvkm_object *object, u32 mthd, void *arg, u32 len)
{
struct nouveau_instmem *imem = nouveau_instmem(object);
struct nvkm_instmem *imem = nvkm_instmem(object);
struct nv31_mpeg_priv *priv = (void *)object->engine;
u32 inst = *(u32 *)arg << 4;
u32 dma0 = nv_ro32(imem, inst + 0);
......@@ -100,17 +95,17 @@ nv31_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
return 0;
}
struct nouveau_ofuncs
struct nvkm_ofuncs
nv31_mpeg_ofuncs = {
.ctor = nv31_mpeg_object_ctor,
.dtor = _nouveau_gpuobj_dtor,
.init = _nouveau_gpuobj_init,
.fini = _nouveau_gpuobj_fini,
.rd32 = _nouveau_gpuobj_rd32,
.wr32 = _nouveau_gpuobj_wr32,
.dtor = _nvkm_gpuobj_dtor,
.init = _nvkm_gpuobj_init,
.fini = _nvkm_gpuobj_fini,
.rd32 = _nvkm_gpuobj_rd32,
.wr32 = _nvkm_gpuobj_wr32,
};
static struct nouveau_omthds
static struct nvkm_omthds
nv31_mpeg_omthds[] = {
{ 0x0190, 0x0190, nv31_mpeg_mthd_dma },
{ 0x01a0, 0x01a0, nv31_mpeg_mthd_dma },
......@@ -118,7 +113,7 @@ nv31_mpeg_omthds[] = {
{}
};
struct nouveau_oclass
struct nvkm_oclass
nv31_mpeg_sclass[] = {
{ 0x3174, &nv31_mpeg_ofuncs, nv31_mpeg_omthds },
{}
......@@ -129,17 +124,17 @@ nv31_mpeg_sclass[] = {
******************************************************************************/
static int
nv31_mpeg_context_ctor(struct nouveau_object *parent,
struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
nv31_mpeg_context_ctor(struct nvkm_object *parent,
struct nvkm_object *engine,
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
struct nv31_mpeg_priv *priv = (void *)engine;
struct nv31_mpeg_chan *chan;
unsigned long flags;
int ret;
ret = nouveau_object_create(parent, engine, oclass, 0, &chan);
ret = nvkm_object_create(parent, engine, oclass, 0, &chan);
*pobject = nv_object(chan);
if (ret)
return ret;
......@@ -147,7 +142,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent,
spin_lock_irqsave(&nv_engine(priv)->lock, flags);
if (priv->chan) {
spin_unlock_irqrestore(&nv_engine(priv)->lock, flags);
nouveau_object_destroy(&chan->base);
nvkm_object_destroy(&chan->base);
*pobject = NULL;
return -EBUSY;
}
......@@ -157,7 +152,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent,
}
static void
nv31_mpeg_context_dtor(struct nouveau_object *object)
nv31_mpeg_context_dtor(struct nvkm_object *object)
{
struct nv31_mpeg_priv *priv = (void *)object->engine;
struct nv31_mpeg_chan *chan = (void *)object;
......@@ -166,17 +161,17 @@ nv31_mpeg_context_dtor(struct nouveau_object *object)
spin_lock_irqsave(&nv_engine(priv)->lock, flags);
priv->chan = NULL;
spin_unlock_irqrestore(&nv_engine(priv)->lock, flags);
nouveau_object_destroy(&chan->base);
nvkm_object_destroy(&chan->base);
}
struct nouveau_oclass
struct nvkm_oclass
nv31_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x31),
.ofuncs = &(struct nouveau_ofuncs) {
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv31_mpeg_context_ctor,
.dtor = nv31_mpeg_context_dtor,
.init = nouveau_object_init,
.fini = nouveau_object_fini,
.init = nvkm_object_init,
.fini = nvkm_object_fini,
},
};
......@@ -185,9 +180,9 @@ nv31_mpeg_cclass = {
******************************************************************************/
void
nv31_mpeg_tile_prog(struct nouveau_engine *engine, int i)
nv31_mpeg_tile_prog(struct nvkm_engine *engine, int i)
{
struct nouveau_fb_tile *tile = &nouveau_fb(engine)->tile.region[i];
struct nvkm_fb_tile *tile = &nvkm_fb(engine)->tile.region[i];
struct nv31_mpeg_priv *priv = (void *)engine;
nv_wr32(priv, 0x00b008 + (i * 0x10), tile->pitch);
......@@ -196,12 +191,12 @@ nv31_mpeg_tile_prog(struct nouveau_engine *engine, int i)
}
void
nv31_mpeg_intr(struct nouveau_subdev *subdev)
nv31_mpeg_intr(struct nvkm_subdev *subdev)
{
struct nv31_mpeg_priv *priv = (void *)subdev;
struct nouveau_fifo *pfifo = nouveau_fifo(subdev);
struct nouveau_handle *handle;
struct nouveau_object *engctx;
struct nvkm_fifo *pfifo = nvkm_fifo(subdev);
struct nvkm_handle *handle;
struct nvkm_object *engctx;
u32 stat = nv_rd32(priv, 0x00b100);
u32 type = nv_rd32(priv, 0x00b230);
u32 mthd = nv_rd32(priv, 0x00b234);
......@@ -220,10 +215,10 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev)
}
if (type == 0x00000010 && engctx) {
handle = nouveau_handle_get_class(engctx, 0x3174);
handle = nvkm_handle_get_class(engctx, 0x3174);
if (handle && !nv_call(handle->object, mthd, data))
show &= ~0x01000000;
nouveau_handle_put(handle);
nvkm_handle_put(handle);
}
}
......@@ -233,21 +228,21 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev)
if (show) {
nv_error(priv, "ch %d [%s] 0x%08x 0x%08x 0x%08x 0x%08x\n",
pfifo->chid(pfifo, engctx),
nouveau_client_name(engctx), stat, type, mthd, data);
nvkm_client_name(engctx), stat, type, mthd, data);
}
spin_unlock_irqrestore(&nv_engine(priv)->lock, flags);
}
static int
nv31_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject)
nv31_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
struct nv31_mpeg_priv *priv;
int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv);
ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv);
if (ret)
return ret;
......@@ -261,14 +256,14 @@ nv31_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
}
int
nv31_mpeg_init(struct nouveau_object *object)
nv31_mpeg_init(struct nvkm_object *object)
{
struct nouveau_engine *engine = nv_engine(object);
struct nvkm_engine *engine = nv_engine(object);
struct nv31_mpeg_priv *priv = (void *)object;
struct nouveau_fb *pfb = nouveau_fb(object);
struct nvkm_fb *pfb = nvkm_fb(object);
int ret, i;
ret = nouveau_mpeg_init(&priv->base);
ret = nvkm_mpeg_init(&priv->base);
if (ret)
return ret;
......@@ -297,13 +292,13 @@ nv31_mpeg_init(struct nouveau_object *object)
return 0;
}
struct nouveau_oclass
struct nvkm_oclass
nv31_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x31),
.ofuncs = &(struct nouveau_ofuncs) {
.ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv31_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor,
.dtor = _nvkm_mpeg_dtor,
.init = nv31_mpeg_init,
.fini = _nouveau_mpeg_fini,
.fini = _nvkm_mpeg_fini,
},
};
#ifndef __NV31_MPEG_H__
#define __NV31_MPEG_H__
#include <engine/mpeg.h>
struct nv31_mpeg_chan {
struct nouveau_object base;
struct nvkm_object base;
};
struct nv31_mpeg_priv {
struct nouveau_mpeg base;
struct nvkm_mpeg base;
struct nv31_mpeg_chan *chan;
};
#endif
......@@ -21,25 +21,18 @@
*
* Authors: Ben Skeggs
*/
#include "nv31.h"
#include <core/os.h>
#include <core/engctx.h>
#include <subdev/fb.h>
#include <subdev/timer.h>
#include <subdev/instmem.h>
#include <engine/mpeg.h>
#include <engine/mpeg/nv31.h>
/*******************************************************************************
* MPEG object classes
******************************************************************************/
static int
nv40_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
nv40_mpeg_mthd_dma(struct nvkm_object *object, u32 mthd, void *arg, u32 len)
{
struct nouveau_instmem *imem = nouveau_instmem(object);
struct nvkm_instmem *imem = nvkm_instmem(object);
struct nv31_mpeg_priv *priv = (void *)object->engine;
u32 inst = *(u32 *)arg << 4;
u32 dma0 = nv_ro32(imem, inst + 0);
......@@ -75,7 +68,7 @@ nv40_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
return 0;
}
static struct nouveau_omthds
static struct nvkm_omthds