All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] igt: Remove Android support
@ 2017-11-24 15:17 Arkadiusz Hiler
  2017-11-24 15:17 ` [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" Arkadiusz Hiler
                   ` (4 more replies)
  0 siblings, 5 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2017-11-24 15:17 UTC (permalink / raw)
  To: intel-gfx; +Cc: Daniel Vetter, Kalyan Kondapally

This patch gets rid of the Android support, deleting all the hacks and
moving code around to the places it belongs.

Android build is not really maintained properly and rots rather fast.
With recent push for Meson here and Android going for Soong it will only
accelerate.

It's a good time to drop the illusion of providing any support.

Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 Android.mk                   |  4 --
 assembler/ralloc.c           |  5 ---
 benchmarks/Android.mk        | 46 ---------------------
 benchmarks/gem_syslatency.c  |  2 -
 lib/Android.mk               | 53 ------------------------
 lib/drmtest.h                | 16 --------
 lib/igt_aux.c                | 95 --------------------------------------------
 lib/igt_aux.h                |  5 ---
 lib/igt_core.c               | 68 -------------------------------
 lib/igt_debugfs.c            | 25 +-----------
 lib/igt_fb.h                 |  7 ----
 lib/igt_kmod.h               |  4 --
 lib/igt_kms.c                | 89 +++++++++++++++++++++++++++++++++++++++++
 lib/tests/Android.mk         | 41 -------------------
 tests/Android.mk             | 83 --------------------------------------
 tests/core_get_client_auth.c |  4 +-
 tests/gem_exec_nop.c         |  4 --
 tools/Android.mk             | 82 --------------------------------------
 18 files changed, 91 insertions(+), 542 deletions(-)
 delete mode 100644 Android.mk
 delete mode 100644 benchmarks/Android.mk
 delete mode 100644 lib/Android.mk
 delete mode 100644 lib/tests/Android.mk
 delete mode 100644 tests/Android.mk
 delete mode 100644 tools/Android.mk

diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 3690fc5a..00000000
--- a/Android.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-HAVE_LIBDRM_INTEL := true
-
-include $(call all-named-subdir-makefiles, lib tests tools benchmarks)
-
diff --git a/assembler/ralloc.c b/assembler/ralloc.c
index 59e71c48..69c1da4d 100644
--- a/assembler/ralloc.c
+++ b/assembler/ralloc.c
@@ -28,11 +28,6 @@
 #include <string.h>
 #include <stdint.h>
 
-/* Android defines SIZE_MAX in limits.h, instead of the standard stdint.h */
-#ifdef ANDROID
-#include <limits.h>
-#endif
-
 /* Some versions of MinGW are missing _vscprintf's declaration, although they
  * still provide the symbol in the import library. */
 #ifdef __MINGW32__
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
deleted file mode 100644
index 4ea275c4..00000000
--- a/benchmarks/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib
-
-#================#
-
-define add_benchmark
-    include $(CLEAR_VARS)
-
-    LOCAL_SRC_FILES := $1.c
-
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES} \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-    LOCAL_CFLAGS += -DANDROID -UNDEBUG -include "check-ndebug.h"
-    LOCAL_CFLAGS += -std=gnu99
-    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-    LOCAL_CFLAGS += -Wno-error=return-type
-    # Excessive complaining for established cases. Rely on the Linux version warnings.
-    LOCAL_CFLAGS += -Wno-sign-compare
-    LOCAL_LDFLAGS += -lkmod
-
-    LOCAL_MODULE := $1_benchmark
-    LOCAL_MODULE_TAGS := optional
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt/benchmarks
-
-    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-    LOCAL_SHARED_LIBRARIES := libpciaccess  \
-                              libkmod       \
-                              libdrm        \
-                              libdrm_intel
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-#================#
-
-benchmark_list := $(benchmarks_prog_list)
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    benchmark_list += $(LIBDRM_INTEL_BENCHMARKS)
-endif
-
-$(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item))))
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index 580edc5f..de59eaf8 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -219,7 +219,6 @@ static void *sys_thp_alloc(void *arg)
 static void bind_cpu(pthread_attr_t *attr, int cpu)
 {
 #ifdef __USE_GNU
-#ifndef ANDROID
 	cpu_set_t mask;
 
 	if (cpu == -1)
@@ -230,7 +229,6 @@ static void bind_cpu(pthread_attr_t *attr, int cpu)
 
 	pthread_attr_setaffinity_np(attr, sizeof(mask), &mask);
 #endif
-#endif
 }
 
 static void rtprio(pthread_attr_t *attr, int prio)
diff --git a/lib/Android.mk b/lib/Android.mk
deleted file mode 100644
index 31f88be7..00000000
--- a/lib/Android.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-GPU_TOOLS_PATH := $(LOCAL_PATH)/..
-IGT_LIB_PATH := $(LOCAL_PATH)
-
-# FIXME: autogenerate this info #
-$(GPU_TOOLS_PATH)/config.h:
-	@echo "updating config.h"
-	@echo '#define PACKAGE_VERSION "1.5"' >> $@ ; \
-	echo '#define TARGET_CPU_PLATFORM "android-ia"' >> $@ ;
-
-include $(LOCAL_PATH)/Makefile.sources
-
-include $(CLEAR_VARS)
-
-LOCAL_GENERATED_SOURCES :=       \
-	$(IGT_LIB_PATH)/version.h  \
-	$(GPU_TOOLS_PATH)/config.h
-
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. \
-                    $(LOCAL_PATH)/stubs/drm/
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-
-LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES
-LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-LOCAL_CFLAGS += -DANDROID -DHAVE_LINUX_KD_H
-LOCAL_CFLAGS += -std=gnu99 -UNDEBUG
-LOCAL_MODULE:= libintel_gpu_tools
-
-LOCAL_SHARED_LIBRARIES := libpciaccess  \
-			  libkmod       \
-			  libdrm        \
-			  libdrm_intel
-
-ifeq ("${ANDROID_HAS_CAIRO}", "1")
-    skip_lib_list :=
-    LOCAL_C_INCLUDES += $(ANDROID_BUILD_TOP)/external/cairo-1.12.16/src
-    LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1 -DIGT_DATADIR=\".\" -DIGT_SRCDIR=\".\"
-else
-skip_lib_list := \
-    igt_kms.c \
-    igt_kms.h \
-    igt_fb.c
-    -DANDROID_HAS_CAIRO=0
-endif
-
-LOCAL_SRC_FILES := $(filter-out %.h $(skip_lib_list),$(lib_source_list))
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(call first-makefiles-under, $(LOCAL_PATH))
-
diff --git a/lib/drmtest.h b/lib/drmtest.h
index a86799d5..fdd34ec6 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -51,22 +51,6 @@
  */
 #define DRIVER_ANY 	~(DRIVER_VGEM)
 
-
-#ifdef ANDROID
-#if (!(defined HAVE_MMAP64)) && (!(defined __x86_64__))
-extern void*  __mmap2(void *, size_t, int, int, int, off_t);
-
-/* mmap64 is a recent addition to bionic and not available in all android builds. */
-/* I can find no reliable way to know if it is defined or not - so just avoid it */
-#define mmap64 igt_mmap64
-static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags,
-        int fd, off64_t offset)
-{
-    return __mmap2(addr, length, prot, flags, fd, offset >> 12);
-}
-#endif
-#endif
-
 /**
  * ARRAY_SIZE:
  * @arr: static array
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index 0bcf792c..a41ae2f1 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -1085,101 +1085,6 @@ void igt_debug_manual_check(const char *var, const char *expected)
 	igt_assert(key != 'n' && key != 'N');
 }
 
-/* Functions with prefix kmstest_ independent of cairo library are pulled out
- * from file igt_kms.c since this file is skipped in lib/Android.mk when flag
- * ANDROID_HAS_CAIRO is 0. This ensures the usability of these functions even
- * when cairo library is not present on Android.
- */
-
-struct type_name {
-	int type;
-	const char *name;
-};
-
-static const char *find_type_name(const struct type_name *names, int type)
-{
-	for (; names->name; names++) {
-		if (names->type == type)
-			return names->name;
-	}
-
-	return "(invalid)";
-}
-
-static const struct type_name encoder_type_names[] = {
-	{ DRM_MODE_ENCODER_NONE, "none" },
-	{ DRM_MODE_ENCODER_DAC, "DAC" },
-	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
-	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
-	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
-	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
-	{ DRM_MODE_ENCODER_DSI, "DSI" },
-	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
-	{}
-};
-
-/**
- * kmstest_encoder_type_str:
- * @type: DRM_MODE_ENCODER_* enumeration value
- *
- * Returns: A string representing the drm encoder @type.
- */
-const char *kmstest_encoder_type_str(int type)
-{
-	return find_type_name(encoder_type_names, type);
-}
-
-static const struct type_name connector_status_names[] = {
-	{ DRM_MODE_CONNECTED, "connected" },
-	{ DRM_MODE_DISCONNECTED, "disconnected" },
-	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
-	{}
-};
-
-/**
- * kmstest_connector_status_str:
- * @status: DRM_MODE_* connector status value
- *
- * Returns: A string representing the drm connector status @status.
- */
-const char *kmstest_connector_status_str(int status)
-{
-	return find_type_name(connector_status_names, status);
-}
-
-static const struct type_name connector_type_names[] = {
-	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
-	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
-	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
-	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
-	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
-	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
-	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
-	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
-	{ DRM_MODE_CONNECTOR_Component, "Component" },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
-	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
-	{ DRM_MODE_CONNECTOR_TV, "TV" },
-	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
-	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
-	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
-	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
-	{}
-};
-
-/**
- * kmstest_connector_type_str:
- * @type: DRM_MODE_CONNECTOR_* enumeration value
- *
- * Returns: A string representing the drm connector @type.
- */
-const char *kmstest_connector_type_str(int type)
-{
-	return find_type_name(connector_type_names, type);
-}
-
 /**
  * igt_lock_mem:
  * @size: the amount of memory to lock into RAM, in MB
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 0bd226be..02e70126 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -45,12 +45,7 @@ extern int num_trash_bos;
 #define NSEC_PER_SEC (1000*USEC_PER_SEC)
 
 /* signal interrupt helpers */
-#ifdef ANDROID
-#include <unistd.h> /* on Android bionic has this implemented */
-#else
 #define gettid() syscall(__NR_gettid)
-#endif
-
 #define sigev_notify_thread_id _sigev_un._tid
 
 /* auxialiary igt helpers from igt_aux.c */
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 6ce83bec..de9269b0 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -496,72 +496,6 @@ void __igt_fixture_end(void)
 }
 
 /*
- * Some of the IGT tests put quite a lot of pressure on memory and when
- * running on Android they are sometimes killed by the Android low memory killer.
- * This seems to be due to some incompatibility between the kswapd free memory
- * targets and the way the lowmemorykiller assesses free memory.
- * The low memory killer really isn't usefull in this context and has no
- * interaction with the gpu driver that we are testing, so the following
- * function is used to disable it by modifying one of its module parameters.
- * We still have the normal linux oom killer to protect the kernel.
- * Apparently it is also possible for the lowmemorykiller to get included
- * in some linux distributions; so rather than check for Android we directly
- * check for the existence of the module parameter we want to adjust.
- *
- * In future, if we can get the lowmemorykiller to play nicely then we can
- * remove this hack.
- */
-static void low_mem_killer_disable(bool disable)
-{
-	static const char* adj_fname="/sys/module/lowmemorykiller/parameters/adj";
-	static const char no_lowmem_killer[] = "9999";
-	int fd;
-	struct stat buf;
-	/* The following must persist across invocations */
-	static char prev_adj_scores[256];
-	static int adj_scores_len = 0;
-	static bool is_disabled = false;
-
-	/* capture the permissions bits for the lowmemkiller adj pseudo-file.
-	 * Bail out if the stat fails; it probably means that there is no
-	 * lowmemorykiller, but in any case we're doomed. */
-	if (stat(adj_fname, &buf)) {
-		igt_assert(errno == ENOENT);
-		return;
-	}
-
-	/* make sure the file can be read/written - by default it is write-only */
-	chmod(adj_fname, S_IRUSR | S_IWUSR);
-
-	if (disable && !is_disabled) {
-		/* read the current oom adj parameters for lowmemorykiller */
-		fd = open(adj_fname, O_RDWR);
-		igt_assert(fd != -1);
-		adj_scores_len = read(fd, (void*)prev_adj_scores, 255);
-		igt_assert(adj_scores_len > 0);
-
-		/* writing 9999 to this module parameter effectively diables the
-		 * low memory killer. This is not a real file, so we dont need to
-		 * seek to the start or truncate it */
-		igt_assert_eq(write(fd, no_lowmem_killer, sizeof(no_lowmem_killer)),
-			      sizeof(no_lowmem_killer));
-		close(fd);
-		is_disabled = true;
-	} else if (is_disabled) {
-		/* just re-enstate the original settings */
-		fd = open(adj_fname, O_WRONLY);
-		igt_assert(fd != -1);
-		igt_assert_eq(write(fd, prev_adj_scores, adj_scores_len),
-			      adj_scores_len);
-		close(fd);
-		is_disabled = false;
-	}
-
-	/* re-enstate the file permissions */
-	chmod(adj_fname, buf.st_mode);
-}
-
-/*
  * If the test takes out the machine, in addition to the usual dmesg
  * spam, the kernel may also emit a "death rattle" -- extra debug
  * information that is overkill for normal successful tests, but
@@ -587,7 +521,6 @@ bool igt_exit_called;
 static void common_exit_handler(int sig)
 {
 	if (!igt_only_list_subtests()) {
-		low_mem_killer_disable(false);
 		kick_fbcon(true);
 	}
 
@@ -879,7 +812,6 @@ out:
 
 		sync();
 		oom_adjust_for_doom();
-		low_mem_killer_disable(true);
 		ftrace_dump_on_oops(true);
 	}
 
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 5670099f..9af8a593 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -990,30 +990,7 @@ int igt_get_stable_obj_count(int driver)
 	obj_count = get_object_count(driver);
 	/* The test relies on the system being in the same state before and
 	 * after the test so any difference in the object count is a result of
-	 * leaks during the test. gem_quiescent_gpu() mostly achieves this but
-	 * on android occasionally obj_count can still change briefly.
-	 * The loop ensures obj_count has remained stable over several checks
-	 */
-#ifdef ANDROID
-	{
-		int loop_count = 0;
-		int prev_obj_count = obj_count;
-		while (loop_count < 4) {
-			usleep(200000);
-			gem_quiescent_gpu(driver);
-			obj_count = get_object_count(driver);
-			if (obj_count == prev_obj_count) {
-				loop_count++;
-			} else {
-				igt_debug("loop_count=%d, obj_count=%d, prev_obj_count=%d\n",
-					loop_count, obj_count, prev_obj_count);
-				loop_count = 0;
-				prev_obj_count = obj_count;
-			}
-
-		}
-	}
-#endif
+	 * leaks during the test. */
 	return obj_count;
 }
 
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index 3f549036..d30a7340 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -28,14 +28,7 @@
 #ifndef __IGT_FB_H__
 #define __IGT_FB_H__
 
-/* cairo is assumed available on linux. On Android we check for ANDROID_HAS_CAIRO */
-#if (!defined(ANDROID)) || (defined(ANDROID) && ANDROID_HAS_CAIRO)
 #include <cairo.h>
-#else
-typedef struct _cairo_surface cairo_surface_t;
-typedef struct _cairo cairo_t;
-#endif
-
 #include <stddef.h>
 #include <stdbool.h>
 #include <drm_fourcc.h>
diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h
index 6a7584f1..fd307a45 100644
--- a/lib/igt_kmod.h
+++ b/lib/igt_kmod.h
@@ -24,11 +24,7 @@
 #ifndef IGT_KMOD_H
 #define IGT_KMOD_H
 
-#ifdef ANDROID
-#include <libkmod/libkmod.h>
-#else
 #include <libkmod.h>
-#endif
 
 #include "igt_aux.h"
 
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 92dcd3ca..125ecb19 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -377,6 +377,95 @@ const char *kmstest_plane_type_name(int plane_type)
 	return names[plane_type];
 }
 
+struct type_name {
+	int type;
+	const char *name;
+};
+
+static const char *find_type_name(const struct type_name *names, int type)
+{
+	for (; names->name; names++) {
+		if (names->type == type)
+			return names->name;
+	}
+
+	return "(invalid)";
+}
+
+static const struct type_name encoder_type_names[] = {
+	{ DRM_MODE_ENCODER_NONE, "none" },
+	{ DRM_MODE_ENCODER_DAC, "DAC" },
+	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
+	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
+	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
+	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
+	{ DRM_MODE_ENCODER_DSI, "DSI" },
+	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
+	{}
+};
+
+/**
+ * kmstest_encoder_type_str:
+ * @type: DRM_MODE_ENCODER_* enumeration value
+ *
+ * Returns: A string representing the drm encoder @type.
+ */
+const char *kmstest_encoder_type_str(int type)
+{
+	return find_type_name(encoder_type_names, type);
+}
+
+static const struct type_name connector_status_names[] = {
+	{ DRM_MODE_CONNECTED, "connected" },
+	{ DRM_MODE_DISCONNECTED, "disconnected" },
+	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
+	{}
+};
+
+/**
+ * kmstest_connector_status_str:
+ * @status: DRM_MODE_* connector status value
+ *
+ * Returns: A string representing the drm connector status @status.
+ */
+const char *kmstest_connector_status_str(int status)
+{
+	return find_type_name(connector_status_names, status);
+}
+
+static const struct type_name connector_type_names[] = {
+	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
+	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
+	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
+	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
+	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
+	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
+	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
+	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
+	{ DRM_MODE_CONNECTOR_Component, "Component" },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
+	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
+	{ DRM_MODE_CONNECTOR_TV, "TV" },
+	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
+	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
+	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
+	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
+	{}
+};
+
+/**
+ * kmstest_connector_type_str:
+ * @type: DRM_MODE_CONNECTOR_* enumeration value
+ *
+ * Returns: A string representing the drm connector @type.
+ */
+const char *kmstest_connector_type_str(int type)
+{
+	return find_type_name(connector_type_names, type);
+}
+
 static const char *mode_stereo_name(const drmModeModeInfo *mode)
 {
 	switch (mode->flags & DRM_MODE_FLAG_3D_MASK) {
diff --git a/lib/tests/Android.mk b/lib/tests/Android.mk
deleted file mode 100644
index bbbd4d86..00000000
--- a/lib/tests/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-#================#
-# each igt test is a separate executable. define a function to build one of these tests
-define add_test
-    include $(CLEAR_VARS)
-
-    # specific to this test
-    LOCAL_SRC_FILES := $1.c
-    LOCAL_MODULE := $1
-
-    # common to all tests
-    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
-    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
-    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
-
-    LOCAL_MODULE_TAGS := optional
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-# set local compilation flags for IGT tests
-IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
-IGT_LOCAL_CFLAGS += -std=gnu99
-# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-IGT_LOCAL_CFLAGS += -Wno-error=return-type
-
-# set local includes
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-# set local libraries
-IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel
-
-$(foreach item,$($(check_prog_list)),$(eval $(call add_test,$(item))))
-
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index c6e966fa..00000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-#================#
-# each igt test is a separate executable. define a function to build one of these tests
-define add_test
-    include $(CLEAR_VARS)
-
-    # specific to this test
-    LOCAL_SRC_FILES := $1.c
-    LOCAL_MODULE := $1
-
-    # common to all tests
-    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
-    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
-    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
-
-    LOCAL_MODULE_TAGS := optional
-    # ask linker to define a specific symbol; we use this to identify IGT tests
-    LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-
-# some tests still do not build under android
-skip_tests_list :=
-skip_tests_list += testdisplay        # needs glib.h
-skip_tests_list += pm_rpm
-
-# set local compilation flags for IGT tests
-IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
-IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=gnu99
-# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-IGT_LOCAL_CFLAGS += -Wno-error=return-type
-# Excessive complaining for established cases. Rely on the Linux version warnings.
-IGT_LOCAL_CFLAGS += -Wno-sign-compare
-
-# set local includes
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-# set local libraries
-IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel
-
-# handle cairo requirements if it is enabled
-ifeq ("${ANDROID_HAS_CAIRO}", "1")
-    IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/cairo-1.12.16/src
-    IGT_LOCAL_SHARED_LIBRARIES += libcairo
-    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1
-else
-# the following tests depend on cairo, so skip them
-    skip_tests_list += \
-    gem_render_copy \
-    pm_lpsp \
-	drm_read \
-	gem_exec_blt \
-	perf \
-	prime_mmap_kms
-
-# All kms tests depend on cairo
-    tmp_list := $(foreach test_name, $(TESTS_progs),\
-        $(if $(findstring kms_,$(test_name)),$(test_name)))
-    skip_tests_list += $(tmp_list)
-
-    tmp_list := $(foreach test_name, $(TESTS_progs_M),\
-        $(if $(findstring kms_,$(test_name)),$(test_name)))
-    skip_tests_list += $(tmp_list)
-
-    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0
-endif
-
-# create two test lists, one for simple single tests, one for tests that have subtests
-tests_list   := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite))
-tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M))
-
-$(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST")))
-$(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST")))
-
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index 676083d5..9c64699d 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -51,12 +51,10 @@ is_local_tid(pid_t tid)
 {
 #ifndef __linux__
 	return pthread_self() == tid;
-#elif !defined(ANDROID)
+#else
 	/* On Linux systems, drmGetClient() would return the thread ID
 	   instead of the actual process ID */
 	return syscall(SYS_gettid) == tid;
-#else
-	return gettid() == tid;
 #endif
 }
 
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index c9280795..b5f15807 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -142,7 +142,6 @@ stable_nop_on_ring(int fd, uint32_t handle, unsigned int engine,
 	return n;
 }
 
-#if !defined(ANDROID) || ANDROID_HAS_CAIRO
 #define assert_within_epsilon(x, ref, tolerance) \
         igt_assert_f((x) <= (1.0 + tolerance) * ref && \
                      (x) >= (1.0 - tolerance) * ref, \
@@ -187,7 +186,6 @@ static void headless(int fd, uint32_t handle)
 	/* check that the two execution speeds are roughly the same */
 	assert_within_epsilon(n_headless, n_display, 0.1f);
 }
-#endif
 
 static bool ignore_engine(int fd, unsigned engine)
 {
@@ -710,13 +708,11 @@ igt_main
 		}
 	}
 
-#if !defined(ANDROID) || ANDROID_HAS_CAIRO
 	igt_subtest("headless") {
 		/* Requires master for changing display modes */
 		igt_require(drmSetMaster(device) == 0);
 		headless(device, handle);
 	}
-#endif
 
 	igt_fixture {
 		igt_stop_hang_detector();
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 96075c9d..00000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_TOOLS_DIR := intel/validation/core/igt/tools
-
-#================#
-
-define add_tool
-    include $(CLEAR_VARS)
-
-    ifeq ($($(1)_SOURCES),)
-        LOCAL_SRC_FILES := $1.c
-    else
-        LOCAL_SRC_FILES := $(filter-out %.h,$($(1)_SOURCES))
-    endif
-
-    LOCAL_CFLAGS += -DHAVE_TERMIOS_H
-    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-    LOCAL_CFLAGS += -DANDROID -UNDEBUG
-    LOCAL_CFLAGS += -std=gnu99
-    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-    LOCAL_CFLAGS += -Wno-error=return-type
-    # Excessive complaining for established cases. Rely on the Linux version warnings.
-    LOCAL_CFLAGS += -Wno-sign-compare
-    LOCAL_LDFLAGS += -lkmod
-    ifeq ($($(1)_LDFLAGS),)
-    else
-        LOCAL_LDFLAGS += $($(1)_LDFLAGS)
-    endif
-
-    LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-    LOCAL_MODULE := $1_tool
-    LOCAL_MODULE_TAGS := optional
-
-    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-    LOCAL_SHARED_LIBRARIES := libpciaccess  \
-                              libkmod       \
-                              libdrm        \
-                              libdrm_intel \
-                              libz
-
-    # Tools dir on host
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)
-    # Tools dir on target.
-    LOCAL_CFLAGS += -DPKGDATADIR=\"/system/vendor/$(LOCAL_TOOLS_DIR)\"
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-#================#
-
-# Copy the register files
-$(shell mkdir -p $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
-$(shell cp $(LOCAL_PATH)/registers/* $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
-
-bin_PROGRAMS := $(tools_prog_lists)
-
-skip_tools_list := \
-    intel_framebuffer_dump \
-    intel_guc_logger \
-    intel_l3_parity \
-    intel_reg_dumper \
-    intel_vga_read \
-    intel_vga_write
-
-ifneq ("${ANDROID_HAS_CAIRO}", "1")
-    skip_tools_list += intel_display_crc
-    skip_tools_list += intel_residency
-endif
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    bin_PROGRAMS += $(LIBDRM_INTEL_BIN)
-    intel_error_decode_LDFLAGS = -lz
-endif
-
-tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS))
-
-$(foreach item,$(tools_list),$(eval $(call add_tool,$(item))))
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional"
  2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
@ 2017-11-24 15:17 ` Arkadiusz Hiler
  2017-11-29 11:07   ` Daniel Vetter
  2017-11-24 16:04 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt: Remove Android support Patchwork
                   ` (3 subsequent siblings)
  4 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Hiler @ 2017-11-24 15:17 UTC (permalink / raw)
  To: intel-gfx

This reverts commit d7d3f4e87b827152f00bdf89a67871736672b492
and gets rid of the config option from the meson.build.

It was needed only for the Android support.

Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
---
 configure.ac  |  6 +-----
 lib/igt_aux.c | 35 +++--------------------------------
 meson.build   |  5 +----
 3 files changed, 5 insertions(+), 41 deletions(-)

diff --git a/configure.ac b/configure.ac
index 1ac2e8e8..84c6e646 100644
--- a/configure.ac
+++ b/configure.ac
@@ -123,11 +123,7 @@ AC_SUBST(ASSEMBLER_WARN_CFLAGS)
 PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.82])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 PKG_CHECK_MODULES(KMOD, [libkmod])
-PKG_CHECK_MODULES(PROCPS, [libprocps], [procps=yes], [procps=no])
-AM_CONDITIONAL(HAVE_PROCPS, [test "x$procps" = xyes])
-if test x"$procps" = xyes; then
-	AC_DEFINE(HAVE_PROCPS,1,[Enable process managment without shelling out])
-fi
+PKG_CHECK_MODULES(PROCPS, [libprocps])
 PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
 
 if test x$have_valgrind = xyes; then
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index a41ae2f1..e2424109 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -48,7 +48,9 @@
 #include <sys/utsname.h>
 #include <termios.h>
 #include <assert.h>
-#include <linux/limits.h>
+
+#include <proc/readproc.h>
+
 #include "drmtest.h"
 #include "i915_drm.h"
 #include "intel_chipset.h"
@@ -68,10 +70,6 @@
 #include <libgen.h>   /* for dirname() */
 #endif
 
-#ifdef HAVE_PROCPS
-#include <proc/readproc.h>
-#endif
-
 /**
  * SECTION:igt_aux
  * @short_description: Auxiliary libraries and support functions
@@ -1296,7 +1294,6 @@ void igt_set_module_param_int(const char *name, int val)
  * This function sends the signal @sig for a process found in process table
  * with name @comm.
  */
-#ifdef HAVE_PROCPS
 int igt_terminate_process(int sig, const char *comm)
 {
 	PROCTAB *proc;
@@ -1321,19 +1318,7 @@ int igt_terminate_process(int sig, const char *comm)
 	closeproc(proc);
 	return err;
 }
-#else
-#warning "No procps, using naive implementation of igt_terminate_process"
 
-int igt_terminate_process(int sig, const char *comm)
-{
-	char pkill_cmd[NAME_MAX];
-
-	snprintf(pkill_cmd, sizeof(pkill_cmd), "pkill -x -%d %s", sig, comm);
-	return system(pkill_cmd);
-}
-#endif
-
-#ifdef HAVE_PROCPS
 struct pinfo {
 	pid_t pid;
 	const char *comm;
@@ -1515,7 +1500,6 @@ __igt_lsof(const char *dir)
 
 	closeproc(proc);
 }
-#endif
 
 /**
  * igt_lsof: Lists information about files opened by processes.
@@ -1524,7 +1508,6 @@ __igt_lsof(const char *dir)
  * This function mimics (a restrictive form of) lsof(8), but also shows
  * information about opened fds.
  */
-#ifdef HAVE_PROCPS
 void
 igt_lsof(const char *dpath)
 {
@@ -1549,18 +1532,6 @@ igt_lsof(const char *dpath)
 
 	free(sanitized);
 }
-#else
-#warning "No procps, using naive implementation of igt_lsof"
-
-void
-igt_lsof(const char *dpath)
-{
-	char lsof_cmd[NAME_MAX];
-
-	snprintf(lsof_cmd, sizeof(lsof_cmd), "lsof +d %s", dpath);
-	system(lsof_cmd);
-}
-#endif
 
 static struct igt_siglatency {
 	timer_t timer;
diff --git a/meson.build b/meson.build
index 2361866b..8e01b05d 100644
--- a/meson.build
+++ b/meson.build
@@ -37,10 +37,7 @@ libdrm_amdgpu = dependency('libdrm_amdgpu', required : false)
 
 pciaccess = dependency('pciaccess', version : '>=0.10')
 libkmod = dependency('libkmod')
-libprocps = dependency('libprocps', required : false)
-if libprocps.found()
-	config.set('HAVE_PROCPS', 1)
-endif
+libprocps = dependency('libprocps', required : true)
 
 valgrind = dependency('valgrind', required : false)
 if valgrind.found()
-- 
2.13.6

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.BAT: success for series starting with [1/2] igt: Remove Android support
  2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
  2017-11-24 15:17 ` [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" Arkadiusz Hiler
@ 2017-11-24 16:04 ` Patchwork
  2017-11-24 18:20 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (2 subsequent siblings)
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-11-24 16:04 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] igt: Remove Android support
URL   : https://patchwork.freedesktop.org/series/34365/
State : success

== Summary ==

IGT patchset tested on top of latest successful build
c6577473df7117b7a6e030605df1e28cd0e55708 lib/igt_core: Move write_stderr out of LIBUNWIND ifdef

with latest DRM-Tip kernel build CI_DRM_3383
99e3e01d35c9 drm-tip: 2017y-11m-24d-13h-20m-57s UTC integration manifest

No testlist changes.

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-b:
                pass       -> INCOMPLETE (fi-snb-2520m) fdo#103713

fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713

fi-bdw-5557u     total:289  pass:268  dwarn:0   dfail:0   fail:0   skip:21  time:445s
fi-bdw-gvtdvm    total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:457s
fi-blb-e6850     total:289  pass:223  dwarn:1   dfail:0   fail:0   skip:65  time:383s
fi-bsw-n3050     total:289  pass:243  dwarn:0   dfail:0   fail:0   skip:46  time:539s
fi-bwr-2160      total:289  pass:183  dwarn:0   dfail:0   fail:0   skip:106 time:279s
fi-bxt-dsi       total:289  pass:259  dwarn:0   dfail:0   fail:0   skip:30  time:504s
fi-bxt-j4205     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:509s
fi-byt-j1900     total:289  pass:254  dwarn:0   dfail:0   fail:0   skip:35  time:507s
fi-byt-n2820     total:289  pass:250  dwarn:0   dfail:0   fail:0   skip:39  time:492s
fi-elk-e7500     total:289  pass:229  dwarn:0   dfail:0   fail:0   skip:60  time:434s
fi-gdg-551       total:289  pass:178  dwarn:1   dfail:0   fail:1   skip:109 time:267s
fi-glk-1         total:289  pass:261  dwarn:0   dfail:0   fail:0   skip:28  time:545s
fi-hsw-4770      total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:439s
fi-hsw-4770r     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:441s
fi-ilk-650       total:289  pass:228  dwarn:0   dfail:0   fail:0   skip:61  time:429s
fi-ivb-3520m     total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-ivb-3770      total:289  pass:260  dwarn:0   dfail:0   fail:0   skip:29  time:462s
fi-kbl-7500u     total:289  pass:264  dwarn:1   dfail:0   fail:0   skip:24  time:484s
fi-kbl-7560u     total:289  pass:270  dwarn:0   dfail:0   fail:0   skip:19  time:531s
fi-kbl-7567u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:481s
fi-kbl-r         total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:531s
fi-pnv-d510      total:289  pass:222  dwarn:1   dfail:0   fail:0   skip:66  time:572s
fi-skl-6260u     total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:462s
fi-skl-6600u     total:289  pass:262  dwarn:0   dfail:0   fail:0   skip:27  time:548s
fi-skl-6700hq    total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:566s
fi-skl-6700k     total:289  pass:265  dwarn:0   dfail:0   fail:0   skip:24  time:516s
fi-skl-6770hq    total:289  pass:269  dwarn:0   dfail:0   fail:0   skip:20  time:499s
fi-skl-gvtdvm    total:289  pass:266  dwarn:0   dfail:0   fail:0   skip:23  time:463s
fi-snb-2520m     total:246  pass:212  dwarn:0   dfail:0   fail:0   skip:33 
fi-snb-2600      total:289  pass:249  dwarn:0   dfail:0   fail:0   skip:40  time:430s
Blacklisted hosts:
fi-cfl-s2        total:289  pass:263  dwarn:0   dfail:0   fail:0   skip:26  time:603s
fi-cnl-y         total:236  pass:211  dwarn:0   dfail:0   fail:0   skip:24 
fi-glk-dsi       total:289  pass:258  dwarn:0   dfail:0   fail:1   skip:30  time:503s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_549/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* ✓ Fi.CI.IGT: success for series starting with [1/2] igt: Remove Android support
  2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
  2017-11-24 15:17 ` [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" Arkadiusz Hiler
  2017-11-24 16:04 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt: Remove Android support Patchwork
@ 2017-11-24 18:20 ` Patchwork
  2017-11-27 14:42 ` [PATCH i-g-t 1/2] " Juha-Pekka Heikkila
  2017-11-29 13:26 ` Szwichtenberg, Radoslaw
  4 siblings, 0 replies; 10+ messages in thread
From: Patchwork @ 2017-11-24 18:20 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

== Series Details ==

Series: series starting with [1/2] igt: Remove Android support
URL   : https://patchwork.freedesktop.org/series/34365/
State : success

== Summary ==

Test kms_frontbuffer_tracking:
        Subgroup fbc-1p-offscren-pri-shrfb-draw-blt:
                fail       -> PASS       (shard-snb) fdo#101623 +2
Test kms_flip:
        Subgroup dpms-vs-vblank-race-interruptible:
                pass       -> FAIL       (shard-hsw) fdo#103060
Test drv_module_reload:
        Subgroup basic-reload:
                pass       -> DMESG-WARN (shard-hsw) fdo#102707
Test gem_busy:
        Subgroup close-race:
                fail       -> PASS       (shard-snb) fdo#103829

fdo#101623 https://bugs.freedesktop.org/show_bug.cgi?id=101623
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#102707 https://bugs.freedesktop.org/show_bug.cgi?id=102707
fdo#103829 https://bugs.freedesktop.org/show_bug.cgi?id=103829

shard-hsw        total:2667 pass:1533 dwarn:2   dfail:0   fail:11  skip:1121 time:9508s
shard-snb        total:2667 pass:1312 dwarn:1   dfail:0   fail:12  skip:1342 time:8125s
Blacklisted hosts:
shard-apl        total:2667 pass:1686 dwarn:1   dfail:0   fail:25  skip:954 time:13703s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_549/shards.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t 1/2] igt: Remove Android support
  2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
                   ` (2 preceding siblings ...)
  2017-11-24 18:20 ` ✓ Fi.CI.IGT: " Patchwork
@ 2017-11-27 14:42 ` Juha-Pekka Heikkila
  2017-11-29 13:26 ` Szwichtenberg, Radoslaw
  4 siblings, 0 replies; 10+ messages in thread
From: Juha-Pekka Heikkila @ 2017-11-27 14:42 UTC (permalink / raw)
  To: Arkadiusz Hiler, intel-gfx; +Cc: Daniel Vetter, Kalyan Kondapally

On 24.11.2017 17:17, Arkadiusz Hiler wrote:
> This patch gets rid of the Android support, deleting all the hacks and
> moving code around to the places it belongs.
> 
> Android build is not really maintained properly and rots rather fast.
> With recent push for Meson here and Android going for Soong it will only
> accelerate.
> 
> It's a good time to drop the illusion of providing any support.
> 
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> ---
>   Android.mk                   |  4 --
>   assembler/ralloc.c           |  5 ---
>   benchmarks/Android.mk        | 46 ---------------------
>   benchmarks/gem_syslatency.c  |  2 -
>   lib/Android.mk               | 53 ------------------------
>   lib/drmtest.h                | 16 --------
>   lib/igt_aux.c                | 95 --------------------------------------------
>   lib/igt_aux.h                |  5 ---
>   lib/igt_core.c               | 68 -------------------------------
>   lib/igt_debugfs.c            | 25 +-----------
>   lib/igt_fb.h                 |  7 ----
>   lib/igt_kmod.h               |  4 --
>   lib/igt_kms.c                | 89 +++++++++++++++++++++++++++++++++++++++++
>   lib/tests/Android.mk         | 41 -------------------
>   tests/Android.mk             | 83 --------------------------------------
>   tests/core_get_client_auth.c |  4 +-
>   tests/gem_exec_nop.c         |  4 --
>   tools/Android.mk             | 82 --------------------------------------
>   18 files changed, 91 insertions(+), 542 deletions(-)
>   delete mode 100644 Android.mk
>   delete mode 100644 benchmarks/Android.mk
>   delete mode 100644 lib/Android.mk
>   delete mode 100644 lib/tests/Android.mk
>   delete mode 100644 tests/Android.mk
>   delete mode 100644 tools/Android.mk
> 
> diff --git a/Android.mk b/Android.mk
> deleted file mode 100644
> index 3690fc5a..00000000
> --- a/Android.mk
> +++ /dev/null
> @@ -1,4 +0,0 @@
> -HAVE_LIBDRM_INTEL := true
> -
> -include $(call all-named-subdir-makefiles, lib tests tools benchmarks)
> -
> diff --git a/assembler/ralloc.c b/assembler/ralloc.c
> index 59e71c48..69c1da4d 100644
> --- a/assembler/ralloc.c
> +++ b/assembler/ralloc.c
> @@ -28,11 +28,6 @@
>   #include <string.h>
>   #include <stdint.h>
>   
> -/* Android defines SIZE_MAX in limits.h, instead of the standard stdint.h */
> -#ifdef ANDROID
> -#include <limits.h>
> -#endif
> -
>   /* Some versions of MinGW are missing _vscprintf's declaration, although they
>    * still provide the symbol in the import library. */
>   #ifdef __MINGW32__
> diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
> deleted file mode 100644
> index 4ea275c4..00000000
> --- a/benchmarks/Android.mk
> +++ /dev/null
> @@ -1,46 +0,0 @@
> -LOCAL_PATH := $(call my-dir)
> -
> -include $(LOCAL_PATH)/Makefile.sources
> -IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib
> -
> -#================#
> -
> -define add_benchmark
> -    include $(CLEAR_VARS)
> -
> -    LOCAL_SRC_FILES := $1.c
> -
> -    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES} \
> -                       $(LOCAL_PATH)/../lib/stubs/drm/
> -    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
> -    LOCAL_CFLAGS += -DANDROID -UNDEBUG -include "check-ndebug.h"
> -    LOCAL_CFLAGS += -std=gnu99
> -    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
> -    LOCAL_CFLAGS += -Wno-error=return-type
> -    # Excessive complaining for established cases. Rely on the Linux version warnings.
> -    LOCAL_CFLAGS += -Wno-sign-compare
> -    LOCAL_LDFLAGS += -lkmod
> -
> -    LOCAL_MODULE := $1_benchmark
> -    LOCAL_MODULE_TAGS := optional
> -    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt/benchmarks
> -
> -    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
> -
> -    LOCAL_SHARED_LIBRARIES := libpciaccess  \
> -                              libkmod       \
> -                              libdrm        \
> -                              libdrm_intel
> -
> -    include $(BUILD_EXECUTABLE)
> -endef
> -
> -#================#
> -
> -benchmark_list := $(benchmarks_prog_list)
> -
> -ifeq ($(HAVE_LIBDRM_INTEL),true)
> -    benchmark_list += $(LIBDRM_INTEL_BENCHMARKS)
> -endif
> -
> -$(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item))))
> diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
> index 580edc5f..de59eaf8 100644
> --- a/benchmarks/gem_syslatency.c
> +++ b/benchmarks/gem_syslatency.c
> @@ -219,7 +219,6 @@ static void *sys_thp_alloc(void *arg)
>   static void bind_cpu(pthread_attr_t *attr, int cpu)
>   {
>   #ifdef __USE_GNU
> -#ifndef ANDROID
>   	cpu_set_t mask;
>   
>   	if (cpu == -1)
> @@ -230,7 +229,6 @@ static void bind_cpu(pthread_attr_t *attr, int cpu)
>   
>   	pthread_attr_setaffinity_np(attr, sizeof(mask), &mask);
>   #endif
> -#endif
>   }
>   
>   static void rtprio(pthread_attr_t *attr, int prio)
> diff --git a/lib/Android.mk b/lib/Android.mk
> deleted file mode 100644
> index 31f88be7..00000000
> --- a/lib/Android.mk
> +++ /dev/null
> @@ -1,53 +0,0 @@
> -LOCAL_PATH := $(call my-dir)
> -
> -GPU_TOOLS_PATH := $(LOCAL_PATH)/..
> -IGT_LIB_PATH := $(LOCAL_PATH)
> -
> -# FIXME: autogenerate this info #
> -$(GPU_TOOLS_PATH)/config.h:
> -	@echo "updating config.h"
> -	@echo '#define PACKAGE_VERSION "1.5"' >> $@ ; \
> -	echo '#define TARGET_CPU_PLATFORM "android-ia"' >> $@ ;
> -
> -include $(LOCAL_PATH)/Makefile.sources
> -
> -include $(CLEAR_VARS)
> -
> -LOCAL_GENERATED_SOURCES :=       \
> -	$(IGT_LIB_PATH)/version.h  \
> -	$(GPU_TOOLS_PATH)/config.h
> -
> -LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. \
> -                    $(LOCAL_PATH)/stubs/drm/
> -
> -LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
> -
> -LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES
> -LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
> -LOCAL_CFLAGS += -DANDROID -DHAVE_LINUX_KD_H
> -LOCAL_CFLAGS += -std=gnu99 -UNDEBUG
> -LOCAL_MODULE:= libintel_gpu_tools
> -
> -LOCAL_SHARED_LIBRARIES := libpciaccess  \
> -			  libkmod       \
> -			  libdrm        \
> -			  libdrm_intel
> -
> -ifeq ("${ANDROID_HAS_CAIRO}", "1")
> -    skip_lib_list :=
> -    LOCAL_C_INCLUDES += $(ANDROID_BUILD_TOP)/external/cairo-1.12.16/src
> -    LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1 -DIGT_DATADIR=\".\" -DIGT_SRCDIR=\".\"
> -else
> -skip_lib_list := \
> -    igt_kms.c \
> -    igt_kms.h \
> -    igt_fb.c
> -    -DANDROID_HAS_CAIRO=0
> -endif
> -
> -LOCAL_SRC_FILES := $(filter-out %.h $(skip_lib_list),$(lib_source_list))
> -
> -include $(BUILD_STATIC_LIBRARY)
> -
> -include $(call first-makefiles-under, $(LOCAL_PATH))
> -
> diff --git a/lib/drmtest.h b/lib/drmtest.h
> index a86799d5..fdd34ec6 100644
> --- a/lib/drmtest.h
> +++ b/lib/drmtest.h
> @@ -51,22 +51,6 @@
>    */
>   #define DRIVER_ANY 	~(DRIVER_VGEM)
>   
> -
> -#ifdef ANDROID
> -#if (!(defined HAVE_MMAP64)) && (!(defined __x86_64__))
> -extern void*  __mmap2(void *, size_t, int, int, int, off_t);
> -
> -/* mmap64 is a recent addition to bionic and not available in all android builds. */
> -/* I can find no reliable way to know if it is defined or not - so just avoid it */
> -#define mmap64 igt_mmap64
> -static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags,
> -        int fd, off64_t offset)
> -{
> -    return __mmap2(addr, length, prot, flags, fd, offset >> 12);
> -}
> -#endif
> -#endif
> -
>   /**
>    * ARRAY_SIZE:
>    * @arr: static array
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index 0bcf792c..a41ae2f1 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -1085,101 +1085,6 @@ void igt_debug_manual_check(const char *var, const char *expected)
>   	igt_assert(key != 'n' && key != 'N');
>   }
>   
> -/* Functions with prefix kmstest_ independent of cairo library are pulled out
> - * from file igt_kms.c since this file is skipped in lib/Android.mk when flag
> - * ANDROID_HAS_CAIRO is 0. This ensures the usability of these functions even
> - * when cairo library is not present on Android.
> - */
> -
> -struct type_name {
> -	int type;
> -	const char *name;
> -};
> -
> -static const char *find_type_name(const struct type_name *names, int type)
> -{
> -	for (; names->name; names++) {
> -		if (names->type == type)
> -			return names->name;
> -	}
> -
> -	return "(invalid)";
> -}
> -
> -static const struct type_name encoder_type_names[] = {
> -	{ DRM_MODE_ENCODER_NONE, "none" },
> -	{ DRM_MODE_ENCODER_DAC, "DAC" },
> -	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
> -	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
> -	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
> -	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
> -	{ DRM_MODE_ENCODER_DSI, "DSI" },
> -	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
> -	{}
> -};
> -
> -/**
> - * kmstest_encoder_type_str:
> - * @type: DRM_MODE_ENCODER_* enumeration value
> - *
> - * Returns: A string representing the drm encoder @type.
> - */
> -const char *kmstest_encoder_type_str(int type)
> -{
> -	return find_type_name(encoder_type_names, type);
> -}
> -
> -static const struct type_name connector_status_names[] = {
> -	{ DRM_MODE_CONNECTED, "connected" },
> -	{ DRM_MODE_DISCONNECTED, "disconnected" },
> -	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
> -	{}
> -};
> -
> -/**
> - * kmstest_connector_status_str:
> - * @status: DRM_MODE_* connector status value
> - *
> - * Returns: A string representing the drm connector status @status.
> - */
> -const char *kmstest_connector_status_str(int status)
> -{
> -	return find_type_name(connector_status_names, status);
> -}
> -
> -static const struct type_name connector_type_names[] = {
> -	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
> -	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
> -	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
> -	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
> -	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
> -	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
> -	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
> -	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
> -	{ DRM_MODE_CONNECTOR_Component, "Component" },
> -	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
> -	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
> -	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
> -	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
> -	{ DRM_MODE_CONNECTOR_TV, "TV" },
> -	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
> -	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
> -	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
> -	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
> -	{}
> -};
> -
> -/**
> - * kmstest_connector_type_str:
> - * @type: DRM_MODE_CONNECTOR_* enumeration value
> - *
> - * Returns: A string representing the drm connector @type.
> - */
> -const char *kmstest_connector_type_str(int type)
> -{
> -	return find_type_name(connector_type_names, type);
> -}
> -
>   /**
>    * igt_lock_mem:
>    * @size: the amount of memory to lock into RAM, in MB
> diff --git a/lib/igt_aux.h b/lib/igt_aux.h
> index 0bd226be..02e70126 100644
> --- a/lib/igt_aux.h
> +++ b/lib/igt_aux.h
> @@ -45,12 +45,7 @@ extern int num_trash_bos;
>   #define NSEC_PER_SEC (1000*USEC_PER_SEC)
>   
>   /* signal interrupt helpers */
> -#ifdef ANDROID
> -#include <unistd.h> /* on Android bionic has this implemented */
> -#else
>   #define gettid() syscall(__NR_gettid)
> -#endif
> -
>   #define sigev_notify_thread_id _sigev_un._tid
>   
>   /* auxialiary igt helpers from igt_aux.c */
> diff --git a/lib/igt_core.c b/lib/igt_core.c
> index 6ce83bec..de9269b0 100644
> --- a/lib/igt_core.c
> +++ b/lib/igt_core.c
> @@ -496,72 +496,6 @@ void __igt_fixture_end(void)
>   }
>   
>   /*
> - * Some of the IGT tests put quite a lot of pressure on memory and when
> - * running on Android they are sometimes killed by the Android low memory killer.
> - * This seems to be due to some incompatibility between the kswapd free memory
> - * targets and the way the lowmemorykiller assesses free memory.
> - * The low memory killer really isn't usefull in this context and has no
> - * interaction with the gpu driver that we are testing, so the following
> - * function is used to disable it by modifying one of its module parameters.
> - * We still have the normal linux oom killer to protect the kernel.
> - * Apparently it is also possible for the lowmemorykiller to get included
> - * in some linux distributions; so rather than check for Android we directly
> - * check for the existence of the module parameter we want to adjust.
> - *
> - * In future, if we can get the lowmemorykiller to play nicely then we can
> - * remove this hack.
> - */
> -static void low_mem_killer_disable(bool disable)
> -{
> -	static const char* adj_fname="/sys/module/lowmemorykiller/parameters/adj";
> -	static const char no_lowmem_killer[] = "9999";
> -	int fd;
> -	struct stat buf;
> -	/* The following must persist across invocations */
> -	static char prev_adj_scores[256];
> -	static int adj_scores_len = 0;
> -	static bool is_disabled = false;
> -
> -	/* capture the permissions bits for the lowmemkiller adj pseudo-file.
> -	 * Bail out if the stat fails; it probably means that there is no
> -	 * lowmemorykiller, but in any case we're doomed. */
> -	if (stat(adj_fname, &buf)) {
> -		igt_assert(errno == ENOENT);
> -		return;
> -	}
> -
> -	/* make sure the file can be read/written - by default it is write-only */
> -	chmod(adj_fname, S_IRUSR | S_IWUSR);
> -
> -	if (disable && !is_disabled) {
> -		/* read the current oom adj parameters for lowmemorykiller */
> -		fd = open(adj_fname, O_RDWR);
> -		igt_assert(fd != -1);
> -		adj_scores_len = read(fd, (void*)prev_adj_scores, 255);
> -		igt_assert(adj_scores_len > 0);
> -
> -		/* writing 9999 to this module parameter effectively diables the
> -		 * low memory killer. This is not a real file, so we dont need to
> -		 * seek to the start or truncate it */
> -		igt_assert_eq(write(fd, no_lowmem_killer, sizeof(no_lowmem_killer)),
> -			      sizeof(no_lowmem_killer));
> -		close(fd);
> -		is_disabled = true;
> -	} else if (is_disabled) {
> -		/* just re-enstate the original settings */
> -		fd = open(adj_fname, O_WRONLY);
> -		igt_assert(fd != -1);
> -		igt_assert_eq(write(fd, prev_adj_scores, adj_scores_len),
> -			      adj_scores_len);
> -		close(fd);
> -		is_disabled = false;
> -	}
> -
> -	/* re-enstate the file permissions */
> -	chmod(adj_fname, buf.st_mode);
> -}
> -
> -/*
>    * If the test takes out the machine, in addition to the usual dmesg
>    * spam, the kernel may also emit a "death rattle" -- extra debug
>    * information that is overkill for normal successful tests, but
> @@ -587,7 +521,6 @@ bool igt_exit_called;
>   static void common_exit_handler(int sig)
>   {
>   	if (!igt_only_list_subtests()) {
> -		low_mem_killer_disable(false);
>   		kick_fbcon(true);
>   	}
>   
> @@ -879,7 +812,6 @@ out:
>   
>   		sync();
>   		oom_adjust_for_doom();
> -		low_mem_killer_disable(true);
>   		ftrace_dump_on_oops(true);
>   	}
>   
> diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
> index 5670099f..9af8a593 100644
> --- a/lib/igt_debugfs.c
> +++ b/lib/igt_debugfs.c
> @@ -990,30 +990,7 @@ int igt_get_stable_obj_count(int driver)
>   	obj_count = get_object_count(driver);
>   	/* The test relies on the system being in the same state before and
>   	 * after the test so any difference in the object count is a result of
> -	 * leaks during the test. gem_quiescent_gpu() mostly achieves this but
> -	 * on android occasionally obj_count can still change briefly.
> -	 * The loop ensures obj_count has remained stable over several checks
> -	 */
> -#ifdef ANDROID
> -	{
> -		int loop_count = 0;
> -		int prev_obj_count = obj_count;
> -		while (loop_count < 4) {
> -			usleep(200000);
> -			gem_quiescent_gpu(driver);
> -			obj_count = get_object_count(driver);
> -			if (obj_count == prev_obj_count) {
> -				loop_count++;
> -			} else {
> -				igt_debug("loop_count=%d, obj_count=%d, prev_obj_count=%d\n",
> -					loop_count, obj_count, prev_obj_count);
> -				loop_count = 0;
> -				prev_obj_count = obj_count;
> -			}
> -
> -		}
> -	}
> -#endif
> +	 * leaks during the test. */
>   	return obj_count;
>   }
>   
> diff --git a/lib/igt_fb.h b/lib/igt_fb.h
> index 3f549036..d30a7340 100644
> --- a/lib/igt_fb.h
> +++ b/lib/igt_fb.h
> @@ -28,14 +28,7 @@
>   #ifndef __IGT_FB_H__
>   #define __IGT_FB_H__
>   
> -/* cairo is assumed available on linux. On Android we check for ANDROID_HAS_CAIRO */
> -#if (!defined(ANDROID)) || (defined(ANDROID) && ANDROID_HAS_CAIRO)
>   #include <cairo.h>
> -#else
> -typedef struct _cairo_surface cairo_surface_t;
> -typedef struct _cairo cairo_t;
> -#endif
> -
>   #include <stddef.h>
>   #include <stdbool.h>
>   #include <drm_fourcc.h>
> diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h
> index 6a7584f1..fd307a45 100644
> --- a/lib/igt_kmod.h
> +++ b/lib/igt_kmod.h
> @@ -24,11 +24,7 @@
>   #ifndef IGT_KMOD_H
>   #define IGT_KMOD_H
>   
> -#ifdef ANDROID
> -#include <libkmod/libkmod.h>
> -#else
>   #include <libkmod.h>
> -#endif
>   
>   #include "igt_aux.h"
>   
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 92dcd3ca..125ecb19 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -377,6 +377,95 @@ const char *kmstest_plane_type_name(int plane_type)
>   	return names[plane_type];
>   }
>   
> +struct type_name {
> +	int type;
> +	const char *name;
> +};
> +
> +static const char *find_type_name(const struct type_name *names, int type)
> +{
> +	for (; names->name; names++) {
> +		if (names->type == type)
> +			return names->name;
> +	}
> +
> +	return "(invalid)";
> +}
> +
> +static const struct type_name encoder_type_names[] = {
> +	{ DRM_MODE_ENCODER_NONE, "none" },
> +	{ DRM_MODE_ENCODER_DAC, "DAC" },
> +	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
> +	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
> +	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
> +	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
> +	{ DRM_MODE_ENCODER_DSI, "DSI" },
> +	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
> +	{}
> +};
> +
> +/**
> + * kmstest_encoder_type_str:
> + * @type: DRM_MODE_ENCODER_* enumeration value
> + *
> + * Returns: A string representing the drm encoder @type.
> + */
> +const char *kmstest_encoder_type_str(int type)
> +{
> +	return find_type_name(encoder_type_names, type);
> +}
> +
> +static const struct type_name connector_status_names[] = {
> +	{ DRM_MODE_CONNECTED, "connected" },
> +	{ DRM_MODE_DISCONNECTED, "disconnected" },
> +	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
> +	{}
> +};
> +
> +/**
> + * kmstest_connector_status_str:
> + * @status: DRM_MODE_* connector status value
> + *
> + * Returns: A string representing the drm connector status @status.
> + */
> +const char *kmstest_connector_status_str(int status)
> +{
> +	return find_type_name(connector_status_names, status);
> +}
> +
> +static const struct type_name connector_type_names[] = {
> +	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
> +	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
> +	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
> +	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
> +	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
> +	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
> +	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
> +	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
> +	{ DRM_MODE_CONNECTOR_Component, "Component" },
> +	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
> +	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
> +	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
> +	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
> +	{ DRM_MODE_CONNECTOR_TV, "TV" },
> +	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
> +	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
> +	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
> +	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
> +	{}
> +};
> +
> +/**
> + * kmstest_connector_type_str:
> + * @type: DRM_MODE_CONNECTOR_* enumeration value
> + *
> + * Returns: A string representing the drm connector @type.
> + */
> +const char *kmstest_connector_type_str(int type)
> +{
> +	return find_type_name(connector_type_names, type);
> +}
> +
>   static const char *mode_stereo_name(const drmModeModeInfo *mode)
>   {
>   	switch (mode->flags & DRM_MODE_FLAG_3D_MASK) {
> diff --git a/lib/tests/Android.mk b/lib/tests/Android.mk
> deleted file mode 100644
> index bbbd4d86..00000000
> --- a/lib/tests/Android.mk
> +++ /dev/null
> @@ -1,41 +0,0 @@
> -LOCAL_PATH := $(call my-dir)
> -
> -include $(LOCAL_PATH)/Makefile.sources
> -
> -#================#
> -# each igt test is a separate executable. define a function to build one of these tests
> -define add_test
> -    include $(CLEAR_VARS)
> -
> -    # specific to this test
> -    LOCAL_SRC_FILES := $1.c
> -    LOCAL_MODULE := $1
> -
> -    # common to all tests
> -    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
> -    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
> -    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
> -    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
> -
> -    LOCAL_MODULE_TAGS := optional
> -    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
> -
> -    include $(BUILD_EXECUTABLE)
> -endef
> -
> -# set local compilation flags for IGT tests
> -IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
> -IGT_LOCAL_CFLAGS += -std=gnu99
> -# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
> -IGT_LOCAL_CFLAGS += -Wno-error=return-type
> -
> -# set local includes
> -IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
> -                       $(LOCAL_PATH)/../lib/stubs/drm/
> -
> -# set local libraries
> -IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
> -IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel
> -
> -$(foreach item,$($(check_prog_list)),$(eval $(call add_test,$(item))))
> -
> diff --git a/tests/Android.mk b/tests/Android.mk
> deleted file mode 100644
> index c6e966fa..00000000
> --- a/tests/Android.mk
> +++ /dev/null
> @@ -1,83 +0,0 @@
> -LOCAL_PATH := $(call my-dir)
> -
> -include $(LOCAL_PATH)/Makefile.sources
> -
> -#================#
> -# each igt test is a separate executable. define a function to build one of these tests
> -define add_test
> -    include $(CLEAR_VARS)
> -
> -    # specific to this test
> -    LOCAL_SRC_FILES := $1.c
> -    LOCAL_MODULE := $1
> -
> -    # common to all tests
> -    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
> -    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
> -    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
> -    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
> -
> -    LOCAL_MODULE_TAGS := optional
> -    # ask linker to define a specific symbol; we use this to identify IGT tests
> -    LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod
> -    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
> -
> -    include $(BUILD_EXECUTABLE)
> -endef
> -
> -
> -# some tests still do not build under android
> -skip_tests_list :=
> -skip_tests_list += testdisplay        # needs glib.h
> -skip_tests_list += pm_rpm
> -
> -# set local compilation flags for IGT tests
> -IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
> -IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=gnu99
> -# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
> -IGT_LOCAL_CFLAGS += -Wno-error=return-type
> -# Excessive complaining for established cases. Rely on the Linux version warnings.
> -IGT_LOCAL_CFLAGS += -Wno-sign-compare
> -
> -# set local includes
> -IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
> -                       $(LOCAL_PATH)/../lib/stubs/drm/
> -
> -# set local libraries
> -IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
> -IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel
> -
> -# handle cairo requirements if it is enabled
> -ifeq ("${ANDROID_HAS_CAIRO}", "1")
> -    IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/cairo-1.12.16/src
> -    IGT_LOCAL_SHARED_LIBRARIES += libcairo
> -    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1
> -else
> -# the following tests depend on cairo, so skip them
> -    skip_tests_list += \
> -    gem_render_copy \
> -    pm_lpsp \
> -	drm_read \
> -	gem_exec_blt \
> -	perf \
> -	prime_mmap_kms
> -
> -# All kms tests depend on cairo
> -    tmp_list := $(foreach test_name, $(TESTS_progs),\
> -        $(if $(findstring kms_,$(test_name)),$(test_name)))
> -    skip_tests_list += $(tmp_list)
> -
> -    tmp_list := $(foreach test_name, $(TESTS_progs_M),\
> -        $(if $(findstring kms_,$(test_name)),$(test_name)))
> -    skip_tests_list += $(tmp_list)
> -
> -    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0
> -endif
> -
> -# create two test lists, one for simple single tests, one for tests that have subtests
> -tests_list   := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite))
> -tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M))
> -
> -$(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST")))
> -$(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST")))
> -
> diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
> index 676083d5..9c64699d 100644
> --- a/tests/core_get_client_auth.c
> +++ b/tests/core_get_client_auth.c
> @@ -51,12 +51,10 @@ is_local_tid(pid_t tid)
>   {
>   #ifndef __linux__
>   	return pthread_self() == tid;
> -#elif !defined(ANDROID)
> +#else
>   	/* On Linux systems, drmGetClient() would return the thread ID
>   	   instead of the actual process ID */
>   	return syscall(SYS_gettid) == tid;
> -#else
> -	return gettid() == tid;
>   #endif
>   }
>   
> diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
> index c9280795..b5f15807 100644
> --- a/tests/gem_exec_nop.c
> +++ b/tests/gem_exec_nop.c
> @@ -142,7 +142,6 @@ stable_nop_on_ring(int fd, uint32_t handle, unsigned int engine,
>   	return n;
>   }
>   
> -#if !defined(ANDROID) || ANDROID_HAS_CAIRO
>   #define assert_within_epsilon(x, ref, tolerance) \
>           igt_assert_f((x) <= (1.0 + tolerance) * ref && \
>                        (x) >= (1.0 - tolerance) * ref, \
> @@ -187,7 +186,6 @@ static void headless(int fd, uint32_t handle)
>   	/* check that the two execution speeds are roughly the same */
>   	assert_within_epsilon(n_headless, n_display, 0.1f);
>   }
> -#endif
>   
>   static bool ignore_engine(int fd, unsigned engine)
>   {
> @@ -710,13 +708,11 @@ igt_main
>   		}
>   	}
>   
> -#if !defined(ANDROID) || ANDROID_HAS_CAIRO
>   	igt_subtest("headless") {
>   		/* Requires master for changing display modes */
>   		igt_require(drmSetMaster(device) == 0);
>   		headless(device, handle);
>   	}
> -#endif
>   
>   	igt_fixture {
>   		igt_stop_hang_detector();
> diff --git a/tools/Android.mk b/tools/Android.mk
> deleted file mode 100644
> index 96075c9d..00000000
> --- a/tools/Android.mk
> +++ /dev/null
> @@ -1,82 +0,0 @@
> -LOCAL_PATH := $(call my-dir)
> -
> -include $(LOCAL_PATH)/Makefile.sources
> -
> -LOCAL_TOOLS_DIR := intel/validation/core/igt/tools
> -
> -#================#
> -
> -define add_tool
> -    include $(CLEAR_VARS)
> -
> -    ifeq ($($(1)_SOURCES),)
> -        LOCAL_SRC_FILES := $1.c
> -    else
> -        LOCAL_SRC_FILES := $(filter-out %.h,$($(1)_SOURCES))
> -    endif
> -
> -    LOCAL_CFLAGS += -DHAVE_TERMIOS_H
> -    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
> -    LOCAL_CFLAGS += -DANDROID -UNDEBUG
> -    LOCAL_CFLAGS += -std=gnu99
> -    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
> -    LOCAL_CFLAGS += -Wno-error=return-type
> -    # Excessive complaining for established cases. Rely on the Linux version warnings.
> -    LOCAL_CFLAGS += -Wno-sign-compare
> -    LOCAL_LDFLAGS += -lkmod
> -    ifeq ($($(1)_LDFLAGS),)
> -    else
> -        LOCAL_LDFLAGS += $($(1)_LDFLAGS)
> -    endif
> -
> -    LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
> -                       $(LOCAL_PATH)/../lib/stubs/drm/
> -
> -    LOCAL_MODULE := $1_tool
> -    LOCAL_MODULE_TAGS := optional
> -
> -    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
> -
> -    LOCAL_SHARED_LIBRARIES := libpciaccess  \
> -                              libkmod       \
> -                              libdrm        \
> -                              libdrm_intel \
> -                              libz
> -
> -    # Tools dir on host
> -    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)
> -    # Tools dir on target.
> -    LOCAL_CFLAGS += -DPKGDATADIR=\"/system/vendor/$(LOCAL_TOOLS_DIR)\"
> -
> -    include $(BUILD_EXECUTABLE)
> -endef
> -
> -#================#
> -
> -# Copy the register files
> -$(shell mkdir -p $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
> -$(shell cp $(LOCAL_PATH)/registers/* $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
> -
> -bin_PROGRAMS := $(tools_prog_lists)
> -
> -skip_tools_list := \
> -    intel_framebuffer_dump \
> -    intel_guc_logger \
> -    intel_l3_parity \
> -    intel_reg_dumper \
> -    intel_vga_read \
> -    intel_vga_write
> -
> -ifneq ("${ANDROID_HAS_CAIRO}", "1")
> -    skip_tools_list += intel_display_crc
> -    skip_tools_list += intel_residency
> -endif
> -
> -ifeq ($(HAVE_LIBDRM_INTEL),true)
> -    bin_PROGRAMS += $(LIBDRM_INTEL_BIN)
> -    intel_error_decode_LDFLAGS = -lz
> -endif
> -
> -tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS))
> -
> -$(foreach item,$(tools_list),$(eval $(call add_tool,$(item))))
> 

Don't know about anyone needing Android support for igt but changes for 
Android support removal are

Reviewed-by: Juha-Pekka Heikkila <juhapekka.heikkila@gmail.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional"
  2017-11-24 15:17 ` [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" Arkadiusz Hiler
@ 2017-11-29 11:07   ` Daniel Vetter
  2017-11-29 13:24     ` Arkadiusz Hiler
  0 siblings, 1 reply; 10+ messages in thread
From: Daniel Vetter @ 2017-11-29 11:07 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

On Fri, Nov 24, 2017 at 05:17:48PM +0200, Arkadiusz Hiler wrote:
> This reverts commit d7d3f4e87b827152f00bdf89a67871736672b492
> and gets rid of the config option from the meson.build.
> 
> It was needed only for the Android support.
> 
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>

on both patches.

I think there's a bunch more things that are only optional because of
Android. Stuff like udev and glib iirc. But maybe we want to keep those,
to avoid to much pain for the next time around someone wants to implement
Android support natively.
-Daniel
> ---
>  configure.ac  |  6 +-----
>  lib/igt_aux.c | 35 +++--------------------------------
>  meson.build   |  5 +----
>  3 files changed, 5 insertions(+), 41 deletions(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 1ac2e8e8..84c6e646 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -123,11 +123,7 @@ AC_SUBST(ASSEMBLER_WARN_CFLAGS)
>  PKG_CHECK_MODULES(DRM, [libdrm >= 2.4.82])
>  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>  PKG_CHECK_MODULES(KMOD, [libkmod])
> -PKG_CHECK_MODULES(PROCPS, [libprocps], [procps=yes], [procps=no])
> -AM_CONDITIONAL(HAVE_PROCPS, [test "x$procps" = xyes])
> -if test x"$procps" = xyes; then
> -	AC_DEFINE(HAVE_PROCPS,1,[Enable process managment without shelling out])
> -fi
> +PKG_CHECK_MODULES(PROCPS, [libprocps])
>  PKG_CHECK_MODULES(VALGRIND, [valgrind], [have_valgrind=yes], [have_valgrind=no])
>  
>  if test x$have_valgrind = xyes; then
> diff --git a/lib/igt_aux.c b/lib/igt_aux.c
> index a41ae2f1..e2424109 100644
> --- a/lib/igt_aux.c
> +++ b/lib/igt_aux.c
> @@ -48,7 +48,9 @@
>  #include <sys/utsname.h>
>  #include <termios.h>
>  #include <assert.h>
> -#include <linux/limits.h>
> +
> +#include <proc/readproc.h>
> +
>  #include "drmtest.h"
>  #include "i915_drm.h"
>  #include "intel_chipset.h"
> @@ -68,10 +70,6 @@
>  #include <libgen.h>   /* for dirname() */
>  #endif
>  
> -#ifdef HAVE_PROCPS
> -#include <proc/readproc.h>
> -#endif
> -
>  /**
>   * SECTION:igt_aux
>   * @short_description: Auxiliary libraries and support functions
> @@ -1296,7 +1294,6 @@ void igt_set_module_param_int(const char *name, int val)
>   * This function sends the signal @sig for a process found in process table
>   * with name @comm.
>   */
> -#ifdef HAVE_PROCPS
>  int igt_terminate_process(int sig, const char *comm)
>  {
>  	PROCTAB *proc;
> @@ -1321,19 +1318,7 @@ int igt_terminate_process(int sig, const char *comm)
>  	closeproc(proc);
>  	return err;
>  }
> -#else
> -#warning "No procps, using naive implementation of igt_terminate_process"
>  
> -int igt_terminate_process(int sig, const char *comm)
> -{
> -	char pkill_cmd[NAME_MAX];
> -
> -	snprintf(pkill_cmd, sizeof(pkill_cmd), "pkill -x -%d %s", sig, comm);
> -	return system(pkill_cmd);
> -}
> -#endif
> -
> -#ifdef HAVE_PROCPS
>  struct pinfo {
>  	pid_t pid;
>  	const char *comm;
> @@ -1515,7 +1500,6 @@ __igt_lsof(const char *dir)
>  
>  	closeproc(proc);
>  }
> -#endif
>  
>  /**
>   * igt_lsof: Lists information about files opened by processes.
> @@ -1524,7 +1508,6 @@ __igt_lsof(const char *dir)
>   * This function mimics (a restrictive form of) lsof(8), but also shows
>   * information about opened fds.
>   */
> -#ifdef HAVE_PROCPS
>  void
>  igt_lsof(const char *dpath)
>  {
> @@ -1549,18 +1532,6 @@ igt_lsof(const char *dpath)
>  
>  	free(sanitized);
>  }
> -#else
> -#warning "No procps, using naive implementation of igt_lsof"
> -
> -void
> -igt_lsof(const char *dpath)
> -{
> -	char lsof_cmd[NAME_MAX];
> -
> -	snprintf(lsof_cmd, sizeof(lsof_cmd), "lsof +d %s", dpath);
> -	system(lsof_cmd);
> -}
> -#endif
>  
>  static struct igt_siglatency {
>  	timer_t timer;
> diff --git a/meson.build b/meson.build
> index 2361866b..8e01b05d 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -37,10 +37,7 @@ libdrm_amdgpu = dependency('libdrm_amdgpu', required : false)
>  
>  pciaccess = dependency('pciaccess', version : '>=0.10')
>  libkmod = dependency('libkmod')
> -libprocps = dependency('libprocps', required : false)
> -if libprocps.found()
> -	config.set('HAVE_PROCPS', 1)
> -endif
> +libprocps = dependency('libprocps', required : true)
>  
>  valgrind = dependency('valgrind', required : false)
>  if valgrind.found()
> -- 
> 2.13.6
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional"
  2017-11-29 11:07   ` Daniel Vetter
@ 2017-11-29 13:24     ` Arkadiusz Hiler
  2017-11-29 15:51       ` Daniel Vetter
  0 siblings, 1 reply; 10+ messages in thread
From: Arkadiusz Hiler @ 2017-11-29 13:24 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx

On Wed, Nov 29, 2017 at 12:07:06PM +0100, Daniel Vetter wrote:
> On Fri, Nov 24, 2017 at 05:17:48PM +0200, Arkadiusz Hiler wrote:
> > This reverts commit d7d3f4e87b827152f00bdf89a67871736672b492
> > and gets rid of the config option from the meson.build.
> > 
> > It was needed only for the Android support.
> > 
> > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> 
> Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> 
> on both patches.
> 
> I think there's a bunch more things that are only optional because of
> Android. Stuff like udev and glib iirc. But maybe we want to keep those,
> to avoid to much pain for the next time around someone wants to implement
> Android support natively.
> -Daniel

Pushed, thanks for Acks and R-bs!

As of further cleanups, there is one really impending on us
- the libunwind one.

We have huge sections of the code wrapped in ifdefs which bit us more
than once - it's easy to misplace code in there, code that should always
be compiled.

This needs a rework, initial ideas is to put all the unwind related mess
into separate file and compile the whole thing conditionally - for
clearer separation.

We would also need "fallback" noop implementation of some of those
functions.

Or we may ask ourself, with Android support gone, is this really worth
it and shouldn't we make libunwind non-optional and just get rid of the
preprocessor macors? :-)

-- 
Cheers,
Arek
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t 1/2] igt: Remove Android support
  2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
                   ` (3 preceding siblings ...)
  2017-11-27 14:42 ` [PATCH i-g-t 1/2] " Juha-Pekka Heikkila
@ 2017-11-29 13:26 ` Szwichtenberg, Radoslaw
  4 siblings, 0 replies; 10+ messages in thread
From: Szwichtenberg, Radoslaw @ 2017-11-29 13:26 UTC (permalink / raw)
  To: Hiler, Arkadiusz, intel-gfx; +Cc: Kondapally, Kalyan, Vetter, Daniel

On Fri, 2017-11-24 at 17:17 +0200, Arkadiusz Hiler wrote:
> This patch gets rid of the Android support, deleting all the hacks and
> moving code around to the places it belongs.
> 
> Android build is not really maintained properly and rots rather fast.
> With recent push for Meson here and Android going for Soong it will only
> accelerate.
> 
> It's a good time to drop the illusion of providing any support.
> 
> Cc: Daniel Vetter <daniel.vetter@intel.com>
> Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
> Cc: Petri Latvala <petri.latvala@intel.com>
> Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
> Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
Reviewed-by: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* Re: [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional"
  2017-11-29 13:24     ` Arkadiusz Hiler
@ 2017-11-29 15:51       ` Daniel Vetter
  0 siblings, 0 replies; 10+ messages in thread
From: Daniel Vetter @ 2017-11-29 15:51 UTC (permalink / raw)
  To: Arkadiusz Hiler; +Cc: intel-gfx

On Wed, Nov 29, 2017 at 03:24:41PM +0200, Arkadiusz Hiler wrote:
> On Wed, Nov 29, 2017 at 12:07:06PM +0100, Daniel Vetter wrote:
> > On Fri, Nov 24, 2017 at 05:17:48PM +0200, Arkadiusz Hiler wrote:
> > > This reverts commit d7d3f4e87b827152f00bdf89a67871736672b492
> > > and gets rid of the config option from the meson.build.
> > > 
> > > It was needed only for the Android support.
> > > 
> > > Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>
> > 
> > Acked-by: Daniel Vetter <daniel.vetter@ffwll.ch>
> > 
> > on both patches.
> > 
> > I think there's a bunch more things that are only optional because of
> > Android. Stuff like udev and glib iirc. But maybe we want to keep those,
> > to avoid to much pain for the next time around someone wants to implement
> > Android support natively.
> > -Daniel
> 
> Pushed, thanks for Acks and R-bs!
> 
> As of further cleanups, there is one really impending on us
> - the libunwind one.
> 
> We have huge sections of the code wrapped in ifdefs which bit us more
> than once - it's easy to misplace code in there, code that should always
> be compiled.
> 
> This needs a rework, initial ideas is to put all the unwind related mess
> into separate file and compile the whole thing conditionally - for
> clearer separation.
> 
> We would also need "fallback" noop implementation of some of those
> functions.
> 
> Or we may ask ourself, with Android support gone, is this really worth
> it and shouldn't we make libunwind non-optional and just get rid of the
> preprocessor macors? :-)

+1 on simply requiring libunwind. The other option is more work, and can
be done when we have a real ask for it (aka Android, in which case your
suggested split-out is probably what we want).
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 10+ messages in thread

* [PATCH i-g-t 1/2] igt: Remove Android support
@ 2017-09-13 10:43 Arkadiusz Hiler
  0 siblings, 0 replies; 10+ messages in thread
From: Arkadiusz Hiler @ 2017-09-13 10:43 UTC (permalink / raw)
  To: intel-gfx; +Cc: Kalyan Kondapally, Daniel Vetter

This patch gets rid of Android support, deleting all the hacks and
moving code around to the places it belong.

Android build is not really maintained properly and rots rather fast.
With recent push for Meson here and Android going for Soong it will only
accelerate.

It's a good time to drop the illusion of providing any support.

If there is someone who actually needs that, please step up and help us
with the maintenance.

Cc: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Daniel Vetter <daniel.vetter@intel.com>
Cc: Kalyan Kondapally <kalyan.kondapally@intel.com>
Cc: Petri Latvala <petri.latvala@intel.com>
Cc: Radoslaw Szwichtenberg <radoslaw.szwichtenberg@intel.com>
Cc: Rafael Barbalho <rafael.barbalho@intel.com>
Signed-off-by: Arkadiusz Hiler <arkadiusz.hiler@intel.com>

---
 Android.mk                   |  4 --
 assembler/ralloc.c           |  5 ---
 benchmarks/Android.mk        | 46 ---------------------
 benchmarks/gem_syslatency.c  |  2 -
 lib/Android.mk               | 53 ------------------------
 lib/drmtest.h                | 16 --------
 lib/igt_aux.c                | 95 --------------------------------------------
 lib/igt_aux.h                |  5 ---
 lib/igt_core.c               | 68 -------------------------------
 lib/igt_debugfs.c            | 25 +-----------
 lib/igt_fb.h                 |  7 ----
 lib/igt_kmod.h               |  4 --
 lib/igt_kms.c                | 89 +++++++++++++++++++++++++++++++++++++++++
 lib/tests/Android.mk         | 41 -------------------
 tests/Android.mk             | 83 --------------------------------------
 tests/core_get_client_auth.c |  4 +-
 tests/gem_exec_nop.c         |  4 --
 tools/Android.mk             | 82 --------------------------------------
 18 files changed, 91 insertions(+), 542 deletions(-)
 delete mode 100644 Android.mk
 delete mode 100644 benchmarks/Android.mk
 delete mode 100644 lib/Android.mk
 delete mode 100644 lib/tests/Android.mk
 delete mode 100644 tests/Android.mk
 delete mode 100644 tools/Android.mk

diff --git a/Android.mk b/Android.mk
deleted file mode 100644
index 3690fc5a..00000000
--- a/Android.mk
+++ /dev/null
@@ -1,4 +0,0 @@
-HAVE_LIBDRM_INTEL := true
-
-include $(call all-named-subdir-makefiles, lib tests tools benchmarks)
-
diff --git a/assembler/ralloc.c b/assembler/ralloc.c
index 59e71c48..69c1da4d 100644
--- a/assembler/ralloc.c
+++ b/assembler/ralloc.c
@@ -28,11 +28,6 @@
 #include <string.h>
 #include <stdint.h>
 
-/* Android defines SIZE_MAX in limits.h, instead of the standard stdint.h */
-#ifdef ANDROID
-#include <limits.h>
-#endif
-
 /* Some versions of MinGW are missing _vscprintf's declaration, although they
  * still provide the symbol in the import library. */
 #ifdef __MINGW32__
diff --git a/benchmarks/Android.mk b/benchmarks/Android.mk
deleted file mode 100644
index 4ea275c4..00000000
--- a/benchmarks/Android.mk
+++ /dev/null
@@ -1,46 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib
-
-#================#
-
-define add_benchmark
-    include $(CLEAR_VARS)
-
-    LOCAL_SRC_FILES := $1.c
-
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES} \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-    LOCAL_CFLAGS += -DANDROID -UNDEBUG -include "check-ndebug.h"
-    LOCAL_CFLAGS += -std=gnu99
-    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-    LOCAL_CFLAGS += -Wno-error=return-type
-    # Excessive complaining for established cases. Rely on the Linux version warnings.
-    LOCAL_CFLAGS += -Wno-sign-compare
-    LOCAL_LDFLAGS += -lkmod
-
-    LOCAL_MODULE := $1_benchmark
-    LOCAL_MODULE_TAGS := optional
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt/benchmarks
-
-    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-    LOCAL_SHARED_LIBRARIES := libpciaccess  \
-                              libkmod       \
-                              libdrm        \
-                              libdrm_intel
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-#================#
-
-benchmark_list := $(benchmarks_prog_list)
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    benchmark_list += $(LIBDRM_INTEL_BENCHMARKS)
-endif
-
-$(foreach item,$(benchmark_list),$(eval $(call add_benchmark,$(item))))
diff --git a/benchmarks/gem_syslatency.c b/benchmarks/gem_syslatency.c
index 4ed23638..994d31e0 100644
--- a/benchmarks/gem_syslatency.c
+++ b/benchmarks/gem_syslatency.c
@@ -183,7 +183,6 @@ static void *sys_wait(void *arg)
 static void bind_cpu(pthread_attr_t *attr, int cpu)
 {
 #ifdef __USE_GNU
-#ifndef ANDROID
 	cpu_set_t mask;
 
 	if (cpu == -1)
@@ -194,7 +193,6 @@ static void bind_cpu(pthread_attr_t *attr, int cpu)
 
 	pthread_attr_setaffinity_np(attr, sizeof(mask), &mask);
 #endif
-#endif
 }
 
 static void rtprio(pthread_attr_t *attr, int prio)
diff --git a/lib/Android.mk b/lib/Android.mk
deleted file mode 100644
index 31f88be7..00000000
--- a/lib/Android.mk
+++ /dev/null
@@ -1,53 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-GPU_TOOLS_PATH := $(LOCAL_PATH)/..
-IGT_LIB_PATH := $(LOCAL_PATH)
-
-# FIXME: autogenerate this info #
-$(GPU_TOOLS_PATH)/config.h:
-	@echo "updating config.h"
-	@echo '#define PACKAGE_VERSION "1.5"' >> $@ ; \
-	echo '#define TARGET_CPU_PLATFORM "android-ia"' >> $@ ;
-
-include $(LOCAL_PATH)/Makefile.sources
-
-include $(CLEAR_VARS)
-
-LOCAL_GENERATED_SOURCES :=       \
-	$(IGT_LIB_PATH)/version.h  \
-	$(GPU_TOOLS_PATH)/config.h
-
-LOCAL_C_INCLUDES += $(LOCAL_PATH)/.. \
-                    $(LOCAL_PATH)/stubs/drm/
-
-LOCAL_EXPORT_C_INCLUDE_DIRS := $(LOCAL_PATH)
-
-LOCAL_CFLAGS += -DHAVE_LIBDRM_ATOMIC_PRIMITIVES
-LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-LOCAL_CFLAGS += -DANDROID -DHAVE_LINUX_KD_H
-LOCAL_CFLAGS += -std=gnu99 -UNDEBUG
-LOCAL_MODULE:= libintel_gpu_tools
-
-LOCAL_SHARED_LIBRARIES := libpciaccess  \
-			  libkmod       \
-			  libdrm        \
-			  libdrm_intel
-
-ifeq ("${ANDROID_HAS_CAIRO}", "1")
-    skip_lib_list :=
-    LOCAL_C_INCLUDES += $(ANDROID_BUILD_TOP)/external/cairo-1.12.16/src
-    LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1 -DIGT_DATADIR=\".\" -DIGT_SRCDIR=\".\"
-else
-skip_lib_list := \
-    igt_kms.c \
-    igt_kms.h \
-    igt_fb.c
-    -DANDROID_HAS_CAIRO=0
-endif
-
-LOCAL_SRC_FILES := $(filter-out %.h $(skip_lib_list),$(lib_source_list))
-
-include $(BUILD_STATIC_LIBRARY)
-
-include $(call first-makefiles-under, $(LOCAL_PATH))
-
diff --git a/lib/drmtest.h b/lib/drmtest.h
index a86799d5..fdd34ec6 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -51,22 +51,6 @@
  */
 #define DRIVER_ANY 	~(DRIVER_VGEM)
 
-
-#ifdef ANDROID
-#if (!(defined HAVE_MMAP64)) && (!(defined __x86_64__))
-extern void*  __mmap2(void *, size_t, int, int, int, off_t);
-
-/* mmap64 is a recent addition to bionic and not available in all android builds. */
-/* I can find no reliable way to know if it is defined or not - so just avoid it */
-#define mmap64 igt_mmap64
-static inline void *igt_mmap64(void *addr, size_t length, int prot, int flags,
-        int fd, off64_t offset)
-{
-    return __mmap2(addr, length, prot, flags, fd, offset >> 12);
-}
-#endif
-#endif
-
 /**
  * ARRAY_SIZE:
  * @arr: static array
diff --git a/lib/igt_aux.c b/lib/igt_aux.c
index eb1f90f9..295e435c 100644
--- a/lib/igt_aux.c
+++ b/lib/igt_aux.c
@@ -1031,101 +1031,6 @@ void igt_debug_manual_check(const char *var, const char *expected)
 	igt_assert(key != 'n' && key != 'N');
 }
 
-/* Functions with prefix kmstest_ independent of cairo library are pulled out
- * from file igt_kms.c since this file is skipped in lib/Android.mk when flag
- * ANDROID_HAS_CAIRO is 0. This ensures the usability of these functions even
- * when cairo library is not present on Android.
- */
-
-struct type_name {
-	int type;
-	const char *name;
-};
-
-static const char *find_type_name(const struct type_name *names, int type)
-{
-	for (; names->name; names++) {
-		if (names->type == type)
-			return names->name;
-	}
-
-	return "(invalid)";
-}
-
-static const struct type_name encoder_type_names[] = {
-	{ DRM_MODE_ENCODER_NONE, "none" },
-	{ DRM_MODE_ENCODER_DAC, "DAC" },
-	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
-	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
-	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
-	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
-	{ DRM_MODE_ENCODER_DSI, "DSI" },
-	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
-	{}
-};
-
-/**
- * kmstest_encoder_type_str:
- * @type: DRM_MODE_ENCODER_* enumeration value
- *
- * Returns: A string representing the drm encoder @type.
- */
-const char *kmstest_encoder_type_str(int type)
-{
-	return find_type_name(encoder_type_names, type);
-}
-
-static const struct type_name connector_status_names[] = {
-	{ DRM_MODE_CONNECTED, "connected" },
-	{ DRM_MODE_DISCONNECTED, "disconnected" },
-	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
-	{}
-};
-
-/**
- * kmstest_connector_status_str:
- * @status: DRM_MODE_* connector status value
- *
- * Returns: A string representing the drm connector status @status.
- */
-const char *kmstest_connector_status_str(int status)
-{
-	return find_type_name(connector_status_names, status);
-}
-
-static const struct type_name connector_type_names[] = {
-	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
-	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
-	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
-	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
-	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
-	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
-	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
-	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
-	{ DRM_MODE_CONNECTOR_Component, "Component" },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
-	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
-	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
-	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
-	{ DRM_MODE_CONNECTOR_TV, "TV" },
-	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
-	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
-	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
-	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
-	{}
-};
-
-/**
- * kmstest_connector_type_str:
- * @type: DRM_MODE_CONNECTOR_* enumeration value
- *
- * Returns: A string representing the drm connector @type.
- */
-const char *kmstest_connector_type_str(int type)
-{
-	return find_type_name(connector_type_names, type);
-}
-
 /**
  * igt_lock_mem:
  * @size: the amount of memory to lock into RAM, in MB
diff --git a/lib/igt_aux.h b/lib/igt_aux.h
index 499a1679..8674b5af 100644
--- a/lib/igt_aux.h
+++ b/lib/igt_aux.h
@@ -43,12 +43,7 @@ extern int num_trash_bos;
 #define NSEC_PER_SEC (1000*USEC_PER_SEC)
 
 /* signal interrupt helpers */
-#ifdef ANDROID
-#include <unistd.h> /* on Android bionic has this implemented */
-#else
 #define gettid() syscall(__NR_gettid)
-#endif
-
 #define sigev_notify_thread_id _sigev_un._tid
 
 /* auxialiary igt helpers from igt_aux.c */
diff --git a/lib/igt_core.c b/lib/igt_core.c
index 9f4ee68b..838aaacc 100644
--- a/lib/igt_core.c
+++ b/lib/igt_core.c
@@ -492,77 +492,10 @@ void __igt_fixture_end(void)
 	siglongjmp(igt_subtest_jmpbuf, 1);
 }
 
-/*
- * Some of the IGT tests put quite a lot of pressure on memory and when
- * running on Android they are sometimes killed by the Android low memory killer.
- * This seems to be due to some incompatibility between the kswapd free memory
- * targets and the way the lowmemorykiller assesses free memory.
- * The low memory killer really isn't usefull in this context and has no
- * interaction with the gpu driver that we are testing, so the following
- * function is used to disable it by modifying one of its module parameters.
- * We still have the normal linux oom killer to protect the kernel.
- * Apparently it is also possible for the lowmemorykiller to get included
- * in some linux distributions; so rather than check for Android we directly
- * check for the existence of the module parameter we want to adjust.
- *
- * In future, if we can get the lowmemorykiller to play nicely then we can
- * remove this hack.
- */
-static void low_mem_killer_disable(bool disable)
-{
-	static const char* adj_fname="/sys/module/lowmemorykiller/parameters/adj";
-	static const char no_lowmem_killer[] = "9999";
-	int fd;
-	struct stat buf;
-	/* The following must persist across invocations */
-	static char prev_adj_scores[256];
-	static int adj_scores_len = 0;
-	static bool is_disabled = false;
-
-	/* capture the permissions bits for the lowmemkiller adj pseudo-file.
-	 * Bail out if the stat fails; it probably means that there is no
-	 * lowmemorykiller, but in any case we're doomed. */
-	if (stat(adj_fname, &buf)) {
-		igt_assert(errno == ENOENT);
-		return;
-	}
-
-	/* make sure the file can be read/written - by default it is write-only */
-	chmod(adj_fname, S_IRUSR | S_IWUSR);
-
-	if (disable && !is_disabled) {
-		/* read the current oom adj parameters for lowmemorykiller */
-		fd = open(adj_fname, O_RDWR);
-		igt_assert(fd != -1);
-		adj_scores_len = read(fd, (void*)prev_adj_scores, 255);
-		igt_assert(adj_scores_len > 0);
-
-		/* writing 9999 to this module parameter effectively diables the
-		 * low memory killer. This is not a real file, so we dont need to
-		 * seek to the start or truncate it */
-		igt_assert_eq(write(fd, no_lowmem_killer, sizeof(no_lowmem_killer)),
-			      sizeof(no_lowmem_killer));
-		close(fd);
-		is_disabled = true;
-	} else if (is_disabled) {
-		/* just re-enstate the original settings */
-		fd = open(adj_fname, O_WRONLY);
-		igt_assert(fd != -1);
-		igt_assert_eq(write(fd, prev_adj_scores, adj_scores_len),
-			      adj_scores_len);
-		close(fd);
-		is_disabled = false;
-	}
-
-	/* re-enstate the file permissions */
-	chmod(adj_fname, buf.st_mode);
-}
-
 bool igt_exit_called;
 static void common_exit_handler(int sig)
 {
 	if (!igt_only_list_subtests()) {
-		low_mem_killer_disable(false);
 		kick_fbcon(true);
 	}
 
@@ -854,7 +787,6 @@ out:
 
 		sync();
 		oom_adjust_for_doom();
-		low_mem_killer_disable(true);
 	}
 
 	/* install exit handler, to ensure we clean up */
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 1e8c8cc3..515df401 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -1153,30 +1153,7 @@ int igt_get_stable_obj_count(int driver)
 	obj_count = get_object_count(driver);
 	/* The test relies on the system being in the same state before and
 	 * after the test so any difference in the object count is a result of
-	 * leaks during the test. gem_quiescent_gpu() mostly achieves this but
-	 * on android occasionally obj_count can still change briefly.
-	 * The loop ensures obj_count has remained stable over several checks
-	 */
-#ifdef ANDROID
-	{
-		int loop_count = 0;
-		int prev_obj_count = obj_count;
-		while (loop_count < 4) {
-			usleep(200000);
-			gem_quiescent_gpu(driver);
-			obj_count = get_object_count(driver);
-			if (obj_count == prev_obj_count) {
-				loop_count++;
-			} else {
-				igt_debug("loop_count=%d, obj_count=%d, prev_obj_count=%d\n",
-					loop_count, obj_count, prev_obj_count);
-				loop_count = 0;
-				prev_obj_count = obj_count;
-			}
-
-		}
-	}
-#endif
+	 * leaks during the test. */
 	return obj_count;
 }
 
diff --git a/lib/igt_fb.h b/lib/igt_fb.h
index a193a1e7..21c20a4e 100644
--- a/lib/igt_fb.h
+++ b/lib/igt_fb.h
@@ -28,14 +28,7 @@
 #ifndef __IGT_FB_H__
 #define __IGT_FB_H__
 
-/* cairo is assumed available on linux. On Android we check for ANDROID_HAS_CAIRO */
-#if (!defined(ANDROID)) || (defined(ANDROID) && ANDROID_HAS_CAIRO)
 #include <cairo.h>
-#else
-typedef struct _cairo_surface cairo_surface_t;
-typedef struct _cairo cairo_t;
-#endif
-
 #include <stddef.h>
 #include <stdbool.h>
 #include <drm_fourcc.h>
diff --git a/lib/igt_kmod.h b/lib/igt_kmod.h
index 6a7584f1..fd307a45 100644
--- a/lib/igt_kmod.h
+++ b/lib/igt_kmod.h
@@ -24,11 +24,7 @@
 #ifndef IGT_KMOD_H
 #define IGT_KMOD_H
 
-#ifdef ANDROID
-#include <libkmod/libkmod.h>
-#else
 #include <libkmod.h>
-#endif
 
 #include "igt_aux.h"
 
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 7bcafc07..f698f7e0 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -374,6 +374,95 @@ const char *kmstest_plane_type_name(int plane_type)
 	return names[plane_type];
 }
 
+struct type_name {
+	int type;
+	const char *name;
+};
+
+static const char *find_type_name(const struct type_name *names, int type)
+{
+	for (; names->name; names++) {
+		if (names->type == type)
+			return names->name;
+	}
+
+	return "(invalid)";
+}
+
+static const struct type_name encoder_type_names[] = {
+	{ DRM_MODE_ENCODER_NONE, "none" },
+	{ DRM_MODE_ENCODER_DAC, "DAC" },
+	{ DRM_MODE_ENCODER_TMDS, "TMDS" },
+	{ DRM_MODE_ENCODER_LVDS, "LVDS" },
+	{ DRM_MODE_ENCODER_TVDAC, "TVDAC" },
+	{ DRM_MODE_ENCODER_VIRTUAL, "Virtual" },
+	{ DRM_MODE_ENCODER_DSI, "DSI" },
+	{ DRM_MODE_ENCODER_DPMST, "DP MST" },
+	{}
+};
+
+/**
+ * kmstest_encoder_type_str:
+ * @type: DRM_MODE_ENCODER_* enumeration value
+ *
+ * Returns: A string representing the drm encoder @type.
+ */
+const char *kmstest_encoder_type_str(int type)
+{
+	return find_type_name(encoder_type_names, type);
+}
+
+static const struct type_name connector_status_names[] = {
+	{ DRM_MODE_CONNECTED, "connected" },
+	{ DRM_MODE_DISCONNECTED, "disconnected" },
+	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
+	{}
+};
+
+/**
+ * kmstest_connector_status_str:
+ * @status: DRM_MODE_* connector status value
+ *
+ * Returns: A string representing the drm connector status @status.
+ */
+const char *kmstest_connector_status_str(int status)
+{
+	return find_type_name(connector_status_names, status);
+}
+
+static const struct type_name connector_type_names[] = {
+	{ DRM_MODE_CONNECTOR_Unknown, "Unknown" },
+	{ DRM_MODE_CONNECTOR_VGA, "VGA" },
+	{ DRM_MODE_CONNECTOR_DVII, "DVI-I" },
+	{ DRM_MODE_CONNECTOR_DVID, "DVI-D" },
+	{ DRM_MODE_CONNECTOR_DVIA, "DVI-A" },
+	{ DRM_MODE_CONNECTOR_Composite, "Composite" },
+	{ DRM_MODE_CONNECTOR_SVIDEO, "SVIDEO" },
+	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
+	{ DRM_MODE_CONNECTOR_Component, "Component" },
+	{ DRM_MODE_CONNECTOR_9PinDIN, "DIN" },
+	{ DRM_MODE_CONNECTOR_DisplayPort, "DP" },
+	{ DRM_MODE_CONNECTOR_HDMIA, "HDMI-A" },
+	{ DRM_MODE_CONNECTOR_HDMIB, "HDMI-B" },
+	{ DRM_MODE_CONNECTOR_TV, "TV" },
+	{ DRM_MODE_CONNECTOR_eDP, "eDP" },
+	{ DRM_MODE_CONNECTOR_VIRTUAL, "Virtual" },
+	{ DRM_MODE_CONNECTOR_DSI, "DSI" },
+	{ DRM_MODE_CONNECTOR_DPI, "DPI" },
+	{}
+};
+
+/**
+ * kmstest_connector_type_str:
+ * @type: DRM_MODE_CONNECTOR_* enumeration value
+ *
+ * Returns: A string representing the drm connector @type.
+ */
+const char *kmstest_connector_type_str(int type)
+{
+	return find_type_name(connector_type_names, type);
+}
+
 static const char *mode_stereo_name(const drmModeModeInfo *mode)
 {
 	switch (mode->flags & DRM_MODE_FLAG_3D_MASK) {
diff --git a/lib/tests/Android.mk b/lib/tests/Android.mk
deleted file mode 100644
index bbbd4d86..00000000
--- a/lib/tests/Android.mk
+++ /dev/null
@@ -1,41 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-#================#
-# each igt test is a separate executable. define a function to build one of these tests
-define add_test
-    include $(CLEAR_VARS)
-
-    # specific to this test
-    LOCAL_SRC_FILES := $1.c
-    LOCAL_MODULE := $1
-
-    # common to all tests
-    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
-    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
-    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
-
-    LOCAL_MODULE_TAGS := optional
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-# set local compilation flags for IGT tests
-IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
-IGT_LOCAL_CFLAGS += -std=gnu99
-# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-IGT_LOCAL_CFLAGS += -Wno-error=return-type
-
-# set local includes
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-# set local libraries
-IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libdrm libdrm_intel
-
-$(foreach item,$($(check_prog_list)),$(eval $(call add_test,$(item))))
-
diff --git a/tests/Android.mk b/tests/Android.mk
deleted file mode 100644
index c6e966fa..00000000
--- a/tests/Android.mk
+++ /dev/null
@@ -1,83 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-#================#
-# each igt test is a separate executable. define a function to build one of these tests
-define add_test
-    include $(CLEAR_VARS)
-
-    # specific to this test
-    LOCAL_SRC_FILES := $1.c
-    LOCAL_MODULE := $1
-
-    # common to all tests
-    LOCAL_CFLAGS += ${IGT_LOCAL_CFLAGS}
-    LOCAL_C_INCLUDES = ${IGT_LOCAL_C_INCLUDES}
-    LOCAL_STATIC_LIBRARIES := ${IGT_LOCAL_STATIC_LIBRARIES}
-    LOCAL_SHARED_LIBRARIES := ${IGT_LOCAL_SHARED_LIBRARIES}
-
-    LOCAL_MODULE_TAGS := optional
-    # ask linker to define a specific symbol; we use this to identify IGT tests
-    LOCAL_LDFLAGS := -Wl,--defsym=$2=0 -lkmod
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/intel/validation/core/igt
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-
-# some tests still do not build under android
-skip_tests_list :=
-skip_tests_list += testdisplay        # needs glib.h
-skip_tests_list += pm_rpm
-
-# set local compilation flags for IGT tests
-IGT_LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM -DANDROID -UNDEBUG
-IGT_LOCAL_CFLAGS += -include "check-ndebug.h" -std=gnu99
-# FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-IGT_LOCAL_CFLAGS += -Wno-error=return-type
-# Excessive complaining for established cases. Rely on the Linux version warnings.
-IGT_LOCAL_CFLAGS += -Wno-sign-compare
-
-# set local includes
-IGT_LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-# set local libraries
-IGT_LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-IGT_LOCAL_SHARED_LIBRARIES := libpciaccess libkmod libdrm libdrm_intel
-
-# handle cairo requirements if it is enabled
-ifeq ("${ANDROID_HAS_CAIRO}", "1")
-    IGT_LOCAL_C_INCLUDES += ${ANDROID_BUILD_TOP}/external/cairo-1.12.16/src
-    IGT_LOCAL_SHARED_LIBRARIES += libcairo
-    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=1
-else
-# the following tests depend on cairo, so skip them
-    skip_tests_list += \
-    gem_render_copy \
-    pm_lpsp \
-	drm_read \
-	gem_exec_blt \
-	perf \
-	prime_mmap_kms
-
-# All kms tests depend on cairo
-    tmp_list := $(foreach test_name, $(TESTS_progs),\
-        $(if $(findstring kms_,$(test_name)),$(test_name)))
-    skip_tests_list += $(tmp_list)
-
-    tmp_list := $(foreach test_name, $(TESTS_progs_M),\
-        $(if $(findstring kms_,$(test_name)),$(test_name)))
-    skip_tests_list += $(tmp_list)
-
-    IGT_LOCAL_CFLAGS += -DANDROID_HAS_CAIRO=0
-endif
-
-# create two test lists, one for simple single tests, one for tests that have subtests
-tests_list   := $(filter-out $(skip_tests_list),$(TESTS_progs) $(HANG) $(TESTS_testsuite))
-tests_list_M := $(filter-out $(skip_tests_list),$(TESTS_progs_M))
-
-$(foreach item,$(tests_list),$(eval $(call add_test,$(item),"IGT_SINGLE_TEST")))
-$(foreach item,$(tests_list_M),$(eval $(call add_test,$(item),"IGT_MULTI_TEST")))
-
diff --git a/tests/core_get_client_auth.c b/tests/core_get_client_auth.c
index 676083d5..9c64699d 100644
--- a/tests/core_get_client_auth.c
+++ b/tests/core_get_client_auth.c
@@ -51,12 +51,10 @@ is_local_tid(pid_t tid)
 {
 #ifndef __linux__
 	return pthread_self() == tid;
-#elif !defined(ANDROID)
+#else
 	/* On Linux systems, drmGetClient() would return the thread ID
 	   instead of the actual process ID */
 	return syscall(SYS_gettid) == tid;
-#else
-	return gettid() == tid;
 #endif
 }
 
diff --git a/tests/gem_exec_nop.c b/tests/gem_exec_nop.c
index 62a53605..b073b5e3 100644
--- a/tests/gem_exec_nop.c
+++ b/tests/gem_exec_nop.c
@@ -139,7 +139,6 @@ stable_nop_on_ring(int fd, uint32_t handle, unsigned int engine,
 	return n;
 }
 
-#if !defined(ANDROID) || ANDROID_HAS_CAIRO
 #define assert_within_epsilon(x, ref, tolerance) \
         igt_assert_f((x) <= (1.0 + tolerance) * ref && \
                      (x) >= (1.0 - tolerance) * ref, \
@@ -184,7 +183,6 @@ static void headless(int fd, uint32_t handle)
 	/* check that the two execution speeds are roughly the same */
 	assert_within_epsilon(n_headless, n_display, 0.1f);
 }
-#endif
 
 static bool ignore_engine(int fd, unsigned engine)
 {
@@ -667,10 +665,8 @@ igt_main
 	igt_subtest("context-sequential")
 		sequential(device, handle, FORKED | CONTEXT, 150);
 
-#if !defined(ANDROID) || ANDROID_HAS_CAIRO
 	igt_subtest("headless")
 		headless(device, handle);
-#endif
 
 	igt_fixture {
 		igt_stop_hang_detector();
diff --git a/tools/Android.mk b/tools/Android.mk
deleted file mode 100644
index 96075c9d..00000000
--- a/tools/Android.mk
+++ /dev/null
@@ -1,82 +0,0 @@
-LOCAL_PATH := $(call my-dir)
-
-include $(LOCAL_PATH)/Makefile.sources
-
-LOCAL_TOOLS_DIR := intel/validation/core/igt/tools
-
-#================#
-
-define add_tool
-    include $(CLEAR_VARS)
-
-    ifeq ($($(1)_SOURCES),)
-        LOCAL_SRC_FILES := $1.c
-    else
-        LOCAL_SRC_FILES := $(filter-out %.h,$($(1)_SOURCES))
-    endif
-
-    LOCAL_CFLAGS += -DHAVE_TERMIOS_H
-    LOCAL_CFLAGS += -DHAVE_STRUCT_SYSINFO_TOTALRAM
-    LOCAL_CFLAGS += -DANDROID -UNDEBUG
-    LOCAL_CFLAGS += -std=gnu99
-    # FIXME: drop once Bionic correctly annotates "noreturn" on pthread_exit
-    LOCAL_CFLAGS += -Wno-error=return-type
-    # Excessive complaining for established cases. Rely on the Linux version warnings.
-    LOCAL_CFLAGS += -Wno-sign-compare
-    LOCAL_LDFLAGS += -lkmod
-    ifeq ($($(1)_LDFLAGS),)
-    else
-        LOCAL_LDFLAGS += $($(1)_LDFLAGS)
-    endif
-
-    LOCAL_C_INCLUDES = $(LOCAL_PATH)/../lib \
-                       $(LOCAL_PATH)/../lib/stubs/drm/
-
-    LOCAL_MODULE := $1_tool
-    LOCAL_MODULE_TAGS := optional
-
-    LOCAL_STATIC_LIBRARIES := libintel_gpu_tools
-
-    LOCAL_SHARED_LIBRARIES := libpciaccess  \
-                              libkmod       \
-                              libdrm        \
-                              libdrm_intel \
-                              libz
-
-    # Tools dir on host
-    LOCAL_MODULE_PATH := $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)
-    # Tools dir on target.
-    LOCAL_CFLAGS += -DPKGDATADIR=\"/system/vendor/$(LOCAL_TOOLS_DIR)\"
-
-    include $(BUILD_EXECUTABLE)
-endef
-
-#================#
-
-# Copy the register files
-$(shell mkdir -p $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
-$(shell cp $(LOCAL_PATH)/registers/* $(TARGET_OUT_VENDOR)/$(LOCAL_TOOLS_DIR)/registers)
-
-bin_PROGRAMS := $(tools_prog_lists)
-
-skip_tools_list := \
-    intel_framebuffer_dump \
-    intel_guc_logger \
-    intel_l3_parity \
-    intel_reg_dumper \
-    intel_vga_read \
-    intel_vga_write
-
-ifneq ("${ANDROID_HAS_CAIRO}", "1")
-    skip_tools_list += intel_display_crc
-    skip_tools_list += intel_residency
-endif
-
-ifeq ($(HAVE_LIBDRM_INTEL),true)
-    bin_PROGRAMS += $(LIBDRM_INTEL_BIN)
-    intel_error_decode_LDFLAGS = -lz
-endif
-
-tools_list := $(filter-out $(skip_tools_list),$(bin_PROGRAMS))
-
-$(foreach item,$(tools_list),$(eval $(call add_tool,$(item))))
-- 
2.13.5

PS. I'll let the patch to float on the mailing list for a week or so before
merging it, but if we would find someone to do the work post-merge, I'll be
happy to revert it.
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2017-11-29 15:51 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-11-24 15:17 [PATCH i-g-t 1/2] igt: Remove Android support Arkadiusz Hiler
2017-11-24 15:17 ` [PATCH i-g-t 2/2] Revert "lib/igt_aux: Make procps optional" Arkadiusz Hiler
2017-11-29 11:07   ` Daniel Vetter
2017-11-29 13:24     ` Arkadiusz Hiler
2017-11-29 15:51       ` Daniel Vetter
2017-11-24 16:04 ` ✓ Fi.CI.BAT: success for series starting with [1/2] igt: Remove Android support Patchwork
2017-11-24 18:20 ` ✓ Fi.CI.IGT: " Patchwork
2017-11-27 14:42 ` [PATCH i-g-t 1/2] " Juha-Pekka Heikkila
2017-11-29 13:26 ` Szwichtenberg, Radoslaw
  -- strict thread matches above, loose matches on Subject: below --
2017-09-13 10:43 Arkadiusz Hiler

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.