Skip to contentSkip to conversation

tests: Split helpers into library

PATCH In review Thierry Reding 2 participants 13 messages Dec 9, 2015 – Dec 14, 2015

lore
Share & tools
lore
#0 lore raw

PATCH 1/10 tests: Split helpers into library

From: Thierry Reding <[email protected]>

Some of the helpers, such as the pattern drawing helpers or the format lookup helpers, have potential to be reused. Move them into a separate library to make it easier to share them.

---
 CleanSpec.mk                |   1 +
 configure.ac                |   1 +
 tests/Makefile.am           |   2 +-
 tests/modeprint/Makefile.am |   1 +
 tests/modeprint/modeprint.c |   2 +-
 tests/modetest/Android.mk   |   1 +
 tests/modetest/Makefile.am  |   8 +-
 tests/modetest/buffers.c    | 961 +-------------------------------------------
 tests/modetest/buffers.h    |  12 +-
 tests/modetest/cursor.c     |   4 +-
 tests/modetest/modetest.c   |  25 +-
 tests/proptest/Makefile.am  |   4 +-
 tests/proptest/proptest.c   |   3 +-
 tests/util/Android.mk       |  39 ++
 tests/util/Makefile.am      |  13 +
 tests/util/Makefile.sources |   6 +
 tests/util/common.h         |  33 ++
 tests/util/format.c         | 120 ++++++
 tests/util/format.h         |  65 +++
 tests/util/pattern.c        | 870 +++++++++++++++++++++++++++++++++++++++
 tests/util/pattern.h        |  39 ++
 tests/vbltest/Makefile.am   |   1 +
 tests/vbltest/vbltest.c     |   2 +-
 23 files changed, 1223 insertions(+), 990 deletions(-)
 create mode 100644 tests/util/Android.mk
 create mode 100644 tests/util/Makefile.am
 create mode 100644 tests/util/Makefile.sources
 create mode 100644 tests/util/common.h
 create mode 100644 tests/util/format.c
 create mode 100644 tests/util/format.h
 create mode 100644 tests/util/pattern.c
 create mode 100644 tests/util/pattern.h
CleanSpec.mk +1 -0
index 8e23cd25d26d..28a11db4e7b0 100644
@@ -1,3 +1,4 @@
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/libdrm)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/include/freedreno)
 $(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/SHARED_LIBRARIES/libdrm_*intermediates)
+$(call add-clean-step, rm -rf $(PRODUCT_OUT)/obj/STATIC_LIBRARIES/libdrm_*intermediates)
configure.ac +1 -0
index b929d36a28c5..ca6cbf4eaa62 100644
@@ -507,6 +507,7 @@ AC_CONFIG_FILES([
 	tests/exynos/Makefile
 	tests/tegra/Makefile
 	tests/nouveau/Makefile
+	tests/util/Makefile
 	man/Makefile
 	libdrm.pc])
 AC_OUTPUT
tests/Makefile.am +1 -1
index c53f4af67111..7ffc076f16d7 100644
@@ -1,4 +1,4 @@
-SUBDIRS = modeprint proptest modetest vbltest
+SUBDIRS = util modeprint proptest modetest vbltest
 
 if HAVE_LIBKMS
 SUBDIRS += kmstest
tests/modeprint/Makefile.am +1 -0
index 895805fd32e8..601dbc964290 100644
@@ -1,6 +1,7 @@
 AM_CFLAGS = \
 	$(WARN_CFLAGS)\
 	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)/tests \
 	-I$(top_srcdir)
 
 if HAVE_INSTALL_TESTS
tests/modeprint/modeprint.c +1 -1
index 5e953f71f646..0d854103c5ae 100644
@@ -41,7 +41,7 @@
 #include "xf86drm.h"
 #include "xf86drmMode.h"
 
-#define ARRAY_SIZE(a) (sizeof(a) / sizeof(a[0]))
+#include "util/common.h"
 
 int current;
 int connectors;
tests/modetest/Android.mk +1 -0
index 0fdfe6856bd6..e616558fd690 100644
@@ -8,5 +8,6 @@ LOCAL_SRC_FILES := $(MODETEST_FILES)
 LOCAL_MODULE := modetest
 
 LOCAL_SHARED_LIBRARIES := libdrm
+LOCAL_STATIC_LIBRARIES := libdrm_util
 
 include $(BUILD_EXECUTABLE)
tests/modetest/Makefile.am +3 -5
index 93820fac7395..25ce372fc303 100644
@@ -4,6 +4,7 @@ AM_CFLAGS = $(filter-out -Wpointer-arith, $(WARN_CFLAGS))
 
 AM_CFLAGS += \
 	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)/tests \
 	-I$(top_srcdir)
 
 if HAVE_INSTALL_TESTS
@@ -18,11 +19,8 @@ modetest_SOURCES = $(MODETEST_FILES)
 
 modetest_LDADD = \
 	$(top_builddir)/libdrm.la \
+	$(top_builddir)/tests/util/libutil.la \
+	$(CAIRO_LIBS) \
 	-lpthread
 
-if HAVE_CAIRO
-AM_CFLAGS += $(CAIRO_CFLAGS)
-modetest_LDADD += $(CAIRO_LIBS)
-endif
-
 EXTRA_DIST = Android.mk
tests/modetest/buffers.c +2 -959

985 lines not on this page · raw message

tests/modetest/buffers.h +3 -9
index ad73d0e4ba73..7f95396b4403 100644
@@ -27,20 +27,14 @@
 #ifndef __BUFFERS_H__
 #define __BUFFERS_H__
 
-struct bo;
+#include "util/pattern.h"
 
-enum fill_pattern {
-	PATTERN_TILES = 0,
-	PATTERN_PLAIN = 1,
-	PATTERN_SMPTE = 2,
-};
+struct bo;
 
 struct bo *bo_create(int fd, unsigned int format,
 		   unsigned int width, unsigned int height,
 		   unsigned int handles[4], unsigned int pitches[4],
-		   unsigned int offsets[4], enum fill_pattern pattern);
+		   unsigned int offsets[4], enum util_fill_pattern pattern);
 void bo_destroy(struct bo *bo);
 
-unsigned int format_fourcc(const char *name);
-
 #endif
tests/modetest/cursor.c +2 -2
index d8a19bd2237e..6de82a4a719f 100644
@@ -40,11 +40,11 @@
 #include "xf86drm.h"
 #include "xf86drmMode.h"
 
+#include "util/common.h"
+
 #include "buffers.h"
 #include "cursor.h"
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
-
 struct cursor {
 	int fd;
 	uint32_t bo_handle;
tests/modetest/modetest.c +15 -10
index 3b01918d1adc..361c6da9016f 100644
@@ -37,6 +37,7 @@
  * TODO: use cairo to write the mode info on the selected output once
  *       the mode has been programmed, along with possible test patterns.
  */
+
 #ifdef HAVE_CONFIG_H
 #include "config.h"
 #endif
@@ -59,6 +60,10 @@
 #include "xf86drmMode.h"
 #include "drm_fourcc.h"
 
+#include "util/common.h"
+#include "util/format.h"
+#include "util/pattern.h"
+
 #include "buffers.h"
 #include "cursor.h"
 
@@ -116,7 +121,6 @@ struct device {
 	} mode;
 };
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
 static inline int64_t U642I64(uint64_t val)
 {
 	return (int64_t)*((int64_t *)&val);
@@ -1047,7 +1051,7 @@ static int set_plane(struct device *dev, struct plane_arg *p)
 		p->w, p->h, p->format_str, plane_id);
 
 	plane_bo = bo_create(dev->fd, p->fourcc, p->w, p->h, handles,
-			     pitches, offsets, PATTERN_TILES);
+			     pitches, offsets, UTIL_PATTERN_TILES);
 	if (plane_bo == NULL)
 		return -1;
 
@@ -1123,8 +1127,9 @@ static void set_mode(struct device *dev, struct pipe_arg *pipes, unsigned int co
 			dev->mode.height = pipe->mode->vdisplay;
 	}
 
-	bo = bo_create(dev->fd, pipes[0].fourcc, dev->mode.width, dev->mode.height,
-		       handles, pitches, offsets, PATTERN_SMPTE);
+	bo = bo_create(dev->fd, pipes[0].fourcc, dev->mode.width,
+		       dev->mode.height, handles, pitches, offsets,
+		       UTIL_PATTERN_SMPTE);
 	if (bo == NULL)
 		return;
 
@@ -1202,7 +1207,7 @@ static void set_cursors(struct device *dev, struct pipe_arg *pipes, unsigned int
 	 * translucent alpha
 	 */
 	bo = bo_create(dev->fd, DRM_FORMAT_ARGB8888, cw, ch, handles, pitches,
-		       offsets, PATTERN_PLAIN);
+		       offsets, UTIL_PATTERN_PLAIN);
 	if (bo == NULL)
 		return;
 
@@ -1241,9 +1246,9 @@ static void test_page_flip(struct device *dev, struct pipe_arg *pipes, unsigned
 	unsigned int i;
 	int ret;
 
-	other_bo = bo_create(dev->fd, pipes[0].fourcc,
-			     dev->mode.width, dev->mode.height,
-			     handles, pitches, offsets, PATTERN_PLAIN);
+	other_bo = bo_create(dev->fd, pipes[0].fourcc, dev->mode.width,
+			     dev->mode.height, handles, pitches, offsets,
+			     UTIL_PATTERN_PLAIN);
 	if (other_bo == NULL)
 		return;
 
@@ -1391,7 +1396,7 @@ static int parse_connector(struct pipe_arg *pipe, const char *arg)
 		pipe->format_str[4] = '\0';
 	}
 
-	pipe->fourcc = format_fourcc(pipe->format_str);
+	pipe->fourcc = util_format_fourcc(pipe->format_str);
 	if (pipe->fourcc == 0)  {
 		fprintf(stderr, "unknown format %s\n", pipe->format_str);
 		return -1;
@@ -1444,7 +1449,7 @@ static int parse_plane(struct plane_arg *plane, const char *p)
 		strcpy(plane->format_str, "XR24");
 	}
 
-	plane->fourcc = format_fourcc(plane->format_str);
+	plane->fourcc = util_format_fourcc(plane->format_str);
 	if (plane->fourcc == 0) {
 		fprintf(stderr, "unknown format %s\n", plane->format_str);
 		return -EINVAL;
tests/proptest/Makefile.am +3 -1
index 0594e02e9904..142882066485 100644
@@ -1,6 +1,7 @@
 AM_CFLAGS = \
 	$(WARN_CFLAGS)\
 	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)/tests \
 	-I$(top_srcdir)
 
 if HAVE_INSTALL_TESTS
@@ -14,4 +15,5 @@ endif
 proptest_SOURCES = \
 	proptest.c
 proptest_LDADD = \
-	$(top_builddir)/libdrm.la
+	$(top_builddir)/libdrm.la \
+	$(top_builddir)/tests/util/libutil.la
tests/proptest/proptest.c +2 -1
index b9296bdb6e3b..b6e00cfcfc4f 100644
@@ -35,7 +35,8 @@
 #include "xf86drm.h"
 #include "xf86drmMode.h"
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#include "util/common.h"
+
 static inline int64_t U642I64(uint64_t val)
 {
 	return (int64_t)*((int64_t *)&val);
tests/util/Android.mk new file +39 -0
new file mode 100644
index 000000000000..73bc6805f16c
@@ -0,0 +1,39 @@
+#
+# Copyright © 2015 NVIDIA 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.
+#
+
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_MODULE := libdrm_util
+LOCAL_MODULE_TAGS := optional
+
+LOCAL_SHARED_LIBRARIES := libdrm
+
+LOCAL_SRC_FILES := $(UTIL_FILES)
+
+# avoid name clashes by requiring users to include util/*.h
+LOCAL_EXPORT_C_INCLUDE_DIRS := $(dir $(LOCAL_PATH))
+
+include $(BUILD_STATIC_LIBRARY)
tests/util/Makefile.am new file +13 -0
new file mode 100644
index 000000000000..f8e0b1712cd2
@@ -0,0 +1,13 @@
+include Makefile.sources
+
+noinst_LTLIBRARIES = \
+	libutil.la
+
+libutil_la_CPPFLAGS = \
+	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)
+
+libutil_la_CFLAGS = \
+	$(CAIRO_CFLAGS)
+
+libutil_la_SOURCES = $(UTIL_FILES)
tests/util/Makefile.sources new file +6 -0
new file mode 100644
index 000000000000..e91fa722650f
@@ -0,0 +1,6 @@
+UTIL_FILES := \
+	common.h \
+	format.c \
+	format.h \
+	pattern.c \
+	pattern.h
tests/util/common.h new file +33 -0
new file mode 100644
index 000000000000..5d572c2dd003
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Tungsten Graphics
+ *   Jakob Bornecrantz <[email protected]>
+ * Copyright 2008 Intel Corporation
+ *   Jesse Barnes <[email protected]>
+ *
+ * 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 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 UTIL_COMMON_H
+#define UTIL_COMMON_H
+
+#ifndef ARRAY_SIZE
+#define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))
+#endif
+
+#endif /* UTIL_COMMON_H */
tests/util/format.c new file +120 -0

120 lines not on this page · raw message

tests/util/format.h new file +65 -0

65 lines not on this page · raw message

tests/util/pattern.c new file +870 -0

870 lines not on this page · raw message

tests/util/pattern.h new file +39 -0
new file mode 100644
index 000000000000..d5c4260cc6ed
@@ -0,0 +1,39 @@
+/*
+ * Copyright 2008 Tungsten Graphics
+ *   Jakob Bornecrantz <[email protected]>
+ * Copyright 2008 Intel Corporation
+ *   Jesse Barnes <[email protected]>
+ *
+ * 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 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 UTIL_PATTERN_H
+#define UTIL_PATTERN_H
+
+enum util_fill_pattern {
+	UTIL_PATTERN_TILES,
+	UTIL_PATTERN_PLAIN,
+	UTIL_PATTERN_SMPTE,
+};
+
+void util_fill_pattern(uint32_t format, enum util_fill_pattern pattern,
+		       void *planes[3], unsigned int width,
+		       unsigned int height, unsigned int stride);
+
+#endif /* UTIL_PATTERN_H */
tests/vbltest/Makefile.am +1 -0
index 4d87887a5686..182e3b6d271c 100644
@@ -1,6 +1,7 @@
 AM_CFLAGS = \
 	$(WARN_CFLAGS)\
 	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)/tests \
 	-I$(top_srcdir)
 
 if HAVE_INSTALL_TESTS
tests/vbltest/vbltest.c +1 -1
index e27f45c1b9c1..de93e7702b26 100644
@@ -54,7 +54,7 @@
 #include "xf86drm.h"
 #include "xf86drmMode.h"
 
-#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
+#include "util/common.h"
 
 extern char *optarg;
 extern int optind, opterr, optopt;
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#1 lore raw

PATCH 2/10 tests: Move name tables to libutil

From: Thierry Reding <[email protected]>

These tables are duplicated in several places, so move them into libutil so that they can be shared.

---
 tests/modetest/modetest.c   |  68 +++---------------------
 tests/proptest/proptest.c   |  41 +--------------
 tests/util/Makefile.sources |   2 +
 tests/util/kms.c            | 122 ++++++++++++++++++++++++++++++++++++++++++++
 tests/util/kms.h            |  33 ++++++++++++
 5 files changed, 165 insertions(+), 101 deletions(-)
 create mode 100644 tests/util/kms.c
 create mode 100644 tests/util/kms.h
tests/modetest/modetest.c +6 -62
index 361c6da9016f..0e009d87fdee 100644
@@ -62,6 +62,7 @@
 
 #include "util/common.h"
 #include "util/format.h"
+#include "util/kms.h"
 #include "util/pattern.h"
 
 #include "buffers.h"
@@ -126,64 +127,6 @@ static inline int64_t U642I64(uint64_t val)
 	return (int64_t)*((int64_t *)&val);
 }
 
-struct type_name {
-	int type;
-	const char *name;
-};
-
-#define type_name_fn(res) \
-const char * res##_str(int type) {			\
-	unsigned int i;					\
-	for (i = 0; i < ARRAY_SIZE(res##_names); i++) { \
-		if (res##_names[i].type == type)	\
-			return res##_names[i].name;	\
-	}						\
-	return "(invalid)";				\
-}
-
-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, "DPMST" },
-};
-
-static type_name_fn(encoder_type)
-
-struct type_name connector_status_names[] = {
-	{ DRM_MODE_CONNECTED, "connected" },
-	{ DRM_MODE_DISCONNECTED, "disconnected" },
-	{ DRM_MODE_UNKNOWNCONNECTION, "unknown" },
-};
-
-static type_name_fn(connector_status)
-
-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, "s-video" },
-	{ DRM_MODE_CONNECTOR_LVDS, "LVDS" },
-	{ DRM_MODE_CONNECTOR_Component, "component" },
-	{ DRM_MODE_CONNECTOR_9PinDIN, "9-pin 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" },
-};
-
-static type_name_fn(connector_type)
-
 #define bit_name_fn(res)					\
 const char * res##_str(int type) {				\
 	unsigned int i;						\
@@ -243,7 +186,7 @@ static void dump_encoders(struct device *dev)
 		printf("%d\t%d\t%s\t0x%08x\t0x%08x\n",
 		       encoder->encoder_id,
 		       encoder->crtc_id,
-		       encoder_type_str(encoder->encoder_type),
+		       util_lookup_encoder_type_name(encoder->encoder_type),
 		       encoder->possible_crtcs,
 		       encoder->possible_clones);
 	}
@@ -387,7 +330,7 @@ static void dump_connectors(struct device *dev)
 		printf("%d\t%d\t%s\t%-15s\t%dx%d\t\t%d\t",
 		       connector->connector_id,
 		       connector->encoder_id,
-		       connector_status_str(connector->connection),
+		       util_lookup_connector_status_name(connector->connection),
 		       _connector->name,
 		       connector->mmWidth, connector->mmHeight,
 		       connector->count_modes);
@@ -611,10 +554,11 @@ static struct resources *get_resources(struct device *dev)
 	/* Set the name of all connectors based on the type name and the per-type ID. */
 	for (i = 0; i < res->res->count_connectors; i++) {
 		struct connector *connector = &res->connectors[i];
+		drmModeConnector *conn = connector->connector;
 
 		asprintf(&connector->name, "%s-%u",
-			 connector_type_str(connector->connector->connector_type),
-			 connector->connector->connector_type_id);
+			 util_lookup_connector_type_name(conn->connector_type),
+			 conn->connector_type_id);
 	}
 
 #define get_properties(_res, __res, type, Type)					\
tests/proptest/proptest.c +2 -39

59 lines not on this page · raw message

tests/util/Makefile.sources +2 -0
index e91fa722650f..e5f851136dd4 100644
@@ -2,5 +2,7 @@ UTIL_FILES := \
 	common.h \
 	format.c \
 	format.h \
+	kms.c \
+	kms.h \
 	pattern.c \
 	pattern.h
tests/util/kms.c new file +122 -0

122 lines not on this page · raw message

tests/util/kms.h new file +33 -0
new file mode 100644
index 000000000000..fa9ab69983ac
@@ -0,0 +1,33 @@
+/*
+ * Copyright 2008 Tungsten Graphics
+ *   Jakob Bornecrantz <[email protected]>
+ * Copyright 2008 Intel Corporation
+ *   Jesse Barnes <[email protected]>
+ *
+ * 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 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 UTIL_KMS_H
+#define UTIL_KMS_H
+
+const char *util_lookup_encoder_type_name(unsigned int type);
+const char *util_lookup_connector_status_name(unsigned int type);
+const char *util_lookup_connector_type_name(unsigned int type);
+
+#endif /* UTIL_KMS_H */
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#2 lore raw

PATCH 3/10 proptest: Add Android support

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

---
 tests/proptest/Android.mk       | 13 +++++++++++++
 tests/proptest/Makefile.am      |  6 ++++--
 tests/proptest/Makefile.sources |  2 ++
 3 files changed, 19 insertions(+), 2 deletions(-)
 create mode 100644 tests/proptest/Android.mk
 create mode 100644 tests/proptest/Makefile.sources
tests/proptest/Android.mk new file +13 -0
new file mode 100644
index 000000000000..d0ab5c92775a
@@ -0,0 +1,13 @@
+LOCAL_PATH := $(call my-dir)
+
+include $(CLEAR_VARS)
+include $(LOCAL_PATH)/Makefile.sources
+
+LOCAL_SRC_FILES := $(PROPTEST_FILES)
+
+LOCAL_MODULE := proptest
+
+LOCAL_SHARED_LIBRARIES := libdrm
+LOCAL_STATIC_LIBRARIES := libdrm_util
+
+include $(BUILD_EXECUTABLE)
tests/proptest/Makefile.am +4 -2
index 142882066485..3fde46bececd 100644
@@ -1,3 +1,5 @@
+include Makefile.sources
+
 AM_CFLAGS = \
 	$(WARN_CFLAGS)\
 	-I$(top_srcdir)/include/drm \
@@ -12,8 +14,8 @@ noinst_PROGRAMS = \
 	proptest
 endif
 
-proptest_SOURCES = \
-	proptest.c
+proptest_SOURCES = $(PROPTEST_FILES)
+
 proptest_LDADD = \
 	$(top_builddir)/libdrm.la \
 	$(top_builddir)/tests/util/libutil.la
tests/proptest/Makefile.sources new file +2 -0
new file mode 100644
index 000000000000..446110d685d5
@@ -0,0 +1,2 @@
+PROPTEST_FILES := \
+	proptest.c
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#3 lore raw

PATCH 4/10 tests: Add libkms-test library

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

This library contains abstractions for KMS that help remove the need for a lot of boilerplate in KMS test programs.

---
 configure.ac                        |   1 +
 tests/Makefile.am                   |   2 +-
 tests/kms/Makefile.am               |  20 ++++
 tests/kms/libkms-test-crtc.c        |  47 ++++++++
 tests/kms/libkms-test-device.c      | 218 ++++++++++++++++++++++++++++++++++++
 tests/kms/libkms-test-framebuffer.c | 157 ++++++++++++++++++++++++++
 tests/kms/libkms-test-plane.c       | 139 +++++++++++++++++++++++
 tests/kms/libkms-test-screen.c      |  92 +++++++++++++++
 tests/kms/libkms-test.h             | 120 ++++++++++++++++++++
 9 files changed, 795 insertions(+), 1 deletion(-)
 create mode 100644 tests/kms/Makefile.am
 create mode 100644 tests/kms/libkms-test-crtc.c
 create mode 100644 tests/kms/libkms-test-device.c
 create mode 100644 tests/kms/libkms-test-framebuffer.c
 create mode 100644 tests/kms/libkms-test-plane.c
 create mode 100644 tests/kms/libkms-test-screen.c
 create mode 100644 tests/kms/libkms-test.h
configure.ac +1 -0
index ca6cbf4eaa62..0c66dfc62a4c 100644
@@ -499,6 +499,7 @@ AC_CONFIG_FILES([
 	tests/Makefile
 	tests/modeprint/Makefile
 	tests/modetest/Makefile
+	tests/kms/Makefile
 	tests/kmstest/Makefile
 	tests/proptest/Makefile
 	tests/radeon/Makefile
tests/Makefile.am +1 -1
index 7ffc076f16d7..58feb1236b66 100644
@@ -1,4 +1,4 @@
-SUBDIRS = util modeprint proptest modetest vbltest
+SUBDIRS = util kms modeprint proptest modetest vbltest
 
 if HAVE_LIBKMS
 SUBDIRS += kmstest
tests/kms/Makefile.am new file +20 -0
new file mode 100644
index 000000000000..da4642184504
@@ -0,0 +1,20 @@
+AM_CPPFLAGS = \
+	-I$(top_srcdir)/include/drm \
+	-I$(top_srcdir)/tests \
+	-I$(top_srcdir)
+
+AM_CFLAGS = \
+	$(WARN_CFLAGS)
+
+noinst_LTLIBRARIES = libkms-test.la
+
+libkms_test_la_SOURCES = \
+	libkms-test.h \
+	libkms-test-crtc.c \
+	libkms-test-device.c \
+	libkms-test-framebuffer.c \
+	libkms-test-plane.c \
+	libkms-test-screen.c
+
+libkms_test_la_LIBADD = \
+	$(top_builddir)/libdrm.la
tests/kms/libkms-test-crtc.c new file +47 -0

47 lines not on this page · raw message

tests/kms/libkms-test-device.c new file +218 -0

218 lines not on this page · raw message

tests/kms/libkms-test-framebuffer.c new file +157 -0

157 lines not on this page · raw message

tests/kms/libkms-test-plane.c new file +139 -0

139 lines not on this page · raw message

tests/kms/libkms-test-screen.c new file +92 -0

92 lines not on this page · raw message

tests/kms/libkms-test.h new file +120 -0

120 lines not on this page · raw message

Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#4 lore raw

PATCH 5/10 tests: kms: Implement CRTC stealing test

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

This test program sets a mode and framebuffer on a connector and cycles through all CRTCs, moving the connector to each of them in turn. This is useful to verify that CRTC stealing is properly handled in the DRM core and drivers.

---
 tests/kms/Makefile.am      |  11 ++++
 tests/kms/kms-steal-crtc.c | 161 +++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 172 insertions(+)
 create mode 100644 tests/kms/kms-steal-crtc.c
tests/kms/Makefile.am +11 -0
index da4642184504..f28b729c068c 100644
@@ -18,3 +18,14 @@ libkms_test_la_SOURCES = \
 
 libkms_test_la_LIBADD = \
 	$(top_builddir)/libdrm.la
+
+if HAVE_INSTALL_TESTS
+bin_PROGRAMS = \
+	kms-steal-crtc
+else
+noinst_PROGRAMS = \
+	kms-steal-crtc
+endif
+
+kms_steal_crtc_SOURCES = kms-steal-crtc.c
+kms_steal_crtc_LDADD = libkms-test.la ../util/libutil.la $(CAIRO_LIBS)
tests/kms/kms-steal-crtc.c new file +161 -0

161 lines not on this page · raw message

Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#5 lore raw

PATCH 6/10 tests: kms: Implement universal planes test

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

This small program allows universal planes to be tested. Currently this isn't very flexible because it allows only the first plane of a given type to be tested on the first CRTC. However it should be simple to extend this with some additional command-line arguments.

---
 tests/kms/Makefile.am            |   9 +-
 tests/kms/kms-universal-planes.c | 358 +++++++++++++++++++++++++++++++++++++++
 2 files changed, 365 insertions(+), 2 deletions(-)
 create mode 100644 tests/kms/kms-universal-planes.c
tests/kms/Makefile.am +7 -2
index f28b729c068c..6645af7acae7 100644
@@ -21,11 +21,16 @@ libkms_test_la_LIBADD = \
 
 if HAVE_INSTALL_TESTS
 bin_PROGRAMS = \
-	kms-steal-crtc
+	kms-steal-crtc \
+	kms-universal-planes
 else
 noinst_PROGRAMS = \
-	kms-steal-crtc
+	kms-steal-crtc \
+	kms-universal-planes
 endif
 
 kms_steal_crtc_SOURCES = kms-steal-crtc.c
 kms_steal_crtc_LDADD = libkms-test.la ../util/libutil.la $(CAIRO_LIBS)
+
+kms_universal_planes_SOURCES = kms-universal-planes.c
+kms_universal_planes_LDADD = libkms-test.la $(CAIRO_LIBS)
tests/kms/kms-universal-planes.c new file +358 -0

358 lines not on this page · raw message

Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#6 lore raw

PATCH 7/10 tests: Add helper to open a device/module

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

The new function util_open() encapsulates the standard method employed by tests to open a device or module. There is a verbatim copy of this in almost all test programs, with slight variations in the list of modules. Moving this code into a common helper allows code reuse and makes tests more consistent.

---
 tests/util/kms.c | 55 +++++++++++++++++++++++++++++++++++++++++++++++++++++++
 tests/util/kms.h |  2 ++
 2 files changed, 57 insertions(+)
tests/util/kms.c +55 -0
index 687b3c3c1cf3..57b0191b2655 100644
@@ -41,9 +41,13 @@
 #include "config.h"
 #endif
 
+#include <errno.h>
 #include <stdint.h>
+#include <stdio.h>
 #include <stdlib.h>
+#include <string.h>
 
+#include "xf86drm.h"
 #include "xf86drmMode.h"
 
 #include "common.h"
@@ -120,3 +124,54 @@ const char *util_lookup_connector_type_name(unsigned int type)
 	return util_lookup_type_name(type, connector_type_names,
 				     ARRAY_SIZE(connector_type_names));
 }
+
+static const char * const modules[] = {
+	"i915",
+	"radeon",
+	"nouveau",
+	"vmwgfx",
+	"omapdrm",
+	"exynos",
+	"tilcdc",
+	"msm",
+	"sti",
+	"tegra",
+	"imx-drm",
+	"rockchip",
+	"atmel-hlcdc",
+};
+
+int util_open(const char *device, const char *module)
+{
+	int fd;
+
+	if (module) {
+		fd = drmOpen(module, device);
+		if (fd < 0) {
+			fprintf(stderr, "failed to open device '%s': %s\n",
+				module, strerror(errno));
+			return -errno;
+		}
+	} else {
+		unsigned int i;
+
+		for (i = 0; i < ARRAY_SIZE(modules); i++) {
+			printf("trying to open device '%s'...", modules[i]);
+
+			fd = drmOpen(modules[i], device);
+			if (fd < 0) {
+				printf("failed\n");
+			} else {
+				printf("done\n");
+				break;
+			}
+		}
+
+		if (fd < 0) {
+			fprintf(stderr, "no device found\n");
+			return -ENODEV;
+		}
+	}
+
+	return fd;
+}
tests/util/kms.h +2 -0
index fa9ab69983ac..dde2ed2c5636 100644
@@ -30,4 +30,6 @@ const char *util_lookup_encoder_type_name(unsigned int type);
 const char *util_lookup_connector_status_name(unsigned int type);
 const char *util_lookup_connector_type_name(unsigned int type);
 
+int util_open(const char *device, const char *module);
+
 #endif /* UTIL_KMS_H */
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#7 lore raw

PATCH 8/10 modetest: Use util_open()

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Use the new util_open() helper instead of open-coding the method for finding a usable device.

---
 tests/modetest/modetest.c | 27 +++------------------------
 1 file changed, 3 insertions(+), 24 deletions(-)
tests/modetest/modetest.c +3 -24
index 0e009d87fdee..22e3e81bd3cc 100644
@@ -1503,7 +1503,6 @@ int main(int argc, char **argv)
 	int drop_master = 0;
 	int test_vsync = 0;
 	int test_cursor = 0;
-	const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "exynos", "tilcdc", "msm", "sti", "tegra", "imx-drm", "rockchip", "atmel-hlcdc" };
 	char *device = NULL;
 	char *module = NULL;
 	unsigned int i;
@@ -1604,29 +1603,9 @@ int main(int argc, char **argv)
 	if (!args)
 		encoders = connectors = crtcs = planes = framebuffers = 1;
 
-	if (module) {
-		dev.fd = drmOpen(module, device);
-		if (dev.fd < 0) {
-			fprintf(stderr, "failed to open device '%s'.\n", module);
-			return 1;
-		}
-	} else {
-		for (i = 0; i < ARRAY_SIZE(modules); i++) {
-			printf("trying to open device '%s'...", modules[i]);
-			dev.fd = drmOpen(modules[i], device);
-			if (dev.fd < 0) {
-				printf("failed.\n");
-			} else {
-				printf("success.\n");
-				break;
-			}
-		}
-
-		if (dev.fd < 0) {
-			fprintf(stderr, "no device found.\n");
-			return 1;
-		}
-	}
+	dev.fd = util_open(module, device);
+	if (dev.fd < 0)
+		return -1;
 
 	if (test_vsync && !page_flipping_supported()) {
 		fprintf(stderr, "page flipping not supported by drm.\n");
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#8 lore raw

PATCH 9/10 proptest: Use util_open()

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Use the new util_open() helper instead of open-coding the method for finding a usable device. While at it, make the command-line interface more consistent with that of modetest by adding the -D and -M options.

---
 tests/proptest/proptest.c | 60 ++++++++++++++++++++++++++++++-----------------
 1 file changed, 38 insertions(+), 22 deletions(-)
tests/proptest/proptest.c +38 -22
index 11eb6e88cef5..24c634569f2f 100644
@@ -27,6 +27,7 @@
 
 #include <assert.h>
 #include <errno.h>
+#include <getopt.h>
 #include <inttypes.h>
 #include <stdlib.h>
 #include <stdio.h>
@@ -232,28 +233,32 @@ static int setProperty(char *argv[])
 	uint32_t obj_id, obj_type, prop_id;
 	uint64_t value;
 
-	obj_id = atoi(argv[1]);
+	obj_id = atoi(argv[0]);
 
-	if (!strcmp(argv[2], "connector")) {
+	if (!strcmp(argv[1], "connector")) {
 		obj_type = DRM_MODE_OBJECT_CONNECTOR;
-	} else if (!strcmp(argv[2], "crtc")) {
+	} else if (!strcmp(argv[1], "crtc")) {
 		obj_type = DRM_MODE_OBJECT_CRTC;
 	} else {
 		fprintf(stderr, "Invalid object type.\n");
 		return 1;
 	}
 
-	prop_id = atoi(argv[3]);
-	value = atoll(argv[4]);
+	prop_id = atoi(argv[2]);
+	value = atoll(argv[3]);
 
 	return drmModeObjectSetProperty(fd, obj_id, obj_type, prop_id, value);
 }
 
-static void printUsage(void)
+static void usage(const char *program)
 {
 	printf("Usage:\n"
-"  proptest\n"
-"  proptest [obj id] [obj type] [prop id] [value]\n"
+"  %s [options]\n"
+"  %s [options] [obj id] [obj type] [prop id] [value]\n"
+"\n"
+"options:\n"
+"  -D DEVICE  use the given device\n"
+"  -M MODULE  use the given driver\n"
 "\n"
 "The first form just prints all the existing properties. The second one is\n"
 "used to set the value of a specified property. The object type can be one of\n"
@@ -262,26 +267,37 @@ static void printUsage(void)
 "\n"
 "Example:\n"
 "  proptest 7 connector 2 1\n"
-"will set property 2 of connector 7 to 1\n");
+"will set property 2 of connector 7 to 1\n", program, program);
 }
 
 int main(int argc, char *argv[])
 {
-	const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "omapdrm", "msm", "rockchip" };
-	unsigned int i, ret = 0;
+	static const char optstr[] = "D:M:";
+	int c, args, ret = 0;
+	char *device = NULL;
+	char *module = NULL;
+
+	while ((c = getopt(argc, argv, optstr)) != -1) {
+		switch (c) {
+		case 'D':
+			device = optarg;
+			break;
+
+		case 'M':
+			module = optarg;
+			break;
 
-	for (i = 0; i < ARRAY_SIZE(modules); i++){
-		fd = drmOpen(modules[i], NULL);
-		if (fd >= 0) {
-			printf("Module %s loaded.\n", modules[i]);
+		default:
+			usage(argv[0]);
 			break;
 		}
 	}
 
-	if (i == ARRAY_SIZE(modules)) {
-		fprintf(stderr, "Failed to load drm modules.\n");
+	args = argc - optind;
+
+	fd = util_open(module, device);
+	if (fd < 0)
 		return 1;
-	}
 
 	res = drmModeGetResources(fd);
 	if (!res) {
@@ -291,12 +307,12 @@ int main(int argc, char *argv[])
 		goto done;
 	}
 
-	if (argc < 2) {
+	if (args < 1) {
 		listAllProperties();
-	} else if (argc == 5) {
-		ret = setProperty(argv);
+	} else if (args == 4) {
+		ret = setProperty(&argv[optind]);
 	} else {
-		printUsage();
+		usage(argv[0]);
 		ret = 1;
 	}
 
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#9 lore raw

PATCH 10/10 vbltest: Use util_open()

In reply to Thierry Reding

From: Thierry Reding <[email protected]>

Use the new util_open() helper instead of open-coding the method for finding a usable device. While at it, this adds -D and -M command-line options to vbltest to make its usage more consistent with its siblings modetest and proptest.

---
 tests/vbltest/Makefile.am |  3 ++-
 tests/vbltest/vbltest.c   | 38 ++++++++++++++++++--------------------
 2 files changed, 20 insertions(+), 21 deletions(-)
tests/vbltest/Makefile.am +2 -1
index 182e3b6d271c..276afad55716 100644
@@ -15,4 +15,5 @@ endif
 vbltest_SOURCES = \
 	vbltest.c
 vbltest_LDADD = \
-	$(top_builddir)/libdrm.la
+	$(top_builddir)/libdrm.la \
+	$(top_builddir)/tests/util/libutil.la
tests/vbltest/vbltest.c +18 -20
index de93e7702b26..60badf1174de 100644
@@ -55,10 +55,11 @@
 #include "xf86drmMode.h"
 
 #include "util/common.h"
+#include "util/kms.h"
 
 extern char *optarg;
 extern int optind, opterr, optopt;
-static char optstr[] = "s";
+static char optstr[] = "D:M:s";
 
 int secondary = 0;
 
@@ -97,16 +98,19 @@ static void vblank_handler(int fd, unsigned int frame, unsigned int sec,
 
 static void usage(char *name)
 {
-	fprintf(stderr, "usage: %s [-s]\n", name);
-	fprintf(stderr, "\t-s\tuse secondary pipe\n");
+	fprintf(stderr, "usage: %s [-DMs]\n", name);
+	fprintf(stderr, "\n");
+	fprintf(stderr, "options:\n");
+	fprintf(stderr, "  -D DEVICE  open the given device\n");
+	fprintf(stderr, "  -M MODULE  open the given module\n");
+	fprintf(stderr, "  -s         use secondary pipe\n");
 	exit(0);
 }
 
 int main(int argc, char **argv)
 {
-	unsigned i;
+	const char *device = NULL, *module = NULL;
 	int c, fd, ret;
-	const char *modules[] = { "i915", "radeon", "nouveau", "vmwgfx", "exynos", "omapdrm", "tilcdc", "msm", "tegra", "imx-drm" , "rockchip" };
 	drmVBlank vbl;
 	drmEventContext evctx;
 	struct vbl_info handler_info;
@@ -114,6 +118,12 @@ int main(int argc, char **argv)
 	opterr = 0;
 	while ((c = getopt(argc, argv, optstr)) != -1) {
 		switch (c) {
+		case 'D':
+			device = optarg;
+			break;
+		case 'M':
+			module = optarg;
+			break;
 		case 's':
 			secondary = 1;
 			break;
@@ -123,21 +133,9 @@ int main(int argc, char **argv)
 		}
 	}
 
-	for (i = 0; i < ARRAY_SIZE(modules); i++) {
-		printf("trying to load module %s...", modules[i]);
-		fd = drmOpen(modules[i], NULL);
-		if (fd < 0) {
-			printf("failed.\n");
-		} else {
-			printf("success.\n");
-			break;
-		}
-	}
-
-	if (i == ARRAY_SIZE(modules)) {
-		fprintf(stderr, "failed to load any modules, aborting.\n");
-		return -1;
-	}
+	fd = util_open(module, device);
+	if (fd < 0)
+		return 1;
 
 	/* Get current count first */
 	vbl.request.type = DRM_VBLANK_RELATIVE;
Signature · 6 lines
2.5.0

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel
#10 lore raw
In reply to Thierry Reding

Hi Thierry, all,

Quoted 33 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Some of the helpers, such as the pattern drawing helpers or the format lookup helpers, have potential to be reused. Move them into a separate library to make it easier to share them.

---
 CleanSpec.mk                |   1 +
 configure.ac                |   1 +
 tests/Makefile.am           |   2 +-
 tests/modeprint/Makefile.am |   1 +
 tests/modeprint/modeprint.c |   2 +-
 tests/modetest/Android.mk   |   1 +
 tests/modetest/Makefile.am  |   8 +-
 tests/modetest/buffers.c    | 961 +-------------------------------------------
 tests/modetest/buffers.h    |  12 +-
 tests/modetest/cursor.c     |   4 +-
 tests/modetest/modetest.c   |  25 +-
 tests/proptest/Makefile.am  |   4 +-
 tests/proptest/proptest.c   |   3 +-
 tests/util/Android.mk       |  39 ++
 tests/util/Makefile.am      |  13 +
 tests/util/Makefile.sources |   6 +
 tests/util/common.h         |  33 ++
 tests/util/format.c         | 120 ++++++
 tests/util/format.h         |  65 +++
 tests/util/pattern.c        | 870 +++++++++++++++++++++++++++++++++++++++
 tests/util/pattern.h        |  39 ++
 tests/vbltest/Makefile.am   |   1 +
 tests/vbltest/vbltest.c     |   2 +-
 23 files changed, 1223 insertions(+), 990 deletions(-)
Quoted 9 lines
 create mode 100644 tests/util/Android.mk
 create mode 100644 tests/util/Makefile.am
 create mode 100644 tests/util/Makefile.sources
 create mode 100644 tests/util/common.h
 create mode 100644 tests/util/format.c
 create mode 100644 tests/util/format.h
 create mode 100644 tests/util/pattern.c
 create mode 100644 tests/util/pattern.h

As mentioned on IRC, although there might be some minor nitpicks I'd rather the series in those in and fix them later. Mostly to avoid the long gap until you get the chance to respin things, but also to spare Tomi (and others) the need to reinvent them :-)

So barring any serious objections, I'd vote for getting these soonish. Perhaps mid next week ?

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#11 lore raw
Quoted 45 lines · Emil Velikov

Hi Thierry, all,

Quoted 33 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Some of the helpers, such as the pattern drawing helpers or the format lookup helpers, have potential to be reused. Move them into a separate library to make it easier to share them.

---
 CleanSpec.mk                |   1 +
 configure.ac                |   1 +
 tests/Makefile.am           |   2 +-
 tests/modeprint/Makefile.am |   1 +
 tests/modeprint/modeprint.c |   2 +-
 tests/modetest/Android.mk   |   1 +
 tests/modetest/Makefile.am  |   8 +-
 tests/modetest/buffers.c    | 961 +-------------------------------------------
 tests/modetest/buffers.h    |  12 +-
 tests/modetest/cursor.c     |   4 +-
 tests/modetest/modetest.c   |  25 +-
 tests/proptest/Makefile.am  |   4 +-
 tests/proptest/proptest.c   |   3 +-
 tests/util/Android.mk       |  39 ++
 tests/util/Makefile.am      |  13 +
 tests/util/Makefile.sources |   6 +
 tests/util/common.h         |  33 ++
 tests/util/format.c         | 120 ++++++
 tests/util/format.h         |  65 +++
 tests/util/pattern.c        | 870 +++++++++++++++++++++++++++++++++++++++
 tests/util/pattern.h        |  39 ++
 tests/vbltest/Makefile.am   |   1 +
 tests/vbltest/vbltest.c     |   2 +-
 23 files changed, 1223 insertions(+), 990 deletions(-)
Quoted 9 lines
 create mode 100644 tests/util/Android.mk
 create mode 100644 tests/util/Makefile.am
 create mode 100644 tests/util/Makefile.sources
 create mode 100644 tests/util/common.h
 create mode 100644 tests/util/format.c
 create mode 100644 tests/util/format.h
 create mode 100644 tests/util/pattern.c
 create mode 100644 tests/util/pattern.h
Quoted 4 lines

As mentioned on IRC, although there might be some minor nitpicks I'd rather the series in those in and fix them later. Mostly to avoid the long gap until you get the chance to respin things, but also to spare Tomi (and others) the need to reinvent them :-)

I don't mind doing another round if you point out the nitpicks. I'm hopeful that I'll get around to respinning sooner this time. =)

Thierry

_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel

#12 lore raw
Quoted 46 lines · Thierry Reding
Quoted 45 lines · Emil Velikov

Hi Thierry, all,

Quoted 42 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Some of the helpers, such as the pattern drawing helpers or the format lookup helpers, have potential to be reused. Move them into a separate library to make it easier to share them.

---
 CleanSpec.mk                |   1 +
 configure.ac                |   1 +
 tests/Makefile.am           |   2 +-
 tests/modeprint/Makefile.am |   1 +
 tests/modeprint/modeprint.c |   2 +-
 tests/modetest/Android.mk   |   1 +
 tests/modetest/Makefile.am  |   8 +-
 tests/modetest/buffers.c    | 961 +-------------------------------------------
 tests/modetest/buffers.h    |  12 +-
 tests/modetest/cursor.c     |   4 +-
 tests/modetest/modetest.c   |  25 +-
 tests/proptest/Makefile.am  |   4 +-
 tests/proptest/proptest.c   |   3 +-
 tests/util/Android.mk       |  39 ++
 tests/util/Makefile.am      |  13 +
 tests/util/Makefile.sources |   6 +
 tests/util/common.h         |  33 ++
 tests/util/format.c         | 120 ++++++
 tests/util/format.h         |  65 +++
 tests/util/pattern.c        | 870 +++++++++++++++++++++++++++++++++++++++
 tests/util/pattern.h        |  39 ++
 tests/vbltest/Makefile.am   |   1 +
 tests/vbltest/vbltest.c     |   2 +-
 23 files changed, 1223 insertions(+), 990 deletions(-)
 create mode 100644 tests/util/Android.mk
 create mode 100644 tests/util/Makefile.am
 create mode 100644 tests/util/Makefile.sources
 create mode 100644 tests/util/common.h
 create mode 100644 tests/util/format.c
 create mode 100644 tests/util/format.h
 create mode 100644 tests/util/pattern.c
 create mode 100644 tests/util/pattern.h
Quoted 8 lines
Quoted 4 lines

As mentioned on IRC, although there might be some minor nitpicks I'd rather the series in those in and fix them later. Mostly to avoid the long gap until you get the chance to respin things, but also to spare Tomi (and others) the need to reinvent them :-)

I don't mind doing another round if you point out the nitpicks. I'm hopeful that I'll get around to respinning sooner this time. =)

The only thing that I've noticed was a lack of teardown in most/all error paths. Which is ... both very low priority and almost impossible to get right/test. If you want to sort those, but all means please do. Alternatively we'll get them some day ;-)

Thanks
Emil
_______________________________________________
dri-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/dri-devel