tests/modetest: Add modetest_atomic tool
PATCH v2 1/1 tests/modetest: Add modetest_atomic tool
This is a modetest like tool but using atomic API.
Unlike modetest it becomes mandatory to specify a mode ("-s") and a plane ("-P") to display a pattern on screen.
This version of modetest_atomic doesn't offer cursor support ("-C" argument has been removed).
Test the frame rate ("-v") it does a loop and swap between two framebuffer for each active planes and not using pageflip event like done in modetest.
---
The code is based on modetest and keep most of it infrastructure like arguments parsing, finding properties id from their name, resources dumping or the general way of working.
It duplicates modetest code but adding compilation flags or conditional tests everywhere in modetest would have made it more complex and unreadable.
Creating modetest_atomic could allow to test atomic API without need to use "big" frameworks like weston, drm_hwcomposer or igt with all their dependencies.
kmscube could also be used to test atomic API but it need EGL.
It have been tested (only) on stm driver with one or two planes actived.
change in version 2:
- make modetest_atomci compile with meson and Android
tests/modetest/Android.mk | 13 + tests/modetest/Makefile.am | 13 +- tests/modetest/Makefile.sources | 7 + tests/modetest/meson.build | 10 + tests/modetest/modetest_atomic.c | 1546 ++++++++++++++++++++++++++++++++++++++ 5 files changed, 1587 insertions(+), 2 deletions(-) create mode 100644 tests/modetest/modetest_atomic.c
tests/modetest/Android.mk +13 -0
@@ -12,3 +12,16 @@ LOCAL_STATIC_LIBRARIES := libdrm_util include $(LIBDRM_COMMON_MK) include $(BUILD_EXECUTABLE) + +include $(CLEAR_VARS) +include $(LOCAL_PATH)/Makefile.sources + +LOCAL_SRC_FILES := $(MODETEST_ATOMIC_FILES) + +LOCAL_MODULE := modetest_atomic + +LOCAL_SHARED_LIBRARIES := libdrm +LOCAL_STATIC_LIBRARIES := libdrm_util + +include $(LIBDRM_COMMON_MK) +include $(BUILD_EXECUTABLE)
tests/modetest/Makefile.am +11 -2
@@ -10,10 +10,12 @@ AM_CFLAGS += \ if HAVE_INSTALL_TESTS bin_PROGRAMS = \ - modetest + modetest \ + modetest_atomic else noinst_PROGRAMS = \ - modetest + modetest \ + modetest_atomic endif modetest_SOURCES = $(MODETEST_FILES)
@@ -22,3 +24,10 @@ modetest_LDADD = \ $(top_builddir)/libdrm.la \ $(top_builddir)/tests/util/libutil.la \ $(CAIRO_LIBS) + +modetest_atomic_SOURCES = $(MODETEST_ATOMIC_FILES) + +modetest_atomic_LDADD = \ + $(top_builddir)/libdrm.la \ + $(top_builddir)/tests/util/libutil.la \ + $(CAIRO_LIBS)
tests/modetest/Makefile.sources +7 -0
@@ -4,3 +4,10 @@ MODETEST_FILES := \ cursor.c \ cursor.h \ modetest.c + +MODETEST_ATOMIC_FILES := \ + buffers.c \ + buffers.h \ + cursor.c \ + cursor.h \ + modetest_atomic.c
tests/modetest/meson.build +10 -0
@@ -27,3 +27,13 @@ modetest = executable( link_with : [libdrm, libutil], install : with_install_tests, ) + +modetest_atomic = executable( + 'modetest_atomic', + files('buffers.c', 'cursor.c', 'modetest_atomic.c'), + c_args : [warn_c_args, '-Wno-pointer-arith'], + include_directories : [inc_root, inc_tests, inc_drm], + dependencies : [dep_threads, dep_cairo], + link_with : [libdrm, libutil], + install : with_install_tests, +)
tests/modetest/modetest_atomic.c new file +1546 -0
1,546 lines not on this page · raw message
Signature · 6 lines
2.15.0 _______________________________________________ dri-devel mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/dri-devel