mirror of
https://github.com/tiagovignatti/intel-gpu-tools.git
synced 2026-08-11 16:32:58 +00:00
s/drmtest_/igt_/
Requested-by: Chris Wilson <chris@chris-wilson.co.uk> Acked-by: Damien Lespiau <damien.lespiau@intel.com> Signed-off-by: Daniel Vetter <daniel.vetter@ffwll.ch>
This commit is contained in:
+51
-51
@@ -277,7 +277,7 @@ int drm_open_any(void)
|
||||
return fd;
|
||||
|
||||
gem_quiescent_gpu(fd);
|
||||
drmtest_install_exit_handler(quiescent_gpu_at_exit);
|
||||
igt_install_exit_handler(quiescent_gpu_at_exit);
|
||||
|
||||
return fd;
|
||||
}
|
||||
@@ -406,9 +406,9 @@ void gem_check_caching(int fd)
|
||||
gem_close(fd, arg.handle);
|
||||
|
||||
if (ret != 0) {
|
||||
if (!drmtest_only_list_subtests())
|
||||
if (!igt_only_list_subtests())
|
||||
printf("no set_caching support detected\n");
|
||||
drmtest_skip();
|
||||
igt_skip();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -422,7 +422,7 @@ void gem_set_caching(int fd, uint32_t handle, int caching)
|
||||
ret = ioctl(fd, LOCAL_DRM_IOCTL_I915_GEM_SET_CACHEING, &arg);
|
||||
|
||||
if (ret != 0 && (errno == ENOTTY || errno == EINVAL))
|
||||
drmtest_skip();
|
||||
igt_skip();
|
||||
else
|
||||
assert(ret == 0);
|
||||
}
|
||||
@@ -635,15 +635,15 @@ static void sig_handler(int i)
|
||||
|
||||
static void signal_helper_exit_handler(int sig)
|
||||
{
|
||||
drmtest_stop_signal_helper();
|
||||
igt_stop_signal_helper();
|
||||
}
|
||||
|
||||
void drmtest_fork_signal_helper(void)
|
||||
void igt_fork_signal_helper(void)
|
||||
{
|
||||
pid_t pid;
|
||||
sighandler_t oldsig;
|
||||
|
||||
drmtest_install_exit_handler(signal_helper_exit_handler);
|
||||
igt_install_exit_handler(signal_helper_exit_handler);
|
||||
|
||||
signal(SIGUSR1, sig_handler);
|
||||
oldsig = signal(SIGQUIT, SIG_DFL);
|
||||
@@ -657,7 +657,7 @@ void drmtest_fork_signal_helper(void)
|
||||
signal_helper = pid;
|
||||
}
|
||||
|
||||
void drmtest_stop_signal_helper(void)
|
||||
void igt_stop_signal_helper(void)
|
||||
{
|
||||
int exitcode;
|
||||
|
||||
@@ -680,7 +680,7 @@ static bool in_subtest = false;
|
||||
static bool test_with_subtests = false;
|
||||
static bool skip_subtests_henceforth = false;
|
||||
|
||||
void drmtest_subtest_init(int argc, char **argv)
|
||||
void igt_subtest_init(int argc, char **argv)
|
||||
{
|
||||
int c, option_index = 0;
|
||||
static struct option long_options[] = {
|
||||
@@ -714,10 +714,10 @@ out:
|
||||
|
||||
/*
|
||||
* Note: Testcases which use these helpers MUST NOT output anything to stdout
|
||||
* outside of places protected by drmtest_run_subtest checks - the piglit
|
||||
* outside of places protected by igt_run_subtest checks - the piglit
|
||||
* runner adds every line to the subtest list.
|
||||
*/
|
||||
bool __drmtest_run_subtest(const char *subtest_name)
|
||||
bool __igt_run_subtest(const char *subtest_name)
|
||||
{
|
||||
assert(in_subtest == false);
|
||||
|
||||
@@ -739,7 +739,7 @@ bool __drmtest_run_subtest(const char *subtest_name)
|
||||
}
|
||||
}
|
||||
|
||||
bool drmtest_only_list_subtests(void)
|
||||
bool igt_only_list_subtests(void)
|
||||
{
|
||||
return list_subtests;
|
||||
}
|
||||
@@ -747,16 +747,16 @@ bool drmtest_only_list_subtests(void)
|
||||
static bool skipped_one = false;
|
||||
static bool succeeded_one = false;
|
||||
static bool failed_one = false;
|
||||
static int drmtest_exitcode;
|
||||
static int igt_exitcode;
|
||||
|
||||
static void exit_subtest(void) __attribute__((noreturn));
|
||||
static void exit_subtest(void)
|
||||
{
|
||||
in_subtest = false;
|
||||
longjmp(drmtest_subtest_jmpbuf, 1);
|
||||
longjmp(igt_subtest_jmpbuf, 1);
|
||||
}
|
||||
|
||||
void drmtest_skip(void)
|
||||
void igt_skip(void)
|
||||
{
|
||||
skipped_one = true;
|
||||
if (in_subtest)
|
||||
@@ -767,19 +767,19 @@ void drmtest_skip(void)
|
||||
exit(77);
|
||||
}
|
||||
|
||||
void drmtest_success(void)
|
||||
void igt_success(void)
|
||||
{
|
||||
succeeded_one = true;
|
||||
if (in_subtest)
|
||||
exit_subtest();
|
||||
}
|
||||
|
||||
void drmtest_fail(int exitcode)
|
||||
void igt_fail(int exitcode)
|
||||
{
|
||||
assert(exitcode != 0 && exitcode != 77);
|
||||
|
||||
if (!failed_one)
|
||||
drmtest_exitcode = exitcode;
|
||||
igt_exitcode = exitcode;
|
||||
|
||||
failed_one = true;
|
||||
|
||||
@@ -791,16 +791,16 @@ void drmtest_fail(int exitcode)
|
||||
}
|
||||
}
|
||||
|
||||
int drmtest_retval(void)
|
||||
int igt_retval(void)
|
||||
{
|
||||
if (drmtest_only_list_subtests())
|
||||
if (igt_only_list_subtests())
|
||||
return 0;
|
||||
|
||||
/* Calling this without calling one of the above is a failure */
|
||||
assert(skipped_one || succeeded_one || failed_one);
|
||||
|
||||
if (failed_one)
|
||||
return drmtest_exitcode;
|
||||
return igt_exitcode;
|
||||
else if (succeeded_one)
|
||||
return 0;
|
||||
else
|
||||
@@ -818,7 +818,7 @@ static bool env_set(const char *env_var, bool default_value)
|
||||
return atoi(val) != 0;
|
||||
}
|
||||
|
||||
bool drmtest_run_in_simulation(void)
|
||||
bool igt_run_in_simulation(void)
|
||||
{
|
||||
static int simulation = -1;
|
||||
|
||||
@@ -830,17 +830,17 @@ bool drmtest_run_in_simulation(void)
|
||||
|
||||
/* Skip the test when running on simulation (and that's relevant only when
|
||||
* we're not in the mode where we list the subtests) */
|
||||
void drmtest_skip_on_simulation(void)
|
||||
void igt_skip_on_simulation(void)
|
||||
{
|
||||
if (drmtest_only_list_subtests())
|
||||
if (igt_only_list_subtests())
|
||||
return;
|
||||
|
||||
if (drmtest_run_in_simulation())
|
||||
if (igt_run_in_simulation())
|
||||
exit(77);
|
||||
}
|
||||
|
||||
/* other helpers */
|
||||
void drmtest_exchange_int(void *array, unsigned i, unsigned j)
|
||||
void igt_exchange_int(void *array, unsigned i, unsigned j)
|
||||
{
|
||||
int *int_arr, tmp;
|
||||
int_arr = array;
|
||||
@@ -850,7 +850,7 @@ void drmtest_exchange_int(void *array, unsigned i, unsigned j)
|
||||
int_arr[j] = tmp;
|
||||
}
|
||||
|
||||
void drmtest_permute_array(void *array, unsigned size,
|
||||
void igt_permute_array(void *array, unsigned size,
|
||||
void (*exchange_func)(void *array,
|
||||
unsigned i,
|
||||
unsigned j))
|
||||
@@ -865,7 +865,7 @@ void drmtest_permute_array(void *array, unsigned size,
|
||||
}
|
||||
}
|
||||
|
||||
void drmtest_progress(const char *header, uint64_t i, uint64_t total)
|
||||
void igt_progress(const char *header, uint64_t i, uint64_t total)
|
||||
{
|
||||
int divider = 200;
|
||||
|
||||
@@ -891,7 +891,7 @@ void drmtest_progress(const char *header, uint64_t i, uint64_t total)
|
||||
drm_intel_bo **trash_bos;
|
||||
int num_trash_bos;
|
||||
|
||||
void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr)
|
||||
void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -904,7 +904,7 @@ void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr)
|
||||
trash_bos[i] = drm_intel_bo_alloc(bufmgr, "trash bo", 1024*1024, 4096);
|
||||
}
|
||||
|
||||
void drmtest_trash_aperture(void)
|
||||
void igt_trash_aperture(void)
|
||||
{
|
||||
int i;
|
||||
uint8_t *gtt_ptr;
|
||||
@@ -917,7 +917,7 @@ void drmtest_trash_aperture(void)
|
||||
}
|
||||
}
|
||||
|
||||
void drmtest_cleanup_aperture_trashers(void)
|
||||
void igt_cleanup_aperture_trashers(void)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1397,7 +1397,7 @@ static struct {
|
||||
bool installed;
|
||||
} orig_sig[MAX_SIGNALS];
|
||||
|
||||
static drmtest_exit_handler_t exit_handler_fn[MAX_EXIT_HANDLERS];
|
||||
static igt_exit_handler_t exit_handler_fn[MAX_EXIT_HANDLERS];
|
||||
static int exit_handler_count;
|
||||
static bool exit_handler_disabled;
|
||||
static sigset_t saved_sig_mask;
|
||||
@@ -1443,7 +1443,7 @@ static void call_exit_handlers(int sig)
|
||||
exit_handler_fn[i](sig);
|
||||
}
|
||||
|
||||
static void drmtest_atexit_handler(void)
|
||||
static void igt_atexit_handler(void)
|
||||
{
|
||||
restore_all_sig_handler();
|
||||
|
||||
@@ -1451,7 +1451,7 @@ static void drmtest_atexit_handler(void)
|
||||
call_exit_handlers(0);
|
||||
}
|
||||
|
||||
static void drmtest_sig_handler(int sig)
|
||||
static void igt_sig_handler(int sig)
|
||||
{
|
||||
restore_all_sig_handler();
|
||||
|
||||
@@ -1475,7 +1475,7 @@ static void drmtest_sig_handler(int sig)
|
||||
* The handler will be passed the signal number if called due to a signal, or
|
||||
* 0 otherwise.
|
||||
*/
|
||||
int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
|
||||
int igt_install_exit_handler(igt_exit_handler_t fn)
|
||||
{
|
||||
int i;
|
||||
|
||||
@@ -1490,11 +1490,11 @@ int drmtest_install_exit_handler(drmtest_exit_handler_t fn)
|
||||
|
||||
for (i = 0; i < ARRAY_SIZE(handled_signals); i++) {
|
||||
if (install_sig_handler(handled_signals[i],
|
||||
drmtest_sig_handler))
|
||||
igt_sig_handler))
|
||||
goto err;
|
||||
}
|
||||
|
||||
if (atexit(drmtest_atexit_handler))
|
||||
if (atexit(igt_atexit_handler))
|
||||
goto err;
|
||||
|
||||
return 0;
|
||||
@@ -1505,7 +1505,7 @@ err:
|
||||
return -1;
|
||||
}
|
||||
|
||||
void drmtest_disable_exit_handler(void)
|
||||
void igt_disable_exit_handler(void)
|
||||
{
|
||||
sigset_t set;
|
||||
int i;
|
||||
@@ -1525,7 +1525,7 @@ void drmtest_disable_exit_handler(void)
|
||||
exit_handler_disabled = true;
|
||||
}
|
||||
|
||||
void drmtest_enable_exit_handler(void)
|
||||
void igt_enable_exit_handler(void)
|
||||
{
|
||||
if (!exit_handler_disabled)
|
||||
return;
|
||||
@@ -1575,16 +1575,16 @@ static void restore_vt_mode_at_exit(int sig)
|
||||
* original mode.
|
||||
*/
|
||||
|
||||
int drmtest_set_vt_graphics_mode(void)
|
||||
int igt_set_vt_graphics_mode(void)
|
||||
{
|
||||
if (drmtest_install_exit_handler(restore_vt_mode_at_exit))
|
||||
if (igt_install_exit_handler(restore_vt_mode_at_exit))
|
||||
return -1;
|
||||
|
||||
drmtest_disable_exit_handler();
|
||||
igt_disable_exit_handler();
|
||||
orig_vt_mode = set_vt_mode(KD_GRAPHICS);
|
||||
if (orig_vt_mode < 0)
|
||||
orig_vt_mode = -1UL;
|
||||
drmtest_enable_exit_handler();
|
||||
igt_enable_exit_handler();
|
||||
|
||||
return orig_vt_mode < 0 ? -1 : 0;
|
||||
}
|
||||
@@ -1725,7 +1725,7 @@ void kmstest_free_connector_config(struct kmstest_connector_config *config)
|
||||
}
|
||||
|
||||
#define PREFAULT_DEBUGFS "/sys/module/i915/parameters/prefault_disable"
|
||||
static int drmtest_prefault_control(bool enable)
|
||||
static int igt_prefault_control(bool enable)
|
||||
{
|
||||
const char *name = PREFAULT_DEBUGFS;
|
||||
int fd;
|
||||
@@ -1758,22 +1758,22 @@ static int drmtest_prefault_control(bool enable)
|
||||
|
||||
static void enable_prefault_at_exit(int sig)
|
||||
{
|
||||
drmtest_enable_prefault();
|
||||
igt_enable_prefault();
|
||||
}
|
||||
|
||||
int drmtest_disable_prefault(void)
|
||||
int igt_disable_prefault(void)
|
||||
{
|
||||
drmtest_install_exit_handler(enable_prefault_at_exit);
|
||||
igt_install_exit_handler(enable_prefault_at_exit);
|
||||
|
||||
return drmtest_prefault_control(false);
|
||||
return igt_prefault_control(false);
|
||||
}
|
||||
|
||||
int drmtest_enable_prefault(void)
|
||||
int igt_enable_prefault(void)
|
||||
{
|
||||
return drmtest_prefault_control(true);
|
||||
return igt_prefault_control(true);
|
||||
}
|
||||
|
||||
void drmtest_system_suspend_autoresume(void)
|
||||
void igt_system_suspend_autoresume(void)
|
||||
{
|
||||
int ret;
|
||||
|
||||
|
||||
+34
-34
@@ -86,36 +86,36 @@ int prime_handle_to_fd(int fd, uint32_t handle);
|
||||
uint32_t prime_fd_to_handle(int fd, int dma_buf_fd);
|
||||
|
||||
/* generally useful helpers */
|
||||
void drmtest_fork_signal_helper(void);
|
||||
void drmtest_stop_signal_helper(void);
|
||||
void drmtest_exchange_int(void *array, unsigned i, unsigned j);
|
||||
void drmtest_permute_array(void *array, unsigned size,
|
||||
void igt_fork_signal_helper(void);
|
||||
void igt_stop_signal_helper(void);
|
||||
void igt_exchange_int(void *array, unsigned i, unsigned j);
|
||||
void igt_permute_array(void *array, unsigned size,
|
||||
void (*exchange_func)(void *array,
|
||||
unsigned i,
|
||||
unsigned j));
|
||||
void drmtest_progress(const char *header, uint64_t i, uint64_t total);
|
||||
void igt_progress(const char *header, uint64_t i, uint64_t total);
|
||||
|
||||
/* subtest infrastructure */
|
||||
jmp_buf drmtest_subtest_jmpbuf;
|
||||
void drmtest_subtest_init(int argc, char **argv);
|
||||
bool __drmtest_run_subtest(const char *subtest_name);
|
||||
#define drmtest_subtest(name) for (; __drmtest_run_subtest((name)) && \
|
||||
(setjmp(drmtest_subtest_jmpbuf) == 0); \
|
||||
drmtest_success())
|
||||
bool drmtest_only_list_subtests(void);
|
||||
void drmtest_skip(void);
|
||||
void drmtest_success(void);
|
||||
void drmtest_fail(int exitcode) __attribute__((noreturn));
|
||||
int drmtest_retval(void);
|
||||
jmp_buf igt_subtest_jmpbuf;
|
||||
void igt_subtest_init(int argc, char **argv);
|
||||
bool __igt_run_subtest(const char *subtest_name);
|
||||
#define igt_subtest(name) for (; __igt_run_subtest((name)) && \
|
||||
(setjmp(igt_subtest_jmpbuf) == 0); \
|
||||
igt_success())
|
||||
bool igt_only_list_subtests(void);
|
||||
void igt_skip(void);
|
||||
void igt_success(void);
|
||||
void igt_fail(int exitcode) __attribute__((noreturn));
|
||||
int igt_retval(void);
|
||||
|
||||
/* check functions which auto-skip tests by calling drmtest_skip() */
|
||||
/* check functions which auto-skip tests by calling igt_skip() */
|
||||
void gem_check_caching(int fd);
|
||||
static inline bool gem_check_vebox(int fd)
|
||||
{
|
||||
if (gem_has_vebox(fd))
|
||||
return true;
|
||||
|
||||
drmtest_skip();
|
||||
igt_skip();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -124,7 +124,7 @@ static inline bool gem_check_bsd(int fd)
|
||||
if (HAS_BSD_RING(intel_get_drm_devid(fd)))
|
||||
return true;
|
||||
|
||||
drmtest_skip();
|
||||
igt_skip();
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -133,19 +133,19 @@ static inline bool gem_check_blt(int fd)
|
||||
if (HAS_BLT_RING(intel_get_drm_devid(fd)))
|
||||
return true;
|
||||
|
||||
drmtest_skip();
|
||||
igt_skip();
|
||||
return false;
|
||||
}
|
||||
|
||||
/* helpers to automatically reduce test runtime in simulation */
|
||||
bool drmtest_run_in_simulation(void);
|
||||
#define SLOW_QUICK(slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow))
|
||||
void drmtest_skip_on_simulation(void);
|
||||
bool igt_run_in_simulation(void);
|
||||
#define SLOW_QUICK(slow,quick) (igt_run_in_simulation() ? (quick) : (slow))
|
||||
void igt_skip_on_simulation(void);
|
||||
|
||||
/* helpers based upon the libdrm buffer manager */
|
||||
void drmtest_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
|
||||
void drmtest_trash_aperture(void);
|
||||
void drmtest_cleanup_aperture_trashers(void);
|
||||
void igt_init_aperture_trashers(drm_intel_bufmgr *bufmgr);
|
||||
void igt_trash_aperture(void);
|
||||
void igt_cleanup_aperture_trashers(void);
|
||||
|
||||
struct kmstest_connector_config {
|
||||
drmModeCrtc *crtc;
|
||||
@@ -220,19 +220,19 @@ inline static void _do_or_die(const char *function, int line, int ret)
|
||||
#define do_or_die(x) _do_or_die(__FUNCTION__, __LINE__, x)
|
||||
#define do_ioctl(fd, ptr, sz) do_or_die(drmIoctl((fd), (ptr), (sz)))
|
||||
|
||||
typedef void (*drmtest_exit_handler_t)(int sig);
|
||||
typedef void (*igt_exit_handler_t)(int sig);
|
||||
|
||||
/* reliable atexit helpers, also work when killed by a signal (if possible) */
|
||||
int drmtest_install_exit_handler(drmtest_exit_handler_t fn);
|
||||
void drmtest_enable_exit_handler(void);
|
||||
void drmtest_disable_exit_handler(void);
|
||||
int igt_install_exit_handler(igt_exit_handler_t fn);
|
||||
void igt_enable_exit_handler(void);
|
||||
void igt_disable_exit_handler(void);
|
||||
|
||||
/* set vt into graphics mode, required to prevent fbcon from interfering */
|
||||
int drmtest_set_vt_graphics_mode(void);
|
||||
int igt_set_vt_graphics_mode(void);
|
||||
|
||||
/* prefault disabling, needs the corresponding debugfs interface */
|
||||
int drmtest_disable_prefault(void);
|
||||
int drmtest_enable_prefault(void);
|
||||
int igt_disable_prefault(void);
|
||||
int igt_enable_prefault(void);
|
||||
|
||||
/* suspend and auto-resume system */
|
||||
void drmtest_system_suspend_autoresume(void);
|
||||
void igt_system_suspend_autoresume(void);
|
||||
|
||||
Reference in New Issue
Block a user