summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2022-06-01 20:47:21 +1000
committerBen Skeggs <bskeggs@redhat.com>2022-11-09 10:44:46 +1000
commitf5e4568991f60125712b03079bc037c6feb953f1 (patch)
treef42d26a9271ee5436e6478097ff09ded8ef33350 /drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
parent8c18138c7633f7f9e609be6b11e48bb33a8dfb75 (diff)
drm/nouveau/fifo: unify handling of channel classes
Adds the basic skeleton for common channel (group) interfaces. - common behaviour between <gk104 and >=gk104 impl's - separates priv/user channel objects - passthrough to existing object for now, kludges removed later Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c')
-rw-r--r--drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c50
1 files changed, 8 insertions, 42 deletions
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
index e11b5eb8e196..1e15b88d59ae 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/fifo/gk104.c
@@ -21,6 +21,8 @@
*
* Authors: Ben Skeggs
*/
+#include "chan.h"
+
#include "gk104.h"
#include "cgrp.h"
#include "changk104.h"
@@ -36,6 +38,10 @@
#include <nvif/class.h>
#include <nvif/cl0080.h>
+static const struct nvkm_chan_func
+gk104_chan = {
+};
+
void
gk104_fifo_engine_status(struct gk104_fifo *fifo, int engn,
struct gk104_fifo_engine_status *status)
@@ -83,45 +89,6 @@ gk104_fifo_engine_status(struct gk104_fifo *fifo, int engn,
status->chan == &status->next ? "*" : " ");
}
-int
-gk104_fifo_class_new(struct nvkm_fifo *base, const struct nvkm_oclass *oclass,
- void *argv, u32 argc, struct nvkm_object **pobject)
-{
- struct gk104_fifo *fifo = gk104_fifo(base);
- if (oclass->engn == &fifo->func->chan) {
- const struct gk104_fifo_chan_user *user = oclass->engn;
- return user->ctor(fifo, oclass, argv, argc, pobject);
- } else
- if (oclass->engn == &fifo->func->user) {
- const struct gk104_fifo_user_user *user = oclass->engn;
- return user->ctor(oclass, argv, argc, pobject);
- }
- WARN_ON(1);
- return -EINVAL;
-}
-
-int
-gk104_fifo_class_get(struct nvkm_fifo *base, int index,
- struct nvkm_oclass *oclass)
-{
- struct gk104_fifo *fifo = gk104_fifo(base);
- int c = 0;
-
- if (fifo->func->user.ctor && c++ == index) {
- oclass->base = fifo->func->user.user;
- oclass->engn = &fifo->func->user;
- return 0;
- }
-
- if (fifo->func->chan.ctor && c++ == index) {
- oclass->base = fifo->func->chan.user;
- oclass->engn = &fifo->func->chan;
- return 0;
- }
-
- return c;
-}
-
void
gk104_fifo_uevent_fini(struct nvkm_fifo *fifo)
{
@@ -1093,8 +1060,6 @@ gk104_fifo_ = {
.uevent_init = gk104_fifo_uevent_init,
.uevent_fini = gk104_fifo_uevent_fini,
.recover_chan = gk104_fifo_recover_chan,
- .class_get = gk104_fifo_class_get,
- .class_new = gk104_fifo_class_new,
};
int
@@ -1245,7 +1210,8 @@ gk104_fifo = {
.fault.hubclient = gk104_fifo_fault_hubclient,
.fault.gpcclient = gk104_fifo_fault_gpcclient,
.runlist = &gk104_fifo_runlist,
- .chan = {{0,0,KEPLER_CHANNEL_GPFIFO_A}, gk104_fifo_gpfifo_new },
+ .cgrp = {{ }, &nv04_cgrp },
+ .chan = {{ 0, 0, KEPLER_CHANNEL_GPFIFO_A }, &gk104_chan, .ctor = &gk104_fifo_gpfifo_new },
};
int