SHM buffer pool and file offset

Richard Röjfors richard.rojfors at gmail.com
Thu Oct 13 17:27:32 UTC 2016


Hi all,

I have a situation where I use shared memory buffers and think it would
be very handy to be able to pass on the file offset to a create_pool call.
Right now the implementation takes for granted that it should mmap
size bytes from the beginning of the file (offset 0).

The case I see is where buffers are coming in from peripherals at specified
physical addresses.
These are in the upper area of the system memory of the device,
so mapping /dev/mem from 0 is not nice since it would result in mapping up
the complete system memory to cover the chunks in the upper part.
Of course I could implement a piece of code in the kernel which would map
the corresponding memory at offset 0, but why not let wayland be a bit more
flexible?

I have modified the create_pool to pass on the offset, and I guess this could
be of use for others too.
If would break the ABI of create_pool if not another call, like
create_pool_at, with the additional parameter is added.

Is this worth upstreaming or considered not being a mainline use case?

Thanks,
Richard


More information about the wayland-devel mailing list