kmssink: Check if we can prime export

This will be used later to decide if a DMABuf allocator should be
exposed.

https://bugzilla.gnome.org/show_bug.cgi?id=787593
This commit is contained in:
Nicolas Dufresne 2017-09-11 15:00:53 -04:00
parent ae8ee0315e
commit 045a91922c
2 changed files with 7 additions and 2 deletions

View file

@ -307,8 +307,10 @@ get_drm_caps (GstKMSSink * self)
ret = drmGetCap (self->fd, DRM_CAP_PRIME, &has_prime);
if (ret)
GST_WARNING_OBJECT (self, "could not get prime capability");
else
else {
self->has_prime_import = (gboolean) (has_prime & DRM_PRIME_CAP_IMPORT);
self->has_prime_export = (gboolean) (has_prime & DRM_PRIME_CAP_EXPORT);
}
has_async_page_flip = 0;
ret = drmGetCap (self->fd, DRM_CAP_ASYNC_PAGE_FLIP, &has_async_page_flip);
@ -317,8 +319,10 @@ get_drm_caps (GstKMSSink * self)
else
self->has_async_page_flip = (gboolean) has_async_page_flip;
GST_INFO_OBJECT (self, "prime import (%s) / async page flip (%s)",
GST_INFO_OBJECT (self,
"prime import (%s) / prime export (%s) / async page flip (%s)",
self->has_prime_import ? "" : "",
self->has_prime_export ? "" : "",
self->has_async_page_flip ? "" : "");
return TRUE;

View file

@ -60,6 +60,7 @@ struct _GstKMSSink {
/* capabilities */
gboolean has_prime_import;
gboolean has_prime_export;
gboolean has_async_page_flip;
gboolean can_scale;