All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt 1/2] lib: Acquire master for pollable spinbatch on gen4/5
@ 2018-04-05 18:47 ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-05 18:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

gen4/5 require a DRM_MASTER to use MI_STORE_DW, make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/igt_dummyload.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 98ab7ac2..ba917ba5 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -31,6 +31,7 @@
 
 #include "igt_core.h"
 #include "drmtest.h"
+#include "igt_device.h"
 #include "igt_dummyload.h"
 #include "igt_gt.h"
 #include "intel_chipset.h"
@@ -144,8 +145,10 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
 
 		igt_assert(!dep);
 
-		if (gen == 4 || gen == 5)
+		if (gen == 4 || gen == 5) {
 			execbuf->flags |= I915_EXEC_SECURE;
+			igt_require(__igt_device_set_master(fd) == 0);
+		}
 
 		spin->poll_handle = gem_create(fd, 4096);
 
-- 
2.16.3

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

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

* [igt-dev] [PATCH igt 1/2] lib: Acquire master for pollable spinbatch on gen4/5
@ 2018-04-05 18:47 ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-05 18:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin

gen4/5 require a DRM_MASTER to use MI_STORE_DW, make it so.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 lib/igt_dummyload.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
index 98ab7ac2..ba917ba5 100644
--- a/lib/igt_dummyload.c
+++ b/lib/igt_dummyload.c
@@ -31,6 +31,7 @@
 
 #include "igt_core.h"
 #include "drmtest.h"
+#include "igt_device.h"
 #include "igt_dummyload.h"
 #include "igt_gt.h"
 #include "intel_chipset.h"
@@ -144,8 +145,10 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
 
 		igt_assert(!dep);
 
-		if (gen == 4 || gen == 5)
+		if (gen == 4 || gen == 5) {
 			execbuf->flags |= I915_EXEC_SECURE;
+			igt_require(__igt_device_set_master(fd) == 0);
+		}
 
 		spin->poll_handle = gem_create(fd, 4096);
 
-- 
2.16.3

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

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

* [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
  2018-04-05 18:47 ` [igt-dev] " Chris Wilson
@ 2018-04-05 18:47   ` Chris Wilson
  -1 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-05 18:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev

As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
to drop master on the original before we are allowed to claim DRM_MASTER
on the second.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/gem_eio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 9599e73d..66d8c18a 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -41,6 +41,7 @@
 #include <drm.h>
 
 #include "igt.h"
+#include "igt_device.h"
 #include "igt_sysfs.h"
 #include "sw_sync.h"
 
@@ -674,6 +675,7 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		igt_device_drop_master(fd);
 
 		igt_require(i915_reset_control(true));
 		igt_force_gpu_reset(fd);
-- 
2.16.3

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

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

* [igt-dev] [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
@ 2018-04-05 18:47   ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-05 18:47 UTC (permalink / raw)
  To: intel-gfx; +Cc: igt-dev, Tvrtko Ursulin

As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
to drop master on the original before we are allowed to claim DRM_MASTER
on the second.

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
---
 tests/gem_eio.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/tests/gem_eio.c b/tests/gem_eio.c
index 9599e73d..66d8c18a 100644
--- a/tests/gem_eio.c
+++ b/tests/gem_eio.c
@@ -41,6 +41,7 @@
 #include <drm.h>
 
 #include "igt.h"
+#include "igt_device.h"
 #include "igt_sysfs.h"
 #include "sw_sync.h"
 
@@ -674,6 +675,7 @@ igt_main
 
 	igt_fixture {
 		fd = drm_open_driver(DRIVER_INTEL);
+		igt_device_drop_master(fd);
 
 		igt_require(i915_reset_control(true));
 		igt_force_gpu_reset(fd);
-- 
2.16.3

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

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

* [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Acquire master for pollable spinbatch on gen4/5
  2018-04-05 18:47 ` [igt-dev] " Chris Wilson
  (?)
  (?)
@ 2018-04-05 19:19 ` Patchwork
  -1 siblings, 0 replies; 13+ messages in thread
From: Patchwork @ 2018-04-05 19:19 UTC (permalink / raw)
  To: Chris Wilson; +Cc: igt-dev

== Series Details ==

Series: series starting with [1/2] lib: Acquire master for pollable spinbatch on gen4/5
URL   : https://patchwork.freedesktop.org/series/41228/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
164b4a3ab34bd7d18d34181c62bfaedb906a76e3 blacklist: Don't run tests on pipe-d, pipe-e or pipe-f

with latest DRM-Tip kernel build CI_DRM_4026
fcaf73c13c14 drm-tip: 2018y-04m-05d-15h-53m-18s UTC integration manifest

No testlist changes.

---- Possible new issues:

Test kms_force_connector_basic:
        Subgroup prune-stale-modes:
                pass       -> SKIP       (fi-ivb-3520m)

---- Known issues:

Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                dmesg-warn -> PASS       (fi-cnl-y3) fdo#104951
Test prime_vgem:
        Subgroup basic-fence-flip:
                fail       -> PASS       (fi-ilk-650) fdo#104008

fdo#104951 https://bugs.freedesktop.org/show_bug.cgi?id=104951
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:285  pass:264  dwarn:0   dfail:0   fail:0   skip:21  time:431s
fi-bdw-gvtdvm    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:442s
fi-blb-e6850     total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:386s
fi-bsw-n3050     total:285  pass:239  dwarn:0   dfail:0   fail:0   skip:46  time:546s
fi-bwr-2160      total:285  pass:180  dwarn:0   dfail:0   fail:0   skip:105 time:298s
fi-bxt-dsi       total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:518s
fi-bxt-j4205     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:516s
fi-byt-j1900     total:285  pass:250  dwarn:0   dfail:0   fail:0   skip:35  time:521s
fi-byt-n2820     total:285  pass:246  dwarn:0   dfail:0   fail:0   skip:39  time:508s
fi-cfl-8700k     total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:409s
fi-cfl-s3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:561s
fi-cfl-u         total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:515s
fi-cnl-y3        total:285  pass:259  dwarn:0   dfail:0   fail:0   skip:26  time:581s
fi-elk-e7500     total:285  pass:226  dwarn:0   dfail:0   fail:0   skip:59  time:425s
fi-gdg-551       total:285  pass:177  dwarn:0   dfail:0   fail:0   skip:108 time:315s
fi-glk-1         total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:542s
fi-glk-j4005     total:285  pass:256  dwarn:0   dfail:0   fail:0   skip:29  time:486s
fi-hsw-4770      total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:404s
fi-ilk-650       total:285  pass:225  dwarn:0   dfail:0   fail:0   skip:60  time:432s
fi-ivb-3520m     total:285  pass:255  dwarn:0   dfail:0   fail:0   skip:30  time:470s
fi-ivb-3770      total:285  pass:252  dwarn:0   dfail:0   fail:0   skip:33  time:437s
fi-kbl-7500u     total:285  pass:260  dwarn:1   dfail:0   fail:0   skip:24  time:475s
fi-kbl-7567u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:466s
fi-kbl-r         total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:510s
fi-pnv-d510      total:285  pass:220  dwarn:1   dfail:0   fail:0   skip:64  time:673s
fi-skl-6260u     total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:444s
fi-skl-6600u     total:285  pass:258  dwarn:0   dfail:0   fail:0   skip:27  time:532s
fi-skl-6700k2    total:285  pass:261  dwarn:0   dfail:0   fail:0   skip:24  time:502s
fi-skl-6770hq    total:285  pass:265  dwarn:0   dfail:0   fail:0   skip:20  time:511s
fi-skl-guc       total:285  pass:257  dwarn:0   dfail:0   fail:0   skip:28  time:428s
fi-skl-gvtdvm    total:285  pass:262  dwarn:0   dfail:0   fail:0   skip:23  time:444s
fi-snb-2520m     total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:582s
fi-snb-2600      total:285  pass:245  dwarn:0   dfail:0   fail:0   skip:40  time:399s
Blacklisted hosts:
fi-cnl-psr       total:285  pass:256  dwarn:3   dfail:0   fail:0   skip:26  time:536s

== Logs ==

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

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

* Re: [PATCH igt 1/2] lib: Acquire master for pollable spinbatch on gen4/5
  2018-04-05 18:47 ` [igt-dev] " Chris Wilson
@ 2018-04-06  8:24   ` Tvrtko Ursulin
  -1 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  8:24 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 05/04/2018 19:47, Chris Wilson wrote:
> gen4/5 require a DRM_MASTER to use MI_STORE_DW, make it so.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   lib/igt_dummyload.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 98ab7ac2..ba917ba5 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -31,6 +31,7 @@
>   
>   #include "igt_core.h"
>   #include "drmtest.h"
> +#include "igt_device.h"
>   #include "igt_dummyload.h"
>   #include "igt_gt.h"
>   #include "intel_chipset.h"
> @@ -144,8 +145,10 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
>   
>   		igt_assert(!dep);
>   
> -		if (gen == 4 || gen == 5)
> +		if (gen == 4 || gen == 5) {
>   			execbuf->flags |= I915_EXEC_SECURE;
> +			igt_require(__igt_device_set_master(fd) == 0);
> +		}
>   
>   		spin->poll_handle = gem_create(fd, 4096);
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [igt-dev] [Intel-gfx] [PATCH igt 1/2] lib: Acquire master for pollable spinbatch on gen4/5
@ 2018-04-06  8:24   ` Tvrtko Ursulin
  0 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  8:24 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 05/04/2018 19:47, Chris Wilson wrote:
> gen4/5 require a DRM_MASTER to use MI_STORE_DW, make it so.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   lib/igt_dummyload.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/lib/igt_dummyload.c b/lib/igt_dummyload.c
> index 98ab7ac2..ba917ba5 100644
> --- a/lib/igt_dummyload.c
> +++ b/lib/igt_dummyload.c
> @@ -31,6 +31,7 @@
>   
>   #include "igt_core.h"
>   #include "drmtest.h"
> +#include "igt_device.h"
>   #include "igt_dummyload.h"
>   #include "igt_gt.h"
>   #include "intel_chipset.h"
> @@ -144,8 +145,10 @@ emit_recursive_batch(igt_spin_t *spin, int fd, uint32_t ctx, unsigned engine,
>   
>   		igt_assert(!dep);
>   
> -		if (gen == 4 || gen == 5)
> +		if (gen == 4 || gen == 5) {
>   			execbuf->flags |= I915_EXEC_SECURE;
> +			igt_require(__igt_device_set_master(fd) == 0);
> +		}
>   
>   		spin->poll_handle = gem_create(fd, 4096);
>   
> 

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Regards,

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

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

* Re: [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
  2018-04-05 18:47   ` [igt-dev] " Chris Wilson
@ 2018-04-06  8:35     ` Tvrtko Ursulin
  -1 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  8:35 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 05/04/2018 19:47, Chris Wilson wrote:
> As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
> to drop master on the original before we are allowed to claim DRM_MASTER
> on the second.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/gem_eio.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> index 9599e73d..66d8c18a 100644
> --- a/tests/gem_eio.c
> +++ b/tests/gem_eio.c
> @@ -41,6 +41,7 @@
>   #include <drm.h>
>   
>   #include "igt.h"
> +#include "igt_device.h"
>   #include "igt_sysfs.h"
>   #include "sw_sync.h"
>   
> @@ -674,6 +675,7 @@ igt_main
>   
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_INTEL);
> +		igt_device_drop_master(fd);


Is it master by default? I can't spot a place which would set master 
either in igt/lib/ or in drm.

But in any case, should we have gem_reopen_driver attempt to drop master 
before re-opening? And if it was successful, drop it again after 
re-opening to end up in the same state?

Regards,

Tvrtko

>   
>   		igt_require(i915_reset_control(true));
>   		igt_force_gpu_reset(fd);
> 

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

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

* Re: [igt-dev] [Intel-gfx] [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
@ 2018-04-06  8:35     ` Tvrtko Ursulin
  0 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  8:35 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 05/04/2018 19:47, Chris Wilson wrote:
> As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
> to drop master on the original before we are allowed to claim DRM_MASTER
> on the second.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   tests/gem_eio.c | 2 ++
>   1 file changed, 2 insertions(+)
> 
> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> index 9599e73d..66d8c18a 100644
> --- a/tests/gem_eio.c
> +++ b/tests/gem_eio.c
> @@ -41,6 +41,7 @@
>   #include <drm.h>
>   
>   #include "igt.h"
> +#include "igt_device.h"
>   #include "igt_sysfs.h"
>   #include "sw_sync.h"
>   
> @@ -674,6 +675,7 @@ igt_main
>   
>   	igt_fixture {
>   		fd = drm_open_driver(DRIVER_INTEL);
> +		igt_device_drop_master(fd);


Is it master by default? I can't spot a place which would set master 
either in igt/lib/ or in drm.

But in any case, should we have gem_reopen_driver attempt to drop master 
before re-opening? And if it was successful, drop it again after 
re-opening to end up in the same state?

Regards,

Tvrtko

>   
>   		igt_require(i915_reset_control(true));
>   		igt_force_gpu_reset(fd);
> 

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

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

* Re: [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
  2018-04-06  8:35     ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
@ 2018-04-06  8:51       ` Chris Wilson
  -1 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-06  8:51 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx; +Cc: igt-dev

Quoting Tvrtko Ursulin (2018-04-06 09:35:41)
> 
> On 05/04/2018 19:47, Chris Wilson wrote:
> > As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
> > to drop master on the original before we are allowed to claim DRM_MASTER
> > on the second.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   tests/gem_eio.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> > index 9599e73d..66d8c18a 100644
> > --- a/tests/gem_eio.c
> > +++ b/tests/gem_eio.c
> > @@ -41,6 +41,7 @@
> >   #include <drm.h>
> >   
> >   #include "igt.h"
> > +#include "igt_device.h"
> >   #include "igt_sysfs.h"
> >   #include "sw_sync.h"
> >   
> > @@ -674,6 +675,7 @@ igt_main
> >   
> >       igt_fixture {
> >               fd = drm_open_driver(DRIVER_INTEL);
> > +             igt_device_drop_master(fd);
> 
> 
> Is it master by default? I can't spot a place which would set master 
> either in igt/lib/ or in drm.

First person to open /dev/dri/cardN gets DRM_MASTER.
 
> But in any case, should we have gem_reopen_driver attempt to drop master 
> before re-opening? And if it was successful, drop it again after 
> re-opening to end up in the same state?

Not sure. I can argue the alternative as well, what if we were testing
authentication and wanted to keep DRM_MASTER and spawn a !MASTER fd.
My first thought was the same, gem_reopen_fd() should try to ensure the
new fd has the same caps as the original, but API they be tricky to rule
out surprises. For me it's easier to say, gem_reopen_fd() follows the
DRM convention in that the second fd will not be DRM_MASTER unless you
play the DRM games. Then you can choose what games to play?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
@ 2018-04-06  8:51       ` Chris Wilson
  0 siblings, 0 replies; 13+ messages in thread
From: Chris Wilson @ 2018-04-06  8:51 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx; +Cc: igt-dev

Quoting Tvrtko Ursulin (2018-04-06 09:35:41)
> 
> On 05/04/2018 19:47, Chris Wilson wrote:
> > As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
> > to drop master on the original before we are allowed to claim DRM_MASTER
> > on the second.
> > 
> > Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> > Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> > ---
> >   tests/gem_eio.c | 2 ++
> >   1 file changed, 2 insertions(+)
> > 
> > diff --git a/tests/gem_eio.c b/tests/gem_eio.c
> > index 9599e73d..66d8c18a 100644
> > --- a/tests/gem_eio.c
> > +++ b/tests/gem_eio.c
> > @@ -41,6 +41,7 @@
> >   #include <drm.h>
> >   
> >   #include "igt.h"
> > +#include "igt_device.h"
> >   #include "igt_sysfs.h"
> >   #include "sw_sync.h"
> >   
> > @@ -674,6 +675,7 @@ igt_main
> >   
> >       igt_fixture {
> >               fd = drm_open_driver(DRIVER_INTEL);
> > +             igt_device_drop_master(fd);
> 
> 
> Is it master by default? I can't spot a place which would set master 
> either in igt/lib/ or in drm.

First person to open /dev/dri/cardN gets DRM_MASTER.
 
> But in any case, should we have gem_reopen_driver attempt to drop master 
> before re-opening? And if it was successful, drop it again after 
> re-opening to end up in the same state?

Not sure. I can argue the alternative as well, what if we were testing
authentication and wanted to keep DRM_MASTER and spawn a !MASTER fd.
My first thought was the same, gem_reopen_fd() should try to ensure the
new fd has the same caps as the original, but API they be tricky to rule
out surprises. For me it's easier to say, gem_reopen_fd() follows the
DRM convention in that the second fd will not be DRM_MASTER unless you
play the DRM games. Then you can choose what games to play?
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
  2018-04-06  8:51       ` [Intel-gfx] " Chris Wilson
@ 2018-04-06  9:18         ` Tvrtko Ursulin
  -1 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  9:18 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 06/04/2018 09:51, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-04-06 09:35:41)
>>
>> On 05/04/2018 19:47, Chris Wilson wrote:
>>> As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
>>> to drop master on the original before we are allowed to claim DRM_MASTER
>>> on the second.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> ---
>>>    tests/gem_eio.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
>>> index 9599e73d..66d8c18a 100644
>>> --- a/tests/gem_eio.c
>>> +++ b/tests/gem_eio.c
>>> @@ -41,6 +41,7 @@
>>>    #include <drm.h>
>>>    
>>>    #include "igt.h"
>>> +#include "igt_device.h"
>>>    #include "igt_sysfs.h"
>>>    #include "sw_sync.h"
>>>    
>>> @@ -674,6 +675,7 @@ igt_main
>>>    
>>>        igt_fixture {
>>>                fd = drm_open_driver(DRIVER_INTEL);
>>> +             igt_device_drop_master(fd);
>>
>>
>> Is it master by default? I can't spot a place which would set master
>> either in igt/lib/ or in drm.
> 
> First person to open /dev/dri/cardN gets DRM_MASTER.

Weird. And I missed to spot that magic while browsing around.

>> But in any case, should we have gem_reopen_driver attempt to drop master
>> before re-opening? And if it was successful, drop it again after
>> re-opening to end up in the same state?
> 
> Not sure. I can argue the alternative as well, what if we were testing
> authentication and wanted to keep DRM_MASTER and spawn a !MASTER fd.
> My first thought was the same, gem_reopen_fd() should try to ensure the
> new fd has the same caps as the original, but API they be tricky to rule
> out surprises. For me it's easier to say, gem_reopen_fd() follows the
> DRM convention in that the second fd will not be DRM_MASTER unless you
> play the DRM games. Then you can choose what games to play?

Okay, pragmatic response says:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Apologies for causing breakage.

Regards,

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

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

* Re: [igt-dev] [Intel-gfx] [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests
@ 2018-04-06  9:18         ` Tvrtko Ursulin
  0 siblings, 0 replies; 13+ messages in thread
From: Tvrtko Ursulin @ 2018-04-06  9:18 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx; +Cc: igt-dev


On 06/04/2018 09:51, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-04-06 09:35:41)
>>
>> On 05/04/2018 19:47, Chris Wilson wrote:
>>> As we reopen the fd for each subtest, and we need a DRM_MASTER, we need
>>> to drop master on the original before we are allowed to claim DRM_MASTER
>>> on the second.
>>>
>>> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
>>> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
>>> ---
>>>    tests/gem_eio.c | 2 ++
>>>    1 file changed, 2 insertions(+)
>>>
>>> diff --git a/tests/gem_eio.c b/tests/gem_eio.c
>>> index 9599e73d..66d8c18a 100644
>>> --- a/tests/gem_eio.c
>>> +++ b/tests/gem_eio.c
>>> @@ -41,6 +41,7 @@
>>>    #include <drm.h>
>>>    
>>>    #include "igt.h"
>>> +#include "igt_device.h"
>>>    #include "igt_sysfs.h"
>>>    #include "sw_sync.h"
>>>    
>>> @@ -674,6 +675,7 @@ igt_main
>>>    
>>>        igt_fixture {
>>>                fd = drm_open_driver(DRIVER_INTEL);
>>> +             igt_device_drop_master(fd);
>>
>>
>> Is it master by default? I can't spot a place which would set master
>> either in igt/lib/ or in drm.
> 
> First person to open /dev/dri/cardN gets DRM_MASTER.

Weird. And I missed to spot that magic while browsing around.

>> But in any case, should we have gem_reopen_driver attempt to drop master
>> before re-opening? And if it was successful, drop it again after
>> re-opening to end up in the same state?
> 
> Not sure. I can argue the alternative as well, what if we were testing
> authentication and wanted to keep DRM_MASTER and spawn a !MASTER fd.
> My first thought was the same, gem_reopen_fd() should try to ensure the
> new fd has the same caps as the original, but API they be tricky to rule
> out surprises. For me it's easier to say, gem_reopen_fd() follows the
> DRM convention in that the second fd will not be DRM_MASTER unless you
> play the DRM games. Then you can choose what games to play?

Okay, pragmatic response says:

Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>

Apologies for causing breakage.

Regards,

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

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

end of thread, other threads:[~2018-04-06  9:18 UTC | newest]

Thread overview: 13+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-04-05 18:47 [PATCH igt 1/2] lib: Acquire master for pollable spinbatch on gen4/5 Chris Wilson
2018-04-05 18:47 ` [igt-dev] " Chris Wilson
2018-04-05 18:47 ` [PATCH igt 2/2] igt/gem_eio: Drop DRM_MASTER so we can reacquire it in the subtests Chris Wilson
2018-04-05 18:47   ` [igt-dev] " Chris Wilson
2018-04-06  8:35   ` Tvrtko Ursulin
2018-04-06  8:35     ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-04-06  8:51     ` Chris Wilson
2018-04-06  8:51       ` [Intel-gfx] " Chris Wilson
2018-04-06  9:18       ` Tvrtko Ursulin
2018-04-06  9:18         ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin
2018-04-05 19:19 ` [igt-dev] ✗ Fi.CI.BAT: warning for series starting with [1/2] lib: Acquire master for pollable spinbatch on gen4/5 Patchwork
2018-04-06  8:24 ` [PATCH igt 1/2] " Tvrtko Ursulin
2018-04-06  8:24   ` [igt-dev] [Intel-gfx] " Tvrtko Ursulin

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.