All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH i-g-t 1/2] lib: Require drmModeResources()
@ 2018-09-13 13:24 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-13 13:24 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

If modesetting is not supported, the drmModeGetResources() call will
fail with -EINVAL (or -ENOTSUPP). As no displays are connected, skip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3e0a07b98..0e6f91475 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1857,7 +1857,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 
 	resources = drmModeGetResources(display->drm_fd);
-	igt_assert(resources);
+	igt_require(resources);
 
 	/*
 	 * We cache the number of pipes, that number is a physical limit of the
-- 
2.19.0

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

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

* [igt-dev] [PATCH i-g-t 1/2] lib: Require drmModeResources()
@ 2018-09-13 13:24 ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-13 13:24 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

If modesetting is not supported, the drmModeGetResources() call will
fail with -EINVAL (or -ENOTSUPP). As no displays are connected, skip.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 3e0a07b98..0e6f91475 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1857,7 +1857,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 
 	resources = drmModeGetResources(display->drm_fd);
-	igt_assert(resources);
+	igt_require(resources);
 
 	/*
 	 * We cache the number of pipes, that number is a physical limit of the
-- 
2.19.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [PATCH i-g-t 2/2] lib: Skip drmModeReources()
  2018-09-13 13:24 ` [igt-dev] " Chris Wilson
@ 2018-09-13 13:24   ` Chris Wilson
  -1 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-13 13:24 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

An alternative to requiring the display is to mark the attached display
as empty (no available CRTC, no outputs) and let the tests skip if they
required any output. This allows the binary to open the display once in
its global fixture, even if it doesn't use the display in every subtest
and so avoid skipping the subtests that didn't require the display.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0e6f91475..b38d64415 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1857,7 +1857,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 
 	resources = drmModeGetResources(display->drm_fd);
-	igt_require(resources);
+	if (!resources)
+		goto out;
 
 	/*
 	 * We cache the number of pipes, that number is a physical limit of the
@@ -2005,6 +2006,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	igt_display_reset(display);
 	igt_kms_disallow_hotplug(drm_fd);
 
+out:
 	LOG_UNINDENT(display);
 }
 
-- 
2.19.0

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

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

* [igt-dev] [PATCH i-g-t 2/2] lib: Skip drmModeReources()
@ 2018-09-13 13:24   ` Chris Wilson
  0 siblings, 0 replies; 7+ messages in thread
From: Chris Wilson @ 2018-09-13 13:24 UTC (permalink / raw)
  To: igt-dev; +Cc: intel-gfx

An alternative to requiring the display is to mark the attached display
as empty (no available CRTC, no outputs) and let the tests skip if they
required any output. This allows the binary to open the display once in
its global fixture, even if it doesn't use the display in every subtest
and so avoid skipping the subtests that didn't require the display.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
---
 lib/igt_kms.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 0e6f91475..b38d64415 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -1857,7 +1857,8 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	display->drm_fd = drm_fd;
 
 	resources = drmModeGetResources(display->drm_fd);
-	igt_require(resources);
+	if (!resources)
+		goto out;
 
 	/*
 	 * We cache the number of pipes, that number is a physical limit of the
@@ -2005,6 +2006,7 @@ void igt_display_init(igt_display_t *display, int drm_fd)
 	igt_display_reset(display);
 	igt_kms_disallow_hotplug(drm_fd);
 
+out:
 	LOG_UNINDENT(display);
 }
 
-- 
2.19.0

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] lib: Require drmModeResources()
  2018-09-13 13:24 ` [igt-dev] " Chris Wilson
  (?)
  (?)
@ 2018-09-13 14:19 ` Patchwork
  -1 siblings, 0 replies; 7+ messages in thread
From: Patchwork @ 2018-09-13 14:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: series starting with [i-g-t,1/2] lib: Require drmModeResources()
URL   : https://patchwork.freedesktop.org/series/49642/
State : failure

== Summary ==

Applying: lib: Require drmModeResources()
Applying: lib: Skip drmModeReources()
Patch failed at 0002 lib: Skip drmModeReources()
Use 'git am --show-current-patch' to see the failed patch
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

* Re: [igt-dev] [PATCH i-g-t 1/2] lib: Require drmModeResources()
  2018-09-13 13:24 ` [igt-dev] " Chris Wilson
@ 2018-09-13 20:42   ` Souza, Jose
  -1 siblings, 0 replies; 7+ messages in thread
From: Souza, Jose @ 2018-09-13 20:42 UTC (permalink / raw)
  To: igt-dev, chris; +Cc: intel-gfx

On Thu, 2018-09-13 at 14:24 +0100, Chris Wilson wrote:
> If modesetting is not supported, the drmModeGetResources() call will
> fail with -EINVAL (or -ENOTSUPP). As no displays are connected, skip.

This one sounds better than the second patch to me.
I just sent this patch together with other patch skiping the tests not
handled by this one.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 3e0a07b98..0e6f91475 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1857,7 +1857,7 @@ void igt_display_init(igt_display_t *display,
> int drm_fd)
>  	display->drm_fd = drm_fd;
>  
>  	resources = drmModeGetResources(display->drm_fd);
> -	igt_assert(resources);
> +	igt_require(resources);
>  
>  	/*
>  	 * We cache the number of pipes, that number is a physical
> limit of the
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [igt-dev] [PATCH i-g-t 1/2] lib: Require drmModeResources()
@ 2018-09-13 20:42   ` Souza, Jose
  0 siblings, 0 replies; 7+ messages in thread
From: Souza, Jose @ 2018-09-13 20:42 UTC (permalink / raw)
  To: igt-dev, chris; +Cc: intel-gfx

On Thu, 2018-09-13 at 14:24 +0100, Chris Wilson wrote:
> If modesetting is not supported, the drmModeGetResources() call will
> fail with -EINVAL (or -ENOTSUPP). As no displays are connected, skip.

This one sounds better than the second patch to me.
I just sent this patch together with other patch skiping the tests not
handled by this one.

Reviewed-by: José Roberto de Souza <jose.souza@intel.com>

> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> ---
>  lib/igt_kms.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/igt_kms.c b/lib/igt_kms.c
> index 3e0a07b98..0e6f91475 100644
> --- a/lib/igt_kms.c
> +++ b/lib/igt_kms.c
> @@ -1857,7 +1857,7 @@ void igt_display_init(igt_display_t *display,
> int drm_fd)
>  	display->drm_fd = drm_fd;
>  
>  	resources = drmModeGetResources(display->drm_fd);
> -	igt_assert(resources);
> +	igt_require(resources);
>  
>  	/*
>  	 * We cache the number of pipes, that number is a physical
> limit of the
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

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

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

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-13 13:24 [PATCH i-g-t 1/2] lib: Require drmModeResources() Chris Wilson
2018-09-13 13:24 ` [igt-dev] " Chris Wilson
2018-09-13 13:24 ` [PATCH i-g-t 2/2] lib: Skip drmModeReources() Chris Wilson
2018-09-13 13:24   ` [igt-dev] " Chris Wilson
2018-09-13 14:19 ` [igt-dev] ✗ Fi.CI.BAT: failure for series starting with [i-g-t,1/2] lib: Require drmModeResources() Patchwork
2018-09-13 20:42 ` [igt-dev] [PATCH i-g-t 1/2] " Souza, Jose
2018-09-13 20:42   ` Souza, Jose

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.