2023-10-15 03:21:23 +00:00
|
|
|
#pragma once
|
|
|
|
|
|
|
|
#include "gdkdmabufformatsbuilderprivate.h"
|
|
|
|
|
2023-12-16 17:59:13 +00:00
|
|
|
#ifdef GDK_RENDERING_VULKAN
|
|
|
|
#include <vulkan/vulkan.h>
|
|
|
|
#endif
|
|
|
|
|
2023-10-15 03:21:23 +00:00
|
|
|
#define GDK_DMABUF_MAX_PLANES 4
|
|
|
|
|
|
|
|
typedef struct _GdkDmabuf GdkDmabuf;
|
|
|
|
|
|
|
|
struct _GdkDmabuf
|
|
|
|
{
|
|
|
|
guint32 fourcc;
|
|
|
|
guint64 modifier;
|
|
|
|
unsigned int n_planes;
|
|
|
|
struct {
|
|
|
|
int fd;
|
|
|
|
unsigned int stride;
|
|
|
|
unsigned int offset;
|
|
|
|
} planes[GDK_DMABUF_MAX_PLANES];
|
|
|
|
};
|
|
|
|
|
2024-07-11 06:57:21 +00:00
|
|
|
void gdk_dmabuf_close_fds (GdkDmabuf *dmabuf);
|
|
|
|
|
2023-10-22 15:23:37 +00:00
|
|
|
#ifdef HAVE_DMABUF
|
2023-10-20 10:08:18 +00:00
|
|
|
|
2023-12-13 06:27:43 +00:00
|
|
|
GdkDmabufFormats * gdk_dmabuf_get_mmap_formats (void) G_GNUC_CONST;
|
|
|
|
void gdk_dmabuf_download_mmap (GdkTexture *texture,
|
|
|
|
GdkMemoryFormat format,
|
2024-07-13 22:51:05 +00:00
|
|
|
GdkColorState *color_state,
|
2023-12-13 06:27:43 +00:00
|
|
|
guchar *data,
|
|
|
|
gsize stride);
|
|
|
|
|
2023-11-26 04:28:34 +00:00
|
|
|
int gdk_dmabuf_ioctl (int fd,
|
|
|
|
unsigned long request,
|
|
|
|
void *arg);
|
2023-11-26 04:58:57 +00:00
|
|
|
gboolean gdk_dmabuf_import_sync_file (int dmabuf_fd,
|
|
|
|
guint32 flags,
|
|
|
|
int sync_file_fd);
|
|
|
|
int gdk_dmabuf_export_sync_file (int dmabuf_fd,
|
|
|
|
guint32 flags);
|
2023-11-26 04:28:34 +00:00
|
|
|
|
2023-10-21 20:31:10 +00:00
|
|
|
gboolean gdk_dmabuf_sanitize (GdkDmabuf *dest,
|
2023-10-20 10:08:18 +00:00
|
|
|
gsize width,
|
|
|
|
gsize height,
|
|
|
|
const GdkDmabuf *src,
|
|
|
|
GError **error);
|
2023-10-21 20:31:10 +00:00
|
|
|
|
|
|
|
gboolean gdk_dmabuf_is_disjoint (const GdkDmabuf *dmabuf);
|
2023-10-21 19:23:11 +00:00
|
|
|
|
2023-12-12 05:48:06 +00:00
|
|
|
gboolean gdk_dmabuf_fourcc_is_yuv (guint32 fourcc,
|
|
|
|
gboolean *is_yuv);
|
2023-11-23 01:00:30 +00:00
|
|
|
gboolean gdk_dmabuf_get_memory_format (guint32 fourcc,
|
|
|
|
gboolean premultiplied,
|
|
|
|
GdkMemoryFormat *out_format);
|
2023-12-16 17:59:13 +00:00
|
|
|
#ifdef GDK_RENDERING_VULKAN
|
2023-10-19 11:34:40 +00:00
|
|
|
gboolean gdk_dmabuf_vk_get_nth (gsize n,
|
|
|
|
guint32 *fourcc,
|
|
|
|
VkFormat *vk_format);
|
2023-12-16 17:59:13 +00:00
|
|
|
VkFormat gdk_dmabuf_get_vk_format (guint32 fourcc,
|
|
|
|
VkComponentMapping *out_components);
|
|
|
|
#endif
|
2023-11-11 22:56:01 +00:00
|
|
|
|
2023-10-15 03:21:23 +00:00
|
|
|
#endif
|