All of lore.kernel.org
 help / color / mirror / Atom feed
From: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
To: seanpaul@chromium.org, airlied@linux.ie,
	dri-devel@lists.freedesktop.org, liviu.dudau@arm.com,
	brian.starkey@arm.com, malidp@foss.arm.com,
	maxime.ripard@bootlin.com, maarten.lankhorst@linux.intel.com,
	ayan.halder@arm.com, daniel.vetter@ffwll.ch,
	raymond.smith@arm.com, david.garbett@arm.com, lisa.wu@arm.com,
	matt.szczesiak@arm.com, charles.xu@arm.com,
	james.qian.wang@arm.com
Cc: nd@arm.com, Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
Subject: [PATCH v5 8/9] drm/selftest: Refactor test-drm_plane_helper
Date: Fri, 19 Oct 2018 11:57:51 +0100	[thread overview]
Message-ID: <20181019105752.17741-9-alexandru-cosmin.gheorghe@arm.com> (raw)
In-Reply-To: <20181019105752.17741-1-alexandru-cosmin.gheorghe@arm.com>

The idea is to split test implementations in different compilation
units, but have one single place where we define the list of tests,
in this case(drm_modeset_selftests.h).

Signed-off-by: Alexandru Gheorghe <alexandru-cosmin.gheorghe@arm.com>
---
 ...er_selftests.h => drm_modeset_selftests.h} |  0
 .../drm/selftests/test-drm_modeset_common.c   | 11 ++++++++++-
 .../drm/selftests/test-drm_modeset_common.h   |  2 +-
 .../gpu/drm/selftests/test-drm_plane_helper.c | 19 +------------------
 4 files changed, 12 insertions(+), 20 deletions(-)
 rename drivers/gpu/drm/selftests/{drm_plane_helper_selftests.h => drm_modeset_selftests.h} (100%)

diff --git a/drivers/gpu/drm/selftests/drm_plane_helper_selftests.h b/drivers/gpu/drm/selftests/drm_modeset_selftests.h
similarity index 100%
rename from drivers/gpu/drm/selftests/drm_plane_helper_selftests.h
rename to drivers/gpu/drm/selftests/drm_modeset_selftests.h
diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.c b/drivers/gpu/drm/selftests/test-drm_modeset_common.c
index fad5209043f1..2a7f93774006 100644
--- a/drivers/gpu/drm/selftests/test-drm_modeset_common.c
+++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.c
@@ -7,9 +7,18 @@
 
 #include "test-drm_modeset_common.h"
 
+#define TESTS "drm_modeset_selftests.h"
+#include "drm_selftest.h"
+
+#include "drm_selftest.c"
+
 static int __init test_drm_modeset_init(void)
 {
-	return test_drm_plane_helper();
+	int err;
+
+	err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
+
+	return err > 0 ? 0 : err;
 }
 
 static void __exit test_drm_modeset_exit(void)
diff --git a/drivers/gpu/drm/selftests/test-drm_modeset_common.h b/drivers/gpu/drm/selftests/test-drm_modeset_common.h
index bdeba264661f..b0065a2eb067 100644
--- a/drivers/gpu/drm/selftests/test-drm_modeset_common.h
+++ b/drivers/gpu/drm/selftests/test-drm_modeset_common.h
@@ -13,6 +13,6 @@
 
 #define FAIL_ON(x) FAIL((x), "%s", "FAIL_ON(" __stringify(x) ")\n")
 
-int test_drm_plane_helper(void);
+int igt_check_plane_state(void *ignored);
 
 #endif
diff --git a/drivers/gpu/drm/selftests/test-drm_plane_helper.c b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
index 0dad2f812a27..0a9553f51796 100644
--- a/drivers/gpu/drm/selftests/test-drm_plane_helper.c
+++ b/drivers/gpu/drm/selftests/test-drm_plane_helper.c
@@ -11,9 +11,6 @@
 
 #include "test-drm_modeset_common.h"
 
-#define TESTS "drm_plane_helper_selftests.h"
-#include "drm_selftest.h"
-
 static void set_src(struct drm_plane_state *plane_state,
 		    unsigned src_x, unsigned src_y,
 		    unsigned src_w, unsigned src_h)
@@ -76,7 +73,7 @@ static bool check_crtc_eq(struct drm_plane_state *plane_state,
 	return true;
 }
 
-static int igt_check_plane_state(void *ignored)
+int igt_check_plane_state(void *ignored)
 {
 	int ret;
 
@@ -220,17 +217,3 @@ static int igt_check_plane_state(void *ignored)
 
 	return 0;
 }
-
-#include "drm_selftest.c"
-
-/**
- * test_drm_plane_helper - Run drm plane helper selftests.
- */
-int test_drm_plane_helper(void)
-{
-	int err;
-
-	err = run_selftests(selftests, ARRAY_SIZE(selftests), NULL);
-
-	return err > 0 ? 0 : err;
-}
-- 
2.18.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/dri-devel

  parent reply	other threads:[~2018-10-19 10:58 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-19 10:57 [PATCH v5 0/9] Add method to describe tile/bit_level_packed formats Alexandru Gheorghe
2018-10-19 10:57 ` [PATCH v5 1/9] drm: fourcc: Convert drm_format_info kerneldoc to in-line member documentation Alexandru Gheorghe
2018-10-19 12:54   ` Maxime Ripard
2018-10-22  9:36     ` Alexandru-Cosmin Gheorghe
2018-10-19 10:57 ` [PATCH v5 2/9] drm/fourcc: Add char_per_block, block_w and block_h in drm_format_info Alexandru Gheorghe
2018-10-19 13:09   ` Brian Starkey
2018-10-22 10:07     ` Alexandru-Cosmin Gheorghe
2018-10-19 10:57 ` [PATCH v5 3/9] drm/fourcc: Add fourcc for Mali linear tiled formats Alexandru Gheorghe
2018-10-19 13:12   ` Brian Starkey
2018-10-19 10:57 ` [PATCH v5 4/9] drm: mali-dp: Enable Mali-DP tiled buffer formats Alexandru Gheorghe
2018-10-19 13:17   ` Brian Starkey
2018-10-22 10:08     ` Alexandru-Cosmin Gheorghe
2018-10-19 10:57 ` [PATCH v5 5/9] drm: Extend framebuffer_check to handle formats with cpp/char_per_block 0 Alexandru Gheorghe
2018-10-19 13:21   ` Brian Starkey
2018-10-22 10:09     ` Alexandru-Cosmin Gheorghe
2018-10-19 10:57 ` [PATCH v5 6/9] drm/fourcc: Add AFBC yuv fourccs for Mali Alexandru Gheorghe
2018-10-19 10:57 ` [PATCH v5 7/9] drm/afbc: Add AFBC modifier usage documentation Alexandru Gheorghe
2018-10-19 10:57 ` Alexandru Gheorghe [this message]
2018-10-19 15:14   ` [PATCH v5 8/9] drm/selftest: Refactor test-drm_plane_helper Daniel Vetter
2018-10-22  9:40     ` Alexandru-Cosmin Gheorghe
2018-10-19 10:57 ` [PATCH v5 9/9] drm/selftests: Add tests for drm_format_info* helpers Alexandru Gheorghe
2018-10-19 15:29   ` Daniel Vetter
2018-10-22 10:32     ` Alexandru-Cosmin Gheorghe
2018-10-23 13:56       ` Daniel Vetter

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20181019105752.17741-9-alexandru-cosmin.gheorghe@arm.com \
    --to=alexandru-cosmin.gheorghe@arm.com \
    --cc=airlied@linux.ie \
    --cc=ayan.halder@arm.com \
    --cc=brian.starkey@arm.com \
    --cc=charles.xu@arm.com \
    --cc=daniel.vetter@ffwll.ch \
    --cc=david.garbett@arm.com \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=james.qian.wang@arm.com \
    --cc=lisa.wu@arm.com \
    --cc=liviu.dudau@arm.com \
    --cc=maarten.lankhorst@linux.intel.com \
    --cc=malidp@foss.arm.com \
    --cc=matt.szczesiak@arm.com \
    --cc=maxime.ripard@bootlin.com \
    --cc=nd@arm.com \
    --cc=raymond.smith@arm.com \
    --cc=seanpaul@chromium.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.