From: Rodrigo Vivi <rodrigo.vivi@intel.com>
To: Jyoti Yadav <jyoti.r.yadav@intel.com>
Cc: igt-dev@lists.freedesktop.org, intel-gfx@lists.freedesktop.org
Subject: Re: [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
Date: Fri, 31 Aug 2018 07:09:54 -0700 [thread overview]
Message-ID: <20180831140954.GF2219@intel.com> (raw)
In-Reply-To: <1535690345-408-1-git-send-email-jyoti.r.yadav@intel.com>
On Fri, Aug 31, 2018 at 12:39:05AM -0400, Jyoti Yadav wrote:
> From: Jyoti <jyoti.r.yadav@intel.com>
>
> BIOS programs few of PWM related registers during initial boot.
> But during System suspend those registers are cleared.
> This test aim to check whether display programs those registers properly after
> system resume.
> Also checks brightness programming during DPMS ON/OFF cycle to check backlight
> programming is done properly from display side.
>
> v2 : Optimize the code to avoid code redundancy. (Rodrigo)
>
> Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com>
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
and pushed...
Thanks,
Rodrigo.
> ---
> tests/pm_backlight.c | 30 ++++++++++++++++++++++++++++--
> 1 file changed, 28 insertions(+), 2 deletions(-)
>
> diff --git a/tests/pm_backlight.c b/tests/pm_backlight.c
> index a695f90..8b5c79d 100644
> --- a/tests/pm_backlight.c
> +++ b/tests/pm_backlight.c
> @@ -47,6 +47,7 @@ struct context {
> #define FADESPEED 100 /* milliseconds between steps */
>
> IGT_TEST_DESCRIPTION("Basic backlight sysfs test");
> +static int8_t *pm_data = NULL;
>
> static int backlight_read(int *result, const char *fname)
> {
> @@ -150,19 +151,38 @@ static void test_fade(struct context *context)
> nanosleep(&ts, NULL);
> }
> }
> +static void test_fade_with_dpms(struct context *context, igt_output_t *output)
> +{
> + bool has_runtime_pm;
> + has_runtime_pm = igt_setup_runtime_pm();
> + igt_info("Runtime PM support: %d\n", has_runtime_pm);
> + igt_assert(has_runtime_pm);
> + kmstest_set_connector_dpms(output->display->drm_fd, output->config.connector, DRM_MODE_DPMS_OFF);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> + kmstest_set_connector_dpms(output->display->drm_fd, output->config.connector, DRM_MODE_DPMS_ON);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_ACTIVE));
> + test_fade(context);
> +}
> +static void test_fade_with_suspend(struct context *context, igt_output_t *output)
> +{
> + kmstest_set_connector_dpms(output->display->drm_fd, output->config.connector, DRM_MODE_DPMS_OFF);
> + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED));
> + igt_system_suspend_autoresume(SUSPEND_STATE_MEM, SUSPEND_TEST_NONE);
> + test_fade(context);
> +}
>
> igt_main
> {
> struct context context = {0};
> int old;
> igt_display_t display;
> + igt_output_t *output;
> struct igt_fb fb;
>
> igt_skip_on_simulation();
>
> igt_fixture {
> enum pipe pipe;
> - igt_output_t *output;
> bool found = false;
> char full_name[32] = {};
> char *name;
> @@ -187,7 +207,6 @@ igt_main
> for_each_pipe_with_valid_output(&display, pipe, output) {
> if (strcmp(name + 6, output->name))
> continue;
> -
> found = true;
> break;
> }
> @@ -205,6 +224,7 @@ igt_main
> igt_plane_set_fb(primary, &fb);
>
> igt_display_commit2(&display, display.is_atomic ? COMMIT_ATOMIC : COMMIT_LEGACY);
> + pm_data = igt_pm_enable_sata_link_power_management();
> }
>
> igt_subtest("basic-brightness")
> @@ -213,6 +233,10 @@ igt_main
> test_bad_brightness(&context);
> igt_subtest("fade")
> test_fade(&context);
> + igt_subtest("fade_with_dpms")
> + test_fade_with_dpms(&context, output);
> + igt_subtest("fade_with_suspend")
> + test_fade_with_suspend(&context, output);
>
> igt_fixture {
> /* Restore old brightness */
> @@ -220,6 +244,8 @@ igt_main
>
> igt_display_fini(&display);
> igt_remove_fb(display.drm_fd, &fb);
> + igt_pm_restore_sata_link_power_management(pm_data);
> + free(pm_data);
> close(display.drm_fd);
> }
> }
> --
> 1.9.1
>
> _______________________________________________
> igt-dev mailing list
> igt-dev@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/igt-dev
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
next prev parent reply other threads:[~2018-08-31 14:09 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-08-31 4:39 [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend Jyoti Yadav
2018-08-31 4:58 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/pm_backlight.c : Brightness test with DPMS and System suspend. (rev4) Patchwork
2018-08-31 7:17 ` [igt-dev] ✓ Fi.CI.IGT: " Patchwork
2018-08-31 14:09 ` Rodrigo Vivi [this message]
2018-09-28 13:37 ` [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend Jani Nikula
-- strict thread matches above, loose matches on Subject: below --
2018-08-23 12:16 Jyoti Yadav
2018-08-30 0:40 ` 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=20180831140954.GF2219@intel.com \
--to=rodrigo.vivi@intel.com \
--cc=igt-dev@lists.freedesktop.org \
--cc=intel-gfx@lists.freedesktop.org \
--cc=jyoti.r.yadav@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).