diff options
author | Simon Ser <contact@emersion.fr> | 2021-08-25 09:33:19 +0200 |
---|---|---|
committer | Simon Zeni <simon@bl4ckb0ne.ca> | 2021-08-25 09:57:20 -0400 |
commit | 3ce2ea9e16fcd1bfab4ec9d5994fa721c5d58dcd (patch) | |
tree | 1bce6445158968c4d73cd73be30c141468dbc84c | |
parent | b37731cdbbef4dc52033c2d26b04d2329720fa07 (diff) |
Move allocator stuff into new directory
Add render/allocator/ and include/render/allocator/ to hold
everything allocator-related.
-rw-r--r-- | backend/backend.c | 2 | ||||
-rw-r--r-- | backend/drm/renderer.c | 2 | ||||
-rw-r--r-- | backend/headless/backend.c | 1 | ||||
-rw-r--r-- | backend/wayland/backend.c | 1 | ||||
-rw-r--r-- | backend/x11/backend.c | 1 | ||||
-rw-r--r-- | include/render/allocator/allocator.h (renamed from include/render/allocator.h) | 5 | ||||
-rw-r--r-- | include/render/allocator/drm_dumb.h (renamed from include/render/drm_dumb_allocator.h) | 8 | ||||
-rw-r--r-- | include/render/allocator/gbm.h (renamed from include/render/gbm_allocator.h) | 7 | ||||
-rw-r--r-- | include/render/allocator/shm.h (renamed from include/render/shm_allocator.h) | 6 | ||||
-rw-r--r-- | render/allocator/allocator.c (renamed from render/allocator.c) | 8 | ||||
-rw-r--r-- | render/allocator/drm_dumb.c (renamed from render/drm_dumb_allocator.c) | 2 | ||||
-rw-r--r-- | render/allocator/gbm.c (renamed from render/gbm_allocator.c) | 2 | ||||
-rw-r--r-- | render/allocator/meson.build | 9 | ||||
-rw-r--r-- | render/allocator/shm.c (renamed from render/shm_allocator.c) | 2 | ||||
-rw-r--r-- | render/meson.build | 9 | ||||
-rw-r--r-- | render/swapchain.c | 2 | ||||
-rw-r--r-- | types/wlr_output.c | 2 |
17 files changed, 35 insertions, 34 deletions
diff --git a/backend/backend.c b/backend/backend.c index ef1d523c..1cdddd16 100644 --- a/backend/backend.c +++ b/backend/backend.c @@ -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 diff --git a/backend/drm/renderer.c b/backend/drm/renderer.c index adda8fd5..4f1b102a 100644 --- a/backend/drm/renderer.c +++ b/backend/drm/renderer.c @@ -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" diff --git a/backend/headless/backend.c b/backend/headless/backend.c index cf7f6026..51217f8b 100644 --- a/backend/headless/backend.c +++ b/backend/headless/backend.c @@ -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" diff --git a/backend/wayland/backend.c b/backend/wayland/backend.c index 207c17d2..c11d25ca 100644 --- a/backend/wayland/backend.c +++ b/backend/wayland/backend.c @@ -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" diff --git a/backend/x11/backend.c b/backend/x11/backend.c index acdd3f39..f55238cb 100644 --- a/backend/x11/backend.c +++ b/backend/x11/backend.c @@ -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" diff --git a/include/render/allocator.h b/include/render/allocator/allocator.h index c33ab126..d67116cd 100644 --- a/include/render/allocator.h +++ b/include/render/allocator/allocator.h @@ -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; diff --git a/include/render/drm_dumb_allocator.h b/include/render/allocator/drm_dumb.h index ff10d54b..7e37acfb 100644 --- a/include/render/drm_dumb_allocator.h +++ b/include/render/allocator/drm_dumb.h @@ -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; diff --git a/include/render/gbm_allocator.h b/include/render/allocator/gbm.h index df6b5e39..eb112e7c 100644 --- a/include/render/gbm_allocator.h +++ b/include/render/allocator/gbm.h @@ -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; diff --git a/include/render/shm_allocator.h b/include/render/allocator/shm.h index d1f48f7f..4b80e475 100644 --- a/include/render/shm_allocator.h +++ b/include/render/allocator/shm.h @@ -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; diff --git a/render/allocator.c b/render/allocator/allocator.c index 5b7e27ff..8664202f 100644 --- a/render/allocator.c +++ b/render/allocator/allocator.c @@ -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, diff --git a/render/drm_dumb_allocator.c b/render/allocator/drm_dumb.c index c0038dff..a47df624 100644 --- a/render/drm_dumb_allocator.c +++ b/render/allocator/drm_dumb.c @@ -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; diff --git a/render/gbm_allocator.c b/render/allocator/gbm.c index 154e5137..ace7ca68 100644 --- a/render/gbm_allocator.c +++ b/render/allocator/gbm.c @@ -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; diff --git a/render/allocator/meson.build b/render/allocator/meson.build new file mode 100644 index 00000000..db17ccb2 --- /dev/null +++ b/render/allocator/meson.build @@ -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') diff --git a/render/shm_allocator.c b/render/allocator/shm.c index 1797433f..7b32cf8d 100644 --- a/render/shm_allocator.c +++ b/render/allocator/shm.c @@ -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; diff --git a/render/meson.build b/render/meson.build index 8c1793f1..b35ba7c9 100644 --- a/render/meson.build +++ b/render/meson.build @@ -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') diff --git a/render/swapchain.c b/render/swapchain.c index fd9f8725..8d3b55f0 100644 --- a/render/swapchain.c +++ b/render/swapchain.c @@ -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" diff --git a/types/wlr_output.c b/types/wlr_output.c index eea282dc..65c1d926 100644 --- a/types/wlr_output.c +++ b/types/wlr_output.c @@ -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" |