summaryrefslogtreecommitdiff
path: root/remoting
diff options
context:
space:
mode:
authorDaniel Stone <daniels@collabora.com>2019-11-11 09:40:27 +0000
committerDaniel Stone <daniels@collabora.com>2019-11-11 10:54:17 +0000
commit4b8b60ebfd399a6641cdd138ebbcf7b1045f0daf (patch)
treed7caf4819192dd2e45a54a465a5170c451c47c7b /remoting
parent04eebc7f07781710c1e17e934390328b628b75ee (diff)
downloadweston-4b8b60ebfd399a6641cdd138ebbcf7b1045f0daf.tar.gz
remoting: Use DRM FourCC formats instead of GBM formats
The remoting plugin currently has a set_gbm_format() hook, which accepts GBM_FORMAT_* tokens from the host to set as a supported format. GBM_FORMAT_* values are strictly aliased with DRM_FORMAT_*. In order to avoid an extra unnecessary dependency from the remoting plugin on GBM, switch to using the formats from libdrm instead. This fixes a compile error seen when the remoting plugin is enabled: ../remoting/remoting-plugin.c:39:10: fatal error: gbm.h: No such file or directory 39 | #include <gbm.h> | ^~~~~~~ compilation terminated. The error was caused by not having any dependency at all on GBM from the remoting backend, which is fixed here by adding a new dependency on the libdrm headers for drm_fourcc.h. Signed-off-by: Daniel Stone <daniels@collabora.com>
Diffstat (limited to 'remoting')
-rw-r--r--remoting/meson.build2
-rw-r--r--remoting/remoting-plugin.c10
2 files changed, 7 insertions, 5 deletions
diff --git a/remoting/meson.build b/remoting/meson.build
index 8b96f122..ed7ff479 100644
--- a/remoting/meson.build
+++ b/remoting/meson.build
@@ -10,7 +10,7 @@ if get_option('remoting')
'gstreamer-app-1.0', 'gstreamer-video-1.0',
'gobject-2.0', 'glib-2.0'
]
- deps_remoting = [ dep_libweston_private ]
+ deps_remoting = [ dep_libweston_private, dep_libdrm_headers ]
foreach depname : depnames
dep = dependency(depname, required: false)
if not dep.found()
diff --git a/remoting/remoting-plugin.c b/remoting/remoting-plugin.c
index c05977eb..8b82572a 100644
--- a/remoting/remoting-plugin.c
+++ b/remoting/remoting-plugin.c
@@ -36,12 +36,12 @@
#include <unistd.h>
#include <sys/types.h>
#include <fcntl.h>
-#include <gbm.h>
#include <gst/gst.h>
#include <gst/allocators/gstdmabuf.h>
#include <gst/app/gstappsrc.h>
#include <gst/video/gstvideometa.h>
+#include <drm_fourcc.h>
#include "remoting-plugin.h"
#include <libweston/backend-drm.h>
@@ -69,6 +69,8 @@ struct remoted_gstpipe {
/* supported gbm format list */
struct remoted_output_support_gbm_format {
+ /* GBM_FORMAT_* tokens are strictly aliased with DRM_FORMAT_*, so we
+ * use the latter to avoid a dependency on GBM */
uint32_t gbm_format;
const char *gst_format_string;
GstVideoFormat gst_video_format;
@@ -76,15 +78,15 @@ struct remoted_output_support_gbm_format {
static const struct remoted_output_support_gbm_format supported_formats[] = {
{
- .gbm_format = GBM_FORMAT_XRGB8888,
+ .gbm_format = DRM_FORMAT_XRGB8888,
.gst_format_string = "BGRx",
.gst_video_format = GST_VIDEO_FORMAT_BGRx,
}, {
- .gbm_format = GBM_FORMAT_RGB565,
+ .gbm_format = DRM_FORMAT_RGB565,
.gst_format_string = "RGB16",
.gst_video_format = GST_VIDEO_FORMAT_RGB16,
}, {
- .gbm_format = GBM_FORMAT_XRGB2101010,
+ .gbm_format = DRM_FORMAT_XRGB2101010,
.gst_format_string = "r210",
.gst_video_format = GST_VIDEO_FORMAT_r210,
}