All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] [intel-gfx][igt-dev] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
@ 2018-08-31  4:39 ` Jyoti Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Jyoti Yadav @ 2018-08-31  4:39 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx, rodrigo.vivi

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>
---
 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

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
@ 2018-08-31  4:39 ` Jyoti Yadav
  0 siblings, 0 replies; 8+ messages in thread
From: Jyoti Yadav @ 2018-08-31  4:39 UTC (permalink / raw)
  To: igt-dev; +Cc: Jyoti, intel-gfx, rodrigo.vivi

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>
---
 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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [igt-dev] ✓ Fi.CI.BAT: success for tests/pm_backlight.c : Brightness test with DPMS and System suspend. (rev4)
  2018-08-31  4:39 ` [igt-dev] [PATCH] [intel-gfx] " Jyoti Yadav
  (?)
@ 2018-08-31  4:58 ` Patchwork
  -1 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-08-31  4:58 UTC (permalink / raw)
  To: Jyoti Yadav; +Cc: igt-dev

== Series Details ==

Series: tests/pm_backlight.c : Brightness test with DPMS and System suspend. (rev4)
URL   : https://patchwork.freedesktop.org/series/48480/
State : success

== Summary ==

= CI Bug Log - changes from CI_DRM_4737 -> IGTPW_1761 =

== Summary - SUCCESS ==

  No regressions found.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48480/revisions/4/mbox/

== Known issues ==

  Here are the changes found in IGTPW_1761 that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@debugfs_test@read_all_entries:
      fi-icl-u:           PASS -> DMESG-FAIL (fdo#107411)
      fi-snb-2520m:       PASS -> INCOMPLETE (fdo#103713)

    igt@gem_exec_reloc@basic-gtt-read-noreloc:
      fi-icl-u:           PASS -> DMESG-WARN (fdo#107411) +77

    igt@gem_exec_suspend@basic-s3:
      fi-icl-u:           PASS -> DMESG-WARN (fdo#107716)

    igt@kms_chamelium@dp-edid-read:
      fi-kbl-7500u:       PASS -> FAIL (fdo#103841)

    
    ==== Possible fixes ====

    igt@kms_pipe_crc_basic@read-crc-pipe-a:
      {fi-byt-clapper}:   FAIL (fdo#107362) -> PASS

    {igt@kms_psr@primary_page_flip}:
      fi-cnl-psr:         FAIL (fdo#107336) -> PASS

    {igt@pm_rpm@module-reload}:
      fi-cnl-psr:         WARN (fdo#107602, fdo#107708) -> PASS

    
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
  fdo#103841 https://bugs.freedesktop.org/show_bug.cgi?id=103841
  fdo#107336 https://bugs.freedesktop.org/show_bug.cgi?id=107336
  fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362
  fdo#107411 https://bugs.freedesktop.org/show_bug.cgi?id=107411
  fdo#107602 https://bugs.freedesktop.org/show_bug.cgi?id=107602
  fdo#107708 https://bugs.freedesktop.org/show_bug.cgi?id=107708
  fdo#107716 https://bugs.freedesktop.org/show_bug.cgi?id=107716


== Participating hosts (53 -> 49) ==

  Missing    (4): fi-ctg-p8600 fi-ilk-m540 fi-byt-squawks fi-bsw-cyan 


== Build changes ==

    * IGT: IGT_4611 -> IGTPW_1761

  CI_DRM_4737: c8fe77635992b1f6b32102657faced7c9165c942 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1761: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1761/
  IGT_4611: b966dd93a30f41581fe1dbf9bc1c4a29b552ca05 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools



== Testlist changes ==

+igt@pm_backlight@fade_with_dpms
+igt@pm_backlight@fade_with_suspend

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1761/issues.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [igt-dev] ✓ Fi.CI.IGT: success for tests/pm_backlight.c : Brightness test with DPMS and System suspend. (rev4)
  2018-08-31  4:39 ` [igt-dev] [PATCH] [intel-gfx] " Jyoti Yadav
  (?)
  (?)
@ 2018-08-31  7:17 ` Patchwork
  -1 siblings, 0 replies; 8+ messages in thread
From: Patchwork @ 2018-08-31  7:17 UTC (permalink / raw)
  To: Jyoti Yadav; +Cc: igt-dev

== Series Details ==

Series: tests/pm_backlight.c : Brightness test with DPMS and System suspend. (rev4)
URL   : https://patchwork.freedesktop.org/series/48480/
State : success

== Summary ==

= CI Bug Log - changes from IGT_4611_full -> IGTPW_1761_full =

== Summary - WARNING ==

  Minor unknown changes coming with IGTPW_1761_full need to be verified
  manually.
  
  If you think the reported changes have nothing to do with the changes
  introduced in IGTPW_1761_full, please notify your bug team to allow them
  to document this new failure mode, which will reduce false positives in CI.

  External URL: https://patchwork.freedesktop.org/api/1.0/series/48480/revisions/4/mbox/

== Possible new issues ==

  Here are the unknown changes that may have been introduced in IGTPW_1761_full:

  === IGT changes ===

    ==== Warnings ====

    igt@pm_rc6_residency@rc6-accuracy:
      shard-kbl:          SKIP -> PASS

    
== Known issues ==

  Here are the changes found in IGTPW_1761_full that come from known issues:

  === IGT changes ===

    ==== Issues hit ====

    igt@drv_suspend@shrink:
      shard-glk:          PASS -> FAIL (fdo#106886)

    igt@gem_pwrite_pread@display-pwrite-blt-gtt_mmap-correctness:
      shard-snb:          PASS -> INCOMPLETE (fdo#105411)

    igt@kms_frontbuffer_tracking@fbc-2p-primscrn-indfb-msflip-blt:
      shard-glk:          PASS -> FAIL (fdo#103167)

    igt@kms_plane_multiple@atomic-pipe-a-tiling-x:
      shard-snb:          PASS -> FAIL (fdo#103166)

    igt@kms_setmode@basic:
      shard-apl:          PASS -> FAIL (fdo#99912)

    igt@perf@blocking:
      shard-hsw:          PASS -> FAIL (fdo#102252)

    igt@testdisplay:
      shard-glk:          PASS -> INCOMPLETE (fdo#107093, fdo#103359, k.org#198133)

    
    ==== Possible fixes ====

    igt@drv_selftest@live_hangcheck:
      shard-kbl:          DMESG-FAIL (fdo#106560, fdo#106947) -> PASS

    igt@gem_render_copy_redux@normal:
      shard-kbl:          INCOMPLETE (fdo#106650, fdo#103665) -> PASS

    igt@kms_cursor_crc@cursor-64x64-suspend:
      shard-kbl:          INCOMPLETE (fdo#107556, fdo#103665) -> PASS

    igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-pwrite:
      shard-snb:          INCOMPLETE (fdo#105411) -> PASS

    igt@kms_rotation_crc@sprite-rotation-180:
      shard-snb:          FAIL (fdo#103925) -> PASS

    
  fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252
  fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166
  fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
  fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359
  fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665
  fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
  fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411
  fdo#106560 https://bugs.freedesktop.org/show_bug.cgi?id=106560
  fdo#106650 https://bugs.freedesktop.org/show_bug.cgi?id=106650
  fdo#106886 https://bugs.freedesktop.org/show_bug.cgi?id=106886
  fdo#106947 https://bugs.freedesktop.org/show_bug.cgi?id=106947
  fdo#107093 https://bugs.freedesktop.org/show_bug.cgi?id=107093
  fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556
  fdo#99912 https://bugs.freedesktop.org/show_bug.cgi?id=99912
  k.org#198133 https://bugzilla.kernel.org/show_bug.cgi?id=198133


== Participating hosts (5 -> 5) ==

  No changes in participating hosts


== Build changes ==

    * IGT: IGT_4611 -> IGTPW_1761
    * Linux: CI_DRM_4715 -> CI_DRM_4737

  CI_DRM_4715: 1b73a69651beab39192502181c83e77a1022014a @ git://anongit.freedesktop.org/gfx-ci/linux
  CI_DRM_4737: c8fe77635992b1f6b32102657faced7c9165c942 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGTPW_1761: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1761/
  IGT_4611: b966dd93a30f41581fe1dbf9bc1c4a29b552ca05 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_1761/shards.html
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
  2018-08-31  4:39 ` [igt-dev] [PATCH] [intel-gfx] " Jyoti Yadav
@ 2018-08-31 14:09   ` Rodrigo Vivi
  -1 siblings, 0 replies; 8+ messages in thread
From: Rodrigo Vivi @ 2018-08-31 14:09 UTC (permalink / raw)
  To: Jyoti Yadav; +Cc: igt-dev, intel-gfx

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
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
@ 2018-08-31 14:09   ` Rodrigo Vivi
  0 siblings, 0 replies; 8+ messages in thread
From: Rodrigo Vivi @ 2018-08-31 14:09 UTC (permalink / raw)
  To: Jyoti Yadav; +Cc: igt-dev, intel-gfx

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

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
  2018-08-31 14:09   ` Rodrigo Vivi
@ 2018-09-28 13:37     ` Jani Nikula
  -1 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2018-09-28 13:37 UTC (permalink / raw)
  To: Rodrigo Vivi, Jyoti Yadav; +Cc: igt-dev, intel-gfx, Lakshmi

On Fri, 31 Aug 2018, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> 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...

Jyoti, please sign up on [1] so we can involve you in bug reports.

This patch, or commit 377752242995 ("tests/pm_backlight.c : Brightness
test with DPMS and System suspend."), appears to cause bug [2]. The
suspend test goes on to use the sysfs interface before the backlight has
been re-enabled after resume, failing the test.

BR,
Jani.

[1] https://bugs.freedesktop.org

[2] https://bugs.freedesktop.org/show_bug.cgi?id=107847


>
> 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

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend.
@ 2018-09-28 13:37     ` Jani Nikula
  0 siblings, 0 replies; 8+ messages in thread
From: Jani Nikula @ 2018-09-28 13:37 UTC (permalink / raw)
  To: Rodrigo Vivi, Jyoti Yadav; +Cc: igt-dev, intel-gfx, Lakshmi

On Fri, 31 Aug 2018, Rodrigo Vivi <rodrigo.vivi@intel.com> wrote:
> 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...

Jyoti, please sign up on [1] so we can involve you in bug reports.

This patch, or commit 377752242995 ("tests/pm_backlight.c : Brightness
test with DPMS and System suspend."), appears to cause bug [2]. The
suspend test goes on to use the sysfs interface before the backlight has
been re-enabled after resume, failing the test.

BR,
Jani.

[1] https://bugs.freedesktop.org

[2] https://bugs.freedesktop.org/show_bug.cgi?id=107847


>
> 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

-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2018-09-28 13:37 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-31  4:39 [PATCH] [intel-gfx][igt-dev] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend Jyoti Yadav
2018-08-31  4:39 ` [igt-dev] [PATCH] [intel-gfx] " 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 ` [igt-dev] [PATCH] [intel-gfx] [PATCH i-g-t] tests/pm_backlight.c : Brightness test with DPMS and System suspend Rodrigo Vivi
2018-08-31 14:09   ` Rodrigo Vivi
2018-09-28 13:37   ` Jani Nikula
2018-09-28 13:37     ` Jani Nikula

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.