Merge branch 'wip/otte/for-main' into 'main'

build: Change where we get drm_fourcc.h from

See merge request GNOME/gtk!6514
This commit is contained in:
Benjamin Otte 2023-10-22 19:33:27 +00:00
commit 3a9aea44df
7 changed files with 21 additions and 14 deletions

View File

@ -28,7 +28,7 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/dma-buf.h>
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>
#include <epoxy/egl.h>
typedef struct _GdkDrmFormatInfo GdkDrmFormatInfo;

View File

@ -23,7 +23,7 @@
#include "gdkdmabufformatsprivate.h"
#ifdef HAVE_DMABUF
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>
#endif
#define GDK_ARRAY_NAME gdk_dmabuf_formats_builder

View File

@ -32,7 +32,7 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/dma-buf.h>
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>
#include <epoxy/egl.h>
#endif

View File

@ -28,7 +28,7 @@
#include <cairo-gobject.h>
#ifdef HAVE_DMABUF
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>
#else
#define DRM_FORMAT_MOD_INVALID ((1ULL << 56) - 1)
#endif
@ -86,7 +86,7 @@ struct _GdkDmabufTextureBuilderClass
*
* The format of the data (for graphics data, essentially its colorspace) is described
* by a 32-bit integer. These format identifiers are defined in the header file
* [drm/drm_fourcc.h](https://github.com/torvalds/linux/blob/master/include/uapi/drm/drm_fourcc.h)
* [drm_fourcc.h](https://github.com/torvalds/linux/blob/master/include/uapi/drm_fourcc.h)
* and commonly referred to as **_fourcc_** values, since they are identified by 4 ASCII
* characters. Additionally, each DMA buffer has a **_modifier_**, which is a 64-bit integer
* that describes driver-specific details of the memory layout, such as tiling or compression.

View File

@ -216,6 +216,7 @@ gdk_deps = [
platform_gio_dep,
pangocairo_dep,
vulkan_dep,
dmabuf_dep,
png_dep,
tiff_dep,
jpeg_dep,

View File

@ -185,14 +185,6 @@ foreach h : check_headers
endif
endforeach
if cc.has_header('linux/dma-buf.h') and cc.has_header('drm/drm_fourcc.h')
cdata.set('HAVE_DMABUF', 1)
else
if os_linux
error('OS is Linux, but linux/dma-buf.h and drm/drm-fourcc.h not found.')
endif
endif
# Maths functions might be implemented in libm
libm = cc.find_library('m', required: false)
@ -626,6 +618,20 @@ else
vulkan_pkg_found = false
endif
if cc.has_header('linux/dma-buf.h')
dmabuf_dep = dependency('libdrm',
required: os_linux)
else
if os_linux
error('OS is Linux, but linux/dma-buf.h not found.')
endif
dmabuf_dep = dependency('', required: false)
endif
cdata.set('HAVE_DMABUF', dmabuf_dep.found())
# We only care about drm_fourcc.h for all the fourccs,
# but not about linking to libdrm
dmabuf_dep = dmabuf_dep.partial_dependency(includes: true, compile_args: true)
cloudproviders_dep = dependency('cloudproviders',
required: get_option('cloudproviders'),
version: cloudproviders_req,

View File

@ -3,7 +3,7 @@
#include <sys/mman.h>
#include <sys/ioctl.h>
#include <linux/dma-heap.h>
#include <drm/drm_fourcc.h>
#include <drm_fourcc.h>
/* For this to work, you may need to give /dev/dma_heap/system
* lax permissions.