From: Paulo Zanoni <paulo.r.zanoni@intel.com>
To: Jim Bride <jim.bride@linux.intel.com>, intel-gfx@lists.freedesktop.org
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Subject: Re: [PATCH IGT v2 6/6] tests/kms_fbcon_fbt: Refactor to use IGT PSR library functions
Date: Fri, 30 Jun 2017 18:13:38 -0300 [thread overview]
Message-ID: <1498857218.22381.7.camel@intel.com> (raw)
In-Reply-To: <1498849944-26404-7-git-send-email-jim.bride@linux.intel.com>
Em Sex, 2017-06-30 às 12:12 -0700, Jim Bride escreveu:
> v2: * Minor functional tweaks and bug fixes
> * Rebase
>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: Paulo Zanoni <paulo.r.zanoni@intel.com>
> Signed-off-by: Jim Bride <jim.bride@linux.intel.com>
> ---
> tests/kms_fbcon_fbt.c | 54 +++++++++++++++++----------------------
> ------------
> 1 file changed, 18 insertions(+), 36 deletions(-)
>
> diff --git a/tests/kms_fbcon_fbt.c b/tests/kms_fbcon_fbt.c
> index d009091..593adb9 100644
> --- a/tests/kms_fbcon_fbt.c
> +++ b/tests/kms_fbcon_fbt.c
> @@ -103,8 +103,9 @@ static bool fbc_is_enabled(int fd)
> return strstr(buf, "FBC enabled\n");
> }
>
> -static bool fbc_wait_until_enabled(int fd)
> +static bool fbc_wait_until_enabled(int fd, bool enabled)
> {
> + enabled = enabled;
If GCC is complaining, please use the appropriate annotations instead
of doing this.
> return igt_wait(fbc_is_enabled(fd), 5000, 1);
> }
>
> @@ -124,6 +125,13 @@ static void set_mode_for_one_screen(struct
> drm_info *drm, struct igt_fb *fb,
>
> if (c->connection == DRM_MODE_CONNECTED && c-
> >count_modes &&
> connector_possible(c)) {
> + if (c->connector_type ==
> DRM_MODE_CONNECTOR_eDP) {
> + bool bret;
> +
> + bret = igt_psr_find_good_mode(c,
> &mode);
> + if (bret)
> + break;
> + }
> mode = &c->modes[0];
> break;
> }
> @@ -147,35 +155,9 @@ static void set_mode_for_one_screen(struct
> drm_info *drm, struct igt_fb *fb,
> igt_assert_eq(rc, 0);
> }
>
> -static bool psr_supported_on_chipset(int fd)
> -{
> - char buf[256];
> -
> - igt_debugfs_read(fd, "i915_edp_psr_status", buf);
> - return strstr(buf, "Sink_Support: yes\n");
> -}
> -
> -static bool connector_can_psr(drmModeConnectorPtr connector)
> -{
> - return (connector->connector_type ==
> DRM_MODE_CONNECTOR_eDP);
> -}
> -
> -static bool psr_is_enabled(int fd)
> -{
> - char buf[256];
> -
> - igt_debugfs_read(fd, "i915_edp_psr_status", buf);
> - return strstr(buf, "\nActive: yes\n");
> -}
> -
> -static bool psr_wait_until_enabled(int fd)
> -{
> - return igt_wait(psr_is_enabled(fd), 5000, 1);
Same problem here as we had in patch 4: changing the timeout from 5 to
10 is going to impact runtime significantly.
> -}
> -
> struct feature {
> bool (*supported_on_chipset)(int fd);
> - bool (*wait_until_enabled)(int fd);
> + bool (*wait_until_enabled)(int fd, bool status);
> bool (*connector_possible_fn)(drmModeConnectorPtr
> connector);
> const char *param_name;
> } fbc = {
> @@ -184,9 +166,9 @@ struct feature {
> .connector_possible_fn = connector_can_fbc,
> .param_name = "enable_fbc",
> }, psr = {
> - .supported_on_chipset = psr_supported_on_chipset,
> - .wait_until_enabled = psr_wait_until_enabled,
> - .connector_possible_fn = connector_can_psr,
> + .supported_on_chipset = igt_psr_sink_support,
> + .wait_until_enabled = igt_psr_await_status,
> + .connector_possible_fn = igt_psr_valid_connector,
> .param_name = "enable_psr",
> };
>
> @@ -210,17 +192,17 @@ static void subtest(struct feature *feature,
> bool suspend)
>
> kmstest_unset_all_crtcs(drm.fd, drm.res);
> wait_user("Modes unset.");
> - igt_assert(!feature->wait_until_enabled(drm.fd));
> + igt_assert(!feature->wait_until_enabled(drm.fd, true));
>
> set_mode_for_one_screen(&drm, &fb, feature-
> >connector_possible_fn);
> wait_user("Screen set.");
> - igt_assert(feature->wait_until_enabled(drm.fd));
> + igt_assert(feature->wait_until_enabled(drm.fd, true));
>
> if (suspend) {
> igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
> SUSPEND_TEST_NONE);
> sleep(5);
> - igt_assert(feature->wait_until_enabled(drm.fd));
> + igt_assert(feature->wait_until_enabled(drm.fd,
> true));
> }
>
> igt_remove_fb(drm.fd, &fb);
> @@ -230,13 +212,13 @@ static void subtest(struct feature *feature,
> bool suspend)
> sleep(3);
>
> wait_user("Back to fbcon.");
> - igt_assert(!feature->wait_until_enabled(drm.fd));
> + igt_assert(!feature->wait_until_enabled(drm.fd, true));
>
> if (suspend) {
> igt_system_suspend_autoresume(SUSPEND_STATE_MEM,
> SUSPEND_TEST_NONE);
> sleep(5);
> - igt_assert(!feature->wait_until_enabled(drm.fd));
> + igt_assert(!feature->wait_until_enabled(drm.fd,
> true));
> }
> }
>
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
prev parent reply other threads:[~2017-06-30 21:13 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-06-30 19:12 [PATCH IGT v2 0/6] IGT PSR Fix-ups Jim Bride
2017-06-30 19:12 ` [PATCH IGT v2 1/6] tests/kms_psr_sink_crc: Change assert_or_manual() to a macro Jim Bride
2017-06-30 19:55 ` Rodrigo Vivi
2017-06-30 19:12 ` [PATCH IGT v2 2/6] lib: Add PSR utility functions to igt library Jim Bride
2017-06-30 20:11 ` Rodrigo Vivi
2017-07-07 13:45 ` Jim Bride
2017-06-30 20:54 ` Paulo Zanoni
2017-07-07 13:53 ` Jim Bride
2017-06-30 19:12 ` [PATCH IGT v2 3/6] tests/kms_psr_sink_crc: Refactor to use new PSR library primitives Jim Bride
2017-06-30 19:12 ` [PATCH IGT v2 4/6] tests/kms_frontbuffer_tracking: Refactor to use IGT PSR library functions Jim Bride
2017-06-30 20:19 ` Rodrigo Vivi
2017-07-07 22:30 ` Jim Bride
2017-06-30 20:46 ` Paulo Zanoni
2017-06-30 21:10 ` Paulo Zanoni
2017-06-30 19:12 ` [PATCH IGT v2 5/6] tests/kms_frontbuffer_tracking: Fix multidraw subtest Jim Bride
2017-06-30 20:21 ` Rodrigo Vivi
2017-07-07 19:43 ` Paulo Zanoni
2017-06-30 19:12 ` [PATCH IGT v2 6/6] tests/kms_fbcon_fbt: Refactor to use IGT PSR library functions Jim Bride
2017-06-30 21:13 ` Paulo Zanoni [this message]
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=1498857218.22381.7.camel@intel.com \
--to=paulo.r.zanoni@intel.com \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jim.bride@linux.intel.com \
--cc=rodrigo.vivi@intel.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).