public inbox for gentoo-dev@lists.gentoo.org
 help / color / mirror / Atom feed
* [gentoo-dev] linux/dma-buf.h mysteriously missing
@ 2017-03-29 16:34 Paweł Hajdan, Jr.
  2017-03-29 17:14 ` Mike Gilbert
  2017-03-29 17:51 ` Matt Turner
  0 siblings, 2 replies; 7+ messages in thread
From: Paweł Hajdan, Jr. @ 2017-03-29 16:34 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 1466 bytes --]

I was packaging chromium-59.0.3053.3 . I worked around the problem
described here, but I'd like to find the right long term solution.

I was hitting the following compile error:

../../ui/gfx/linux/client_native_pixmap_dmabuf.cc:39:27: fatal error:
linux/dma-buf.h: No such file or directory
 #include <linux/dma-buf.h>

Despite having sys-kernel/linux-headers-4.10 installed, I do not have
that header. Interestingly, it is present in the tarball
(gentoo-headers-base-4.10.tar.xz), but doesn't seem to get installed.

This is the workaround I applied:
<https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-dma-buf-r1.patch?id=f3d721fbb4127f17e836a1842cfdd2bf76f0d398>

This is part of the chromium code in question:

<https://cs.chromium.org/chromium/src/ui/gfx/linux/client_native_pixmap_dmabuf.cc?q=dma-buf.h+package:%5Echromium$&l=39&dr=C>

#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
#include <linux/types.h>

struct local_dma_buf_sync {
  __u64 flags;
};

#define LOCAL_DMA_BUF_SYNC_READ (1 << 0)
#define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0)
#define LOCAL_DMA_BUF_SYNC_RW \
  (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
#define LOCAL_DMA_BUF_SYNC_START (0 << 2)
#define LOCAL_DMA_BUF_SYNC_END (1 << 2)

#define LOCAL_DMA_BUF_BASE 'b'
#define LOCAL_DMA_BUF_IOCTL_SYNC \
  _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)

#else
#include <linux/dma-buf.h>
#endif

Paweł


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-29 16:34 [gentoo-dev] linux/dma-buf.h mysteriously missing Paweł Hajdan, Jr.
@ 2017-03-29 17:14 ` Mike Gilbert
  2017-03-29 17:51 ` Matt Turner
  1 sibling, 0 replies; 7+ messages in thread
From: Mike Gilbert @ 2017-03-29 17:14 UTC (permalink / raw
  To: Gentoo Dev

On Wed, Mar 29, 2017 at 12:34 PM, Paweł Hajdan, Jr.
<phajdan.jr@gentoo.org> wrote:
> I was packaging chromium-59.0.3053.3 . I worked around the problem
> described here, but I'd like to find the right long term solution.
>
> I was hitting the following compile error:
>
> ../../ui/gfx/linux/client_native_pixmap_dmabuf.cc:39:27: fatal error:
> linux/dma-buf.h: No such file or directory
>  #include <linux/dma-buf.h>
>
> Despite having sys-kernel/linux-headers-4.10 installed, I do not have
> that header. Interestingly, it is present in the tarball
> (gentoo-headers-base-4.10.tar.xz), but doesn't seem to get installed.
>
> This is the workaround I applied:
> <https://gitweb.gentoo.org/repo/gentoo.git/tree/www-client/chromium/files/chromium-dma-buf-r1.patch?id=f3d721fbb4127f17e836a1842cfdd2bf76f0d398>
>
> This is part of the chromium code in question:
>
> <https://cs.chromium.org/chromium/src/ui/gfx/linux/client_native_pixmap_dmabuf.cc?q=dma-buf.h+package:%5Echromium$&l=39&dr=C>
>
> #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0)
> #include <linux/types.h>
>
> struct local_dma_buf_sync {
>   __u64 flags;
> };
>
> #define LOCAL_DMA_BUF_SYNC_READ (1 << 0)
> #define LOCAL_DMA_BUF_SYNC_WRITE (2 << 0)
> #define LOCAL_DMA_BUF_SYNC_RW \
>   (LOCAL_DMA_BUF_SYNC_READ | LOCAL_DMA_BUF_SYNC_WRITE)
> #define LOCAL_DMA_BUF_SYNC_START (0 << 2)
> #define LOCAL_DMA_BUF_SYNC_END (1 << 2)
>
> #define LOCAL_DMA_BUF_BASE 'b'
> #define LOCAL_DMA_BUF_IOCTL_SYNC \
>   _IOW(LOCAL_DMA_BUF_BASE, 0, struct local_dma_buf_sync)
>
> #else
> #include <linux/dma-buf.h>
> #endif

It seems the file was not added to include/uapi/linux/Kbuild. This was
likely an oversight by the kernel developer who added the header file.

I would suggest filing a bug.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-29 16:34 [gentoo-dev] linux/dma-buf.h mysteriously missing Paweł Hajdan, Jr.
  2017-03-29 17:14 ` Mike Gilbert
@ 2017-03-29 17:51 ` Matt Turner
  2017-03-30 13:33   ` Paweł Hajdan, Jr.
  2017-03-30 14:44   ` Mike Gilbert
  1 sibling, 2 replies; 7+ messages in thread
From: Matt Turner @ 2017-03-29 17:51 UTC (permalink / raw
  To: gentoo development

It's a bug that has since been fixed by kernel commit
2220fc1ab363e6fab1f321430d69be17a8b92bd7 ("uapi: add missing install
of dma-buf.h"). The header was originally added in 4.10, and the fix
commit is in 4.11-rc1.

I guess we just need to hack around it in sys-kernel/linux-headers-4.10.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-29 17:51 ` Matt Turner
@ 2017-03-30 13:33   ` Paweł Hajdan, Jr.
  2017-03-30 14:44   ` Mike Gilbert
  1 sibling, 0 replies; 7+ messages in thread
From: Paweł Hajdan, Jr. @ 2017-03-30 13:33 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 449 bytes --]

On 29/03/2017 19:51, Matt Turner wrote:
> It's a bug that has since been fixed by kernel commit
> 2220fc1ab363e6fab1f321430d69be17a8b92bd7 ("uapi: add missing install
> of dma-buf.h"). The header was originally added in 4.10, and the fix
> commit is in 4.11-rc1.
> 
> I guess we just need to hack around it in sys-kernel/linux-headers-4.10.

Thanks for the pointer!

I filed <https://bugs.gentoo.org/show_bug.cgi?id=614290>

Paweł



[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 827 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-29 17:51 ` Matt Turner
  2017-03-30 13:33   ` Paweł Hajdan, Jr.
@ 2017-03-30 14:44   ` Mike Gilbert
  2017-03-30 14:45     ` Kristian Fiskerstrand
  2017-03-30 16:33     ` Matt Turner
  1 sibling, 2 replies; 7+ messages in thread
From: Mike Gilbert @ 2017-03-30 14:44 UTC (permalink / raw
  To: Gentoo Dev

On Wed, Mar 29, 2017 at 1:51 PM, Matt Turner <mattst88@gentoo.org> wrote:
> It's a bug that has since been fixed by kernel commit
> 2220fc1ab363e6fab1f321430d69be17a8b92bd7 ("uapi: add missing install
> of dma-buf.h"). The header was originally added in 4.10, and the fix
> commit is in 4.11-rc1.
>
> I guess we just need to hack around it in sys-kernel/linux-headers-4.10.
>

git says the file was added in 4.6, not 4.10.


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-30 14:44   ` Mike Gilbert
@ 2017-03-30 14:45     ` Kristian Fiskerstrand
  2017-03-30 16:33     ` Matt Turner
  1 sibling, 0 replies; 7+ messages in thread
From: Kristian Fiskerstrand @ 2017-03-30 14:45 UTC (permalink / raw
  To: gentoo-dev


[-- Attachment #1.1: Type: text/plain, Size: 784 bytes --]

On 03/30/2017 04:44 PM, Mike Gilbert wrote:
> On Wed, Mar 29, 2017 at 1:51 PM, Matt Turner <mattst88@gentoo.org> wrote:
>> It's a bug that has since been fixed by kernel commit
>> 2220fc1ab363e6fab1f321430d69be17a8b92bd7 ("uapi: add missing install
>> of dma-buf.h"). The header was originally added in 4.10, and the fix
>> commit is in 4.11-rc1.
>>
>> I guess we just need to hack around it in sys-kernel/linux-headers-4.10.
>>
> 
> git says the file was added in 4.6, not 4.10.
> 

That seems more consistent with the original posting, containing
#if LINUX_VERSION_CODE < KERNEL_VERSION(4, 6, 0) clause for definitions

-- 
Kristian Fiskerstrand
OpenPGP keyblock reachable at hkp://pool.sks-keyservers.net
fpr:94CB AFDD 3034 5109 5618 35AA 0B7F 8B60 E3ED FAE3


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [gentoo-dev] linux/dma-buf.h mysteriously missing
  2017-03-30 14:44   ` Mike Gilbert
  2017-03-30 14:45     ` Kristian Fiskerstrand
@ 2017-03-30 16:33     ` Matt Turner
  1 sibling, 0 replies; 7+ messages in thread
From: Matt Turner @ 2017-03-30 16:33 UTC (permalink / raw
  To: gentoo development

On Thu, Mar 30, 2017 at 7:44 AM, Mike Gilbert <floppym@gentoo.org> wrote:
> On Wed, Mar 29, 2017 at 1:51 PM, Matt Turner <mattst88@gentoo.org> wrote:
>> It's a bug that has since been fixed by kernel commit
>> 2220fc1ab363e6fab1f321430d69be17a8b92bd7 ("uapi: add missing install
>> of dma-buf.h"). The header was originally added in 4.10, and the fix
>> commit is in 4.11-rc1.
>>
>> I guess we just need to hack around it in sys-kernel/linux-headers-4.10.
>>
>
> git says the file was added in 4.6, not 4.10.

Yes, you are right. My mistake.


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2017-03-30 16:34 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-03-29 16:34 [gentoo-dev] linux/dma-buf.h mysteriously missing Paweł Hajdan, Jr.
2017-03-29 17:14 ` Mike Gilbert
2017-03-29 17:51 ` Matt Turner
2017-03-30 13:33   ` Paweł Hajdan, Jr.
2017-03-30 14:44   ` Mike Gilbert
2017-03-30 14:45     ` Kristian Fiskerstrand
2017-03-30 16:33     ` Matt Turner

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox