summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/nouveau/nvif
diff options
context:
space:
mode:
authorBen Skeggs <bskeggs@redhat.com>2022-06-01 20:46:38 +1000
committerBen Skeggs <bskeggs@redhat.com>2022-11-09 10:44:27 +1000
commitffd2664114c8fb9f12c4d4fd09c6d57cc3f4d951 (patch)
treeb517cb30c45ac38ebef079fbd5ceaa589b6d5e16 /drivers/gpu/drm/nouveau/nvif
parent1d4dce284164de21cfbab05d0b763711c428df45 (diff)
drm/nouveau/disp: expose head event class
Also fixes vblank interrupts being left enabled when they're not meant to be as a result of races/bugs in previous event handling code. v2: - use ?: (lyude) Signed-off-by: Ben Skeggs <bskeggs@redhat.com> Reviewed-by: Lyude Paul <lyude@redhat.com>
Diffstat (limited to 'drivers/gpu/drm/nouveau/nvif')
-rw-r--r--drivers/gpu/drm/nouveau/nvif/head.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/drivers/gpu/drm/nouveau/nvif/head.c b/drivers/gpu/drm/nouveau/nvif/head.c
index 01deba462600..f00e01d232db 100644
--- a/drivers/gpu/drm/nouveau/nvif/head.c
+++ b/drivers/gpu/drm/nouveau/nvif/head.c
@@ -26,6 +26,16 @@
#include <nvif/class.h>
#include <nvif/if0013.h>
+int
+nvif_head_vblank_event_ctor(struct nvif_head *head, const char *name, nvif_event_func func,
+ bool wait, struct nvif_event *event)
+{
+ int ret = nvif_event_ctor(&head->object, name ?: "nvifHeadVBlank", nvif_head_id(head),
+ func, wait, NULL, 0, event);
+ NVIF_ERRON(ret, &head->object, "[NEW EVENT:VBLANK]");
+ return ret;
+}
+
void
nvif_head_dtor(struct nvif_head *head)
{