Simon Ser
38ba5881a0
buffer: replace get_data_ptr with {begin,end}_data_ptr_access
...
This new API allows buffer implementations to know when a user is
actively accessing the buffer's underlying storage. This is
important for the upcoming client-backed wlr_buffer implementation.
4 years ago
Simon Ser
68758e8c21
buffer: use wlr_texture_from_buffer for DMA-BUFs
4 years ago
Simon Ser
24fde77c62
buffer: add format param to get_data_ptr
...
Allow wlr_buffer_impl.get_data_ptr to return a format.
This allows the Pixman renderer to not care about get_dmabuf/get_shm,
and only care about get_data_ptr. This will also help with [1], because
client wl_shm buffers can't implement get_shm.
[1]: https://github.com/swaywm/wlroots/pull/2892
References: https://github.com/swaywm/wlroots/issues/2864
4 years ago
Simon Ser
6c61de996c
buffer: introduce wlr_buffer_get_shm
...
References: https://github.com/swaywm/wlroots/issues/2399#issuecomment-769408708
4 years ago
Simon Zeni
0b9288ec0b
buffer: introduce wlr_buffer_get_data_ptr
...
The function has been place in an internal header for API stability
reasons.
4 years ago
Simon Zeni
50d2985607
Move render/shm_format functions to render/pixel_format
4 years ago
Simon Ser
c2815fd44d
buffer: add missing convert_wl_shm_format_to_drm call
...
Fixes: 27fba3df43
("render: use DRM formats in wlr_texture_from_pixels")
Closes: https://github.com/swaywm/wlroots/issues/2757
4 years ago
Simon Ser
b9460ab724
Stop using wlr_texture_get_size
...
Just use wlr_texture.{width,height} directly.
4 years ago
Simon Ser
ae5275c09f
client-buffer: remove unnecessary wlr_resource_get_buffer_size
...
We can just get the size from the imported texture.
4 years ago
Simon Ser
0b40d09a21
buffer: add wlr_client_buffer_get
4 years ago
Simon Ser
1fa9e0203b
buffer: add width and height
5 years ago
Simon Ser
6595db6409
buffer: add a release event
...
Consumers call wlr_buffer_lock. Once all consumers are done with the
buffer, only the producer should have a reference to the buffer. In this
case, we can release the buffer (and let the producer re-use it).
5 years ago
Simon Ser
1674ca725c
buffer: add destroy event
5 years ago
Simon Ser
41f9916ae5
buffer: remove unused wlr_client_buffer fields
...
Forgot to remove these, they are superseded by fields in wlr_buffer. Some
functions were still using them.
Fixes: 8afc1ed68c
("Introduce wlr_client_buffer")
Closes: https://github.com/swaywm/sway/issues/5087
5 years ago
Simon Ser
8afc1ed68c
Introduce wlr_client_buffer
...
Split out the client/resource handling out of wlr_buffer by introducing
wlr_client_buffer. Make wlr_buffer an interface so that compositors can
create their own wlr_buffers (e.g. backed by GBM, like glider [1]).
[1]: c66847dd1c/include/gbm_allocator.h (L7)
5 years ago
Simon Ser
96e8e9b098
buffer: improve error handling
...
In case the texture can't be imported, release the buffer so that the
client can submit another one. In case the allocation fails, disconnect
the client.
5 years ago
Simon Ser
493804e421
buffer: add wlr_buffer_get_dmabuf
6 years ago
nyorain
cd28637187
Remove fmt parameter from wlr_texture_write_pixels
...
It's not allowed to change the format of a texture so remove
the confusing parameter.
6 years ago
emersion
ac28d701c0
buffer: disconnect clients that commit an unknown buffer type
...
If this happens, something went really wrong and we should do more
than just logging an error. See [1].
[1]: https://gitlab.freedesktop.org/wayland/weston/issues/148
6 years ago
emersion
5dbf0fe7f2
linux-dmabuf: add v1 suffix
...
This prevents some future conflicts with the stable version.
Fixes #1133
6 years ago
emersion
7cbef15206
util: add wlr_ prefix to log symbols
6 years ago
emersion
225aa815b0
buffer: fix wlr_texture leak on failed alloc
7 years ago
emersion
da114d5013
buffer: don't destroy DMA-BUF textures with wl_buffer
...
After some discussions on #wayland, it seems that as soon as you
hold a reference to a DMA-BUF (via EGLImage for instance), the
underlying memory won't get free'd. The client is allowed to
re-use the DMA-BUF and upload something else to it though.
7 years ago
emersion
3a2ef75d3a
Add back wlr_buffer
...
This reverts commit d27eeaa14c
.
7 years ago
Drew DeVault
d27eeaa14c
Revert "Merge pull request #1050 from emersion/wlr-buffer"
...
This reverts commit 5e4af4862e
, reversing
changes made to 9a1f0e2d5f
.
7 years ago
emersion
38d415dd20
buffer: make wlr_buffer_ref return the buffer
7 years ago
emersion
e4933ab445
Introduce wlr_buffer
7 years ago