Commit e7c29683 authored by Ben Skeggs's avatar Ben Skeggs

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__ #ifndef __NVKM_MPEG_H__
#define __NOUVEAU_MPEG_H__ #define __NVKM_MPEG_H__
#include <core/engine.h>
#include <core/engctx.h> #include <core/engctx.h>
struct nouveau_mpeg_chan { struct nvkm_mpeg_chan {
struct nouveau_engctx base; struct nvkm_engctx base;
}; };
#define nouveau_mpeg_context_create(p,e,c,g,s,a,f,d) \ #define nvkm_mpeg_context_create(p,e,c,g,s,a,f,d) \
nouveau_engctx_create((p), (e), (c), (g), (s), (a), (f), (d)) nvkm_engctx_create((p), (e), (c), (g), (s), (a), (f), (d))
#define nouveau_mpeg_context_destroy(d) \ #define nvkm_mpeg_context_destroy(d) \
nouveau_engctx_destroy(&(d)->base) nvkm_engctx_destroy(&(d)->base)
#define nouveau_mpeg_context_init(d) \ #define nvkm_mpeg_context_init(d) \
nouveau_engctx_init(&(d)->base) nvkm_engctx_init(&(d)->base)
#define nouveau_mpeg_context_fini(d,s) \ #define nvkm_mpeg_context_fini(d,s) \
nouveau_engctx_fini(&(d)->base, (s)) nvkm_engctx_fini(&(d)->base, (s))
#define _nouveau_mpeg_context_dtor _nouveau_engctx_dtor #define _nvkm_mpeg_context_dtor _nvkm_engctx_dtor
#define _nouveau_mpeg_context_init _nouveau_engctx_init #define _nvkm_mpeg_context_init _nvkm_engctx_init
#define _nouveau_mpeg_context_fini _nouveau_engctx_fini #define _nvkm_mpeg_context_fini _nvkm_engctx_fini
#define _nouveau_mpeg_context_rd32 _nouveau_engctx_rd32 #define _nvkm_mpeg_context_rd32 _nvkm_engctx_rd32
#define _nouveau_mpeg_context_wr32 _nouveau_engctx_wr32 #define _nvkm_mpeg_context_wr32 _nvkm_engctx_wr32
struct nouveau_mpeg {
struct nouveau_engine base;
};
#define nouveau_mpeg_create(p,e,c,d) \ #include <core/engine.h>
nouveau_engine_create((p), (e), (c), true, "PMPEG", "mpeg", (d))
#define nouveau_mpeg_destroy(d) \ struct nvkm_mpeg {
nouveau_engine_destroy(&(d)->base) struct nvkm_engine 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 *);
#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 #endif
...@@ -109,7 +109,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -109,7 +109,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -138,7 +138,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -138,7 +138,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -167,7 +167,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -167,7 +167,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -196,7 +196,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -196,7 +196,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -225,7 +225,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -225,7 +225,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -283,7 +283,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -283,7 +283,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_VP ] = &nv84_vp_oclass;
device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass; device->oclass[NVDEV_ENGINE_CIPHER ] = &g84_cipher_oclass;
device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass; device->oclass[NVDEV_ENGINE_BSP ] = &g84_bsp_oclass;
...@@ -371,7 +371,7 @@ nv50_identify(struct nouveau_device *device) ...@@ -371,7 +371,7 @@ nv50_identify(struct nouveau_device *device)
device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass; device->oclass[NVDEV_ENGINE_FIFO ] = g84_fifo_oclass;
device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass; device->oclass[NVDEV_ENGINE_SW ] = nv50_sw_oclass;
device->oclass[NVDEV_ENGINE_GR ] = &nv50_gr_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_MSPDEC ] = &nv98_mspdec_oclass;
device->oclass[NVDEV_ENGINE_MSVLD ] = &nv98_msvld_oclass; device->oclass[NVDEV_ENGINE_MSVLD ] = &nv98_msvld_oclass;
device->oclass[NVDEV_ENGINE_MSPPP ] = &nv98_msppp_oclass; device->oclass[NVDEV_ENGINE_MSPPP ] = &nv98_msppp_oclass;
......
...@@ -2,4 +2,4 @@ nvkm-y += nvkm/engine/mpeg/nv31.o ...@@ -2,4 +2,4 @@ nvkm-y += nvkm/engine/mpeg/nv31.o
nvkm-y += nvkm/engine/mpeg/nv40.o nvkm-y += nvkm/engine/mpeg/nv40.o
nvkm-y += nvkm/engine/mpeg/nv44.o nvkm-y += nvkm/engine/mpeg/nv44.o
nvkm-y += nvkm/engine/mpeg/nv50.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 @@ ...@@ -21,30 +21,22 @@
* *
* Authors: Ben Skeggs * 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> #include <engine/mpeg.h>
struct nv84_mpeg_priv { struct g84_mpeg_priv {
struct nouveau_mpeg base; struct nvkm_mpeg base;
}; };
struct nv84_mpeg_chan { struct g84_mpeg_chan {
struct nouveau_mpeg_chan base; struct nvkm_mpeg_chan base;
}; };
/******************************************************************************* /*******************************************************************************
* MPEG object classes * MPEG object classes
******************************************************************************/ ******************************************************************************/
static struct nouveau_oclass static struct nvkm_oclass
nv84_mpeg_sclass[] = { g84_mpeg_sclass[] = {
{ 0x8274, &nv50_mpeg_ofuncs }, { 0x8274, &nv50_mpeg_ofuncs },
{} {}
}; };
...@@ -53,16 +45,16 @@ nv84_mpeg_sclass[] = { ...@@ -53,16 +45,16 @@ nv84_mpeg_sclass[] = {
* PMPEG context * PMPEG context
******************************************************************************/ ******************************************************************************/
static struct nouveau_oclass static struct nvkm_oclass
nv84_mpeg_cclass = { g84_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x84), .handle = NV_ENGCTX(MPEG, 0x84),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_mpeg_context_ctor, .ctor = nv50_mpeg_context_ctor,
.dtor = _nouveau_mpeg_context_dtor, .dtor = _nvkm_mpeg_context_dtor,
.init = _nouveau_mpeg_context_init, .init = _nvkm_mpeg_context_init,
.fini = _nouveau_mpeg_context_fini, .fini = _nvkm_mpeg_context_fini,
.rd32 = _nouveau_mpeg_context_rd32, .rd32 = _nvkm_mpeg_context_rd32,
.wr32 = _nouveau_mpeg_context_wr32, .wr32 = _nvkm_mpeg_context_wr32,
}, },
}; };
...@@ -71,32 +63,32 @@ nv84_mpeg_cclass = { ...@@ -71,32 +63,32 @@ nv84_mpeg_cclass = {
******************************************************************************/ ******************************************************************************/
static int static int
nv84_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, g84_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv84_mpeg_priv *priv; struct g84_mpeg_priv *priv;
int ret; int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv); ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
nv_subdev(priv)->unit = 0x00000002; nv_subdev(priv)->unit = 0x00000002;
nv_subdev(priv)->intr = nv50_mpeg_intr; nv_subdev(priv)->intr = nv50_mpeg_intr;
nv_engine(priv)->cclass = &nv84_mpeg_cclass; nv_engine(priv)->cclass = &g84_mpeg_cclass;
nv_engine(priv)->sclass = nv84_mpeg_sclass; nv_engine(priv)->sclass = g84_mpeg_sclass;
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv84_mpeg_oclass = { g84_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x84), .handle = NV_ENGINE(MPEG, 0x84),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv84_mpeg_ctor, .ctor = g84_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor, .dtor = _nvkm_mpeg_dtor,
.init = nv50_mpeg_init, .init = nv50_mpeg_init,
.fini = _nouveau_mpeg_fini, .fini = _nvkm_mpeg_fini,
}, },
}; };
...@@ -21,35 +21,30 @@ ...@@ -21,35 +21,30 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include "nv31.h"
#include <core/client.h> #include <core/client.h>
#include <core/os.h>
#include <core/engctx.h>
#include <core/handle.h> #include <core/handle.h>
#include <engine/fifo.h>
#include <subdev/instmem.h>
#include <subdev/fb.h> #include <subdev/fb.h>
#include <subdev/timer.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 * MPEG object classes
******************************************************************************/ ******************************************************************************/
static int static int
nv31_mpeg_object_ctor(struct nouveau_object *parent, nv31_mpeg_object_ctor(struct nvkm_object *parent,
struct nouveau_object *engine, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_gpuobj *obj; struct nvkm_gpuobj *obj;
int ret; int ret;
ret = nouveau_gpuobj_create(parent, engine, oclass, 0, parent, ret = nvkm_gpuobj_create(parent, engine, oclass, 0, parent,
20, 16, 0, &obj); 20, 16, 0, &obj);
*pobject = nv_object(obj); *pobject = nv_object(obj);
if (ret) if (ret)
return ret; return ret;
...@@ -62,9 +57,9 @@ nv31_mpeg_object_ctor(struct nouveau_object *parent, ...@@ -62,9 +57,9 @@ nv31_mpeg_object_ctor(struct nouveau_object *parent,
} }
static int 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; struct nv31_mpeg_priv *priv = (void *)object->engine;
u32 inst = *(u32 *)arg << 4; u32 inst = *(u32 *)arg << 4;
u32 dma0 = nv_ro32(imem, inst + 0); 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) ...@@ -100,17 +95,17 @@ nv31_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
return 0; return 0;
} }
struct nouveau_ofuncs struct nvkm_ofuncs
nv31_mpeg_ofuncs = { nv31_mpeg_ofuncs = {
.ctor = nv31_mpeg_object_ctor, .ctor = nv31_mpeg_object_ctor,
.dtor = _nouveau_gpuobj_dtor, .dtor = _nvkm_gpuobj_dtor,
.init = _nouveau_gpuobj_init, .init = _nvkm_gpuobj_init,
.fini = _nouveau_gpuobj_fini, .fini = _nvkm_gpuobj_fini,
.rd32 = _nouveau_gpuobj_rd32, .rd32 = _nvkm_gpuobj_rd32,
.wr32 = _nouveau_gpuobj_wr32, .wr32 = _nvkm_gpuobj_wr32,
}; };
static struct nouveau_omthds static struct nvkm_omthds
nv31_mpeg_omthds[] = { nv31_mpeg_omthds[] = {
{ 0x0190, 0x0190, nv31_mpeg_mthd_dma }, { 0x0190, 0x0190, nv31_mpeg_mthd_dma },
{ 0x01a0, 0x01a0, nv31_mpeg_mthd_dma }, { 0x01a0, 0x01a0, nv31_mpeg_mthd_dma },
...@@ -118,7 +113,7 @@ nv31_mpeg_omthds[] = { ...@@ -118,7 +113,7 @@ nv31_mpeg_omthds[] = {
{} {}
}; };
struct nouveau_oclass struct nvkm_oclass
nv31_mpeg_sclass[] = { nv31_mpeg_sclass[] = {
{ 0x3174, &nv31_mpeg_ofuncs, nv31_mpeg_omthds }, { 0x3174, &nv31_mpeg_ofuncs, nv31_mpeg_omthds },
{} {}
...@@ -129,17 +124,17 @@ nv31_mpeg_sclass[] = { ...@@ -129,17 +124,17 @@ nv31_mpeg_sclass[] = {
******************************************************************************/ ******************************************************************************/
static int static int
nv31_mpeg_context_ctor(struct nouveau_object *parent, nv31_mpeg_context_ctor(struct nvkm_object *parent,
struct nouveau_object *engine, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv31_mpeg_priv *priv = (void *)engine; struct nv31_mpeg_priv *priv = (void *)engine;
struct nv31_mpeg_chan *chan; struct nv31_mpeg_chan *chan;
unsigned long flags; unsigned long flags;
int ret; int ret;
ret = nouveau_object_create(parent, engine, oclass, 0, &chan); ret = nvkm_object_create(parent, engine, oclass, 0, &chan);
*pobject = nv_object(chan); *pobject = nv_object(chan);
if (ret) if (ret)
return ret; return ret;
...@@ -147,7 +142,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent, ...@@ -147,7 +142,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent,
spin_lock_irqsave(&nv_engine(priv)->lock, flags); spin_lock_irqsave(&nv_engine(priv)->lock, flags);
if (priv->chan) { if (priv->chan) {
spin_unlock_irqrestore(&nv_engine(priv)->lock, flags); spin_unlock_irqrestore(&nv_engine(priv)->lock, flags);
nouveau_object_destroy(&chan->base); nvkm_object_destroy(&chan->base);
*pobject = NULL; *pobject = NULL;
return -EBUSY; return -EBUSY;
} }
...@@ -157,7 +152,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent, ...@@ -157,7 +152,7 @@ nv31_mpeg_context_ctor(struct nouveau_object *parent,
} }
static void 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_priv *priv = (void *)object->engine;
struct nv31_mpeg_chan *chan = (void *)object; struct nv31_mpeg_chan *chan = (void *)object;
...@@ -166,17 +161,17 @@ nv31_mpeg_context_dtor(struct nouveau_object *object) ...@@ -166,17 +161,17 @@ nv31_mpeg_context_dtor(struct nouveau_object *object)
spin_lock_irqsave(&nv_engine(priv)->lock, flags); spin_lock_irqsave(&nv_engine(priv)->lock, flags);
priv->chan = NULL; priv->chan = NULL;
spin_unlock_irqrestore(&nv_engine(priv)->lock, flags); 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 = { nv31_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x31), .handle = NV_ENGCTX(MPEG, 0x31),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv31_mpeg_context_ctor, .ctor = nv31_mpeg_context_ctor,
.dtor = nv31_mpeg_context_dtor, .dtor = nv31_mpeg_context_dtor,
.init = nouveau_object_init, .init = nvkm_object_init,
.fini = nouveau_object_fini, .fini = nvkm_object_fini,
}, },
}; };
...@@ -185,9 +180,9 @@ nv31_mpeg_cclass = { ...@@ -185,9 +180,9 @@ nv31_mpeg_cclass = {
******************************************************************************/ ******************************************************************************/
void 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; struct nv31_mpeg_priv *priv = (void *)engine;
nv_wr32(priv, 0x00b008 + (i * 0x10), tile->pitch); nv_wr32(priv, 0x00b008 + (i * 0x10), tile->pitch);
...@@ -196,12 +191,12 @@ nv31_mpeg_tile_prog(struct nouveau_engine *engine, int i) ...@@ -196,12 +191,12 @@ nv31_mpeg_tile_prog(struct nouveau_engine *engine, int i)
} }
void void
nv31_mpeg_intr(struct nouveau_subdev *subdev) nv31_mpeg_intr(struct nvkm_subdev *subdev)
{ {
struct nv31_mpeg_priv *priv = (void *)subdev; struct nv31_mpeg_priv *priv = (void *)subdev;
struct nouveau_fifo *pfifo = nouveau_fifo(subdev); struct nvkm_fifo *pfifo = nvkm_fifo(subdev);
struct nouveau_handle *handle; struct nvkm_handle *handle;
struct nouveau_object *engctx; struct nvkm_object *engctx;
u32 stat = nv_rd32(priv, 0x00b100); u32 stat = nv_rd32(priv, 0x00b100);
u32 type = nv_rd32(priv, 0x00b230); u32 type = nv_rd32(priv, 0x00b230);
u32 mthd = nv_rd32(priv, 0x00b234); u32 mthd = nv_rd32(priv, 0x00b234);
...@@ -220,10 +215,10 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -220,10 +215,10 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev)
} }
if (type == 0x00000010 && engctx) { 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)) if (handle && !nv_call(handle->object, mthd, data))
show &= ~0x01000000; show &= ~0x01000000;
nouveau_handle_put(handle); nvkm_handle_put(handle);
} }
} }
...@@ -233,21 +228,21 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -233,21 +228,21 @@ nv31_mpeg_intr(struct nouveau_subdev *subdev)
if (show) { if (show) {
nv_error(priv, "ch %d [%s] 0x%08x 0x%08x 0x%08x 0x%08x\n", nv_error(priv, "ch %d [%s] 0x%08x 0x%08x 0x%08x 0x%08x\n",
pfifo->chid(pfifo, engctx), 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); spin_unlock_irqrestore(&nv_engine(priv)->lock, flags);
} }
static int static int
nv31_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv31_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv31_mpeg_priv *priv; struct nv31_mpeg_priv *priv;
int ret; int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv); ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -261,14 +256,14 @@ nv31_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -261,14 +256,14 @@ nv31_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
} }
int 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 nv31_mpeg_priv *priv = (void *)object;
struct nouveau_fb *pfb = nouveau_fb(object); struct nvkm_fb *pfb = nvkm_fb(object);
int ret, i; int ret, i;
ret = nouveau_mpeg_init(&priv->base); ret = nvkm_mpeg_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -297,13 +292,13 @@ nv31_mpeg_init(struct nouveau_object *object) ...@@ -297,13 +292,13 @@ nv31_mpeg_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv31_mpeg_oclass = { nv31_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x31), .handle = NV_ENGINE(MPEG, 0x31),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv31_mpeg_ctor, .ctor = nv31_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor, .dtor = _nvkm_mpeg_dtor,
.init = nv31_mpeg_init, .init = nv31_mpeg_init,
.fini = _nouveau_mpeg_fini, .fini = _nvkm_mpeg_fini,
}, },
}; };
#ifndef __NV31_MPEG_H__ #ifndef __NV31_MPEG_H__
#define __NV31_MPEG_H__ #define __NV31_MPEG_H__
#include <engine/mpeg.h> #include <engine/mpeg.h>
struct nv31_mpeg_chan { struct nv31_mpeg_chan {
struct nouveau_object base; struct nvkm_object base;
}; };
struct nv31_mpeg_priv { struct nv31_mpeg_priv {
struct nouveau_mpeg base; struct nvkm_mpeg base;
struct nv31_mpeg_chan *chan; struct nv31_mpeg_chan *chan;
}; };
#endif #endif
...@@ -21,25 +21,18 @@ ...@@ -21,25 +21,18 @@
* *
* Authors: Ben Skeggs * 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 <subdev/instmem.h>
#include <engine/mpeg.h>
#include <engine/mpeg/nv31.h>
/******************************************************************************* /*******************************************************************************
* MPEG object classes * MPEG object classes
******************************************************************************/ ******************************************************************************/
static int 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; struct nv31_mpeg_priv *priv = (void *)object->engine;
u32 inst = *(u32 *)arg << 4; u32 inst = *(u32 *)arg << 4;
u32 dma0 = nv_ro32(imem, inst + 0); 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) ...@@ -75,7 +68,7 @@ nv40_mpeg_mthd_dma(struct nouveau_object *object, u32 mthd, void *arg, u32 len)
return 0; return 0;
} }
static struct nouveau_omthds static struct nvkm_omthds
nv40_mpeg_omthds[] = { nv40_mpeg_omthds[] = {
{ 0x0190, 0x0190, nv40_mpeg_mthd_dma }, { 0x0190, 0x0190, nv40_mpeg_mthd_dma },
{ 0x01a0, 0x01a0, nv40_mpeg_mthd_dma }, { 0x01a0, 0x01a0, nv40_mpeg_mthd_dma },
...@@ -83,7 +76,7 @@ nv40_mpeg_omthds[] = { ...@@ -83,7 +76,7 @@ nv40_mpeg_omthds[] = {
{} {}
}; };
struct nouveau_oclass struct nvkm_oclass
nv40_mpeg_sclass[] = { nv40_mpeg_sclass[] = {
{ 0x3174, &nv31_mpeg_ofuncs, nv40_mpeg_omthds }, { 0x3174, &nv31_mpeg_ofuncs, nv40_mpeg_omthds },
{} {}
...@@ -94,7 +87,7 @@ nv40_mpeg_sclass[] = { ...@@ -94,7 +87,7 @@ nv40_mpeg_sclass[] = {
******************************************************************************/ ******************************************************************************/
static void static void
nv40_mpeg_intr(struct nouveau_subdev *subdev) nv40_mpeg_intr(struct nvkm_subdev *subdev)
{ {
struct nv31_mpeg_priv *priv = (void *)subdev; struct nv31_mpeg_priv *priv = (void *)subdev;
u32 stat; u32 stat;
...@@ -109,14 +102,14 @@ nv40_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -109,14 +102,14 @@ nv40_mpeg_intr(struct nouveau_subdev *subdev)
} }
static int static int
nv40_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv40_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv31_mpeg_priv *priv; struct nv31_mpeg_priv *priv;
int ret; int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv); ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -129,13 +122,13 @@ nv40_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -129,13 +122,13 @@ nv40_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv40_mpeg_oclass = { nv40_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x40), .handle = NV_ENGINE(MPEG, 0x40),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv40_mpeg_ctor, .ctor = nv40_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor, .dtor = _nvkm_mpeg_dtor,
.init = nv31_mpeg_init, .init = nv31_mpeg_init,
.fini = _nouveau_mpeg_fini, .fini = _nvkm_mpeg_fini,
}, },
}; };
...@@ -21,25 +21,18 @@ ...@@ -21,25 +21,18 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <engine/mpeg.h>
#include <core/os.h>
#include <core/client.h> #include <core/client.h>
#include <core/engctx.h>
#include <core/handle.h> #include <core/handle.h>
#include <subdev/fb.h>
#include <subdev/timer.h>
#include <subdev/instmem.h>
#include <engine/fifo.h> #include <engine/fifo.h>
#include <engine/mpeg.h>
struct nv44_mpeg_priv { struct nv44_mpeg_priv {
struct nouveau_mpeg base; struct nvkm_mpeg base;
}; };
struct nv44_mpeg_chan { struct nv44_mpeg_chan {
struct nouveau_mpeg_chan base; struct nvkm_mpeg_chan base;
}; };
/******************************************************************************* /*******************************************************************************
...@@ -47,17 +40,16 @@ struct nv44_mpeg_chan { ...@@ -47,17 +40,16 @@ struct nv44_mpeg_chan {
******************************************************************************/ ******************************************************************************/
static int static int
nv44_mpeg_context_ctor(struct nouveau_object *parent, nv44_mpeg_context_ctor(struct nvkm_object *parent,
struct nouveau_object *engine, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv44_mpeg_chan *chan; struct nv44_mpeg_chan *chan;
int ret; int ret;
ret = nouveau_mpeg_context_create(parent, engine, oclass, NULL, ret = nvkm_mpeg_context_create(parent, engine, oclass, NULL, 264 * 4,
264 * 4, 16, 16, NVOBJ_FLAG_ZERO_ALLOC, &chan);
NVOBJ_FLAG_ZERO_ALLOC, &chan);
*pobject = nv_object(chan); *pobject = nv_object(chan);
if (ret) if (ret)
return ret; return ret;
...@@ -67,7 +59,7 @@ nv44_mpeg_context_ctor(struct nouveau_object *parent, ...@@ -67,7 +59,7 @@ nv44_mpeg_context_ctor(struct nouveau_object *parent,
} }
static int static int
nv44_mpeg_context_fini(struct nouveau_object *object, bool suspend) nv44_mpeg_context_fini(struct nvkm_object *object, bool suspend)
{ {
struct nv44_mpeg_priv *priv = (void *)object->engine; struct nv44_mpeg_priv *priv = (void *)object->engine;
...@@ -81,16 +73,16 @@ nv44_mpeg_context_fini(struct nouveau_object *object, bool suspend) ...@@ -81,16 +73,16 @@ nv44_mpeg_context_fini(struct nouveau_object *object, bool suspend)
return 0; return 0;
} }
static struct nouveau_oclass static struct nvkm_oclass
nv44_mpeg_cclass = { nv44_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x44), .handle = NV_ENGCTX(MPEG, 0x44),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv44_mpeg_context_ctor, .ctor = nv44_mpeg_context_ctor,
.dtor = _nouveau_mpeg_context_dtor, .dtor = _nvkm_mpeg_context_dtor,
.init = _nouveau_mpeg_context_init, .init = _nvkm_mpeg_context_init,
.fini = nv44_mpeg_context_fini, .fini = nv44_mpeg_context_fini,
.rd32 = _nouveau_mpeg_context_rd32, .rd32 = _nvkm_mpeg_context_rd32,
.wr32 = _nouveau_mpeg_context_wr32, .wr32 = _nvkm_mpeg_context_wr32,
}, },
}; };
...@@ -99,12 +91,12 @@ nv44_mpeg_cclass = { ...@@ -99,12 +91,12 @@ nv44_mpeg_cclass = {
******************************************************************************/ ******************************************************************************/
static void static void
nv44_mpeg_intr(struct nouveau_subdev *subdev) nv44_mpeg_intr(struct nvkm_subdev *subdev)
{ {
struct nouveau_fifo *pfifo = nouveau_fifo(subdev); struct nvkm_fifo *pfifo = nvkm_fifo(subdev);
struct nouveau_engine *engine = nv_engine(subdev); struct nvkm_engine *engine = nv_engine(subdev);
struct nouveau_object *engctx; struct nvkm_object *engctx;
struct nouveau_handle *handle; struct nvkm_handle *handle;
struct nv44_mpeg_priv *priv = (void *)subdev; struct nv44_mpeg_priv *priv = (void *)subdev;
u32 inst = nv_rd32(priv, 0x00b318) & 0x000fffff; u32 inst = nv_rd32(priv, 0x00b318) & 0x000fffff;
u32 stat = nv_rd32(priv, 0x00b100); u32 stat = nv_rd32(priv, 0x00b100);
...@@ -114,7 +106,7 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -114,7 +106,7 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev)
u32 show = stat; u32 show = stat;
int chid; int chid;
engctx = nouveau_engctx_get(engine, inst); engctx = nvkm_engctx_get(engine, inst);
chid = pfifo->chid(pfifo, engctx); chid = pfifo->chid(pfifo, engctx);
if (stat & 0x01000000) { if (stat & 0x01000000) {
...@@ -125,10 +117,10 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -125,10 +117,10 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev)
} }
if (type == 0x00000010) { if (type == 0x00000010) {
handle = nouveau_handle_get_class(engctx, 0x3174); handle = nvkm_handle_get_class(engctx, 0x3174);
if (handle && !nv_call(handle->object, mthd, data)) if (handle && !nv_call(handle->object, mthd, data))
show &= ~0x01000000; show &= ~0x01000000;
nouveau_handle_put(handle); nvkm_handle_put(handle);
} }
} }
...@@ -138,15 +130,15 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -138,15 +130,15 @@ nv44_mpeg_intr(struct nouveau_subdev *subdev)
if (show) { if (show) {
nv_error(priv, nv_error(priv,
"ch %d [0x%08x %s] 0x%08x 0x%08x 0x%08x 0x%08x\n", "ch %d [0x%08x %s] 0x%08x 0x%08x 0x%08x 0x%08x\n",
chid, inst << 4, nouveau_client_name(engctx), stat, chid, inst << 4, nvkm_client_name(engctx), stat,
type, mthd, data); type, mthd, data);
} }
nouveau_engctx_put(engctx); nvkm_engctx_put(engctx);
} }
static void static void
nv44_mpeg_me_intr(struct nouveau_subdev *subdev) nv44_mpeg_me_intr(struct nvkm_subdev *subdev)
{ {
struct nv44_mpeg_priv *priv = (void *)subdev; struct nv44_mpeg_priv *priv = (void *)subdev;
u32 stat; u32 stat;
...@@ -161,14 +153,14 @@ nv44_mpeg_me_intr(struct nouveau_subdev *subdev) ...@@ -161,14 +153,14 @@ nv44_mpeg_me_intr(struct nouveau_subdev *subdev)
} }
static int static int
nv44_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv44_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv44_mpeg_priv *priv; struct nv44_mpeg_priv *priv;
int ret; int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv); ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -181,13 +173,13 @@ nv44_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -181,13 +173,13 @@ nv44_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv44_mpeg_oclass = { nv44_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x44), .handle = NV_ENGINE(MPEG, 0x44),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv44_mpeg_ctor, .ctor = nv44_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor, .dtor = _nvkm_mpeg_dtor,
.init = nv31_mpeg_init, .init = nv31_mpeg_init,
.fini = _nouveau_mpeg_fini, .fini = _nvkm_mpeg_fini,
}, },
}; };
...@@ -21,22 +21,17 @@ ...@@ -21,22 +21,17 @@
* *
* Authors: Ben Skeggs * Authors: Ben Skeggs
*/ */
#include <engine/mpeg.h>
#include <core/os.h>
#include <core/engctx.h>
#include <subdev/mmu.h>
#include <subdev/bar.h> #include <subdev/bar.h>
#include <subdev/timer.h> #include <subdev/timer.h>
#include <engine/mpeg.h>
struct nv50_mpeg_priv { struct nv50_mpeg_priv {
struct nouveau_mpeg base; struct nvkm_mpeg base;
}; };
struct nv50_mpeg_chan { struct nv50_mpeg_chan {
struct nouveau_mpeg_chan base; struct nvkm_mpeg_chan base;
}; };
/******************************************************************************* /*******************************************************************************
...@@ -44,16 +39,16 @@ struct nv50_mpeg_chan { ...@@ -44,16 +39,16 @@ struct nv50_mpeg_chan {
******************************************************************************/ ******************************************************************************/
static int static int
nv50_mpeg_object_ctor(struct nouveau_object *parent, nv50_mpeg_object_ctor(struct nvkm_object *parent,
struct nouveau_object *engine, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_gpuobj *obj; struct nvkm_gpuobj *obj;
int ret; int ret;
ret = nouveau_gpuobj_create(parent, engine, oclass, 0, parent, ret = nvkm_gpuobj_create(parent, engine, oclass, 0, parent,
16, 16, 0, &obj); 16, 16, 0, &obj);
*pobject = nv_object(obj); *pobject = nv_object(obj);
if (ret) if (ret)
return ret; return ret;
...@@ -65,17 +60,17 @@ nv50_mpeg_object_ctor(struct nouveau_object *parent, ...@@ -65,17 +60,17 @@ nv50_mpeg_object_ctor(struct nouveau_object *parent,
return 0; return 0;
} }
struct nouveau_ofuncs struct nvkm_ofuncs
nv50_mpeg_ofuncs = { nv50_mpeg_ofuncs = {
.ctor = nv50_mpeg_object_ctor, .ctor = nv50_mpeg_object_ctor,
.dtor = _nouveau_gpuobj_dtor, .dtor = _nvkm_gpuobj_dtor,
.init = _nouveau_gpuobj_init, .init = _nvkm_gpuobj_init,
.fini = _nouveau_gpuobj_fini, .fini = _nvkm_gpuobj_fini,
.rd32 = _nouveau_gpuobj_rd32, .rd32 = _nvkm_gpuobj_rd32,
.wr32 = _nouveau_gpuobj_wr32, .wr32 = _nvkm_gpuobj_wr32,
}; };
static struct nouveau_oclass static struct nvkm_oclass
nv50_mpeg_sclass[] = { nv50_mpeg_sclass[] = {
{ 0x3174, &nv50_mpeg_ofuncs }, { 0x3174, &nv50_mpeg_ofuncs },
{} {}
...@@ -86,17 +81,17 @@ nv50_mpeg_sclass[] = { ...@@ -86,17 +81,17 @@ nv50_mpeg_sclass[] = {
******************************************************************************/ ******************************************************************************/
int int
nv50_mpeg_context_ctor(struct nouveau_object *parent, nv50_mpeg_context_ctor(struct nvkm_object *parent,
struct nouveau_object *engine, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nouveau_bar *bar = nouveau_bar(parent); struct nvkm_bar *bar = nvkm_bar(parent);
struct nv50_mpeg_chan *chan; struct nv50_mpeg_chan *chan;
int ret; int ret;
ret = nouveau_mpeg_context_create(parent, engine, oclass, NULL, 128 * 4, ret = nvkm_mpeg_context_create(parent, engine, oclass, NULL, 128 * 4,
0, NVOBJ_FLAG_ZERO_ALLOC, &chan); 0, NVOBJ_FLAG_ZERO_ALLOC, &chan);
*pobject = nv_object(chan); *pobject = nv_object(chan);
if (ret) if (ret)
return ret; return ret;
...@@ -107,16 +102,16 @@ nv50_mpeg_context_ctor(struct nouveau_object *parent, ...@@ -107,16 +102,16 @@ nv50_mpeg_context_ctor(struct nouveau_object *parent,
return 0; return 0;
} }
static struct nouveau_oclass static struct nvkm_oclass
nv50_mpeg_cclass = { nv50_mpeg_cclass = {
.handle = NV_ENGCTX(MPEG, 0x50), .handle = NV_ENGCTX(MPEG, 0x50),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_mpeg_context_ctor, .ctor = nv50_mpeg_context_ctor,
.dtor = _nouveau_mpeg_context_dtor, .dtor = _nvkm_mpeg_context_dtor,
.init = _nouveau_mpeg_context_init, .init = _nvkm_mpeg_context_init,
.fini = _nouveau_mpeg_context_fini, .fini = _nvkm_mpeg_context_fini,
.rd32 = _nouveau_mpeg_context_rd32, .rd32 = _nvkm_mpeg_context_rd32,
.wr32 = _nouveau_mpeg_context_wr32, .wr32 = _nvkm_mpeg_context_wr32,
}, },
}; };
...@@ -125,7 +120,7 @@ nv50_mpeg_cclass = { ...@@ -125,7 +120,7 @@ nv50_mpeg_cclass = {
******************************************************************************/ ******************************************************************************/
void void
nv50_mpeg_intr(struct nouveau_subdev *subdev) nv50_mpeg_intr(struct nvkm_subdev *subdev)
{ {
struct nv50_mpeg_priv *priv = (void *)subdev; struct nv50_mpeg_priv *priv = (void *)subdev;
u32 stat = nv_rd32(priv, 0x00b100); u32 stat = nv_rd32(priv, 0x00b100);
...@@ -152,7 +147,7 @@ nv50_mpeg_intr(struct nouveau_subdev *subdev) ...@@ -152,7 +147,7 @@ nv50_mpeg_intr(struct nouveau_subdev *subdev)
} }
static void static void
nv50_vpe_intr(struct nouveau_subdev *subdev) nv50_vpe_intr(struct nvkm_subdev *subdev)
{ {
struct nv50_mpeg_priv *priv = (void *)subdev; struct nv50_mpeg_priv *priv = (void *)subdev;
...@@ -167,14 +162,14 @@ nv50_vpe_intr(struct nouveau_subdev *subdev) ...@@ -167,14 +162,14 @@ nv50_vpe_intr(struct nouveau_subdev *subdev)
} }
static int static int
nv50_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, nv50_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine,
struct nouveau_oclass *oclass, void *data, u32 size, struct nvkm_oclass *oclass, void *data, u32 size,
struct nouveau_object **pobject) struct nvkm_object **pobject)
{ {
struct nv50_mpeg_priv *priv; struct nv50_mpeg_priv *priv;
int ret; int ret;
ret = nouveau_mpeg_create(parent, engine, oclass, &priv); ret = nvkm_mpeg_create(parent, engine, oclass, &priv);
*pobject = nv_object(priv); *pobject = nv_object(priv);
if (ret) if (ret)
return ret; return ret;
...@@ -187,12 +182,12 @@ nv50_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine, ...@@ -187,12 +182,12 @@ nv50_mpeg_ctor(struct nouveau_object *parent, struct nouveau_object *engine,
} }
int int
nv50_mpeg_init(struct nouveau_object *object) nv50_mpeg_init(struct nvkm_object *object)
{ {
struct nv50_mpeg_priv *priv = (void *)object; struct nv50_mpeg_priv *priv = (void *)object;
int ret; int ret;
ret = nouveau_mpeg_init(&priv->base); ret = nvkm_mpeg_init(&priv->base);
if (ret) if (ret)
return ret; return ret;
...@@ -218,13 +213,13 @@ nv50_mpeg_init(struct nouveau_object *object) ...@@ -218,13 +213,13 @@ nv50_mpeg_init(struct nouveau_object *object)
return 0; return 0;
} }
struct nouveau_oclass struct nvkm_oclass
nv50_mpeg_oclass = { nv50_mpeg_oclass = {
.handle = NV_ENGINE(MPEG, 0x50), .handle = NV_ENGINE(MPEG, 0x50),
.ofuncs = &(struct nouveau_ofuncs) { .ofuncs = &(struct nvkm_ofuncs) {
.ctor = nv50_mpeg_ctor, .ctor = nv50_mpeg_ctor,
.dtor = _nouveau_mpeg_dtor, .dtor = _nvkm_mpeg_dtor,
.init = nv50_mpeg_init, .init = nv50_mpeg_init,
.fini = _nouveau_mpeg_fini, .fini = _nvkm_mpeg_fini,
}, },
}; };
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