mirror of
https://gitlab.freedesktop.org/wlroots/wlroots.git
synced 2025-11-03 09:01:40 -05:00
render: add DRM dumb buffer allocator
This commit is contained in:
parent
2c90e0f521
commit
ed7f2651b6
4 changed files with 286 additions and 1 deletions
37
include/render/drm_dumb_allocator.h
Normal file
37
include/render/drm_dumb_allocator.h
Normal file
|
|
@ -0,0 +1,37 @@
|
|||
#ifndef RENDER_DRM_DUMB_ALLOCATOR_H
|
||||
#define RENDER_DRM_DUMB_ALLOCATOR_H
|
||||
|
||||
#include "render/allocator.h"
|
||||
|
||||
#include <wlr/types/wlr_buffer.h>
|
||||
|
||||
struct wlr_drm_dumb_buffer {
|
||||
struct wlr_buffer base;
|
||||
struct wl_list link; // wlr_drm_dumb_allocator::buffers
|
||||
|
||||
int drm_fd; // -1 if the allocator has been destroyed
|
||||
struct wlr_dmabuf_attributes dmabuf;
|
||||
|
||||
uint32_t format;
|
||||
uint32_t handle;
|
||||
uint32_t stride;
|
||||
uint32_t width, height;
|
||||
|
||||
uint64_t size;
|
||||
void *data;
|
||||
};
|
||||
|
||||
struct wlr_drm_dumb_allocator {
|
||||
struct wlr_allocator base;
|
||||
struct wl_list buffers; // wlr_drm_dumb_buffer::link
|
||||
int drm_fd;
|
||||
};
|
||||
|
||||
/**
|
||||
* Creates a new drm dumb allocator from a DRM FD.
|
||||
*
|
||||
* Does not take ownership over the FD.
|
||||
*/
|
||||
struct wlr_allocator *wlr_drm_dumb_allocator_create(int fd);
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue