diff mbox

[5/5] tests/kms_psr_sink_crc: Dry run with PSR disabled.

Message ID 1409869371-7558-5-git-send-email-rodrigo.vivi@intel.com (mailing list archive)
State New, archived
Headers show

Commit Message

Rodrigo Vivi Sept. 4, 2014, 10:22 p.m. UTC
This allows to run tests with psr disabled and know what to expect when
PSR is actually enabled.

Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
---
 tests/kms_psr_sink_crc.c | 8 ++++++++
 1 file changed, 8 insertions(+)

Comments

Daniel Vetter Sept. 5, 2014, 8:23 a.m. UTC | #1
On Thu, Sep 04, 2014 at 06:22:51PM -0400, Rodrigo Vivi wrote:
> This allows to run tests with psr disabled and know what to expect when
> PSR is actually enabled.
> 
> Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>

I don't really follow what this is useful for ... Can you please elaborate
how this is used and how it helps debugging?
-Daniel

> ---
>  tests/kms_psr_sink_crc.c | 8 ++++++++
>  1 file changed, 8 insertions(+)
> 
> diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> index 51e54a7..1380ca4 100644
> --- a/tests/kms_psr_sink_crc.c
> +++ b/tests/kms_psr_sink_crc.c
> @@ -72,6 +72,7 @@ typedef struct {
>  	igt_display_t display;
>  	struct igt_fb fb[2];
>  	igt_plane_t *plane[2];
> +	bool running_with_psr_disabled;
>  } data_t;
>  
>  static const char *tests_str(enum tests test)
> @@ -264,6 +265,9 @@ static bool psr_enabled(data_t *data)
>  	FILE *file;
>  	char str[4];
>  
> +	if (data->running_with_psr_disabled)
> +		return true;
> +
>  	file = igt_debugfs_fopen("i915_edp_psr_status", "r");
>  	igt_require(file);
>  
> @@ -284,6 +288,9 @@ static bool psr_active(data_t *data)
>  	FILE *file;
>  	char str[4];
>  
> +	if (data->running_with_psr_disabled)
> +		return true;
> +
>  	file = igt_debugfs_fopen("i915_edp_psr_status", "r");
>  	igt_require(file);
>  
> @@ -604,6 +611,7 @@ igt_main
>  		kmstest_set_vt_graphics_mode();
>  
>  		data.devid = intel_get_drm_devid(data.drm_fd);
> +		data.running_with_psr_disabled = igt_dry_run;
>  
>  		igt_skip_on(!psr_enabled(&data));
>  
> -- 
> 1.9.3
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Rodrigo Vivi Sept. 5, 2014, 3:51 p.m. UTC | #2
I really didn't like this implementation because I'm using the global
variable in the test case.

So I think also providing a define igt_skip_function_on_dryrun()  if
(igt_dry_run) return 0 is more igt like.

For psr I need a way to run the testcases even when PSR is disabled to know
what to expect. So dryrun on psr test case means runs even with psr
disabled.
For any other feature could be something similar, run with feature
disabled. Or also it can be used for any other big testcase using a local
assert that do this plus igt_assert next so it can avoid fails and execute
the test to the end just to check all interactions.

So, what do you think? I could live with my old define on code though...





On Fri, Sep 5, 2014 at 1:23 AM, Daniel Vetter <daniel@ffwll.ch> wrote:

> On Thu, Sep 04, 2014 at 06:22:51PM -0400, Rodrigo Vivi wrote:
> > This allows to run tests with psr disabled and know what to expect when
> > PSR is actually enabled.
> >
> > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
>
> I don't really follow what this is useful for ... Can you please elaborate
> how this is used and how it helps debugging?
> -Daniel
>
> > ---
> >  tests/kms_psr_sink_crc.c | 8 ++++++++
> >  1 file changed, 8 insertions(+)
> >
> > diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> > index 51e54a7..1380ca4 100644
> > --- a/tests/kms_psr_sink_crc.c
> > +++ b/tests/kms_psr_sink_crc.c
> > @@ -72,6 +72,7 @@ typedef struct {
> >       igt_display_t display;
> >       struct igt_fb fb[2];
> >       igt_plane_t *plane[2];
> > +     bool running_with_psr_disabled;
> >  } data_t;
> >
> >  static const char *tests_str(enum tests test)
> > @@ -264,6 +265,9 @@ static bool psr_enabled(data_t *data)
> >       FILE *file;
> >       char str[4];
> >
> > +     if (data->running_with_psr_disabled)
> > +             return true;
> > +
> >       file = igt_debugfs_fopen("i915_edp_psr_status", "r");
> >       igt_require(file);
> >
> > @@ -284,6 +288,9 @@ static bool psr_active(data_t *data)
> >       FILE *file;
> >       char str[4];
> >
> > +     if (data->running_with_psr_disabled)
> > +             return true;
> > +
> >       file = igt_debugfs_fopen("i915_edp_psr_status", "r");
> >       igt_require(file);
> >
> > @@ -604,6 +611,7 @@ igt_main
> >               kmstest_set_vt_graphics_mode();
> >
> >               data.devid = intel_get_drm_devid(data.drm_fd);
> > +             data.running_with_psr_disabled = igt_dry_run;
> >
> >               igt_skip_on(!psr_enabled(&data));
> >
> > --
> > 1.9.3
> >
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
> --
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>
Daniel Vetter Sept. 8, 2014, 7:49 a.m. UTC | #3
On Fri, Sep 05, 2014 at 08:51:03AM -0700, Rodrigo Vivi wrote:
> I really didn't like this implementation because I'm using the global
> variable in the test case.
> 
> So I think also providing a define igt_skip_function_on_dryrun()  if
> (igt_dry_run) return 0 is more igt like.
> 
> For psr I need a way to run the testcases even when PSR is disabled to know
> what to expect. So dryrun on psr test case means runs even with psr
> disabled.
> For any other feature could be something similar, run with feature
> disabled. Or also it can be used for any other big testcase using a local
> assert that do this plus igt_assert next so it can avoid fails and execute
> the test to the end just to check all interactions.
> 
> So, what do you think? I could live with my old define on code though...

I'd just add a --dry-run option to the psr testcase here. With the recent
work to unify option parsing it's fairly simple to add test-specific
options. And I don't really see a use-case for a generic dry-run flag
outside of this testcase. Or at least not one which means the same thing
in all tests - I expect each test will want to have different kinds of
dry-run behaviour.
-Daniel


> 
> 
> 
> 
> 
> On Fri, Sep 5, 2014 at 1:23 AM, Daniel Vetter <daniel@ffwll.ch> wrote:
> 
> > On Thu, Sep 04, 2014 at 06:22:51PM -0400, Rodrigo Vivi wrote:
> > > This allows to run tests with psr disabled and know what to expect when
> > > PSR is actually enabled.
> > >
> > > Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
> >
> > I don't really follow what this is useful for ... Can you please elaborate
> > how this is used and how it helps debugging?
> > -Daniel
> >
> > > ---
> > >  tests/kms_psr_sink_crc.c | 8 ++++++++
> > >  1 file changed, 8 insertions(+)
> > >
> > > diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
> > > index 51e54a7..1380ca4 100644
> > > --- a/tests/kms_psr_sink_crc.c
> > > +++ b/tests/kms_psr_sink_crc.c
> > > @@ -72,6 +72,7 @@ typedef struct {
> > >       igt_display_t display;
> > >       struct igt_fb fb[2];
> > >       igt_plane_t *plane[2];
> > > +     bool running_with_psr_disabled;
> > >  } data_t;
> > >
> > >  static const char *tests_str(enum tests test)
> > > @@ -264,6 +265,9 @@ static bool psr_enabled(data_t *data)
> > >       FILE *file;
> > >       char str[4];
> > >
> > > +     if (data->running_with_psr_disabled)
> > > +             return true;
> > > +
> > >       file = igt_debugfs_fopen("i915_edp_psr_status", "r");
> > >       igt_require(file);
> > >
> > > @@ -284,6 +288,9 @@ static bool psr_active(data_t *data)
> > >       FILE *file;
> > >       char str[4];
> > >
> > > +     if (data->running_with_psr_disabled)
> > > +             return true;
> > > +
> > >       file = igt_debugfs_fopen("i915_edp_psr_status", "r");
> > >       igt_require(file);
> > >
> > > @@ -604,6 +611,7 @@ igt_main
> > >               kmstest_set_vt_graphics_mode();
> > >
> > >               data.devid = intel_get_drm_devid(data.drm_fd);
> > > +             data.running_with_psr_disabled = igt_dry_run;
> > >
> > >               igt_skip_on(!psr_enabled(&data));
> > >
> > > --
> > > 1.9.3
> > >
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> > --
> > Daniel Vetter
> > Software Engineer, Intel Corporation
> > +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >
> 
> 
> 
> -- 
> Rodrigo Vivi
> Blog: http://blog.vivi.eng.br
diff mbox

Patch

diff --git a/tests/kms_psr_sink_crc.c b/tests/kms_psr_sink_crc.c
index 51e54a7..1380ca4 100644
--- a/tests/kms_psr_sink_crc.c
+++ b/tests/kms_psr_sink_crc.c
@@ -72,6 +72,7 @@  typedef struct {
 	igt_display_t display;
 	struct igt_fb fb[2];
 	igt_plane_t *plane[2];
+	bool running_with_psr_disabled;
 } data_t;
 
 static const char *tests_str(enum tests test)
@@ -264,6 +265,9 @@  static bool psr_enabled(data_t *data)
 	FILE *file;
 	char str[4];
 
+	if (data->running_with_psr_disabled)
+		return true;
+
 	file = igt_debugfs_fopen("i915_edp_psr_status", "r");
 	igt_require(file);
 
@@ -284,6 +288,9 @@  static bool psr_active(data_t *data)
 	FILE *file;
 	char str[4];
 
+	if (data->running_with_psr_disabled)
+		return true;
+
 	file = igt_debugfs_fopen("i915_edp_psr_status", "r");
 	igt_require(file);
 
@@ -604,6 +611,7 @@  igt_main
 		kmstest_set_vt_graphics_mode();
 
 		data.devid = intel_get_drm_devid(data.drm_fd);
+		data.running_with_psr_disabled = igt_dry_run;
 
 		igt_skip_on(!psr_enabled(&data));