[igt-dev] [PATCH i-g-t 29/29] lib/igt_device_scan: add null implementation

D Scott Phillips d.scott.phillips at intel.com
Wed Dec 11 00:52:35 UTC 2019


Signed-off-by: D Scott Phillips <d.scott.phillips at intel.com>
---
 lib/igt_device_scan_null.c | 67 ++++++++++++++++++++++++++++++++++++++
 lib/meson.build            |  3 +-
 2 files changed, 69 insertions(+), 1 deletion(-)
 create mode 100644 lib/igt_device_scan_null.c

diff --git a/lib/igt_device_scan_null.c b/lib/igt_device_scan_null.c
new file mode 100644
index 00000000..27f2d94b
--- /dev/null
+++ b/lib/igt_device_scan_null.c
@@ -0,0 +1,67 @@
+/*
+ * Copyright © 2019 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ */
+
+#include <fcntl.h>
+#include "igt_device_scan.h"
+
+void igt_devices_scan(bool force) {
+}
+
+void igt_devices_print(enum igt_devices_print_type printtype) {
+}
+
+void igt_devices_print_vendors(void) {
+}
+
+void igt_device_print_filter_types(void) {
+}
+
+bool igt_device_is_filter_set(void) {
+	return false;
+}
+
+void igt_device_filter_set(const char *filter) {
+}
+
+void igt_device_filter_free(void) {
+}
+
+const char *igt_device_filter_get(void) {
+	return NULL;
+}
+
+bool igt_device_card_match(const char *filter, struct igt_device_card *card) {
+	card->subsystem[0] = '\0';
+	strcpy(card->card, "/dev/dri/card0");
+	strcpy(card->render, "/dev/dri/renderD128");
+	return true;
+}
+
+int igt_open_card(struct igt_device_card *card) {
+	return open(card->card, O_RDWR);
+}
+
+int igt_open_render(struct igt_device_card *card) {
+	return open(card->render, O_RDWR);
+}
diff --git a/lib/meson.build b/lib/meson.build
index 710b89b5..8bf02653 100644
--- a/lib/meson.build
+++ b/lib/meson.build
@@ -10,7 +10,6 @@ lib_sources = [
 	'igt_color_encoding.c',
 	'igt_debugfs.c',
 	'igt_device.c',
-	'igt_device_scan.c',
 	'igt_gt.c',
 	'igt_halffloat.c',
 	'igt_matrix.c',
@@ -67,12 +66,14 @@ lib_sources = [
 if host_machine.system() == 'linux'
 	lib_sources += [
 		'igt_aux.c',
+		'igt_device_scan.c',
 		'igt_kmod.c',
 		'igt_perf.c',
 	]
 else
 	lib_sources += [
 		'igt_aux_null.c',
+		'igt_device_scan_null.c',
 		'igt_kmod_null.c',
 		'igt_perf_null.c',
 	]
-- 
2.23.0



More information about the igt-dev mailing list