backend-drm: move into new subdir

Move the DRM-backend into a new sub-directory to make it stand out from
libweston core. This facilitates splitting drm.c into more files later.

vaapi-recorder is used only by DRM-backend, move that too.

libbacklight is used only by DRM-backend and a manual test program, and is
moved as well.

Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.com>
dev
Pekka Paalanen 6 years ago committed by Daniel Stone
parent 644eb64a5d
commit f0f37bcaa1
  1. 0
      libweston/backend-drm/drm.c
  2. 0
      libweston/backend-drm/libbacklight.c
  3. 0
      libweston/backend-drm/libbacklight.h
  4. 90
      libweston/backend-drm/meson.build
  5. 0
      libweston/backend-drm/vaapi-recorder.c
  6. 0
      libweston/backend-drm/vaapi-recorder.h
  7. 92
      libweston/meson.build

@ -0,0 +1,90 @@
if not get_option('backend-drm')
subdir_done()
endif
lib_backlight = static_library(
'backlight',
'libbacklight.c',
dependencies: [
dep_libdrm_headers,
dependency('libudev')
],
include_directories: include_directories('../..'),
install: false
)
dep_backlight = declare_dependency(
link_with: lib_backlight,
include_directories: include_directories('.')
)
config_h.set('BUILD_DRM_COMPOSITOR', '1')
srcs_drm = [
'drm.c',
linux_dmabuf_unstable_v1_protocol_c,
linux_dmabuf_unstable_v1_server_protocol_h,
presentation_time_server_protocol_h,
]
deps_drm = [
dep_libweston,
dep_session_helper,
dep_libdrm,
dep_libinput_backend,
dependency('libudev', version: '>= 136'),
dep_backlight
]
# XXX: Actually let DRM-backend build without GBM, it really should
if true # get_option('renderer-gl')
dep_gbm = dependency('gbm', required: false)
if not dep_gbm.found()
error('drm-backend requires gbm which was not found. Or, you can use \'-Dbackend-drm=false\'.')
endif
if dep_gbm.version().version_compare('>= 17.1')
config_h.set('HAVE_GBM_MODIFIERS', '1')
endif
if dep_gbm.version().version_compare('>= 17.2')
config_h.set('HAVE_GBM_FD_IMPORT', '1')
endif
deps_drm += dep_gbm
endif
if get_option('backend-drm-screencast-vaapi')
foreach name : [ 'libva', 'libva-drm' ]
d = dependency(name, version: '>= 0.34.0', required: false)
if not d.found()
error('VA-API recorder requires @0@ >= 0.34.0 which was not found. Or, you can use \'-Dbackend-drm-screencast-vaapi=false\'.'.format(name))
endif
deps_drm += d
endforeach
srcs_drm += 'vaapi-recorder.c'
deps_drm += dependency('threads')
config_h.set('BUILD_VAAPI_RECORDER', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.71')
config_h.set('HAVE_DRM_ADDFB2_MODIFIERS', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.78')
config_h.set('HAVE_DRM_ATOMIC', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.83')
config_h.set('HAVE_DRM_FORMATS_BLOB', '1')
endif
plugin_drm = shared_library(
'drm-backend',
srcs_drm,
include_directories: include_directories('../..', '../../shared'),
dependencies: deps_drm,
name_prefix: '',
install: true,
install_dir: dir_module_libweston
)
env_modmap += 'drm-backend.so=@0@;'.format(plugin_drm.full_path())
install_headers(backend_drm_h, subdir: dir_include_libweston_install)

@ -185,97 +185,6 @@ dep_libinput_backend = declare_dependency(
include_directories: include_directories('.')
)
if get_option('backend-drm')
config_h.set('BUILD_DRM_COMPOSITOR', '1')
lib_backlight = static_library(
'backlight',
'libbacklight.c',
dependencies: [
dep_libdrm_headers,
dependency('libudev')
],
include_directories: include_directories('..'),
install: false,
build_by_default: false
)
dep_backlight = declare_dependency(
link_with: lib_backlight,
include_directories: include_directories('.')
)
srcs_drm = [
'compositor-drm.c',
linux_dmabuf_unstable_v1_protocol_c,
linux_dmabuf_unstable_v1_server_protocol_h,
presentation_time_server_protocol_h,
]
deps_drm = [
dep_libweston,
dep_session_helper,
dep_libdrm,
dep_libinput_backend,
dependency('libudev', version: '>= 136'),
dep_backlight
]
# XXX: Actually let DRM-backend build without GBM, it really should
if true # get_option('renderer-gl')
dep_gbm = dependency('gbm', required: false)
if not dep_gbm.found()
error('drm-backend requires gbm which was not found. Or, you can use \'-Dbackend-drm=false\'.')
endif
if dep_gbm.version().version_compare('>= 17.1')
config_h.set('HAVE_GBM_MODIFIERS', '1')
endif
if dep_gbm.version().version_compare('>= 17.2')
config_h.set('HAVE_GBM_FD_IMPORT', '1')
endif
deps_drm += dep_gbm
endif
if get_option('backend-drm-screencast-vaapi')
foreach name : [ 'libva', 'libva-drm' ]
d = dependency(name, version: '>= 0.34.0', required: false)
if not d.found()
error('VA-API recorder requires @0@ >= 0.34.0 which was not found. Or, you can use \'-Dbackend-drm-screencast-vaapi=false\'.'.format(name))
endif
deps_drm += d
endforeach
srcs_drm += 'vaapi-recorder.c'
deps_drm += dependency('threads')
config_h.set('BUILD_VAAPI_RECORDER', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.71')
config_h.set('HAVE_DRM_ADDFB2_MODIFIERS', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.78')
config_h.set('HAVE_DRM_ATOMIC', '1')
endif
if dep_libdrm.version().version_compare('>= 2.4.83')
config_h.set('HAVE_DRM_FORMATS_BLOB', '1')
endif
plugin_drm = shared_library(
'drm-backend',
srcs_drm,
include_directories: include_directories('..', '../shared'),
dependencies: deps_drm,
name_prefix: '',
install: true,
install_dir: dir_module_libweston
)
env_modmap += 'drm-backend.so=@0@;'.format(plugin_drm.full_path())
install_headers(backend_drm_h, subdir: dir_include_libweston_install)
endif
if get_option('backend-headless')
config_h.set('BUILD_HEADLESS_COMPOSITOR', '1')
@ -487,3 +396,4 @@ if get_option('weston-launch')
endif
subdir('renderer-gl')
subdir('backend-drm')

Loading…
Cancel
Save