[RESEND] lib/kms: Enable outputs by default in igt_require_display

Submitted by Daniel Vetter on Dec. 7, 2018, 2:01 p.m.

Details

Message ID 20181207140107.25360-1-daniel.vetter@ffwll.ch
State New
Series "lib/kms: Enable outputs by default in igt_require_display"
Headers show

Commit Message

Daniel Vetter Dec. 7, 2018, 2:01 p.m.
More testing, automatically when using the high-level kms helpers!

Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
---
 lib/igt_kms.c                | 6 +++++-
 tests/kms_invalid_dotclock.c | 1 -
 tests/kms_pipe_crc_basic.c   | 2 --
 3 files changed, 5 insertions(+), 4 deletions(-)

Patch hide | download patch | download mbox

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index e5f42a6bbcbb..684a599ca674 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -2035,7 +2035,11 @@  void igt_display_require(igt_display_t *display, int drm_fd)
 out:
 	LOG_UNINDENT(display);
 
-	igt_require(display->n_pipes && display->n_outputs);
+	if (display->n_pipes && display->n_outputs)
+		igt_enable_connectors(drm_fd);
+	else
+		igt_skip("No KMS driver or no outputs, pipes: %d, outputs: %d\n",
+			 display->n_pipes, display->n_outputs);
 }
 
 /**
diff --git a/tests/kms_invalid_dotclock.c b/tests/kms_invalid_dotclock.c
index 8c4c3122bec1..275007df942d 100644
--- a/tests/kms_invalid_dotclock.c
+++ b/tests/kms_invalid_dotclock.c
@@ -131,7 +131,6 @@  igt_simple_main
 	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
 	igt_require_intel(data.drm_fd);
 
-	igt_enable_connectors(data.drm_fd);
 	kmstest_set_vt_graphics_mode();
 
 	igt_display_require(&data.display, data.drm_fd);
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 5bc0952fca3d..60802848d3ee 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -181,8 +181,6 @@  igt_main
 	igt_fixture {
 		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
 
-		igt_enable_connectors(data.drm_fd);
-
 		kmstest_set_vt_graphics_mode();
 
 		igt_require_pipe_crc(data.drm_fd);

Comments

Maarten Lankhorst Dec. 7, 2018, 2:21 p.m.
Op 07-12-2018 om 15:01 schreef Daniel Vetter:
> More testing, automatically when using the high-level kms helpers!
>
> Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> ---
>  lib/igt_kms.c                | 6 +++++-
>  tests/kms_invalid_dotclock.c | 1 -
>  tests/kms_pipe_crc_basic.c   | 2 --
>  3 files changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index e5f42a6bbcbb..684a599ca674 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -2035,7 +2035,11 @@ void igt_display_require(igt_display_t *display, int drm_fd)
>  out:
>  	LOG_UNINDENT(display);
>  
> -	igt_require(display->n_pipes && display->n_outputs);
> +	if (display->n_pipes && display->n_outputs)
> +		igt_enable_connectors(drm_fd);
> +	else
> +		igt_skip("No KMS driver or no outputs, pipes: %d, outputs: %d\n",
> +			 display->n_pipes, display->n_outputs);
>  }
>  
>  /**
> diff --git a/tests/kms_invalid_dotclock.c b/tests/kms_invalid_dotclock.c
> index 8c4c3122bec1..275007df942d 100644
> --- a/tests/kms_invalid_dotclock.c
> +++ b/tests/kms_invalid_dotclock.c
> @@ -131,7 +131,6 @@ igt_simple_main
>  	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
>  	igt_require_intel(data.drm_fd);
>  
> -	igt_enable_connectors(data.drm_fd);
>  	kmstest_set_vt_graphics_mode();
>  
>  	igt_display_require(&data.display, data.drm_fd);
> diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> index 5bc0952fca3d..60802848d3ee 100644
> --- a/tests/kms_pipe_crc_basic.c
> +++ b/tests/kms_pipe_crc_basic.c
> @@ -181,8 +181,6 @@ igt_main
>  	igt_fixture {
>  		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
>  
> -		igt_enable_connectors(data.drm_fd);
> -
>  		kmstest_set_vt_graphics_mode();
>  
>  		igt_require_pipe_crc(data.drm_fd);

At some point we should integrate chamelium too?

Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Daniel Vetter Dec. 7, 2018, 3 p.m.
On Fri, Dec 07, 2018 at 03:21:34PM +0100, Maarten Lankhorst wrote:
> Op 07-12-2018 om 15:01 schreef Daniel Vetter:
> > More testing, automatically when using the high-level kms helpers!
> >
> > Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
> > Signed-off-by: Daniel Vetter <daniel.vetter@intel.com>
> > ---
> >  lib/igt_kms.c                | 6 +++++-
> >  tests/kms_invalid_dotclock.c | 1 -
> >  tests/kms_pipe_crc_basic.c   | 2 --
> >  3 files changed, 5 insertions(+), 4 deletions(-)
> >
> > diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> > index e5f42a6bbcbb..684a599ca674 100644
> > --- a/lib/igt_kms.c
> > +++ b/lib/igt_kms.c
> > @@ -2035,7 +2035,11 @@ void igt_display_require(igt_display_t *display, int drm_fd)
> >  out:
> >  	LOG_UNINDENT(display);
> >  
> > -	igt_require(display->n_pipes && display->n_outputs);
> > +	if (display->n_pipes && display->n_outputs)
> > +		igt_enable_connectors(drm_fd);
> > +	else
> > +		igt_skip("No KMS driver or no outputs, pipes: %d, outputs: %d\n",
> > +			 display->n_pipes, display->n_outputs);
> >  }
> >  
> >  /**
> > diff --git a/tests/kms_invalid_dotclock.c b/tests/kms_invalid_dotclock.c
> > index 8c4c3122bec1..275007df942d 100644
> > --- a/tests/kms_invalid_dotclock.c
> > +++ b/tests/kms_invalid_dotclock.c
> > @@ -131,7 +131,6 @@ igt_simple_main
> >  	data.drm_fd = drm_open_driver_master(DRIVER_INTEL);
> >  	igt_require_intel(data.drm_fd);
> >  
> > -	igt_enable_connectors(data.drm_fd);
> >  	kmstest_set_vt_graphics_mode();
> >  
> >  	igt_display_require(&data.display, data.drm_fd);
> > diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
> > index 5bc0952fca3d..60802848d3ee 100644
> > --- a/tests/kms_pipe_crc_basic.c
> > +++ b/tests/kms_pipe_crc_basic.c
> > @@ -181,8 +181,6 @@ igt_main
> >  	igt_fixture {
> >  		data.drm_fd = drm_open_driver_master(DRIVER_ANY);
> >  
> > -		igt_enable_connectors(data.drm_fd);
> > -
> >  		kmstest_set_vt_graphics_mode();
> >  
> >  		igt_require_pipe_crc(data.drm_fd);
> 
> At some point we should integrate chamelium too?

Hm, I thought chamelium is enabled by default? But yeah, if not we should
definitely make sure that's the case.

> Reviewed-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>

Thanks for the review.
-Daniel