intel-gpu-tools: Changes to 'upstream-unstable'
.gitignore | 5
Android.mk | 531 ---
Makefile.am | 27
NEWS | 30
README | 16
assembler/Makefile.am | 3
assembler/brw_compat.h | 2
assembler/brw_defines.h | 1
assembler/disasm-main.c | 11
assembler/gen4asm.h | 4
assembler/gen8_disasm.c | 993 +++++++
assembler/gen8_instruction.c | 425 +++
assembler/gen8_instruction.h | 360 ++
assembler/gram.y | 473 ++-
assembler/lex.l | 1
assembler/main.c | 56
autogen.sh | 7
benchmarks/intel_upload_blit_large.c | 7
benchmarks/intel_upload_blit_large_gtt.c | 7
benchmarks/intel_upload_blit_large_map.c | 7
benchmarks/intel_upload_blit_small.c | 7
configure.ac | 42
debugger/eudb.c | 18
debugger/system_routine/Makefile.am | 1
demos/intel_sprite_on.c | 1
docs/Makefile.am | 1
docs/reference/Makefile.am | 1
docs/reference/intel-gpu-tools/.gitignore | 26
docs/reference/intel-gpu-tools/Makefile.am | 105
docs/reference/intel-gpu-tools/intel-gpu-tools-docs.xml | 42
docs/reference/intel-gpu-tools/version.xml.in | 1
lib/Android.mk | 64
lib/Makefile.am | 36
lib/Makefile.sources | 47
lib/check-ndebug.h | 3
lib/drmtest.c | 2130 +---------------
lib/drmtest.h | 344 --
lib/gen6_render.h | 2
lib/gen7_media.h | 323 ++
lib/gen8_media.h | 372 ++
lib/gen8_render.h | 328 ++
lib/i830_reg.h | 3
lib/i915_pciids.h | 211 +
lib/igt_core.c | 1076 ++++++++
lib/igt_core.h | 459 +++
lib/igt_debugfs.c | 294 ++
lib/igt_debugfs.h | 81
lib/igt_display.h | 14
lib/igt_kms.c | 1454 ++++++++++
lib/igt_kms.h | 194 +
lib/instdone.c | 273 ++
lib/intel_batchbuffer.c | 9
lib/intel_batchbuffer.h | 39
lib/intel_chipset.h | 40
lib/intel_dpio.c | 94
lib/intel_drm.c | 4
lib/intel_gpu_tools.h | 17
lib/intel_iosf.c | 67
lib/intel_mmio.c | 21
lib/intel_reg.h | 288 --
lib/intel_reg_map.c | 4
lib/ioctl_wrappers.c | 884 ++++++
lib/ioctl_wrappers.h | 95
lib/media_fill.c | 14
lib/media_fill.h | 64
lib/media_fill_gen7.c | 351 ++
lib/media_fill_gen8.c | 374 ++
lib/rendercopy.c | 49
lib/rendercopy.h | 12
lib/rendercopy_gen6.c | 12
lib/rendercopy_gen7.c | 12
lib/rendercopy_gen8.c | 997 +++++++
lib/rendercopy_i830.c | 5
lib/rendercopy_i915.c | 1
scripts/list-workarounds | 2
shaders/media/README | 5
shaders/media/media_fill.gxa | 44
tests/.gitignore | 14
tests/Android.mk | 52
tests/Makefile.am | 222 -
tests/Makefile.sources | 226 +
tests/NAMING-CONVENTION | 8
tests/core_get_client_auth.c | 100
tests/core_getclient.c | 3
tests/core_getstats.c | 3
tests/core_getversion.c | 3
tests/drm_get_client_auth.c | 84
tests/drm_vma_limiter.c | 4
tests/drm_vma_limiter_cached.c | 17
tests/drm_vma_limiter_cpu.c | 4
tests/drm_vma_limiter_gtt.c | 4
tests/drv_missed_irq_hang | 8
tests/drv_suspend.c | 4
tests/eviction_common.c | 243 +
tests/gem_bad_blit.c | 8
tests/gem_bad_length.c | 4
tests/gem_caching.c | 7
tests/gem_close_race.c | 54
tests/gem_concurrent_blit.c | 53
tests/gem_cpu_reloc.c | 71
tests/gem_cs_prefetch.c | 17
tests/gem_ctx_bad_destroy.c | 4
tests/gem_ctx_bad_exec.c | 9
tests/gem_ctx_basic.c | 6
tests/gem_ctx_create.c | 4
tests/gem_ctx_exec.c | 109
tests/gem_double_irq_loop.c | 17
tests/gem_evict_alignment.c | 18
tests/gem_evict_everything.c | 224 -
tests/gem_exec_big.c | 4
tests/gem_exec_blt.c | 30
tests/gem_exec_faulting_reloc.c | 50
tests/gem_exec_lut_handle.c | 7
tests/gem_fd_exhaustion.c | 91
tests/gem_fenced_exec_thrash.c | 8
tests/gem_gtt_cpu_tlb.c | 5
tests/gem_gtt_hog.c | 178 +
tests/gem_gtt_speed.c | 2
tests/gem_hangcheck_forcewake.c | 15
tests/gem_largeobject.c | 10
tests/gem_linear_blits.c | 13
tests/gem_lut_handle.c | 7
tests/gem_madvise.c | 155 +
tests/gem_media_fill.c | 129
tests/gem_mmap_gtt.c | 1
tests/gem_mmap_offset_exhaustion.c | 4
tests/gem_partial_pwrite_pread.c | 7
tests/gem_persistent_relocs.c | 33
tests/gem_pin.c | 16
tests/gem_pipe_control_store_loop.c | 21
tests/gem_pwrite_pread.c | 172 -
tests/gem_reg_read.c | 3
tests/gem_reloc_overflow.c | 135 -
tests/gem_reloc_vs_gpu.c | 33
tests/gem_render_copy.c | 25
tests/gem_render_linear_blits.c | 13
tests/gem_render_tiled_blits.c | 13
tests/gem_reset_stats.c | 1098 ++++++++
tests/gem_ring_sync_copy.c | 367 ++
tests/gem_ring_sync_loop.c | 9
tests/gem_ringfill.c | 12
tests/gem_seqno_wrap.c | 38
tests/gem_set_tiling_vs_blt.c | 22
tests/gem_set_tiling_vs_gtt.c | 4
tests/gem_set_tiling_vs_pwrite.c | 4
tests/gem_storedw_batches_loop.c | 27
tests/gem_storedw_loop_blt.c | 44
tests/gem_storedw_loop_bsd.c | 44
tests/gem_storedw_loop_render.c | 44
tests/gem_storedw_loop_vebox.c | 16
tests/gem_stress.c | 10
tests/gem_threaded_access_tiled.c | 4
tests/gem_tiled_fence_blits.c | 4
tests/gem_tiled_partial_pwrite_pread.c | 8
tests/gem_tiled_pread.c | 5
tests/gem_tiled_pread_pwrite.c | 5
tests/gem_tiled_swapping.c | 5
tests/gem_tiling_max_stride.c | 4
tests/gem_unfence_active_buffers.c | 25
tests/gem_unref_active_buffers.c | 11
tests/gem_vmap_blits.c | 18
tests/gem_wait_render_timeout.c | 21
tests/gem_write_read_ring_switch.c | 13
tests/gen3_mixed_blits.c | 4
tests/gen3_render_linear_blits.c | 2
tests/gen3_render_mixed_blits.c | 2
tests/gen3_render_tiledx_blits.c | 2
tests/gen3_render_tiledy_blits.c | 2
tests/gen7_forcewake_mt.c | 202 +
tests/kms_cursor_crc.c | 262 -
tests/kms_fbc_crc.c | 524 +++
tests/kms_flip.c | 417 +--
tests/kms_pipe_crc_basic.c | 175 -
tests/kms_plane.c | 245 +
tests/kms_render.c | 5
tests/kms_setmode.c | 22
tests/pm_lpsp.c | 277 ++
tests/pm_pc8.c | 1162 +++++++-
tests/pm_psr.c | 5
tests/pm_rc6_residency.c | 4
tests/pm_rps.c | 586 +++-
tests/prime_nv_pcopy.c | 4
tests/prime_udl.c | 26
tests/testdisplay.c | 52
tools/.gitignore | 1
tools/Android.mk | 43
tools/Makefile.am | 54
tools/Makefile.sources | 50
tools/intel_audio_dump.c | 2057 ++++++++-------
tools/intel_disable_clock_gating.c | 71
tools/intel_dpio_read.c | 4
tools/intel_dpio_write.c | 4
tools/intel_dump_decode.c | 10
tools/intel_error_decode.c | 63
tools/intel_gpu_top.c | 8
tools/intel_iosf_read.c | 70
tools/intel_reg_dumper.c | 15
tools/quick_dump/Makefile.am | 3
tools/quick_dump/audio_config_haswell_plus.txt | 35
tools/quick_dump/audio_debug_haswell_plus.txt | 8
tools/quick_dump/broadwell | 5
tools/quick_dump/chipset.i | 6
tools/quick_dump/gen7_other.txt | 4
tools/quick_dump/gen8_interrupt.txt | 44
tools/quick_dump/haswell | 3
tools/quick_dump/haswell_other.txt | 18
tools/quick_dump/intel_chipset.c | 5
tools/quick_dump/quick_dump.py | 130
tools/quick_dump/reg_access.py | 67
tools/quick_dump/vlv_dpio.txt | 113
210 files changed, 19133 insertions(+), 6807 deletions(-)
New commits:
commit a095072b64a37a7df6a011608fb932796991a891
Author: Rodrigo Vivi <rodrigo.vivi@gmail.com>
Date: Thu Mar 13 07:52:47 2014 -0300
bump version to 1.6 and add the release date
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@gmail.com>
diff --git a/NEWS b/NEWS
index 22bb014..b2432b1 100644
--- a/NEWS
+++ b/NEWS
@@ -1,4 +1,4 @@
-Release 1.6 (2014-XX-YY)
+Release 1.6 (2014-03-13)
------------------------
- Changes to support Broadwell in the test suite. (Ben, Damien, et al.)
diff --git a/configure.ac b/configure.ac
index 2ddbe0d..21420da 100644
--- a/configure.ac
+++ b/configure.ac
@@ -22,7 +22,7 @@
AC_PREREQ([2.60])
AC_INIT([intel-gpu-tools],
- [1.5],
+ [1.6],
[https://bugs.freedesktop.org/enter_bug.cgi?product=xorg],
[intel-gpu-tools])
commit 981276819fdf6de312ecafcef27822741265f237
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Mar 12 18:53:51 2014 +0100
lib/igt_debugfs: api docs
Again issues with an enum, this time intel_pipe_crc_source. The
typedefs seem to work better here though.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 131dccc..5c02901 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -34,9 +34,54 @@
#include "igt_display.h"
#include "igt_debugfs.h"
+/**
+ * SECTION:igt_debugfs
+ * @short_description: Support code for debugfs features
+ * @title: i-g-t debugfs
+ *
+ * This library provides helpers to access debugfs features. On top of some
+ * basic functions to access debugfs files with e.g. igt_debugfs_open() it also
+ * provides higher-level wrappers for some debugfs features
+ *
+ * # Pipe CRC Support
+ *
+ * This library wraps up the kernel's support for capturing pipe CRCs into a
+ * neat and tidy package. For the datailed usage see all the functions which
+ * work on #igt_pipe_crc_t. This is supported on all platforms and outputs.
+ *
+ * Actually using pipe CRCs to write modeset tests is a bit tricky though, so
+ * there is no way to directly check a CRC: Both the details of the plane
+ * blending, color correction and other hardware and how exactly the CRC is
+ * computed at each tap point vary by hardware generation and are not disclosed.
+ *
+ * The only way to use #igt_crc_t CRCs therefors is to compare CRCs among each
+ * another either for equality or difference. Otherwise CRCs must be treated as
+ * completely opaque values. Note that not even CRCs from different pipes or tap
+ * points on the same platform can be compared. Hence only use igt_crc_is_null()
+ * and igt_crc_equal() to insepct CRC values captured by the same
+ * #igt_pipe_crc_t object.
+ *
+ * # Other debugfs interface wrappers
+ *
+ * This covers the miscellaneous debugfs interface wrappers:
+ *
+ * - drm/i915 supports interfaces to evict certain clases of gem buffer objects,
+ * see igt_drop_caches_set().
+ *
+ * - drm/i915 supports an interface to disable prefaulting, useful to test
+ * slowpaths in ioctls. See igt_disable_prefault().
+ */
+
/*
* General debugfs helpers
*/
+
+/**
+ * igt_debugfs_init:
+ * @debugfs: debugfs access structure to initialize
+ *
+ * Initializes the debugfs access helper library.
+ */
void igt_debugfs_init(igt_debugfs_t *debugfs)
{
const char *path = "/sys/kernel/debug";
@@ -71,6 +116,15 @@ find_minor:
igt_fail(4);
}
+/**
+ * igt_debugfs_open:
+ * @debugfs: debugfs access structure
+ * @filename: name of the debugfs node to open
+ * @mode: mode bits as used by open()
+ *
+ * This opens a debugfs file as a Unix file descriptor. The filename should be
+ * relative to the drm device's root, i.e without "drm/<minor>".
+ */
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode)
{
char buf[1024];
@@ -79,6 +133,15 @@ int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode)
return open(buf, mode);
}
+/**
+ * igt_debugfs_fopen:
+ * @debugfs: debugfs access structure
+ * @filename: name of the debugfs node to open
+ * @mode: mode string as used by fopen()
+ *
+ * This opens a debugfs file as a libc FILE. The filename should be
+ * relative to the drm device's root, i.e without "drm/<minor>".
+ */
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
const char *mode)
{
@@ -92,6 +155,13 @@ FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
* Pipe CRC
*/
+/**
+ * igt_crc_is_null:
+ * @crc: pipe CRC value to check
+ *
+ * Returns: True if the CRC is null/invalid, false if it represents a captured
+ * valid CRC.
+ */
bool igt_crc_is_null(igt_crc_t *crc)
{
int i;
@@ -103,6 +173,15 @@ bool igt_crc_is_null(igt_crc_t *crc)
return true;
}
+/**
+ * igt_crc_equal:
+ * @a: first pipe CRC value
+ * @b: second pipe CRC value
+ *
+ * Compares two CRC values.
+ *
+ * Returns: Retruns true if the two CRCs match, false otherwise.
+ */
bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b)
{
int i;
@@ -117,6 +196,16 @@ bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b)
return true;
}
+/**
+ * igt_crc_to_string:
+ * @crc: pipe CRC value to print
+ *
+ * This formats @crc into a string buffer which is owned by igt_crc_to_string().
+ * The next call will override the buffer again, which makes this multithreading
+ * unsafe.
+ *
+ * This should only ever be used for diagnostic debug output.
+ */
char *igt_crc_to_string(igt_crc_t *crc)
{
char buf[128];
@@ -205,6 +294,14 @@ static void pipe_crc_exit_handler(int sig)
igt_pipe_crc_reset();
}
+/**
+ * igt_pipe_crc_check:
+ * @debugfs: debugfs access structure
+ *
+ * Convenience helper to check whether pipe CRC capturing is supported by the
+ * kernel. Uses igt_skip to automatically skip the test/subtest if this isn't
+ * the case.
+ */
void igt_pipe_crc_check(igt_debugfs_t *debugfs)
{
const char *cmd = "pipe A none";
@@ -223,6 +320,18 @@ void igt_pipe_crc_check(igt_debugfs_t *debugfs)
fclose(ctl);
}
+/**
+ * igt_pipe_crc_new:
+ * @debugfs: debugfs access structure
+ * @pipe: display pipe to use as source
+ * @source: CRC tap point to use as source
+ *
+ * This sets up a new pipe CRC capture object for the given @pipe and @source.
+ *
+ * Returns: A pipe CRC object if the given @pipe and @source is available, NULL
+ * otherwise. Tests can use this to intelligently skip if they require a
+ * specific pipe CRC source to function properly.
+ */
igt_pipe_crc_t *
igt_pipe_crc_new(igt_debugfs_t *debugfs, enum pipe pipe,
enum intel_pipe_crc_source source)
@@ -258,6 +367,12 @@ igt_pipe_crc_new(igt_debugfs_t *debugfs, enum pipe pipe,
return pipe_crc;
}
+/**
+ * igt_pipe_crc_free:
+ * @pipe_crc: pipe CRC object
+ *
+ * Frees all resources associated with @pipe_crc.
+ */
void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
{
if (!pipe_crc)
@@ -268,6 +383,12 @@ void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc)
free(pipe_crc);
}
+/**
+ * igt_pipe_crc_start:
+ * @pipe_crc: pipe CRC object
+ *
+ * Starts the CRC capture process on @pipe_crc.
+ */
void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
{
igt_crc_t *crcs = NULL;
@@ -282,6 +403,12 @@ void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc)
free(crcs);
}
+/**
+ * igt_pipe_crc_stop:
+ * @pipe_crc: pipe CRC object
+ *
+ * Stops the CRC capture process on @pipe_crc.
+ */
void igt_pipe_crc_stop(igt_pipe_crc_t *pipe_crc)
{
char buf[32];
@@ -315,9 +442,18 @@ static bool read_one_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out)
return true;
}
-/*
- * Read @n_crcs from the @pipe_crc. This function blocks until @n_crcs are
- * retrieved.
+/**
+ * igt_pipe_crc_get_crcs:
+ * @pipe_crc: pipe CRC object
+ * @n_crcs: number of CRCs to capture
+ * @out_crcs: buffer pointer for the captured CRC values
+ *
+ * Read @n_crcs from @pipe_crc. This function blocks until @n_crcs are
+ * retrieved. @out_crcs is alloced by this function and must be released with
+ * free() by the caller.
+ *
+ * Callers must start and stop the capturing themselves by calling
+ * igt_pipe_crc_start() and igt_pipe_crc_stop().
*/
void
igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
@@ -340,9 +476,13 @@ igt_pipe_crc_get_crcs(igt_pipe_crc_t *pipe_crc, int n_crcs,
*out_crcs = crcs;
}
-/*
- * Read 1 CRC from @pipe_crc. This function blocks until the CRC is retrieved.
- * @out_crc must be allocated by the caller.
+/**
+ * igt_pipe_crc_collect_crc:
+ * @pipe_crc: pipe CRC object
+ * @out_crc: buffer for the captured CRC values
+ *
+ * Read a single CRC from @pipe_crc. This function blocks until the CRC is
+ * retrieved. @out_crc must be allocated by the caller.
*
* This function takes care of the pipe_crc book-keeping, it will start/stop
* the collection of the CRC.
@@ -358,6 +498,13 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc)
* Drop caches
*/
+/**
+ * igt_drop_caches_set:
+ * @val: bitmask for DROP_* values
+ *
+ * This calls the debugfs interface the drm/i915 GEM driver exposes to drop or
+ * evict certain classes of gem buffer objects.
+ */
void igt_drop_caches_set(uint64_t val)
{
igt_debugfs_t debugfs;
@@ -406,6 +553,15 @@ static void enable_prefault_at_exit(int sig)
igt_enable_prefault();
}
+/**
+ * igt_disable_prefault:
+ *
+ * Disable prefaulting in certain gem ioctls through the debugfs interface. As
+ * usual this installs an exit handler to clean up and re-enable prefaulting
+ * even when the test exited abnormally.
+ *
+ * igt_enable_prefault() will enable normale operation again.
+ */
void igt_disable_prefault(void)
{
igt_prefault_control(false);
@@ -413,6 +569,11 @@ void igt_disable_prefault(void)
igt_install_exit_handler(enable_prefault_at_exit);
}
+/**
+ * igt_enable_prefault:
+ *
+ * Enable prefault (again) through the debugfs interface.
+ */
void igt_enable_prefault(void)
{
igt_prefault_control(true);
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 04ac2dc..90e31d7 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -31,6 +31,11 @@
#include "igt_display.h"
+/**
+ * igt_debugfs_t:
+ *
+ * debugfs access structure. Needs to be initialized with igt_debugfs_init().
+ */
typedef struct {
char root[128];
char dri_path[128];
@@ -45,6 +50,38 @@ FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
* Pipe CRC
*/
+/**
+ * igt_pipe_crc_t:
+ *
+ * Pipe CRC support structure. Needs to be allocated and set up with
+ * igt_pipe_crc_new() for a specific pipe and pipe CRC source value.
+ */
+typedef struct _igt_pipe_crc igt_pipe_crc_t;
+
+/**
+ * igt_crc_t:
+ * @frame: frame number of the capture CRC
+ * @n_words: internal field, don't access
+ * @crc: internal field, don't access
+ *
+ * Pipe CRC value. All other members than @frame are private and should not be
+ * inspected by testcases.
+ */
+typedef struct {
+ uint32_t frame;
+ int n_words;
+ uint32_t crc[5];
+} igt_crc_t;
+
+/**
+ * intel_pipe_crc_source:
+ *
+ * Enumeration of all supported pipe CRC sources. Not all platforms and all
+ * outputs support all of them. Generic tests should just use
+ * INTEL_PIPE_CRC_SOURCE_AUTO. It should always map to an end-of-pipe CRC
+ * suitable for checking planes, cursor, color correction and any other
+ * output-agnostic features.
+ */
enum intel_pipe_crc_source {
INTEL_PIPE_CRC_SOURCE_NONE,
INTEL_PIPE_CRC_SOURCE_PLANE1,
@@ -59,13 +96,6 @@ enum intel_pipe_crc_source {
INTEL_PIPE_CRC_SOURCE_MAX,
};
-typedef struct _igt_pipe_crc igt_pipe_crc_t;
-typedef struct {
- uint32_t frame;
- int n_words;
- uint32_t crc[5];
-} igt_crc_t;
-
bool igt_crc_is_null(igt_crc_t *crc);
bool igt_crc_equal(igt_crc_t *a, igt_crc_t *b);
char *igt_crc_to_string(igt_crc_t *crc);
@@ -85,9 +115,30 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
* Drop caches
*/
+/**
+ * DROP_UNBOUND:
+ *
+ * Drop all currently unbound gem buffer objects from the cache.
+ */
#define DROP_UNBOUND 0x1
+/**
+ * DROP_BOUND:
+ *
+ * Drop all inactive objects which are bound into some gpu address space.
+ */
#define DROP_BOUND 0x2
+/**
+ * DROP_RETIRE:
+ *
+ * Wait for all outstanding gpu commands to complete, but do not take any
+ * further actions.
+ */
#define DROP_RETIRE 0x4
+/**
+ * DROP_ACTIVE:
+ *
+ * Also drop active objects once retired.
+ */
#define DROP_ACTIVE 0x8
#define DROP_ALL (DROP_UNBOUND | \
DROP_BOUND | \
commit 36a83a6c5ccfff7336d257aba499c4e72674615a
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Mar 12 19:24:00 2014 +0100
lib/igt_debugfs: drop drm_fd argument from igt_pipe_crc_new
It's nowhere used and removing it gives us a cleaner, more
orthogonal interface.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 9c4c989..131dccc 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -136,8 +136,6 @@ char *igt_crc_to_string(igt_crc_t *crc)
#define PIPE_CRC_BUFFER_LEN (PIPE_CRC_LINE_LEN + 1)
struct _igt_pipe_crc {
- int drm_fd;
-
int ctl_fd;
int crc_fd;
int line_len;
@@ -226,7 +224,7 @@ void igt_pipe_crc_check(igt_debugfs_t *debugfs)
}
igt_pipe_crc_t *
-igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
+igt_pipe_crc_new(igt_debugfs_t *debugfs, enum pipe pipe,
enum intel_pipe_crc_source source)
{
igt_pipe_crc_t *pipe_crc;
@@ -246,7 +244,6 @@ igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
pipe_crc->line_len = PIPE_CRC_LINE_LEN;
pipe_crc->buffer_len = PIPE_CRC_BUFFER_LEN;
- pipe_crc->drm_fd = drm_fd;
pipe_crc->pipe = pipe;
pipe_crc->source = source;
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 5f940cb..04ac2dc 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -72,7 +72,7 @@ char *igt_crc_to_string(igt_crc_t *crc);
void igt_pipe_crc_check(igt_debugfs_t *debugfs);
igt_pipe_crc_t *
-igt_pipe_crc_new(igt_debugfs_t *debugfs, int drm_fd, enum pipe pipe,
+igt_pipe_crc_new(igt_debugfs_t *debugfs, enum pipe pipe,
enum intel_pipe_crc_source source);
void igt_pipe_crc_free(igt_pipe_crc_t *pipe_crc);
void igt_pipe_crc_start(igt_pipe_crc_t *pipe_crc);
diff --git a/tests/kms_cursor_crc.c b/tests/kms_cursor_crc.c
index f98fbdb..0b38a7c 100644
--- a/tests/kms_cursor_crc.c
+++ b/tests/kms_cursor_crc.c
@@ -63,7 +63,7 @@ static igt_pipe_crc_t *create_crc(data_t *data, enum pipe pipe)
{
igt_pipe_crc_t *crc;
- crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd, pipe,
+ crc = igt_pipe_crc_new(&data->debugfs, pipe,
INTEL_PIPE_CRC_SOURCE_AUTO);
return crc;
}
diff --git a/tests/kms_fbc_crc.c b/tests/kms_fbc_crc.c
index 4d4473e..edcba7a 100644
--- a/tests/kms_fbc_crc.c
+++ b/tests/kms_fbc_crc.c
@@ -352,7 +352,7 @@ static bool prepare_crtc(data_t *data, uint32_t connector_id, enum test_mode mod
data->pipe_crc[data->crtc_idx] = NULL;
pipe_crc = igt_pipe_crc_new(&data->debugfs,
- data->drm_fd, data->crtc_idx,
+ data->crtc_idx,
INTEL_PIPE_CRC_SOURCE_AUTO);
if (!pipe_crc) {
printf("auto crc not supported on this connector with crtc %i\n",
diff --git a/tests/kms_pipe_crc_basic.c b/tests/kms_pipe_crc_basic.c
index 2b46ef3..8523b53 100644
--- a/tests/kms_pipe_crc_basic.c
+++ b/tests/kms_pipe_crc_basic.c
@@ -88,7 +88,7 @@ static void test_read_crc(data_t *data, int pipe, unsigned flags)
igt_display_commit(display);
- pipe_crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd,
+ pipe_crc = igt_pipe_crc_new(&data->debugfs,
pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
if (!pipe_crc)
diff --git a/tests/kms_plane.c b/tests/kms_plane.c
index 2371f9a..6c7275a 100644
--- a/tests/kms_plane.c
+++ b/tests/kms_plane.c
@@ -92,7 +92,7 @@ test_position_init(test_position_t *test, igt_output_t *output, enum pipe pipe)
drmModeModeInfo *mode;
igt_plane_t *primary;
- test->pipe_crc = igt_pipe_crc_new(&data->debugfs, data->drm_fd,
+ test->pipe_crc = igt_pipe_crc_new(&data->debugfs,
pipe, INTEL_PIPE_CRC_SOURCE_AUTO);
igt_output_set_pipe(output, pipe);
commit 803d07b2fff95794d8a840728d417e8e1d31264c
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Mar 12 19:00:48 2014 +0100
lib: make igt_debugfs_open infallible
(Almost) no one cared anyway.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 32edc43..9c4c989 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -37,7 +37,7 @@
/*
* General debugfs helpers
*/
-int igt_debugfs_init(igt_debugfs_t *debugfs)
+void igt_debugfs_init(igt_debugfs_t *debugfs)
{
const char *path = "/sys/kernel/debug";
struct stat st;
@@ -51,11 +51,9 @@ int igt_debugfs_init(igt_debugfs_t *debugfs)
if (stat("/sys/kernel/debug/dri", &st) == 0)
goto find_minor;
- if (stat("/sys/kernel/debug", &st))
- return errno;
+ igt_assert(stat("/sys/kernel/debug", &st) == 0);
- if (mount("debug", "/sys/kernel/debug", "debugfs", 0, 0))
- return errno;
+ igt_assert(mount("debug", "/sys/kernel/debug", "debugfs", 0, 0) == 0);
find_minor:
strcpy(debugfs->root, path);
@@ -64,12 +62,13 @@ find_minor:
sprintf(debugfs->dri_path + len, "/i915_error_state");
if (stat(debugfs->dri_path, &st) == 0) {
debugfs->dri_path[len] = '\0';
- return 0;
+ return;
}
}
debugfs->dri_path[0] = '\0';
- return ENOENT;
+
+ igt_fail(4);
}
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode)
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 43fa0fc..5f940cb 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -36,7 +36,7 @@ typedef struct {
char dri_path[128];
} igt_debugfs_t;
-int igt_debugfs_init(igt_debugfs_t *debugfs);
+void igt_debugfs_init(igt_debugfs_t *debugfs);
int igt_debugfs_open(igt_debugfs_t *debugfs, const char *filename, int mode);
FILE *igt_debugfs_fopen(igt_debugfs_t *debugfs, const char *filename,
const char *mode);
diff --git a/tests/gem_reset_stats.c b/tests/gem_reset_stats.c
index a7d6550..71ba6df 100644
--- a/tests/gem_reset_stats.c
+++ b/tests/gem_reset_stats.c
@@ -1041,7 +1041,7 @@ igt_main
"Kernel is too old, or contexts not supported: %s\n",
strerror(errno));
- assert(igt_debugfs_init(&dfs) == 0);
+ igt_debugfs_init(&dfs);
}
igt_subtest("params")
commit 096bb851f6bbcd018b3e7dc42930952971c4ea72
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Mar 12 18:53:44 2014 +0100
lib/ioctl_wrappers: api doc fixup
Oops.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
index 60512c7..3756930 100644
--- a/lib/ioctl_wrappers.c
+++ b/lib/ioctl_wrappers.c
@@ -785,7 +785,7 @@ void gem_require_caching(int fd)
/**
* gem_require_ring:
* @fd: open i915 drm file descriptor
- * @id: ring flag bit as used in gem_execbuf()
+ * @ring_id: ring flag bit as used in gem_execbuf()
*
* Feature test macro to query whether a specific ring is available.
* In contrast to gem_has_enable_ring() this automagically skips if the ring
commit adb28fd71d21175f047d7ed4cc3e4683a146b57b
Author: Daniel Vetter <daniel.vetter@ffwll.ch>
Date: Wed Mar 12 16:53:47 2014 +0100
lib: move prefault helpers to igt_debugfs.c
This way all debugfs library code is in one place, ready for some api
documentation care.
Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
diff --git a/lib/drmtest.c b/lib/drmtest.c
index a5aac4d..78b9999 100644
--- a/lib/drmtest.c
+++ b/lib/drmtest.c
@@ -425,44 +425,6 @@ void igt_cleanup_aperture_trashers(void)
free(trash_bos);
}
-#define PREFAULT_DEBUGFS "/sys/module/i915/parameters/prefault_disable"
-static void igt_prefault_control(bool enable)
-{
- const char *name = PREFAULT_DEBUGFS;
- int fd;
- char buf[2] = {'Y', 'N'};
- int index;
-
- fd = open(name, O_RDWR);
- igt_require(fd >= 0);
-
- if (enable)
- index = 1;
- else
- index = 0;
-
- igt_require(write(fd, &buf[index], 1) == 1);
-
- close(fd);
-}
-
-static void enable_prefault_at_exit(int sig)
-{
- igt_enable_prefault();
-}
-
-void igt_disable_prefault(void)
-{
- igt_prefault_control(false);
-
- igt_install_exit_handler(enable_prefault_at_exit);
-}
-
-void igt_enable_prefault(void)
-{
- igt_prefault_control(true);
-}
-
void igt_system_suspend_autoresume(void)
{
int ret;
diff --git a/lib/drmtest.h b/lib/drmtest.h
index f9f21d3..593f31b 100644
--- a/lib/drmtest.h
+++ b/lib/drmtest.h
@@ -77,10 +77,6 @@ void igt_cleanup_aperture_trashers(void);
/* set vt into graphics mode, required to prevent fbcon from interfering */
void igt_set_vt_graphics_mode(void);
-/* prefault disabling, needs the corresponding debugfs interface */
-void igt_disable_prefault(void);
-void igt_enable_prefault(void);
-
/* suspend and auto-resume system */
void igt_system_suspend_autoresume(void);
diff --git a/lib/igt_debugfs.c b/lib/igt_debugfs.c
index 4a4a4dd..32edc43 100644
--- a/lib/igt_debugfs.c
+++ b/lib/igt_debugfs.c
@@ -34,6 +34,9 @@
#include "igt_display.h"
#include "igt_debugfs.h"
+/*
+ * General debugfs helpers
+ */
int igt_debugfs_init(igt_debugfs_t *debugfs)
{
const char *path = "/sys/kernel/debug";
@@ -376,3 +379,45 @@ void igt_drop_caches_set(uint64_t val)
igt_assert(nbytes == strlen(data) + 1);
close(fd);
}
+
+/*
+ * Prefault control
+ */
+
+#define PREFAULT_DEBUGFS "/sys/module/i915/parameters/prefault_disable"
+static void igt_prefault_control(bool enable)
+{
+ const char *name = PREFAULT_DEBUGFS;
+ int fd;
+ char buf[2] = {'Y', 'N'};
+ int index;
+
+ fd = open(name, O_RDWR);
+ igt_require(fd >= 0);
+
+ if (enable)
+ index = 1;
+ else
+ index = 0;
+
+ igt_require(write(fd, &buf[index], 1) == 1);
+
+ close(fd);
+}
+
+static void enable_prefault_at_exit(int sig)
+{
+ igt_enable_prefault();
+}
+
+void igt_disable_prefault(void)
+{
+ igt_prefault_control(false);
+
+ igt_install_exit_handler(enable_prefault_at_exit);
+}
+
+void igt_enable_prefault(void)
+{
+ igt_prefault_control(true);
+}
diff --git a/lib/igt_debugfs.h b/lib/igt_debugfs.h
index 6b7e623..43fa0fc 100644
--- a/lib/igt_debugfs.h
+++ b/lib/igt_debugfs.h
@@ -96,4 +96,12 @@ void igt_pipe_crc_collect_crc(igt_pipe_crc_t *pipe_crc, igt_crc_t *out_crc);
Reply to: