summaryrefslogtreecommitdiff
path: root/glamor/glamor.h
diff options
context:
space:
mode:
authorHans de Goede <hdegoede@redhat.com>2016-08-23 12:18:56 +0200
committerHans de Goede <hdegoede@redhat.com>2016-09-13 10:26:21 +0200
commita74d553cb97d545148bd2f81b7bd021cca94e076 (patch)
tree3ee6acc9ddcafce773fc18e0c2185d0a9285d3f1 /glamor/glamor.h
parent527c6baa294d17c5eca1d87ac941844872e90dac (diff)
glamor: Add glamor_shareable_fd_from_pixmap()
Add glamor_shareable_fd_from_pixmap function to get dma-buf fds suitable for sharing across GPUs (not using GPU specific tiling). This is necessary for the modesetting driver to correctly implement the DRI2 SharePixmapBacking callback. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Keith Packard <keithp@keithp.com>
Diffstat (limited to 'glamor/glamor.h')
-rw-r--r--glamor/glamor.h20
1 files changed, 20 insertions, 0 deletions
diff --git a/glamor/glamor.h b/glamor/glamor.h
index e27033a84..bdd2374cf 100644
--- a/glamor/glamor.h
+++ b/glamor/glamor.h
@@ -181,6 +181,26 @@ extern _X_EXPORT int glamor_fd_from_pixmap(ScreenPtr screen,
PixmapPtr pixmap,
CARD16 *stride, CARD32 *size);
+/* @glamor_shareable_fd_from_pixmap: Get a dma-buf fd suitable for sharing
+ * with other GPUs from a pixmap.
+ *
+ * @screen: Current screen pointer.
+ * @pixmap: The pixmap from which we want the fd.
+ * @stride, @size: Pointers to fill the stride and size of the
+ * buffer associated to the fd.
+ *
+ * The returned fd will point to a buffer which is suitable for sharing
+ * across GPUs (not using GPU specific tiling).
+ * The pixmap and the buffer associated by the fd will share the same
+ * content.
+ * The pixmap's stride may be modified by this function.
+ * Returns the fd on success, -1 on error.
+ * */
+extern _X_EXPORT int glamor_shareable_fd_from_pixmap(ScreenPtr screen,
+ PixmapPtr pixmap,
+ CARD16 *stride,
+ CARD32 *size);
+
/**
* @glamor_name_from_pixmap: Gets a gem name from a pixmap.
*