Allow building igt without graphics dependencies
Subsystems (2)
cover Allow building igt without graphics dependencies
This patchset allows building igt without cairo and pixman, making its tools conveniently available in compute-only environments for debugging purposes. Building tests, overlays and some graphics-dependent tools is not available in this scenario, but most of the interesting stuff is in there.
The new graphics=<enabled/disabled> build-time setting decides whenever igt requires cairo and pixman. Disabling those dependencies prevents transitive dependencies on a large number of graphics-related libraries (X11, etc).
Ryszard Knop (5):
lib/i915: Replace igt.h with individual header imports lib/igt*, lib/intel*: Replace igt.h with individual header imports tools, lib: Replace igt.h with individual header imports lib, tools: Add the 'graphics' build-time setting
lib, tools: Misc cleanups and typo fixes
lib/i915/gem.c | 6 +- lib/i915/gem_mman.h | 1 + lib/i915/i915_blt.c | 17 +++++- lib/i915/i915_blt.h | 7 ++- lib/i915/intel_mocs.c | 6 +- lib/igt.h | 8 ++- lib/igt_amd.c | 8 ++- lib/igt_amd.h | 3 +- lib/igt_collection.c | 3 +- lib/igt_debugfs.c | 2 + lib/igt_debugfs.h | 5 +- lib/igt_device.c | 9 ++- lib/igt_fb.h | 10 +++- lib/igt_frame.h | 2 - lib/igt_nouveau.c | 2 +- lib/igt_syncobj.c | 3 +- lib/intel_allocator.c | 9 ++- lib/intel_allocator_msgchannel.c | 6 +- lib/intel_allocator_random.c | 6 +- lib/intel_allocator_reloc.c | 5 +- lib/intel_bufops.c | 12 +++- lib/intel_bufops.h | 2 + lib/meson.build | 24 ++++---- lib/nouveau/cea0b5.c | 2 +- lib/tests/meson.build | 5 +- lib/veboxcopy_gen12.c | 2 +- meson.build | 32 +++++++--- meson_options.txt | 4 ++ tools/amd_hdmi_compliance.c | 4 +- tools/igt_compliance_utils.c | 2 +- tools/igt_dp_compliance_hotplug.c | 6 +- tools/intel_dp_compliance.c | 8 ++- tools/intel_gem_info.c | 4 +- tools/intel_guc_logger.c | 3 +- tools/intel_gvtg_test.c | 3 +- tools/intel_pm_rpm.c | 8 ++- tools/intel_reg.c | 14 +++-- tools/intel_residency.c | 4 +- tools/lsgpu.c | 5 +- tools/meson.build | 97 +++++++++++++++++-------------- tools/msm_dp_compliance.c | 4 +- 41 files changed, 252 insertions(+), 111 deletions(-)
Signature · 1 line
2.36.1
PATCH 1/5 lib/i915: Replace igt.h with individual header imports
Prevents pulling in unnecessary definitions in the library, tools etc. Also makes it easier and faster to automatically analyze library files. It's fine to use it in tests, benchmarks and the runner.
--- lib/i915/gem.c | 6 ++++-- lib/i915/gem_mman.h | 1 + lib/i915/i915_blt.c | 17 +++++++++++++++-- lib/i915/i915_blt.h | 7 ++++++- lib/i915/intel_mocs.c | 6 ++++-- 5 files changed, 30 insertions(+), 7 deletions(-)
lib/i915/gem.c +4 -2
@@ -26,10 +26,12 @@#include <fcntl.h> #include <sys/ioctl.h> -#include "i915/gem.h" -#include "igt.h" +#include "igt_dummyload.h" #include "igt_debugfs.h" +#include "igt_params.h" #include "igt_sysfs.h" +#include "i915/gem.h" +#include "drmtest.h" static void __restore_defaults (int engine) {
lib/i915/gem_mman.h +1 -0
@@ -26,6 +26,7 @@#define GEM_MMAN_H #include <stdint.h> +#include <stdbool.h> void *gem_mmap__gtt (int fd,uint32_t handle,uint64_t size,unsigned prot);void *gem_mmap__cpu (int fd,uint32_t handle,uint64_t offset,uint64_t size,unsigned prot);
lib/i915/i915_blt.c +15 -2
@@ -4,10 +4,23 @@*/ #include <malloc.h> +#include <string.h> +#include <inttypes.h> +#include <cairo.h> -#include "igt.h" -#include "gem_create.h" + +#include "igt_core.h" +#include "igt_aux.h" +#include "i915_blt.h" +#include "gem_mman.h" +#include "gem_create.h" + +#include "intel_reg.h" +#include "intel_chipset.h" +#include "ioctl_wrappers.h" +#include "intel_allocator.h" +#include "intel_memory_region.h" #define BITRANGE (start, end) (end - start + 1)
lib/i915/i915_blt.h +6 -1
@@ -42,11 +42,16 @@*/ #include <errno.h> +#include <stdbool.h> #include <sys/ioctl.h> #include <sys/time.h> #include <malloc.h> +#include "drm.h" -#include "igt.h" + +#include "intel_ctx.h" +#include "igt_gt.h" +#define CCS_RATIO 256
lib/i915/intel_mocs.c +4 -2
@@ -3,9 +3,11 @@* Copyright © 2022 Intel Corporation */ -#include "igt.h" -#include "i915/gem.h" +#include "i915_drm.h" + +#include "intel_chipset.h" #include "intel_mocs.h" +#include "i915/gem.h" #define DG1_MOCS_UC_IDX 1#define DG1_MOCS_WB_IDX 5
Signature · 1 line
2.36.1
PATCH 2/5 lib/igt*, lib/intel*: Replace igt.h with individual header imports
In reply to Ryszard KnopPrevents pulling in unnecessary definitions in the library, tools etc. Also makes it easier and faster to automatically analyze library files. It's fine to use it in tests, benchmarks and the runner.
--- lib/igt_amd.c | 8 ++++++-- lib/igt_amd.h | 3 ++- lib/igt_collection.c | 3 ++- lib/igt_device.c | 9 +++++++-- lib/igt_nouveau.c | 2 +- lib/igt_syncobj.c | 3 ++- lib/intel_allocator.c | 9 ++++++++- lib/intel_allocator_msgchannel.c | 6 +++++- lib/intel_allocator_random.c | 6 +++++- lib/intel_allocator_reloc.c | 5 ++++- lib/intel_bufops.c | 7 +++++-- 11 files changed, 47 insertions(+), 14 deletions(-)
lib/igt_amd.c +6 -2
@@ -23,10 +23,14 @@#include <fcntl.h> #include <sys/stat.h> +#include <amdgpu_drm.h> + +#include "igt_core.h" #include "igt_amd.h" -#include "igt.h" +#include "igt_kms.h" #include "igt_sysfs.h" -#include <amdgpu_drm.h> +#include "igt_debugfs.h" +#include "drmtest.h" #define X0 1#define X1 2
lib/igt_amd.h +2 -1
@@ -24,8 +24,9 @@#define IGT_AMD_H #include <stdint.h> -#include "igt.h" +#include "igt_fb.h" +#include "igt_kms.h" #include "igt_psr.h" /* Read & Write DSC parameters */
lib/igt_collection.c +2 -1
@@ -21,7 +21,8 @@* IN THE SOFTWARE. */ -#include "igt.h" +#include "igt_aux.h" +#include "igt_core.h" #include "igt_collection.h" /**
lib/igt_device.c +7 -2
@@ -22,10 +22,15 @@* */ #include <fcntl.h> - +#include <errno.h> #include <sys/stat.h> #include <sys/sysmacros.h> -#include "igt.h" + +#include <pciaccess.h> +#include <xf86drm.h> + +#include "igt_core.h" +#include "igt_debugfs.h" #include "igt_device.h" #include "igt_sysfs.h"
lib/igt_nouveau.c +1 -1
@@ -27,7 +27,7 @@#include <nouveau/nouveau.h> #include <nouveau/nvif/class.h> -#include "igt.h" +#include "igt_fb.h" #include "igt_list.h" #include "igt_nouveau.h"
lib/igt_syncobj.c +2 -1
@@ -24,8 +24,9 @@#include <errno.h> #include <xf86drm.h> -#include "igt.h" +#include "igt_core.h" #include "igt_syncobj.h" +#include "ioctl_wrappers.h" /** * SECTION:igt_syncobj
lib/intel_allocator.c +8 -1
@@ -12,11 +12,18 @@#include <signal.h> #include <stdlib.h> #include <unistd.h> -#include "igt.h" +#include <errno.h> +#include "igt_map.h" +#include "ioctl_wrappers.h" +#include "intel_allocator.h" #include "intel_allocator_msgchannel.h" +#include "i915/gem_mman.h" +#include "i915/gem_context.h" +#include "i915/intel_memory_region.h" +//#define ALLOCDBG #ifdef ALLOCDBG #define alloc_info igt_info
lib/intel_allocator_msgchannel.c +5 -1
@@ -6,8 +6,12 @@#include <sys/types.h> #include <sys/ipc.h> #include <sys/msg.h> +#include <stdbool.h> +#include <string.h> +#include <errno.h> #include <fcntl.h> -#include "igt.h" + +#include "igt_core.h" #include "intel_allocator_msgchannel.h" extern __threadpid_t child_tid;
lib/intel_allocator_random.c +5 -1
@@ -4,8 +4,12 @@*/ #include <stdlib.h> -#include "igt.h" +#include <inttypes.h> + +#include "igt_aux.h" #include "igt_rand.h" +#include "drmtest.h" +#include "ioctl_wrappers.h" #include "intel_allocator.h" struct intel_allocator *
lib/intel_allocator_reloc.c +4 -1
@@ -4,8 +4,11 @@*/ #include <stdlib.h> -#include "igt.h" + +#include "igt_aux.h" #include "igt_rand.h" +#include "drmtest.h" +#include "ioctl_wrappers.h" #include "intel_allocator.h" struct intel_allocator *
lib/intel_bufops.c +5 -2
@@ -25,10 +25,13 @@#include <sys/ioctl.h> #include <cairo.h> -#include "i915/gem_create.h" -#include "igt.h" #include "igt_x86.h" #include "intel_bufops.h" +#include "intel_chipset.h" +#include "ioctl_wrappers.h" + +#include "i915/gem_mman.h" +#include "i915/gem_create.h" /** * SECTION:intel_bufops
Signature · 1 line
2.36.1
PATCH 3/5 tools, lib: Replace igt.h with individual header imports
In reply to Ryszard KnopPrevents pulling in unnecessary definitions in the library, tools etc. Also makes it easier and faster to automatically analyze library files. It's fine to use it in tests, benchmarks and the runner.
--- lib/nouveau/cea0b5.c | 2 +- lib/veboxcopy_gen12.c | 2 +- tools/amd_hdmi_compliance.c | 4 +++- tools/igt_compliance_utils.c | 2 +- tools/igt_dp_compliance_hotplug.c | 6 ++++-- tools/intel_dp_compliance.c | 8 ++++++-- tools/intel_gem_info.c | 4 +++- tools/intel_guc_logger.c | 3 ++- tools/intel_gvtg_test.c | 3 ++- tools/intel_pm_rpm.c | 8 +++++++- tools/intel_reg.c | 14 ++++++++++---- tools/intel_residency.c | 4 +++- tools/lsgpu.c | 5 +++-- tools/msm_dp_compliance.c | 4 +++- 14 files changed, 49 insertions(+), 20 deletions(-)
lib/nouveau/cea0b5.c +1 -1
@@ -22,7 +22,7 @@#include <inttypes.h> -#include "igt.h" +#include "igt_fb.h" #include "igt_nouveau.h" #include "nouveau/nvif/push906f.h"
lib/veboxcopy_gen12.c +1 -1
@@ -21,8 +21,8 @@* IN THE SOFTWARE. */ -#include "igt.h" #include "intel_aux_pgtable.h" +#include "intel_chipset.h" #include "veboxcopy.h" #define YCRCB_NORMAL 0
tools/amd_hdmi_compliance.c +3 -1
@@ -20,7 +20,9 @@* OTHER DEALINGS IN THE SOFTWARE. */ -#include "igt.h" +#include "igt_core.h" +#include "igt_kms.h" +#include "drmtest.h" /* Common test data */ typedef struct data {
tools/igt_compliance_utils.c +1 -1
@@ -23,12 +23,12 @@* IN THE SOFTWARE. */ -#include "igt.h" #include <string.h> #include <signal.h> #include <termios.h> #include <libgen.h> +#include "igt_core.h" #include "igt_dp_compliance.h" static int tio_fd;
tools/igt_dp_compliance_hotplug.c +4 -2
@@ -23,14 +23,16 @@* IN THE SOFTWARE. */ -#include "igt.h" #include <string.h> #include <stdlib.h> #include <sys/stat.h> -#include "igt_dp_compliance.h" #include <libudev.h> + +#include "igt_core.h" +#include "igt_dp_compliance.h" +static struct udev_monitor *uevent_monitor;static struct udev *udev;static GIOChannel *udevchannel;
tools/intel_dp_compliance.c +6 -2
@@ -106,8 +106,8 @@* DRM modeset example * */ -#include "igt.h" #include <errno.h> +#include <stdlib.h> #include <getopt.h> #include <stdint.h> #include <stdbool.h>
@@ -117,8 +117,12 @@#include <fcntl.h> #include "igt_dp_compliance.h" +#include "igt_core.h" +#include "igt_kms.h" +#include "drmtest.h" +#include "intel_chipset.h" -#include <stdlib.h> +#include "i915/gem_mman.h" /* User Input definitions */ #define HELP_DESCRIPTION 1
tools/intel_gem_info.c +3 -1
@@ -1,9 +1,11 @@ -#include "igt.h" #include <sys/ioctl.h> #include <errno.h> #include <signal.h> +#include <i915_drm.h> +#include "igt_core.h" +#include "drmtest.h" int main (void ) {
tools/intel_guc_logger.c +2 -1
@@ -36,7 +36,8 @@#include <sys/mman.h> #include <pthread.h> -#include "igt.h" +#include "igt_core.h" +#include "igt_debugfs.h" #define MB (x) ((uint64_t)(x) * 1024 * 1024)#ifndef PAGE_SIZE
tools/intel_gvtg_test.c +2 -1
@@ -29,7 +29,6 @@* Enable more GVT-g related test cases. */ -#include "igt.h" #include <errno.h> #include <getopt.h> #include <strings.h>
@@ -40,6 +39,8 @@#include <pwd.h> #include <dirent.h> +#include "igt_core.h" +#define RANDOM (x) (rand() % x)
tools/intel_pm_rpm.c +7 -1
@@ -26,11 +26,17 @@#include <stdlib.h> #include <string.h> #include <stdbool.h> -#include "igt.h" + +#include "igt_core.h" #include "igt_device.h" #include "igt_device_scan.h" +#include "igt_kms.h" #include "igt_pm.h" +#include "intel_chipset.h" + +#include <drm.h> +#define DONT_SET_AUTOSUSPEND_DELAY (1 << 0)#define SET_I915_AUTOSUSPEND_DELAY (1 << 1)
tools/intel_reg.c +10 -4
@@ -31,14 +31,20 @@#include <sys/stat.h> #include <unistd.h> -#include "i915/gem_create.h" -#include "igt.h" +#include "i915_drm.h" +#include "igt_gt.h" -#include "intel_io.h" -#include "intel_chipset.h" +#include "drmtest.h" +#include "ioctl_wrappers.h" +#include "intel_io.h" +#include "intel_reg.h" #include "intel_reg_spec.h" +#include "intel_chipset.h" +#include "i915/gem_mman.h" +#include "i915/gem_create.h" +#include "i915/gem_engine_topology.h" #ifdef HAVE_SYS_IO_H #include <sys/io.h>
tools/intel_residency.c +3 -1
@@ -32,7 +32,9 @@#include <signal.h> #include <time.h> #include <getopt.h> -#include "igt.h" + +#include "igt_kms.h" +#include "igt_draw.h" #define IA32_TIME_STAMP_COUNTER 0x10
tools/lsgpu.c +3 -2
@@ -22,12 +22,13 @@* */ -#include "igt_device_scan.h" -#include "igt.h" #include <string.h> #include <signal.h> #include <glib.h> +#include "igt_device_scan.h" +#include "igt_core.h" +/** * SECTION:lsgpu * @short_description: lsgpu
tools/msm_dp_compliance.c +3 -1
@@ -107,7 +107,6 @@* DRM modeset example * */ -#include "igt.h" #include <errno.h> #include <getopt.h> #include <stdint.h>
@@ -117,6 +116,9 @@#include <sys/stat.h> #include <fcntl.h> +#include "igt_core.h" +#include "igt_kms.h" +#include "drmtest.h" #include "igt_dp_compliance.h" #include <stdlib.h>
Signature · 1 line
2.36.1
PATCH 4/5 lib, tools: Add the 'graphics' build-time setting
In reply to Ryszard KnopThe graphics=<enabled/disabled> setting decides whenever igt will depend on cairo and pixman. Disabling those dependencies prevents transitive dependencies on a large number of graphics-related libraries (X11, etc), thus allowing igt tools to be installed in compute-only environments.
In practice this works for tools and benchmarks only - tests or overlays depend on those libraries too much to selectively disable features in there while keeping it all maintainable.
--- lib/igt.h | 7 +++- lib/igt_debugfs.c | 2 + lib/igt_debugfs.h | 5 ++- lib/igt_fb.h | 10 ++++- lib/intel_bufops.c | 5 +++ lib/intel_bufops.h | 2 + lib/meson.build | 18 +++++---- lib/tests/meson.build | 5 ++- meson.build | 32 ++++++++++----- meson_options.txt | 4 ++ tools/meson.build | 93 ++++++++++++++++++++++++------------------- 11 files changed, 121 insertions(+), 62 deletions(-)
lib/igt.h +5 -2
@@ -32,8 +32,6 @@#include "igt_debugfs.h" #include "igt_draw.h" #include "igt_dummyload.h" -#include "igt_fb.h" -#include "igt_frame.h" #include "igt_gt.h" #include "igt_kms.h" #include "igt_params.h"
@@ -50,6 +48,11 @@#include "i915/gem_mman.h" #include "i915/gem_engine_topology.h" +#ifdef HAVE_GRAPHICS +#include "igt_fb.h" +#include "igt_frame.h" +#endif +#ifdef HAVE_CHAMELIUM #include "igt_alsa.h" #include "igt_audio.h"
lib/igt_debugfs.c +2 -0
@@ -1035,6 +1035,7 @@ igt_pipe_crc_get_for_frame(int drm_fd, igt_pipe_crc_t *pipe_crc,crc_sanity_checks (pipe_crc, crc); } +#ifdef HAVE_GRAPHICS /** * igt_pipe_crc_get_current: * @drm_fd: Pointer to drm fd for vblank counter
@@ -1052,6 +1053,7 @@ igt_pipe_crc_get_current(int drm_fd, igt_pipe_crc_t *pipe_crc, igt_crc_t *crc) return igt_pipe_crc_get_for_frame(drm_fd, pipe_crc, vblank, crc); } +#endif /* HAVE_GRAPHICS */ /** * igt_pipe_crc_collect_crc:
lib/igt_debugfs.h +4 -1
@@ -119,10 +119,13 @@ int igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs, igt_crc_t **out_crcs);void igt_pipe_crc_drain (igt_pipe_crc_t *pipe_crc);void igt_pipe_crc_get_single (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc); -void igt_pipe_crc_get_current (int drm_fd,igt_pipe_crc_t *pipe_crc,igt_crc_t *crc);void igt_pipe_crc_get_for_frame (int drm_fd,igt_pipe_crc_t *pipe_crc,unsigned int vblank,igt_crc_t *crc); +#ifdef HAVE_GRAPHICS +void igt_pipe_crc_get_current (int drm_fd,igt_pipe_crc_t *pipe_crc,igt_crc_t *crc); +#endif /* HAVE_GRAPHICS */ +void igt_pipe_crc_collect_crc (igt_pipe_crc_t *pipe_crc,igt_crc_t *out_crc);void igt_hpd_storm_set_threshold (int fd,unsigned int threshold);
lib/igt_fb.h +9 -1
@@ -29,7 +29,10 @@#ifndef __IGT_FB_H__#define __IGT_FB_H__ +#ifdef HAVE_GRAPHICS #include <cairo.h> +#endif +#include <stddef.h> #include <stdbool.h> #include <drm_fourcc.h>
@@ -90,7 +93,6 @@ typedef struct igt_fb {enum igt_color_range color_range;uint64_t modifier;uint64_t size; -cairo_surface_t *cairo_surface;unsigned int domain;unsigned int num_planes;uint32_t strides[4 ];
@@ -99,6 +101,10 @@ typedef struct igt_fb {unsigned int plane_width[4 ];unsigned int plane_height[4 ];void *driver_priv; + +#ifdef HAVE_GRAPHICS +cairo_surface_t *cairo_surface; +#endif /* HAVE_GRAPHICS */ } igt_fb_t;/**
@@ -184,6 +190,7 @@ bool igt_fb_is_ccs_plane(const struct igt_fb *fb, int plane);bool igt_fb_is_gen12_ccs_cc_plane (const struct igt_fb *fb,int plane);int igt_fb_ccs_to_main_plane (const struct igt_fb *fb,int ccs_plane); +#ifdef HAVE_GRAPHICS /* cairo-based painting */ cairo_surface_t *igt_get_cairo_surface (int fd,struct igt_fb *fb);cairo_surface_t *igt_cairo_image_surface_create_from_png (const char *filename);
@@ -205,6 +212,7 @@ void igt_paint_image(cairo_t *cr, const char *filename,int igt_cairo_printf_line (cairo_t *cr,enum igt_text_align align,double yspacing,const char *fmt, ...) __attribute__((format (printf,4 ,5 ))); +#endif /* HAVE_GRAPHICS */ /* helpers to handle drm fourcc codes */ uint32_t igt_bpp_depth_to_drm_format (int bpp,int depth);
lib/intel_bufops.c +5 -0
@@ -23,7 +23,10 @@*/ #include <sys/ioctl.h> + +#ifdef HAVE_GRAPHICS #include <cairo.h> +#endif #include "igt_x86.h" #include "intel_bufops.h"
@@ -1203,6 +1206,7 @@ const char *intel_buf_set_name(struct intel_buf *buf, const char *name)return strncpy (buf->name, name,INTEL_BUF_NAME_MAXSIZE ); } +#ifdef HAVE_GRAPHICS static void __intel_buf_write_to_png(struct buf_ops *bops, struct intel_buf *buf, const char *filename,
@@ -1245,6 +1249,7 @@ void intel_buf_write_aux_to_png(struct intel_buf *buf, const char *filename) __intel_buf_write_to_png(buf->bops, buf, filename, true); } +#endif /* HAVE_GRAPHICS */ #define DEFAULT_BUFOPS (__gen_start, __gen_end) \ .gen_start = __gen_start, \
lib/intel_bufops.h +2 -0
@@ -187,7 +187,9 @@ void intel_buf_print(const struct intel_buf *buf);void intel_buf_dump (const struct intel_buf *buf,const char *filename);const char *intel_buf_set_name (struct intel_buf *buf,const char *name); +#ifdef HAVE_GRAPHICS void intel_buf_write_to_png (struct intel_buf *buf,const char *filename);void intel_buf_write_aux_to_png (struct intel_buf *buf,const char *filename); +#endif /* HAVE_GRAPHICS */ #endif
lib/meson.build +11 -7
@@ -12,7 +12,6 @@ lib_sources = [ 'i915/gem_vm.c', 'i915/intel_memory_region.c', 'i915/intel_mocs.c', - 'i915/i915_blt.c', 'igt_collection.c', 'igt_color_encoding.c', 'igt_debugfs.c',
@@ -67,10 +66,7 @@ lib_sources = [ 'intel_aux_pgtable.c', 'intel_reg_map.c', 'intel_iosf.c', - 'igt_kms.c', - 'igt_fb.c', 'igt_core.c', - 'igt_draw.c', 'igt_list.c', 'igt_map.c', 'igt_pm.c',
@@ -91,7 +87,6 @@ lib_sources = [ ] lib_deps = [ - cairo, glib, libatomic, libdrm,
@@ -101,12 +96,21 @@ lib_deps = [ libudev, math, pciaccess, - pixman, pthreads, realtime, zlib ] +if build_graphics + lib_deps += [cairo, pixman] + lib_sources += [ + 'igt_fb.c', + 'igt_kms.c', + 'igt_draw.c', + 'i915/i915_blt.c', + ] +endif + if libdrm_intel.found() lib_deps += libdrm_intel else
@@ -132,7 +136,7 @@ if valgrind.found() lib_deps += valgrind endif -if gsl.found() +if gsl.found() and build_graphics lib_deps += gsl lib_sources += [ 'igt_frame.c', 'igt_audio.c' ] endif
lib/tests/meson.build +4 -1
@@ -6,7 +6,6 @@ lib_tests = [ 'igt_conflicting_args', 'igt_describe', 'igt_dynamic_subtests', - 'igt_edid', 'igt_exit_handler', 'igt_fork', 'igt_fork_helper',
@@ -22,6 +21,10 @@ lib_tests = [ 'i915_perf_data_alignment', ] +if build_graphics + lib_tests += 'igt_edid' +endif + lib_fail_tests = [ 'igt_no_subtest', 'igt_simple_test_subtests',
meson.build +23 -9
@@ -82,8 +82,13 @@ endforeach build_chamelium = get_option('chamelium') build_docs = get_option('docs') build_tests = not get_option('tests').disabled() +build_graphics = not get_option('graphics').disabled() with_libdrm = get_option('libdrm_drivers') +if build_tests and not build_graphics + error('Building tests without graphics features is not supported') +endif + build_info = ['Build type: ' + get_option('buildtype')] inc = include_directories('include/drm-uapi', 'include/linux-uapi', 'lib', 'lib/stubs/syscalls', '.')
@@ -127,7 +132,6 @@ libunwind = dependency('libunwind', required : get_option('libunwind')) build_info += 'With libunwind: @0@'.format(libunwind.found()) libdw = dependency('libdw', required : true) -pixman = dependency('pixman-1', required : true) valgrind = dependency('valgrind', required : get_option('valgrind')) if valgrind.found()
@@ -135,7 +139,15 @@ if valgrind.found() endif build_info += 'Valgrind annotations: @0@'.format(valgrind.found()) -cairo = dependency('cairo', version : '>1.12.0', required : true) +if build_graphics + config.set('HAVE_GRAPHICS', 1) + cairo = dependency('cairo', version : '>1.12.0', required : true) + pixman = dependency('pixman-1', required : true) +else + cairo = disabler() + pixman = disabler() +endif + libudev = dependency('libudev', required : true) glib = dependency('glib-2.0', required : true)
@@ -331,12 +343,14 @@ foreach str : build_info message(str) endforeach -if cairo.version().version_compare('<1.17.2') - if pixman.version().version_compare('<0.36.0') - warning('Pixman < 0.36.0 found, cannot test HDR formats') +if build_graphics + if cairo.version().version_compare('<1.17.2') + if pixman.version().version_compare('<0.36.0') + warning('Pixman < 0.36.0 found, cannot test HDR formats') + endif + warning('Cairo < 1.17.2 found, cannot test HDR formats') + elif pixman.version().version_compare('<0.36.0') + # Cairo 1.17.2 requires 0.36.0 to compile, but somehow it went missing? + error('Cairo with floating point support found, but pixman version too old') endif - warning('Cairo < 1.17.2 found, cannot test HDR formats') -elif pixman.version().version_compare('<0.36.0') - # Cairo 1.17.2 requires 0.36.0 to compile, but somehow it went missing? - error('Cairo with floating point support found, but pixman version too old') endif
meson_options.txt +4 -0
@@ -34,6 +34,10 @@ option('libdrm_drivers', choices : ['', 'auto', 'intel', 'nouveau', 'amdgpu'], description : 'libdrm libraries to be used') +option('graphics', + type : 'feature', + description : 'Enable graphics-dependent features (cairo)') + option('libunwind', type : 'feature', description : 'Use libunwind')
tools/meson.build +52 -41
141 lines not on this page · raw message
Signature · 1 line
2.36.1
PATCH 5/5 lib, tools: Misc cleanups and typo fixes
In reply to Ryszard KnopA couple of small fixes for annoyances found while introducing the new build-time option.
--- lib/igt.h | 1 - lib/igt_frame.h | 2 -- lib/meson.build | 6 +++--- tools/meson.build | 4 ++-- 4 files changed, 5 insertions(+), 8 deletions(-)
lib/igt.h +0 -1
@@ -28,7 +28,6 @@#include "i915_3d.h" #include "igt_aux.h" #include "igt_core.h" -#include "igt_core.h" #include "igt_debugfs.h" #include "igt_draw.h" #include "igt_dummyload.h"
lib/igt_frame.h +0 -2
@@ -27,8 +27,6 @@#ifndef IGT_FRAME_H #define IGT_FRAME_H -#include "config.h" -#include <stdbool.h> bool igt_frame_dump_is_enabled (void );
lib/meson.build +3 -3
@@ -115,7 +115,7 @@ if libdrm_intel.found() lib_deps += libdrm_intel else lib_sources += 'stubs/drm/intel_bufmgr.c' - inc = [ inc, include_directories('stubs/drm') ] + inc += include_directories('stubs/drm') endif if libdrm_nouveau.found()
@@ -191,12 +191,12 @@ lib_igt = declare_dependency(link_with : lib_igt_build, igt_deps = [ lib_igt ] + lib_deps -lin_igt_chipset_build = static_library('igt_chipset', +lib_igt_chipset_build = static_library('igt_chipset', ['intel_chipset.c', 'intel_device_info.c'], include_directories : inc) -lib_igt_chipset = declare_dependency(link_with : lin_igt_chipset_build, +lib_igt_chipset = declare_dependency(link_with : lib_igt_chipset_build, include_directories : inc) lib_igt_perf_build = static_library('igt_perf',
tools/meson.build +2 -2
@@ -1,11 +1,11 @@ -tools_progs_noisnt = [ +tools_progs_noinstall = [ 'cnl_compute_wrpll', 'hsw_compute_wrpll', 'skl_compute_wrpll', 'skl_ddb_allocation', ] -foreach prog : tools_progs_noisnt +foreach prog : tools_progs_noinstall executable(prog, prog + '.c', dependencies : igt_deps, install : false)
Signature · 1 line
2.36.1
Patchwork
CI[igt-dev] ✗ Fi.CI.BUILD: failure for Allow building igt without graphics dependencies
In reply to Ryszard Knop== Series Details ==
== Series Details ==
Series: Allow building igt without graphics dependencies
URL : https://patchwork.freedesktop.org/series/104699/
State : failure
== Summary ==
Applying: lib/i915: Replace igt.h with individual header imports Patch failed at 0001 lib/i915: Replace igt.h with individual header imports When you have resolved this problem, run "git am --continue". If you prefer to skip this patch, run "git am --skip" instead. To restore the original branch and stop patching, run "git am --abort".