* [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c
@ 2018-11-03 11:36 Jyoti Yadav
2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 1/5] [intel-gfx] lib/igt_pm: Moves Dmc_loaded() function into library Jyoti Yadav
` (6 more replies)
0 siblings, 7 replies; 14+ messages in thread
From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw)
To: igt-dev; +Cc: Jyoti Yadav
This patch series adds new tests to validate Display C states.
DC states like DC5 and DC6 are validated during PSR entry/exit
and during DPMS on/off cycle.
Jyoti Yadav (5):
[intel-gfx][igt-dev] lib/igt_pm: Moves Dmc_loaded() function into
library
[intel-gfx][igt-dev] tests/pm_dc: Added new test to verify Display C
States.
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC6 during PSR
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC5 during DPMS
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC6 during DPMS
lib/igt_pm.c | 28 ++++++
lib/igt_pm.h | 1 +
tests/Makefile.sources | 1 +
tests/meson.build | 1 +
tests/pm_dc.c | 266 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/pm_rpm.c | 17 +---
6 files changed, 298 insertions(+), 16 deletions(-)
create mode 100644 tests/pm_dc.c
--
1.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 14+ messages in thread* [igt-dev] [PATCH i-g-t v3 1/5] [intel-gfx] lib/igt_pm: Moves Dmc_loaded() function into library 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav @ 2018-11-03 11:36 ` Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav ` (5 subsequent siblings) 6 siblings, 0 replies; 14+ messages in thread From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav It will be used by new test pm_dc.c which will validate Display C States. So moving the same to igt_pm library. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- lib/igt_pm.c | 28 ++++++++++++++++++++++++++++ lib/igt_pm.h | 1 + tests/pm_rpm.c | 17 +---------------- 3 files changed, 30 insertions(+), 16 deletions(-) diff --git a/lib/igt_pm.c b/lib/igt_pm.c index 4902723..8b87c58 100644 --- a/lib/igt_pm.c +++ b/lib/igt_pm.c @@ -38,6 +38,7 @@ #include "drmtest.h" #include "igt_pm.h" #include "igt_aux.h" +#include "igt_sysfs.h" /** * SECTION:igt_pm @@ -620,3 +621,30 @@ bool igt_wait_for_pm_status(enum igt_runtime_pm_status status) { return igt_wait(igt_get_runtime_pm_status() == status, 10000, 100); } + +/** + * dmc_loaded: + * @debugfs: fd to the debugfs dir. + + * Check whether DMC FW is loaded or not. DMC FW is require for few Display C + * states like DC5 and DC6. FW does the Context Save and Restore during Display + * C States entry and exit. + * + * Returns: + * True if DMC FW is loaded otherwise false. + */ +bool igt_pm_dmc_loaded(int debugfs) +{ + igt_require(debugfs != -1); + char buf[15]; + int len; + + len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1); + if (len < 0) + return true; /* no CSR support, no DMC requirement */ + + buf[len] = '\0'; + + igt_info("DMC: %s\n", buf); + return strstr(buf, "fw loaded: yes"); +} diff --git a/lib/igt_pm.h b/lib/igt_pm.h index 10cc679..70d2380 100644 --- a/lib/igt_pm.h +++ b/lib/igt_pm.h @@ -50,5 +50,6 @@ bool igt_setup_runtime_pm(void); void igt_restore_runtime_pm(void); enum igt_runtime_pm_status igt_get_runtime_pm_status(void); bool igt_wait_for_pm_status(enum igt_runtime_pm_status status); +bool igt_pm_dmc_loaded(int debugfs); #endif /* IGT_PM_H */ diff --git a/tests/pm_rpm.c b/tests/pm_rpm.c index c24fd95..fae6750 100644 --- a/tests/pm_rpm.c +++ b/tests/pm_rpm.c @@ -693,21 +693,6 @@ static void setup_pc8(void) has_pc8 = true; } -static bool dmc_loaded(void) -{ - char buf[15]; - int len; - - len = igt_sysfs_read(debugfs, "i915_dmc_info", buf, sizeof(buf) - 1); - if (len < 0) - return true; /* no CSR support, no DMC requirement */ - - buf[len] = '\0'; - - igt_info("DMC: %s\n", buf); - return strstr(buf, "fw loaded: yes"); -} - static bool setup_environment(void) { if (has_runtime_pm) @@ -730,7 +715,7 @@ static bool setup_environment(void) igt_info("Runtime PM support: %d\n", has_runtime_pm); igt_info("PC8 residency support: %d\n", has_pc8); igt_require(has_runtime_pm); - igt_require(dmc_loaded()); + igt_require(igt_pm_dmc_loaded(debugfs)); out: disable_all_screens(&ms_data); -- 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] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States. 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 1/5] [intel-gfx] lib/igt_pm: Moves Dmc_loaded() function into library Jyoti Yadav @ 2018-11-03 11:36 ` Jyoti Yadav 2018-11-21 17:39 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR Jyoti Yadav ` (4 subsequent siblings) 6 siblings, 1 reply; 14+ messages in thread From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav Currently this test validates DC5 upon PSR entry for supported platforms. Added new file for compilation inside Makefile and Meson. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- tests/Makefile.sources | 1 + tests/meson.build | 1 + tests/pm_dc.c | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 214 insertions(+) create mode 100644 tests/pm_dc.c diff --git a/tests/Makefile.sources b/tests/Makefile.sources index c84933f..d491420 100644 --- a/tests/Makefile.sources +++ b/tests/Makefile.sources @@ -214,6 +214,7 @@ TESTS_progs = \ pm_lpsp \ pm_rc6_residency \ pm_rpm \ + pm_dc \ pm_rps \ pm_sseu \ prime_busy \ diff --git a/tests/meson.build b/tests/meson.build index 17deb94..50b0687 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -188,6 +188,7 @@ test_progs = [ 'pm_lpsp', 'pm_rc6_residency', 'pm_rpm', + 'pm_dc', 'pm_rps', 'pm_sseu', 'prime_busy', diff --git a/tests/pm_dc.c b/tests/pm_dc.c new file mode 100644 index 0000000..671c0f5 --- /dev/null +++ b/tests/pm_dc.c @@ -0,0 +1,212 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +#include "igt.h" +#include "igt_sysfs.h" +#include "igt_psr.h" +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include "intel_bufmgr.h" +#include "intel_io.h" +#include "limits.h" + + +typedef struct { + int drm_fd; + int debugfs_fd; + uint32_t devid; + igt_display_t display; + struct igt_fb fb_white; + drmModeModeInfo *mode; + igt_output_t *output; +} data_t; + +/* DC State Flags */ +#define CHECK_DC5 1 +#define CHECK_DC6 2 + +static void setup_output(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output; + enum pipe pipe; + + for_each_pipe_with_valid_output(display, pipe, output) { + drmModeConnectorPtr c = output->config.connector; + + if (c->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + + igt_output_set_pipe(output, pipe); + data->output = output; + data->mode = igt_output_get_mode(output); + + return; + } +} + +static void display_init(data_t *data) +{ + igt_display_init(&data->display, data->drm_fd); + setup_output(data); +} + +static void display_fini(data_t *data) +{ + igt_display_fini(&data->display); +} + +static bool edp_psr_sink_support(data_t *data) +{ + char buf[512]; + + igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status", + buf, sizeof(buf)); + + return strstr(buf, "Sink_Support: yes\n"); +} + +static void cleanup(data_t *data) +{ + igt_plane_t *primary; + + primary = igt_output_get_plane_type(data->output, + DRM_PLANE_TYPE_PRIMARY); + igt_plane_set_fb(primary, NULL); + igt_display_commit(&data->display); + igt_remove_fb(data->drm_fd, &data->fb_white); +} + +static void setup_primary(data_t *data) +{ + igt_plane_t *primary; + + primary = igt_output_get_plane_type(data->output, + DRM_PLANE_TYPE_PRIMARY); + igt_plane_set_fb(primary, NULL); + igt_create_color_fb(data->drm_fd, + data->mode->hdisplay, data->mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, + 1.0, 1.0, 1.0, + &data->fb_white); + igt_display_commit(&data->display); + + igt_plane_set_fb(primary, &data->fb_white); + igt_display_commit(&data->display); +} + +static uint32_t get_dc_counter(char *dc_data) +{ + char *e; + long ret; + char *s = strchr(dc_data, ':'); + + assert(s); + s++; + ret = strtol(s, &e, 10); + assert(((ret != LONG_MIN && ret != LONG_MAX) || errno != ERANGE) && + e > s && *e == '\n' && ret >= 0); + return ret; +} + +static uint32_t read_dc_counter(uint32_t drm_fd, int dc_flag) +{ + char buf[4096]; + char *str; + + igt_debugfs_read(drm_fd, "i915_dmc_info", buf); + if (dc_flag & CHECK_DC5) + str = strstr(buf, "DC3 -> DC5 count"); + else if (dc_flag & CHECK_DC6) + str = strstr(buf, "DC5 -> DC6 count"); + igt_skip_on_f(str == NULL, "DC%d counter is not availble\n", + dc_flag & CHECK_DC5 ? 5 : 6); + return get_dc_counter(str); +} + +bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count) +{ + return igt_wait(read_dc_counter(drm_fd, dc_flag) > prev_dc_count, 1000, 100); +} + +void check_dc_counter(int drm_fd, int dc_flag, uint32_t prev_dc_count) +{ + igt_assert_f(dc_state_wait_entry(drm_fd, dc_flag, prev_dc_count), + "DC%d state is not achieved\n", + dc_flag & CHECK_DC5 ? 5 : 6); +} + +static void test_dc_state_psr(data_t *data, int dc_flag) +{ + uint32_t dc_counter_before_psr; + + dc_counter_before_psr = read_dc_counter(data->drm_fd, dc_flag); + setup_output(data); + setup_primary(data); + igt_assert(psr_wait_entry(data->debugfs_fd)); + check_dc_counter(data->drm_fd, dc_flag, dc_counter_before_psr); +} + +int main(int argc, char *argv[]) +{ + bool has_runtime_pm; + data_t data = {}; + + igt_skip_on_simulation(); + igt_subtest_init(argc, argv); + igt_fixture { + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + data.debugfs_fd = igt_debugfs_dir(data.drm_fd); + igt_require(data.debugfs_fd != -1); + kmstest_set_vt_graphics_mode(); + data.devid = intel_get_drm_devid(data.drm_fd); + has_runtime_pm = igt_setup_runtime_pm(); + igt_info("Runtime PM support: %d\n", has_runtime_pm); + igt_require(has_runtime_pm); + igt_require(igt_pm_dmc_loaded(data.debugfs_fd)); + igt_display_init(&data->display, data->drm_fd); + //display_init(&data); + } + + igt_subtest("dc5-psr") { + psr_enable(data.debugfs_fd); + igt_require_f(edp_psr_sink_support(&data), + "Sink does not support PSR\n"); + /* Check DC5 counter is available for the platform. + * Skip the test if counter is not available. + */ + read_dc_counter(data.drm_fd, CHECK_DC5); + test_dc_state_psr(&data, CHECK_DC5); + cleanup(&data); + } + igt_fixture { + close(data.debugfs_fd); + display_fini(&data); + } + + igt_exit(); +} -- 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] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States. 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav @ 2018-11-21 17:39 ` Imre Deak 0 siblings, 0 replies; 14+ messages in thread From: Imre Deak @ 2018-11-21 17:39 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev On Sat, Nov 03, 2018 at 07:36:03AM -0400, Jyoti Yadav wrote: > Currently this test validates DC5 upon PSR entry for supported platforms. > Added new file for compilation inside Makefile and Meson. Please always list the changes for the new revision here to make review easier. In particular it would be good to know how the crash during cleanup in the previous version got fixed. > > Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> > --- > tests/Makefile.sources | 1 + > tests/meson.build | 1 + > tests/pm_dc.c | 212 +++++++++++++++++++++++++++++++++++++++++++++++++ > 3 files changed, 214 insertions(+) > create mode 100644 tests/pm_dc.c > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources > index c84933f..d491420 100644 > --- a/tests/Makefile.sources > +++ b/tests/Makefile.sources > @@ -214,6 +214,7 @@ TESTS_progs = \ > pm_lpsp \ > pm_rc6_residency \ > pm_rpm \ > + pm_dc \ > pm_rps \ > pm_sseu \ > prime_busy \ > diff --git a/tests/meson.build b/tests/meson.build > index 17deb94..50b0687 100644 > --- a/tests/meson.build > +++ b/tests/meson.build > @@ -188,6 +188,7 @@ test_progs = [ > 'pm_lpsp', > 'pm_rc6_residency', > 'pm_rpm', > + 'pm_dc', > 'pm_rps', > 'pm_sseu', > 'prime_busy', > diff --git a/tests/pm_dc.c b/tests/pm_dc.c > new file mode 100644 > index 0000000..671c0f5 > --- /dev/null > +++ b/tests/pm_dc.c > @@ -0,0 +1,212 @@ > +/* > + * Copyright © 2018 Intel Corporation > + * > + * Permission is hereby granted, free of charge, to any person obtaining a > + * copy of this software and associated documentation files (the "Software"), > + * to deal in the Software without restriction, including without limitation > + * the rights to use, copy, modify, merge, publish, distribute, sublicense, > + * and/or sell copies of the Software, and to permit persons to whom the > + * Software is furnished to do so, subject to the following conditions: > + * > + * The above copyright notice and this permission notice (including the next > + * paragraph) shall be included in all copies or substantial portions of the > + * Software. > + * > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS > + * IN THE SOFTWARE. > + * > + */ > + > +#include "igt.h" > +#include "igt_sysfs.h" > +#include "igt_psr.h" > +#include <errno.h> > +#include <stdbool.h> > +#include <stdio.h> > +#include <string.h> > +#include "intel_bufmgr.h" > +#include "intel_io.h" > +#include "limits.h" > + > + > +typedef struct { > + int drm_fd; > + int debugfs_fd; > + uint32_t devid; > + igt_display_t display; > + struct igt_fb fb_white; > + drmModeModeInfo *mode; > + igt_output_t *output; > +} data_t; > + > +/* DC State Flags */ > +#define CHECK_DC5 1 > +#define CHECK_DC6 2 > + > +static void setup_output(data_t *data) > +{ > + igt_display_t *display = &data->display; > + igt_output_t *output; > + enum pipe pipe; > + > + for_each_pipe_with_valid_output(display, pipe, output) { > + drmModeConnectorPtr c = output->config.connector; > + > + if (c->connector_type != DRM_MODE_CONNECTOR_eDP) > + continue; > + > + igt_output_set_pipe(output, pipe); > + data->output = output; > + data->mode = igt_output_get_mode(output); > + > + return; > + } > +} > + > +static void display_init(data_t *data) > +{ > + igt_display_init(&data->display, data->drm_fd); > + setup_output(data); > +} This function isn't used. > + > +static void display_fini(data_t *data) > +{ > + igt_display_fini(&data->display); > +} > + > +static bool edp_psr_sink_support(data_t *data) > +{ > + char buf[512]; > + > + igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status", > + buf, sizeof(buf)); > + > + return strstr(buf, "Sink_Support: yes\n"); > +} > + > +static void cleanup(data_t *data) > +{ > + igt_plane_t *primary; > + > + primary = igt_output_get_plane_type(data->output, > + DRM_PLANE_TYPE_PRIMARY); > + igt_plane_set_fb(primary, NULL); > + igt_display_commit(&data->display); > + igt_remove_fb(data->drm_fd, &data->fb_white); > +} This function isn't used either by the end of the patchset. > + > +static void setup_primary(data_t *data) > +{ > + igt_plane_t *primary; > + > + primary = igt_output_get_plane_type(data->output, > + DRM_PLANE_TYPE_PRIMARY); > + igt_plane_set_fb(primary, NULL); > + igt_create_color_fb(data->drm_fd, > + data->mode->hdisplay, data->mode->vdisplay, > + DRM_FORMAT_XRGB8888, > + LOCAL_I915_FORMAT_MOD_X_TILED, > + 1.0, 1.0, 1.0, > + &data->fb_white); > + igt_display_commit(&data->display); Why do we need this separate commit? > + > + igt_plane_set_fb(primary, &data->fb_white); I can't see this FB getting freed anywhere (cleanup() vansihes by the end). > + igt_display_commit(&data->display); > +} > + > +static uint32_t get_dc_counter(char *dc_data) > +{ > + char *e; > + long ret; > + char *s = strchr(dc_data, ':'); > + > + assert(s); > + s++; > + ret = strtol(s, &e, 10); > + assert(((ret != LONG_MIN && ret != LONG_MAX) || errno != ERANGE) && > + e > s && *e == '\n' && ret >= 0); > + return ret; > +} > + > +static uint32_t read_dc_counter(uint32_t drm_fd, int dc_flag) > +{ > + char buf[4096]; > + char *str; > + > + igt_debugfs_read(drm_fd, "i915_dmc_info", buf); > + if (dc_flag & CHECK_DC5) > + str = strstr(buf, "DC3 -> DC5 count"); > + else if (dc_flag & CHECK_DC6) > + str = strstr(buf, "DC5 -> DC6 count"); > + igt_skip_on_f(str == NULL, "DC%d counter is not availble\n", > + dc_flag & CHECK_DC5 ? 5 : 6); > + return get_dc_counter(str); > +} > + > +bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count) > +{ > + return igt_wait(read_dc_counter(drm_fd, dc_flag) > prev_dc_count, 1000, 100); > +} > + > +void check_dc_counter(int drm_fd, int dc_flag, uint32_t prev_dc_count) > +{ > + igt_assert_f(dc_state_wait_entry(drm_fd, dc_flag, prev_dc_count), > + "DC%d state is not achieved\n", > + dc_flag & CHECK_DC5 ? 5 : 6); > +} > + > +static void test_dc_state_psr(data_t *data, int dc_flag) > +{ > + uint32_t dc_counter_before_psr; > + > + dc_counter_before_psr = read_dc_counter(data->drm_fd, dc_flag); > + setup_output(data); > + setup_primary(data); > + igt_assert(psr_wait_entry(data->debugfs_fd)); > + check_dc_counter(data->drm_fd, dc_flag, dc_counter_before_psr); > +} > + > +int main(int argc, char *argv[]) > +{ > + bool has_runtime_pm; > + data_t data = {}; > + > + igt_skip_on_simulation(); > + igt_subtest_init(argc, argv); > + igt_fixture { > + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); > + data.debugfs_fd = igt_debugfs_dir(data.drm_fd); > + igt_require(data.debugfs_fd != -1); > + kmstest_set_vt_graphics_mode(); > + data.devid = intel_get_drm_devid(data.drm_fd); > + has_runtime_pm = igt_setup_runtime_pm(); > + igt_info("Runtime PM support: %d\n", has_runtime_pm); > + igt_require(has_runtime_pm); > + igt_require(igt_pm_dmc_loaded(data.debugfs_fd)); > + igt_display_init(&data->display, data->drm_fd); > + //display_init(&data); Leftover code. > + } > + > + igt_subtest("dc5-psr") { > + psr_enable(data.debugfs_fd); > + igt_require_f(edp_psr_sink_support(&data), > + "Sink does not support PSR\n"); > + /* Check DC5 counter is available for the platform. > + * Skip the test if counter is not available. > + */ > + read_dc_counter(data.drm_fd, CHECK_DC5); > + test_dc_state_psr(&data, CHECK_DC5); > + cleanup(&data); This one you'll remove in a later patch, so could be removed already here. > + } > + igt_fixture { > + close(data.debugfs_fd); > + display_fini(&data); > + } > + > + igt_exit(); > +} > -- > 1.9.1 > _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 1/5] [intel-gfx] lib/igt_pm: Moves Dmc_loaded() function into library Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav @ 2018-11-03 11:36 ` Jyoti Yadav 2018-11-21 17:40 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS Jyoti Yadav ` (3 subsequent siblings) 6 siblings, 1 reply; 14+ messages in thread From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav This patch add subtest to check DC6 entry on PSR for the supported platforms. v2: Rename the subtest with more meaningful name. v3: Rebased. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- tests/pm_dc.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/tests/pm_dc.c b/tests/pm_dc.c index 671c0f5..3ecfb1c 100644 --- a/tests/pm_dc.c +++ b/tests/pm_dc.c @@ -203,6 +203,18 @@ int main(int argc, char *argv[]) test_dc_state_psr(&data, CHECK_DC5); cleanup(&data); } + + igt_subtest("dc6-psr") { + psr_enable(data.debugfs_fd); + igt_require_f(edp_psr_sink_support(&data), + "Sink does not support PSR\n"); + /* Check DC5 counter is available for the platform. + * Skip the test if counter is not available. + */ + read_dc_counter(data.drm_fd, CHECK_DC6); + test_dc_state_psr(&data, CHECK_DC6); + cleanup(&data); + } igt_fixture { close(data.debugfs_fd); display_fini(&data); -- 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] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR Jyoti Yadav @ 2018-11-21 17:40 ` Imre Deak 0 siblings, 0 replies; 14+ messages in thread From: Imre Deak @ 2018-11-21 17:40 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev On Sat, Nov 03, 2018 at 07:36:04AM -0400, Jyoti Yadav wrote: > This patch add subtest to check DC6 entry on PSR for the supported > platforms. > > v2: Rename the subtest with more meaningful name. > v3: Rebased. > > Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> > --- > tests/pm_dc.c | 12 ++++++++++++ > 1 file changed, 12 insertions(+) > > diff --git a/tests/pm_dc.c b/tests/pm_dc.c > index 671c0f5..3ecfb1c 100644 > --- a/tests/pm_dc.c > +++ b/tests/pm_dc.c > @@ -203,6 +203,18 @@ int main(int argc, char *argv[]) > test_dc_state_psr(&data, CHECK_DC5); > cleanup(&data); > } > + > + igt_subtest("dc6-psr") { > + psr_enable(data.debugfs_fd); > + igt_require_f(edp_psr_sink_support(&data), > + "Sink does not support PSR\n"); > + /* Check DC5 counter is available for the platform. ^DC6 > + * Skip the test if counter is not available. > + */ > + read_dc_counter(data.drm_fd, CHECK_DC6); > + test_dc_state_psr(&data, CHECK_DC6); > + cleanup(&data); You add this here only to remove it in a later patch. > + } > igt_fixture { > close(data.debugfs_fd); > display_fini(&data); > -- > 1.9.1 > _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav ` (2 preceding siblings ...) 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR Jyoti Yadav @ 2018-11-03 11:36 ` Jyoti Yadav 2018-11-21 17:42 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 " Jyoti Yadav ` (2 subsequent siblings) 6 siblings, 1 reply; 14+ messages in thread From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav Added new subtest for DC5 entry during DPMS on/off cycle. During DPMS on/off cycle DC5 counter is incremented. v2: Rename the subtest with meaningful name. v3: Rebased Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- tests/pm_dc.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) diff --git a/tests/pm_dc.c b/tests/pm_dc.c index 3ecfb1c..d47b837 100644 --- a/tests/pm_dc.c +++ b/tests/pm_dc.c @@ -171,6 +171,29 @@ static void test_dc_state_psr(data_t *data, int dc_flag) check_dc_counter(data->drm_fd, dc_flag, dc_counter_before_psr); } +static void dpms_off_on(data_t *data) +{ + for (int i = 0; i < data->display.n_outputs; i++) { + kmstest_set_connector_dpms(data->drm_fd, data->display.outputs[i].config.connector, + DRM_MODE_DPMS_OFF); + } + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)); + for (int i = 0; i < data->display.n_outputs; i++) { + kmstest_set_connector_dpms(data->drm_fd, data->display.outputs[i].config.connector, + DRM_MODE_DPMS_ON); + } + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_ACTIVE)); +} + +static void test_dc_state_dpms(data_t *data, int dc_flag) +{ + uint32_t dc_counter; + + dc_counter = read_dc_counter(data->drm_fd, dc_flag); + dpms_off_on(data); + check_dc_counter(data->drm_fd, dc_flag, dc_counter); +} + int main(int argc, char *argv[]) { bool has_runtime_pm; @@ -208,13 +231,23 @@ int main(int argc, char *argv[]) psr_enable(data.debugfs_fd); igt_require_f(edp_psr_sink_support(&data), "Sink does not support PSR\n"); - /* Check DC5 counter is available for the platform. + /* Check DC6 counter is available for the platform. * Skip the test if counter is not available. */ read_dc_counter(data.drm_fd, CHECK_DC6); test_dc_state_psr(&data, CHECK_DC6); cleanup(&data); } + + igt_subtest("dc5-dpms") { + /* Check DC5 counter is available for the platform. + * Skip the test if counter is not available. + */ + read_dc_counter(data.drm_fd, CHECK_DC5); + test_dc_state_dpms(&data, CHECK_DC5); + // cleanup(&data); + } + igt_fixture { close(data.debugfs_fd); display_fini(&data); -- 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] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS Jyoti Yadav @ 2018-11-21 17:42 ` Imre Deak 0 siblings, 0 replies; 14+ messages in thread From: Imre Deak @ 2018-11-21 17:42 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev On Sat, Nov 03, 2018 at 07:36:05AM -0400, Jyoti Yadav wrote: > Added new subtest for DC5 entry during DPMS on/off cycle. > During DPMS on/off cycle DC5 counter is incremented. > > v2: Rename the subtest with meaningful name. > v3: Rebased > > Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> > --- > tests/pm_dc.c | 35 ++++++++++++++++++++++++++++++++++- > 1 file changed, 34 insertions(+), 1 deletion(-) > > diff --git a/tests/pm_dc.c b/tests/pm_dc.c > index 3ecfb1c..d47b837 100644 > --- a/tests/pm_dc.c > +++ b/tests/pm_dc.c > @@ -171,6 +171,29 @@ static void test_dc_state_psr(data_t *data, int dc_flag) > check_dc_counter(data->drm_fd, dc_flag, dc_counter_before_psr); > } > > +static void dpms_off_on(data_t *data) > +{ > + for (int i = 0; i < data->display.n_outputs; i++) { > + kmstest_set_connector_dpms(data->drm_fd, data->display.outputs[i].config.connector, > + DRM_MODE_DPMS_OFF); > + } > + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_SUSPENDED)); > + for (int i = 0; i < data->display.n_outputs; i++) { > + kmstest_set_connector_dpms(data->drm_fd, data->display.outputs[i].config.connector, > + DRM_MODE_DPMS_ON); > + } > + igt_assert(igt_wait_for_pm_status(IGT_RUNTIME_PM_STATUS_ACTIVE)); > +} > + > +static void test_dc_state_dpms(data_t *data, int dc_flag) > +{ > + uint32_t dc_counter; > + > + dc_counter = read_dc_counter(data->drm_fd, dc_flag); > + dpms_off_on(data); > + check_dc_counter(data->drm_fd, dc_flag, dc_counter); > +} > + > int main(int argc, char *argv[]) > { > bool has_runtime_pm; > @@ -208,13 +231,23 @@ int main(int argc, char *argv[]) > psr_enable(data.debugfs_fd); > igt_require_f(edp_psr_sink_support(&data), > "Sink does not support PSR\n"); > - /* Check DC5 counter is available for the platform. > + /* Check DC6 counter is available for the platform. Should be fixed in the patch adding this. > * Skip the test if counter is not available. > */ > read_dc_counter(data.drm_fd, CHECK_DC6); > test_dc_state_psr(&data, CHECK_DC6); > cleanup(&data); > } > + > + igt_subtest("dc5-dpms") { > + /* Check DC5 counter is available for the platform. > + * Skip the test if counter is not available. > + */ > + read_dc_counter(data.drm_fd, CHECK_DC5); > + test_dc_state_dpms(&data, CHECK_DC5); > + // cleanup(&data); Leftover code. > + } > + > igt_fixture { > close(data.debugfs_fd); > display_fini(&data); > -- > 1.9.1 > _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 during DPMS 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav ` (3 preceding siblings ...) 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS Jyoti Yadav @ 2018-11-03 11:36 ` Jyoti Yadav 2018-11-21 17:43 ` Imre Deak 2018-11-03 12:25 ` [igt-dev] ✓ Fi.CI.BAT: success for Added new test file pm_dc.c (rev2) Patchwork 2018-11-03 13:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 6 siblings, 1 reply; 14+ messages in thread From: Jyoti Yadav @ 2018-11-03 11:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav Added new subtest for DC6 entry during DPMS on/off cycle. During DPMS on/off cycle DC6 counter is incremented. v2: Renamed the subtest name. v3: Rebased. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- tests/pm_dc.c | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tests/pm_dc.c b/tests/pm_dc.c index d47b837..6d71e34 100644 --- a/tests/pm_dc.c +++ b/tests/pm_dc.c @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) igt_info("Runtime PM support: %d\n", has_runtime_pm); igt_require(has_runtime_pm); igt_require(igt_pm_dmc_loaded(data.debugfs_fd)); - igt_display_init(&data->display, data->drm_fd); + igt_display_init(&data.display, data.drm_fd); //display_init(&data); } @@ -248,6 +248,15 @@ int main(int argc, char *argv[]) // cleanup(&data); } + igt_subtest("dc6-dpms") { + /* Check DC6 counter is available for the platform. + * Skip the test if counter is not available. + */ + read_dc_counter(data.drm_fd, CHECK_DC6); + test_dc_state_dpms(&data, CHECK_DC6); + //cleanup(&data); + } + igt_fixture { close(data.debugfs_fd); display_fini(&data); -- 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] 14+ messages in thread
* Re: [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 during DPMS 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 " Jyoti Yadav @ 2018-11-21 17:43 ` Imre Deak 0 siblings, 0 replies; 14+ messages in thread From: Imre Deak @ 2018-11-21 17:43 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev On Sat, Nov 03, 2018 at 07:36:06AM -0400, Jyoti Yadav wrote: > Added new subtest for DC6 entry during DPMS on/off cycle. > During DPMS on/off cycle DC6 counter is incremented. > > v2: Renamed the subtest name. > v3: Rebased. > > Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> > --- > tests/pm_dc.c | 11 ++++++++++- > 1 file changed, 10 insertions(+), 1 deletion(-) > > diff --git a/tests/pm_dc.c b/tests/pm_dc.c > index d47b837..6d71e34 100644 > --- a/tests/pm_dc.c > +++ b/tests/pm_dc.c > @@ -211,7 +211,7 @@ int main(int argc, char *argv[]) > igt_info("Runtime PM support: %d\n", has_runtime_pm); > igt_require(has_runtime_pm); > igt_require(igt_pm_dmc_loaded(data.debugfs_fd)); > - igt_display_init(&data->display, data->drm_fd); > + igt_display_init(&data.display, data.drm_fd); Should be fixed in the patch adding it. > //display_init(&data); > } > > @@ -248,6 +248,15 @@ int main(int argc, char *argv[]) > // cleanup(&data); > } > > + igt_subtest("dc6-dpms") { > + /* Check DC6 counter is available for the platform. > + * Skip the test if counter is not available. > + */ > + read_dc_counter(data.drm_fd, CHECK_DC6); > + test_dc_state_dpms(&data, CHECK_DC6); > + //cleanup(&data); Leftover code. > + } > + > igt_fixture { > close(data.debugfs_fd); > display_fini(&data); > -- > 1.9.1 > _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✓ Fi.CI.BAT: success for Added new test file pm_dc.c (rev2) 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav ` (4 preceding siblings ...) 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 " Jyoti Yadav @ 2018-11-03 12:25 ` Patchwork 2018-11-03 13:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 6 siblings, 0 replies; 14+ messages in thread From: Patchwork @ 2018-11-03 12:25 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev == Series Details == Series: Added new test file pm_dc.c (rev2) URL : https://patchwork.freedesktop.org/series/51722/ State : success == Summary == = CI Bug Log - changes from CI_DRM_5081 -> IGTPW_2034 = == Summary - SUCCESS == No regressions found. External URL: https://patchwork.freedesktop.org/api/1.0/series/51722/revisions/2/mbox/ == Known issues == Here are the changes found in IGTPW_2034 that come from known issues: === IGT changes === ==== Issues hit ==== igt@gem_exec_suspend@basic-s3: fi-kbl-soraka: NOTRUN -> INCOMPLETE (fdo#107859, fdo#107556, fdo#107774) igt@kms_pipe_crc_basic@suspend-read-crc-pipe-b: fi-byt-clapper: PASS -> FAIL (fdo#103191, fdo#107362) ==== Possible fixes ==== igt@gem_cpu_reloc@basic: fi-kbl-7560u: INCOMPLETE (fdo#103665) -> PASS igt@kms_flip@basic-flip-vs-modeset: fi-skl-6700hq: DMESG-WARN (fdo#105998) -> PASS +1 fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191 fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665 fdo#105998 https://bugs.freedesktop.org/show_bug.cgi?id=105998 fdo#107362 https://bugs.freedesktop.org/show_bug.cgi?id=107362 fdo#107556 https://bugs.freedesktop.org/show_bug.cgi?id=107556 fdo#107774 https://bugs.freedesktop.org/show_bug.cgi?id=107774 fdo#107859 https://bugs.freedesktop.org/show_bug.cgi?id=107859 == Participating hosts (50 -> 46) == Additional (1): fi-kbl-soraka Missing (5): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-ctg-p8600 == Build changes == * IGT: IGT_4705 -> IGTPW_2034 CI_DRM_5081: f5e16acf6c85d38756c3efdb77ec6aede55df0ba @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2034: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/ IGT_4705: 7983e19ed62ec8db1884f55e07e458a62cc51e37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Testlist changes == +igt@pm_dc@dc5-dpms +igt@pm_dc@dc5-psr +igt@pm_dc@dc6-dpms +igt@pm_dc@dc6-psr == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/issues.html _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* [igt-dev] ✗ Fi.CI.IGT: failure for Added new test file pm_dc.c (rev2) 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav ` (5 preceding siblings ...) 2018-11-03 12:25 ` [igt-dev] ✓ Fi.CI.BAT: success for Added new test file pm_dc.c (rev2) Patchwork @ 2018-11-03 13:43 ` Patchwork 2018-11-21 18:10 ` Imre Deak 6 siblings, 1 reply; 14+ messages in thread From: Patchwork @ 2018-11-03 13:43 UTC (permalink / raw) To: Jyoti Yadav; +Cc: igt-dev == Series Details == Series: Added new test file pm_dc.c (rev2) URL : https://patchwork.freedesktop.org/series/51722/ State : failure == Summary == = CI Bug Log - changes from IGT_4705_full -> IGTPW_2034_full = == Summary - FAILURE == Serious unknown changes coming with IGTPW_2034_full absolutely need to be verified manually. If you think the reported changes have nothing to do with the changes introduced in IGTPW_2034_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/51722/revisions/2/mbox/ == Possible new issues == Here are the unknown changes that may have been introduced in IGTPW_2034_full: === IGT changes === ==== Possible regressions ==== igt@kms_properties@connector-properties-atomic: shard-apl: PASS -> FAIL shard-glk: PASS -> FAIL shard-hsw: PASS -> FAIL shard-kbl: PASS -> FAIL {igt@pm_dc@dc5-dpms}: shard-glk: NOTRUN -> FAIL +1 shard-apl: NOTRUN -> FAIL {igt@pm_dc@dc6-dpms}: shard-kbl: NOTRUN -> FAIL ==== Warnings ==== igt@perf_pmu@rc6: shard-kbl: SKIP -> PASS igt@pm_rc6_residency@rc6-accuracy: shard-snb: SKIP -> PASS == Known issues == Here are the changes found in IGTPW_2034_full that come from known issues: === IGT changes === ==== Issues hit ==== igt@gem_ppgtt@blt-vs-render-ctx0: shard-kbl: PASS -> INCOMPLETE (fdo#106887, fdo#103665, fdo#106023) igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a: shard-snb: PASS -> DMESG-WARN (fdo#107956) igt@kms_chv_cursor_fail@pipe-a-256x256-top-edge: shard-glk: PASS -> FAIL (fdo#104671) igt@kms_color@pipe-a-ctm-max: shard-apl: PASS -> FAIL (fdo#108147) igt@kms_cursor_crc@cursor-128x42-sliding: shard-kbl: PASS -> FAIL (fdo#103232) +1 igt@kms_cursor_crc@cursor-256x85-onscreen: shard-glk: PASS -> FAIL (fdo#103232) +4 igt@kms_cursor_crc@cursor-64x21-sliding: shard-apl: PASS -> FAIL (fdo#103232) +2 igt@kms_flip@flip-vs-expired-vblank-interruptible: shard-apl: PASS -> FAIL (fdo#102887, fdo#105363) shard-glk: PASS -> FAIL (fdo#105363) igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu: shard-glk: PASS -> FAIL (fdo#103167) +8 igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-pwrite: shard-snb: SKIP -> INCOMPLETE (fdo#105411) igt@kms_plane_alpha_blend@pipe-a-alpha-7efc: shard-apl: PASS -> FAIL (fdo#108145) igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb: shard-glk: NOTRUN -> FAIL (fdo#108145) igt@kms_plane_multiple@atomic-pipe-a-tiling-y: shard-apl: PASS -> FAIL (fdo#103166) +2 igt@kms_setmode@basic: shard-apl: PASS -> FAIL (fdo#99912) igt@kms_universal_plane@universal-plane-pipe-c-functional: shard-glk: PASS -> FAIL (fdo#103166) +7 shard-kbl: PASS -> FAIL (fdo#103166) +1 igt@kms_vblank@pipe-b-wait-forked-busy: shard-kbl: PASS -> DMESG-WARN (fdo#103558) igt@perf@blocking: shard-hsw: PASS -> FAIL (fdo#102252) ==== Possible fixes ==== igt@gem_exec_schedule@preempt-contexts-render: shard-glk: DMESG-WARN (fdo#105763, fdo#106538) -> PASS igt@gem_ppgtt@blt-vs-render-ctxn: shard-kbl: INCOMPLETE (fdo#106887, fdo#103665, fdo#106023) -> PASS igt@kms_available_modes_crc@available_mode_test_crc: shard-snb: FAIL (fdo#106641) -> PASS igt@kms_color@pipe-c-ctm-max: shard-kbl: FAIL (fdo#108147) -> PASS shard-apl: FAIL (fdo#108147) -> PASS igt@kms_color@pipe-c-legacy-gamma: shard-apl: FAIL (fdo#104782) -> PASS igt@kms_cursor_crc@cursor-256x256-dpms: shard-apl: FAIL (fdo#103232) -> PASS +1 igt@kms_cursor_crc@cursor-256x256-sliding: shard-glk: FAIL (fdo#103232) -> PASS +1 igt@kms_draw_crc@draw-method-rgb565-render-ytiled: shard-apl: INCOMPLETE (fdo#103927) -> SKIP igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt: shard-apl: FAIL (fdo#103167) -> PASS +1 igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move: shard-kbl: FAIL (fdo#103167) -> PASS +1 igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-indfb-draw-mmap-wc: shard-glk: INCOMPLETE (fdo#103359, k.org#198133) -> PASS igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-mmap-wc: shard-glk: FAIL (fdo#103167) -> PASS +2 igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes: shard-kbl: INCOMPLETE (fdo#103665) -> PASS igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb: shard-glk: FAIL (fdo#108145) -> PASS igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max: shard-apl: FAIL (fdo#108145) -> PASS igt@kms_plane_multiple@atomic-pipe-b-tiling-y: shard-glk: FAIL (fdo#103166) -> PASS +1 shard-apl: FAIL (fdo#103166) -> PASS +1 igt@kms_setmode@basic: shard-kbl: FAIL (fdo#99912) -> PASS {name}: This element is suppressed. This means it is ignored when computing the status of the difference (SUCCESS, WARNING, or FAILURE). fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252 fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887 fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166 fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167 fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232 fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359 fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558 fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665 fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927 fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671 fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782 fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363 fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411 fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763 fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023 fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538 fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641 fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887 fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956 fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145 fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147 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 (6 -> 5) == Missing (1): shard-skl == Build changes == * IGT: IGT_4705 -> IGTPW_2034 * Linux: CI_DRM_5079 -> CI_DRM_5081 CI_DRM_5079: fc3d54b430337be9c61a524c65b521761d6664a8 @ git://anongit.freedesktop.org/gfx-ci/linux CI_DRM_5081: f5e16acf6c85d38756c3efdb77ec6aede55df0ba @ git://anongit.freedesktop.org/gfx-ci/linux IGTPW_2034: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/ IGT_4705: 7983e19ed62ec8db1884f55e07e458a62cc51e37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools == Logs == For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/shards.html _______________________________________________ igt-dev mailing list igt-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/igt-dev ^ permalink raw reply [flat|nested] 14+ messages in thread
* Re: [igt-dev] ✗ Fi.CI.IGT: failure for Added new test file pm_dc.c (rev2) 2018-11-03 13:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork @ 2018-11-21 18:10 ` Imre Deak 0 siblings, 0 replies; 14+ messages in thread From: Imre Deak @ 2018-11-21 18:10 UTC (permalink / raw) To: igt-dev, Jyoti Yadav On Sat, Nov 03, 2018 at 01:43:42PM +0000, Patchwork wrote: > == Series Details == > > Series: Added new test file pm_dc.c (rev2) > URL : https://patchwork.freedesktop.org/series/51722/ > State : failure > > == Summary == > > = CI Bug Log - changes from IGT_4705_full -> IGTPW_2034_full = > > == Summary - FAILURE == > > Serious unknown changes coming with IGTPW_2034_full absolutely need to be > verified manually. > > If you think the reported changes have nothing to do with the changes > introduced in IGTPW_2034_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/51722/revisions/2/mbox/ > > == Possible new issues == > > Here are the unknown changes that may have been introduced in IGTPW_2034_full: > > === IGT changes === > > ==== Possible regressions ==== > > igt@kms_properties@connector-properties-atomic: > shard-apl: PASS -> FAIL > shard-glk: PASS -> FAIL > shard-hsw: PASS -> FAIL > shard-kbl: PASS -> FAIL > > {igt@pm_dc@dc5-dpms}: > shard-glk: NOTRUN -> FAIL +1 > shard-apl: NOTRUN -> FAIL Hm, I think we here either enter DC5 and right afterwards enter/exit DC9, or enter/exit DC9 directly without entering DC5 at all. In any case the DC9 entry/exit will zero the DC5/6 counters. Based on this to be able to test DC5 alone we'd have to save/restore the DC5/6 counters somehow across runtime suspend/resume, or just run the test with runtime PM disabled (which prevents DC9). There could be a related problem on platforms with both DC5 and 6 (ICL+) in that we may skip DC5 if DC6 is allowed (and always just enter DC6 or DC9). So this needs to be tested on such platforms. > > {igt@pm_dc@dc6-dpms}: > shard-kbl: NOTRUN -> FAIL This could be a problem where some other peripheral (SSD, network) prevents DC6, so we need to configure those properly or (if that's not possible for some reason) have some way to automatically skip the test on such configs. Do you have results for these tests that you ran on your own? Here I can only see results for the DPMS tests not the PSR ones and only on GLK/APL/KBL, as the tests were only run in shards that has only these machines and wihtout any PSR panels. > > > ==== Warnings ==== > > igt@perf_pmu@rc6: > shard-kbl: SKIP -> PASS > > igt@pm_rc6_residency@rc6-accuracy: > shard-snb: SKIP -> PASS > > > == Known issues == > > Here are the changes found in IGTPW_2034_full that come from known issues: > > === IGT changes === > > ==== Issues hit ==== > > igt@gem_ppgtt@blt-vs-render-ctx0: > shard-kbl: PASS -> INCOMPLETE (fdo#106887, fdo#103665, fdo#106023) > > igt@kms_busy@extended-pageflip-modeset-hang-oldfb-render-a: > shard-snb: PASS -> DMESG-WARN (fdo#107956) > > igt@kms_chv_cursor_fail@pipe-a-256x256-top-edge: > shard-glk: PASS -> FAIL (fdo#104671) > > igt@kms_color@pipe-a-ctm-max: > shard-apl: PASS -> FAIL (fdo#108147) > > igt@kms_cursor_crc@cursor-128x42-sliding: > shard-kbl: PASS -> FAIL (fdo#103232) +1 > > igt@kms_cursor_crc@cursor-256x85-onscreen: > shard-glk: PASS -> FAIL (fdo#103232) +4 > > igt@kms_cursor_crc@cursor-64x21-sliding: > shard-apl: PASS -> FAIL (fdo#103232) +2 > > igt@kms_flip@flip-vs-expired-vblank-interruptible: > shard-apl: PASS -> FAIL (fdo#102887, fdo#105363) > shard-glk: PASS -> FAIL (fdo#105363) > > igt@kms_frontbuffer_tracking@fbc-2p-primscrn-spr-indfb-draw-mmap-cpu: > shard-glk: PASS -> FAIL (fdo#103167) +8 > > igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-pri-indfb-draw-pwrite: > shard-snb: SKIP -> INCOMPLETE (fdo#105411) > > igt@kms_plane_alpha_blend@pipe-a-alpha-7efc: > shard-apl: PASS -> FAIL (fdo#108145) > > igt@kms_plane_alpha_blend@pipe-b-alpha-transparant-fb: > shard-glk: NOTRUN -> FAIL (fdo#108145) > > igt@kms_plane_multiple@atomic-pipe-a-tiling-y: > shard-apl: PASS -> FAIL (fdo#103166) +2 > > igt@kms_setmode@basic: > shard-apl: PASS -> FAIL (fdo#99912) > > igt@kms_universal_plane@universal-plane-pipe-c-functional: > shard-glk: PASS -> FAIL (fdo#103166) +7 > shard-kbl: PASS -> FAIL (fdo#103166) +1 > > igt@kms_vblank@pipe-b-wait-forked-busy: > shard-kbl: PASS -> DMESG-WARN (fdo#103558) > > igt@perf@blocking: > shard-hsw: PASS -> FAIL (fdo#102252) > > > ==== Possible fixes ==== > > igt@gem_exec_schedule@preempt-contexts-render: > shard-glk: DMESG-WARN (fdo#105763, fdo#106538) -> PASS > > igt@gem_ppgtt@blt-vs-render-ctxn: > shard-kbl: INCOMPLETE (fdo#106887, fdo#103665, fdo#106023) -> PASS > > igt@kms_available_modes_crc@available_mode_test_crc: > shard-snb: FAIL (fdo#106641) -> PASS > > igt@kms_color@pipe-c-ctm-max: > shard-kbl: FAIL (fdo#108147) -> PASS > shard-apl: FAIL (fdo#108147) -> PASS > > igt@kms_color@pipe-c-legacy-gamma: > shard-apl: FAIL (fdo#104782) -> PASS > > igt@kms_cursor_crc@cursor-256x256-dpms: > shard-apl: FAIL (fdo#103232) -> PASS +1 > > igt@kms_cursor_crc@cursor-256x256-sliding: > shard-glk: FAIL (fdo#103232) -> PASS +1 > > igt@kms_draw_crc@draw-method-rgb565-render-ytiled: > shard-apl: INCOMPLETE (fdo#103927) -> SKIP > > igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-draw-blt: > shard-apl: FAIL (fdo#103167) -> PASS +1 > > igt@kms_frontbuffer_tracking@fbc-1p-primscrn-spr-indfb-move: > shard-kbl: FAIL (fdo#103167) -> PASS +1 > > igt@kms_frontbuffer_tracking@fbc-2p-primscrn-pri-indfb-draw-mmap-wc: > shard-glk: INCOMPLETE (fdo#103359, k.org#198133) -> PASS > > igt@kms_frontbuffer_tracking@fbc-2p-scndscrn-cur-indfb-draw-mmap-wc: > shard-glk: FAIL (fdo#103167) -> PASS +2 > > igt@kms_plane@plane-panning-bottom-right-suspend-pipe-c-planes: > shard-kbl: INCOMPLETE (fdo#103665) -> PASS > > igt@kms_plane_alpha_blend@pipe-c-alpha-opaque-fb: > shard-glk: FAIL (fdo#108145) -> PASS > > igt@kms_plane_alpha_blend@pipe-c-constant-alpha-max: > shard-apl: FAIL (fdo#108145) -> PASS > > igt@kms_plane_multiple@atomic-pipe-b-tiling-y: > shard-glk: FAIL (fdo#103166) -> PASS +1 > shard-apl: FAIL (fdo#103166) -> PASS +1 > > igt@kms_setmode@basic: > shard-kbl: FAIL (fdo#99912) -> PASS > > > {name}: This element is suppressed. This means it is ignored when computing > the status of the difference (SUCCESS, WARNING, or FAILURE). > > fdo#102252 https://bugs.freedesktop.org/show_bug.cgi?id=102252 > fdo#102887 https://bugs.freedesktop.org/show_bug.cgi?id=102887 > fdo#103166 https://bugs.freedesktop.org/show_bug.cgi?id=103166 > fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167 > fdo#103232 https://bugs.freedesktop.org/show_bug.cgi?id=103232 > fdo#103359 https://bugs.freedesktop.org/show_bug.cgi?id=103359 > fdo#103558 https://bugs.freedesktop.org/show_bug.cgi?id=103558 > fdo#103665 https://bugs.freedesktop.org/show_bug.cgi?id=103665 > fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927 > fdo#104671 https://bugs.freedesktop.org/show_bug.cgi?id=104671 > fdo#104782 https://bugs.freedesktop.org/show_bug.cgi?id=104782 > fdo#105363 https://bugs.freedesktop.org/show_bug.cgi?id=105363 > fdo#105411 https://bugs.freedesktop.org/show_bug.cgi?id=105411 > fdo#105763 https://bugs.freedesktop.org/show_bug.cgi?id=105763 > fdo#106023 https://bugs.freedesktop.org/show_bug.cgi?id=106023 > fdo#106538 https://bugs.freedesktop.org/show_bug.cgi?id=106538 > fdo#106641 https://bugs.freedesktop.org/show_bug.cgi?id=106641 > fdo#106887 https://bugs.freedesktop.org/show_bug.cgi?id=106887 > fdo#107956 https://bugs.freedesktop.org/show_bug.cgi?id=107956 > fdo#108145 https://bugs.freedesktop.org/show_bug.cgi?id=108145 > fdo#108147 https://bugs.freedesktop.org/show_bug.cgi?id=108147 > 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 (6 -> 5) == > > Missing (1): shard-skl > > > == Build changes == > > * IGT: IGT_4705 -> IGTPW_2034 > * Linux: CI_DRM_5079 -> CI_DRM_5081 > > CI_DRM_5079: fc3d54b430337be9c61a524c65b521761d6664a8 @ git://anongit.freedesktop.org/gfx-ci/linux > CI_DRM_5081: f5e16acf6c85d38756c3efdb77ec6aede55df0ba @ git://anongit.freedesktop.org/gfx-ci/linux > IGTPW_2034: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/ > IGT_4705: 7983e19ed62ec8db1884f55e07e458a62cc51e37 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools > > == Logs == > > For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_2034/shards.html > _______________________________________________ > 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] 14+ messages in thread
* [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c
@ 2018-10-30 3:35 Jyoti Yadav
2018-10-30 3:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav
0 siblings, 1 reply; 14+ messages in thread
From: Jyoti Yadav @ 2018-10-30 3:35 UTC (permalink / raw)
To: igt-dev; +Cc: Jyoti Yadav
This patch series adds new tests to validate Display C states.
DC states like DC5 and DC6 are validated during PSR entry/exit
and during DPMS on/off cycle.
Jyoti Yadav (5):
[intel-gfx][igt-dev] lib/igt_pm: Moves Dmc_loaded() function into
library
[intel-gfx][igt-dev] tests/pm_dc: Added new test to verify Display C
States
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC6 during PSR
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC5 during DPMS
[intel-gfx][igt-dev] tests/pm_dc: Added test for DC6 during DPMS
lib/igt_pm.c | 28 ++++++
lib/igt_pm.h | 1 +
tests/Makefile.sources | 1 +
tests/meson.build | 1 +
tests/pm_dc.c | 264 +++++++++++++++++++++++++++++++++++++++++++++++++
tests/pm_rpm.c | 17 +---
6 files changed, 296 insertions(+), 16 deletions(-)
create mode 100644 tests/pm_dc.c
--
1.9.1
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev
^ permalink raw reply [flat|nested] 14+ messages in thread* [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States 2018-10-30 3:35 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav @ 2018-10-30 3:36 ` Jyoti Yadav 0 siblings, 0 replies; 14+ messages in thread From: Jyoti Yadav @ 2018-10-30 3:36 UTC (permalink / raw) To: igt-dev; +Cc: Jyoti Yadav Currently this test validates DC5 upon PSR entry for supported platforms. Added new file for compilation inside Makefile and Meson. v2: Used the debugfs entry for DC counters instead of Registers. Used shorter names for variables. Introduced timeout to read DC counters. v3: one second timeout is introduced to read DC counters. Skip the subtest if counters are not available for that platform. Signed-off-by: Jyoti Yadav <jyoti.r.yadav@intel.com> --- tests/Makefile.sources | 1 + tests/meson.build | 1 + tests/pm_dc.c | 210 +++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 212 insertions(+) create mode 100644 tests/pm_dc.c diff --git a/tests/Makefile.sources b/tests/Makefile.sources index c84933f..d491420 100644 --- a/tests/Makefile.sources +++ b/tests/Makefile.sources @@ -214,6 +214,7 @@ TESTS_progs = \ pm_lpsp \ pm_rc6_residency \ pm_rpm \ + pm_dc \ pm_rps \ pm_sseu \ prime_busy \ diff --git a/tests/meson.build b/tests/meson.build index 17deb94..50b0687 100644 --- a/tests/meson.build +++ b/tests/meson.build @@ -188,6 +188,7 @@ test_progs = [ 'pm_lpsp', 'pm_rc6_residency', 'pm_rpm', + 'pm_dc', 'pm_rps', 'pm_sseu', 'prime_busy', diff --git a/tests/pm_dc.c b/tests/pm_dc.c new file mode 100644 index 0000000..9ced34f --- /dev/null +++ b/tests/pm_dc.c @@ -0,0 +1,210 @@ +/* + * Copyright © 2018 Intel Corporation + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice (including the next + * paragraph) shall be included in all copies or substantial portions of the + * Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + */ + +#include "igt.h" +#include "igt_sysfs.h" +#include "igt_psr.h" +#include <errno.h> +#include <stdbool.h> +#include <stdio.h> +#include <string.h> +#include "intel_bufmgr.h" +#include "intel_io.h" +#include "limits.h" + + +typedef struct { + int drm_fd; + int debugfs_fd; + uint32_t devid; + igt_display_t display; + struct igt_fb fb_white; + drmModeModeInfo *mode; + igt_output_t *output; +} data_t; + +/* DC State Flags */ +#define CHECK_DC5 1 +#define CHECK_DC6 2 + +static void setup_output(data_t *data) +{ + igt_display_t *display = &data->display; + igt_output_t *output; + enum pipe pipe; + + for_each_pipe_with_valid_output(display, pipe, output) { + drmModeConnectorPtr c = output->config.connector; + + if (c->connector_type != DRM_MODE_CONNECTOR_eDP) + continue; + + igt_output_set_pipe(output, pipe); + data->output = output; + data->mode = igt_output_get_mode(output); + + return; + } +} + +static void display_init(data_t *data) +{ + igt_display_init(&data->display, data->drm_fd); + setup_output(data); +} + +static void display_fini(data_t *data) +{ + igt_display_fini(&data->display); +} + +static bool edp_psr_sink_support(data_t *data) +{ + char buf[512]; + + igt_debugfs_simple_read(data->debugfs_fd, "i915_edp_psr_status", + buf, sizeof(buf)); + + return strstr(buf, "Sink_Support: yes\n"); +} + +static void cleanup(data_t *data) +{ + igt_plane_t *primary; + + primary = igt_output_get_plane_type(data->output, + DRM_PLANE_TYPE_PRIMARY); + igt_plane_set_fb(primary, NULL); + igt_display_commit(&data->display); + igt_remove_fb(data->drm_fd, &data->fb_white); +} + +static void setup_primary(data_t *data) +{ + igt_plane_t *primary; + + primary = igt_output_get_plane_type(data->output, + DRM_PLANE_TYPE_PRIMARY); + igt_plane_set_fb(primary, NULL); + igt_create_color_fb(data->drm_fd, + data->mode->hdisplay, data->mode->vdisplay, + DRM_FORMAT_XRGB8888, + LOCAL_I915_FORMAT_MOD_X_TILED, + 1.0, 1.0, 1.0, + &data->fb_white); + igt_display_commit(&data->display); + + igt_plane_set_fb(primary, &data->fb_white); + igt_display_commit(&data->display); +} + +static uint32_t get_dc_counter(char *dc_data) +{ + char *e; + long ret; + char *s = strchr(dc_data, ':'); + + assert(s); + s++; + ret = strtol(s, &e, 10); + assert(((ret != LONG_MIN && ret != LONG_MAX) || errno != ERANGE) && + e > s && *e == '\n' && ret >= 0); + return ret; +} + +static uint32_t read_dc_counter(uint32_t drm_fd, int dc_flag) +{ + char buf[4096]; + char *str; + + igt_debugfs_read(drm_fd, "i915_dmc_info", buf); + if (dc_flag & CHECK_DC5) + str = strstr(buf, "DC3 -> DC5 count"); + else if (dc_flag & CHECK_DC6) + str = strstr(buf, "DC5 -> DC6 count"); + igt_skip_on_f(str == NULL, "DC%d counter is not available\n", + dc_flag & CHECK_DC5 ? 5 : 6); + return get_dc_counter(str); +} + +bool dc_state_wait_entry(int drm_fd, int dc_flag, int prev_dc_count) +{ + return igt_wait(read_dc_counter(drm_fd, dc_flag) > prev_dc_count, 1000, 100); +} + +void check_dc_counter(int drm_fd, int dc_flag, uint32_t prev_dc_count) +{ + igt_assert_f(dc_state_wait_entry(drm_fd, dc_flag, prev_dc_count), + "DC%d state is not achieved\n", + dc_flag & CHECK_DC5 ? 5 : 6); +} + +static void test_dc_state_psr(data_t *data, int dc_flag) +{ + uint32_t dc_counter_before_psr; + + dc_counter_before_psr = read_dc_counter(data->drm_fd, dc_flag); + setup_primary(data); + igt_assert(psr_wait_entry(data->debugfs_fd)); + check_dc_counter(data->drm_fd, dc_flag, dc_counter_before_psr); +} + +int main(int argc, char *argv[]) +{ + bool has_runtime_pm; + data_t data = {}; + + igt_skip_on_simulation(); + igt_subtest_init(argc, argv); + igt_fixture { + data.drm_fd = drm_open_driver_master(DRIVER_INTEL); + data.debugfs_fd = igt_debugfs_dir(data.drm_fd); + igt_require(data.debugfs_fd != -1); + kmstest_set_vt_graphics_mode(); + data.devid = intel_get_drm_devid(data.drm_fd); + has_runtime_pm = igt_setup_runtime_pm(); + igt_info("Runtime PM support: %d\n", has_runtime_pm); + igt_require(has_runtime_pm); + igt_require(igt_pm_dmc_loaded(data.debugfs_fd)); + display_init(&data); + } + + igt_subtest("dc5-psr") { + psr_enable(data.debugfs_fd); + igt_require_f(edp_psr_sink_support(&data), + "Sink does not support PSR\n"); + /* Check DC5 counter is available for the platform. + * Skip the test if counter is not available. + */ + read_dc_counter(data.drm_fd, CHECK_DC5); + test_dc_state_psr(&data, CHECK_DC5); + cleanup(&data); + } + igt_fixture { + close(data.debugfs_fd); + display_fini(&data); + } + + igt_exit(); +} -- 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] 14+ messages in thread
end of thread, other threads:[~2018-11-21 18:11 UTC | newest] Thread overview: 14+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2018-11-03 11:36 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 1/5] [intel-gfx] lib/igt_pm: Moves Dmc_loaded() function into library Jyoti Yadav 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav 2018-11-21 17:39 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 3/5] [intel-gfx] tests/pm_dc: Added test for DC6 during PSR Jyoti Yadav 2018-11-21 17:40 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 4/5] [intel-gfx] tests/pm_dc: Added test for DC5 during DPMS Jyoti Yadav 2018-11-21 17:42 ` Imre Deak 2018-11-03 11:36 ` [igt-dev] [PATCH i-g-t v3 5/5] [intel-gfx] tests/pm_dc: Added test for DC6 " Jyoti Yadav 2018-11-21 17:43 ` Imre Deak 2018-11-03 12:25 ` [igt-dev] ✓ Fi.CI.BAT: success for Added new test file pm_dc.c (rev2) Patchwork 2018-11-03 13:43 ` [igt-dev] ✗ Fi.CI.IGT: failure " Patchwork 2018-11-21 18:10 ` Imre Deak -- strict thread matches above, loose matches on Subject: below -- 2018-10-30 3:35 [igt-dev] [PATCH i-g-t v3 0/5] Added new test file pm_dc.c Jyoti Yadav 2018-10-30 3:36 ` [igt-dev] [PATCH i-g-t v3 2/5] [intel-gfx] tests/pm_dc: Added new test to verify Display C States Jyoti Yadav
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox