aboutsummaryrefslogtreecommitdiff
path: root/contrib/vhost-user-gpu/vhost-user-gpu.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/vhost-user-gpu/vhost-user-gpu.c')
-rw-r--r--contrib/vhost-user-gpu/vhost-user-gpu.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/contrib/vhost-user-gpu/vhost-user-gpu.c b/contrib/vhost-user-gpu/vhost-user-gpu.c
index 2e7815a7a3..aa304475a0 100644
--- a/contrib/vhost-user-gpu/vhost-user-gpu.c
+++ b/contrib/vhost-user-gpu/vhost-user-gpu.c
@@ -1071,6 +1071,7 @@ static gboolean
protocol_features_cb(gint fd, GIOCondition condition, gpointer user_data)
{
const uint64_t protocol_edid = (1 << VHOST_USER_GPU_PROTOCOL_F_EDID);
+ const uint64_t protocol_dmabuf2 = (1 << VHOST_USER_GPU_PROTOCOL_F_DMABUF2);
VuGpu *g = user_data;
uint64_t protocol_features;
VhostUserGpuMsg msg = {
@@ -1082,7 +1083,7 @@ protocol_features_cb(gint fd, GIOCondition condition, gpointer user_data)
return G_SOURCE_CONTINUE;
}
- protocol_features &= protocol_edid;
+ protocol_features &= (protocol_edid | protocol_dmabuf2);
msg = (VhostUserGpuMsg) {
.request = VHOST_USER_GPU_SET_PROTOCOL_FEATURES,
@@ -1100,6 +1101,8 @@ protocol_features_cb(gint fd, GIOCondition condition, gpointer user_data)
exit(EXIT_FAILURE);
}
+ g->use_modifiers = !!(protocol_features & protocol_dmabuf2);
+
return G_SOURCE_REMOVE;
}