From: Kenneth Graunke Date: Wed, 29 Apr 2020 06:30:02 +0000 (-0700) Subject: iris: Include linux/sync_file.h instead of cut and pasting contents X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=abf8aed68047;p=mesa.git 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: --- 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) {