intel-gfx.lists.freedesktop.org archive mirror
 help / color / mirror / Atom feed
From: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
To: intel-gfx@lists.freedesktop.org
Cc: Lyude <lyude@redhat.com>
Subject: [PATCH i-g-t 3/5] lib/igt_chamelium: Get rid of async hpd pulse functions
Date: Mon, 26 Jun 2017 10:22:17 +0300	[thread overview]
Message-ID: <20170626072219.2470-3-paul.kocialkowski@linux.intel.com> (raw)
In-Reply-To: <20170626072219.2470-1-paul.kocialkowski@linux.intel.com>

This removes the functions related to async hpd pulse handling, that
were used for hpd toggle during suspend testing. Since the XMLRPC
library does not guarantee that the call will be made before caring
for its result, this function did not work properly.

These functions are deprecated in favor of HPD toggle scheduling, that
was recently added to the Chamelium's XMLRPC API and IGT.

Signed-off-by: Paul Kocialkowski <paul.kocialkowski@linux.intel.com>
---
 lib/igt_chamelium.c | 72 -----------------------------------------------------
 lib/igt_chamelium.h |  4 ---
 2 files changed, 76 deletions(-)

diff --git a/lib/igt_chamelium.c b/lib/igt_chamelium.c
index 523cc853..225f98c3 100644
--- a/lib/igt_chamelium.c
+++ b/lib/igt_chamelium.c
@@ -469,78 +469,6 @@ void chamelium_schedule_hpd_toggle(struct chamelium *chamelium,
 				    "(iii)", port->id, delay_ms, rising_edge));
 }
 
-static void async_rpc_handler(const char *server_url, const char *method_name,
-			      xmlrpc_value *param_array, void *user_data,
-			      xmlrpc_env *fault, xmlrpc_value *result)
-{
-	/* We don't care about the responses */
-}
-
-/**
- * chamelium_async_hpd_pulse_start:
- * @chamelium: The Chamelium instance to use
- * @port: The port to fire the HPD pulses on
- * @high: Whether to fire a high pulse (e.g. simulate a connect), or a low
- * pulse (e.g. simulate a disconnect)
- * @delay_secs: How long to wait before sending the HPD pulse.
- *
- * Instructs the chamelium to send an hpd pulse after @delay_secs seconds have
- * passed, without waiting for the chamelium to finish. This is useful for
- * testing things such as hpd after a suspend/resume cycle, since we can't tell
- * the chamelium to send a hotplug at the same time that our system is
- * suspended.
- *
- * It is required that the user eventually call
- * #chamelium_async_hpd_pulse_finish, to clean up the leftover XML-RPC
- * responses from the chamelium.
- */
-void chamelium_async_hpd_pulse_start(struct chamelium *chamelium,
-				     struct chamelium_port *port,
-				     bool high, int delay_secs)
-{
-	xmlrpc_value *pulse_widths = xmlrpc_array_new(&chamelium->env), *width;
-
-	/* TODO: Actually implement something in the chameleon server to allow
-	 * for delayed actions such as hotplugs. This would work a bit better
-	 * and allow us to test suspend/resume on ports without hpd like VGA
-	 */
-
-	igt_debug("Sending HPD pulse (%s) on %s with %d second delay\n",
-		  high ? "high->low" : "low->high", port->name, delay_secs);
-
-	/* If we're starting at high, make the first pulse width 0 so we keep
-	 * the port connected */
-	if (high) {
-		width = xmlrpc_int_new(&chamelium->env, 0);
-		xmlrpc_array_append_item(&chamelium->env, pulse_widths, width);
-		xmlrpc_DECREF(width);
-	}
-
-	width = xmlrpc_int_new(&chamelium->env, delay_secs * 1000);
-	xmlrpc_array_append_item(&chamelium->env, pulse_widths, width);
-	xmlrpc_DECREF(width);
-
-	xmlrpc_client_start_rpcf(&chamelium->env, chamelium->client,
-				 chamelium->url,
-				 "FireMixedHpdPulses", async_rpc_handler, NULL,
-				 "(iA)", port->id, pulse_widths);
-	xmlrpc_DECREF(pulse_widths);
-}
-
-/**
- * chamelium_async_hpd_pulse_finish:
- * @chamelium: The Chamelium instance to use
- *
- * Waits for any asynchronous RPC started by #chamelium_async_hpd_pulse_start
- * to complete, and then cleans up any leftover responses from the chamelium.
- * If all of the RPC calls have already completed, this function returns
- * immediately.
- */
-void chamelium_async_hpd_pulse_finish(struct chamelium *chamelium)
-{
-	xmlrpc_client_event_loop_finish(chamelium->client);
-}
-
 /**
  * chamelium_new_edid:
  * @chamelium: The Chamelium instance to use
diff --git a/lib/igt_chamelium.h b/lib/igt_chamelium.h
index 408a4b85..81322ad2 100644
--- a/lib/igt_chamelium.h
+++ b/lib/igt_chamelium.h
@@ -64,10 +64,6 @@ void chamelium_fire_hpd_pulses(struct chamelium *chamelium,
 void chamelium_schedule_hpd_toggle(struct chamelium *chamelium,
 				   struct chamelium_port *port, int delay_ms,
 				   bool rising_edge);
-void chamelium_async_hpd_pulse_start(struct chamelium *chamelium,
-				     struct chamelium_port *port,
-				     bool high, int delay_secs);
-void chamelium_async_hpd_pulse_finish(struct chamelium *chamelium);
 int chamelium_new_edid(struct chamelium *chamelium, const unsigned char *edid);
 void chamelium_port_set_edid(struct chamelium *chamelium,
 			     struct chamelium_port *port, int edid_id);
-- 
2.13.1

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  parent reply	other threads:[~2017-06-26  7:23 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-06-26  7:22 [PATCH i-g-t 1/5] lib/igt_chamelium: Add support for HPD toggle scheduling Paul Kocialkowski
2017-06-26  7:22 ` [PATCH i-g-t 2/5] tests/chamelium: Use HPD toggle scheduling instead of async pulses Paul Kocialkowski
2017-06-26  7:22 ` Paul Kocialkowski [this message]
2017-06-26  7:22 ` [PATCH i-g-t 4/5] tests/chamelium: Test HPD toggle after suspend and hibernate for VGA Paul Kocialkowski
2017-06-26  7:22 ` [PATCH i-g-t 5/5] tests/chamelium: Also test VGA for common suspend and hibernate tests Paul Kocialkowski
2017-06-26 21:07 ` [PATCH i-g-t 1/5] lib/igt_chamelium: Add support for HPD toggle scheduling Lyude Paul
2017-06-27  7:25   ` Paul Kocialkowski

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=20170626072219.2470-3-paul.kocialkowski@linux.intel.com \
    --to=paul.kocialkowski@linux.intel.com \
    --cc=intel-gfx@lists.freedesktop.org \
    --cc=lyude@redhat.com \
    /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;
as well as URLs for NNTP newsgroup(s).