drm/nouveau/fifo: tidy up channel creation event code
authorBen Skeggs <bskeggs@redhat.com>
Sat, 5 Nov 2016 03:12:57 +0000 (13:12 +1000)
committerBen Skeggs <bskeggs@redhat.com>
Fri, 17 Feb 2017 07:38:08 +0000 (17:38 +1000)
Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
drivers/gpu/drm/nouveau/nvkm/engine/fifo/base.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/chan.c
drivers/gpu/drm/nouveau/nvkm/engine/fifo/priv.h

index 1c9682ae3a6bf0a0b5b7bc6ddb129e7d1aa452d3..4a01afe917345fe77c224eadcf733c2d03aca167 100644 (file)
@@ -91,8 +91,8 @@ nvkm_fifo_chan_chid(struct nvkm_fifo *fifo, int chid, unsigned long *rflags)
 }
 
 static int
-nvkm_fifo_event_ctor(struct nvkm_object *object, void *data, u32 size,
-                    struct nvkm_notify *notify)
+nvkm_fifo_cevent_ctor(struct nvkm_object *object, void *data, u32 size,
+                     struct nvkm_notify *notify)
 {
        if (size == 0) {
                notify->size  = 0;
@@ -104,10 +104,16 @@ nvkm_fifo_event_ctor(struct nvkm_object *object, void *data, u32 size,
 }
 
 static const struct nvkm_event_func
-nvkm_fifo_event_func = {
-       .ctor = nvkm_fifo_event_ctor,
+nvkm_fifo_cevent_func = {
+       .ctor = nvkm_fifo_cevent_ctor,
 };
 
+void
+nvkm_fifo_cevent(struct nvkm_fifo *fifo)
+{
+       nvkm_event_send(&fifo->cevent, 1, 0, NULL, 0);
+}
+
 static void
 nvkm_fifo_uevent_fini(struct nvkm_event *event, int type, int index)
 {
@@ -283,5 +289,5 @@ nvkm_fifo_ctor(const struct nvkm_fifo_func *func, struct nvkm_device *device,
                        return ret;
        }
 
-       return nvkm_event_init(&nvkm_fifo_event_func, 1, 1, &fifo->cevent);
+       return nvkm_event_init(&nvkm_fifo_cevent_func, 1, 1, &fifo->cevent);
 }
index 3b87e09e31efff9d68c138e25e116e75171f036b..fab760ae922fbe4784084d0cbc77f5496e2997bf 100644 (file)
@@ -410,6 +410,6 @@ nvkm_fifo_chan_ctor(const struct nvkm_fifo_chan_func *func,
                     base + user * chan->chid;
        chan->size = user;
 
-       nvkm_event_send(&fifo->cevent, 1, 0, NULL, 0);
+       nvkm_fifo_cevent(fifo);
        return 0;
 }
index f6dfb37d94296378c65d368650fa07d9f8cad83a..9bf0251c05d023d2917991cc59c8ca885f0eccae 100644 (file)
@@ -6,6 +6,7 @@
 int nvkm_fifo_ctor(const struct nvkm_fifo_func *, struct nvkm_device *,
                   int index, int nr, struct nvkm_fifo *);
 void nvkm_fifo_uevent(struct nvkm_fifo *);
+void nvkm_fifo_cevent(struct nvkm_fifo *);
 
 struct nvkm_fifo_chan_oclass;
 struct nvkm_fifo_func {