diff options
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c')
-rw-r--r-- | drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c | 78 |
1 files changed, 37 insertions, 41 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c index b3463f3739ce..f908fa093266 100644 --- a/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c +++ b/drivers/gpu/drm/nouveau/nvkm/engine/mpeg/nv50.c @@ -26,10 +26,6 @@ #include <subdev/bar.h> #include <subdev/timer.h> -struct nv50_mpeg_priv { - struct nvkm_mpeg base; -}; - struct nv50_mpeg_chan { struct nvkm_mpeg_chan base; }; @@ -122,42 +118,42 @@ nv50_mpeg_cclass = { void nv50_mpeg_intr(struct nvkm_subdev *subdev) { - struct nv50_mpeg_priv *priv = (void *)subdev; - u32 stat = nv_rd32(priv, 0x00b100); - u32 type = nv_rd32(priv, 0x00b230); - u32 mthd = nv_rd32(priv, 0x00b234); - u32 data = nv_rd32(priv, 0x00b238); + struct nvkm_mpeg *mpeg = (void *)subdev; + u32 stat = nv_rd32(mpeg, 0x00b100); + u32 type = nv_rd32(mpeg, 0x00b230); + u32 mthd = nv_rd32(mpeg, 0x00b234); + u32 data = nv_rd32(mpeg, 0x00b238); u32 show = stat; if (stat & 0x01000000) { /* happens on initial binding of the object */ if (type == 0x00000020 && mthd == 0x0000) { - nv_wr32(priv, 0x00b308, 0x00000100); + nv_wr32(mpeg, 0x00b308, 0x00000100); show &= ~0x01000000; } } if (show) { - nv_info(priv, "0x%08x 0x%08x 0x%08x 0x%08x\n", + nv_info(mpeg, "0x%08x 0x%08x 0x%08x 0x%08x\n", stat, type, mthd, data); } - nv_wr32(priv, 0x00b100, stat); - nv_wr32(priv, 0x00b230, 0x00000001); + nv_wr32(mpeg, 0x00b100, stat); + nv_wr32(mpeg, 0x00b230, 0x00000001); } static void nv50_vpe_intr(struct nvkm_subdev *subdev) { - struct nv50_mpeg_priv *priv = (void *)subdev; + struct nvkm_mpeg *mpeg = (void *)subdev; - if (nv_rd32(priv, 0x00b100)) + if (nv_rd32(mpeg, 0x00b100)) nv50_mpeg_intr(subdev); - if (nv_rd32(priv, 0x00b800)) { - u32 stat = nv_rd32(priv, 0x00b800); - nv_info(priv, "PMSRCH: 0x%08x\n", stat); - nv_wr32(priv, 0xb800, stat); + if (nv_rd32(mpeg, 0x00b800)) { + u32 stat = nv_rd32(mpeg, 0x00b800); + nv_info(mpeg, "PMSRCH: 0x%08x\n", stat); + nv_wr32(mpeg, 0xb800, stat); } } @@ -166,47 +162,47 @@ nv50_mpeg_ctor(struct nvkm_object *parent, struct nvkm_object *engine, struct nvkm_oclass *oclass, void *data, u32 size, struct nvkm_object **pobject) { - struct nv50_mpeg_priv *priv; + struct nvkm_mpeg *mpeg; int ret; - ret = nvkm_mpeg_create(parent, engine, oclass, &priv); - *pobject = nv_object(priv); + ret = nvkm_mpeg_create(parent, engine, oclass, &mpeg); + *pobject = nv_object(mpeg); if (ret) return ret; - nv_subdev(priv)->unit = 0x00400002; - nv_subdev(priv)->intr = nv50_vpe_intr; - nv_engine(priv)->cclass = &nv50_mpeg_cclass; - nv_engine(priv)->sclass = nv50_mpeg_sclass; + nv_subdev(mpeg)->unit = 0x00400002; + nv_subdev(mpeg)->intr = nv50_vpe_intr; + nv_engine(mpeg)->cclass = &nv50_mpeg_cclass; + nv_engine(mpeg)->sclass = nv50_mpeg_sclass; return 0; } int nv50_mpeg_init(struct nvkm_object *object) { - struct nv50_mpeg_priv *priv = (void *)object; + struct nvkm_mpeg *mpeg = (void *)object; int ret; - ret = nvkm_mpeg_init(&priv->base); + ret = nvkm_mpeg_init(mpeg); if (ret) return ret; - nv_wr32(priv, 0x00b32c, 0x00000000); - nv_wr32(priv, 0x00b314, 0x00000100); - nv_wr32(priv, 0x00b0e0, 0x0000001a); + nv_wr32(mpeg, 0x00b32c, 0x00000000); + nv_wr32(mpeg, 0x00b314, 0x00000100); + nv_wr32(mpeg, 0x00b0e0, 0x0000001a); - nv_wr32(priv, 0x00b220, 0x00000044); - nv_wr32(priv, 0x00b300, 0x00801ec1); - nv_wr32(priv, 0x00b390, 0x00000000); - nv_wr32(priv, 0x00b394, 0x00000000); - nv_wr32(priv, 0x00b398, 0x00000000); - nv_mask(priv, 0x00b32c, 0x00000001, 0x00000001); + nv_wr32(mpeg, 0x00b220, 0x00000044); + nv_wr32(mpeg, 0x00b300, 0x00801ec1); + nv_wr32(mpeg, 0x00b390, 0x00000000); + nv_wr32(mpeg, 0x00b394, 0x00000000); + nv_wr32(mpeg, 0x00b398, 0x00000000); + nv_mask(mpeg, 0x00b32c, 0x00000001, 0x00000001); - nv_wr32(priv, 0x00b100, 0xffffffff); - nv_wr32(priv, 0x00b140, 0xffffffff); + nv_wr32(mpeg, 0x00b100, 0xffffffff); + nv_wr32(mpeg, 0x00b140, 0xffffffff); - if (!nv_wait(priv, 0x00b200, 0x00000001, 0x00000000)) { - nv_error(priv, "timeout 0x%08x\n", nv_rd32(priv, 0x00b200)); + if (!nv_wait(mpeg, 0x00b200, 0x00000001, 0x00000000)) { + nv_error(mpeg, "timeout 0x%08x\n", nv_rd32(mpeg, 0x00b200)); return -EBUSY; } |