Move allocator stuff into new directory

Add render/allocator/ and include/render/allocator/ to hold
everything allocator-related.
This commit is contained in:
Simon Ser 2021-08-25 09:33:19 +02:00 committed by Simon Zeni
parent b37731cdbb
commit 3ce2ea9e16
17 changed files with 35 additions and 34 deletions

View File

@ -18,7 +18,7 @@
#include <wlr/util/log.h>
#include "backend/backend.h"
#include "backend/multi.h"
#include "render/allocator.h"
#include "render/allocator/allocator.h"
#include "util/signal.h"
#if WLR_HAS_DRM_BACKEND

View File

@ -14,7 +14,7 @@
#include "backend/drm/drm.h"
#include "backend/drm/util.h"
#include "render/drm_format_set.h"
#include "render/allocator.h"
#include "render/allocator/allocator.h"
#include "render/pixel_format.h"
#include "render/swapchain.h"
#include "render/wlr_renderer.h"

View File

@ -12,7 +12,6 @@
#include "backend/backend.h"
#include "backend/headless.h"
#include "render/drm_format_set.h"
#include "render/gbm_allocator.h"
#include "render/wlr_renderer.h"
#include "util/signal.h"

View File

@ -17,7 +17,6 @@
#include "backend/backend.h"
#include "backend/wayland.h"
#include "render/allocator.h"
#include "render/drm_format_set.h"
#include "render/pixel_format.h"
#include "render/wlr_renderer.h"

View File

@ -31,7 +31,6 @@
#include "backend/backend.h"
#include "backend/x11.h"
#include "render/allocator.h"
#include "render/drm_format_set.h"
#include "util/signal.h"

View File

@ -1,9 +1,8 @@
#ifndef RENDER_ALLOCATOR
#define RENDER_ALLOCATOR
#ifndef RENDER_ALLOCATOR_ALLOCATOR_H
#define RENDER_ALLOCATOR_ALLOCATOR_H
#include <stdbool.h>
#include <wayland-server-core.h>
#include <wlr/render/dmabuf.h>
#include <wlr/render/drm_format_set.h>
struct wlr_allocator;

View File

@ -1,9 +1,9 @@
#ifndef RENDER_DRM_DUMB_ALLOCATOR_H
#define RENDER_DRM_DUMB_ALLOCATOR_H
#include "render/allocator.h"
#ifndef RENDER_ALLOCATOR_DRM_DUMB_H
#define RENDER_ALLOCATOR_DRM_DUMB_H
#include <wlr/render/dmabuf.h>
#include <wlr/types/wlr_buffer.h>
#include "render/allocator/allocator.h"
struct wlr_drm_dumb_buffer {
struct wlr_buffer base;

View File

@ -1,9 +1,10 @@
#ifndef RENDER_GBM_ALLOCATOR_H
#define RENDER_GBM_ALLOCATOR_H
#ifndef RENDER_ALLOCATOR_GBM_H
#define RENDER_ALLOCATOR_GBM_H
#include <gbm.h>
#include <wlr/render/dmabuf.h>
#include <wlr/types/wlr_buffer.h>
#include "render/allocator.h"
#include "render/allocator/allocator.h"
struct wlr_gbm_buffer {
struct wlr_buffer base;

View File

@ -1,8 +1,8 @@
#ifndef RENDER_SHM_ALLOCATOR_H
#define RENDER_SHM_ALLOCATOR_H
#ifndef RENDER_ALLOCATOR_SHM_H
#define RENDER_ALLOCATOR_SHM_H
#include <wlr/types/wlr_buffer.h>
#include "render/allocator.h"
#include "render/allocator/allocator.h"
struct wlr_shm_buffer {
struct wlr_buffer base;

View File

@ -3,10 +3,10 @@
#include <wlr/util/log.h>
#include <xf86drm.h>
#include "backend/backend.h"
#include "render/allocator.h"
#include "render/gbm_allocator.h"
#include "render/shm_allocator.h"
#include "render/drm_dumb_allocator.h"
#include "render/allocator/allocator.h"
#include "render/allocator/drm_dumb.h"
#include "render/allocator/gbm.h"
#include "render/allocator/shm.h"
#include "render/wlr_renderer.h"
void wlr_allocator_init(struct wlr_allocator *alloc,

View File

@ -13,7 +13,7 @@
#include <wlr/backend.h>
#include <wlr/backend/session.h>
#include "render/drm_dumb_allocator.h"
#include "render/allocator/drm_dumb.h"
#include "render/pixel_format.h"
static const struct wlr_buffer_impl buffer_impl;

View File

@ -6,7 +6,7 @@
#include <unistd.h>
#include <wlr/util/log.h>
#include <xf86drm.h>
#include "render/gbm_allocator.h"
#include "render/allocator/gbm.h"
static const struct wlr_buffer_impl buffer_impl;

View File

@ -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')

View File

@ -5,7 +5,7 @@
#include <unistd.h>
#include <wlr/util/log.h>
#include "render/pixel_format.h"
#include "render/shm_allocator.h"
#include "render/allocator/shm.h"
#include "util/shm.h"
static const struct wlr_buffer_impl buffer_impl;

View File

@ -6,21 +6,14 @@ elif 'auto' in renderers and get_option('auto_features').disabled()
endif
wlr_files += files(
'allocator.c',
'dmabuf.c',
'drm_format_set.c',
'gbm_allocator.c',
'pixel_format.c',
'shm_allocator.c',
'swapchain.c',
'wlr_renderer.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)
if egl.found()
wlr_deps += egl
@ -32,3 +25,5 @@ if 'gles2' in renderers or 'auto' in renderers
endif
subdir('pixman')
subdir('allocator')

View File

@ -2,7 +2,7 @@
#include <stdlib.h>
#include <wlr/util/log.h>
#include <wlr/types/wlr_buffer.h>
#include "render/allocator.h"
#include "render/allocator/allocator.h"
#include "render/drm_format_set.h"
#include "render/swapchain.h"

View File

@ -17,7 +17,7 @@
#include <wlr/util/log.h>
#include <wlr/util/region.h>
#include "backend/backend.h"
#include "render/allocator.h"
#include "render/allocator/allocator.h"
#include "render/drm_format_set.h"
#include "render/swapchain.h"
#include "render/wlr_renderer.h"