From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Cc: igt-dev@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH i-g-t 3/4] tests/kms_psr_sink_crc: Test PSR source HW status before PSR entry.
Date: Thu, 12 Jul 2018 16:20:45 -0700 [thread overview]
Message-ID: <20180712232045.GI2208@intel.com> (raw)
In-Reply-To: <20180712080943.8495-3-dhinakaran.pandiyan@intel.com>
On Thu, Jul 12, 2018 at 01:09:42AM -0700, Dhinakaran Pandiyan wrote:
> Wait for PSR HW status to show active before starting an PSR exit action.
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Signed-off-by: Dhinakaran Pandiyan <dhinakaran.pandiyan@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> ---
> tests/kms_psr_sink_crc.c | 27 +++++++++------------------
> 1 file changed, 9 insertions(+), 18 deletions(-)
>
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 4a18609a..4eca51da 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -197,33 +197,24 @@ static bool sink_support(data_t *data)
> strstr(buf, "Sink_Support: yes\n");
> }
>
> -static bool psr_enabled(data_t *data)
> +static bool psr_active(data_t *data, bool check_active)
> {
> + bool active;
> char buf[512];
>
> igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
>
> - return data->with_psr_disabled ||
> - strstr(buf, "HW Enabled & Active bit: yes\n");
> + active = strstr(buf, "HW Enabled & Active bit: yes\n") &&
> + (strstr(buf, "SRDENT") || strstr(buf, "SLEEP"));
> + return check_active ? active : !active;
> }
>
> static bool wait_psr_entry(data_t *data)
> {
> - int timeout = 5;
> - while (timeout--) {
> - if (psr_enabled(data))
> - return true;
> - sleep(1);
> - }
> - return false;
> -}
> + if (data->with_psr_disabled)
> + return true;
>
> -static bool psr_inactive(data_t *data)
> -{
> - char buf[512];
> -
> - igt_debugfs_read(data->drm_fd, "i915_edp_psr_status", buf);
> - return !(strstr(buf, "SRDENT") || strstr("SLEEP"));
> + return igt_wait((psr_active(data, true)), 500, 1);
> }
>
> static inline void manual(const char *expected)
> @@ -312,7 +303,7 @@ static void run_test(data_t *data)
> expected = "screen GREEN";
> break;
> }
> - assert(psr_inactive(data));
> + igt_assert(psr_active(data, false));
> manual(expected);
> }
>
> --
> 2.14.1
>
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-07-12 23:20 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-07-12 8:09 [igt-dev] [PATCH i-g-t 1/4] tests/frontbuffer_tracking: Do not test sink crc Dhinakaran Pandiyan
2018-07-12 8:09 ` [igt-dev] [PATCH i-g-t 2/4] tests/kms_psr_sink_crc: " Dhinakaran Pandiyan
2018-07-12 23:19 ` Rodrigo Vivi
2018-07-12 8:09 ` [igt-dev] [PATCH i-g-t 3/4] tests/kms_psr_sink_crc: Test PSR source HW status before PSR entry Dhinakaran Pandiyan
2018-07-12 23:20 ` Rodrigo Vivi [this message]
2018-07-12 8:09 ` [igt-dev] [PATCH i-g-t 4/4] tests/psr: Rename kms_psr_sink_crc.c to kms_psr.c Dhinakaran Pandiyan
2018-07-12 23:21 ` Rodrigo Vivi
2018-07-13 22:32 ` Rodrigo Vivi
2018-07-12 10:27 ` [igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,1/4] tests/frontbuffer_tracking: Do not test sink crc Patchwork
2018-07-12 13:36 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-07-12 23:18 ` [igt-dev] [PATCH i-g-t 1/4] " Rodrigo Vivi
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=20180712232045.GI2208@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=dhinakaran.pandiyan@intel.com \
--cc=igt-dev@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 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.