[Intel-gfx] [PATCH 3/3] intel-gpu-tools: change how cairo.h is included, to enable Android build

tim.gore at intel.com tim.gore at intel.com
Fri Mar 28 13:55:00 CET 2014


From: tgore <tim.gore at intel.com>

A recent commit (64401f57e958998d537ff67525d5f1e9a4f76b22) moved
igt_display into igt_kms. This means igt_debugfs.c now needs to
include igt_kms.h, which in turn includes igt_fb.h and hence cairo.h.
This breaks the build on android since there is no cairo port for
Android at present. igt_fb.h doesn't really need cairo.h it can manage
with a couple of incomplete declarations. This then requires igt_fb.c
and several test source files to explicitly include cairo.h, instead
of getting it indirectly through igt_fb.h. This enables us to build
the igt tests that dont require cairo on Android.

Signed-off-by: Tim Gore <tim.gore at intel.com>
---
 lib/Android.mk         | 4 +++-
 lib/igt_fb.c           | 1 +
 lib/igt_fb.h           | 4 +++-
 tests/kms_cursor_crc.c | 1 +
 tests/kms_fbc_crc.c    | 1 +
 tests/kms_plane.c      | 1 +
 tests/pm_lpsp.c        | 1 +
 tests/pm_pc8.c         | 1 +
 8 files changed, 12 insertions(+), 2 deletions(-)

diff --git a/lib/Android.mk b/lib/Android.mk
index 6735255..1260633 100644
--- a/lib/Android.mk
+++ b/lib/Android.mk
@@ -33,7 +33,9 @@ include $(LOCAL_PATH)/Makefile.sources
 
 skip_lib_list := \
     igt_kms.c \
-    igt_kms.h
+    igt_kms.h \
+    igt_fb.c \
+    igt_fb.h
 
 lib_list := $(filter-out $(skip_lib_list),$(libintel_tools_la_SOURCES))
 
diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index ef486f9..6a7b8b1 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -32,6 +32,7 @@
 #include "drmtest.h"
 #include "igt_fb.h"
 #include "ioctl_wrappers.h"
+#include <cairo.h>
 
 /**
  * SECTION:igt_fb
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 5f0ff51..5b2c516 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -28,11 +28,13 @@
 #ifndef __IGT_FB_H__
 #define __IGT_FB_H__
 
-#include <cairo.h>
 
 #include <drm_fourcc.h>
 #include <xf86drmMode.h>
 
+typedef struct _cairo_surface cairo_surface_t;
+typedef struct _cairo cairo_t;
+
 /* helpers to create nice-looking framebuffers */
 struct igt_fb {
 	uint32_t fb_id;
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index fbb5d88..85f6464 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -27,6 +27,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+#include <cairo.h>
 
 #include "drmtest.h"
 #include "igt_debugfs.h"
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 4f56d63..1f2754e 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -26,6 +26,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+#include <cairo.h>
 
 #include "drmtest.h"
 #include "igt_debugfs.h"
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 6bdbca3..3153ace 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -28,6 +28,7 @@
 #include <stdbool.h>
 #include <stdio.h>
 #include <string.h>
+#include <cairo.h>
 
 #include "drmtest.h"
 #include "igt_debugfs.h"
diff --git a/tests/pm_lpsp.c b/tests/pm_lpsp.c
index 9d3884c..f053457 100644
--- a/tests/pm_lpsp.c
+++ b/tests/pm_lpsp.c
@@ -28,6 +28,7 @@
 #include <sys/stat.h>
 #include <fcntl.h>
 #include <unistd.h>
+#include <cairo.h>
 
 #include "drmtest.h"
 #include "igt_kms.h"
diff --git a/tests/pm_pc8.c b/tests/pm_pc8.c
index 0d04323..e9996bc 100644
--- a/tests/pm_pc8.c
+++ b/tests/pm_pc8.c
@@ -41,6 +41,7 @@
 #include <linux/i2c-dev.h>
 
 #include <drm.h>
+#include <cairo.h>
 
 #include "drmtest.h"
 #include "intel_batchbuffer.h"
-- 
1.9.0




More information about the Intel-gfx mailing list