now that llist is fixed enable more of i915 __notify_execute_cb()
authorjsg <jsg@openbsd.org>
Wed, 27 Jul 2022 07:08:34 +0000 (07:08 +0000)
committerjsg <jsg@openbsd.org>
Wed, 27 Jul 2022 07:08:34 +0000 (07:08 +0000)
this path is called when running the intel xorg driver on broadwell

sys/dev/pci/drm/i915/i915_request.c
sys/dev/pci/drm/include/linux/irq_work.h

index a2a5352..93935a8 100644 (file)
@@ -165,7 +165,7 @@ static void irq_execute_cb(struct irq_work *wrk)
        struct execute_cb *cb = container_of(wrk, typeof(*cb), work);
 
        i915_sw_fence_complete(cb->fence);
-#ifdef notyet
+#ifdef __linux__
        kmem_cache_free(slab_execute_cbs, cb);
 #else
        pool_put(&slab_execute_cbs, cb);
@@ -180,13 +180,10 @@ __notify_execute_cb(struct i915_request *rq, bool (*fn)(struct irq_work *wrk))
        if (llist_empty(&rq->execute_cb))
                return;
 
-       STUB();
-#ifdef notyet
        llist_for_each_entry_safe(cb, cn,
                                  llist_del_all(&rq->execute_cb),
                                  work.node.llist)
                fn(&cb->work);
-#endif
 }
 
 static void __notify_execute_cb_irq(struct i915_request *rq)
@@ -196,10 +193,10 @@ static void __notify_execute_cb_irq(struct i915_request *rq)
 
 static bool irq_work_imm(struct irq_work *wrk)
 {
-#ifdef notyet
+#ifdef __linux__
        wrk->func(wrk);
 #else
-       STUB();
+       wrk->task.t_func(wrk);
 #endif
        return false;
 }
@@ -506,11 +503,6 @@ __await_execution(struct i915_request *rq,
        if (i915_request_is_active(signal))
                return 0;
 
-       STUB();
-       i915_sw_fence_await(&rq->submit);
-       return -ENOSYS;
-#ifdef notyet
-
 #ifdef __linux__
        cb = kmem_cache_alloc(slab_execute_cbs, gfp);
 #else
@@ -544,7 +536,6 @@ __await_execution(struct i915_request *rq,
        }
 
        return 0;
-#endif
 }
 
 static bool fatal_error(int error)
index d0d637a..bed8270 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: irq_work.h,v 1.8 2022/01/19 05:36:54 jsg Exp $        */
+/*     $OpenBSD: irq_work.h,v 1.9 2022/07/27 07:08:34 jsg Exp $        */
 /*
  * Copyright (c) 2015 Mark Kettenis
  *
 #include <sys/systm.h>
 #include <sys/task.h>
 
+#include <linux/llist.h>
+
 struct workqueue_struct;
 
 extern struct workqueue_struct *system_wq;
 
+struct irq_node {
+       struct llist_node llist;
+};
+
 struct irq_work {
        struct task task;
        struct taskq *tq;
+       struct irq_node node;
 };
 
 typedef void (*irq_work_func_t)(struct irq_work *);