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: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/3802>
This commit is contained in:
Kenneth Graunke 2020-04-28 23:30:02 -07:00 committed by Marge Bot
parent a807c9e91d
commit abf8aed680

View file

@ -26,6 +26,8 @@
* Fences for driver and IPC serialisation, scheduling and synchronisation.
*/
#include <linux/sync_file.h>
#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 <linux/sync_file.h>
* 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)
{