* [PATCH 2/2]i-g-t: gem_dummy_reloc_loop.c: add vebox test case
@ 2013-05-03 7:55 Zhong Li
2013-05-04 0:54 ` Ben Widawsky
0 siblings, 1 reply; 2+ messages in thread
From: Zhong Li @ 2013-05-03 7:55 UTC (permalink / raw)
To: intel-gfx, daniel.vetter, ben; +Cc: jocelyn.li
Signed-off-by: Zhong Li <zhong.li@intel.com>
---
tests/gem_dummy_reloc_loop.c | 21 +++++++++++++++++----
1 file changed, 17 insertions(+), 4 deletions(-)
diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
index b67c7d3..b5da577 100644
--- a/tests/gem_dummy_reloc_loop.c
+++ b/tests/gem_dummy_reloc_loop.c
@@ -42,6 +42,8 @@
#include "intel_gpu_tools.h"
#include "i830_reg.h"
+#define LOCACL_I915_EXEC_VEBOX (4<<0)
+
static drm_intel_bufmgr *bufmgr;
struct intel_batchbuffer *batch;
static drm_intel_bo *target_buffer;
@@ -88,14 +90,14 @@ dummy_reloc_loop(int ring)
}
static void
-dummy_reloc_loop_random_ring(void)
+dummy_reloc_loop_random_ring(int num_rings)
{
int i;
srandom(0xdeadbeef);
for (i = 0; i < 0x100000; i++) {
- int ring = random() % 3 + 1;
+ int ring = random() % num_rings + 1;
if (ring == I915_EXEC_RENDER) {
BEGIN_BATCH(4);
@@ -126,11 +128,13 @@ int main(int argc, char **argv)
{
int fd;
int devid;
+ int num_rings = 1; /*render ring is alwyas available*/
drmtest_subtest_init(argc, argv);
fd = drm_open_any();
devid = intel_get_drm_devid(fd);
+ num_rings = gem_get_num_rings(fd);
if (!HAS_BLT_RING(devid)) {
fprintf(stderr, "not (yet) implemented for pre-snb\n");
return 77;
@@ -179,11 +183,20 @@ int main(int argc, char **argv)
}
}
+ if (drmtest_run_subtest("vebox")) {
+ if (gem_has_vebox(fd)) {
+ sleep(2);
+ printf("running dummy loop on vebox\n");
+ dummy_reloc_loop(LOCACL_I915_EXEC_VEBOX);
+ printf("dummy loop run on vebox completed\n");
+ }
+ }
+
if (drmtest_run_subtest("mixed")) {
- if (HAS_BLT_RING(devid) && HAS_BSD_RING(devid)) {
+ if (num_rings > 1) {
sleep(2);
printf("running dummy loop on random rings\n");
- dummy_reloc_loop_random_ring();
+ dummy_reloc_loop_random_ring(num_rings);
printf("dummy loop run on random rings completed\n");
}
}
--
1.7.9.5
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH 2/2]i-g-t: gem_dummy_reloc_loop.c: add vebox test case
2013-05-03 7:55 [PATCH 2/2]i-g-t: gem_dummy_reloc_loop.c: add vebox test case Zhong Li
@ 2013-05-04 0:54 ` Ben Widawsky
0 siblings, 0 replies; 2+ messages in thread
From: Ben Widawsky @ 2013-05-04 0:54 UTC (permalink / raw)
To: Zhong Li; +Cc: daniel.vetter, intel-gfx, jocelyn.li
On Fri, May 03, 2013 at 03:55:34PM +0800, Zhong Li wrote:
> Signed-off-by: Zhong Li <zhong.li@intel.com>
> ---
> tests/gem_dummy_reloc_loop.c | 21 +++++++++++++++++----
> 1 file changed, 17 insertions(+), 4 deletions(-)
>
> diff --git a/tests/gem_dummy_reloc_loop.c b/tests/gem_dummy_reloc_loop.c
> index b67c7d3..b5da577 100644
> --- a/tests/gem_dummy_reloc_loop.c
> +++ b/tests/gem_dummy_reloc_loop.c
> @@ -42,6 +42,8 @@
> #include "intel_gpu_tools.h"
> #include "i830_reg.h"
>
> +#define LOCACL_I915_EXEC_VEBOX (4<<0)
> +
s/LOCACL/LOCAL
> static drm_intel_bufmgr *bufmgr;
> struct intel_batchbuffer *batch;
> static drm_intel_bo *target_buffer;
> @@ -88,14 +90,14 @@ dummy_reloc_loop(int ring)
> }
>
> static void
> -dummy_reloc_loop_random_ring(void)
> +dummy_reloc_loop_random_ring(int num_rings)
> {
> int i;
>
> srandom(0xdeadbeef);
>
> for (i = 0; i < 0x100000; i++) {
> - int ring = random() % 3 + 1;
> + int ring = random() % num_rings + 1;
>
> if (ring == I915_EXEC_RENDER) {
> BEGIN_BATCH(4);
> @@ -126,11 +128,13 @@ int main(int argc, char **argv)
> {
> int fd;
> int devid;
> + int num_rings = 1; /*render ring is alwyas available*/
Initializing this to 1 is a bit silly.
>
> drmtest_subtest_init(argc, argv);
>
> fd = drm_open_any();
> devid = intel_get_drm_devid(fd);
> + num_rings = gem_get_num_rings(fd);
> if (!HAS_BLT_RING(devid)) {
> fprintf(stderr, "not (yet) implemented for pre-snb\n");
> return 77;
> @@ -179,11 +183,20 @@ int main(int argc, char **argv)
> }
> }
>
> + if (drmtest_run_subtest("vebox")) {
> + if (gem_has_vebox(fd)) {
> + sleep(2);
> + printf("running dummy loop on vebox\n");
> + dummy_reloc_loop(LOCACL_I915_EXEC_VEBOX);
> + printf("dummy loop run on vebox completed\n");
> + }
> + }
> +
> if (drmtest_run_subtest("mixed")) {
> - if (HAS_BLT_RING(devid) && HAS_BSD_RING(devid)) {
> + if (num_rings > 1) {
You stuck in a small behavioral change here for the test suite which
could potential regress (or highlight previously uncaught bugs)
platforms that don't have VEBOX. The change you've made is fine with me,
but it belongs in the commit message.
> sleep(2);
> printf("running dummy loop on random rings\n");
> - dummy_reloc_loop_random_ring();
> + dummy_reloc_loop_random_ring(num_rings);
> printf("dummy loop run on random rings completed\n");
> }
> }
> --
> 1.7.9.5
>
With a commit message explaining the change I mentioned above, I've
merged this to master.
--
Ben Widawsky, Intel Open Source Technology Center
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2013-05-04 0:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-05-03 7:55 [PATCH 2/2]i-g-t: gem_dummy_reloc_loop.c: add vebox test case Zhong Li
2013-05-04 0:54 ` Ben Widawsky
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox