[Intel-gfx] [PATCH 08/12] lib: fold igt_display into igt_kms

Daniel Vetter daniel.vetter at ffwll.ch
Wed Mar 26 17:15:51 CET 2014


For 1 function and 2 types we kinda don't need separate files.
Especially now that igt_kms is much more focused on the actual modeset
stuff with all the framebuffer helpers extracted to igt_fb.

Signed-off-by: Daniel Vetter <daniel.vetter at ffwll.ch>
---
 .../intel-gpu-tools/intel-gpu-tools-docs.xml       |  1 -
 lib/Makefile.sources                               |  2 -
 lib/igt_debugfs.c                                  |  2 +-
 lib/igt_display.c                                  | 41 ---------------
 lib/igt_display.h                                  | 61 ----------------------
 lib/igt_kms.c                                      | 13 +++++
 lib/igt_kms.h                                      | 34 +++++++++++-
 7 files changed, 47 insertions(+), 107 deletions(-)
 delete mode 100644 lib/igt_display.c
 delete mode 100644 lib/igt_display.h

diff --git a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml
index bd8294e5fd1e..1dafe6c2a7dc 100644
--- a/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml
+++ b/docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml
@@ -18,7 +18,6 @@
     <xi:include href="xml/drmtest.xml"/>
     <xi:include href="xml/igt_core.xml"/>
     <xi:include href="xml/igt_debugfs.xml"/>
-    <xi:include href="xml/igt_display.xml"/>
     <xi:include href="xml/igt_kms.xml"/>
     <xi:include href="xml/igt_aux.xml"/>
     <xi:include href="xml/ioctl_wrappers.xml"/>
diff --git a/lib/Makefile.sources b/lib/Makefile.sources
index f0f411dc2147..62a0c758160f 100644
--- a/lib/Makefile.sources
+++ b/lib/Makefile.sources
@@ -8,8 +8,6 @@ libintel_tools_la_SOURCES = 	\
 	i915_pciids.h		\
 	igt_debugfs.c		\
 	igt_debugfs.h		\
-	igt_display.c		\
-	igt_display.h		\
 	igt_aux.c		\
 	igt_aux.h		\
 	instdone.c		\
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index e04f8c5b9837..81a06ff34c6c 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -33,7 +33,7 @@
 #include <unistd.h>
 
 #include "drmtest.h"
-#include "igt_display.h"
+#include "igt_kms.h"
 #include "igt_debugfs.h"
 
 /**
diff --git a/lib/igt_display.c b/lib/igt_display.c
deleted file mode 100644
index 28e21e69eb57..000000000000
--- a/lib/igt_display.c
+++ /dev/null
@@ -1,41 +0,0 @@
-/*
- * Copyright © 2013 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 <string.h>
-
-#include "drmtest.h"
-#include "igt_display.h"
-
-void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
-{
-	drmVBlank wait_vbl;
-
-	memset(&wait_vbl, 0, sizeof(wait_vbl));
-
-	wait_vbl.request.type = pipe << DRM_VBLANK_HIGH_CRTC_SHIFT |
-				DRM_VBLANK_RELATIVE;
-	wait_vbl.request.sequence = 1;
-
-	igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0);
-}
diff --git a/lib/igt_display.h b/lib/igt_display.h
deleted file mode 100644
index 77a75a7005b3..000000000000
--- a/lib/igt_display.h
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright © 2013 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.
- *
- */
-
-#ifndef __IGT_DISPLAY_H__
-#define __IGT_DISPLAY_H__
-
-enum pipe {
-        PIPE_A = 0,
-        PIPE_B,
-        PIPE_C,
-        I915_MAX_PIPES
-};
-#define pipe_name(p) ((p) + 'A')
-
-/* We namespace this enum to not conflict with the Android i915_drm.h */
-enum igt_plane {
-        IGT_PLANE_1 = 0,
-        IGT_PLANE_PRIMARY = IGT_PLANE_1,
-        IGT_PLANE_2,
-        IGT_PLANE_3,
-        IGT_PLANE_CURSOR,
-};
-
-const char *plane_name(enum igt_plane p);
-
-#define sprite_name(p, s) ((p) * dev_priv->num_plane + (s) + 'A')
-
-enum port {
-        PORT_A = 0,
-        PORT_B,
-        PORT_C,
-        PORT_D,
-        PORT_E,
-        I915_MAX_PORTS
-};
-#define port_name(p) ((p) + 'A')
-
-void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
-
-#endif /* __IGT_DISPLAY_H__ */
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 1d4bad4535c7..678cf391234c 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -993,3 +993,16 @@ void igt_plane_set_position(igt_plane_t *plane, int x, int y)
 
 	plane->position_changed = true;
 }
+
+void igt_wait_for_vblank(int drm_fd, enum pipe pipe)
+{
+	drmVBlank wait_vbl;
+
+	memset(&wait_vbl, 0, sizeof(wait_vbl));
+
+	wait_vbl.request.type = pipe << DRM_VBLANK_HIGH_CRTC_SHIFT |
+				DRM_VBLANK_RELATIVE;
+	wait_vbl.request.sequence = 1;
+
+	igt_assert(drmWaitVBlank(drm_fd, &wait_vbl) == 0);
+}
diff --git a/lib/igt_kms.h b/lib/igt_kms.h
index 1ba7d9bc7021..439a6346f352 100644
--- a/lib/igt_kms.h
+++ b/lib/igt_kms.h
@@ -33,7 +33,37 @@
 
 #include <xf86drmMode.h>
 
-#include "igt_display.h"
+enum pipe {
+        PIPE_A = 0,
+        PIPE_B,
+        PIPE_C,
+        I915_MAX_PIPES
+};
+#define pipe_name(p) ((p) + 'A')
+
+/* We namespace this enum to not conflict with the Android i915_drm.h */
+enum igt_plane {
+        IGT_PLANE_1 = 0,
+        IGT_PLANE_PRIMARY = IGT_PLANE_1,
+        IGT_PLANE_2,
+        IGT_PLANE_3,
+        IGT_PLANE_CURSOR,
+};
+
+const char *plane_name(enum igt_plane p);
+
+#define sprite_name(p, s) ((p) * dev_priv->num_plane + (s) + 'A')
+
+enum port {
+        PORT_A = 0,
+        PORT_B,
+        PORT_C,
+        PORT_D,
+        PORT_E,
+        I915_MAX_PORTS
+};
+#define port_name(p) ((p) + 'A')
+
 #include "igt_fb.h"
 
 struct kmstest_connector_config {
@@ -130,6 +160,8 @@ igt_plane_t *igt_output_get_plane(igt_output_t *output, enum igt_plane plane);
 void igt_plane_set_fb(igt_plane_t *plane, struct igt_fb *fb);
 void igt_plane_set_position(igt_plane_t *plane, int x, int y);
 
+void igt_wait_for_vblank(int drm_fd, enum pipe pipe);
+
 #define for_each_connected_output(display, output)		\
 	for (int i__ = 0;  i__ < (display)->n_outputs; i__++)	\
 		if ((output = &(display)->outputs[i__]), output->valid)
-- 
1.8.5.2




More information about the Intel-gfx mailing list