2019-04-05 12:58:27 +03:00
|
|
|
if not get_option('backend-drm')
|
|
|
|
subdir_done()
|
|
|
|
endif
|
|
|
|
|
2022-10-13 12:50:26 +03:00
|
|
|
dep_libdisplay_info = dependency(
|
|
|
|
'libdisplay-info',
|
|
|
|
version: ['>= 0.1.1', '< 0.2.0'],
|
|
|
|
fallback: ['display-info', 'di_dep'],
|
|
|
|
default_options: [
|
|
|
|
'werror=false',
|
|
|
|
],
|
|
|
|
required: false,
|
|
|
|
)
|
|
|
|
config_h.set10('HAVE_LIBDISPLAY_INFO', dep_libdisplay_info.found())
|
|
|
|
|
2019-04-05 12:58:27 +03:00
|
|
|
lib_backlight = static_library(
|
|
|
|
'backlight',
|
|
|
|
'libbacklight.c',
|
|
|
|
dependencies: [
|
|
|
|
dep_libdrm_headers,
|
|
|
|
dependency('libudev')
|
|
|
|
],
|
2019-04-05 17:09:28 +03:00
|
|
|
include_directories: common_inc,
|
2019-04-05 12:58:27 +03:00
|
|
|
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',
|
2019-06-18 13:16:53 +03:00
|
|
|
'fb.c',
|
2019-06-17 18:04:26 +03:00
|
|
|
'modes.c',
|
2019-06-18 13:12:07 +03:00
|
|
|
'kms.c',
|
2022-05-09 13:59:16 +03:00
|
|
|
'kms-color.c',
|
2019-06-18 13:30:54 +03:00
|
|
|
'state-helpers.c',
|
2019-06-22 20:40:31 +03:00
|
|
|
'state-propose.c',
|
2019-04-05 12:58:27 +03:00
|
|
|
linux_dmabuf_unstable_v1_protocol_c,
|
|
|
|
linux_dmabuf_unstable_v1_server_protocol_h,
|
|
|
|
presentation_time_server_protocol_h,
|
|
|
|
]
|
|
|
|
|
|
|
|
deps_drm = [
|
2022-12-08 18:19:34 +03:00
|
|
|
dep_egl, # optional
|
2021-07-22 16:33:51 +03:00
|
|
|
dep_libm,
|
2019-10-17 16:20:57 +03:00
|
|
|
dep_libdl,
|
2021-11-10 18:20:44 +03:00
|
|
|
dep_libshared,
|
2019-04-18 16:43:55 +03:00
|
|
|
dep_libweston_private,
|
2019-04-05 12:58:27 +03:00
|
|
|
dep_session_helper,
|
|
|
|
dep_libdrm,
|
|
|
|
dep_libinput_backend,
|
|
|
|
dependency('libudev', version: '>= 136'),
|
2022-10-13 12:50:26 +03:00
|
|
|
dep_libdisplay_info,
|
2019-04-05 12:58:27 +03:00
|
|
|
dep_backlight
|
|
|
|
]
|
|
|
|
|
2019-07-09 23:02:00 +03:00
|
|
|
if get_option('renderer-gl')
|
2019-04-05 12:58:27 +03:00
|
|
|
dep_gbm = dependency('gbm', required: false)
|
|
|
|
if not dep_gbm.found()
|
2019-07-09 23:02:00 +03:00
|
|
|
error('drm-backend with GL renderer requires gbm which was not found. Or, you can use \'-Drenderer-gl=false\'.')
|
2019-04-05 12:58:27 +03:00
|
|
|
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
|
2019-07-09 23:02:00 +03:00
|
|
|
srcs_drm += 'drm-gbm.c'
|
|
|
|
config_h.set('BUILD_DRM_GBM', '1')
|
2019-04-05 12:58:27 +03:00
|
|
|
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
|
|
|
|
|
2020-07-15 12:01:04 +03:00
|
|
|
if get_option('remoting') or get_option('pipewire')
|
2019-07-09 23:02:00 +03:00
|
|
|
if not get_option('renderer-gl')
|
2020-07-15 12:54:47 +03:00
|
|
|
error('DRM virtual requires renderer-gl.')
|
2019-07-09 23:02:00 +03:00
|
|
|
endif
|
2019-07-09 01:50:30 +03:00
|
|
|
srcs_drm += 'drm-virtual.c'
|
|
|
|
config_h.set('BUILD_DRM_VIRTUAL', '1')
|
|
|
|
endif
|
|
|
|
|
2019-04-05 12:58:27 +03:00
|
|
|
plugin_drm = shared_library(
|
|
|
|
'drm-backend',
|
|
|
|
srcs_drm,
|
2019-04-05 17:09:28 +03:00
|
|
|
include_directories: common_inc,
|
2019-04-05 12:58:27 +03:00
|
|
|
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)
|