From 4db2db4a065cb100acb153744e83fd301befdbf4 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Mon, 16 Nov 2020 18:23:18 +0300 Subject: [PATCH 1/3] Use llist.h from base system. --- linuxkpi/gplv2/include/linux/llist.h | 5 +++++ linuxkpi/gplv2/src/linux_llist.c | 3 +++ 2 files changed, 8 insertions(+) diff --git a/linuxkpi/gplv2/include/linux/llist.h b/linuxkpi/gplv2/include/linux/llist.h index a1d00615d9c..c866b230ac4 100644 --- a/linuxkpi/gplv2/include/linux/llist.h +++ b/linuxkpi/gplv2/include/linux/llist.h @@ -1,3 +1,5 @@ +#include +#if __FreeBSD_version < 1300128 #ifndef _LINUX_GPLV2_LLIST_H #define _LINUX_GPLV2_LLIST_H /* @@ -223,3 +225,6 @@ struct llist_node *llist_reverse_order(struct llist_node *head); #endif /* _LINUX_GPLV2_LLIST_H */ +#else +#include_next +#endif diff --git a/linuxkpi/gplv2/src/linux_llist.c b/linuxkpi/gplv2/src/linux_llist.c index 08f476e2427..254ec383e3b 100644 --- a/linuxkpi/gplv2/src/linux_llist.c +++ b/linuxkpi/gplv2/src/linux_llist.c @@ -1,3 +1,5 @@ +#include +#if __FreeBSD_version < 1300128 /* * Lock-less NULL terminated single linked list * @@ -99,3 +101,4 @@ struct llist_node *llist_reverse_order(struct llist_node *head) return new_head; } +#endif From 4fe96ee179b97da4d2c2ad897632b838462ae9ac Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Thu, 12 Nov 2020 12:54:38 +0300 Subject: [PATCH 2/3] Chase https://reviews.freebsd.org/D27171 --- drivers/gpu/drm/i915/i915_request.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_request.c b/drivers/gpu/drm/i915/i915_request.c index 42c198b6940..7f98ab3d735 100644 --- a/drivers/gpu/drm/i915/i915_request.c +++ b/drivers/gpu/drm/i915/i915_request.c @@ -364,7 +364,7 @@ __i915_request_await_execution(struct i915_request *rq, if (hook) { cb->hook = hook; cb->signal = i915_request_get(signal); -#ifdef __linux__ +#if defined(__linux__) || (defined(__FreeBSD__) && __FreeBSD_version > 1300127) cb->work.func = irq_execute_cb_hook; #elif defined(__FreeBSD__) /* irq_work is just a workqueue for us */ From 65ee3947f3deb596ecc9b49e544d01fbd4096d29 Mon Sep 17 00:00:00 2001 From: Vladimir Kondratyev Date: Thu, 12 Nov 2020 18:45:27 +0300 Subject: [PATCH 3/3] Use asynchronous free() call in i915_sw_fence code to fix #9. --- drivers/gpu/drm/i915/i915_sw_fence.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/gpu/drm/i915/i915_sw_fence.c b/drivers/gpu/drm/i915/i915_sw_fence.c index 6a88db29125..815bf6717c3 100644 --- a/drivers/gpu/drm/i915/i915_sw_fence.c +++ b/drivers/gpu/drm/i915/i915_sw_fence.c @@ -384,7 +384,11 @@ static void dma_i915_sw_fence_wake(struct dma_fence *dma, i915_sw_fence_set_error_once(cb->fence, dma->error); i915_sw_fence_complete(cb->fence); +#if defined(__FreeBSD__) && __FreeBSD_version > 1300127 + kfree_async(cb); +#else kfree(cb); +#endif } static void timer_i915_sw_fence_wake(struct timer_list *t)