@@ -1072,7 +1072,7 @@ nv04_finish_page_flip(struct nouveau_channel *chan,
return 0;
}
-int
+enum nvif_event_stat
nv04_flip_complete(struct nvif_event *event, void *argv, u32 argc)
{
struct nv04_display *disp = container_of(event, typeof(*disp), flip);
@@ -1272,7 +1272,7 @@ static const struct drm_plane_funcs nv04_primary_plane_funcs = {
DRM_PLANE_NON_ATOMIC_FUNCS,
};
-static int
+static enum nvif_event_stat
nv04_crtc_vblank_handler(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_crtc *nv_crtc = container_of(event, struct nouveau_crtc, vblank);
@@ -182,5 +182,5 @@ nouveau_bios_run_init_table(struct drm_device *dev, u16 table,
);
}
-int nv04_flip_complete(struct nvif_event *, void *, u32);
+enum nvif_event_stat nv04_flip_complete(struct nvif_event *, void *, u32);
#endif
@@ -549,7 +549,7 @@ nvd9_head_func = {
.late_register = nv50_head_late_register,
};
-static int
+static enum nvif_event_stat
nv50_head_vblank_handler(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_crtc *nv_crtc = container_of(event, struct nouveau_crtc, vblank);
@@ -23,6 +23,11 @@ struct nvif_cgrp_priv;
struct nvif_chan_priv;
struct nvif_engobj_priv;
+enum nvif_event_stat {
+ NVIF_EVENT_KEEP,
+ NVIF_EVENT_DROP,
+};
+
struct nvif_event_impl {
void (*del)(struct nvif_event_priv *);
int (*allow)(struct nvif_event_priv *);
@@ -2,11 +2,10 @@
#ifndef __NVIF_EVENT_H__
#define __NVIF_EVENT_H__
#include <nvif/object.h>
+#include <nvif/driverif.h>
struct nvif_event;
-#define NVIF_EVENT_KEEP 0
-#define NVIF_EVENT_DROP 1
-typedef int (*nvif_event_func)(struct nvif_event *, void *repv, u32 repc);
+typedef enum nvif_event_stat (*nvif_event_func)(struct nvif_event *, void *repv, u32 repc);
struct nvif_event {
const struct nvif_event_impl *impl;
@@ -47,7 +47,7 @@ nouveau_channel_kill(struct nouveau_channel *chan)
nouveau_fence_context_kill(chan->fence, -ENODEV);
}
-static int
+static enum nvif_event_stat
nouveau_channel_killed(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_channel *chan = container_of(event, typeof(*chan), kill);
@@ -1199,7 +1199,7 @@ nouveau_connector_hpd(struct nouveau_connector *nv_connector, u64 bits)
spin_unlock_irqrestore(&drm->hpd_lock, flags);
}
-static int
+static enum nvif_event_stat
nouveau_connector_irq(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_connector *nv_connector = container_of(event, typeof(*nv_connector), irq);
@@ -1208,7 +1208,7 @@ nouveau_connector_irq(struct nvif_event *event, void *repv, u32 repc)
return NVIF_EVENT_KEEP;
}
-static int
+static enum nvif_event_stat
nouveau_connector_hotplug(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_connector *nv_connector = container_of(event, typeof(*nv_connector), hpd);
@@ -168,7 +168,7 @@ nouveau_fence_uevent_work(struct work_struct *work)
spin_unlock_irqrestore(&fctx->lock, flags);
}
-static int
+static enum nvif_event_stat
nouveau_fence_wait_uevent_handler(struct nvif_event *event, void *repv, u32 repc)
{
struct nouveau_fence_chan *fctx = container_of(event, typeof(*fctx), event);
@@ -870,7 +870,7 @@ nouveau_svm_fault(struct work_struct *work)
nouveau_svm_fault_replay(svm);
}
-static int
+static enum nvif_event_stat
nouveau_svm_event(struct nvif_event *event, void *argv, u32 argc)
{
struct nouveau_svm_fault_buffer *buffer = container_of(event, typeof(*buffer), notify);
Return an enum rather than an int from nvif_event callbacks. Also moves the NVIF_EVENT_* definitions to driverif.h, with the rest of the DRM<->NVKM interfaces. Signed-off-by: Ben Skeggs <bskeggs@nvidia.com> --- drivers/gpu/drm/nouveau/dispnv04/crtc.c | 4 ++-- drivers/gpu/drm/nouveau/dispnv04/disp.h | 2 +- drivers/gpu/drm/nouveau/dispnv50/head.c | 2 +- drivers/gpu/drm/nouveau/include/nvif/driverif.h | 5 +++++ drivers/gpu/drm/nouveau/include/nvif/event.h | 5 ++--- drivers/gpu/drm/nouveau/nouveau_chan.c | 2 +- drivers/gpu/drm/nouveau/nouveau_connector.c | 4 ++-- drivers/gpu/drm/nouveau/nouveau_fence.c | 2 +- drivers/gpu/drm/nouveau/nouveau_svm.c | 2 +- 9 files changed, 16 insertions(+), 12 deletions(-)