[3/3] test/gem_dummy_reloc_loop: add tests for dual bsd ring
diff mbox

Message ID 1421110221-15634-4-git-send-email-zhipeng.gong@intel.com
State New, archived
Headers show

Commit Message

Zhipeng Gong Jan. 13, 2015, 12:50 a.m. UTC
Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
---
 tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++
 1 file changed, 18 insertions(+)

Comments

Rodrigo Vivi Jan. 20, 2015, 9:49 p.m. UTC | #1
On Mon, Jan 12, 2015 at 4:50 PM, Zhipeng Gong <zhipeng.gong@intel.com> wrote:
> Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
> ---
>  tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++
>  1 file changed, 18 insertions(+)
>
> diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
> index 335700d..5e0a10a 100644
> --- a/tests/gem_dummy_reloc_loop.c
> +++ b/tests/gem_dummy_reloc_loop.c
> @@ -43,6 +43,8 @@
>  #include "intel_chipset.h"
>
>  #define LOCAL_I915_EXEC_VEBOX (4<<0)
> +#define LOCAL_I915_EXEC_BSD_RING1 (1<<13)
> +#define LOCAL_I915_EXEC_BSD_RING2 (2<<13)
>
>  static drm_intel_bufmgr *bufmgr;
>  struct intel_batchbuffer *batch;
> @@ -260,6 +262,22 @@ igt_main
>         }
>  #endif
>
> +       igt_subtest("bsd-ring1") {
> +               igt_require(gem_has_bsd2(fd));
Should we really skip this if bsd2 isn't present?
On my GT2:
Test requirement not met in function __real_main179, file
gem_dummy_reloc_loop.c:266:
Test requirement: gem_has_bsd2(fd)
Subtest bsd-ring1: SKIP (0.000s)

> +               sleep(2);
> +               igt_info("running dummy loop on bsd-ring1\n");
> +               dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1);
> +               igt_info("dummy loop run on bsd-ring1 completed\n");
> +       }
> +
> +       igt_subtest("bsd-ring2") {
> +               igt_require(gem_has_bsd2(fd));
> +               sleep(2);
> +               igt_info("running dummy loop on bsd-ring2\n");
> +               dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2);
> +               igt_info("dummy loop run on bsd-ring2 completed\n");
> +       }
> +
>         igt_subtest("mixed") {
>                 if (num_rings > 1) {
>                         sleep(2);
> --
> 1.8.3.1
>
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Zhipeng Gong Jan. 21, 2015, 1:10 a.m. UTC | #2
> -----Original Message-----

> From: Rodrigo Vivi [mailto:rodrigo.vivi@gmail.com]

> Sent: Wednesday, January 21, 2015 5:49 AM

> To: Gong, Zhipeng

> Cc: intel-gfx; Vivi, Rodrigo

> Subject: Re: [Intel-gfx] [PATCH 3/3] test/gem_dummy_reloc_loop: add tests for

> dual bsd ring

> 

> On Mon, Jan 12, 2015 at 4:50 PM, Zhipeng Gong <zhipeng.gong@intel.com>

> wrote:

> > Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>

> > ---

> >  tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++

> >  1 file changed, 18 insertions(+)

> >

> > diff --git a/tests/gem_dummy_reloc_loop.c

> > b/tests/gem_dummy_reloc_loop.c index 335700d..5e0a10a 100644

> > --- a/tests/gem_dummy_reloc_loop.c

> > +++ b/tests/gem_dummy_reloc_loop.c

> > @@ -43,6 +43,8 @@

> >  #include "intel_chipset.h"

> >

> >  #define LOCAL_I915_EXEC_VEBOX (4<<0)

> > +#define LOCAL_I915_EXEC_BSD_RING1 (1<<13) #define

> > +LOCAL_I915_EXEC_BSD_RING2 (2<<13)

> >

> >  static drm_intel_bufmgr *bufmgr;

> >  struct intel_batchbuffer *batch;

> > @@ -260,6 +262,22 @@ igt_main

> >         }

> >  #endif

> >

> > +       igt_subtest("bsd-ring1") {

> > +               igt_require(gem_has_bsd2(fd));

> Should we really skip this if bsd2 isn't present?

> On my GT2:

> Test requirement not met in function __real_main179, file

> gem_dummy_reloc_loop.c:266:

> Test requirement: gem_has_bsd2(fd)

> Subtest bsd-ring1: SKIP (0.000s)

> 

Yes, I915_EXEC_BSD_RING1 only take effects on the platform with 2VDBOX.
In kernel, the code is like this, it has a precondition of HAS_BSD2(dev).
    if (HAS_BSD2(dev)) {
            int ring_id;
            switch (args->flags & I915_EXEC_BSD_MASK) {
			...
            case I915_EXEC_BSD_RING1:
                    ring = &dev_priv->ring[VCS];
                    break;
			...


> > +               sleep(2);

> > +               igt_info("running dummy loop on bsd-ring1\n");

> > +

> dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1);

> > +               igt_info("dummy loop run on bsd-ring1 completed\n");

> > +       }

> > +

> > +       igt_subtest("bsd-ring2") {

> > +               igt_require(gem_has_bsd2(fd));

> > +               sleep(2);

> > +               igt_info("running dummy loop on bsd-ring2\n");

> > +

> dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2);

> > +               igt_info("dummy loop run on bsd-ring2 completed\n");

> > +       }

> > +

> >         igt_subtest("mixed") {

> >                 if (num_rings > 1) {

> >                         sleep(2);

> > --

> > 1.8.3.1

> >

> > _______________________________________________

> > 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
Rodrigo Vivi Jan. 21, 2015, 2:23 a.m. UTC | #3
Thanks for the explanation.

As soon as I get my GT3 back I do another round, but with your
explanations and with the code I've re-reviewed I'm confident
everything is right.

Thanks,
Rodrigo.

On Tue, Jan 20, 2015 at 5:10 PM, Gong, Zhipeng <zhipeng.gong@intel.com> wrote:
>
>
>> -----Original Message-----
>> From: Rodrigo Vivi [mailto:rodrigo.vivi@gmail.com]
>> Sent: Wednesday, January 21, 2015 5:49 AM
>> To: Gong, Zhipeng
>> Cc: intel-gfx; Vivi, Rodrigo
>> Subject: Re: [Intel-gfx] [PATCH 3/3] test/gem_dummy_reloc_loop: add tests for
>> dual bsd ring
>>
>> On Mon, Jan 12, 2015 at 4:50 PM, Zhipeng Gong <zhipeng.gong@intel.com>
>> wrote:
>> > Signed-off-by: Zhipeng Gong <zhipeng.gong@intel.com>
>> > ---
>> >  tests/gem_dummy_reloc_loop.c | 18 ++++++++++++++++++
>> >  1 file changed, 18 insertions(+)
>> >
>> > diff --git a/tests/gem_dummy_reloc_loop.c
>> > b/tests/gem_dummy_reloc_loop.c index 335700d..5e0a10a 100644
>> > --- a/tests/gem_dummy_reloc_loop.c
>> > +++ b/tests/gem_dummy_reloc_loop.c
>> > @@ -43,6 +43,8 @@
>> >  #include "intel_chipset.h"
>> >
>> >  #define LOCAL_I915_EXEC_VEBOX (4<<0)
>> > +#define LOCAL_I915_EXEC_BSD_RING1 (1<<13) #define
>> > +LOCAL_I915_EXEC_BSD_RING2 (2<<13)
>> >
>> >  static drm_intel_bufmgr *bufmgr;
>> >  struct intel_batchbuffer *batch;
>> > @@ -260,6 +262,22 @@ igt_main
>> >         }
>> >  #endif
>> >
>> > +       igt_subtest("bsd-ring1") {
>> > +               igt_require(gem_has_bsd2(fd));
>> Should we really skip this if bsd2 isn't present?
>> On my GT2:
>> Test requirement not met in function __real_main179, file
>> gem_dummy_reloc_loop.c:266:
>> Test requirement: gem_has_bsd2(fd)
>> Subtest bsd-ring1: SKIP (0.000s)
>>
> Yes, I915_EXEC_BSD_RING1 only take effects on the platform with 2VDBOX.
> In kernel, the code is like this, it has a precondition of HAS_BSD2(dev).
>     if (HAS_BSD2(dev)) {
>             int ring_id;
>             switch (args->flags & I915_EXEC_BSD_MASK) {
>                         ...
>             case I915_EXEC_BSD_RING1:
>                     ring = &dev_priv->ring[VCS];
>                     break;
>                         ...
>
>
>> > +               sleep(2);
>> > +               igt_info("running dummy loop on bsd-ring1\n");
>> > +
>> dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1);
>> > +               igt_info("dummy loop run on bsd-ring1 completed\n");
>> > +       }
>> > +
>> > +       igt_subtest("bsd-ring2") {
>> > +               igt_require(gem_has_bsd2(fd));
>> > +               sleep(2);
>> > +               igt_info("running dummy loop on bsd-ring2\n");
>> > +
>> dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2);
>> > +               igt_info("dummy loop run on bsd-ring2 completed\n");
>> > +       }
>> > +
>> >         igt_subtest("mixed") {
>> >                 if (num_rings > 1) {
>> >                         sleep(2);
>> > --
>> > 1.8.3.1
>> >
>> > _______________________________________________
>> > 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

Patch
diff mbox

diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
index 335700d..5e0a10a 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -43,6 +43,8 @@ 
 #include "intel_chipset.h"
 
 #define LOCAL_I915_EXEC_VEBOX (4<<0)
+#define LOCAL_I915_EXEC_BSD_RING1 (1<<13)
+#define LOCAL_I915_EXEC_BSD_RING2 (2<<13)
 
 static drm_intel_bufmgr *bufmgr;
 struct intel_batchbuffer *batch;
@@ -260,6 +262,22 @@  igt_main
 	}
 #endif
 
+	igt_subtest("bsd-ring1") {
+		igt_require(gem_has_bsd2(fd));
+		sleep(2);
+		igt_info("running dummy loop on bsd-ring1\n");
+		dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING1);
+		igt_info("dummy loop run on bsd-ring1 completed\n");
+	}
+
+	igt_subtest("bsd-ring2") {
+		igt_require(gem_has_bsd2(fd));
+		sleep(2);
+		igt_info("running dummy loop on bsd-ring2\n");
+		dummy_reloc_loop(I915_EXEC_BSD|LOCAL_I915_EXEC_BSD_RING2);
+		igt_info("dummy loop run on bsd-ring2 completed\n");
+	}
+
 	igt_subtest("mixed") {
 		if (num_rings > 1) {
 			sleep(2);