Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Greg V
On 01/19/2018 20:38, Emil Velikov wrote: On 18 January 2018 at 22:54, Greg V wrote: Move the Weston os_create_anonymous_file code from egl/wayland into util, add support for Linux memfd and FreeBSD SHM_ANON, use that code in anv instead of explicit memfd calls for portability. --- Looks quite

Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Greg V
On 01/24/2018 15:16, Emil Velikov wrote: On 24 January 2018 at 11:58, Greg V wrote: +#ifndef __FreeBSD__ mkstemp does exist on FreeBSD, right? If so you can drop this guard and simplify the one in os_create_anonymous_file(). The guard is there because this function (create_tmpfile_cloexec)

Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-24 Thread Emil Velikov
On 24 January 2018 at 11:58, Greg V wrote: >>> >>> +#ifndef __FreeBSD__ >> >> mkstemp does exist on FreeBSD, right? If so you can drop this guard >> and simplify the one in os_create_anonymous_file(). > > The guard is there because this function (create_tmpfile_cloexec) goes > unused on FreeBSD.

Re: [Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-19 Thread Emil Velikov
On 18 January 2018 at 22:54, Greg V wrote: > Move the Weston os_create_anonymous_file code from egl/wayland into util, > add support for Linux memfd and FreeBSD SHM_ANON, > use that code in anv instead of explicit memfd calls for portability. > --- Looks quite good - a few small suggestions below

[Mesa-dev] [PATCH v2 3/5] util: add anon_file.h for all memfd/temp file usage

2018-01-19 Thread Greg V
Move the Weston os_create_anonymous_file code from egl/wayland into util, add support for Linux memfd and FreeBSD SHM_ANON, use that code in anv instead of explicit memfd calls for portability. --- src/egl/drivers/dri2/platform_wayland.c | 116 +- src/intel/vulkan/anv_allocator