Intel-GFX Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Imre Deak <imre.deak@intel.com>
To: intel-gfx@lists.freedesktop.org
Subject: [PATCH 2/4] lib: export the exit handler interface
Date: Wed, 22 May 2013 17:40:46 +0300	[thread overview]
Message-ID: <1369233648-5873-2-git-send-email-imre.deak@intel.com> (raw)
In-Reply-To: <1369233648-5873-1-git-send-email-imre.deak@intel.com>

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 lib/drmtest.c | 7 +++----
 lib/drmtest.h | 6 ++++++
 2 files changed, 9 insertions(+), 4 deletions(-)

diff --git a/lib/drmtest.c b/lib/drmtest.c
index 9fc03a0..16f5be1 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -1022,7 +1022,6 @@ static struct {
 	bool installed;
 } orig_sig[MAX_SIGNALS];
 
-typedef void (*drmtest_exit_handler_t)(int sig);
 static drmtest_exit_handler_t exit_handler_fn[MAX_EXIT_HANDLERS];
 static int exit_handler_count;
 static bool exit_handler_disabled;
@@ -1101,7 +1100,7 @@ static void drmtest_sig_handler(int sig)
  * The handler will be passed the signal number if called due to a signal, or
  * 0 otherwise.
  */
-static int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
+int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
 {
 	int i;
 
@@ -1131,7 +1130,7 @@ err:
 	return -1;
 }
 
-static void drmtest_disable_exit_handler(void)
+void drmtest_disable_exit_handler(void)
 {
 	sigset_t set;
 	int i;
@@ -1151,7 +1150,7 @@ static void drmtest_disable_exit_handler(void)
 	exit_handler_disabled = true;
 }
 
-static void drmtest_enable_exit_handler(void)
+void drmtest_enable_exit_handler(void)
 {
 	if (!exit_handler_disabled)
 		return;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index 6f78102..7202ad5 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -132,4 +132,10 @@ inline static void _do_or_die(const char *function, int line, int ret)
 #define do_or_die(x) _do_or_die(__FUNCTION__, __LINE__, x)
 #define do_ioctl(fd, ptr, sz) do_or_die(drmIoctl((fd), (ptr), (sz)))
 
+typedef void (*drmtest_exit_handler_t)(int sig);
+
+int drmtest_install_exit_handler(drmtest_exit_handler_t fn);
+void drmtest_enable_exit_handler(void);
+void drmtest_disable_exit_handler(void);
+
 int drmtest_set_vt_graphics_mode(void);
-- 
1.8.1.2

  reply	other threads:[~2013-05-22 14:40 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-05-22 14:40 [PATCH 1/4] lib: fix exit handler when multiple handlers are registered Imre Deak
2013-05-22 14:40 ` Imre Deak [this message]
2013-05-22 14:40 ` [PATCH 3/4] kms_flip: do a DPMS ON when exiting with error Imre Deak
2013-05-22 14:40 ` [PATCH 4/4] kms_flip: add subtests for the DPMS OFF->modeset->flip sequence Imre Deak
2013-05-22 16:18   ` 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=1369233648-5873-2-git-send-email-imre.deak@intel.com \
    --to=imre.deak@intel.com \
    --cc=intel-gfx@lists.freedesktop.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox