Skip to contentSkip to conversation

Analogue/VGA frame comparison support

PATCH In review Paul Kocialkowski 2 participants 4 messages Jul 20, 2017 Library code

lore
Share & tools
lore
#0 lore raw

v4 cover Analogue/VGA frame comparison support

Changes since v3:
* Squashed configure.ac changes in this series

Changes since v2:
* Changed analogue in favor of analog
* Integrated analog frame match fixup in the original commit
* Rebased on top of the new revisions of the series this depends on

Changes since v1:
* Split analogue frame comparison to igt_frame, using cairo surfaces
* Added a chamelium helper for analogue frame checking and frame dumping

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

#1 lore raw

PATCH v4 1/2 lib/igt_frame: Add support for analog frame comparison testing

This adds support for analog frame comparison check, as used in VGA. Since VGA uses a DAC-ADC chain, its data cannot be expected to be pixel perfect. Thus, it is impossible to uses a CRC check and full frames have to be analyzed instead. Such an analysis is implemented, based on both an absolute error threshold and a correlation with the expected error trend for a DAC-ADC chain. It was tested with a couple encoders and provides reliable error detection with few false positives.

---
 configure.ac         |   2 +
 lib/Makefile.am      |   9 ++++
 lib/Makefile.sources |   2 -
 lib/igt_frame.c      | 131 +++++++++++++++++++++++++++++++++++++++++++++++++++
 lib/igt_frame.h      |   2 +
 5 files changed, 144 insertions(+), 2 deletions(-)
configure.ac +2 -0
index 7655df1c..7ea768e2 100644
@@ -181,6 +181,8 @@ PKG_CHECK_MODULES(GLIB, [glib-2.0], [glib=yes], [glib=no])
 if test x"$glib" = xyes; then
 	AC_DEFINE(HAVE_GLIB,1,[Enable glib support])
 fi
+PKG_CHECK_MODULES(GSL, [gsl], [gsl=yes], [gsl=no])
+AM_CONDITIONAL(HAVE_GSL, [test "x$gsl" = xyes])
 
 # for chamelium
 AC_ARG_ENABLE(chamelium, AS_HELP_STRING([--disable-chamelium],
lib/Makefile.am +9 -0
index d4f41128..9c932d6f 100644
@@ -29,12 +29,20 @@ lib_source_list +=	 	\
 	$(NULL)
 endif
 
+if HAVE_GSL
+lib_source_list +=		\
+	igt_frame.c		\
+	igt_frame.h		\
+	$(NULL)
+endif
+
 AM_CPPFLAGS = -I$(top_srcdir)
 AM_CFLAGS = \
 	    $(CWARNFLAGS) \
 	    $(DRM_CFLAGS) \
 	    $(PCIACCESS_CFLAGS) \
 	    $(LIBUNWIND_CFLAGS) \
+	    $(GSL_CFLAGS) \
 	    $(KMOD_CFLAGS) \
 	    $(PROCPS_CFLAGS) \
 	    $(DEBUG_CFLAGS) \
@@ -54,6 +62,7 @@ libintel_tools_la_LIBADD = \
 	$(DRM_LIBS) \
 	$(PCIACCESS_LIBS) \
 	$(PROCPS_LIBS) \
+	$(GSL_LIBS) \
 	$(KMOD_LIBS) \
 	$(CAIRO_LIBS) \
 	$(LIBUDEV_LIBS) \
lib/Makefile.sources +0 -2
index c2e58809..53fdb54c 100644
@@ -83,8 +83,6 @@ lib_source_list =	 	\
 	uwildmat/uwildmat.c	\
 	igt_kmod.c		\
 	igt_kmod.h		\
-	igt_frame.c		\
-	igt_frame.h		\
 	$(NULL)
 
 .PHONY: version.h.tmp
lib/igt_frame.c +131 -0

140 lines not on this page · raw message

lib/igt_frame.h +2 -0
index ec6a1643..1d9bbf6a 100644
@@ -39,5 +39,7 @@ void igt_write_compared_frames_to_png(cairo_surface_t *reference,
 				      cairo_surface_t *capture,
 				      const char *reference_suffix,
 				      const char *capture_suffix);
+bool igt_check_analog_frame_match(cairo_surface_t *reference,
+				  cairo_surface_t *capture);
 
 #endif
Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
#2 lore raw

PATCH v4 2/2 chamelium: Add support for VGA frame comparison testing

In reply to Paul Kocialkowski

This adds support for VGA frame comparison testing with the reference generated from cairo. The retrieved frame from the chamelium is first cropped, as it contains the blanking intervals, through a dedicated helper. Another helper function asserts that the analog frame matches or dump it to png if not.

---
 configure.ac        |   4 ++
 lib/igt_chamelium.c | 164 ++++++++++++++++++++++++++++++++++++++++++++++++++--
 lib/igt_chamelium.h |   7 ++-
 tests/chamelium.c   |  57 ++++++++++++++++++
 4 files changed, 226 insertions(+), 6 deletions(-)
configure.ac +4 -0
index 7ea768e2..dec3e923 100644
@@ -197,6 +197,10 @@ if test "x$enable_chamelium" = xyes; then
 	if test x"$glib" != xyes; then
 		AC_MSG_ERROR([Failed to find glib, required by chamelium. Use --disable-chamelium to disable chamelium support.])
 	fi
+	if test x"$gsl" != xyes; then
+		AC_MSG_ERROR([Failed to find gsl, required by chamelium. Use --disable-chamelium to disable chamelium support.])
+	fi
+
 	AC_DEFINE(HAVE_CHAMELIUM, 1, [Enable Chamelium support])
 fi
 
lib/igt_chamelium.c +159 -5

187 lines not on this page · raw message

lib/igt_chamelium.h +6 -1
index 80afcafa..2a0fa234 100644
@@ -101,7 +101,6 @@ int chamelium_get_captured_frame_count(struct chamelium *chamelium);
 int chamelium_get_frame_limit(struct chamelium *chamelium,
 			      struct chamelium_port *port,
 			      int w, int h);
-
 void chamelium_assert_frame_eq(const struct chamelium *chamelium,
 			       const struct chamelium_frame_dump *dump,
 			       struct igt_fb *fb);
@@ -109,6 +108,12 @@ void chamelium_assert_crc_eq_or_dump(struct chamelium *chamelium,
 				     igt_crc_t *reference_crc,
 				     igt_crc_t *capture_crc, struct igt_fb *fb,
 				     int index);
+void chamelium_assert_analog_frame_match_or_dump(struct chamelium *chamelium,
+						 struct chamelium_port *port,
+						 const struct chamelium_frame_dump *frame,
+						 struct igt_fb *fb);
+void chamelium_crop_analog_frame(struct chamelium_frame_dump *dump, int width,
+				 int height);
 void chamelium_destroy_frame_dump(struct chamelium_frame_dump *dump);
 
 #endif /* IGT_CHAMELIUM_H */
tests/chamelium.c +57 -0

75 lines not on this page · raw message

Signature · 6 lines
2.13.2

_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Reviewed-by on the v4 series
#3 lore raw
In reply to Paul Kocialkowski

For the whole series:

I've also just pushed them, cheers!

Quoted 13 lines · Paul Kocialkowski

Changes since v3:
* Squashed configure.ac changes in this series

Changes since v2:
* Changed analogue in favor of analog
* Integrated analog frame match fixup in the original commit
* Rebased on top of the new revisions of the series this depends on

Changes since v1:
* Split analogue frame comparison to igt_frame, using cairo surfaces
* Added a chamelium helper for analogue frame checking and frame dumping

Signature · 6 lines
Cheers,
	Lyude
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx