Gentoo Archives: gentoo-dev

From: Mike Gilbert <floppym@g.o>
To: Gentoo Dev <gentoo-dev@l.g.o>
Subject: Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
Date: Wed, 29 Mar 2017 17:15:20
Message-Id: CAJ0EP42eH5v=fKjApi-foFsm2CoqH2jyCMiGQvRdnceXN1YgnA@mail.gmail.com
In Reply to: [gentoo-dev] linux/dma-buf.h mysteriously missing by "Paweł Hajdan
1 On Wed, Mar 29, 2017 at 12:34 PM, Paweł Hajdan, Jr.
2 <phajdan.jr@g.o> wrote:
3 > I was packaging chromium-59.0.3053.3 . I worked around the problem
4 > described here, but I'd like to find the right long term solution.
5 >
6 > I was hitting the following compile error:
7 >
8 > ../../ui/gfx/linux/client_native_pixmap_dmabuf.cc:39:27: fatal error:
9 > linux/dma-buf.h: No such file or directory
10 > #include <linux/dma-buf.h>
11 >
12 > Despite having sys-kernel/linux-headers-4.10 installed, I do not have
13 > that header. Interestingly, it is present in the tarball
14 > (gentoo-headers-base-4.10.tar.xz), but doesn't seem to get installed.
15 >
16 > This is the workaround I applied:
17 > <https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-dma-buf-r1.patch?id=f3d721fbb4127f17e836a1842cfdd2bf76f0d398>
18 >
19 > This is part of the chromium code in question:
20 >
21 > <https://cs.chromium.org/chromium/src/ui/gfx/linux/client_native_pixmap_dmabuf.cc?q=dma-buf.h+package:%5Echromium$&l=39&dr=C>
22 >
23 > #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
24 > #include <linux/types.h>
25 >
26 > struct local_dma_buf_sync {
27 > __u64 flags;
28 > };
29 >
30 > #define LOCAL_DMA_BUF_SYNC_READ (1 << 0)
31 > #define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0)
32 > #define LOCAL_DMA_BUF_SYNC_RW \
33 > (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
34 > #define LOCAL_DMA_BUF_SYNC_START (0 << 2)
35 > #define LOCAL_DMA_BUF_SYNC_END (1 << 2)
36 >
37 > #define LOCAL_DMA_BUF_BASE 'b'
38 > #define LOCAL_DMA_BUF_IOCTL_SYNC \
39 > _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)
40 >
41 > #else
42 > #include <linux/dma-buf.h>
43 > #endif
44
45 It seems the file was not added to include/uapi/linux/Kbuild. This was
46 likely an oversight by the kernel developer who added the header file.
47
48 I would suggest filing a bug.