Re: [Intel-gfx] [PATCH i-g-t] include inttypes.h for PRI defines

2018-01-10 Thread Mike Frysinger
On 10 Jan 2018 12:42, Petri Latvala wrote:
> On Tue, Jan 09, 2018 at 10:50:53PM -0500, Mike Frysinger wrote:
> > Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96620
> > Signed-off-by: Mike Frysinger <vap...@gentoo.org>
> > ---
> >  lib/igt_fb.c | 1 +
> >  1 file changed, 1 insertion(+)
> 
> 
> Files matching "PRI[diuoxX]" but not "inttypes.h":
> 
> lib/igt_fb.c
> lib/igt_kms.c
> lib/intel_os.c
> tests/prime_nv_pcopy.c
> tools/hsw_compute_wrpll.c
> tools/intel_gpu_top.c
> tools/intel_opregion_decode.c
> tools/intel_residency.c
> tools/intel_watermark.c
> 
> Looks like they get inttypes.h here via
> 
>  igt.h and pals -> intel_chipset.h -> pciaccess.h -> inttypes.h
> 
> The mystery is why the other files haven't slapped you with the same
> issue. Regardless, same change should be done in all of those. Can you
> expand this patch?

yeah i patched the one that was failing rather than looking deeper.
i can update them all.
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


[Intel-gfx] [PATCH i-g-t v2] include inttypes.h for PRI defines

2018-01-10 Thread Mike Frysinger
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96620
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 lib/igt_fb.c  | 1 +
 lib/igt_kms.c | 1 +
 lib/intel_os.c| 1 +
 tests/prime_nv_pcopy.c| 1 +
 tools/hsw_compute_wrpll.c | 1 +
 tools/intel_gpu_top.c | 1 +
 tools/intel_opregion_decode.c | 1 +
 tools/intel_residency.c   | 1 +
 tools/intel_watermark.c   | 1 +
 9 files changed, 9 insertions(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index dcae07dff021..ded639e833f1 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include "drmtest.h"
 #include "igt_fb.h"
diff --git a/lib/igt_kms.c b/lib/igt_kms.c
index 069752ecf12b..eb57f4a99454 100644
--- a/lib/igt_kms.c
+++ b/lib/igt_kms.c
@@ -26,6 +26,7 @@
  */
 
 #include "config.h"
+#include 
 #include 
 #include 
 #include 
diff --git a/lib/intel_os.c b/lib/intel_os.c
index a77566c15d9b..bb2c16bf3283 100644
--- a/lib/intel_os.c
+++ b/lib/intel_os.c
@@ -28,6 +28,7 @@
 
 #include "config.h"
 
+#include 
 #include 
 #include 
 #include 
diff --git a/tests/prime_nv_pcopy.c b/tests/prime_nv_pcopy.c
index b5ceabf15cc7..bbcf76807cf6 100644
--- a/tests/prime_nv_pcopy.c
+++ b/tests/prime_nv_pcopy.c
@@ -15,6 +15,7 @@
 
 
 #include "igt.h"
+#include 
 #include 
 #include 
 #include 
diff --git a/tools/hsw_compute_wrpll.c b/tools/hsw_compute_wrpll.c
index 6c85c07c77c4..b1eeb7c7cd76 100644
--- a/tools/hsw_compute_wrpll.c
+++ b/tools/hsw_compute_wrpll.c
@@ -21,6 +21,7 @@
  * DEALINGS IN THE SOFTWARE.
  */
 
+#include 
 #include 
 #include 
 #include 
diff --git a/tools/intel_gpu_top.c b/tools/intel_gpu_top.c
index 83cf53eaaf0b..098e6ce3ff86 100644
--- a/tools/intel_gpu_top.c
+++ b/tools/intel_gpu_top.c
@@ -29,6 +29,7 @@
 
 #include "config.h"
 
+#include 
 #include 
 #include 
 #include 
diff --git a/tools/intel_opregion_decode.c b/tools/intel_opregion_decode.c
index 380e43a8b514..b0a503e1a0c0 100644
--- a/tools/intel_opregion_decode.c
+++ b/tools/intel_opregion_decode.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/tools/intel_residency.c b/tools/intel_residency.c
index 116215a1ede1..bfab40da42d4 100644
--- a/tools/intel_residency.c
+++ b/tools/intel_residency.c
@@ -28,6 +28,7 @@
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
diff --git a/tools/intel_watermark.c b/tools/intel_watermark.c
index 308e351dcd2f..03da68b6ff69 100644
--- a/tools/intel_watermark.c
+++ b/tools/intel_watermark.c
@@ -22,6 +22,7 @@
  *
  */
 
+#include 
 #include 
 #include 
 #include 
-- 
2.15.1

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


[Intel-gfx] [PATCH i-g-t] include inttypes.h for PRI defines

2018-01-09 Thread Mike Frysinger
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96620
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 lib/igt_fb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index dcae07dff021..ded639e833f1 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -27,6 +27,7 @@
 
 #include 
 #include 
+#include 
 
 #include "drmtest.h"
 #include "igt_fb.h"
-- 
2.15.1

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


[Intel-gfx] [PATCH i-g-t] pull in headers for major/minor/makedev funcs

2018-01-09 Thread Mike Frysinger
Use the portable autoconf helper to figure out which header to include
for these funcs.  Linux C libs are moving to not implicitly include them
via sys/types.h anymore, and other OS's have long required you to pull
in the right header directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96618
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 configure.ac| 1 +
 lib/igt_sysfs.c | 9 +
 tools/aubdump.c | 8 
 3 files changed, 18 insertions(+)

diff --git a/configure.ac b/configure.ac
index 7e8475744f60..51053d51c662 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,7 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
 
 # Checks for functions, headers, structures, etc.
 AC_HEADER_STDC
+AC_HEADER_MAJOR
 AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h])
 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
  #include 
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index f8aae9d5c695..7f2576ca210f 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -22,10 +22,13 @@
  *
  */
 
+#include "config.h"
+
 #include 
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -34,6 +37,12 @@
 #include 
 #include 
 #include 
+#ifdef MAJOR_IN_MKDEV
+#include 
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include 
+#endif
 #include 
 #include 
 #include 
diff --git a/tools/aubdump.c b/tools/aubdump.c
index 2a37c1a7e956..764da18173d4 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -21,6 +21,8 @@
  * IN THE SOFTWARE.
  */
 
+#include "config.h"
+
 #include 
 #include 
 #include 
@@ -37,6 +39,12 @@
 #include 
 #include 
 #include 
+#ifdef MAJOR_IN_MKDEV
+#include 
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include 
+#endif
 #include 
 
 #include "intel_aub.h"
-- 
2.15.1

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


[Intel-gfx] [PATCH xf86-video-intel v2] tools/backlight_helper: #include "config.h"

2016-12-07 Thread Mike Frysinger
From: Mike Gilbert <flop...@gentoo.org>

The file uses defines from config.h but never actually includes it.

Signed-off-by: Mike Gilbert <flop...@gentoo.org>
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 tools/backlight_helper.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index a00f0d6bd8a2..aadb8fac92ba 100644
--- a/tools/backlight_helper.c
+++ b/tools/backlight_helper.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include 
 #include 
 #include 
-- 
2.11.0.rc2

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


[Intel-gfx] [PATCH] tools/backlight_helper: #include "config.h"

2016-12-06 Thread Mike Frysinger
From: Mike Gilbert 

---
 tools/backlight_helper.c | 4 
 1 file changed, 4 insertions(+)

diff --git a/tools/backlight_helper.c b/tools/backlight_helper.c
index a00f0d6bd8a2..aadb8fac92ba 100644
--- a/tools/backlight_helper.c
+++ b/tools/backlight_helper.c
@@ -1,3 +1,7 @@
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
 #include 
 #include 
 #include 
-- 
2.11.0.rc2

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


[Intel-gfx] [PATCH i-g-t] pull in headers for major/minor/makedev funcs

2016-06-22 Thread Mike Frysinger
Use the portable autoconf helper to figure out which header to include
for these funcs.  Linux C libs are moving to not implicitly include them
via sys/types.h anymore, and other OS's have long required you to pull
in the right header directly.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96618
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 configure.ac| 1 +
 lib/igt_sysfs.c | 9 +
 tools/aubdump.c | 8 +++-
 3 files changed, 17 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 0405c8b3375b..2e2c3ab7a7b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -57,6 +57,7 @@ AM_CONDITIONAL(HAVE_RST2MAN, [test "x$RST2MAN" = xyes])
 
 # Checks for functions, headers, structures, etc.
 AC_HEADER_STDC
+AC_HEADER_MAJOR
 AC_CHECK_HEADERS([termios.h linux/kd.h sys/kd.h libgen.h sys/io.h])
 AC_CHECK_MEMBERS([struct sysinfo.totalram],[],[],[AC_INCLUDES_DEFAULT
  #include 
diff --git a/lib/igt_sysfs.c b/lib/igt_sysfs.c
index 61b94c6478f2..7553eeb7e636 100644
--- a/lib/igt_sysfs.c
+++ b/lib/igt_sysfs.c
@@ -22,9 +22,12 @@
  *
  */
 
+#include "config.h"
+
 #include 
 #include 
 #include 
+#include 
 #include 
 #include 
 #include 
@@ -32,6 +35,12 @@
 #include 
 #include 
 #include 
+#ifdef MAJOR_IN_MKDEV
+#include 
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include 
+#endif
 #include 
 
 #include "igt_sysfs.h"
diff --git a/tools/aubdump.c b/tools/aubdump.c
index e7f63e7bb85b..f7ae1ccdb662 100644
--- a/tools/aubdump.c
+++ b/tools/aubdump.c
@@ -21,7 +21,7 @@
  * IN THE SOFTWARE.
  */
 
-#define _GNU_SOURCE /* for RTLD_NEXT */
+#include "config.h"
 
 #include 
 #include 
@@ -38,6 +38,12 @@
 #include 
 #include 
 #include 
+#ifdef MAJOR_IN_MKDEV
+#include 
+#endif
+#ifdef MAJOR_IN_SYSMACROS
+#include 
+#endif
 #include 
 
 #include "intel_aub.h"
-- 
2.8.2

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


[Intel-gfx] [PATCH i-g-t] include inttypes.h for PRI defines

2016-06-22 Thread Mike Frysinger
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=96620
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 lib/igt_fb.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/lib/igt_fb.c b/lib/igt_fb.c
index 61205f345707..ba29eae5cabd 100644
--- a/lib/igt_fb.c
+++ b/lib/igt_fb.c
@@ -28,6 +28,7 @@
 #define _GNU_SOURCE
 #include 
 #include 
+#include 
 
 #include "drmtest.h"
 #include "igt_fb.h"
-- 
2.8.2

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


[Intel-gfx] [PATCH i-g-t] configure: update bugzilla URL

2016-06-22 Thread Mike Frysinger
Signed-off-by: Mike Frysinger <vap...@gentoo.org>
---
 configure.ac | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 2e2c3ab7a7b0..d84508b5f6f5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -23,7 +23,7 @@
 AC_PREREQ([2.60])
 AC_INIT([intel-gpu-tools],
[1.15],
-   
[https://bugs.freedesktop.org/enter_bug.cgi?product=DRI=DRM/Intel],
+   [https://bugs.freedesktop.org/enter_bug.cgi?product=DRI=IGT],
[intel-gpu-tools])
 
 AC_CONFIG_SRCDIR([Makefile.am])
-- 
2.8.2

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


Re: [Intel-gfx] [PATCH v4 2/5] drm: Add private data field to trace control block

2015-08-25 Thread Mike Frysinger
On 24 Aug 2015 14:42, Patrik Jakobsson wrote:
 We need to be able to store private data in the tcb across it's
 lifetime. To ensure proper destruction of the data a free_priv_data
 callback must be provided if an allocation is stored in priv_data. The
 callback is executed automatically when the life of the tcb ends.
 
 * defs.h: Add extern declaration of free_tcb_priv_data.
  (struct tcb): Add priv_data and free_priv_data.
 * strace.c (free_tcb_priv_data): New function
 (drop_tcb): Execute free_tcb_priv_data callback
 * syscall.c (trace_syscall_exiting): Execute free_tcb_priv_data callback
 
 Signed-off-by: Patrik Jakobsson patrik.jakobs...@linux.intel.com
 ---
  defs.h|  6 ++
  strace.c  | 14 ++
  syscall.c |  1 +
  3 files changed, 21 insertions(+)
 
 diff --git a/defs.h b/defs.h
 index 9059026..bc3bd83 100644
 --- a/defs.h
 +++ b/defs.h
 @@ -266,6 +266,10 @@ struct tcb {
   int u_error;/* Error code */
   long scno;  /* System call number */
   long u_arg[MAX_ARGS];   /* System call arguments */
 +
 + void *priv_data;/* Private data for syscall decoding functions 
 */
 + void (*free_priv_data)(void *); /* Callback for freeing priv_data */

should we name these _priv_data and _free_priv_data and provides accessor
functions ?  i worry that code paths might stomp on each other by accident
and we don't end up noticing.

static void set_tcb_priv_data(struct tcb *tcp, void *data, void 
(*free_data)(void *))
{
assert(tcp-_priv_data == NULL  tcp-_free_priv_data == NULL);
...
}
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v4 1/5] drm: Add config for detecting libdrm

2015-08-25 Thread Mike Frysinger
On 24 Aug 2015 14:42, Patrik Jakobsson wrote:
 +PKG_CHECK_MODULES([LIBDRM], [libdrm],
 +   [CPPFLAGS=$CPPFLAGS $LIBDRM_CFLAGS
 +AC_CHECK_HEADERS([drm.h i915_drm.h])],
 +   [AC_CHECK_HEADERS([drm/drm.h drm/i915_drm.h])])

i would make the drm/xxx headers unconditional -- add them to the big
block that does:
AC_CHECK_HEADERS(m4_normalize([
...
]))

otherwise seems fine
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 1/5] drm: Add config for detecting libdrm

2015-07-30 Thread Mike Frysinger
On 30 Jul 2015 15:30, Patrik Jakobsson wrote:
 On Thu, Jul 23, 2015 at 05:48:21AM -0400, Mike Frysinger wrote:
  On 01 Jul 2015 14:52, Patrik Jakobsson wrote:
   Use pkg-config to try to find libdrm. If that fails use the standard
   include directory for kernel drm headers in /usr/include/drm.
   
   * configure.ac: Use pkg-config to find libdrm
   
   Signed-off-by: Patrik Jakobsson patrik.jakobs...@linux.intel.com
   ---
configure.ac | 4 
1 file changed, 4 insertions(+)
   
   diff --git a/configure.ac b/configure.ac
   index bb8bf46..aa63af7 100644
   --- a/configure.ac
   +++ b/configure.ac
   @@ -844,6 +844,10 @@ fi
AM_CONDITIONAL([USE_LIBUNWIND], [test x$use_libunwind = xyes])
AC_MSG_RESULT([$use_libunwind])

   +PKG_CHECK_MODULES([libdrm], [libdrm],
   + [CPPFLAGS=$CPPFLAGS $libdrm_CFLAGS],
   + [CPPFLAGS=$CPPFLAGS -I/usr/include/drm])
  
  yikes, no, this is a really really bad idea.  it should read:
  PKG_CHECK_MODULES([LIBDRM], [libdrm],
  [CPPFLAGS=$CPPFLAGS $LIBDRM_CFLAGS], [:])
 
 I take it you don't want me to fallback on kernel headers and skip
 compiling with drm support if libdrm is not available?

you cannot hardcode any path at all.  if the kernel headers provide all
of the defines/structs that you need, then just include them directly
via #include drm/xxx.h.
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 1/5] drm: Add config for detecting libdrm

2015-07-24 Thread Mike Frysinger
On 01 Jul 2015 14:52, Patrik Jakobsson wrote:
 Use pkg-config to try to find libdrm. If that fails use the standard
 include directory for kernel drm headers in /usr/include/drm.
 
 * configure.ac: Use pkg-config to find libdrm
 
 Signed-off-by: Patrik Jakobsson patrik.jakobs...@linux.intel.com
 ---
  configure.ac | 4 
  1 file changed, 4 insertions(+)
 
 diff --git a/configure.ac b/configure.ac
 index bb8bf46..aa63af7 100644
 --- a/configure.ac
 +++ b/configure.ac
 @@ -844,6 +844,10 @@ fi
  AM_CONDITIONAL([USE_LIBUNWIND], [test x$use_libunwind = xyes])
  AC_MSG_RESULT([$use_libunwind])
  
 +PKG_CHECK_MODULES([libdrm], [libdrm],
 + [CPPFLAGS=$CPPFLAGS $libdrm_CFLAGS],
 + [CPPFLAGS=$CPPFLAGS -I/usr/include/drm])

yikes, no, this is a really really bad idea.  it should read:
PKG_CHECK_MODULES([LIBDRM], [libdrm],
[CPPFLAGS=$CPPFLAGS $LIBDRM_CFLAGS], [:])
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx


Re: [Intel-gfx] [PATCH v3 1/5] drm: Add config for detecting libdrm

2015-07-24 Thread Mike Frysinger
On 23 Jul 2015 13:44, Dmitry V. Levin wrote:
 On Thu, Jul 23, 2015 at 05:48:21AM -0400, Mike Frysinger wrote:
  On 01 Jul 2015 14:52, Patrik Jakobsson wrote:
   Use pkg-config to try to find libdrm. If that fails use the standard
   include directory for kernel drm headers in /usr/include/drm.
   
   * configure.ac: Use pkg-config to find libdrm
   
   Signed-off-by: Patrik Jakobsson patrik.jakobs...@linux.intel.com
   ---
configure.ac | 4 
1 file changed, 4 insertions(+)
   
   diff --git a/configure.ac b/configure.ac
   index bb8bf46..aa63af7 100644
   --- a/configure.ac
   +++ b/configure.ac
   @@ -844,6 +844,10 @@ fi
AM_CONDITIONAL([USE_LIBUNWIND], [test x$use_libunwind = xyes])
AC_MSG_RESULT([$use_libunwind])

   +PKG_CHECK_MODULES([libdrm], [libdrm],
   + [CPPFLAGS=$CPPFLAGS $libdrm_CFLAGS],
   + [CPPFLAGS=$CPPFLAGS -I/usr/include/drm])
  
  yikes, no, this is a really really bad idea.  it should read:
  PKG_CHECK_MODULES([LIBDRM], [libdrm],
  [CPPFLAGS=$CPPFLAGS $LIBDRM_CFLAGS], [:])
 
 Why [:] ?  Wouldn't [] suffice?

probably ... force of habit after being bitten by m4 macros that did not expect
to expand empty code and thus lead to shell errors (include macros by autotools
projects).  i.e. if the m4 looked something like:
if ...check if pkg is available...; then
$3
else
$4
fi
then the generated configure script would have syntax errors.
-mike


signature.asc
Description: Digital signature
___
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
http://lists.freedesktop.org/mailman/listinfo/intel-gfx