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 */ 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) 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