From abf8aed68047c1fa4d28e92a1aa2ccf74e0be5dc Mon Sep 17 00:00:00 2001 From: Kenneth Graunke Date: Tue, 28 Apr 2020 23:30:02 -0700 Subject: [PATCH] iris: Include linux/sync_file.h instead of cut and pasting contents Lets us drop some cut and pasted kernel header contents. Linux 4.7 came out 4 years before we the first officially supported release of this driver; iris won't run on kernels older than 4.16, and 4.18.11+ is strongly recommended. So I suspect it's safe to assume that a kernel header from 4.7 will exist at build time. Part-of: --- src/gallium/drivers/iris/iris_fence.c | 20 ++------------------ 1 file changed, 2 insertions(+), 18 deletions(-) diff --git a/src/gallium/drivers/iris/iris_fence.c b/src/gallium/drivers/iris/iris_fence.c index 0d3144d61cc..65982c41c7c 100644 --- a/src/gallium/drivers/iris/iris_fence.c +++ b/src/gallium/drivers/iris/iris_fence.c @@ -26,6 +26,8 @@ * Fences for driver and IPC serialisation, scheduling and synchronisation. */ +#include + #include "util/u_inlines.h" #include "intel/common/gen_gem.h" @@ -269,24 +271,6 @@ iris_fence_finish(struct pipe_screen *p_screen, return gen_ioctl(screen->fd, DRM_IOCTL_SYNCOBJ_WAIT, &args) == 0; } -#ifndef SYNC_IOC_MAGIC -/* duplicated from linux/sync_file.h to avoid build-time dependency - * on new (v4.7) kernel headers. Once distro's are mostly using - * something newer than v4.7 drop this and #include - * instead. - */ -struct sync_merge_data { - char name[32]; - __s32 fd2; - __s32 fence; - __u32 flags; - __u32 pad; -}; - -#define SYNC_IOC_MAGIC '>' -#define SYNC_IOC_MERGE _IOWR(SYNC_IOC_MAGIC, 3, struct sync_merge_data) -#endif - static int sync_merge_fd(int sync_fd, int new_fd) { -- 2.30.2