mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2025-07-23 09:56:02 +00:00
overlay: Auatomatically mount debugfs
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
parent
34198b801e
commit
55b8c33ca5
@ -70,7 +70,7 @@ if test "x$GCC" = "xyes"; then
|
||||
fi
|
||||
AC_SUBST(ASSEMBLER_WARN_CFLAGS)
|
||||
|
||||
PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.45 libdrm])
|
||||
PKG_CHECK_MODULES(DRM, [libdrm_intel >= 2.4.40 libdrm])
|
||||
PKG_CHECK_MODULES(PCIACCESS, [pciaccess >= 0.10])
|
||||
PKG_CHECK_MODULES(OVERLAY_XVLIB, [xv x11 xext], enable_overlay_xvlib=yes, enable_overlay_xvlib=no)
|
||||
PKG_CHECK_MODULES(OVERLAY_XLIB, [cairo-xlib], enable_overlay_xlib=yes, enable_overlay_xlib=no)
|
||||
|
@ -210,9 +210,11 @@ static inline void gem_require_ring(int fd, int ring_id)
|
||||
case I915_EXEC_BSD:
|
||||
igt_require(HAS_BSD_RING(intel_get_drm_devid(fd)));
|
||||
return;
|
||||
#ifdef I915_EXEC_VEBOX
|
||||
case I915_EXEC_VEBOX:
|
||||
igt_require(gem_has_vebox(fd));
|
||||
return;
|
||||
#endif
|
||||
default:
|
||||
assert(0);
|
||||
return;
|
||||
|
@ -14,6 +14,8 @@ intel_gpu_overlay_SOURCES = \
|
||||
chart.c \
|
||||
cpu-top.h \
|
||||
cpu-top.c \
|
||||
debugfs.h \
|
||||
debugfs.c \
|
||||
gem-objects.h \
|
||||
gem-objects.c \
|
||||
gpu-top.h \
|
||||
|
21
overlay/debugfs.c
Normal file
21
overlay/debugfs.c
Normal file
@ -0,0 +1,21 @@
|
||||
#include <sys/stat.h>
|
||||
#include <sys/mount.h>
|
||||
#include <errno.h>
|
||||
|
||||
#include "debugfs.h"
|
||||
|
||||
int debugfs_init(void)
|
||||
{
|
||||
struct stat st;
|
||||
|
||||
if (stat("/sys/kernel/debug/dri", &st) == 0)
|
||||
return 0;
|
||||
|
||||
if (stat("/sys/kernel/debug", &st))
|
||||
return errno;
|
||||
|
||||
if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
|
||||
return errno;
|
||||
|
||||
return 0;
|
||||
}
|
1
overlay/debugfs.h
Normal file
1
overlay/debugfs.h
Normal file
@ -0,0 +1 @@
|
||||
int debugfs_init(void);
|
@ -517,6 +517,8 @@ int main(int argc, char **argv)
|
||||
if (ctx.surface == NULL)
|
||||
return ENOMEM;
|
||||
|
||||
debugfs_init();
|
||||
|
||||
init_gpu_top(&ctx, &ctx.gpu_top);
|
||||
init_gpu_perf(&ctx, &ctx.gpu_perf);
|
||||
init_gpu_freq(&ctx, &ctx.gpu_freq);
|
||||
|
@ -106,8 +106,10 @@ int main(int argc, char *argv[])
|
||||
igt_assert(exec(fd, handle, I915_EXEC_BSD, ctx_id) != 0);
|
||||
igt_subtest("blt")
|
||||
igt_assert(exec(fd, handle, I915_EXEC_BLT, ctx_id) != 0);
|
||||
#ifdef I915_EXEC_VEBOX
|
||||
igt_subtest("vebox")
|
||||
igt_assert(exec(fd, handle, I915_EXEC_VEBOX, ctx_id) != 0);
|
||||
#endif
|
||||
|
||||
igt_exit();
|
||||
}
|
||||
|
@ -173,6 +173,7 @@ int main(int argc, char **argv)
|
||||
printf("dummy loop run on blt completed\n");
|
||||
}
|
||||
|
||||
#ifdef I915_EXEC_VEBOX
|
||||
igt_subtest("vebox") {
|
||||
gem_require_ring(fd, I915_EXEC_VEBOX);
|
||||
sleep(2);
|
||||
@ -180,6 +181,7 @@ int main(int argc, char **argv)
|
||||
dummy_reloc_loop(LOCAL_I915_EXEC_VEBOX);
|
||||
printf("dummy loop run on vebox completed\n");
|
||||
}
|
||||
#endif
|
||||
|
||||
igt_subtest("mixed") {
|
||||
if (num_rings > 1) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user