All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] tests/core_getparams: Create new test core_getparams
@ 2015-03-02 23:40 jeff.mcgee
  2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
  0 siblings, 1 reply; 22+ messages in thread
From: jeff.mcgee @ 2015-03-02 23:40 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

New test core_getparams consists of 2 subtests, each one testing
the ability of userspace to query the correct value of a GT config
attribute: subslice total or EU total. drm/i915 implementation of
these queries is required for Cherryview and Gen9+ devices (non-
simulated).

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/.gitignore       |   1 +
 tests/Makefile.sources |   1 +
 tests/core_getparams.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+)
 create mode 100644 tests/core_getparams.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 7b4dd94..39b4e28 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,7 @@
 # Please keep sorted alphabetically
 core_get_client_auth
 core_getclient
+core_getparams
 core_getstats
 core_getversion
 drm_import_export
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 51e8376..999c8f8 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
 
 TESTS_progs_M = \
 	core_get_client_auth \
+	core_getparams \
 	drv_suspend \
 	drv_hangman \
 	gem_bad_reloc \
diff --git a/tests/core_getparams.c b/tests/core_getparams.c
new file mode 100644
index 0000000..37a4f63
--- /dev/null
+++ b/tests/core_getparams.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Jeff McGee <jeff.mcgee@intel.com>
+ *
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <xf86drm.h>
+#include "drmtest.h"
+#include "intel_chipset.h"
+#include "intel_bufmgr.h"
+
+int drm_fd;
+int devid;
+
+static void
+init(void)
+{
+	drm_fd = drm_open_any();
+	devid = intel_get_drm_devid(drm_fd);
+}
+
+static void
+deinit(void)
+{
+	close(drm_fd);
+}
+
+static void
+subslice_total(void)
+{
+	unsigned int subslice_total = 0;
+	int ret;
+
+	ret = drm_intel_get_subslice_total(drm_fd, &subslice_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert(ret == -ENODEV);
+			igt_info("subslice total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert(ret != EINVAL); /* request not recognized? */
+			igt_assert(ret != ENODEV); /* device not supported? */
+			igt_assert(ret == 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert(subslice_total != 0);
+		igt_info("subslice total: %u\n", subslice_total);
+	}
+}
+
+static void
+eu_total(void)
+{
+	unsigned int eu_total = 0;
+	int ret;
+
+	ret = drm_intel_get_eu_total(drm_fd, &eu_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert(ret == -ENODEV);
+			igt_info("EU total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert(ret != EINVAL); /* request not recognized? */
+			igt_assert(ret != ENODEV); /* device not supported? */
+			igt_assert(ret == 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert(eu_total != 0);
+		igt_info("EU total: %u\n", eu_total);
+	}
+}
+
+static void
+exit_handler(int sig)
+{
+	deinit();
+}
+
+igt_main
+{
+	igt_fixture {
+		igt_install_exit_handler(exit_handler);
+		init();
+	}
+
+	igt_subtest("subslice-total")
+		subslice_total();
+
+	igt_subtest("eu-total")
+		eu_total();
+}
-- 
2.3.0

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* [PATCH i-g-t 1/2] tests/core_getparams: Create new test core_getparams
  2015-03-02 23:40 [PATCH] tests/core_getparams: Create new test core_getparams jeff.mcgee
@ 2015-03-09 23:19 ` jeff.mcgee
  2015-03-09 23:19   ` [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60 jeff.mcgee
                     ` (3 more replies)
  0 siblings, 4 replies; 22+ messages in thread
From: jeff.mcgee @ 2015-03-09 23:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

New test core_getparams consists of 2 subtests, each one testing
the ability of userspace to query the correct value of a GT config
attribute: subslice total or EU total. drm/i915 implementation of
these queries is required for Cherryview and Gen9+ devices (non-
simulated).

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/.gitignore       |   1 +
 tests/Makefile.sources |   1 +
 tests/core_getparams.c | 145 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 147 insertions(+)
 create mode 100644 tests/core_getparams.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 7b4dd94..39b4e28 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,7 @@
 # Please keep sorted alphabetically
 core_get_client_auth
 core_getclient
+core_getparams
 core_getstats
 core_getversion
 drm_import_export
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 51e8376..999c8f8 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
 
 TESTS_progs_M = \
 	core_get_client_auth \
+	core_getparams \
 	drv_suspend \
 	drv_hangman \
 	gem_bad_reloc \
diff --git a/tests/core_getparams.c b/tests/core_getparams.c
new file mode 100644
index 0000000..37a4f63
--- /dev/null
+++ b/tests/core_getparams.c
@@ -0,0 +1,145 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Jeff McGee <jeff.mcgee@intel.com>
+ *
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <xf86drm.h>
+#include "drmtest.h"
+#include "intel_chipset.h"
+#include "intel_bufmgr.h"
+
+int drm_fd;
+int devid;
+
+static void
+init(void)
+{
+	drm_fd = drm_open_any();
+	devid = intel_get_drm_devid(drm_fd);
+}
+
+static void
+deinit(void)
+{
+	close(drm_fd);
+}
+
+static void
+subslice_total(void)
+{
+	unsigned int subslice_total = 0;
+	int ret;
+
+	ret = drm_intel_get_subslice_total(drm_fd, &subslice_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert(ret == -ENODEV);
+			igt_info("subslice total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert(ret != EINVAL); /* request not recognized? */
+			igt_assert(ret != ENODEV); /* device not supported? */
+			igt_assert(ret == 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert(subslice_total != 0);
+		igt_info("subslice total: %u\n", subslice_total);
+	}
+}
+
+static void
+eu_total(void)
+{
+	unsigned int eu_total = 0;
+	int ret;
+
+	ret = drm_intel_get_eu_total(drm_fd, &eu_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert(ret == -ENODEV);
+			igt_info("EU total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert(ret != EINVAL); /* request not recognized? */
+			igt_assert(ret != ENODEV); /* device not supported? */
+			igt_assert(ret == 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert(eu_total != 0);
+		igt_info("EU total: %u\n", eu_total);
+	}
+}
+
+static void
+exit_handler(int sig)
+{
+	deinit();
+}
+
+igt_main
+{
+	igt_fixture {
+		igt_install_exit_handler(exit_handler);
+		init();
+	}
+
+	igt_subtest("subslice-total")
+		subslice_total();
+
+	igt_subtest("eu-total")
+		eu_total();
+}
-- 
2.3.0

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

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

* [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
@ 2015-03-09 23:19   ` jeff.mcgee
  2015-03-09 23:30   ` jeff.mcgee
                     ` (2 subsequent siblings)
  3 siblings, 0 replies; 22+ messages in thread
From: jeff.mcgee @ 2015-03-09 23:19 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

tests/core_getparams needs the new libdrm interfaces for
querying subslice and EU counts.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 16d6a2e..88a1c3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
 fi
 AC_SUBST(ASSEMBLER_WARN_CFLAGS)
 
-PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
+PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
 PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
-- 
2.3.0

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
  2015-03-09 23:19   ` [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60 jeff.mcgee
@ 2015-03-09 23:30   ` jeff.mcgee
  2015-03-09 23:41   ` jeff.mcgee
  2015-03-12 20:38   ` [PATCH i-g-t v2] tests/core_getparams: Create new test core_getparams jeff.mcgee
  3 siblings, 0 replies; 22+ messages in thread
From: jeff.mcgee @ 2015-03-09 23:30 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

tests/core_getparams needs the new libdrm interfaces for
querying subslice and EU counts.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 16d6a2e..88a1c3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
 fi
 AC_SUBST(ASSEMBLER_WARN_CFLAGS)
 
-PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
+PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
 PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
-- 
2.3.0

_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
  2015-03-09 23:19   ` [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60 jeff.mcgee
  2015-03-09 23:30   ` jeff.mcgee
@ 2015-03-09 23:41   ` jeff.mcgee
  2015-03-10  7:37     ` [Intel-gfx] " Daniel Vetter
  2015-03-12 20:38   ` [PATCH i-g-t v2] tests/core_getparams: Create new test core_getparams jeff.mcgee
  3 siblings, 1 reply; 22+ messages in thread
From: jeff.mcgee @ 2015-03-09 23:41 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

tests/core_getparams needs the new libdrm interfaces for
querying subslice and EU counts.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 16d6a2e..88a1c3d 100644
--- a/configure.ac
+++ b/configure.ac
@@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
 fi
 AC_SUBST(ASSEMBLER_WARN_CFLAGS)
 
-PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
+PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
 PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
 PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
 PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
-- 
2.3.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-09 23:41   ` jeff.mcgee
@ 2015-03-10  7:37     ` Daniel Vetter
  2015-03-10 16:59       ` [Beignet] " Jeff McGee
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Vetter @ 2015-03-10  7:37 UTC (permalink / raw)
  To: jeff.mcgee; +Cc: intel-gfx, beignet, dri-devel

On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> From: Jeff McGee <jeff.mcgee@intel.com>
> 
> tests/core_getparams needs the new libdrm interfaces for
> querying subslice and EU counts.
> 
> For: VIZ-4636
> Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> ---
>  configure.ac | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/configure.ac b/configure.ac
> index 16d6a2e..88a1c3d 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
>  fi
>  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
>  
> -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])

Please don't and instead copypaste the new structs/defines with a local_
prefix like we do it for all the other new igt testcases. Forcing libdrm
to get updated for igt all the time can get annoying fast.
-Daniel

>  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>  PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
>  PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
> -- 
> 2.3.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Beignet] [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10  7:37     ` [Intel-gfx] " Daniel Vetter
@ 2015-03-10 16:59       ` Jeff McGee
  2015-03-10 17:58         ` Rob Clark
  0 siblings, 1 reply; 22+ messages in thread
From: Jeff McGee @ 2015-03-10 16:59 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, dri-devel, beignet

On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> > From: Jeff McGee <jeff.mcgee@intel.com>
> > 
> > tests/core_getparams needs the new libdrm interfaces for
> > querying subslice and EU counts.
> > 
> > For: VIZ-4636
> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > ---
> >  configure.ac | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/configure.ac b/configure.ac
> > index 16d6a2e..88a1c3d 100644
> > --- a/configure.ac
> > +++ b/configure.ac
> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> >  fi
> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> >  
> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> 
> Please don't and instead copypaste the new structs/defines with a local_
> prefix like we do it for all the other new igt testcases. Forcing libdrm
> to get updated for igt all the time can get annoying fast.
> -Daniel
> 
In this case I'm trying to exercise new API functions in libdrm which
wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
avoid requiring updated libdrm? I can do that, but it fails to test the
complete path that client would use.
-Jeff

> >  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
> >  PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
> >  PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
> > -- 
> > 2.3.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Beignet mailing list
> Beignet@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Beignet] [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 16:59       ` [Beignet] " Jeff McGee
@ 2015-03-10 17:58         ` Rob Clark
  2015-03-10 18:34           ` Jeff McGee
  2015-03-10 18:47           ` [Intel-gfx] " Daniel Vetter
  0 siblings, 2 replies; 22+ messages in thread
From: Rob Clark @ 2015-03-10 17:58 UTC (permalink / raw)
  To: Daniel Vetter, Intel Graphics Development, beignet, dri-devel

On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
>> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
>> > From: Jeff McGee <jeff.mcgee@intel.com>
>> >
>> > tests/core_getparams needs the new libdrm interfaces for
>> > querying subslice and EU counts.
>> >
>> > For: VIZ-4636
>> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
>> > ---
>> >  configure.ac | 2 +-
>> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/configure.ac b/configure.ac
>> > index 16d6a2e..88a1c3d 100644
>> > --- a/configure.ac
>> > +++ b/configure.ac
>> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
>> >  fi
>> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
>> >
>> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
>> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
>>
>> Please don't and instead copypaste the new structs/defines with a local_
>> prefix like we do it for all the other new igt testcases. Forcing libdrm
>> to get updated for igt all the time can get annoying fast.
>> -Daniel
>>
> In this case I'm trying to exercise new API functions in libdrm which
> wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> avoid requiring updated libdrm? I can do that, but it fails to test the
> complete path that client would use.


Am I missing something, or does 2.4.60 not exist yet?

That said dependency bumps for igt seem like less of an issue than
dependency bumps for mesa..  I mean if you are using igt you are
probably on the latest anyways..  I'm not sure why Daniel is so
concerned about that..

(but dependency bumps to something that doesn't exist yet should
perhaps be avoided)

BR,
-R


> -Jeff
>
>> >  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>> >  PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
>> >  PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
>> > --
>> > 2.3.0
>> >
>> > _______________________________________________
>> > Intel-gfx mailing list
>> > Intel-gfx@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>>
>> --
>> Daniel Vetter
>> Software Engineer, Intel Corporation
>> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>> _______________________________________________
>> Beignet mailing list
>> Beignet@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/beignet
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Beignet] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 18:34           ` Jeff McGee
@ 2015-03-10 18:24             ` Rob Clark
  0 siblings, 0 replies; 22+ messages in thread
From: Rob Clark @ 2015-03-10 18:24 UTC (permalink / raw)
  To: Rob Clark, Daniel Vetter, Intel Graphics Development, beignet, dri-devel

On Tue, Mar 10, 2015 at 2:34 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
>> On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
>> > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
>> >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
>> >> > From: Jeff McGee <jeff.mcgee@intel.com>
>> >> >
>> >> > tests/core_getparams needs the new libdrm interfaces for
>> >> > querying subslice and EU counts.
>> >> >
>> >> > For: VIZ-4636
>> >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
>> >> > ---
>> >> >  configure.ac | 2 +-
>> >> >  1 file changed, 1 insertion(+), 1 deletion(-)
>> >> >
>> >> > diff --git a/configure.ac b/configure.ac
>> >> > index 16d6a2e..88a1c3d 100644
>> >> > --- a/configure.ac
>> >> > +++ b/configure.ac
>> >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
>> >> >  fi
>> >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
>> >> >
>> >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
>> >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
>> >>
>> >> Please don't and instead copypaste the new structs/defines with a local_
>> >> prefix like we do it for all the other new igt testcases. Forcing libdrm
>> >> to get updated for igt all the time can get annoying fast.
>> >> -Daniel
>> >>
>> > In this case I'm trying to exercise new API functions in libdrm which
>> > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
>> > avoid requiring updated libdrm? I can do that, but it fails to test the
>> > complete path that client would use.
>>
>>
>> Am I missing something, or does 2.4.60 not exist yet?
>>
>> That said dependency bumps for igt seem like less of an issue than
>> dependency bumps for mesa..  I mean if you are using igt you are
>> probably on the latest anyways..  I'm not sure why Daniel is so
>> concerned about that..
>>
>> (but dependency bumps to something that doesn't exist yet should
>> perhaps be avoided)
>>
>> BR,
>> -R
>>
>
> Hi Rob. This igt change is contigent upon my libdrm changes which
> would in fact bump that version to 2.4.60 after adding an API. That
> change is also posted and waiting review. I guess I should have stated
> that dependency here to begin with.
>
> http://lists.freedesktop.org/archives/intel-gfx/2015-March/061101.html
>

ahh, my bad.. I hadn't read all of the threads.. sorry for the noise ;-)

BR,
-R

> Jeff
>>
>> > -Jeff
>> >
>> >> >  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
>> >> >  PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
>> >> >  PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
>> >> > --
>> >> > 2.3.0
>> >> >
>> >> > _______________________________________________
>> >> > Intel-gfx mailing list
>> >> > Intel-gfx@lists.freedesktop.org
>> >> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
>> >>
>> >> --
>> >> Daniel Vetter
>> >> Software Engineer, Intel Corporation
>> >> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
>> >> _______________________________________________
>> >> Beignet mailing list
>> >> Beignet@lists.freedesktop.org
>> >> http://lists.freedesktop.org/mailman/listinfo/beignet
>> > _______________________________________________
>> > dri-devel mailing list
>> > dri-devel@lists.freedesktop.org
>> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
>> _______________________________________________
>> dri-devel mailing list
>> dri-devel@lists.freedesktop.org
>> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 17:58         ` Rob Clark
@ 2015-03-10 18:34           ` Jeff McGee
  2015-03-10 18:24             ` [Beignet] " Rob Clark
  2015-03-10 18:47           ` [Intel-gfx] " Daniel Vetter
  1 sibling, 1 reply; 22+ messages in thread
From: Jeff McGee @ 2015-03-10 18:34 UTC (permalink / raw)
  To: Rob Clark; +Cc: dri-devel, Intel Graphics Development, beignet, Daniel Vetter

On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
> On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> >> > From: Jeff McGee <jeff.mcgee@intel.com>
> >> >
> >> > tests/core_getparams needs the new libdrm interfaces for
> >> > querying subslice and EU counts.
> >> >
> >> > For: VIZ-4636
> >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> >> > ---
> >> >  configure.ac | 2 +-
> >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >> >
> >> > diff --git a/configure.ac b/configure.ac
> >> > index 16d6a2e..88a1c3d 100644
> >> > --- a/configure.ac
> >> > +++ b/configure.ac
> >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> >> >  fi
> >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> >> >
> >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> >>
> >> Please don't and instead copypaste the new structs/defines with a local_
> >> prefix like we do it for all the other new igt testcases. Forcing libdrm
> >> to get updated for igt all the time can get annoying fast.
> >> -Daniel
> >>
> > In this case I'm trying to exercise new API functions in libdrm which
> > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> > avoid requiring updated libdrm? I can do that, but it fails to test the
> > complete path that client would use.
> 
> 
> Am I missing something, or does 2.4.60 not exist yet?
> 
> That said dependency bumps for igt seem like less of an issue than
> dependency bumps for mesa..  I mean if you are using igt you are
> probably on the latest anyways..  I'm not sure why Daniel is so
> concerned about that..
> 
> (but dependency bumps to something that doesn't exist yet should
> perhaps be avoided)
> 
> BR,
> -R
> 

Hi Rob. This igt change is contigent upon my libdrm changes which
would in fact bump that version to 2.4.60 after adding an API. That
change is also posted and waiting review. I guess I should have stated
that dependency here to begin with.

http://lists.freedesktop.org/archives/intel-gfx/2015-March/061101.html

Jeff
> 
> > -Jeff
> >
> >> >  PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
> >> >  PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext dri2proto >= 2.6], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
> >> >  PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib dri2proto >= 2.6], enable_overlay_xlib=yes, enable_overlay_xlib=no)
> >> > --
> >> > 2.3.0
> >> >
> >> > _______________________________________________
> >> > Intel-gfx mailing list
> >> > Intel-gfx@lists.freedesktop.org
> >> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> >>
> >> --
> >> Daniel Vetter
> >> Software Engineer, Intel Corporation
> >> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> >> _______________________________________________
> >> Beignet mailing list
> >> Beignet@lists.freedesktop.org
> >> http://lists.freedesktop.org/mailman/listinfo/beignet
> > _______________________________________________
> > dri-devel mailing list
> > dri-devel@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/dri-devel
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 17:58         ` Rob Clark
  2015-03-10 18:34           ` Jeff McGee
@ 2015-03-10 18:47           ` Daniel Vetter
  2015-03-10 20:06             ` Jeff McGee
  1 sibling, 1 reply; 22+ messages in thread
From: Daniel Vetter @ 2015-03-10 18:47 UTC (permalink / raw)
  To: Rob Clark; +Cc: dri-devel, Intel Graphics Development, beignet, Daniel Vetter

On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
> On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> >> > From: Jeff McGee <jeff.mcgee@intel.com>
> >> >
> >> > tests/core_getparams needs the new libdrm interfaces for
> >> > querying subslice and EU counts.
> >> >
> >> > For: VIZ-4636
> >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> >> > ---
> >> >  configure.ac | 2 +-
> >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >> >
> >> > diff --git a/configure.ac b/configure.ac
> >> > index 16d6a2e..88a1c3d 100644
> >> > --- a/configure.ac
> >> > +++ b/configure.ac
> >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> >> >  fi
> >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> >> >
> >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> >>
> >> Please don't and instead copypaste the new structs/defines with a local_
> >> prefix like we do it for all the other new igt testcases. Forcing libdrm
> >> to get updated for igt all the time can get annoying fast.
> >> -Daniel
> >>
> > In this case I'm trying to exercise new API functions in libdrm which
> > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> > avoid requiring updated libdrm? I can do that, but it fails to test the
> > complete path that client would use.
> 
> 
> Am I missing something, or does 2.4.60 not exist yet?
> 
> That said dependency bumps for igt seem like less of an issue than
> dependency bumps for mesa..  I mean if you are using igt you are
> probably on the latest anyways..  I'm not sure why Daniel is so
> concerned about that..
> 
> (but dependency bumps to something that doesn't exist yet should
> perhaps be avoided)

I'd like to avoid massive depency loops for igt tests so that I can merge
the testcase right when the patches land in -nightly. Otherwise there's
always a small delay involved where regression can creep in. Also if I
have to update libdrm every time I update igt that's annoying since
without that I don't have to install/update anything at all - I run igt
in-place. And we've used the LOCAL_ prefixes for pretty much every abi
addition in igt tests thus far.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 18:47           ` [Intel-gfx] " Daniel Vetter
@ 2015-03-10 20:06             ` Jeff McGee
  2015-03-11  7:21               ` Daniel Vetter
  0 siblings, 1 reply; 22+ messages in thread
From: Jeff McGee @ 2015-03-10 20:06 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: beignet, Rob Clark, Intel Graphics Development, dri-devel

On Tue, Mar 10, 2015 at 07:47:03PM +0100, Daniel Vetter wrote:
> On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
> > On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> > > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> > >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> > >> > From: Jeff McGee <jeff.mcgee@intel.com>
> > >> >
> > >> > tests/core_getparams needs the new libdrm interfaces for
> > >> > querying subslice and EU counts.
> > >> >
> > >> > For: VIZ-4636
> > >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > >> > ---
> > >> >  configure.ac | 2 +-
> > >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >> >
> > >> > diff --git a/configure.ac b/configure.ac
> > >> > index 16d6a2e..88a1c3d 100644
> > >> > --- a/configure.ac
> > >> > +++ b/configure.ac
> > >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> > >> >  fi
> > >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> > >> >
> > >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> > >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> > >>
> > >> Please don't and instead copypaste the new structs/defines with a local_
> > >> prefix like we do it for all the other new igt testcases. Forcing libdrm
> > >> to get updated for igt all the time can get annoying fast.
> > >> -Daniel
> > >>
> > > In this case I'm trying to exercise new API functions in libdrm which
> > > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> > > avoid requiring updated libdrm? I can do that, but it fails to test the
> > > complete path that client would use.
> > 
> > 
> > Am I missing something, or does 2.4.60 not exist yet?
> > 
> > That said dependency bumps for igt seem like less of an issue than
> > dependency bumps for mesa..  I mean if you are using igt you are
> > probably on the latest anyways..  I'm not sure why Daniel is so
> > concerned about that..
> > 
> > (but dependency bumps to something that doesn't exist yet should
> > perhaps be avoided)
> 
> I'd like to avoid massive depency loops for igt tests so that I can merge
> the testcase right when the patches land in -nightly. Otherwise there's
> always a small delay involved where regression can creep in. Also if I
> have to update libdrm every time I update igt that's annoying since
> without that I don't have to install/update anything at all - I run igt
> in-place. And we've used the LOCAL_ prefixes for pretty much every abi
> addition in igt tests thus far.
> -Daniel

I understand that and it certainly makes sense when libdrm is only
providing defines or structs. But as I said, in this case there is
code in libdrm (the wrapper) that we could test as part of the
complete path. Are you recommending that I implement duplicate
wrapper functions in igt with the local prefix?
-Jeff
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* Re: [Intel-gfx] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-10 20:06             ` Jeff McGee
@ 2015-03-11  7:21               ` Daniel Vetter
  2015-03-12 20:42                 ` [Beignet] " Jeff McGee
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Vetter @ 2015-03-11  7:21 UTC (permalink / raw)
  To: Daniel Vetter, Rob Clark, dri-devel, Intel Graphics Development, beignet

On Tue, Mar 10, 2015 at 01:06:44PM -0700, Jeff McGee wrote:
> On Tue, Mar 10, 2015 at 07:47:03PM +0100, Daniel Vetter wrote:
> > On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
> > > On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> > > > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> > > >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> > > >> > From: Jeff McGee <jeff.mcgee@intel.com>
> > > >> >
> > > >> > tests/core_getparams needs the new libdrm interfaces for
> > > >> > querying subslice and EU counts.
> > > >> >
> > > >> > For: VIZ-4636
> > > >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > > >> > ---
> > > >> >  configure.ac | 2 +-
> > > >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >> >
> > > >> > diff --git a/configure.ac b/configure.ac
> > > >> > index 16d6a2e..88a1c3d 100644
> > > >> > --- a/configure.ac
> > > >> > +++ b/configure.ac
> > > >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> > > >> >  fi
> > > >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> > > >> >
> > > >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> > > >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> > > >>
> > > >> Please don't and instead copypaste the new structs/defines with a local_
> > > >> prefix like we do it for all the other new igt testcases. Forcing libdrm
> > > >> to get updated for igt all the time can get annoying fast.
> > > >> -Daniel
> > > >>
> > > > In this case I'm trying to exercise new API functions in libdrm which
> > > > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> > > > avoid requiring updated libdrm? I can do that, but it fails to test the
> > > > complete path that client would use.
> > > 
> > > 
> > > Am I missing something, or does 2.4.60 not exist yet?
> > > 
> > > That said dependency bumps for igt seem like less of an issue than
> > > dependency bumps for mesa..  I mean if you are using igt you are
> > > probably on the latest anyways..  I'm not sure why Daniel is so
> > > concerned about that..
> > > 
> > > (but dependency bumps to something that doesn't exist yet should
> > > perhaps be avoided)
> > 
> > I'd like to avoid massive depency loops for igt tests so that I can merge
> > the testcase right when the patches land in -nightly. Otherwise there's
> > always a small delay involved where regression can creep in. Also if I
> > have to update libdrm every time I update igt that's annoying since
> > without that I don't have to install/update anything at all - I run igt
> > in-place. And we've used the LOCAL_ prefixes for pretty much every abi
> > addition in igt tests thus far.
> > -Daniel
> 
> I understand that and it certainly makes sense when libdrm is only
> providing defines or structs. But as I said, in this case there is
> code in libdrm (the wrapper) that we could test as part of the
> complete path. Are you recommending that I implement duplicate
> wrapper functions in igt with the local prefix?

Sorry I totally didn't realize that. Generally we don't have a lot of igt
testcase for libdrm really, imo it's usually simpler to just add the
interface to each part. Since this is such a simple one there's no need to
have a low-level test and the libdrm test on top, but that's what I'd do
if there's something worth testing in libdrm. Because for complex
functionality I really want to get the bare-metal tests in together with
the kernel part. Stalling for libdrm release could take longer.

And yes, personally I'd just have open-coded the getparam call here in
igt, but that's just a bikeshed.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* [PATCH i-g-t v2] tests/core_getparams: Create new test core_getparams
  2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
                     ` (2 preceding siblings ...)
  2015-03-09 23:41   ` jeff.mcgee
@ 2015-03-12 20:38   ` jeff.mcgee
  2015-03-13  0:26     ` [PATCH i-g-t v3] " jeff.mcgee
  3 siblings, 1 reply; 22+ messages in thread
From: jeff.mcgee @ 2015-03-12 20:38 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

New test core_getparams consists of 2 subtests, each one testing
the ability of userspace to query the correct value of a GT config
attribute: subslice total or EU total. drm/i915 implementation of
these queries is required for Cherryview and Gen9+ devices (non-
simulated).

v2: Duplicate small amount of new libdrm functionality to avoid
    bumping libdrm version requirement (Daniel). Convert some
    igt_asserts to the appropriate comparison variants. Add a
    test description.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/.gitignore       |   1 +
 tests/Makefile.sources |   1 +
 tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 169 insertions(+)
 create mode 100644 tests/core_getparams.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 426cc67..c742308 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,7 @@
 # Please keep sorted alphabetically
 core_get_client_auth
 core_getclient
+core_getparams
 core_getstats
 core_getversion
 drm_import_export
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 51e8376..999c8f8 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
 
 TESTS_progs_M = \
 	core_get_client_auth \
+	core_getparams \
 	drv_suspend \
 	drv_hangman \
 	gem_bad_reloc \
diff --git a/tests/core_getparams.c b/tests/core_getparams.c
new file mode 100644
index 0000000..2855d06
--- /dev/null
+++ b/tests/core_getparams.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Jeff McGee <jeff.mcgee@intel.com>
+ *
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <xf86drm.h>
+#include <i915_drm.h>
+#include "drmtest.h"
+#include "intel_chipset.h"
+#include "intel_bufmgr.h"
+
+IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
+
+int drm_fd;
+int devid;
+
+static void
+init(void)
+{
+	drm_fd = drm_open_any();
+	devid = intel_get_drm_devid(drm_fd);
+}
+
+static void
+deinit(void)
+{
+	close(drm_fd);
+}
+
+#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
+#define LOCAL_I915_PARAM_EU_TOTAL	34
+
+static int
+getparam(int param, int *value)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memset(&gp, 0, sizeof(gp));
+	gp.value = value;
+	gp.param = param;
+	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	if (ret)
+		return -errno;
+
+	return 0;
+}
+
+static void
+subslice_total(void)
+{
+	unsigned int subslice_total = 0;
+	int ret;
+
+	ret = getparam(I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert_eq(ret, -ENODEV);
+			igt_info("subslice total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert_neq(ret, EINVAL); /* request not recognized? */
+			igt_assert_neq(ret, ENODEV); /* device not supported? */
+			igt_assert_eq(ret, 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert_neq(subslice_total, 0);
+		igt_info("subslice total: %u\n", subslice_total);
+	}
+}
+
+static void
+eu_total(void)
+{
+	unsigned int eu_total = 0;
+	int ret;
+
+	ret = getparam(I915_PARAM_EU_TOTAL, (int*)&eu_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert_eq(ret, -ENODEV);
+			igt_info("EU total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert_neq(ret, EINVAL); /* request not recognized? */
+			igt_assert_neq(ret, ENODEV); /* device not supported? */
+			igt_assert_eq(ret, 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert_neq(eu_total, 0);
+		igt_info("EU total: %u\n", eu_total);
+	}
+}
+
+static void
+exit_handler(int sig)
+{
+	deinit();
+}
+
+igt_main
+{
+	igt_fixture {
+		igt_install_exit_handler(exit_handler);
+		init();
+	}
+
+	igt_subtest("subslice-total")
+		subslice_total();
+
+	igt_subtest("eu-total")
+		eu_total();
+}
-- 
2.3.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Beignet] [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60
  2015-03-11  7:21               ` Daniel Vetter
@ 2015-03-12 20:42                 ` Jeff McGee
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff McGee @ 2015-03-12 20:42 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: beignet, Intel Graphics Development, dri-devel

On Wed, Mar 11, 2015 at 08:21:36AM +0100, Daniel Vetter wrote:
> On Tue, Mar 10, 2015 at 01:06:44PM -0700, Jeff McGee wrote:
> > On Tue, Mar 10, 2015 at 07:47:03PM +0100, Daniel Vetter wrote:
> > > On Tue, Mar 10, 2015 at 01:58:52PM -0400, Rob Clark wrote:
> > > > On Tue, Mar 10, 2015 at 12:59 PM, Jeff McGee <jeff.mcgee@intel.com> wrote:
> > > > > On Tue, Mar 10, 2015 at 08:37:30AM +0100, Daniel Vetter wrote:
> > > > >> On Mon, Mar 09, 2015 at 04:41:02PM -0700, jeff.mcgee@intel.com wrote:
> > > > >> > From: Jeff McGee <jeff.mcgee@intel.com>
> > > > >> >
> > > > >> > tests/core_getparams needs the new libdrm interfaces for
> > > > >> > querying subslice and EU counts.
> > > > >> >
> > > > >> > For: VIZ-4636
> > > > >> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > > > >> > ---
> > > > >> >  configure.ac | 2 +-
> > > > >> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >> >
> > > > >> > diff --git a/configure.ac b/configure.ac
> > > > >> > index 16d6a2e..88a1c3d 100644
> > > > >> > --- a/configure.ac
> > > > >> > +++ b/configure.ac
> > > > >> > @@ -82,7 +82,7 @@ if test "x$GCC" = "xyes"; then
> > > > >> >  fi
> > > > >> >  AC_SUBST(ASSEMBLER_WARN_CFLAGS)
> > > > >> >
> > > > >> > -PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.52 libdrm])
> > > > >> > +PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.60 libdrm])
> > > > >>
> > > > >> Please don't and instead copypaste the new structs/defines with a local_
> > > > >> prefix like we do it for all the other new igt testcases. Forcing libdrm
> > > > >> to get updated for igt all the time can get annoying fast.
> > > > >> -Daniel
> > > > >>
> > > > > In this case I'm trying to exercise new API functions in libdrm which
> > > > > wrap the GETPARAM ioctl. Would you rather me bypass the wrapper to
> > > > > avoid requiring updated libdrm? I can do that, but it fails to test the
> > > > > complete path that client would use.
> > > > 
> > > > 
> > > > Am I missing something, or does 2.4.60 not exist yet?
> > > > 
> > > > That said dependency bumps for igt seem like less of an issue than
> > > > dependency bumps for mesa..  I mean if you are using igt you are
> > > > probably on the latest anyways..  I'm not sure why Daniel is so
> > > > concerned about that..
> > > > 
> > > > (but dependency bumps to something that doesn't exist yet should
> > > > perhaps be avoided)
> > > 
> > > I'd like to avoid massive depency loops for igt tests so that I can merge
> > > the testcase right when the patches land in -nightly. Otherwise there's
> > > always a small delay involved where regression can creep in. Also if I
> > > have to update libdrm every time I update igt that's annoying since
> > > without that I don't have to install/update anything at all - I run igt
> > > in-place. And we've used the LOCAL_ prefixes for pretty much every abi
> > > addition in igt tests thus far.
> > > -Daniel
> > 
> > I understand that and it certainly makes sense when libdrm is only
> > providing defines or structs. But as I said, in this case there is
> > code in libdrm (the wrapper) that we could test as part of the
> > complete path. Are you recommending that I implement duplicate
> > wrapper functions in igt with the local prefix?
> 
> Sorry I totally didn't realize that. Generally we don't have a lot of igt
> testcase for libdrm really, imo it's usually simpler to just add the
> interface to each part. Since this is such a simple one there's no need to
> have a low-level test and the libdrm test on top, but that's what I'd do
> if there's something worth testing in libdrm. Because for complex
> functionality I really want to get the bare-metal tests in together with
> the kernel part. Stalling for libdrm release could take longer.
> 
> And yes, personally I'd just have open-coded the getparam call here in
> igt, but that's just a bikeshed.
> -Daniel
> -- 

Scratch this patch. I just sent v2 of the previous patch that removes
the dependency on libdrm update.
-Jeff
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-12 20:38   ` [PATCH i-g-t v2] tests/core_getparams: Create new test core_getparams jeff.mcgee
@ 2015-03-13  0:26     ` jeff.mcgee
  2015-03-13  8:58       ` Daniel Vetter
  2015-03-13  9:09       ` [Intel-gfx] " Zhigang Gong
  0 siblings, 2 replies; 22+ messages in thread
From: jeff.mcgee @ 2015-03-13  0:26 UTC (permalink / raw)
  To: intel-gfx; +Cc: dri-devel, beignet

From: Jeff McGee <jeff.mcgee@intel.com>

New test core_getparams consists of 2 subtests, each one testing
the ability of userspace to query the correct value of a GT config
attribute: subslice total or EU total. drm/i915 implementation of
these queries is required for Cherryview and Gen9+ devices (non-
simulated).

v2: Duplicate small amount of new libdrm functionality to avoid
    bumping libdrm version requirement (Daniel). Convert some
    igt_asserts to the appropriate comparison variants. Add a
    test description.
v3: Actually use the LOCAL GETPARAM defines. Otherwise can't build
    against older libdrm as intended by v2.

For: VIZ-4636
Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
---
 tests/.gitignore       |   1 +
 tests/Makefile.sources |   1 +
 tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
 3 files changed, 169 insertions(+)
 create mode 100644 tests/core_getparams.c

diff --git a/tests/.gitignore b/tests/.gitignore
index 426cc67..c742308 100644
--- a/tests/.gitignore
+++ b/tests/.gitignore
@@ -1,6 +1,7 @@
 # Please keep sorted alphabetically
 core_get_client_auth
 core_getclient
+core_getparams
 core_getstats
 core_getversion
 drm_import_export
diff --git a/tests/Makefile.sources b/tests/Makefile.sources
index 51e8376..999c8f8 100644
--- a/tests/Makefile.sources
+++ b/tests/Makefile.sources
@@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
 
 TESTS_progs_M = \
 	core_get_client_auth \
+	core_getparams \
 	drv_suspend \
 	drv_hangman \
 	gem_bad_reloc \
diff --git a/tests/core_getparams.c b/tests/core_getparams.c
new file mode 100644
index 0000000..2855d06
--- /dev/null
+++ b/tests/core_getparams.c
@@ -0,0 +1,167 @@
+/*
+ * Copyright © 2014 Intel Corporation
+ *
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
+ * Software is furnished to do so, subject to the following conditions:
+ *
+ * The above copyright notice and this permission notice (including the next
+ * paragraph) shall be included in all copies or substantial portions of the
+ * Software.
+ *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
+ * IN THE SOFTWARE.
+ *
+ * Authors:
+ *    Jeff McGee <jeff.mcgee@intel.com>
+ *
+ */
+
+#include <unistd.h>
+#include <errno.h>
+#include <xf86drm.h>
+#include <i915_drm.h>
+#include "drmtest.h"
+#include "intel_chipset.h"
+#include "intel_bufmgr.h"
+
+IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
+
+int drm_fd;
+int devid;
+
+static void
+init(void)
+{
+	drm_fd = drm_open_any();
+	devid = intel_get_drm_devid(drm_fd);
+}
+
+static void
+deinit(void)
+{
+	close(drm_fd);
+}
+
+#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
+#define LOCAL_I915_PARAM_EU_TOTAL	34
+
+static int
+getparam(int param, int *value)
+{
+	drm_i915_getparam_t gp;
+	int ret;
+
+	memset(&gp, 0, sizeof(gp));
+	gp.value = value;
+	gp.param = param;
+	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
+	if (ret)
+		return -errno;
+
+	return 0;
+}
+
+static void
+subslice_total(void)
+{
+	unsigned int subslice_total = 0;
+	int ret;
+
+	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert_eq(ret, -ENODEV);
+			igt_info("subslice total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert_neq(ret, EINVAL); /* request not recognized? */
+			igt_assert_neq(ret, ENODEV); /* device not supported? */
+			igt_assert_eq(ret, 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert_neq(subslice_total, 0);
+		igt_info("subslice total: %u\n", subslice_total);
+	}
+}
+
+static void
+eu_total(void)
+{
+	unsigned int eu_total = 0;
+	int ret;
+
+	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
+
+	if (ret) {
+		/*
+		 * These devices are not required to implement the
+		 * interface. If they do not, -ENODEV must be returned.
+		*/
+		if ((intel_gen(devid) < 8) ||
+		    IS_BROADWELL(devid) ||
+		    igt_run_in_simulation()) {
+			igt_assert_eq(ret, -ENODEV);
+			igt_info("EU total: unknown\n");
+		/*
+		 * All other devices must implement the interface, so
+		 * fail them if we are here.
+		*/
+		} else {
+			igt_assert_neq(ret, EINVAL); /* request not recognized? */
+			igt_assert_neq(ret, ENODEV); /* device not supported? */
+			igt_assert_eq(ret, 0); /* other error? */
+		}
+	} else {
+		/*
+		 * On success, just make sure the returned count value is
+		 * non-zero. The validity of the count value for the given
+		 * device is not checked.
+		*/
+		igt_assert_neq(eu_total, 0);
+		igt_info("EU total: %u\n", eu_total);
+	}
+}
+
+static void
+exit_handler(int sig)
+{
+	deinit();
+}
+
+igt_main
+{
+	igt_fixture {
+		igt_install_exit_handler(exit_handler);
+		init();
+	}
+
+	igt_subtest("subslice-total")
+		subslice_total();
+
+	igt_subtest("eu-total")
+		eu_total();
+}
-- 
2.3.0

_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13  0:26     ` [PATCH i-g-t v3] " jeff.mcgee
@ 2015-03-13  8:58       ` Daniel Vetter
  2015-03-13  9:09       ` [Intel-gfx] " Zhigang Gong
  1 sibling, 0 replies; 22+ messages in thread
From: Daniel Vetter @ 2015-03-13  8:58 UTC (permalink / raw)
  To: jeff.mcgee; +Cc: intel-gfx, beignet, dri-devel

On Thu, Mar 12, 2015 at 05:26:25PM -0700, jeff.mcgee@intel.com wrote:
> From: Jeff McGee <jeff.mcgee@intel.com>
> 
> New test core_getparams consists of 2 subtests, each one testing
> the ability of userspace to query the correct value of a GT config
> attribute: subslice total or EU total. drm/i915 implementation of
> these queries is required for Cherryview and Gen9+ devices (non-
> simulated).
> 
> v2: Duplicate small amount of new libdrm functionality to avoid
>     bumping libdrm version requirement (Daniel). Convert some
>     igt_asserts to the appropriate comparison variants. Add a
>     test description.
> v3: Actually use the LOCAL GETPARAM defines. Otherwise can't build
>     against older libdrm as intended by v2.
> 
> For: VIZ-4636
> Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> ---
>  tests/.gitignore       |   1 +
>  tests/Makefile.sources |   1 +
>  tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 169 insertions(+)
>  create mode 100644 tests/core_getparams.c
> 
> diff --git a/tests/.gitignore b/tests/.gitignore
> index 426cc67..c742308 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -1,6 +1,7 @@
>  # Please keep sorted alphabetically
>  core_get_client_auth
>  core_getclient
> +core_getparams
>  core_getstats
>  core_getversion
>  drm_import_export
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 51e8376..999c8f8 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
>  
>  TESTS_progs_M = \
>  	core_get_client_auth \
> +	core_getparams \

Sorry I missed this little one: core_ is for drm core stuff shared by all
drivers (i.e. even those not supporting gem or kms). getparam is an i915
specific thing, so imo better to have drv_ as a prefix.

For our naming conventions and igt test sections see the docs at

http://people.freedesktop.org/~danvet/igt/

For review I think signing up someone from the beignet team might be best.
Cheers, Daniel

>  	drv_suspend \
>  	drv_hangman \
>  	gem_bad_reloc \
> diff --git a/tests/core_getparams.c b/tests/core_getparams.c
> new file mode 100644
> index 0000000..2855d06
> --- /dev/null
> +++ b/tests/core_getparams.c
> @@ -0,0 +1,167 @@
> +/*
> + * Copyright © 2014 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Jeff McGee <jeff.mcgee@intel.com>
> + *
> + */
> +
> +#include <unistd.h>
> +#include <errno.h>
> +#include <xf86drm.h>
> +#include <i915_drm.h>
> +#include "drmtest.h"
> +#include "intel_chipset.h"
> +#include "intel_bufmgr.h"
> +
> +IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
> +
> +int drm_fd;
> +int devid;
> +
> +static void
> +init(void)
> +{
> +	drm_fd = drm_open_any();
> +	devid = intel_get_drm_devid(drm_fd);
> +}
> +
> +static void
> +deinit(void)
> +{
> +	close(drm_fd);
> +}
> +
> +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
> +#define LOCAL_I915_PARAM_EU_TOTAL	34
> +
> +static int
> +getparam(int param, int *value)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	memset(&gp, 0, sizeof(gp));
> +	gp.value = value;
> +	gp.param = param;
> +	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
> +
> +static void
> +subslice_total(void)
> +{
> +	unsigned int subslice_total = 0;
> +	int ret;
> +
> +	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
> +
> +	if (ret) {
> +		/*
> +		 * These devices are not required to implement the
> +		 * interface. If they do not, -ENODEV must be returned.
> +		*/
> +		if ((intel_gen(devid) < 8) ||
> +		    IS_BROADWELL(devid) ||
> +		    igt_run_in_simulation()) {
> +			igt_assert_eq(ret, -ENODEV);
> +			igt_info("subslice total: unknown\n");
> +		/*
> +		 * All other devices must implement the interface, so
> +		 * fail them if we are here.
> +		*/
> +		} else {
> +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> +			igt_assert_eq(ret, 0); /* other error? */
> +		}
> +	} else {
> +		/*
> +		 * On success, just make sure the returned count value is
> +		 * non-zero. The validity of the count value for the given
> +		 * device is not checked.
> +		*/
> +		igt_assert_neq(subslice_total, 0);
> +		igt_info("subslice total: %u\n", subslice_total);
> +	}
> +}
> +
> +static void
> +eu_total(void)
> +{
> +	unsigned int eu_total = 0;
> +	int ret;
> +
> +	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
> +
> +	if (ret) {
> +		/*
> +		 * These devices are not required to implement the
> +		 * interface. If they do not, -ENODEV must be returned.
> +		*/
> +		if ((intel_gen(devid) < 8) ||
> +		    IS_BROADWELL(devid) ||
> +		    igt_run_in_simulation()) {
> +			igt_assert_eq(ret, -ENODEV);
> +			igt_info("EU total: unknown\n");
> +		/*
> +		 * All other devices must implement the interface, so
> +		 * fail them if we are here.
> +		*/
> +		} else {
> +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> +			igt_assert_eq(ret, 0); /* other error? */
> +		}
> +	} else {
> +		/*
> +		 * On success, just make sure the returned count value is
> +		 * non-zero. The validity of the count value for the given
> +		 * device is not checked.
> +		*/
> +		igt_assert_neq(eu_total, 0);
> +		igt_info("EU total: %u\n", eu_total);
> +	}
> +}
> +
> +static void
> +exit_handler(int sig)
> +{
> +	deinit();
> +}
> +
> +igt_main
> +{
> +	igt_fixture {
> +		igt_install_exit_handler(exit_handler);
> +		init();
> +	}
> +
> +	igt_subtest("subslice-total")
> +		subslice_total();
> +
> +	igt_subtest("eu-total")
> +		eu_total();
> +}
> -- 
> 2.3.0
> 
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13  0:26     ` [PATCH i-g-t v3] " jeff.mcgee
  2015-03-13  8:58       ` Daniel Vetter
@ 2015-03-13  9:09       ` Zhigang Gong
  2015-03-13 16:32         ` Daniel Vetter
  1 sibling, 1 reply; 22+ messages in thread
From: Zhigang Gong @ 2015-03-13  9:09 UTC (permalink / raw)
  To: jeff.mcgee; +Cc: intel-gfx, beignet, dri-devel

My only concern is about the following macros:

> +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL      33
> +#define LOCAL_I915_PARAM_EU_TOTAL    34

How about to just use the definitons in the kernel header file?
For an example:

  #include <drm/i915_drm.h>

  #ifdef LOCAL_I915_PARAM_SUBSLICE_TOTAL
  //Put all the code into this block.
  #endif

Then we can avoid put the same definitions in different files,
and we can avoid unecessary testing on an old kernel which doesn't
have this kernel interface.

For all the other part, it LGTM.

Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>

Thanks,
Zhigang Gong.

On Thu, Mar 12, 2015 at 05:26:25PM -0700, jeff.mcgee@intel.com wrote:
> From: Jeff McGee <jeff.mcgee@intel.com>
> 
> New test core_getparams consists of 2 subtests, each one testing
> the ability of userspace to query the correct value of a GT config
> attribute: subslice total or EU total. drm/i915 implementation of
> these queries is required for Cherryview and Gen9+ devices (non-
> simulated).
> 
> v2: Duplicate small amount of new libdrm functionality to avoid
>     bumping libdrm version requirement (Daniel). Convert some
>     igt_asserts to the appropriate comparison variants. Add a
>     test description.
> v3: Actually use the LOCAL GETPARAM defines. Otherwise can't build
>     against older libdrm as intended by v2.
> 
> For: VIZ-4636
> Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> ---
>  tests/.gitignore       |   1 +
>  tests/Makefile.sources |   1 +
>  tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 169 insertions(+)
>  create mode 100644 tests/core_getparams.c
> 
> diff --git a/tests/.gitignore b/tests/.gitignore
> index 426cc67..c742308 100644
> --- a/tests/.gitignore
> +++ b/tests/.gitignore
> @@ -1,6 +1,7 @@
>  # Please keep sorted alphabetically
>  core_get_client_auth
>  core_getclient
> +core_getparams
>  core_getstats
>  core_getversion
>  drm_import_export
> diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> index 51e8376..999c8f8 100644
> --- a/tests/Makefile.sources
> +++ b/tests/Makefile.sources
> @@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
>  
>  TESTS_progs_M = \
>  	core_get_client_auth \
> +	core_getparams \
>  	drv_suspend \
>  	drv_hangman \
>  	gem_bad_reloc \
> diff --git a/tests/core_getparams.c b/tests/core_getparams.c
> new file mode 100644
> index 0000000..2855d06
> --- /dev/null
> +++ b/tests/core_getparams.c
> @@ -0,0 +1,167 @@
> +/*
> + * Copyright © 2014 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> + * IN THE SOFTWARE.
> + *
> + * Authors:
> + *    Jeff McGee <jeff.mcgee@intel.com>
> + *
> + */
> +
> +#include <unistd.h>
> +#include <errno.h>
> +#include <xf86drm.h>
> +#include <i915_drm.h>
> +#include "drmtest.h"
> +#include "intel_chipset.h"
> +#include "intel_bufmgr.h"
> +
> +IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
> +
> +int drm_fd;
> +int devid;
> +
> +static void
> +init(void)
> +{
> +	drm_fd = drm_open_any();
> +	devid = intel_get_drm_devid(drm_fd);
> +}
> +
> +static void
> +deinit(void)
> +{
> +	close(drm_fd);
> +}
> +
> +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
> +#define LOCAL_I915_PARAM_EU_TOTAL	34
> +
> +static int
> +getparam(int param, int *value)
> +{
> +	drm_i915_getparam_t gp;
> +	int ret;
> +
> +	memset(&gp, 0, sizeof(gp));
> +	gp.value = value;
> +	gp.param = param;
> +	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
> +	if (ret)
> +		return -errno;
> +
> +	return 0;
> +}
> +
> +static void
> +subslice_total(void)
> +{
> +	unsigned int subslice_total = 0;
> +	int ret;
> +
> +	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
> +
> +	if (ret) {
> +		/*
> +		 * These devices are not required to implement the
> +		 * interface. If they do not, -ENODEV must be returned.
> +		*/
> +		if ((intel_gen(devid) < 8) ||
> +		    IS_BROADWELL(devid) ||
> +		    igt_run_in_simulation()) {
> +			igt_assert_eq(ret, -ENODEV);
> +			igt_info("subslice total: unknown\n");
> +		/*
> +		 * All other devices must implement the interface, so
> +		 * fail them if we are here.
> +		*/
> +		} else {
> +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> +			igt_assert_eq(ret, 0); /* other error? */
> +		}
> +	} else {
> +		/*
> +		 * On success, just make sure the returned count value is
> +		 * non-zero. The validity of the count value for the given
> +		 * device is not checked.
> +		*/
> +		igt_assert_neq(subslice_total, 0);
> +		igt_info("subslice total: %u\n", subslice_total);
> +	}
> +}
> +
> +static void
> +eu_total(void)
> +{
> +	unsigned int eu_total = 0;
> +	int ret;
> +
> +	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
> +
> +	if (ret) {
> +		/*
> +		 * These devices are not required to implement the
> +		 * interface. If they do not, -ENODEV must be returned.
> +		*/
> +		if ((intel_gen(devid) < 8) ||
> +		    IS_BROADWELL(devid) ||
> +		    igt_run_in_simulation()) {
> +			igt_assert_eq(ret, -ENODEV);
> +			igt_info("EU total: unknown\n");
> +		/*
> +		 * All other devices must implement the interface, so
> +		 * fail them if we are here.
> +		*/
> +		} else {
> +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> +			igt_assert_eq(ret, 0); /* other error? */
> +		}
> +	} else {
> +		/*
> +		 * On success, just make sure the returned count value is
> +		 * non-zero. The validity of the count value for the given
> +		 * device is not checked.
> +		*/
> +		igt_assert_neq(eu_total, 0);
> +		igt_info("EU total: %u\n", eu_total);
> +	}
> +}
> +
> +static void
> +exit_handler(int sig)
> +{
> +	deinit();
> +}
> +
> +igt_main
> +{
> +	igt_fixture {
> +		igt_install_exit_handler(exit_handler);
> +		init();
> +	}
> +
> +	igt_subtest("subslice-total")
> +		subslice_total();
> +
> +	igt_subtest("eu-total")
> +		eu_total();
> +}
> -- 
> 2.3.0
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

* Re: [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13  9:09       ` [Intel-gfx] " Zhigang Gong
@ 2015-03-13 16:32         ` Daniel Vetter
  2015-03-13 16:51           ` [Beignet] [Intel-gfx] " Jeff McGee
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Vetter @ 2015-03-13 16:32 UTC (permalink / raw)
  To: jeff.mcgee, intel-gfx, dri-devel, beignet

On Fri, Mar 13, 2015 at 05:09:46PM +0800, Zhigang Gong wrote:
> My only concern is about the following macros:
> 
> > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL      33
> > +#define LOCAL_I915_PARAM_EU_TOTAL    34
> 
> How about to just use the definitons in the kernel header file?
> For an example:
> 
>   #include <drm/i915_drm.h>
> 
>   #ifdef LOCAL_I915_PARAM_SUBSLICE_TOTAL
>   //Put all the code into this block.
>   #endif
> 
> Then we can avoid put the same definitions in different files,
> and we can avoid unecessary testing on an old kernel which doesn't
> have this kernel interface.
> 
> For all the other part, it LGTM.
> 
> Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>

Once we update the libdrm requirements in igt we tend to go around and
replace all the now obsolete LOCAL_ defines. Imo not worth doing extra
work until then.

Patch applied, thanks.
-Daniel

> 
> Thanks,
> Zhigang Gong.
> 
> On Thu, Mar 12, 2015 at 05:26:25PM -0700, jeff.mcgee@intel.com wrote:
> > From: Jeff McGee <jeff.mcgee@intel.com>
> > 
> > New test core_getparams consists of 2 subtests, each one testing
> > the ability of userspace to query the correct value of a GT config
> > attribute: subslice total or EU total. drm/i915 implementation of
> > these queries is required for Cherryview and Gen9+ devices (non-
> > simulated).
> > 
> > v2: Duplicate small amount of new libdrm functionality to avoid
> >     bumping libdrm version requirement (Daniel). Convert some
> >     igt_asserts to the appropriate comparison variants. Add a
> >     test description.
> > v3: Actually use the LOCAL GETPARAM defines. Otherwise can't build
> >     against older libdrm as intended by v2.
> > 
> > For: VIZ-4636
> > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > ---
> >  tests/.gitignore       |   1 +
> >  tests/Makefile.sources |   1 +
> >  tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
> >  3 files changed, 169 insertions(+)
> >  create mode 100644 tests/core_getparams.c
> > 
> > diff --git a/tests/.gitignore b/tests/.gitignore
> > index 426cc67..c742308 100644
> > --- a/tests/.gitignore
> > +++ b/tests/.gitignore
> > @@ -1,6 +1,7 @@
> >  # Please keep sorted alphabetically
> >  core_get_client_auth
> >  core_getclient
> > +core_getparams
> >  core_getstats
> >  core_getversion
> >  drm_import_export
> > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > index 51e8376..999c8f8 100644
> > --- a/tests/Makefile.sources
> > +++ b/tests/Makefile.sources
> > @@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
> >  
> >  TESTS_progs_M = \
> >  	core_get_client_auth \
> > +	core_getparams \
> >  	drv_suspend \
> >  	drv_hangman \
> >  	gem_bad_reloc \
> > diff --git a/tests/core_getparams.c b/tests/core_getparams.c
> > new file mode 100644
> > index 0000000..2855d06
> > --- /dev/null
> > +++ b/tests/core_getparams.c
> > @@ -0,0 +1,167 @@
> > +/*
> > + * Copyright © 2014 Intel Corporation
> > + *
> > + * Permission is hereby granted, free of charge, to any person obtaining a
> > + * copy of this software and associated documentation files (the "Software"),
> > + * to deal in the Software without restriction, including without limitation
> > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > + * and/or sell copies of the Software, and to permit persons to whom the
> > + * Software is furnished to do so, subject to the following conditions:
> > + *
> > + * The above copyright notice and this permission notice (including the next
> > + * paragraph) shall be included in all copies or substantial portions of the
> > + * Software.
> > + *
> > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > + * IN THE SOFTWARE.
> > + *
> > + * Authors:
> > + *    Jeff McGee <jeff.mcgee@intel.com>
> > + *
> > + */
> > +
> > +#include <unistd.h>
> > +#include <errno.h>
> > +#include <xf86drm.h>
> > +#include <i915_drm.h>
> > +#include "drmtest.h"
> > +#include "intel_chipset.h"
> > +#include "intel_bufmgr.h"
> > +
> > +IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
> > +
> > +int drm_fd;
> > +int devid;
> > +
> > +static void
> > +init(void)
> > +{
> > +	drm_fd = drm_open_any();
> > +	devid = intel_get_drm_devid(drm_fd);
> > +}
> > +
> > +static void
> > +deinit(void)
> > +{
> > +	close(drm_fd);
> > +}
> > +
> > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
> > +#define LOCAL_I915_PARAM_EU_TOTAL	34
> > +
> > +static int
> > +getparam(int param, int *value)
> > +{
> > +	drm_i915_getparam_t gp;
> > +	int ret;
> > +
> > +	memset(&gp, 0, sizeof(gp));
> > +	gp.value = value;
> > +	gp.param = param;
> > +	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
> > +	if (ret)
> > +		return -errno;
> > +
> > +	return 0;
> > +}
> > +
> > +static void
> > +subslice_total(void)
> > +{
> > +	unsigned int subslice_total = 0;
> > +	int ret;
> > +
> > +	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
> > +
> > +	if (ret) {
> > +		/*
> > +		 * These devices are not required to implement the
> > +		 * interface. If they do not, -ENODEV must be returned.
> > +		*/
> > +		if ((intel_gen(devid) < 8) ||
> > +		    IS_BROADWELL(devid) ||
> > +		    igt_run_in_simulation()) {
> > +			igt_assert_eq(ret, -ENODEV);
> > +			igt_info("subslice total: unknown\n");
> > +		/*
> > +		 * All other devices must implement the interface, so
> > +		 * fail them if we are here.
> > +		*/
> > +		} else {
> > +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> > +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> > +			igt_assert_eq(ret, 0); /* other error? */
> > +		}
> > +	} else {
> > +		/*
> > +		 * On success, just make sure the returned count value is
> > +		 * non-zero. The validity of the count value for the given
> > +		 * device is not checked.
> > +		*/
> > +		igt_assert_neq(subslice_total, 0);
> > +		igt_info("subslice total: %u\n", subslice_total);
> > +	}
> > +}
> > +
> > +static void
> > +eu_total(void)
> > +{
> > +	unsigned int eu_total = 0;
> > +	int ret;
> > +
> > +	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
> > +
> > +	if (ret) {
> > +		/*
> > +		 * These devices are not required to implement the
> > +		 * interface. If they do not, -ENODEV must be returned.
> > +		*/
> > +		if ((intel_gen(devid) < 8) ||
> > +		    IS_BROADWELL(devid) ||
> > +		    igt_run_in_simulation()) {
> > +			igt_assert_eq(ret, -ENODEV);
> > +			igt_info("EU total: unknown\n");
> > +		/*
> > +		 * All other devices must implement the interface, so
> > +		 * fail them if we are here.
> > +		*/
> > +		} else {
> > +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> > +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> > +			igt_assert_eq(ret, 0); /* other error? */
> > +		}
> > +	} else {
> > +		/*
> > +		 * On success, just make sure the returned count value is
> > +		 * non-zero. The validity of the count value for the given
> > +		 * device is not checked.
> > +		*/
> > +		igt_assert_neq(eu_total, 0);
> > +		igt_info("EU total: %u\n", eu_total);
> > +	}
> > +}
> > +
> > +static void
> > +exit_handler(int sig)
> > +{
> > +	deinit();
> > +}
> > +
> > +igt_main
> > +{
> > +	igt_fixture {
> > +		igt_install_exit_handler(exit_handler);
> > +		init();
> > +	}
> > +
> > +	igt_subtest("subslice-total")
> > +		subslice_total();
> > +
> > +	igt_subtest("eu-total")
> > +		eu_total();
> > +}
> > -- 
> > 2.3.0
> > 
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/intel-gfx

-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Beignet] [Intel-gfx] [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13 16:32         ` Daniel Vetter
@ 2015-03-13 16:51           ` Jeff McGee
  2015-03-13 16:59             ` [Beignet] " Daniel Vetter
  0 siblings, 1 reply; 22+ messages in thread
From: Jeff McGee @ 2015-03-13 16:51 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, beignet, dri-devel

On Fri, Mar 13, 2015 at 05:32:41PM +0100, Daniel Vetter wrote:
> On Fri, Mar 13, 2015 at 05:09:46PM +0800, Zhigang Gong wrote:
> > My only concern is about the following macros:
> > 
> > > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL      33
> > > +#define LOCAL_I915_PARAM_EU_TOTAL    34
> > 
> > How about to just use the definitons in the kernel header file?
> > For an example:
> > 
> >   #include <drm/i915_drm.h>
> > 
> >   #ifdef LOCAL_I915_PARAM_SUBSLICE_TOTAL
> >   //Put all the code into this block.
> >   #endif
> > 
> > Then we can avoid put the same definitions in different files,
> > and we can avoid unecessary testing on an old kernel which doesn't
> > have this kernel interface.
> > 
> > For all the other part, it LGTM.
> > 
> > Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
> 
> Once we update the libdrm requirements in igt we tend to go around and
> replace all the now obsolete LOCAL_ defines. Imo not worth doing extra
> work until then.
> 
> Patch applied, thanks.
> -Daniel
> 

Patch applied? Do you want me to make the name change first? Should the
kernel part be reviewed and merged first?
-Jeff

> > 
> > Thanks,
> > Zhigang Gong.
> > 
> > On Thu, Mar 12, 2015 at 05:26:25PM -0700, jeff.mcgee@intel.com wrote:
> > > From: Jeff McGee <jeff.mcgee@intel.com>
> > > 
> > > New test core_getparams consists of 2 subtests, each one testing
> > > the ability of userspace to query the correct value of a GT config
> > > attribute: subslice total or EU total. drm/i915 implementation of
> > > these queries is required for Cherryview and Gen9+ devices (non-
> > > simulated).
> > > 
> > > v2: Duplicate small amount of new libdrm functionality to avoid
> > >     bumping libdrm version requirement (Daniel). Convert some
> > >     igt_asserts to the appropriate comparison variants. Add a
> > >     test description.
> > > v3: Actually use the LOCAL GETPARAM defines. Otherwise can't build
> > >     against older libdrm as intended by v2.
> > > 
> > > For: VIZ-4636
> > > Signed-off-by: Jeff McGee <jeff.mcgee@intel.com>
> > > ---
> > >  tests/.gitignore       |   1 +
> > >  tests/Makefile.sources |   1 +
> > >  tests/core_getparams.c | 167 +++++++++++++++++++++++++++++++++++++++++++++++++
> > >  3 files changed, 169 insertions(+)
> > >  create mode 100644 tests/core_getparams.c
> > > 
> > > diff --git a/tests/.gitignore b/tests/.gitignore
> > > index 426cc67..c742308 100644
> > > --- a/tests/.gitignore
> > > +++ b/tests/.gitignore
> > > @@ -1,6 +1,7 @@
> > >  # Please keep sorted alphabetically
> > >  core_get_client_auth
> > >  core_getclient
> > > +core_getparams
> > >  core_getstats
> > >  core_getversion
> > >  drm_import_export
> > > diff --git a/tests/Makefile.sources b/tests/Makefile.sources
> > > index 51e8376..999c8f8 100644
> > > --- a/tests/Makefile.sources
> > > +++ b/tests/Makefile.sources
> > > @@ -15,6 +15,7 @@ NOUVEAU_TESTS_M = \
> > >  
> > >  TESTS_progs_M = \
> > >  	core_get_client_auth \
> > > +	core_getparams \
> > >  	drv_suspend \
> > >  	drv_hangman \
> > >  	gem_bad_reloc \
> > > diff --git a/tests/core_getparams.c b/tests/core_getparams.c
> > > new file mode 100644
> > > index 0000000..2855d06
> > > --- /dev/null
> > > +++ b/tests/core_getparams.c
> > > @@ -0,0 +1,167 @@
> > > +/*
> > > + * Copyright © 2014 Intel Corporation
> > > + *
> > > + * Permission is hereby granted, free of charge, to any person obtaining a
> > > + * copy of this software and associated documentation files (the "Software"),
> > > + * to deal in the Software without restriction, including without limitation
> > > + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> > > + * and/or sell copies of the Software, and to permit persons to whom the
> > > + * Software is furnished to do so, subject to the following conditions:
> > > + *
> > > + * The above copyright notice and this permission notice (including the next
> > > + * paragraph) shall be included in all copies or substantial portions of the
> > > + * Software.
> > > + *
> > > + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> > > + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> > > + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> > > + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> > > + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
> > > + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
> > > + * IN THE SOFTWARE.
> > > + *
> > > + * Authors:
> > > + *    Jeff McGee <jeff.mcgee@intel.com>
> > > + *
> > > + */
> > > +
> > > +#include <unistd.h>
> > > +#include <errno.h>
> > > +#include <xf86drm.h>
> > > +#include <i915_drm.h>
> > > +#include "drmtest.h"
> > > +#include "intel_chipset.h"
> > > +#include "intel_bufmgr.h"
> > > +
> > > +IGT_TEST_DESCRIPTION("Tests the export of parameters via DRM_IOCTL_I915_GETPARAM\n");
> > > +
> > > +int drm_fd;
> > > +int devid;
> > > +
> > > +static void
> > > +init(void)
> > > +{
> > > +	drm_fd = drm_open_any();
> > > +	devid = intel_get_drm_devid(drm_fd);
> > > +}
> > > +
> > > +static void
> > > +deinit(void)
> > > +{
> > > +	close(drm_fd);
> > > +}
> > > +
> > > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL	33
> > > +#define LOCAL_I915_PARAM_EU_TOTAL	34
> > > +
> > > +static int
> > > +getparam(int param, int *value)
> > > +{
> > > +	drm_i915_getparam_t gp;
> > > +	int ret;
> > > +
> > > +	memset(&gp, 0, sizeof(gp));
> > > +	gp.value = value;
> > > +	gp.param = param;
> > > +	ret = drmIoctl(drm_fd, DRM_IOCTL_I915_GETPARAM, &gp);
> > > +	if (ret)
> > > +		return -errno;
> > > +
> > > +	return 0;
> > > +}
> > > +
> > > +static void
> > > +subslice_total(void)
> > > +{
> > > +	unsigned int subslice_total = 0;
> > > +	int ret;
> > > +
> > > +	ret = getparam(LOCAL_I915_PARAM_SUBSLICE_TOTAL, (int*)&subslice_total);
> > > +
> > > +	if (ret) {
> > > +		/*
> > > +		 * These devices are not required to implement the
> > > +		 * interface. If they do not, -ENODEV must be returned.
> > > +		*/
> > > +		if ((intel_gen(devid) < 8) ||
> > > +		    IS_BROADWELL(devid) ||
> > > +		    igt_run_in_simulation()) {
> > > +			igt_assert_eq(ret, -ENODEV);
> > > +			igt_info("subslice total: unknown\n");
> > > +		/*
> > > +		 * All other devices must implement the interface, so
> > > +		 * fail them if we are here.
> > > +		*/
> > > +		} else {
> > > +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> > > +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> > > +			igt_assert_eq(ret, 0); /* other error? */
> > > +		}
> > > +	} else {
> > > +		/*
> > > +		 * On success, just make sure the returned count value is
> > > +		 * non-zero. The validity of the count value for the given
> > > +		 * device is not checked.
> > > +		*/
> > > +		igt_assert_neq(subslice_total, 0);
> > > +		igt_info("subslice total: %u\n", subslice_total);
> > > +	}
> > > +}
> > > +
> > > +static void
> > > +eu_total(void)
> > > +{
> > > +	unsigned int eu_total = 0;
> > > +	int ret;
> > > +
> > > +	ret = getparam(LOCAL_I915_PARAM_EU_TOTAL, (int*)&eu_total);
> > > +
> > > +	if (ret) {
> > > +		/*
> > > +		 * These devices are not required to implement the
> > > +		 * interface. If they do not, -ENODEV must be returned.
> > > +		*/
> > > +		if ((intel_gen(devid) < 8) ||
> > > +		    IS_BROADWELL(devid) ||
> > > +		    igt_run_in_simulation()) {
> > > +			igt_assert_eq(ret, -ENODEV);
> > > +			igt_info("EU total: unknown\n");
> > > +		/*
> > > +		 * All other devices must implement the interface, so
> > > +		 * fail them if we are here.
> > > +		*/
> > > +		} else {
> > > +			igt_assert_neq(ret, EINVAL); /* request not recognized? */
> > > +			igt_assert_neq(ret, ENODEV); /* device not supported? */
> > > +			igt_assert_eq(ret, 0); /* other error? */
> > > +		}
> > > +	} else {
> > > +		/*
> > > +		 * On success, just make sure the returned count value is
> > > +		 * non-zero. The validity of the count value for the given
> > > +		 * device is not checked.
> > > +		*/
> > > +		igt_assert_neq(eu_total, 0);
> > > +		igt_info("EU total: %u\n", eu_total);
> > > +	}
> > > +}
> > > +
> > > +static void
> > > +exit_handler(int sig)
> > > +{
> > > +	deinit();
> > > +}
> > > +
> > > +igt_main
> > > +{
> > > +	igt_fixture {
> > > +		igt_install_exit_handler(exit_handler);
> > > +		init();
> > > +	}
> > > +
> > > +	igt_subtest("subslice-total")
> > > +		subslice_total();
> > > +
> > > +	igt_subtest("eu-total")
> > > +		eu_total();
> > > +}
> > > -- 
> > > 2.3.0
> > > 
> > > _______________________________________________
> > > Intel-gfx mailing list
> > > Intel-gfx@lists.freedesktop.org
> > > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> > _______________________________________________
> > Intel-gfx mailing list
> > Intel-gfx@lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/intel-gfx
> 
> -- 
> Daniel Vetter
> Software Engineer, Intel Corporation
> +41 (0) 79 365 57 48 - http://blog.ffwll.ch
> _______________________________________________
> Beignet mailing list
> Beignet@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/beignet
_______________________________________________
dri-devel mailing list
dri-devel@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/dri-devel

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

* Re: [Beignet] [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13 16:51           ` [Beignet] [Intel-gfx] " Jeff McGee
@ 2015-03-13 16:59             ` Daniel Vetter
  2015-03-13 17:03               ` [Intel-gfx] " Jeff McGee
  0 siblings, 1 reply; 22+ messages in thread
From: Daniel Vetter @ 2015-03-13 16:59 UTC (permalink / raw)
  To: Daniel Vetter, intel-gfx, dri-devel, beignet

On Fri, Mar 13, 2015 at 09:51:57AM -0700, Jeff McGee wrote:
> On Fri, Mar 13, 2015 at 05:32:41PM +0100, Daniel Vetter wrote:
> > On Fri, Mar 13, 2015 at 05:09:46PM +0800, Zhigang Gong wrote:
> > > My only concern is about the following macros:
> > > 
> > > > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL      33
> > > > +#define LOCAL_I915_PARAM_EU_TOTAL    34
> > > 
> > > How about to just use the definitons in the kernel header file?
> > > For an example:
> > > 
> > >   #include <drm/i915_drm.h>
> > > 
> > >   #ifdef LOCAL_I915_PARAM_SUBSLICE_TOTAL
> > >   //Put all the code into this block.
> > >   #endif
> > > 
> > > Then we can avoid put the same definitions in different files,
> > > and we can avoid unecessary testing on an old kernel which doesn't
> > > have this kernel interface.
> > > 
> > > For all the other part, it LGTM.
> > > 
> > > Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
> > 
> > Once we update the libdrm requirements in igt we tend to go around and
> > replace all the now obsolete LOCAL_ defines. Imo not worth doing extra
> > work until then.
> > 
> > Patch applied, thanks.
> > -Daniel
> > 
> 
> Patch applied? Do you want me to make the name change first? Should the
> kernel part be reviewed and merged first?

Forgot my own review comment already ;-) Fixed up with a follow-up patch.
And I'll pull the kernel part in now too.
-Daniel
-- 
Daniel Vetter
Software Engineer, Intel Corporation
+41 (0) 79 365 57 48 - http://blog.ffwll.ch
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx

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

* Re: [Intel-gfx] [PATCH i-g-t v3] tests/core_getparams: Create new test core_getparams
  2015-03-13 16:59             ` [Beignet] " Daniel Vetter
@ 2015-03-13 17:03               ` Jeff McGee
  0 siblings, 0 replies; 22+ messages in thread
From: Jeff McGee @ 2015-03-13 17:03 UTC (permalink / raw)
  To: Daniel Vetter; +Cc: intel-gfx, beignet, dri-devel

On Fri, Mar 13, 2015 at 05:59:13PM +0100, Daniel Vetter wrote:
> On Fri, Mar 13, 2015 at 09:51:57AM -0700, Jeff McGee wrote:
> > On Fri, Mar 13, 2015 at 05:32:41PM +0100, Daniel Vetter wrote:
> > > On Fri, Mar 13, 2015 at 05:09:46PM +0800, Zhigang Gong wrote:
> > > > My only concern is about the following macros:
> > > > 
> > > > > +#define LOCAL_I915_PARAM_SUBSLICE_TOTAL      33
> > > > > +#define LOCAL_I915_PARAM_EU_TOTAL    34
> > > > 
> > > > How about to just use the definitons in the kernel header file?
> > > > For an example:
> > > > 
> > > >   #include <drm/i915_drm.h>
> > > > 
> > > >   #ifdef LOCAL_I915_PARAM_SUBSLICE_TOTAL
> > > >   //Put all the code into this block.
> > > >   #endif
> > > > 
> > > > Then we can avoid put the same definitions in different files,
> > > > and we can avoid unecessary testing on an old kernel which doesn't
> > > > have this kernel interface.
> > > > 
> > > > For all the other part, it LGTM.
> > > > 
> > > > Reviewed-by: Zhigang Gong <zhigang.gong@linux.intel.com>
> > > 
> > > Once we update the libdrm requirements in igt we tend to go around and
> > > replace all the now obsolete LOCAL_ defines. Imo not worth doing extra
> > > work until then.
> > > 
> > > Patch applied, thanks.
> > > -Daniel
> > > 
> > 
> > Patch applied? Do you want me to make the name change first? Should the
> > kernel part be reviewed and merged first?
> 
> Forgot my own review comment already ;-) Fixed up with a follow-up patch.
> And I'll pull the kernel part in now too.
> -Daniel

Thanks. That leaves just the libdrm patch and version bump before Beignet
can merge their patches.
-Jeff
_______________________________________________
Beignet mailing list
Beignet@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/beignet

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

end of thread, other threads:[~2015-03-13 17:03 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-03-02 23:40 [PATCH] tests/core_getparams: Create new test core_getparams jeff.mcgee
2015-03-09 23:19 ` [PATCH i-g-t 1/2] " jeff.mcgee
2015-03-09 23:19   ` [PATCH i-g-t 2/2] configure: Bump required libdrm version to 2.4.60 jeff.mcgee
2015-03-09 23:30   ` jeff.mcgee
2015-03-09 23:41   ` jeff.mcgee
2015-03-10  7:37     ` [Intel-gfx] " Daniel Vetter
2015-03-10 16:59       ` [Beignet] " Jeff McGee
2015-03-10 17:58         ` Rob Clark
2015-03-10 18:34           ` Jeff McGee
2015-03-10 18:24             ` [Beignet] " Rob Clark
2015-03-10 18:47           ` [Intel-gfx] " Daniel Vetter
2015-03-10 20:06             ` Jeff McGee
2015-03-11  7:21               ` Daniel Vetter
2015-03-12 20:42                 ` [Beignet] " Jeff McGee
2015-03-12 20:38   ` [PATCH i-g-t v2] tests/core_getparams: Create new test core_getparams jeff.mcgee
2015-03-13  0:26     ` [PATCH i-g-t v3] " jeff.mcgee
2015-03-13  8:58       ` Daniel Vetter
2015-03-13  9:09       ` [Intel-gfx] " Zhigang Gong
2015-03-13 16:32         ` Daniel Vetter
2015-03-13 16:51           ` [Beignet] [Intel-gfx] " Jeff McGee
2015-03-13 16:59             ` [Beignet] " Daniel Vetter
2015-03-13 17:03               ` [Intel-gfx] " Jeff McGee

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.