Move allocator stuff into new directory
Add render/allocator/ and include/render/allocator/ to hold everything allocator-related.
This commit is contained in:
parent
b37731cdbb
commit
3ce2ea9e16
|
@ -18,7 +18,7 @@
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "backend/multi.h"
|
#include "backend/multi.h"
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
#include "util/signal.h"
|
#include "util/signal.h"
|
||||||
|
|
||||||
#if WLR_HAS_DRM_BACKEND
|
#if WLR_HAS_DRM_BACKEND
|
||||||
|
|
|
@ -14,7 +14,7 @@
|
||||||
#include "backend/drm/drm.h"
|
#include "backend/drm/drm.h"
|
||||||
#include "backend/drm/util.h"
|
#include "backend/drm/util.h"
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
#include "render/pixel_format.h"
|
#include "render/pixel_format.h"
|
||||||
#include "render/swapchain.h"
|
#include "render/swapchain.h"
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
|
|
|
@ -12,7 +12,6 @@
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "backend/headless.h"
|
#include "backend/headless.h"
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/gbm_allocator.h"
|
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
#include "util/signal.h"
|
#include "util/signal.h"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,6 @@
|
||||||
|
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "backend/wayland.h"
|
#include "backend/wayland.h"
|
||||||
#include "render/allocator.h"
|
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/pixel_format.h"
|
#include "render/pixel_format.h"
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
|
|
|
@ -31,7 +31,6 @@
|
||||||
|
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "backend/x11.h"
|
#include "backend/x11.h"
|
||||||
#include "render/allocator.h"
|
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "util/signal.h"
|
#include "util/signal.h"
|
||||||
|
|
||||||
|
|
|
@ -1,9 +1,8 @@
|
||||||
#ifndef RENDER_ALLOCATOR
|
#ifndef RENDER_ALLOCATOR_ALLOCATOR_H
|
||||||
#define RENDER_ALLOCATOR
|
#define RENDER_ALLOCATOR_ALLOCATOR_H
|
||||||
|
|
||||||
#include <stdbool.h>
|
#include <stdbool.h>
|
||||||
#include <wayland-server-core.h>
|
#include <wayland-server-core.h>
|
||||||
#include <wlr/render/dmabuf.h>
|
|
||||||
#include <wlr/render/drm_format_set.h>
|
#include <wlr/render/drm_format_set.h>
|
||||||
|
|
||||||
struct wlr_allocator;
|
struct wlr_allocator;
|
|
@ -1,9 +1,9 @@
|
||||||
#ifndef RENDER_DRM_DUMB_ALLOCATOR_H
|
#ifndef RENDER_ALLOCATOR_DRM_DUMB_H
|
||||||
#define RENDER_DRM_DUMB_ALLOCATOR_H
|
#define RENDER_ALLOCATOR_DRM_DUMB_H
|
||||||
|
|
||||||
#include "render/allocator.h"
|
|
||||||
|
|
||||||
|
#include <wlr/render/dmabuf.h>
|
||||||
#include <wlr/types/wlr_buffer.h>
|
#include <wlr/types/wlr_buffer.h>
|
||||||
|
#include "render/allocator/allocator.h"
|
||||||
|
|
||||||
struct wlr_drm_dumb_buffer {
|
struct wlr_drm_dumb_buffer {
|
||||||
struct wlr_buffer base;
|
struct wlr_buffer base;
|
|
@ -1,9 +1,10 @@
|
||||||
#ifndef RENDER_GBM_ALLOCATOR_H
|
#ifndef RENDER_ALLOCATOR_GBM_H
|
||||||
#define RENDER_GBM_ALLOCATOR_H
|
#define RENDER_ALLOCATOR_GBM_H
|
||||||
|
|
||||||
#include <gbm.h>
|
#include <gbm.h>
|
||||||
|
#include <wlr/render/dmabuf.h>
|
||||||
#include <wlr/types/wlr_buffer.h>
|
#include <wlr/types/wlr_buffer.h>
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
|
|
||||||
struct wlr_gbm_buffer {
|
struct wlr_gbm_buffer {
|
||||||
struct wlr_buffer base;
|
struct wlr_buffer base;
|
|
@ -1,8 +1,8 @@
|
||||||
#ifndef RENDER_SHM_ALLOCATOR_H
|
#ifndef RENDER_ALLOCATOR_SHM_H
|
||||||
#define RENDER_SHM_ALLOCATOR_H
|
#define RENDER_ALLOCATOR_SHM_H
|
||||||
|
|
||||||
#include <wlr/types/wlr_buffer.h>
|
#include <wlr/types/wlr_buffer.h>
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
|
|
||||||
struct wlr_shm_buffer {
|
struct wlr_shm_buffer {
|
||||||
struct wlr_buffer base;
|
struct wlr_buffer base;
|
|
@ -3,10 +3,10 @@
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
#include "render/gbm_allocator.h"
|
#include "render/allocator/drm_dumb.h"
|
||||||
#include "render/shm_allocator.h"
|
#include "render/allocator/gbm.h"
|
||||||
#include "render/drm_dumb_allocator.h"
|
#include "render/allocator/shm.h"
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
|
|
||||||
void wlr_allocator_init(struct wlr_allocator *alloc,
|
void wlr_allocator_init(struct wlr_allocator *alloc,
|
|
@ -13,7 +13,7 @@
|
||||||
#include <wlr/backend.h>
|
#include <wlr/backend.h>
|
||||||
#include <wlr/backend/session.h>
|
#include <wlr/backend/session.h>
|
||||||
|
|
||||||
#include "render/drm_dumb_allocator.h"
|
#include "render/allocator/drm_dumb.h"
|
||||||
#include "render/pixel_format.h"
|
#include "render/pixel_format.h"
|
||||||
|
|
||||||
static const struct wlr_buffer_impl buffer_impl;
|
static const struct wlr_buffer_impl buffer_impl;
|
|
@ -6,7 +6,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include <xf86drm.h>
|
#include <xf86drm.h>
|
||||||
#include "render/gbm_allocator.h"
|
#include "render/allocator/gbm.h"
|
||||||
|
|
||||||
static const struct wlr_buffer_impl buffer_impl;
|
static const struct wlr_buffer_impl buffer_impl;
|
||||||
|
|
|
@ -0,0 +1,9 @@
|
||||||
|
wlr_files += files(
|
||||||
|
'allocator.c',
|
||||||
|
'gbm.c',
|
||||||
|
'shm.c',
|
||||||
|
'drm_dumb.c',
|
||||||
|
)
|
||||||
|
|
||||||
|
has = cc.has_function('gbm_bo_get_fd_for_plane', dependencies: [gbm])
|
||||||
|
add_project_arguments('-DHAS_GBM_BO_GET_FD_FOR_PLANE=@0@'.format(has.to_int()), language: 'c')
|
|
@ -5,7 +5,7 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include "render/pixel_format.h"
|
#include "render/pixel_format.h"
|
||||||
#include "render/shm_allocator.h"
|
#include "render/allocator/shm.h"
|
||||||
#include "util/shm.h"
|
#include "util/shm.h"
|
||||||
|
|
||||||
static const struct wlr_buffer_impl buffer_impl;
|
static const struct wlr_buffer_impl buffer_impl;
|
|
@ -6,21 +6,14 @@ elif 'auto' in renderers and get_option('auto_features').disabled()
|
||||||
endif
|
endif
|
||||||
|
|
||||||
wlr_files += files(
|
wlr_files += files(
|
||||||
'allocator.c',
|
|
||||||
'dmabuf.c',
|
'dmabuf.c',
|
||||||
'drm_format_set.c',
|
'drm_format_set.c',
|
||||||
'gbm_allocator.c',
|
|
||||||
'pixel_format.c',
|
'pixel_format.c',
|
||||||
'shm_allocator.c',
|
|
||||||
'swapchain.c',
|
'swapchain.c',
|
||||||
'wlr_renderer.c',
|
'wlr_renderer.c',
|
||||||
'wlr_texture.c',
|
'wlr_texture.c',
|
||||||
'drm_dumb_allocator.c',
|
|
||||||
)
|
)
|
||||||
|
|
||||||
has = cc.has_function('gbm_bo_get_fd_for_plane', dependencies: [gbm])
|
|
||||||
add_project_arguments('-DHAS_GBM_BO_GET_FD_FOR_PLANE=@0@'.format(has.to_int()), language: 'c')
|
|
||||||
|
|
||||||
egl = dependency('egl', required: 'gles2' in renderers)
|
egl = dependency('egl', required: 'gles2' in renderers)
|
||||||
if egl.found()
|
if egl.found()
|
||||||
wlr_deps += egl
|
wlr_deps += egl
|
||||||
|
@ -32,3 +25,5 @@ if 'gles2' in renderers or 'auto' in renderers
|
||||||
endif
|
endif
|
||||||
|
|
||||||
subdir('pixman')
|
subdir('pixman')
|
||||||
|
|
||||||
|
subdir('allocator')
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include <wlr/types/wlr_buffer.h>
|
#include <wlr/types/wlr_buffer.h>
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/swapchain.h"
|
#include "render/swapchain.h"
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@
|
||||||
#include <wlr/util/log.h>
|
#include <wlr/util/log.h>
|
||||||
#include <wlr/util/region.h>
|
#include <wlr/util/region.h>
|
||||||
#include "backend/backend.h"
|
#include "backend/backend.h"
|
||||||
#include "render/allocator.h"
|
#include "render/allocator/allocator.h"
|
||||||
#include "render/drm_format_set.h"
|
#include "render/drm_format_set.h"
|
||||||
#include "render/swapchain.h"
|
#include "render/swapchain.h"
|
||||||
#include "render/wlr_renderer.h"
|
#include "render/wlr_renderer.h"
|
||||||
|
|
Loading…
Reference in New Issue