SHM buffer pool and file offset

Giulio Camuffo giuliocamuffo at gmail.com
Fri Oct 14 07:07:42 UTC 2016


Hi,

2016-10-13 19:27 GMT+02:00 Richard Röjfors <richard.rojfors at gmail.com>:
> 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.

We cannot break the API/ABI, but a new request is fine. Personally, I
think it would be a nice addition.

Cheers,
Giulio

>
> Is this worth upstreaming or considered not being a mainline use case?
>
> Thanks,
> Richard
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list