|
@@ -27,7 +27,8 @@
|
|
#include <core/engctx.h>
|
|
#include <core/engctx.h>
|
|
#include <core/ramht.h>
|
|
#include <core/ramht.h>
|
|
#include <core/event.h>
|
|
#include <core/event.h>
|
|
-#include <core/class.h>
|
|
|
|
|
|
+#include <nvif/unpack.h>
|
|
|
|
+#include <nvif/class.h>
|
|
|
|
|
|
#include <subdev/timer.h>
|
|
#include <subdev/timer.h>
|
|
#include <subdev/bar.h>
|
|
#include <subdev/bar.h>
|
|
@@ -160,17 +161,24 @@ nv84_fifo_chan_ctor_dma(struct nouveau_object *parent,
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
struct nouveau_object **pobject)
|
|
struct nouveau_object **pobject)
|
|
{
|
|
{
|
|
|
|
+ union {
|
|
|
|
+ struct nv03_channel_dma_v0 v0;
|
|
|
|
+ } *args = data;
|
|
struct nouveau_bar *bar = nouveau_bar(parent);
|
|
struct nouveau_bar *bar = nouveau_bar(parent);
|
|
struct nv50_fifo_base *base = (void *)parent;
|
|
struct nv50_fifo_base *base = (void *)parent;
|
|
struct nv50_fifo_chan *chan;
|
|
struct nv50_fifo_chan *chan;
|
|
- struct nv03_channel_dma_class *args = data;
|
|
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- if (size < sizeof(*args))
|
|
|
|
- return -EINVAL;
|
|
|
|
|
|
+ nv_ioctl(parent, "create channel dma size %d\n", size);
|
|
|
|
+ if (nvif_unpack(args->v0, 0, 0, false)) {
|
|
|
|
+ nv_ioctl(parent, "create channel dma vers %d pushbuf %08x "
|
|
|
|
+ "offset %016llx\n", args->v0.version,
|
|
|
|
+ args->v0.pushbuf, args->v0.offset);
|
|
|
|
+ } else
|
|
|
|
+ return ret;
|
|
|
|
|
|
ret = nouveau_fifo_channel_create(parent, engine, oclass, 0, 0xc00000,
|
|
ret = nouveau_fifo_channel_create(parent, engine, oclass, 0, 0xc00000,
|
|
- 0x2000, args->pushbuf,
|
|
|
|
|
|
+ 0x2000, args->v0.pushbuf,
|
|
(1ULL << NVDEV_ENGINE_DMAOBJ) |
|
|
(1ULL << NVDEV_ENGINE_DMAOBJ) |
|
|
(1ULL << NVDEV_ENGINE_SW) |
|
|
(1ULL << NVDEV_ENGINE_SW) |
|
|
(1ULL << NVDEV_ENGINE_GR) |
|
|
(1ULL << NVDEV_ENGINE_GR) |
|
|
@@ -186,6 +194,8 @@ nv84_fifo_chan_ctor_dma(struct nouveau_object *parent,
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
|
+ args->v0.chid = chan->base.chid;
|
|
|
|
+
|
|
ret = nouveau_ramht_new(nv_object(chan), nv_object(chan), 0x8000, 16,
|
|
ret = nouveau_ramht_new(nv_object(chan), nv_object(chan), 0x8000, 16,
|
|
&chan->ramht);
|
|
&chan->ramht);
|
|
if (ret)
|
|
if (ret)
|
|
@@ -196,10 +206,10 @@ nv84_fifo_chan_ctor_dma(struct nouveau_object *parent,
|
|
nv_parent(chan)->object_attach = nv84_fifo_object_attach;
|
|
nv_parent(chan)->object_attach = nv84_fifo_object_attach;
|
|
nv_parent(chan)->object_detach = nv50_fifo_object_detach;
|
|
nv_parent(chan)->object_detach = nv50_fifo_object_detach;
|
|
|
|
|
|
- nv_wo32(base->ramfc, 0x08, lower_32_bits(args->offset));
|
|
|
|
- nv_wo32(base->ramfc, 0x0c, upper_32_bits(args->offset));
|
|
|
|
- nv_wo32(base->ramfc, 0x10, lower_32_bits(args->offset));
|
|
|
|
- nv_wo32(base->ramfc, 0x14, upper_32_bits(args->offset));
|
|
|
|
|
|
+ nv_wo32(base->ramfc, 0x08, lower_32_bits(args->v0.offset));
|
|
|
|
+ nv_wo32(base->ramfc, 0x0c, upper_32_bits(args->v0.offset));
|
|
|
|
+ nv_wo32(base->ramfc, 0x10, lower_32_bits(args->v0.offset));
|
|
|
|
+ nv_wo32(base->ramfc, 0x14, upper_32_bits(args->v0.offset));
|
|
nv_wo32(base->ramfc, 0x3c, 0x003f6078);
|
|
nv_wo32(base->ramfc, 0x3c, 0x003f6078);
|
|
nv_wo32(base->ramfc, 0x44, 0x01003fff);
|
|
nv_wo32(base->ramfc, 0x44, 0x01003fff);
|
|
nv_wo32(base->ramfc, 0x48, chan->base.pushgpu->node->offset >> 4);
|
|
nv_wo32(base->ramfc, 0x48, chan->base.pushgpu->node->offset >> 4);
|
|
@@ -222,18 +232,26 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
struct nouveau_oclass *oclass, void *data, u32 size,
|
|
struct nouveau_object **pobject)
|
|
struct nouveau_object **pobject)
|
|
{
|
|
{
|
|
|
|
+ union {
|
|
|
|
+ struct nv50_channel_gpfifo_v0 v0;
|
|
|
|
+ } *args = data;
|
|
struct nouveau_bar *bar = nouveau_bar(parent);
|
|
struct nouveau_bar *bar = nouveau_bar(parent);
|
|
struct nv50_fifo_base *base = (void *)parent;
|
|
struct nv50_fifo_base *base = (void *)parent;
|
|
struct nv50_fifo_chan *chan;
|
|
struct nv50_fifo_chan *chan;
|
|
- struct nv50_channel_ind_class *args = data;
|
|
|
|
u64 ioffset, ilength;
|
|
u64 ioffset, ilength;
|
|
int ret;
|
|
int ret;
|
|
|
|
|
|
- if (size < sizeof(*args))
|
|
|
|
- return -EINVAL;
|
|
|
|
|
|
+ nv_ioctl(parent, "create channel gpfifo size %d\n", size);
|
|
|
|
+ if (nvif_unpack(args->v0, 0, 0, false)) {
|
|
|
|
+ nv_ioctl(parent, "create channel gpfifo vers %d pushbuf %08x "
|
|
|
|
+ "ioffset %016llx ilength %08x\n",
|
|
|
|
+ args->v0.version, args->v0.pushbuf, args->v0.ioffset,
|
|
|
|
+ args->v0.ilength);
|
|
|
|
+ } else
|
|
|
|
+ return ret;
|
|
|
|
|
|
ret = nouveau_fifo_channel_create(parent, engine, oclass, 0, 0xc00000,
|
|
ret = nouveau_fifo_channel_create(parent, engine, oclass, 0, 0xc00000,
|
|
- 0x2000, args->pushbuf,
|
|
|
|
|
|
+ 0x2000, args->v0.pushbuf,
|
|
(1ULL << NVDEV_ENGINE_DMAOBJ) |
|
|
(1ULL << NVDEV_ENGINE_DMAOBJ) |
|
|
(1ULL << NVDEV_ENGINE_SW) |
|
|
(1ULL << NVDEV_ENGINE_SW) |
|
|
(1ULL << NVDEV_ENGINE_GR) |
|
|
(1ULL << NVDEV_ENGINE_GR) |
|
|
@@ -249,6 +267,8 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
|
|
if (ret)
|
|
if (ret)
|
|
return ret;
|
|
return ret;
|
|
|
|
|
|
|
|
+ args->v0.chid = chan->base.chid;
|
|
|
|
+
|
|
ret = nouveau_ramht_new(nv_object(chan), nv_object(chan), 0x8000, 16,
|
|
ret = nouveau_ramht_new(nv_object(chan), nv_object(chan), 0x8000, 16,
|
|
&chan->ramht);
|
|
&chan->ramht);
|
|
if (ret)
|
|
if (ret)
|
|
@@ -259,8 +279,8 @@ nv84_fifo_chan_ctor_ind(struct nouveau_object *parent,
|
|
nv_parent(chan)->object_attach = nv84_fifo_object_attach;
|
|
nv_parent(chan)->object_attach = nv84_fifo_object_attach;
|
|
nv_parent(chan)->object_detach = nv50_fifo_object_detach;
|
|
nv_parent(chan)->object_detach = nv50_fifo_object_detach;
|
|
|
|
|
|
- ioffset = args->ioffset;
|
|
|
|
- ilength = order_base_2(args->ilength / 8);
|
|
|
|
|
|
+ ioffset = args->v0.ioffset;
|
|
|
|
+ ilength = order_base_2(args->v0.ilength / 8);
|
|
|
|
|
|
nv_wo32(base->ramfc, 0x3c, 0x403f6078);
|
|
nv_wo32(base->ramfc, 0x3c, 0x403f6078);
|
|
nv_wo32(base->ramfc, 0x44, 0x01003fff);
|
|
nv_wo32(base->ramfc, 0x44, 0x01003fff);
|
|
@@ -320,8 +340,8 @@ nv84_fifo_ofuncs_ind = {
|
|
|
|
|
|
static struct nouveau_oclass
|
|
static struct nouveau_oclass
|
|
nv84_fifo_sclass[] = {
|
|
nv84_fifo_sclass[] = {
|
|
- { NV84_CHANNEL_DMA_CLASS, &nv84_fifo_ofuncs_dma },
|
|
|
|
- { NV84_CHANNEL_IND_CLASS, &nv84_fifo_ofuncs_ind },
|
|
|
|
|
|
+ { G82_CHANNEL_DMA, &nv84_fifo_ofuncs_dma },
|
|
|
|
+ { G82_CHANNEL_GPFIFO, &nv84_fifo_ofuncs_ind },
|
|
{}
|
|
{}
|
|
};
|
|
};
|
|
|
|
|