#include <core/engine.h>
struct nvkm_sw {
- struct nvkm_engine base;
+ struct nvkm_engine engine;
};
#define nvkm_sw_create(p,e,c,d) \
nvkm_engine_create((p), (e), (c), true, "SW", "software", (d))
#define nvkm_sw_destroy(d) \
- nvkm_engine_destroy(&(d)->base)
+ nvkm_engine_destroy(&(d)->engine)
#define nvkm_sw_init(d) \
- nvkm_engine_init(&(d)->base)
+ nvkm_engine_init(&(d)->engine)
#define nvkm_sw_fini(d,s) \
- nvkm_engine_fini(&(d)->base, (s))
+ nvkm_engine_fini(&(d)->engine, (s))
#define _nvkm_sw_dtor _nvkm_engine_dtor
#define _nvkm_sw_init _nvkm_engine_init
void *args, u32 size)
{
struct nv50_sw_chan *chan = (void *)nv_engctx(object->parent);
- struct nv50_sw_priv *priv = (void *)nv_object(chan)->engine;
+ struct nvkm_sw *sw = (void *)nv_object(chan)->engine;
u32 data = *(u32 *)args;
switch (mthd) {
case 0x600:
- nv_wr32(priv, 0x419e00, data); /* MP.PM_UNK000 */
+ nv_wr32(sw, 0x419e00, data); /* MP.PM_UNK000 */
break;
case 0x644:
if (data & ~0x1ffffe)
return -EINVAL;
- nv_wr32(priv, 0x419e44, data); /* MP.TRAP_WARP_ERROR_EN */
+ nv_wr32(sw, 0x419e44, data); /* MP.TRAP_WARP_ERROR_EN */
break;
case 0x6ac:
- nv_wr32(priv, 0x419eac, data); /* MP.PM_UNK0AC */
+ nv_wr32(sw, 0x419eac, data); /* MP.PM_UNK0AC */
break;
default:
return -EINVAL;
{
struct nv50_sw_chan *chan =
container_of(notify, typeof(*chan), vblank.notify[notify->index]);
- struct nv50_sw_priv *priv = (void *)nv_object(chan)->engine;
- struct nvkm_bar *bar = nvkm_bar(priv);
+ struct nvkm_sw *sw = (void *)nv_object(chan)->engine;
+ struct nvkm_bar *bar = nvkm_bar(sw);
- nv_wr32(priv, 0x001718, 0x80000000 | chan->vblank.channel);
+ nv_wr32(sw, 0x001718, 0x80000000 | chan->vblank.channel);
bar->flush(bar);
- nv_wr32(priv, 0x06000c, upper_32_bits(chan->vblank.offset));
- nv_wr32(priv, 0x060010, lower_32_bits(chan->vblank.offset));
- nv_wr32(priv, 0x060014, chan->vblank.value);
+ nv_wr32(sw, 0x06000c, upper_32_bits(chan->vblank.offset));
+ nv_wr32(sw, 0x060010, lower_32_bits(chan->vblank.offset));
+ nv_wr32(sw, 0x060014, chan->vblank.value);
return NVKM_NOTIFY_DROP;
}
#include <engine/sw.h>
#include <engine/fifo.h>
-struct nv04_sw_priv {
- struct nvkm_sw base;
-};
-
-struct nv04_sw_chan {
- struct nvkm_sw_chan base;
-};
-
/*******************************************************************************
* software object classes
******************************************************************************/
static int
nv04_sw_flip(struct nvkm_object *object, u32 mthd, void *args, u32 size)
{
- struct nv04_sw_chan *chan = (void *)nv_engctx(object->parent);
- if (chan->base.flip)
- return chan->base.flip(chan->base.flip_data);
+ struct nvkm_sw_chan *chan = (void *)nv_engctx(object->parent);
+ if (chan->flip)
+ return chan->flip(chan->flip_data);
return -EINVAL;
}
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
- struct nv04_sw_chan *chan;
+ struct nvkm_sw_chan *chan;
int ret;
ret = nvkm_sw_context_create(parent, engine, oclass, &chan);
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
- struct nv04_sw_priv *priv;
+ struct nvkm_sw *sw;
int ret;
- ret = nvkm_sw_create(parent, engine, oclass, &priv);
- *pobject = nv_object(priv);
+ ret = nvkm_sw_create(parent, engine, oclass, &sw);
+ *pobject = nv_object(sw);
if (ret)
return ret;
- nv_engine(priv)->cclass = &nv04_sw_cclass;
- nv_engine(priv)->sclass = nv04_sw_sclass;
- nv_subdev(priv)->intr = nv04_sw_intr;
+ nv_engine(sw)->cclass = &nv04_sw_cclass;
+ nv_engine(sw)->sclass = nv04_sw_sclass;
+ nv_subdev(sw)->intr = nv04_sw_intr;
return 0;
}
*/
#include <engine/sw.h>
-struct nv10_sw_priv {
- struct nvkm_sw base;
-};
-
-struct nv10_sw_chan {
- struct nvkm_sw_chan base;
-};
-
/*******************************************************************************
* software object classes
******************************************************************************/
static int
nv10_sw_flip(struct nvkm_object *object, u32 mthd, void *args, u32 size)
{
- struct nv10_sw_chan *chan = (void *)nv_engctx(object->parent);
- if (chan->base.flip)
- return chan->base.flip(chan->base.flip_data);
+ struct nvkm_sw_chan *chan = (void *)nv_engctx(object->parent);
+ if (chan->flip)
+ return chan->flip(chan->flip_data);
return -EINVAL;
}
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
- struct nv10_sw_chan *chan;
+ struct nvkm_sw_chan *chan;
int ret;
ret = nvkm_sw_context_create(parent, engine, oclass, &chan);
struct nvkm_oclass *oclass, void *data, u32 size,
struct nvkm_object **pobject)
{
- struct nv10_sw_priv *priv;
+ struct nvkm_sw *sw;
int ret;
- ret = nvkm_sw_create(parent, engine, oclass, &priv);
- *pobject = nv_object(priv);
+ ret = nvkm_sw_create(parent, engine, oclass, &sw);
+ *pobject = nv_object(sw);
if (ret)
return ret;
- nv_engine(priv)->cclass = &nv10_sw_cclass;
- nv_engine(priv)->sclass = nv10_sw_sclass;
- nv_subdev(priv)->intr = nv04_sw_intr;
+ nv_engine(sw)->cclass = &nv10_sw_cclass;
+ nv_engine(sw)->sclass = nv10_sw_sclass;
+ nv_subdev(sw)->intr = nv04_sw_intr;
return 0;
}
{
struct nv50_sw_chan *chan =
container_of(notify, typeof(*chan), vblank.notify[notify->index]);
- struct nv50_sw_priv *priv = (void *)nv_object(chan)->engine;
- struct nvkm_bar *bar = nvkm_bar(priv);
+ struct nvkm_sw *sw = (void *)nv_object(chan)->engine;
+ struct nvkm_bar *bar = nvkm_bar(sw);
- nv_wr32(priv, 0x001704, chan->vblank.channel);
- nv_wr32(priv, 0x001710, 0x80000000 | chan->vblank.ctxdma);
+ nv_wr32(sw, 0x001704, chan->vblank.channel);
+ nv_wr32(sw, 0x001710, 0x80000000 | chan->vblank.ctxdma);
bar->flush(bar);
- if (nv_device(priv)->chipset == 0x50) {
- nv_wr32(priv, 0x001570, chan->vblank.offset);
- nv_wr32(priv, 0x001574, chan->vblank.value);
+ if (nv_device(sw)->chipset == 0x50) {
+ nv_wr32(sw, 0x001570, chan->vblank.offset);
+ nv_wr32(sw, 0x001574, chan->vblank.value);
} else {
- nv_wr32(priv, 0x060010, chan->vblank.offset);
- nv_wr32(priv, 0x060014, chan->vblank.value);
+ nv_wr32(sw, 0x060010, chan->vblank.offset);
+ nv_wr32(sw, 0x060014, chan->vblank.value);
}
return NVKM_NOTIFY_DROP;
struct nvkm_object **pobject)
{
struct nv50_sw_oclass *pclass = (void *)oclass;
- struct nv50_sw_priv *priv;
+ struct nvkm_sw *sw;
int ret;
- ret = nvkm_sw_create(parent, engine, oclass, &priv);
- *pobject = nv_object(priv);
+ ret = nvkm_sw_create(parent, engine, oclass, &sw);
+ *pobject = nv_object(sw);
if (ret)
return ret;
- nv_engine(priv)->cclass = pclass->cclass;
- nv_engine(priv)->sclass = pclass->sclass;
- nv_subdev(priv)->intr = nv04_sw_intr;
+ nv_engine(sw)->cclass = pclass->cclass;
+ nv_engine(sw)->sclass = pclass->sclass;
+ nv_subdev(sw)->intr = nv04_sw_intr;
return 0;
}
struct nvkm_oclass *sclass;
};
-struct nv50_sw_priv {
- struct nvkm_sw base;
-};
-
int nv50_sw_ctor(struct nvkm_object *, struct nvkm_object *,
struct nvkm_oclass *, void *, u32,
struct nvkm_object **);