Provide a simulation friendly test environment v2
Second installment of this series.
Patches 1-6 are trivial general cleanups I came across while doing this, patches 7-10 are the real thing.
The changes from the last version are:
• Move from a white list of tests to run to a black list of tests to skip
• Name the environment variable that controls the simulation behaviour to INTEL_SIMULATION to have a chance to share the name with the piglit tests.
Signature · 6 lines
Damien _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH 1/10 README: Reword a few sentences
To be a bit more correct (they were understandable though).
--- README | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-)
README +4 -4
@@ -27,17 +27,17 @@ tests/ Run this tests with "make test" as root from this directory. Note that no other drm clients (X server) may run. - "make test" only runs a default of test usefull for regression testing. - Other tests not run are: + "make test" only runs a default set of tests and is useful for + regression testing. Other tests not run are: - tests that might hang the gpu, see HANG in Makefile.am - gem_stress, a stress test suite. Look at the source for all the various options. - testdisplay is only run in the default mode. testdisplay has tons of - options to test different kms functionality, again read the source of + options to test different kms functionality, again read the source for the details. The more comfortable way to run tests is with piglit. First grab piglit - from + from: git://anongit.freedesktop.org/piglit
Signature · 1 line
1.8.1.4
PATCH 2/10 build: Make grep silent when running make test
In reply to Damien Lespiau-q will prevent grep from writing to stdout and print "root" when make test is running as root.
--- tests/Makefile.am | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/Makefile.am +1 -1
@@ -143,7 +143,7 @@ TESTS = \ $(NULL) test: - @whoami | grep root || ( echo ERROR: not running as root; exit 1 ) + @whoami | grep -q root || ( echo ERROR: not running as root; exit 1 ) @./check_drm_clients @make TESTS="${kernel_tests}" check
Signature · 1 line
1.8.1.4
PATCH 3/10 lib: Remove the execution bit of intel_chipset.h
In reply to Damien Lespiau--- lib/intel_chipset.h | 0 1 file changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 lib/intel_chipset.h
lib/intel_chipset.h +0 -0
Signature · 1 line
1.8.1.4
PATCH 4/10 Update .gitignore files with the new tests and tools
In reply to Damien LespiauAlso sort them.
--- tests/.gitignore | 24 ++++++++++++++---------- tools/.gitignore | 5 +++++ 2 files changed, 19 insertions(+), 10 deletions(-)
tests/.gitignore +14 -10
@@ -1,4 +1,3 @@ -kms_flip drm_vma_limiter drm_vma_limiter_cached drm_vma_limiter_cpu
@@ -9,10 +8,10 @@ gem_bad_blit gem_bad_length gem_basic gem_cacheing -gem_cs_prefetch -gem_cs_tlb gem_cpu_concurrent_blit gem_cpu_reloc +gem_cs_prefetch +gem_cs_tlb gem_ctx_bad_destroy gem_ctx_bad_exec gem_ctx_basic
@@ -21,20 +20,22 @@ gem_ctx_exec gem_double_irq_loop gem_dummy_reloc_loop gem_exec_bad_domains -gem_exec_blt gem_exec_big +gem_exec_blt gem_exec_faulting_reloc +gem_exec_lut_handle gem_exec_nop -gem_fenced_exec_thrash gem_fence_thrash +gem_fenced_exec_thrash gem_flink -gem_gtt_speed gem_gtt_concurrent_blit gem_gtt_cpu_tlb +gem_gtt_speed gem_hang gem_hangcheck_forcewake gem_largeobject gem_linear_blits +gem_lut_handle gem_mmap gem_mmap_gtt gem_mmap_offset_exhaustion
@@ -45,21 +46,22 @@ gem_pipe_control_store_loop gem_pread_after_blit gem_pwrite gem_readwrite +gem_reg_read gem_reloc_overflow gem_reloc_vs_gpu -gem_reg_read gem_render_linear_blits gem_render_tiled_blits -gem_ringfill gem_ring_sync_loop +gem_ringfill +gem_seqno_wrap gem_set_tiling_vs_blt gem_set_tiling_vs_gtt gem_set_tiling_vs_pwrite -gem_seqno_wrap gem_storedw_batches_loop gem_storedw_loop_blt gem_storedw_loop_bsd gem_storedw_loop_render +gem_storedw_loop_vebox gem_stress gem_threaded_access_tiled gem_tiled_blits
@@ -68,6 +70,7 @@ gem_tiled_partial_pwrite_pread gem_tiled_pread gem_tiled_pread_pwrite gem_tiled_swapping +gem_tiling_max_stride gem_unfence_active_buffers gem_unref_active_buffers gem_vmap_blits
@@ -80,12 +83,13 @@ gen3_render_tiledy_blits getclient getstats getversion +kms_flip prime_nv_api prime_nv_pcopy prime_nv_test prime_self_import prime_udl -testdisplay sysfs_rc6_residency sysfs_rps +testdisplay # Please keep sorted alphabetically
tools/.gitignore +5 -0
@@ -16,7 +16,12 @@ intel_gtt intel_infoframes intel_l3_parity intel_lid +intel_nc_read +intel_nc_write intel_panel_fitter +intel_perf_counters +intel_punit_read +intel_punit_write intel_reg_checker intel_reg_dumper intel_reg_read
Signature · 1 line
1.8.1.4
PATCH 5/10 lib: Add the declaration of intel_register_access_needs_fakewake()
In reply to Damien LespiauOtherwise gcc complains that the function hasn't been declared.
--- lib/intel_gpu_tools.h | 2 ++ 1 file changed, 2 insertions(+)
lib/intel_gpu_tools.h +2 -0
@@ -45,6 +45,8 @@ int intel_register_access_init(struct pci_device *pci_dev, int safe);void intel_register_access_fini (void );uint32_t intel_register_read (uint32_t reg);void intel_register_write (uint32_t reg,uint32_t val); +int intel_register_access_needs_fakewake (void ); +/* Following functions are relevant only for SoCs like Valleyview */ uint32_t intel_dpio_reg_read (uint32_t reg);void intel_dpio_reg_write (uint32_t reg,uint32_t val);
Signature · 1 line
1.8.1.4
PATCH 6/10 reg_dumper: Shut a warning down
In reply to Damien Lespiau--- tools/intel_reg_dumper.c | 1 + 1 file changed, 1 insertion(+)
tools/intel_reg_dumper.c +1 -0
@@ -1721,6 +1721,7 @@ DEBUGSTRING(hsw_debug_pipe_ddi_func_ctl) mode ="FDI" ;break ;case 5 : +default : mode ="mode reserved" ;break ; }
Signature · 1 line
1.8.1.4
Re: [PATCH 06/10] reg_dumper: Shut a warning down
Merged until this point as they are really trivial patch and the out of date .gitignore is annoying me.
Signature · 1 line
Damien
PATCH 7/10 lib: Rename IGT_QUICK to INTEL_SIMULATION
In reply to Damien LespiauIt's more accurate this way as the quick mode is really useful for in the simulation environment.
v2: Use the INTEL_ prefix to have a chance to share the same environment
variable as piglit OpenGL tests
--- lib/drmtest.c | 10 +++++----- lib/drmtest.h | 4 ++-- 2 files changed, 7 insertions(+), 7 deletions(-)
lib/drmtest.c +5 -5
@@ -602,14 +602,14 @@ static bool env_set(const char *env_var)return atoi (val) !=0 ; } -bool drmtest_run_quick (void ) +bool drmtest_run_in_simulation (void ) { -static int run_quick =-1 ; +static int simulation =-1 ; -if (run_quick ==-1 ) - run_quick =env_set ("IGT_QUICK" ); +if (simulation ==-1 ) + simulation =env_set ("INTEL_SIMULATION" ); -return run_quick; +return simulation; }/* other helpers */
lib/drmtest.h +2 -2
@@ -89,8 +89,8 @@ void drmtest_subtest_init(int argc, char **argv);bool drmtest_run_subtest (const char *subtest_name);bool drmtest_only_list_subtests (void ); -bool drmtest_run_quick (void ); -#define SLOW_QUICK (slow,quick) (drmtest_run_quick() ? (quick) : (slow)) +bool drmtest_run_in_simulation (void ); +#define SLOW_QUICK (slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow))/* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers (drm_intel_bufmgr *bufmgr);
Signature · 1 line
1.8.1.4
PATCH 8/10 lib: Introduce drmtest_skip_on_simulation()
In reply to Damien LespiauThis will allow us to explicitely blacklist tests we don't want to run on simulation.
--- lib/drmtest.c | 12 ++++++++++++ lib/drmtest.h | 1 + 2 files changed, 13 insertions(+)
lib/drmtest.c +12 -0
@@ -38,6 +38,7 @@#include <math.h> #include <getopt.h> #include <stdlib.h> +#include <unistd.h> #include "drmtest.h" #include "i915_drm.h"
@@ -612,6 +613,17 @@ bool drmtest_run_in_simulation(void)return simulation; } +/* 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 ) +{ +if (drmtest_only_list_subtests ()) +return ; + +if (drmtest_run_in_simulation ()) +exit (77 ); +} +/* other helpers */ void drmtest_exchange_int (void *array,unsigned i,unsigned j) {
lib/drmtest.h +1 -0
@@ -91,6 +91,7 @@ bool drmtest_only_list_subtests(void);bool drmtest_run_in_simulation (void );#define SLOW_QUICK (slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow)) +void drmtest_skip_on_simulation (void );/* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers (drm_intel_bufmgr *bufmgr);
Signature · 1 line
1.8.1.4
Re: [PATCH 08/10] lib: Introduce drmtest_skip_on_simulation()
Quoted 44 lines · On Mon, 29 Apr 2013 19:15:35 +0100 Damien Lespiau <[email protected]>…
This will allow us to explicitely blacklist tests we don't want to run on simulation.
Signed-off-by Damien Lespiau <[email protected]>--- lib/drmtest.c | 12 ++++++++++++ lib/drmtest.h | 1 + 2 files changed, 13 insertions(+)lib/drmtest.c +12
-0@@ -38,6 +38,7 @@#include <math.h> #include <getopt.h> #include <stdlib.h> +#include <unistd.h> #include "drmtest.h" #include "i915_drm.h" @@ -612,6 +613,17 @@ bool drmtest_run_in_simulation(void)return simulation; } +/* 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 ) +{ +if (drmtest_only_list_subtests ()) +return ; + +if (drmtest_run_in_simulation ()) +exit (77 ); +} +/* other helpers */ void drmtest_exchange_int (void *array,unsigned i,unsigned j) {lib/drmtest.h +0
-0
lib/drmtest.h bool drmtest_only_list_subtests(void); · line 97
Quoted 7 lines
lib/drmtest.h +1
-0@@ -91,6 +91,7 @@ bool drmtest_only_list_subtests(void);bool drmtest_run_in_simulation (void );#define SLOW_QUICK (slow,quick) (drmtest_run_in_simulation() ? (quick) : (slow)) +void drmtest_skip_on_simulation (void );/* helpers based upon the libdrm buffer manager */ void drmtest_init_aperture_trashers (drm_intel_bufmgr *bufmgr);
So if we're shooting for a real test suite in the end, this seems like the wrong way to go. Rather we should be pulling boilerplate *out* of each test (like open_any, sanity checks for ppgtt or whatever) and making each test tiny.
Then we could have lists of tests in a separate file, complete with parameters, that would define specific areas of interest or things to run.
I'm hoping that wouldn't get in the way of running individual tests easily, but I don't think it would if we did it right...
Signature · 1 line
Jesse Barnes, Intel Open Source Technology Center
PATCH 9/10 tests: Black list tests we don't want to run on simulation
In reply to Damien LespiauLet's start by a small set of tests, to eventually consider running more.
The current list should then be:
gem_mmapgem_pread_after_blitgem_ring_sync_loopgem_ctx_basicgem_pipe_control_store_loopgem_storedw_loop_rendergem_storedw_loop_bltgem_storedw_loop_bsdgem_render_linear_blitsgem_tiled_blitsgem_cpu_reloc
gem_exec_nopgem_mmap_gtt
--- tests/drm_lib.sh | 5 +++++ tests/drm_vma_limiter.c | 2 ++ tests/drm_vma_limiter_cached.c | 2 ++ tests/drm_vma_limiter_cpu.c | 2 ++ tests/drm_vma_limiter_gtt.c | 2 ++ tests/gem_bad_length.c | 2 ++ tests/gem_cacheing.c | 1 + tests/gem_cpu_concurrent_blit.c | 1 + tests/gem_cs_prefetch.c | 2 ++ tests/gem_cs_tlb.c | 1 + tests/gem_ctx_bad_destroy.c | 2 ++ tests/gem_ctx_bad_exec.c | 3 +++ tests/gem_ctx_create.c | 2 ++ tests/gem_ctx_exec.c | 3 +++ tests/gem_double_irq_loop.c | 2 ++ tests/gem_dummy_reloc_loop.c | 1 + tests/gem_exec_bad_domains.c | 1 + tests/gem_exec_big.c | 2 ++ tests/gem_exec_blt.c | 2 ++ tests/gem_exec_faulting_reloc.c | 2 ++ tests/gem_exec_lut_handle.c | 2 ++ tests/gem_fence_thrash.c | 1 + tests/gem_fenced_exec_thrash.c | 12 +++++++++--- tests/gem_flink.c | 1 + tests/gem_gtt_concurrent_blit.c | 1 + tests/gem_gtt_cpu_tlb.c | 2 ++ tests/gem_gtt_speed.c | 2 ++ tests/gem_hangcheck_forcewake.c | 2 ++ tests/gem_largeobject.c | 2 ++ tests/gem_linear_blits.c | 2 ++ tests/gem_lut_handle.c | 2 ++ tests/gem_mmap_offset_exhaustion.c | 2 ++ tests/gem_partial_pwrite_pread.c | 1 + tests/gem_pin.c | 2 ++ tests/gem_pwrite.c | 2 ++ tests/gem_readwrite.c | 2 ++ tests/gem_reg_read.c | 2 ++ tests/gem_reloc_overflow.c | 2 ++ tests/gem_reloc_vs_gpu.c | 2 ++ tests/gem_render_tiled_blits.c | 2 ++ tests/gem_ringfill.c | 1 + tests/gem_seqno_wrap.c | 2 ++ tests/gem_set_tiling_vs_blt.c | 1 + tests/gem_set_tiling_vs_gtt.c | 2 ++ tests/gem_set_tiling_vs_pwrite.c | 2 ++ tests/gem_storedw_batches_loop.c | 2 ++ tests/gem_threaded_access_tiled.c | 2 ++ tests/gem_tiled_fence_blits.c | 2 ++ tests/gem_tiled_partial_pwrite_pread.c | 1 + tests/gem_tiled_pread.c | 2 ++ tests/gem_tiled_pread_pwrite.c | 1 + tests/gem_tiled_swapping.c | 2 ++ tests/gem_tiling_max_stride.c | 2 ++ tests/gem_unfence_active_buffers.c | 2 ++ tests/gem_unref_active_buffers.c | 2 ++ tests/gem_vmap_blits.c | 2 ++ tests/gem_wait_render_timeout.c | 2 ++ tests/kms_flip.c | 1 + tests/prime_nv_api.c | 3 +++ tests/prime_nv_pcopy.c | 1 + tests/prime_nv_test.c | 1 + tests/prime_self_import.c | 1 + tests/prime_udl.c | 3 +++ tests/sysfs_edid_timing | 2 ++ tests/sysfs_rc6_residency.c | 2 ++ tests/sysfs_rps.c | 2 ++ tests/testdisplay.c | 2 ++ 67 files changed, 131 insertions(+), 3 deletions(-)
tests/drm_lib.sh +5 -0
@@ -29,4 +29,9 @@ if [ `cat $i915_path/clients | wc -l` -gt "2" ] ; then die "ERROR: other drm clients running" fi +function drmtest_skip_on_simulation() +{ + [ -n "$INTEL_SIMULATION" ] && exit 77 +} +drmtest_skip_on_simulation
tests/drm_vma_limiter.c +2 -0
@@ -60,6 +60,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/drm_vma_limiter_cached.c +2 -0
@@ -61,6 +61,8 @@ int main(int argc, char **argv)char *ptr;drm_intel_bo *load_bo; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/drm_vma_limiter_cpu.c +2 -0
@@ -61,6 +61,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/drm_vma_limiter_gtt.c +2 -0
@@ -62,6 +62,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/gem_bad_length.c +2 -0
@@ -124,6 +124,8 @@ int main(int argc, char **argv) {int fd; +drmtest_skip_on_simulation (); + fd =drm_open_any ();create0 (fd);
tests/gem_cacheing.c +1 -0
@@ -113,6 +113,7 @@ int main(int argc, char **argv)bool skipped_all = true;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();srandom (0xdeadbeef );
tests/gem_cpu_concurrent_blit.c +1 -0
@@ -99,6 +99,7 @@ main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_cs_prefetch.c +2 -0
@@ -96,6 +96,8 @@ int main(int argc, char **argv)int count;drm_intel_bo *sample_batch_bo; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/gem_cs_tlb.c +1 -0
@@ -152,6 +152,7 @@ int main(int argc, char **argv)uint32_t devid;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any (); devid =intel_get_drm_devid (fd);
tests/gem_ctx_bad_destroy.c +2 -0
@@ -80,6 +80,8 @@ int main(int argc, char *argv[])uint32_t ctx_id;int ret, fd; +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);
tests/gem_ctx_bad_exec.c +3 -0
@@ -111,6 +111,9 @@ int main(int argc, char *argv[])uint32_t batch[2 ] = {MI_BATCH_BUFFER_END };uint32_t ctx_id;int fd; + +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);
tests/gem_ctx_create.c +2 -0
@@ -42,6 +42,8 @@ int main(int argc, char *argv[])int ret, fd;struct local_drm_i915_gem_context_create create; +drmtest_skip_on_simulation (); + create.ctx_id =rand (); create.pad =rand ();
tests/gem_ctx_exec.c +3 -0
@@ -122,6 +122,9 @@ int main(int argc, char *argv[])uint32_t batch[2 ] = {0 ,MI_BATCH_BUFFER_END };uint32_t ctx_id;int fd; + +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);
tests/gem_double_irq_loop.c +2 -0
@@ -98,6 +98,8 @@ int main(int argc, char **argv)int fd;int devid; +drmtest_skip_on_simulation (); +if (argc !=1 ) {fprintf (stderr,"usage: %s\n" , argv[0 ]);exit (-1 );
tests/gem_dummy_reloc_loop.c +1 -0
@@ -128,6 +128,7 @@ int main(int argc, char **argv)int devid;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any (); devid =intel_get_drm_devid (fd);
tests/gem_exec_bad_domains.c +1 -0
@@ -157,6 +157,7 @@ int main(int argc, char **argv)drm_intel_bo *tmp;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_exec_big.c +2 -0
@@ -108,6 +108,8 @@ int main(int argc, char **argv)uint32_t reloc_ofs;unsigned batch_size; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (batch_size =BATCH_SIZE /4 ; batch_size <=BATCH_SIZE ; batch_size +=4096 ) {
tests/gem_exec_blt.c +2 -0
@@ -250,6 +250,8 @@ int main(int argc, char **argv) {int i; +drmtest_skip_on_simulation (); +if (argc >1 ) {for (i =1 ; i < argc; i++) {int object_size =atoi (argv[i]);
tests/gem_exec_faulting_reloc.c +2 -0
@@ -220,6 +220,8 @@ static void run(int object_size)int main (int argc,char **argv) { +drmtest_skip_on_simulation (); +run (OBJECT_SIZE );return 0 ;
tests/gem_exec_lut_handle.c +2 -0
@@ -127,6 +127,8 @@ int main(int argc, char **argv) { .name = NULL }, }, *p; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (n =0 ; n <MAX_NUM_EXEC ; n++) {
tests/gem_fence_thrash.c +1 -0
@@ -208,6 +208,7 @@ int main(int argc, char **argv) {drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();if (drmtest_run_subtest ("bo-write-verify-none" ))assert (run_test (0 , bo_write_verify,I915_TILING_NONE ,80 ) ==0 );
tests/gem_fenced_exec_thrash.c +9 -3
@@ -159,9 +159,15 @@ static void run_test(int fd, int num_fences, int expected_errno)int main (int argc,char **argv) { -int fd =drm_open_any (); -int num_fences =get_num_fences (fd); -uint32_t devid =intel_get_drm_devid (fd); +int fd; +int num_fences; +uint32_t devid; + +drmtest_skip_on_simulation (); + + fd =drm_open_any (); + num_fences =get_num_fences (fd); + devid =intel_get_drm_devid (fd);assert (num_fences <=MAX_FENCES );
tests/gem_flink.c +1 -0
@@ -155,6 +155,7 @@ int main(int argc, char **argv)int fd;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_gtt_concurrent_blit.c +1 -0
@@ -102,6 +102,7 @@ main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_gtt_cpu_tlb.c +2 -0
@@ -77,6 +77,8 @@ main(int argc, char **argv)uint32_t *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,OBJ_SIZE );
tests/gem_gtt_speed.c +2 -0
@@ -61,6 +61,8 @@ int main(int argc, char **argv)int loop, i, tiling;int fd; +drmtest_skip_on_simulation (); +if (argc >1 ) size =atoi (argv[1 ]);if (size ==0 ) {
tests/gem_hangcheck_forcewake.c +2 -0
@@ -65,6 +65,8 @@ int main(int argc, char **argv)unsigned long pitch, act_size;int fd, i, devid; +drmtest_skip_on_simulation (); +memset (blob,'A' ,sizeof (blob)); fd =drm_open_any ();
tests/gem_largeobject.c +2 -0
@@ -87,6 +87,8 @@ int main(int argc, char **argv) {int fd; +drmtest_skip_on_simulation (); + fd =drm_open_any ();test_large_object (fd);
tests/gem_linear_blits.c +2 -0
@@ -182,6 +182,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); count =0 ;
tests/gem_lut_handle.c +2 -0
@@ -179,6 +179,8 @@ int main(int argc, char **argv)uint32_t handle;int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,4096 );
tests/gem_mmap_offset_exhaustion.c +2 -0
@@ -83,6 +83,8 @@ int main(int argc, char **argv) {int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* we have 32bit of address space, so try to fit one MB more
tests/gem_partial_pwrite_pread.c +1 -0
@@ -258,6 +258,7 @@ int main(int argc, char **argv)srandom (0xdeadbeef );drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_pin.c +2 -0
@@ -203,6 +203,8 @@ int main(int argc, char **argv)uint32_t *handle, *offset;int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (!test_can_pin (fd))
tests/gem_pwrite.c +2 -0
@@ -91,6 +91,8 @@ int main(int argc, char **argv)uint32_t *src, dst;int fd, count; +drmtest_skip_on_simulation (); +if (argc >1 ) object_size =atoi (argv[1 ]);if (object_size ==0 )
tests/gem_readwrite.c +2 -0
@@ -82,6 +82,8 @@ int main(int argc, char **argv)int ret;int handle; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,OBJECT_SIZE );
tests/gem_reg_read.c +2 -0
@@ -71,6 +71,8 @@ int main(int argc, char *argv[])int ret, fd;uint64_t val; +drmtest_skip_on_simulation (); + fd =drm_open_any (); reg_read.offset =0x2358 ;
tests/gem_reloc_overflow.c +2 -0
@@ -62,6 +62,8 @@ int main(int argc, char *argv[])struct drm_i915_gem_exec_object2 *execobjs;struct drm_i915_gem_execbuffer2 execbuf = {0 }; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* Create giant reloc buffer area. */
tests/gem_reloc_vs_gpu.c +2 -0
@@ -148,6 +148,8 @@ int main(int argc, char **argv)int fd, i, ring;uint32_t test; +drmtest_skip_on_simulation (); +memset (blob,'A' ,sizeof (blob)); fd =drm_open_any ();
tests/gem_render_tiled_blits.c +2 -0
@@ -71,6 +71,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, j, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); render_copy =get_render_copyfunc (intel_get_drm_devid (fd));
tests/gem_ringfill.c +1 -0
@@ -206,6 +206,7 @@ int main(int argc, char **argv)int fd, fails =0 ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();
tests/gem_seqno_wrap.c +2 -0
@@ -647,6 +647,8 @@ int main(int argc, char **argv)int wcount =0 ;int r =-1 ; +drmtest_skip_on_simulation (); +parse_options (argc, argv); card_index =drm_get_card (0 );
tests/gem_set_tiling_vs_blt.c +1 -0
@@ -234,6 +234,7 @@ int main(int argc, char **argv)uint32_t tiling, tiling_after;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();for (i =0 ; i <1024 *256 ; i++) data[i] = i;
tests/gem_set_tiling_vs_gtt.c +2 -0
@@ -58,6 +58,8 @@ int main(int argc, char **argv)bool tiling_changed;int tile_height; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (IS_GEN2 (intel_get_drm_devid (fd)))
tests/gem_set_tiling_vs_pwrite.c +2 -0
@@ -56,6 +56,8 @@ int main(int argc, char **argv)int i;uint32_t handle; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (i =0 ; i <OBJECT_SIZE /4 ; i++)
tests/gem_storedw_batches_loop.c +2 -0
@@ -137,6 +137,8 @@ int main(int argc, char **argv)int fd;int devid; +drmtest_skip_on_simulation (); +if (argc !=1 ) {fprintf (stderr,"usage: %s\n" , argv[0 ]);exit (-1 );
tests/gem_threaded_access_tiled.c +2 -0
@@ -95,6 +95,8 @@ int main(int argc, char **argv)unsigned long pitch =0 ;int r; +drmtest_skip_on_simulation (); + fd =drm_open_any ();assert (fd >=0 );
tests/gem_tiled_fence_blits.c +2 -0
@@ -108,6 +108,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int fd, i, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); count =3 *gem_aperture_size (fd) / (1024 *1024 ) /2 ;if (count >intel_get_total_ram_mb () *9 /10 ) {
tests/gem_tiled_partial_pwrite_pread.c +1 -0
@@ -277,6 +277,7 @@ int main(int argc, char **argv)uint32_t tiling_mode =I915_TILING_X ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();srandom (0xdeadbeef );
tests/gem_tiled_pread.c +2 -0
@@ -134,6 +134,8 @@ main(int argc, char **argv)uint32_t handle;uint32_t devid; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =create_bo (fd);
tests/gem_tiled_pread_pwrite.c +1 -0
@@ -123,6 +123,7 @@ main(int argc, char **argv)uint32_t handle, handle_target;int count; +drmtest_skip_on_simulation (); fd =drm_open_any (); count =intel_get_total_ram_mb () *9 /10 ;
tests/gem_tiled_swapping.c +2 -0
@@ -101,6 +101,8 @@ main(int argc, char **argv)int count; current_tiling_mode =I915_TILING_X ; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* need slightly more than total ram */ count =intel_get_total_ram_mb () *11 /10 ;
tests/gem_tiling_max_stride.c +2 -0
@@ -81,6 +81,8 @@ int main(int argc, char *argv[])int tile_width =512 ;int tile_height =8 ; +drmtest_skip_on_simulation (); + fd =drm_open_any (); devid =intel_get_drm_devid (fd);
tests/gem_unfence_active_buffers.c +2 -0
@@ -70,6 +70,8 @@ int main(int argc, char **argv)drm_intel_bo *busy_bo, *test_bo;uint32_t tiling =I915_TILING_X ; +drmtest_skip_on_simulation (); +for (i =0 ; i <1024 *256 ; i++) data[i] = i;
tests/gem_unref_active_buffers.c +2 -0
@@ -56,6 +56,8 @@ int main(int argc, char **argv) {int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/gem_vmap_blits.c +2 -0
@@ -262,6 +262,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (!has_vmap (fd)) {
tests/gem_wait_render_timeout.c +2 -0
@@ -122,6 +122,8 @@ int main(int argc, char **argv)bool done = false;int i, iter =1 ; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );
tests/kms_flip.c +1 -0
@@ -1202,6 +1202,7 @@ int main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); drm_fd =drm_open_any ();
tests/prime_nv_api.c +3 -0
@@ -18,6 +18,7 @@#include "nouveau.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" +#include "drmtest.h" #define BO_SIZE (256*1024)
@@ -316,6 +317,8 @@ int main(int argc, char **argv) {int ret; +drmtest_skip_on_simulation (); + ret =find_and_open_devices ();if (ret <0 )return ret;
tests/prime_nv_pcopy.c +1 -0
@@ -1268,6 +1268,7 @@ int main(int argc, char **argv)int ret, failed =0 , run =0 ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); ret =find_and_open_devices ();if (ret <0 )
tests/prime_nv_test.c +1 -0
@@ -511,6 +511,7 @@ int main(int argc, char **argv)return ret;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();if (nouveau_fd ==-1 || intel_fd ==-1 ) {fprintf (stderr,"failed to find intel and nouveau GPU\n" );
tests/prime_self_import.c +1 -0
@@ -197,6 +197,7 @@ int main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();for (i =0 ; i <ARRAY_SIZE (tests); i++) {if (drmtest_run_subtest (tests[i].name))
tests/prime_udl.c +3 -0
@@ -29,6 +29,7 @@#include "intel_bufmgr.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" +#include "drmtest.h" int intel_fd =-1 , udl_fd =-1 ;drm_intel_bufmgr *bufmgr;
@@ -150,6 +151,8 @@ int main(int argc, char **argv) {int ret; +drmtest_skip_on_simulation (); + ret =find_and_open_devices ();if (ret <0 )return ret;
tests/sysfs_edid_timing +2 -0
@@ -5,6 +5,8 @@ # we sometimes take a *really* long time. So let's just check for some reasonable timing here # +[ -n "$INTEL_SIMULATION" ] && exit 77 + TIME1=$(date +%s%N) cat $(find /sys/devices/|grep drm | grep /status) > /dev/null TIME2=$(date +%s%N)
tests/sysfs_rc6_residency.c +2 -0
@@ -63,6 +63,8 @@ int main(int argc, char *argv[])FILE *file;int diff; +drmtest_skip_on_simulation (); +/* Use drm_open_any to verify device existence */ fd =drm_open_any ();close (fd);
tests/sysfs_rps.c +2 -0
@@ -133,6 +133,8 @@ int main(int argc, char *argv[])struct junk *junk = stuff;int fd, ret; +drmtest_skip_on_simulation (); +if (argc >1 ) verbose++;
tests/testdisplay.c +2 -0
@@ -675,6 +675,8 @@ int main(int argc, char **argv)GMainLoop *mainloop;float force_clock; +drmtest_skip_on_simulation (); +enter_exec_path ( argv ); opterr =0 ;
Signature · 1 line
1.8.1.4
Re: [PATCH 09/10] tests: Black list tests we don't want to run on simulation
Quoted 17 lines · Damien Lespiau
Let's start by a small set of tests, to eventually consider running more.
The current list should then be:
gem_mmapgem_pread_after_blitgem_ring_sync_loopgem_ctx_basicgem_pipe_control_store_loopgem_storedw_loop_rendergem_storedw_loop_bltgem_storedw_loop_bsdgem_render_linear_blitsgem_tiled_blitsgem_cpu_reloc
Quoted 4 lines
gem_exec_nopgem_mmap_gttSigned-off-by Damien Lespiau <[email protected]>
Series is acked, a few comments below for more tests to include. Feel free to ignore (for the first round at least).
Cheers, Daniel
[Comments reference the test right above them.]
Quoted 10 lines
--- tests/drm_lib.sh | 5 +++++ tests/drm_vma_limiter.c | 2 ++ tests/drm_vma_limiter_cached.c | 2 ++ tests/drm_vma_limiter_cpu.c | 2 ++ tests/drm_vma_limiter_gtt.c | 2 ++ tests/gem_bad_length.c | 2 ++ tests/gem_cacheing.c | 1 + tests/gem_cpu_concurrent_blit.c | 1 + tests/gem_cs_prefetch.c | 2 ++
Quoted 8 lines
tests/gem_cs_tlb.c | 1 + tests/gem_ctx_bad_destroy.c | 2 ++ tests/gem_ctx_bad_exec.c | 3 +++ tests/gem_ctx_create.c | 2 ++ tests/gem_ctx_exec.c | 3 +++ tests/gem_double_irq_loop.c | 2 ++ tests/gem_dummy_reloc_loop.c | 1 + tests/gem_exec_bad_domains.c | 1 +
Low overhead, should imo be run in simulation.
Quoted 3 lines
tests/gem_exec_big.c | 2 ++ tests/gem_exec_blt.c | 2 ++ tests/gem_exec_faulting_reloc.c | 2 ++
Same.
Quoted 4 lines
tests/gem_exec_lut_handle.c | 2 ++ tests/gem_fence_thrash.c | 1 + tests/gem_fenced_exec_thrash.c | 12 +++++++++--- tests/gem_flink.c | 1 +
Same.
Quoted 7 lines
tests/gem_gtt_concurrent_blit.c | 1 + tests/gem_gtt_cpu_tlb.c | 2 ++ tests/gem_gtt_speed.c | 2 ++ tests/gem_hangcheck_forcewake.c | 2 ++ tests/gem_largeobject.c | 2 ++ tests/gem_linear_blits.c | 2 ++ tests/gem_lut_handle.c | 2 ++
Tons of tiny batches to exercise api corner-cases. Imo worthwile with reduced loop rounds.
Quoted 6 lines
tests/gem_mmap_offset_exhaustion.c | 2 ++ tests/gem_partial_pwrite_pread.c | 1 + tests/gem_pin.c | 2 ++ tests/gem_pwrite.c | 2 ++ tests/gem_readwrite.c | 2 ++ tests/gem_reg_read.c | 2 ++
Tiny api test, should be included imo.
Quoted 1 line
tests/gem_reloc_overflow.c | 2 ++
Same.
Quoted 4 lines
tests/gem_reloc_vs_gpu.c | 2 ++ tests/gem_render_tiled_blits.c | 2 ++ tests/gem_ringfill.c | 1 + tests/gem_seqno_wrap.c | 2 ++
Maybe with reduced default rounds. It's a bit expensive, but imo pretty important ...
Quoted 10 lines
tests/gem_set_tiling_vs_blt.c | 1 + tests/gem_set_tiling_vs_gtt.c | 2 ++ tests/gem_set_tiling_vs_pwrite.c | 2 ++ tests/gem_storedw_batches_loop.c | 2 ++ tests/gem_threaded_access_tiled.c | 2 ++ tests/gem_tiled_fence_blits.c | 2 ++ tests/gem_tiled_partial_pwrite_pread.c | 1 + tests/gem_tiled_pread.c | 2 ++ tests/gem_tiled_pread_pwrite.c | 1 + tests/gem_tiled_swapping.c | 2 ++
I think we should include some of the tiled tests. tiled_pread + tiled_pread_pwrite should give us coverage for tiling screw-ups without hunting endlessly for cache coherency issues or trying to force the full working set through swap. tiled_pread_pwrite definitely needs fewer rounds (the high number is to hunt for L-shaped memory architectures, which luckily is a thing of the past now).
Quoted 1 line
tests/gem_tiling_max_stride.c | 2 ++
Interface test, should be included imo.
Quoted 5 lines
tests/gem_unfence_active_buffers.c | 2 ++ tests/gem_unref_active_buffers.c | 2 ++ tests/gem_vmap_blits.c | 2 ++ tests/gem_wait_render_timeout.c | 2 ++ tests/kms_flip.c | 1 +
Maybe a reduced flip test, i.e. just basic flips, 10 rounds or so? Most of this just tests races against bazillion different things, so not too interesting.
Quoted 4 lines
tests/prime_nv_api.c | 3 +++ tests/prime_nv_pcopy.c | 1 + tests/prime_nv_test.c | 1 + tests/prime_self_import.c | 1 +
Again interface tests, imo good to include.
Quoted 4 lines
tests/prime_udl.c | 3 +++ tests/sysfs_edid_timing | 2 ++ tests/sysfs_rc6_residency.c | 2 ++ tests/sysfs_rps.c | 2 ++
Same. Or do we presume that turbo isn't working anyway?
Quoted 893 lines
tests/testdisplay.c | 2 ++ 67 files changed, 131 insertions(+), 3 deletions(-)tests/drm_lib.sh +5
-0@@ -29,4 +29,9 @@ if [ `cat $i915_path/clients | wc -l` -gt "2" ] ; then die "ERROR: other drm clients running" fi +function drmtest_skip_on_simulation() +{ + [ -n "$INTEL_SIMULATION" ] && exit 77 +} +drmtest_skip_on_simulationtests/drm_vma_limiter.c +2
-0@@ -60,6 +60,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/drm_vma_limiter_cached.c +2
-0@@ -61,6 +61,8 @@ int main(int argc, char **argv)char *ptr;drm_intel_bo *load_bo; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/drm_vma_limiter_cpu.c +2
-0@@ -61,6 +61,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/drm_vma_limiter_gtt.c +2
-0@@ -62,6 +62,8 @@ int main(int argc, char **argv)int i;char *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/gem_bad_length.c +2
-0@@ -124,6 +124,8 @@ int main(int argc, char **argv) {int fd; +drmtest_skip_on_simulation (); + fd =drm_open_any ();create0 (fd);tests/gem_cacheing.c +1
-0@@ -113,6 +113,7 @@ int main(int argc, char **argv)bool skipped_all = true;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();srandom (0xdeadbeef );tests/gem_cpu_concurrent_blit.c +1
-0@@ -99,6 +99,7 @@ main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_cs_prefetch.c +2
-0@@ -96,6 +96,8 @@ int main(int argc, char **argv)int count;drm_intel_bo *sample_batch_bo; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/gem_cs_tlb.c +1
-0@@ -152,6 +152,7 @@ int main(int argc, char **argv)uint32_t devid;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any (); devid =intel_get_drm_devid (fd);tests/gem_ctx_bad_destroy.c +2
-0@@ -80,6 +80,8 @@ int main(int argc, char *argv[])uint32_t ctx_id;int ret, fd; +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);tests/gem_ctx_bad_exec.c +3
-0@@ -111,6 +111,9 @@ int main(int argc, char *argv[])uint32_t batch[2 ] = {MI_BATCH_BUFFER_END };uint32_t ctx_id;int fd; + +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);tests/gem_ctx_create.c +2
-0@@ -42,6 +42,8 @@ int main(int argc, char *argv[])int ret, fd;struct local_drm_i915_gem_context_create create; +drmtest_skip_on_simulation (); + create.ctx_id =rand (); create.pad =rand ();tests/gem_ctx_exec.c +3
-0@@ -122,6 +122,9 @@ int main(int argc, char *argv[])uint32_t batch[2 ] = {0 ,MI_BATCH_BUFFER_END };uint32_t ctx_id;int fd; + +drmtest_skip_on_simulation (); + fd =drm_open_any (); ctx_id =context_create (fd);tests/gem_double_irq_loop.c +2
-0@@ -98,6 +98,8 @@ int main(int argc, char **argv)int fd;int devid; +drmtest_skip_on_simulation (); +if (argc !=1 ) {fprintf (stderr,"usage: %s\n" , argv[0 ]);exit (-1 );tests/gem_dummy_reloc_loop.c +1
-0@@ -128,6 +128,7 @@ int main(int argc, char **argv)int devid;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any (); devid =intel_get_drm_devid (fd);tests/gem_exec_bad_domains.c +1
-0@@ -157,6 +157,7 @@ int main(int argc, char **argv)drm_intel_bo *tmp;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_exec_big.c +2
-0@@ -108,6 +108,8 @@ int main(int argc, char **argv)uint32_t reloc_ofs;unsigned batch_size; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (batch_size =BATCH_SIZE /4 ; batch_size <=BATCH_SIZE ; batch_size +=4096 ) {tests/gem_exec_blt.c +2
-0@@ -250,6 +250,8 @@ int main(int argc, char **argv) {int i; +drmtest_skip_on_simulation (); +if (argc >1 ) {for (i =1 ; i < argc; i++) {int object_size =atoi (argv[i]);tests/gem_exec_faulting_reloc.c +2
-0@@ -220,6 +220,8 @@ static void run(int object_size)int main (int argc,char **argv) { +drmtest_skip_on_simulation (); +run (OBJECT_SIZE );return 0 ;tests/gem_exec_lut_handle.c +2
-0@@ -127,6 +127,8 @@ int main(int argc, char **argv) { .name = NULL }, }, *p; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (n =0 ; n <MAX_NUM_EXEC ; n++) {tests/gem_fence_thrash.c +1
-0@@ -208,6 +208,7 @@ int main(int argc, char **argv) {drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();if (drmtest_run_subtest ("bo-write-verify-none" ))assert (run_test (0 , bo_write_verify,I915_TILING_NONE ,80 ) ==0 );tests/gem_fenced_exec_thrash.c +9
-3@@ -159,9 +159,15 @@ static void run_test(int fd, int num_fences, int expected_errno)int main (int argc,char **argv) { -int fd =drm_open_any (); -int num_fences =get_num_fences (fd); -uint32_t devid =intel_get_drm_devid (fd); +int fd; +int num_fences; +uint32_t devid; + +drmtest_skip_on_simulation (); + + fd =drm_open_any (); + num_fences =get_num_fences (fd); + devid =intel_get_drm_devid (fd);assert (num_fences <=MAX_FENCES );tests/gem_flink.c +1
-0@@ -155,6 +155,7 @@ int main(int argc, char **argv)int fd;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_gtt_concurrent_blit.c +1
-0@@ -102,6 +102,7 @@ main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_gtt_cpu_tlb.c +2
-0@@ -77,6 +77,8 @@ main(int argc, char **argv)uint32_t *ptr; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,OBJ_SIZE );tests/gem_gtt_speed.c +2
-0@@ -61,6 +61,8 @@ int main(int argc, char **argv)int loop, i, tiling;int fd; +drmtest_skip_on_simulation (); +if (argc >1 ) size =atoi (argv[1 ]);if (size ==0 ) {tests/gem_hangcheck_forcewake.c +2
-0@@ -65,6 +65,8 @@ int main(int argc, char **argv)unsigned long pitch, act_size;int fd, i, devid; +drmtest_skip_on_simulation (); +memset (blob,'A' ,sizeof (blob)); fd =drm_open_any ();tests/gem_largeobject.c +2
-0@@ -87,6 +87,8 @@ int main(int argc, char **argv) {int fd; +drmtest_skip_on_simulation (); + fd =drm_open_any ();test_large_object (fd);tests/gem_linear_blits.c +2
-0@@ -182,6 +182,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); count =0 ;tests/gem_lut_handle.c +2
-0@@ -179,6 +179,8 @@ int main(int argc, char **argv)uint32_t handle;int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,4096 );tests/gem_mmap_offset_exhaustion.c +2
-0@@ -83,6 +83,8 @@ int main(int argc, char **argv) {int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* we have 32bit of address space, so try to fit one MB more tests/gem_partial_pwrite_pread.c +1
-0@@ -258,6 +258,7 @@ int main(int argc, char **argv)srandom (0xdeadbeef );drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_pin.c +2
-0@@ -203,6 +203,8 @@ int main(int argc, char **argv)uint32_t *handle, *offset;int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (!test_can_pin (fd))tests/gem_pwrite.c +2
-0@@ -91,6 +91,8 @@ int main(int argc, char **argv)uint32_t *src, dst;int fd, count; +drmtest_skip_on_simulation (); +if (argc >1 ) object_size =atoi (argv[1 ]);if (object_size ==0 )tests/gem_readwrite.c +2
-0@@ -82,6 +82,8 @@ int main(int argc, char **argv)int ret;int handle; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =gem_create (fd,OBJECT_SIZE );tests/gem_reg_read.c +2
-0@@ -71,6 +71,8 @@ int main(int argc, char *argv[])int ret, fd;uint64_t val; +drmtest_skip_on_simulation (); + fd =drm_open_any (); reg_read.offset =0x2358 ;tests/gem_reloc_overflow.c +2
-0@@ -62,6 +62,8 @@ int main(int argc, char *argv[])struct drm_i915_gem_exec_object2 *execobjs;struct drm_i915_gem_execbuffer2 execbuf = {0 }; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* Create giant reloc buffer area. */ tests/gem_reloc_vs_gpu.c +2
-0@@ -148,6 +148,8 @@ int main(int argc, char **argv)int fd, i, ring;uint32_t test; +drmtest_skip_on_simulation (); +memset (blob,'A' ,sizeof (blob)); fd =drm_open_any ();tests/gem_render_tiled_blits.c +2
-0@@ -71,6 +71,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, j, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); render_copy =get_render_copyfunc (intel_get_drm_devid (fd));tests/gem_ringfill.c +1
-0@@ -206,6 +206,7 @@ int main(int argc, char **argv)int fd, fails =0 ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); fd =drm_open_any ();tests/gem_seqno_wrap.c +2
-0@@ -647,6 +647,8 @@ int main(int argc, char **argv)int wcount =0 ;int r =-1 ; +drmtest_skip_on_simulation (); +parse_options (argc, argv); card_index =drm_get_card (0 );tests/gem_set_tiling_vs_blt.c +1
-0@@ -234,6 +234,7 @@ int main(int argc, char **argv)uint32_t tiling, tiling_after;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();for (i =0 ; i <1024 *256 ; i++) data[i] = i;tests/gem_set_tiling_vs_gtt.c +2
-0@@ -58,6 +58,8 @@ int main(int argc, char **argv)bool tiling_changed;int tile_height; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (IS_GEN2 (intel_get_drm_devid (fd)))tests/gem_set_tiling_vs_pwrite.c +2
-0@@ -56,6 +56,8 @@ int main(int argc, char **argv)int i;uint32_t handle; +drmtest_skip_on_simulation (); + fd =drm_open_any ();for (i =0 ; i <OBJECT_SIZE /4 ; i++)tests/gem_storedw_batches_loop.c +2
-0@@ -137,6 +137,8 @@ int main(int argc, char **argv)int fd;int devid; +drmtest_skip_on_simulation (); +if (argc !=1 ) {fprintf (stderr,"usage: %s\n" , argv[0 ]);exit (-1 );tests/gem_threaded_access_tiled.c +2
-0@@ -95,6 +95,8 @@ int main(int argc, char **argv)unsigned long pitch =0 ;int r; +drmtest_skip_on_simulation (); + fd =drm_open_any ();assert (fd >=0 );tests/gem_tiled_fence_blits.c +2
-0@@ -108,6 +108,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int fd, i, count; +drmtest_skip_on_simulation (); + fd =drm_open_any (); count =3 *gem_aperture_size (fd) / (1024 *1024 ) /2 ;if (count >intel_get_total_ram_mb () *9 /10 ) {tests/gem_tiled_partial_pwrite_pread.c +1
-0@@ -277,6 +277,7 @@ int main(int argc, char **argv)uint32_t tiling_mode =I915_TILING_X ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();srandom (0xdeadbeef );tests/gem_tiled_pread.c +2
-0@@ -134,6 +134,8 @@ main(int argc, char **argv)uint32_t handle;uint32_t devid; +drmtest_skip_on_simulation (); + fd =drm_open_any (); handle =create_bo (fd);tests/gem_tiled_pread_pwrite.c +1
-0@@ -123,6 +123,7 @@ main(int argc, char **argv)uint32_t handle, handle_target;int count; +drmtest_skip_on_simulation (); fd =drm_open_any (); count =intel_get_total_ram_mb () *9 /10 ;tests/gem_tiled_swapping.c +2
-0@@ -101,6 +101,8 @@ main(int argc, char **argv)int count; current_tiling_mode =I915_TILING_X ; +drmtest_skip_on_simulation (); + fd =drm_open_any ();/* need slightly more than total ram */ count =intel_get_total_ram_mb () *11 /10 ;tests/gem_tiling_max_stride.c +2
-0@@ -81,6 +81,8 @@ int main(int argc, char *argv[])int tile_width =512 ;int tile_height =8 ; +drmtest_skip_on_simulation (); + fd =drm_open_any (); devid =intel_get_drm_devid (fd);tests/gem_unfence_active_buffers.c +2
-0@@ -70,6 +70,8 @@ int main(int argc, char **argv)drm_intel_bo *busy_bo, *test_bo;uint32_t tiling =I915_TILING_X ; +drmtest_skip_on_simulation (); +for (i =0 ; i <1024 *256 ; i++) data[i] = i;tests/gem_unref_active_buffers.c +2
-0@@ -56,6 +56,8 @@ int main(int argc, char **argv) {int fd, i; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/gem_vmap_blits.c +2
-0@@ -262,6 +262,8 @@ int main(int argc, char **argv)uint32_t start =0 ;int i, fd, count; +drmtest_skip_on_simulation (); + fd =drm_open_any ();if (!has_vmap (fd)) {tests/gem_wait_render_timeout.c +2
-0@@ -122,6 +122,8 @@ int main(int argc, char **argv)bool done = false;int i, iter =1 ; +drmtest_skip_on_simulation (); + fd =drm_open_any (); bufmgr =drm_intel_bufmgr_gem_init (fd,4096 );tests/kms_flip.c +1
-0@@ -1202,6 +1202,7 @@ int main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); drm_fd =drm_open_any ();tests/prime_nv_api.c +3
-0@@ -18,6 +18,7 @@#include "nouveau.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" +#include "drmtest.h" #define BO_SIZE (256*1024)@@ -316,6 +317,8 @@ int main(int argc, char **argv) {int ret; +drmtest_skip_on_simulation (); + ret =find_and_open_devices ();if (ret <0 )return ret;tests/prime_nv_pcopy.c +1
-0@@ -1268,6 +1268,7 @@ int main(int argc, char **argv)int ret, failed =0 , run =0 ;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation (); ret =find_and_open_devices ();if (ret <0 )tests/prime_nv_test.c +1
-0@@ -511,6 +511,7 @@ int main(int argc, char **argv)return ret;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();if (nouveau_fd ==-1 || intel_fd ==-1 ) {fprintf (stderr,"failed to find intel and nouveau GPU\n" );tests/prime_self_import.c +1
-0@@ -197,6 +197,7 @@ int main(int argc, char **argv)int i;drmtest_subtest_init (argc, argv); +drmtest_skip_on_simulation ();for (i =0 ; i <ARRAY_SIZE (tests); i++) {if (drmtest_run_subtest (tests[i].name))tests/prime_udl.c +3
-0@@ -29,6 +29,7 @@#include "intel_bufmgr.h" #include "intel_gpu_tools.h" #include "intel_batchbuffer.h" +#include "drmtest.h" int intel_fd =-1 , udl_fd =-1 ;drm_intel_bufmgr *bufmgr;@@ -150,6 +151,8 @@ int main(int argc, char **argv) {int ret; +drmtest_skip_on_simulation (); + ret =find_and_open_devices ();if (ret <0 )return ret;tests/sysfs_edid_timing +2
-0@@ -5,6 +5,8 @@ # we sometimes take a *really* long time. So let's just check for some reasonable timing here # +[ -n "$INTEL_SIMULATION" ] && exit 77 + TIME1=$(date +%s%N) cat $(find /sys/devices/|grep drm | grep /status) > /dev/null TIME2=$(date +%s%N)tests/sysfs_rc6_residency.c +2
-0@@ -63,6 +63,8 @@ int main(int argc, char *argv[])FILE *file;int diff; +drmtest_skip_on_simulation (); +/* Use drm_open_any to verify device existence */ fd =drm_open_any ();close (fd);tests/sysfs_rps.c +2
-0@@ -133,6 +133,8 @@ int main(int argc, char *argv[])struct junk *junk = stuff;int fd, ret; +drmtest_skip_on_simulation (); +if (argc >1 ) verbose++;tests/testdisplay.c +2
-0@@ -675,6 +675,8 @@ int main(int argc, char **argv)GMainLoop *mainloop;float force_clock; +drmtest_skip_on_simulation (); +enter_exec_path ( argv ); opterr =0 ;Signature · 6 lines
1.8.1.4 _______________________________________________ Intel-gfx mailing list [email protected] http://lists.freedesktop.org/mailman/listinfo/intel-gfx
Signature · 3 lines
Daniel Vetter Software Engineer, Intel Corporation +41 (0) 79 365 57 48 - http://blog.ffwll.ch
PATCH 10/10 tests: Instrument tests run in simulation to run quickly
In reply to Damien LespiauWe tweak the tests marked as runnable in simulation to run more quickly, more often then not at the expense of stress testing (which is of an arguable interest for the initial bring up in simulation). Hopefully the values chosen still test something, which is not always straightforward.
It does run quickly, the number on an IVB machines are:
$ time sudo IGT_SIMULATION=0 ./piglit-run.py tests/igt.tests foo [...] real 2m0.141s user 0m16.365s sys 1m33.382s
Vs.
$ time sudo IGT_SIMULATION=1 ./piglit-run.py tests/igt.tests foo [...] real 0m0.448s user 0m0.226s sys 0m0.183s
--- tests/gem_cpu_reloc.c | 3 +++ tests/gem_ctx_basic.c | 5 +++++ tests/gem_exec_nop.c | 2 +- tests/gem_mmap_gtt.c | 5 ++++- tests/gem_pipe_control_store_loop.c | 2 +- tests/gem_render_linear_blits.c | 6 ++++++ tests/gem_ring_sync_loop.c | 2 +- tests/gem_storedw_batches_loop.c | 8 +++++--- tests/gem_storedw_loop_blt.c | 8 +++++--- tests/gem_storedw_loop_bsd.c | 8 +++++--- tests/gem_storedw_loop_render.c | 8 +++++--- tests/gem_tiled_blits.c | 6 ++++++ 12 files changed, 47 insertions(+), 16 deletions(-)
tests/gem_cpu_reloc.c +3 -0
@@ -153,6 +153,9 @@ int main(int argc, char **argv) } count = aper_size /4096 *2 ; +if (drmtest_run_in_simulation ()) + count =10 ; + handles =malloc (count *sizeof (uint32_t ));assert (handles);
tests/gem_ctx_basic.c +5 -0
@@ -143,6 +143,11 @@ int main(int argc, char *argv[]) fd =drm_open_any (); devid =intel_get_drm_devid (fd); +if (drmtest_run_in_simulation ()) { + num_contexts =2 ; + iter =4 ; + } +parse (argc, argv); threads =calloc (num_contexts,sizeof (*threads));
tests/gem_exec_nop.c +1 -1
@@ -96,7 +96,7 @@ static void loop(int fd, uint32_t handle, unsigned ring_id, const char *ring_nam skipped_all = false; -for (count =1 ; count <=1 <<17 ; count <<=1 ) { +for (count =1 ; count <=SLOW_QUICK (1 <<17 ,1 <<4 ); count <<=1 ) {struct timeval start, end;gettimeofday (&start,NULL );
tests/gem_mmap_gtt.c +4 -1
@@ -40,7 +40,7 @@#include "i915_drm.h" #include "drmtest.h" -#define OBJECT_SIZE (16*1024*1024) +static int OBJECT_SIZE =16 *1024 *1024 ;static void set_domain (int fd,uint32_t handle) {
@@ -148,6 +148,9 @@ int main(int argc, char **argv) {int fd; +if (drmtest_run_in_simulation ()) +OBJECT_SIZE =1 *1024 *1024 ; +drmtest_subtest_init (argc, argv); fd =drm_open_any ();
tests/gem_pipe_control_store_loop.c +1 -1
@@ -70,7 +70,7 @@ store_pipe_control_loop(void)uint32_t *buf;drm_intel_bo *target_bo; -for (i =0 ; i <0x10000 ; i++) { +for (i =0 ; i <SLOW_QUICK (0x10000 ,4 ); i++) {/* we want to check tlb consistency of the pipe_control target, * so get a new buffer every time around */ target_bo =drm_intel_bo_alloc (bufmgr,"target bo" ,4096 ,4096 );
tests/gem_render_linear_blits.c +6 -0
@@ -81,8 +81,11 @@ int main(int argc, char **argv) batch =intel_batchbuffer_alloc (bufmgr,intel_get_drm_devid (fd)); count =0 ; +if (drmtest_run_in_simulation ()) + count =2 ;if (argc >1 ) count =atoi (argv[1 ]); +if (count ==0 ) count =3 *gem_aperture_size (fd) /SIZE /2 ;else if (count <2 ) {
@@ -127,6 +130,9 @@ int main(int argc, char **argv)for (i =0 ; i < count; i++)check_bo (fd, bo[i]->handle, start_val[i]); +if (drmtest_run_in_simulation ()) +return 0 ; +printf ("Cyclic blits, backward...\n" );for (i =0 ; i < count *4 ; i++) {struct scratch_buf src, dst;
tests/gem_ring_sync_loop.c +1 -1
@@ -99,7 +99,7 @@ store_dword_loop(int fd)srandom (0xdeadbeef ); -for (i =0 ; i <0x100000 ; i++) { +for (i =0 ; i <SLOW_QUICK (0x100000 ,10 ); i++) {int ring =random () % num_rings +1 ;if (ring ==I915_EXEC_RENDER ) {
tests/gem_storedw_batches_loop.c +5 -3
@@ -60,7 +60,7 @@ store_dword_loop(int divider)if (!has_ppgtt) cmd |=MI_MEM_VIRTUAL ; -for (i =0 ; i <SLOW_QUICK (0x80000 ,0x10 ); i++) { +for (i =0 ; i <SLOW_QUICK (0x80000 ,4 ); i++) { cmd_bo =drm_intel_bo_alloc (bufmgr,"cmd bo" ,4096 ,4096 );if (!cmd_bo) {fprintf (stderr,"failed to alloc cmd bo\n" );
@@ -172,8 +172,10 @@ int main(int argc, char **argv)store_dword_loop (1 );store_dword_loop (2 ); -store_dword_loop (3 ); -store_dword_loop (5 ); +if (!drmtest_run_in_simulation ()) { +store_dword_loop (3 ); +store_dword_loop (5 ); + }drm_intel_bo_unreference (target_bo);drm_intel_bufmgr_destroy (bufmgr);
tests/gem_storedw_loop_blt.c +5 -3
@@ -63,7 +63,7 @@ store_dword_loop(int divider)if (!has_ppgtt) cmd |=MI_MEM_VIRTUAL ; -for (i =0 ; i <SLOW_QUICK (0x100000 ,0x10 ); i++) { +for (i =0 ; i <SLOW_QUICK (0x100000 ,4 ); i++) {BEGIN_BATCH (4 );OUT_BATCH (cmd);OUT_BATCH (0 );/* reserved */
@@ -150,8 +150,10 @@ int main(int argc, char **argv)store_dword_loop (1 );store_dword_loop (2 ); -store_dword_loop (3 ); -store_dword_loop (5 ); +if (!drmtest_run_in_simulation ()) { +store_dword_loop (3 ); +store_dword_loop (5 ); + }drm_intel_bo_unreference (target_buffer);intel_batchbuffer_free (batch);
tests/gem_storedw_loop_bsd.c +5 -3
@@ -63,7 +63,7 @@ store_dword_loop(int divider)if (!has_ppgtt) cmd |=MI_MEM_VIRTUAL ; -for (i =0 ; i <SLOW_QUICK (0x100000 ,0x10 ); i++) { +for (i =0 ; i <SLOW_QUICK (0x100000 ,4 ); i++) {BEGIN_BATCH (4 );OUT_BATCH (cmd);OUT_BATCH (0 );/* reserved */
@@ -156,8 +156,10 @@ int main(int argc, char **argv)store_dword_loop (1 );store_dword_loop (2 ); -store_dword_loop (3 ); -store_dword_loop (5 ); +if (!drmtest_run_in_simulation ()) { +store_dword_loop (3 ); +store_dword_loop (5 ); + }drm_intel_bo_unreference (target_buffer);intel_batchbuffer_free (batch);
tests/gem_storedw_loop_render.c +5 -3
@@ -63,7 +63,7 @@ store_dword_loop(int divider)if (!has_ppgtt) cmd |=MI_MEM_VIRTUAL ; -for (i =0 ; i <SLOW_QUICK (0x100000 ,0x10 ); i++) { +for (i =0 ; i <SLOW_QUICK (0x100000 ,4 ); i++) {BEGIN_BATCH (4 );OUT_BATCH (cmd);OUT_BATCH (0 );/* reserved */
@@ -144,8 +144,10 @@ int main(int argc, char **argv)store_dword_loop (1 );store_dword_loop (2 ); -store_dword_loop (3 ); -store_dword_loop (5 ); +if (!drmtest_run_in_simulation ()) { +store_dword_loop (3 ); +store_dword_loop (5 ); + }drm_intel_bo_unreference (target_buffer);intel_batchbuffer_free (batch);
tests/gem_tiled_blits.c +6 -0
@@ -127,8 +127,11 @@ int main(int argc, char **argv) fd =drm_open_any (); count =0 ; +if (drmtest_run_in_simulation ()) + count =2 ;if (argc >1 ) count =atoi (argv[1 ]); +if (count ==0 ) { count =3 *gem_aperture_size (fd) / (1024 *1024 ) /2 ; count += (count &1 ) ==0 ;
@@ -175,6 +178,9 @@ int main(int argc, char **argv)for (i =0 ; i < count; i++)check_bo (bo[i], bo_start_val[i]); +if (drmtest_run_in_simulation ()) +return 0 ; +printf ("Cyclic blits, backward...\n" );for (i =0 ; i < count *4 ; i++) {int src = (i+1 ) % count;
Signature · 1 line
1.8.1.4