Commit Graph

11 Commits

Author SHA1 Message Date
Simon Ser fdb24d19ca allocator/drm_dumb: use libdrm dumb buffer helpers
References: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/272
2022-11-17 08:05:55 +00:00
Simon Ser 58d4cfaca3 render/allocator/drm_dumb: drop finish_buffer()
Simplify things a bit.
2022-10-01 19:45:29 +00:00
Simon Ser c659792d7b render/allocator/drm_dumb: fix error handling
In the CREATE_DUMB error code-path, we'd only free() the buffer,
however it's already inserted in the alloc->buffers list at this
point.

Instead, make sure finish_buffer() is safe to call (by populating
drm_fd) and call that function.
2022-10-01 19:45:29 +00:00
Simon Ser 3e7ea8715b render/allocator/drm_dumb: get format info before allocating
Simplifies error handling a bit.
2022-10-01 19:45:29 +00:00
Simon Ser d81f68d2b4 render/allocator/drm_dumb: check modifier list
Check that the modifier list passed as input contains either
INVALID or LINEAR. We don't support others.
2022-10-01 19:45:29 +00:00
Simon Ser 5ef8a18a29 render/allocator/drm_dumb: advertise LINEAR instead of INVALID modifier
INVALID means that the modifier is implicit. However dumb buffers
are guaranteed to be LINEAR, so let's just advertise this. Fixes
cursors with the DRM backend: cursor planes usually only support
LINEAR.
2022-10-01 19:45:29 +00:00
Simon Ser 39b68ea47a buffer: extract interface to separate header
Closes: https://gitlab.freedesktop.org/wlroots/wlroots/-/issues/3389
2022-03-03 15:39:05 +01:00
Simon Zeni 02a1ae169e render/allocator: make wlr_allocator part of the public API 2021-11-09 15:26:36 +00:00
Simon Ser 4e7a8707cc buffer: add data_ptr access flags
This allows callers to specify the operations they'll perform on
the returned data pointer. The motivations for this are:

- The upcoming Linux MAP_NOSIGBUS flag may only be usable on
  read-only mappings.
- gbm_bo_map with GBM_BO_TRANSFER_READ hurts performance.
2021-09-10 13:16:10 -04:00
Simon Ser d9d8fc1ab9 render/allocator: re-open GBM FD
Using the same DRM file description for the DRM backend and for the
GBM allocator will result in GEM handle ref'counting issues [1].
Re-open the DRM FD to fix these issues.

[1]: https://gitlab.freedesktop.org/mesa/drm/-/merge_requests/110
2021-09-01 15:17:05 -04:00
Simon Ser 3ce2ea9e16 Move allocator stuff into new directory
Add render/allocator/ and include/render/allocator/ to hold
everything allocator-related.
2021-08-25 09:57:20 -04:00
Renamed from render/drm_dumb_allocator.c (Browse further)