lib/igt_dummyload: add igt_cork
Subsystems (2)
PATCH v4 1/11 lib/igt_dummyload: add igt_cork
From: Daniele Ceraolo Spurio <[email protected]>
The "cork" bo (imported bo with attached fence) and fence is used in several tests to stall execution. Moving it to a common place makes the codebase cleaner.
Note that the actual test updates is done in follow up patches as it is simpler to do in one go after one more common function is added in the next patch.
v2: don't use new/free naming, don't use dynamic alloc (Chris)
v3: add sw_sync common functions. (Chris)
v4: squash sw_sync and vgem cork structs into one. (Chris)
--- lib/igt_dummyload.c | 121 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_dummyload.h | 32 ++++++++++++++ 2 files changed, 153 insertions(+)
lib/igt_dummyload.c +121 -0
@@ -29,12 +29,14 @@#include <i915_drm.h> #include "igt_core.h" +#include "drmtest.h" #include "igt_dummyload.h" #include "igt_gt.h" #include "intel_chipset.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "sw_sync.h" +#include "igt_vgem.h" /** * SECTION:igt_dummyload
@@ -371,3 +373,122 @@ void igt_terminate_spin_batches(void)igt_spin_batch_end (iter);pthread_mutex_unlock (&list_lock); } + +static uint32_t plug_vgem_handle (struct igt_cork *cork,int fd) +{ +struct vgem_bo bo; +int dmabuf; +uint32_t handle; +struct igt_cork_vgem *vgem_cork = &cork->cork.vgem; + + vgem_cork->device =drm_open_driver (DRIVER_VGEM ); +igt_require (vgem_has_fences (vgem_cork->device)); + + bo.width = bo.height =1 ; + bo.bpp =4 ; +vgem_create (vgem_cork->device, &bo); + vgem_cork->fence =vgem_fence_attach (vgem_cork->device, &bo,VGEM_FENCE_WRITE ); + + dmabuf =prime_handle_to_fd (vgem_cork->device, bo.handle); + handle =prime_fd_to_handle (fd, dmabuf); +close (dmabuf); + +return handle; +} + +static void unplug_vgem_handle (struct igt_cork *cork) +{ +struct igt_cork_vgem *vgem_cork = &cork->cork.vgem; + +igt_assert (vgem_cork->device); + +vgem_fence_signal (vgem_cork->device, vgem_cork->fence); +close (vgem_cork->device); + vgem_cork->device =-1 ; +} + +static uint32_t plug_sync_fd (struct igt_cork *cork) +{ +int fence; +struct igt_cork_sw_sync *sw_sync_cork = &cork->cork.sw_sync; + +igt_require_sw_sync (); + + sw_sync_cork->timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (sw_sync_cork->timeline,1 ); + +return fence; +} + +static void unplug_sync_fd (struct igt_cork *cork) +{ +struct igt_cork_sw_sync *sw_sync_cork = &cork->cork.sw_sync; + +sw_sync_timeline_inc (sw_sync_cork->timeline,1 ); +close (sw_sync_cork->timeline); +} + +/** +* igt_cork_plug: +* @fd: open drm file descriptor +* @method: method to utilize for corking. +* @cork: structure that will be filled with the state of the cork bo. +* Note: this has to match the corking method. +* +* This function provides a mechanism to stall submission. It provides two +* blocking methods: +* +* VGEM_BO. +* Imports a vgem bo with a fence attached to it. This bo can be used as a +* dependency during submission to stall execution until the fence is signaled. +* +* SW_SYNC: +* Creates a timeline and then a fence on that timeline. The fence can be used +* as an input fence to a request, the request will be stalled until the fence +* is signaled. +* +* The parameters required to unblock the execution and to cleanup are stored in +* the provided cork structure. +* +* Returns: +* Handle of the imported BO / Sw sync fence FD. +*/ +uint32_t igt_cork_plug (struct igt_cork *cork,int fd) +{ +igt_assert (cork->cork.fd ==-1 ); + +switch (cork->type) { +case CORK_SYNC_FD : +return plug_sync_fd (cork); + +case CORK_VGEM_HANDLE : +return plug_vgem_handle (cork, fd); + +default : +igt_assert_f (0 ,"Invalid cork type!\n" ); +return 0 ; + } +} + +/** +* igt_cork_unplug: +* @method: method to utilize for corking. +* @cork: cork state from igt_cork_plug() +* +* This function unblocks the execution by signaling the fence attached to the +* imported bo and does the necessary post-processing. +* +* NOTE: the handle returned by igt_cork_plug is not closed during this phase. +*/ +void igt_cork_unplug (struct igt_cork *cork) +{ +switch (cork->type) { +case CORK_SYNC_FD : +unplug_sync_fd (cork); +return ; + +case CORK_VGEM_HANDLE : +unplug_vgem_handle (cork); +return ; + } +}
lib/igt_dummyload.h +32 -0
@@ -61,4 +61,36 @@ void igt_spin_batch_free(int fd, igt_spin_t *spin);void igt_terminate_spin_batches (void ); +enum igt_cork_type { +CORK_SYNC_FD =1 , +CORK_VGEM_HANDLE +}; + +struct igt_cork_vgem { +int device; +uint32_t fence; +}; + +struct igt_cork_sw_sync { +int timeline; +}; + +struct igt_cork { +enum igt_cork_type type; + +union __cork { +int fd; + +struct igt_cork_vgem vgem; +struct igt_cork_sw_sync sw_sync; + } cork; +}; + +#define IGT_CORK (name, cork_type) struct igt_cork name = { .type = cork_type, .cork.fd = -1} +#define IGT_CORK_HANDLE (name) IGT_CORK(name, CORK_VGEM_HANDLE) +#define IGT_CORK_FENCE (name) IGT_CORK(name, CORK_SYNC_FD) + +uint32_t igt_cork_plug (struct igt_cork *cork,int fd); +void igt_cork_unplug (struct igt_cork *cork); +#endif /* __IGT_DUMMYLOAD_H__ */
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 2/11 lib/igt_gt: add intel_measure_ring_size
From: Daniele Ceraolo Spurio <[email protected]>
The logic to measure the ring size is replicated almost identically in several tests. Adding it as a common function will make the code cleaner.
The tests are updated in follow up patches.
v2:
- Move into a new file: 'gem_ring'. (Chris)
v3:
- Rename ring measure function. (Chris)
--- lib/Makefile.sources | 2 + lib/i915/gem_ring.c | 117 +++++++++++++++++++++++++++++++++++++++++++++++++++ lib/i915/gem_ring.h | 36 ++++++++++++++++ lib/meson.build | 2 + 4 files changed, 157 insertions(+) create mode 100644 lib/i915/gem_ring.c create mode 100644 lib/i915/gem_ring.h
lib/Makefile.sources +2 -0
@@ -9,6 +9,8 @@ lib_source_list = \ i915/gem_scheduler.h \ i915/gem_submission.c \ i915/gem_submission.h \ + i915/gem_ring.h \ + i915/gem_ring.c \ i915_3d.h \ i915_reg.h \ i915_pciids.h \
lib/i915/gem_ring.c new file +117 -0
117 lines not on this page · raw message
lib/i915/gem_ring.h new file +36 -0
@@ -0,0 +1,36 @@ +/* +* Copyright © 2014 Intel Corporation +* +* Permission is hereby granted, free of charge, to any person obtaining a +* copy of this software and associated documentation files (the "Software"), +* to deal in the Software without restriction, including without limitation +* the rights to use, copy, modify, merge, publish, distribute, sublicense, +* and/or sell copies of the Software, and to permit persons to whom the +* Software is furnished to do so, subject to the following conditions: +* +* The above copyright notice and this permission notice (including the next +* paragraph) shall be included in all copies or substantial portions of the +* Software. +* +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL +* THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +* FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS +* IN THE SOFTWARE. +*/ + +#ifndef GEM_RING_H +#define GEM_RING_H + +#include <stdbool.h> + +enum measure_ring_flags { +MEASURE_RING_NEW_CTX =1 +}; + +unsigned int +gem_measure_ring_inflight (int fd,unsigned int engine,enum measure_ring_flags flags); + +#endif /* GEM_RING_H */
lib/meson.build +2 -0
@@ -5,6 +5,7 @@ lib_headers = [ 'i915/gem_context.h', 'i915/gem_scheduler.h', 'i915/gem_submission.h', + 'i915/gem_ring.h', 'i915_3d.h', 'i915_reg.h', 'i915_pciids.h',
@@ -57,6 +58,7 @@ lib_sources = [ 'i915/gem_context.c', 'i915/gem_scheduler.c', 'i915/gem_submission.c', + 'i915/gem_ring.c', 'igt_debugfs.c', 'igt_device.c', 'igt_aux.c',
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v4 02/11] lib/igt_gt: add intel_measure_ring_size
Quoting Antonio Argenziano (2018-02-21 23:19:38)
lib/i915/gem_ring.c line 61
Quoted 10 lines
lib/i915/gem_ring.c new file +10
-0+unsigned int +gem_measure_ring_inflight (int fd,unsigned int engine,enum measure_ring_flags flags) +{ +struct sigaction old_sa, sa = { .sa_handler = alarm_handler }; +struct drm_i915_gem_exec_object2 obj[2 ]; +struct drm_i915_gem_execbuffer2 execbuf; +const uint32_t bbe =MI_BATCH_BUFFER_END ; +unsigned int count, last; +struct itimerval itv; +IGT_CORK_HANDLE (cork);
An improvement we can make here is to iterate over all engines and report the minimum ring size (for engine==-1). Something like,
if (engine == ~0u) {
unsigned int min = ~0u;
for_each_physical_engine(fd, engine) {
unsigned int this = gem_measure_ring_inflight(fd, engine, flags);
if (this < min)
min = this;
}
return min;
}-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v4 02/11] lib/igt_gt: add intel_measure_ring_size
Quoted 14 lines · Chris Wilson
Quoting Antonio Argenziano (2018-02-21 23:19:38)
lib/i915/gem_ring.c line 61
Quoted 10 lines
lib/i915/gem_ring.c new file +10
-0+unsigned int +gem_measure_ring_inflight (int fd,unsigned int engine,enum measure_ring_flags flags) +{ +struct sigaction old_sa, sa = { .sa_handler = alarm_handler }; +struct drm_i915_gem_exec_object2 obj[2 ]; +struct drm_i915_gem_execbuffer2 execbuf; +const uint32_t bbe =MI_BATCH_BUFFER_END ; +unsigned int count, last; +struct itimerval itv; +IGT_CORK_HANDLE (cork);An improvement we can make here is to iterate over all engines and report the minimum ring size (for engine==-1). Something like,
Which would make the usage in some tests more correct. I'll add it to my TODO list.
Thanks,
Antonio
Quoted 12 lines
if (engine == ~0u) {
unsigned int min = ~0u;
for_each_physical_engine(fd, engine) {
unsigned int this = gem_measure_ring_inflight(fd, engine, flags);
if (this < min)
min = this;
}
return min;
}Quoted 2 lines
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 3/11 tests/gem_exec_schedule: use new common functions
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With intel_measure_ring_size and igt_cork added as common utilities we can use them instead of the local copy of those utilities
--- tests/gem_exec_schedule.c | 162 ++++++++++++---------------------------------- 1 file changed, 41 insertions(+), 121 deletions(-)
tests/gem_exec_schedule.c +41 -121
@@ -32,6 +32,7 @@#include "igt_vgem.h" #include "igt_rand.h" #include "igt_sysfs.h" +#include "i915/gem_ring.h" #define LO 0#define HI 1
@@ -102,35 +103,6 @@ static void store_dword(int fd, uint32_t ctx, unsigned ring,gem_close (fd, obj[2 ].handle); } -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -close (c->device); -} -static uint32_t create_highest_priority (int fd) {uint32_t ctx =gem_context_create (fd);
@@ -145,7 +117,7 @@ static uint32_t create_highest_priority(int fd)return ctx; } -static void unplug_show_queue (int fd,struct cork *c,unsigned int engine) +static void unplug_show_queue (int fd,struct igt_cork *c,unsigned int engine) {igt_spin_t *spin[MAX_ELSP_QLEN ];
@@ -155,7 +127,7 @@ static void unplug_show_queue(int fd, struct cork *c, unsigned int engine)gem_context_destroy (fd, ctx); } -unplug (c);/* batches will now be queued on the engine */ +igt_cork_unplug (c);/* batches will now be queued on the engine */ igt_debugfs_dump (fd,"i915_engine_info" );for (int n =0 ; n <ARRAY_SIZE (spin); n++)
@@ -165,19 +137,20 @@ static void unplug_show_queue(int fd, struct cork *c, unsigned int engine)static void fifo (int fd,unsigned ring) { -struct cork cork; -uint32_t scratch; +IGT_CORK_HANDLE (cork); +uint32_t scratch, plug;uint32_t *ptr; scratch =gem_create (fd,4096 ); -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd);/* Same priority, same timeline, final result will be the second eb */ -store_dword (fd,0 , ring, scratch,0 ,1 , cork.handle,0 ); -store_dword (fd,0 , ring, scratch,0 ,2 , cork.handle,0 ); +store_dword (fd,0 , ring, scratch,0 ,1 , plug,0 ); +store_dword (fd,0 , ring, scratch,0 ,2 , plug,0 );unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug); ptr =gem_mmap__gtt (fd, scratch,4096 ,PROT_READ ); gem_set_domain(fd, scratch, /* no write hazard lies! */
@@ -269,8 +242,8 @@ static void smoketest(int fd, unsigned ring, unsigned timeout) static void reorder(int fd, unsigned ring, unsigned flags)#define EQUAL 1 { -struct cork cork; -uint32_t scratch; +IGT_CORK_HANDLE (cork); +uint32_t scratch, plug;uint32_t *ptr;uint32_t ctx[2 ];
@@ -281,15 +254,16 @@ static void reorder(int fd, unsigned ring, unsigned flags)gem_context_set_priority (fd, ctx[HI ], flags &EQUAL ?MIN_PRIO :0 ); scratch =gem_create (fd,4096 ); -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd);/* We expect the high priority context to be executed first, and * so the final result will be value from the low priority context. */ -store_dword (fd, ctx[LO ], ring, scratch,0 , ctx[LO ], cork.handle,0 ); -store_dword (fd, ctx[HI ], ring, scratch,0 , ctx[HI ], cork.handle,0 ); +store_dword (fd, ctx[LO ], ring, scratch,0 , ctx[LO ], plug,0 ); +store_dword (fd, ctx[HI ], ring, scratch,0 , ctx[HI ], plug,0 );unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug);gem_context_destroy (fd, ctx[LO ]);gem_context_destroy (fd, ctx[HI ]);
@@ -308,10 +282,11 @@ static void reorder(int fd, unsigned ring, unsigned flags)static void promotion (int fd,unsigned ring) { -struct cork cork; +IGT_CORK_HANDLE (cork);uint32_t result, dep;uint32_t *ptr;uint32_t ctx[3 ]; +uint32_t plug; ctx[LO ] =gem_context_create (fd);gem_context_set_priority (fd, ctx[LO ],MIN_PRIO );
@@ -325,15 +300,15 @@ static void promotion(int fd, unsigned ring) result =gem_create (fd,4096 ); dep =gem_create (fd,4096 ); -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd);/* Expect that HI promotes LO, so the order will be LO, HI, NOISE. * * fifo would be NOISE, LO, HI. * strict priority would be HI, NOISE, LO */ -store_dword (fd, ctx[NOISE ], ring, result,0 , ctx[NOISE ], cork.handle,0 ); -store_dword (fd, ctx[LO ], ring, result,0 , ctx[LO ], cork.handle,0 ); +store_dword (fd, ctx[NOISE ], ring, result,0 , ctx[NOISE ], plug,0 ); +store_dword (fd, ctx[LO ], ring, result,0 , ctx[LO ], plug,0 );/* link LO <-> HI via a dependency on another buffer */ store_dword (fd, ctx[LO ], ring, dep,0 , ctx[LO ],0 ,I915_GEM_DOMAIN_INSTRUCTION );
@@ -342,6 +317,7 @@ static void promotion(int fd, unsigned ring)store_dword (fd, ctx[HI ], ring, result,0 , ctx[HI ],0 ,0 );unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug);gem_context_destroy (fd, ctx[NOISE ]);gem_context_destroy (fd, ctx[LO ]);
@@ -565,7 +541,8 @@ static void deep(int fd, unsigned ring)const unsigned int nreq =MAX_PRIO -MIN_PRIO ;const unsigned size =ALIGN (4 *nreq,4096 );struct timespec tv = {}; -struct cork cork; +IGT_CORK_HANDLE (cork); +uint32_t plug;uint32_t result, dep[XS ];uint32_t expected =0 ;uint32_t *ptr;
@@ -605,7 +582,7 @@ static void deep(int fd, unsigned ring)gem_sync (fd, result); } -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd);/* Create a deep dependency chain, with a few branches */ for (int n =0 ; n < nreq &&igt_seconds_elapsed (&tv) <8 ; n++) {
@@ -613,7 +590,7 @@ static void deep(int fd, unsigned ring)gem_context_set_priority (fd, context,MAX_PRIO - nreq + n);for (int m =0 ; m <XS ; m++) -store_dword (fd, context, ring, dep[m],4 *n, context, cork.handle,I915_GEM_DOMAIN_INSTRUCTION ); +store_dword (fd, context, ring, dep[m],4 *n, context, plug,I915_GEM_DOMAIN_INSTRUCTION ); }for (int n =0 ; n < nreq &&igt_seconds_elapsed (&tv) <6 ; n++) {
@@ -628,6 +605,7 @@ static void deep(int fd, unsigned ring) }unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug);igt_require (expected);/* too slow */ for (int n =0 ; n <MAX_CONTEXTS ; n++)
@@ -670,71 +648,13 @@ static int __execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)return err; } -static unsigned int measure_ring_size (int fd,unsigned int ring) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count, last; -struct itimerval itv; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (obj +1 ); - execbuf.buffer_count =1 ; - execbuf.flags = ring; -gem_execbuf (fd, &execbuf); -gem_sync (fd, obj[1 ].handle); - -plug (fd, &c); - obj[0 ].handle = c.handle; - - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - execbuf.rsvd1 =gem_context_create (fd); - -sigaction (SIGALRM , &sa,NULL ); - itv.it_interval.tv_sec =0 ; - itv.it_interval.tv_usec =100 ; - itv.it_value.tv_sec =0 ; - itv.it_value.tv_usec =1000 ; -setitimer (ITIMER_REAL , &itv,NULL ); - - last =-1 ; - count =0 ; -do { -if (__execbuf (fd, &execbuf) ==0 ) { - count++; -continue ; - } - -if (last == count) -break ; - - last = count; - }while (1 ); - -memset (&itv,0 ,sizeof (itv)); -setitimer (ITIMER_REAL , &itv,NULL ); - -unplug (&c); -gem_close (fd, obj[1 ].handle); -gem_context_destroy (fd, execbuf.rsvd1); - -return count; -} -static void wide (int fd,unsigned ring) {struct timespec tv = {}; -unsigned int ring_size =measure_ring_size (fd, ring); +unsigned int ring_size =gem_measure_ring_inflight (fd, ring,MEASURE_RING_NEW_CTX ); -struct cork cork; +IGT_CORK_HANDLE (cork); +uint32_t plug;uint32_t result;uint32_t *ptr;uint32_t *ctx;
@@ -746,20 +666,21 @@ static void wide(int fd, unsigned ring) result =gem_create (fd,4 *MAX_CONTEXTS ); -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd);/* Lots of in-order requests, plugged and submitted simultaneously */ for (count =0 ;igt_seconds_elapsed (&tv) <5 && count < ring_size; count++) {for (int n =0 ; n <MAX_CONTEXTS ; n++) { -store_dword (fd, ctx[n], ring, result,4 *n, ctx[n], cork.handle,I915_GEM_DOMAIN_INSTRUCTION ); +store_dword (fd, ctx[n], ring, result,4 *n, ctx[n], plug,I915_GEM_DOMAIN_INSTRUCTION ); } }igt_info ("Submitted %d requests over %d contexts in %.1fms\n" , count,MAX_CONTEXTS ,igt_nsec_elapsed (&tv) *1e-6 );unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug);for (int n =0 ; n <MAX_CONTEXTS ; n++)gem_context_destroy (fd, ctx[n]);
@@ -782,21 +703,20 @@ static void reorder_wide(int fd, unsigned ring)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 execbuf;struct timespec tv = {}; -unsigned int ring_size =measure_ring_size (fd, ring); -struct cork cork; -uint32_t result, target; +unsigned int ring_size =gem_measure_ring_inflight (fd, ring,MEASURE_RING_NEW_CTX ); +IGT_CORK_HANDLE (cork); +uint32_t result, target, plug;uint32_t *found, *expected; result =gem_create (fd,4096 ); target =gem_create (fd,4096 ); - -plug (fd, &cork); + plug =igt_cork_plug (&cork, fd); expected =gem_mmap__cpu (fd, target,0 ,4096 ,PROT_WRITE );gem_set_domain (fd, target,I915_GEM_DOMAIN_CPU ,I915_GEM_DOMAIN_CPU );memset (obj,0 ,sizeof (obj)); - obj[0 ].handle = cork.handle; + obj[0 ].handle = plug; obj[1 ].handle = result; obj[2 ].relocs_ptr =to_user_pointer (&reloc); obj[2 ].relocation_count =1 ;
@@ -864,6 +784,7 @@ static void reorder_wide(int fd, unsigned ring) }unplug_show_queue (fd, &cork, ring); +gem_close (fd, plug); found =gem_mmap__gtt (fd, result,4096 ,PROT_READ ); gem_set_domain(fd, result, /* no write hazard lies! */
@@ -898,7 +819,7 @@ static void test_pi_ringfull(int fd, unsigned int engine)struct drm_i915_gem_exec_object2 obj[2 ];unsigned int last, count;struct itimerval itv; -struct cork c; +IGT_CORK_HANDLE (c);bool *result; result =mmap (NULL ,4096 ,PROT_WRITE ,MAP_SHARED |MAP_ANON ,-1 ,0 );
@@ -920,8 +841,7 @@ static void test_pi_ringfull(int fd, unsigned int engine)gem_sync (fd, obj[1 ].handle);/* Fill the low-priority ring */ -plug (fd, &c); - obj[0 ].handle = c.handle; + obj[0 ].handle =igt_cork_plug (&c, fd); execbuf.buffers_ptr =to_user_pointer (obj); execbuf.buffer_count =2 ;
@@ -995,7 +915,7 @@ static void test_pi_ringfull(int fd, unsigned int engine)igt_assert_f (result[2 ],"High priority child unable to submit within 10ms\n" ); -unplug (&c); +igt_cork_unplug (&c);igt_waitchildren ();gem_context_destroy (fd, execbuf.rsvd1);
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 4/11 tests/gem_exec_fence: use new common functions
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With intel_measure_ring_size and igt_cork added as common utilities we can use them instead of the local copy of those utilities
--- tests/gem_exec_fence.c | 107 ++++++------------------------------------------- 1 file changed, 12 insertions(+), 95 deletions(-)
tests/gem_exec_fence.c +12 -95
@@ -25,6 +25,7 @@#include "igt_sysfs.h" #include "igt_vgem.h" #include "sw_sync.h" +#include "i915/gem_ring.h" #include <sys/ioctl.h> #include <sys/poll.h>
@@ -321,36 +322,6 @@ static void resubmit(int fd, uint32_t handle, unsigned int ring, int count)gem_execbuf (fd, &execbuf); } -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (int fd,struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -gem_close (fd, c->handle); -close (c->device); -} -static void alarm_handler (int sig) { }
@@ -367,62 +338,6 @@ static int __execbuf(int fd, struct drm_i915_gem_execbuffer2 *execbuf)return err; } -static unsigned int measure_ring_size (int fd) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count, last; -struct itimerval itv; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (&obj[1 ]); - execbuf.buffer_count =1 ; -gem_execbuf (fd, &execbuf); -gem_sync (fd, obj[1 ].handle); - -plug (fd, &c); - obj[0 ].handle = c.handle; - - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - -sigaction (SIGALRM , &sa,NULL ); - itv.it_interval.tv_sec =0 ; - itv.it_interval.tv_usec =100 ; - itv.it_value.tv_sec =0 ; - itv.it_value.tv_usec =1000 ; -setitimer (ITIMER_REAL , &itv,NULL ); - - last =-1 ; - count =0 ; -do { -if (__execbuf (fd, &execbuf) ==0 ) { - count++; -continue ; - } - -if (last == count) -break ; - - last = count; - }while (1 ); - -memset (&itv,0 ,sizeof (itv)); -setitimer (ITIMER_REAL , &itv,NULL ); - -unplug (fd, &c); -gem_close (fd, obj[1 ].handle); - -return count; -} -static void test_parallel (int fd,unsigned int master) {const int SCRATCH =0 ;
@@ -437,15 +352,16 @@ static void test_parallel(int fd, unsigned int master)uint32_t batch[16 ];igt_spin_t *spin;unsigned engine; -struct cork c; +IGT_CORK_HANDLE (c); +uint32_t plug;int i, x =0 ; -plug (fd, &c); + plug =igt_cork_plug (&c, fd);/* Fill the queue with many requests so that the next one has to * wait before it can be executed by the hardware. */ - spin =igt_spin_batch_new (fd,0 , master, c.handle); + spin =igt_spin_batch_new (fd,0 , master, plug);resubmit (fd, spin->handle, master,16 );/* Now queue the master request and its secondaries */
@@ -566,7 +482,8 @@ static void test_parallel(int fd, unsigned int master) }/* Unblock the master */ -unplug (fd, &c); +igt_cork_unplug (&c); +gem_close (fd, plug);igt_spin_batch_end (spin);/* Wait for all secondaries to complete. If we used a regular fence
@@ -692,7 +609,7 @@ static void test_long_history(int fd, long ring_size, unsigned flags)unsigned int nengine, n, s;unsigned long limit;int all_fences; -struct cork c; +IGT_CORK_HANDLE (c); limit =-1 ;if (!gem_uses_full_ppgtt (fd))
@@ -727,8 +644,7 @@ static void test_long_history(int fd, long ring_size, unsigned flags) execbuf.buffers_ptr =to_user_pointer (obj); execbuf.buffer_count =2 ; -plug (fd, &c); - obj[0 ].handle = c.handle; + obj[0 ].handle =igt_cork_plug (&c, fd); igt_until_timeout(5) { execbuf.rsvd1 =gem_context_create (fd);
@@ -756,7 +672,7 @@ static void test_long_history(int fd, long ring_size, unsigned flags)if (!--limit)break ; } -unplug (fd, &c); +igt_cork_unplug (&c);igt_info ("History depth = %d\n" ,sync_fence_count (all_fences));
@@ -780,6 +696,7 @@ static void test_long_history(int fd, long ring_size, unsigned flags)gem_sync (fd, obj[1 ].handle);gem_close (fd, obj[1 ].handle); +gem_close (fd, obj[0 ].handle); }static void test_fence_flip (int i915)
@@ -1630,7 +1547,7 @@ igt_mainlong ring_size =0 ; igt_fixture { - ring_size =measure_ring_size (i915) -1 ; + ring_size =gem_measure_ring_inflight (i915,0 ,0 ) -1 ;igt_info ("Ring size: %ld batches\n" , ring_size);igt_require (ring_size);
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 5/11 tests/gem_exec_latency: use new common functions
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With intel_measure_ring_size and igt_cork added as common utilities we can use them instead of the local copy of those utilities
--- tests/gem_exec_latency.c | 99 +++++++----------------------------------------- 1 file changed, 13 insertions(+), 86 deletions(-)
tests/gem_exec_latency.c +13 -86
@@ -41,6 +41,7 @@#include "igt_sysfs.h" #include "igt_vgem.h" +#include "i915/gem_ring.h" #define LOCAL_I915_EXEC_NO_RELOC (1<<11)#define LOCAL_I915_EXEC_HANDLE_LUT (1<<12)
@@ -55,83 +56,6 @@static unsigned int ring_size; -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -close (c->device); -} - -static void alarm_handler (int sig) -{ -} - -static void set_timeout (int seconds) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; - -sigaction (SIGALRM , seconds ? &sa :NULL ,NULL ); -alarm (seconds); -} - -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -return ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , execbuf); -} - -static unsigned int measure_ring_size (int fd) -{ -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -plug (fd, &c); - obj[0 ].handle = c.handle; - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - - count =0 ; -set_timeout (1 ); -while (__execbuf (fd, &execbuf) ==0 ) - count++; -set_timeout (0 ); - -unplug (&c); -gem_close (fd, obj[1 ].handle); - -return count; -} -#define RCS_TIMESTAMP (0x2000 + 0x358) static void latency_on_ring(int fd, unsigned ring, const char *name,
@@ -142,7 +66,7 @@ static void latency_on_ring(int fd,struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_relocation_entry reloc;struct drm_i915_gem_execbuffer2 execbuf; -struct cork c; +IGT_CORK_HANDLE (c);volatile uint32_t *reg;unsigned repeats = ring_size;uint32_t start, end, *map, *results;
@@ -206,8 +130,7 @@ static void latency_on_ring(int fd, }if (flags &CORK ) { -plug (fd, &c); - obj[0 ].handle = c.handle; + obj[0 ].handle =igt_cork_plug (&c, fd); execbuf.buffers_ptr =to_user_pointer (&obj[0 ]); execbuf.buffer_count =3 ; }
@@ -228,7 +151,7 @@ static void latency_on_ring(int fd,igt_assert (reloc.presumed_offset == obj[1 ].offset);if (flags &CORK ) -unplug (&c); +igt_cork_unplug (&c);gem_set_domain (fd, obj[1 ].handle,I915_GEM_DOMAIN_GTT ,0 ); gpu_latency = (results[repeats-1 ] - results[0 ]) / (double )(repeats-1 );
@@ -269,6 +192,8 @@ static void latency_on_ring(int fd,munmap (map,64 *1024 );munmap (results,4096 ); +if (flags &CORK ) +gem_close (fd, obj[0 ].handle);gem_close (fd, obj[1 ].handle);gem_close (fd, obj[2 ].handle); }
@@ -331,7 +256,7 @@ static void latency_from_ring(int fd,for (e = intel_execution_engines; e->name; e++) {igt_spin_t *spin =NULL ; -struct cork c; +IGT_CORK_HANDLE (c);if (e->exec_id ==0 )continue ;
@@ -347,8 +272,7 @@ static void latency_from_ring(int fd, spin =igt_spin_batch_new (fd, ctx[0 ], ring,0 );if (flags &CORK ) { -plug (fd, &c); - obj[0 ].handle = c.handle; + obj[0 ].handle =igt_cork_plug (&c, fd); execbuf.buffers_ptr =to_user_pointer (&obj[0 ]); execbuf.buffer_count =3 ; }
@@ -408,7 +332,7 @@ static void latency_from_ring(int fd, }if (flags &CORK ) -unplug (&c); +igt_cork_unplug (&c);gem_set_domain (fd, obj[1 ].handle,I915_GEM_DOMAIN_GTT ,I915_GEM_DOMAIN_GTT );
@@ -420,6 +344,9 @@ static void latency_from_ring(int fd,munmap (map,64 *1024 );munmap (results,4096 ); + +if (flags &CORK ) +gem_close (fd, obj[0 ].handle);gem_close (fd, obj[1 ].handle);gem_close (fd, obj[2 ].handle);
@@ -441,7 +368,7 @@ igt_maingem_submission_print_method (device); - ring_size =measure_ring_size (device); + ring_size =gem_measure_ring_inflight (device,0 ,0 );igt_info ("Ring size: %d batches\n" , ring_size);igt_require (ring_size >8 ); ring_size -=8 ;/* leave some spare */
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 6/11 tests/gem_wait: use igt_cork
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With igt_cork added as common utility we can use it instead of the local copy
--- tests/gem_wait.c | 58 ++++++++++++++------------------------------------------ 1 file changed, 14 insertions(+), 44 deletions(-)
tests/gem_wait.c +14 -44
@@ -69,51 +69,15 @@ static void invalid_buf(int fd)#define AWAIT 4#define WRITE 8 -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static struct cork plug (int fd,unsigned flags) -{ -struct cork c; -struct vgem_bo bo; -int dmabuf; - -if ((flags & (WRITE |AWAIT )) ==0 ) -return (struct cork ){0 }; - - c.device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c.device, &bo); - c.fence =vgem_fence_attach (c.device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c.device, bo.handle); - c.handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); - -return c; -} - -static void unplug (struct cork *c) -{ -if (!c->device) -return ; - -vgem_fence_signal (c->device, c->fence); -close (c->device); -} -static void basic (int fd,unsigned engine,unsigned flags) { -struct cork cork =plug (fd, flags); -igt_spin_t *spin =igt_spin_batch_new (fd,0 , engine, cork.handle); +IGT_CORK_HANDLE (cork); +uint32_t plug = + flags & (WRITE |AWAIT ) ?igt_cork_plug (&cork, fd) :0 ; +igt_spin_t *spin =igt_spin_batch_new (fd,0 , engine, plug);struct drm_i915_gem_wait wait = { - flags &WRITE ? cork.handle : spin->handle - }; + flags &WRITE ? plug : spin->handle + };igt_assert_eq (__gem_wait (fd, &wait), -ETIME );
@@ -127,7 +91,9 @@ static void basic(int fd, unsigned engine, unsigned flags) timeout =1 ; } -unplug (&cork); +if (flags & (WRITE |AWAIT )) +igt_cork_unplug (&cork); +igt_assert_eq (__gem_wait (fd, &wait), -ETIME );while (__gem_wait (fd, &wait) == -ETIME )
@@ -137,7 +103,9 @@ static void basic(int fd, unsigned engine, unsigned flags)igt_assert_eq (__gem_wait (fd, &wait), -ETIME );igt_assert_eq_s64 (wait.timeout_ns,0 ); -unplug (&cork); +if (flags & (WRITE |AWAIT )) +igt_cork_unplug (&cork); + wait.timeout_ns =0 ;igt_assert_eq (__gem_wait (fd, &wait), -ETIME );
@@ -157,6 +125,8 @@ static void basic(int fd, unsigned engine, unsigned flags)igt_assert (wait.timeout_ns ==0 ); } +if (plug) +gem_close (fd, plug);igt_spin_batch_free (fd, spin); }
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 7/11 tests/gem_eio: use igt_cork
In reply to Antonio ArgenzianoWith igt_cork added as common utility we can use it instead of the local copy
--- tests/gem_eio.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-)
tests/gem_eio.c +4 -6
@@ -365,15 +365,14 @@ static void test_inflight_external(int fd)const uint32_t bbe =MI_BATCH_BUFFER_END ;struct drm_i915_gem_execbuffer2 execbuf;struct drm_i915_gem_exec_object2 obj; -int timeline, fence;igt_spin_t *hang; +uint32_t fence; +IGT_CORK_FENCE (cork); -igt_require_gem (fd);igt_require_sw_sync ();igt_require (gem_has_exec_fence (fd)); - timeline =sw_sync_timeline_create (); - fence =sw_sync_timeline_create_fence (timeline,1 ); + fence =igt_cork_plug (&cork, fd);igt_require (i915_reset_control (false)); hang =__igt_spin_batch_new (fd,0 ,0 ,0 );
@@ -397,7 +396,7 @@ static void test_inflight_external(int fd)gem_sync (fd, hang->handle);/* wedged, with an unready batch */ igt_assert (!gem_bo_busy (fd, hang->handle));igt_assert (gem_bo_busy (fd, obj.handle)); -sw_sync_timeline_inc (timeline,1 );/* only now submit our batches */ +igt_cork_unplug (&cork);/* only now submit our batches */ igt_assert_eq (__gem_wait (fd, obj.handle,-1 ),0 );igt_assert_eq (sync_fence_status (fence), -EIO );
@@ -406,7 +405,6 @@ static void test_inflight_external(int fd)igt_spin_batch_free (fd, hang);igt_assert (i915_reset_control (true));trigger_reset (fd); -close (timeline); }static void test_inflight_internal (int fd)
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 8/11 tests/gem_exec_await: use intel_measure_ring_size
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With intel_measure_ring_size added as common function we can use it instead of the local copy
--- tests/gem_exec_await.c | 91 ++------------------------------------------------ 1 file changed, 2 insertions(+), 89 deletions(-)
tests/gem_exec_await.c +2 -89
@@ -26,6 +26,7 @@#include "igt_rand.h" #include "igt_sysfs.h" #include "igt_vgem.h" +#include "i915/gem_ring.h" #include <sys/ioctl.h> #include <sys/signal.h>
@@ -237,94 +238,6 @@ static void wide(int fd, int ring_size, int timeout, unsigned int flags)free (exec); } -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -close (c->device); -} - -static void alarm_handler (int sig) -{ -} - -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -return ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , execbuf); -} - -static unsigned int measure_ring_size (int fd) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count, last; -struct itimerval itv; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -plug (fd, &c); - obj[0 ].handle = c.handle; - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - -sigaction (SIGALRM , &sa,NULL ); - itv.it_interval.tv_sec =0 ; - itv.it_interval.tv_usec =100 ; - itv.it_value.tv_sec =0 ; - itv.it_value.tv_usec =1000 ; -setitimer (ITIMER_REAL , &itv,NULL ); - - last = count =0 ; -do { -if (__execbuf (fd, &execbuf) ==0 ) { - count++; -continue ; - } - -if (last == count) -break ; - - last = count; - }while (1 ); - -memset (&itv,0 ,sizeof (itv)); -setitimer (ITIMER_REAL , &itv,NULL ); - -unplug (&c); -gem_close (fd, obj[1 ].handle); - -return count; -} - igt_main {int ring_size =0 ;
@@ -336,7 +249,7 @@ igt_mainigt_require_gem (device);gem_submission_print_method (device); - ring_size =measure_ring_size (device) -10 ; + ring_size =gem_measure_ring_inflight (device,0 ,0 ) -10 ;if (!gem_has_execlists (device)) ring_size /=2 ;igt_info ("Ring size: %d batches\n" , ring_size);
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 9/11 tests/gem_ringfill: use intel_measure_ring_size
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
With intel_measure_ring_size added as common function we can use it instead of the local copy
--- tests/gem_ringfill.c | 97 ++-------------------------------------------------- 1 file changed, 2 insertions(+), 95 deletions(-)
tests/gem_ringfill.c +2 -95
@@ -35,6 +35,7 @@#include "igt_device.h" #include "igt_gt.h" #include "igt_vgem.h" +#include "i915/gem_ring.h" #include <signal.h> #include <sys/ioctl.h>
@@ -237,100 +238,6 @@ static void run_test(int fd, unsigned ring, unsigned flags, unsigned timeout)run_test (fd, ring,0 ,0 ); } -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -close (c->device); -} - -static void alarm_handler (int sig) -{ -} - -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -return ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , execbuf); -} - -static unsigned int measure_ring_size (int fd) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count, last; -struct itimerval itv; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (obj +1 ); - execbuf.buffer_count =1 ; -gem_execbuf (fd, &execbuf); -gem_sync (fd, obj[1 ].handle); - -plug (fd, &c); - obj[0 ].handle = c.handle; - - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - -sigaction (SIGALRM , &sa,NULL ); - itv.it_interval.tv_sec =0 ; - itv.it_interval.tv_usec =100 ; - itv.it_value.tv_sec =0 ; - itv.it_value.tv_usec =1000 ; -setitimer (ITIMER_REAL , &itv,NULL ); - - last =-1 ; - count =0 ; -do { -if (__execbuf (fd, &execbuf) ==0 ) { - count++; -continue ; - } - -if (last == count) -break ; - - last = count; - }while (1 ); - -memset (&itv,0 ,sizeof (itv)); -setitimer (ITIMER_REAL , &itv,NULL ); - -unplug (&c); -gem_close (fd, obj[1 ].handle); - -return count; -} -igt_main {const struct {
@@ -365,7 +272,7 @@ igt_main master = true; } - ring_size =measure_ring_size (fd); + ring_size =gem_measure_ring_inflight (fd,0 ,0 );igt_info ("Ring size: %d batches\n" , ring_size);igt_require (ring_size); }
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 10/11 tests/gem_busy: Use intel_measure_ring_size
In reply to Antonio ArgenzianoWith intel_measure_ring_size added as common function we can use it instead of the local copy
--- tests/gem_busy.c | 98 ++------------------------------------------------------ 1 file changed, 2 insertions(+), 96 deletions(-)
tests/gem_busy.c +2 -96
@@ -28,6 +28,7 @@#include "igt.h" #include "igt_rand.h" #include "igt_vgem.h" +#include "i915/gem_ring.h" #define LOCAL_EXEC_NO_RELOC (1<<11)#define PAGE_ALIGN (x) ALIGN(x, 4096)
@@ -299,105 +300,10 @@ static void xchg_u32(void *array, unsigned i, unsigned j) u32[j] = tmp; } -struct cork { -int device; -uint32_t handle; -uint32_t fence; -}; - -static void plug (int fd,struct cork *c) -{ -struct vgem_bo bo; -int dmabuf; - - c->device =drm_open_driver (DRIVER_VGEM ); - - bo.width = bo.height =1 ; - bo.bpp =4 ; -vgem_create (c->device, &bo); - c->fence =vgem_fence_attach (c->device, &bo,VGEM_FENCE_WRITE ); - - dmabuf =prime_handle_to_fd (c->device, bo.handle); - c->handle =prime_fd_to_handle (fd, dmabuf); -close (dmabuf); -} - -static void unplug (struct cork *c) -{ -vgem_fence_signal (c->device, c->fence); -close (c->device); -} - -static void alarm_handler (int sig) -{ -} - -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -return ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , execbuf); -} - -static unsigned int measure_ring_size (int fd) -{ -struct sigaction sa = { .sa_handler = alarm_handler }; -struct drm_i915_gem_exec_object2 obj[2 ]; -struct drm_i915_gem_execbuffer2 execbuf; -const uint32_t bbe =MI_BATCH_BUFFER_END ; -unsigned int count, last; -struct itimerval itv; -struct cork c; - -memset (obj,0 ,sizeof (obj)); - obj[1 ].handle =gem_create (fd,4096 ); -gem_write (fd, obj[1 ].handle,0 , &bbe,sizeof (bbe)); - -memset (&execbuf,0 ,sizeof (execbuf)); - execbuf.buffers_ptr =to_user_pointer (obj +1 ); - execbuf.buffer_count =1 ; -gem_execbuf (fd, &execbuf); -gem_sync (fd, obj[1 ].handle); - -plug (fd, &c); - obj[0 ].handle = c.handle; - - execbuf.buffers_ptr =to_user_pointer (obj); - execbuf.buffer_count =2 ; - -sigaction (SIGALRM , &sa,NULL ); - itv.it_interval.tv_sec =0 ; - itv.it_interval.tv_usec =100 ; - itv.it_value.tv_sec =0 ; - itv.it_value.tv_usec =1000 ; -setitimer (ITIMER_REAL , &itv,NULL ); - - last =-1 ; - count =0 ; -do { -if (__execbuf (fd, &execbuf) ==0 ) { - count++; -continue ; - } - -if (last == count) -break ; - - last = count; - }while (1 ); - -memset (&itv,0 ,sizeof (itv)); -setitimer (ITIMER_REAL , &itv,NULL ); - -unplug (&c); -gem_close (fd, obj[1 ].handle); -gem_quiescent_gpu (fd); - -return count; -} -static void close_race (int fd) {const unsigned int ncpus =sysconf (_SC_NPROCESSORS_ONLN); -const unsigned int nhandles =measure_ring_size (fd) /2 ; +const unsigned int nhandles =gem_measure_ring_inflight (fd,0 ,0 ) /2 ;unsigned int engines[16 ], nengine;unsigned long *control;uint32_t *handles;
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v4 10/11] tests/gem_busy: Use intel_measure_ring_size
Quoting Antonio Argenziano (2018-02-21 23:19:46)
Quoted 5 lines
With
intel_measure_ring_sizeadded as common function we can use it instead of the local copyCc Daniele Ceraolo Spurio <[email protected]>Signed-off-by Antonio Argenziano <[email protected]>
Didn't spot anything of note in the conversions, so 2?-10
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v4 11/11 igt: Use lib gem_execbuf where possible
In reply to Antonio ArgenzianoReplace custom execbuf ioctl wrapper with the ones in lib.
v2:
- Lib execbuf wrapper is not signal handling friendly. (Chris)
--- tests/gem_close_race.c | 3 +-- tests/gem_ctx_exec.c | 15 +++++---------- tests/gem_evict_alignment.c | 7 ++----- tests/gem_exec_bad_domains.c | 6 +----- tests/gem_exec_blt.c | 4 ++-- tests/gem_exec_fence.c | 14 +------------- tests/gem_exec_lut_handle.c | 2 +- tests/gem_exec_params.c | 9 ++------- tests/gem_gtt_hog.c | 2 +- tests/gem_lut_handle.c | 13 ++----------- tests/gem_pwrite_pread.c | 12 ++++++------ tests/gen3_mixed_blits.c | 16 ++-------------- tests/gen3_render_linear_blits.c | 6 +++--- tests/gen3_render_mixed_blits.c | 6 +++--- tests/gen3_render_tiledx_blits.c | 4 ++-- tests/gen3_render_tiledy_blits.c | 6 +++--- tests/pm_rpm.c | 6 +++--- 17 files changed, 40 insertions(+), 91 deletions(-)
tests/gem_close_race.c +1 -2
@@ -119,8 +119,7 @@ static void selfcopy(int fd, uint32_t handle, int loops) gem_pwrite.size =sizeof (buf); gem_pwrite.data_ptr =to_user_pointer (buf);if (drmIoctl (fd,DRM_IOCTL_I915_GEM_PWRITE , &gem_pwrite) ==0 ) { -while (loops-- && -drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf) ==0 ) +while (loops-- &&__gem_execbuf (fd, &execbuf) ==0 ) ; }
tests/gem_ctx_exec.c +5 -10
@@ -52,7 +52,6 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id) {struct drm_i915_gem_execbuffer2 execbuf;struct drm_i915_gem_exec_object2 gem_exec; -int ret =0 ; gem_exec.handle = handle; gem_exec.relocation_count =0 ;
@@ -75,10 +74,7 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id)i915_execbuffer2_set_context_id (execbuf, ctx_id); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); - -return ret; +return __gem_execbuf (fd, &execbuf); }static void big_exec (int fd,uint32_t handle,int ring)
@@ -116,7 +112,7 @@ static void big_exec(int fd, uint32_t handle, int ring) execbuf.buffer_count =1 ;i915_execbuffer2_set_context_id (execbuf, ctx_id1); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);for (i =0 ; i < num_buffers; i++) {uint32_t tmp_handle =gem_create (fd,4096 );
@@ -127,8 +123,7 @@ static void big_exec(int fd, uint32_t handle, int ring) execbuf.buffer_count = i +1 ;/* figure out how many buffers we can exactly fit */ -while (drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf) !=0 ) { +while (__gem_execbuf (fd, &execbuf) !=0 ) { i--;gem_close (fd, gem_exec[i].handle); gem_exec[i].handle = handle;
@@ -140,10 +135,10 @@ static void big_exec(int fd, uint32_t handle, int ring) i - 1, num_buffers);/* double check that it works */ -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);i915_execbuffer2_set_context_id (execbuf, ctx_id2); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_sync (fd, handle); }
tests/gem_evict_alignment.c +2 -5
@@ -61,7 +61,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo,struct drm_i915_gem_exec_object2 *obj;struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int n, ret, i=0 ; +int n, i=0 ; batch[i++] = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
@@ -121,10 +121,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -if (ret) - ret = errno; -igt_assert_eq (ret, error); +igt_assert_eq (__gem_execbuf (fd, &exec), -error);gem_close (fd, handle);free (obj);
tests/gem_exec_bad_domains.c +1 -5
@@ -95,7 +95,6 @@ static void multi_write_domain(int fd)struct drm_i915_gem_exec_object2 exec[2 ];struct drm_i915_gem_relocation_entry reloc[1 ];uint32_t handle, handle_target; -int ret; handle =gem_create (fd,4096 ); handle_target =gem_create (fd,4096 );
@@ -137,10 +136,7 @@ static void multi_write_domain(int fd)i915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); -igt_assert (ret !=0 && errno ==EINVAL ); +igt_assert_eq (__gem_execbuf (fd, &execbuf), -EINVAL );gem_close (fd, handle);gem_close (fd, handle_target);
tests/gem_exec_blt.c +2 -2
@@ -228,12 +228,12 @@ static void run(int object_size, bool dumb) execbuf.flags |=LOCAL_I915_EXEC_HANDLE_LUT ; execbuf.flags |=LOCAL_I915_EXEC_NO_RELOC ; -if (drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf)) { +if (__gem_execbuf (fd, &execbuf)) { len =gem_linear_blt (fd, buf, src, dst, object_size, reloc);igt_assert (len == execbuf.batch_len);gem_write (fd, handle,0 , buf, len); execbuf.flags = ring; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf); }gem_sync (fd, handle);
tests/gem_exec_fence.c +1 -13
@@ -326,18 +326,6 @@ static void alarm_handler(int sig) { } -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -int err; - - err =0 ; -if (ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2_WR , execbuf)) - err = -errno; - - errno =0 ; -return err; -} -static void test_parallel (int fd,unsigned int master) {const int SCRATCH =0 ;
@@ -565,7 +553,7 @@ static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) last =-1 ; count =0 ; do { - int err = __execbuf(fd, &execbuf); + int err = __gem_execbuf(fd, &execbuf); igt_assert_eq(lower_32_bits(execbuf.rsvd2), fence);
tests/gem_exec_lut_handle.c +1 -1
@@ -77,7 +77,7 @@ static int has_exec_lut(int fd) execbuf.buffer_count =1 ; execbuf.flags =LOCAL_I915_EXEC_HANDLE_LUT ; -return drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf) ==0 ; +return __gem_execbuf (fd, &execbuf) ==0 ; }#define ELAPSED (a,b) (1e6*((b)->tv_sec - (a)->tv_sec) + ((b)->tv_usec - (a)->tv_usec))
tests/gem_exec_params.c +2 -7
@@ -233,10 +233,7 @@ igt_main }#define RUN_FAIL (expected_errno) do { \ - igt_assert(drmIoctl(fd, \ - DRM_IOCTL_I915_GEM_EXECBUFFER2, \ - &execbuf) == -1); \ - igt_assert_eq(errno, expected_errno); \ + igt_assert_eq(__gem_execbuf(fd, &execbuf), -expected_errno); \ } while(0) igt_subtest("no-bsd") {
@@ -350,9 +347,7 @@ igt_mainRUN_FAIL (EPERM );igt_device_set_master (fd); -igt_assert (drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf) ==0 ); +gem_execbuf (fd, &execbuf);igt_device_drop_master (fd);/* Only needs temporary master */ }
tests/gem_gtt_hog.c +1 -1
@@ -113,7 +113,7 @@ static void busy(data_t *data, uint32_t handle, int size, int loops) gem_pwrite.data_ptr =to_user_pointer (buf);if (drmIoctl (data->fd,DRM_IOCTL_I915_GEM_PWRITE , &gem_pwrite) ==0 ) {while (loops--) -drmIoctl (data->fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (data->fd, &execbuf); }drmIoctl (data->fd,DRM_IOCTL_GEM_CLOSE , &create.handle);
tests/gem_lut_handle.c +2 -11
@@ -84,12 +84,7 @@ static int exec(int fd, uint32_t handle, unsigned int flags)i915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; -if (drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf)) -return -errno; - -return 0 ; +return __gem_execbuf (fd, &execbuf); }static int many_exec (int fd,uint32_t batch,int num_exec,int num_reloc,unsigned flags)
@@ -156,11 +151,7 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsigni915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); -if (ret <0 ) - ret = -errno; + ret =__gem_execbuf (fd, &execbuf);for (n =0 ; n < num_exec; n++)gem_close (fd, gem_exec[n].handle);
tests/gem_pwrite_pread.c +6 -6
@@ -100,7 +100,7 @@ static void copy(int fd, uint32_t src, uint32_t dst, void *buf, int len, int loowhile (loops--) {gem_write (fd, src,0 , buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_read (fd, dst,0 , buf, len); }
@@ -120,7 +120,7 @@ static void as_gtt_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);memcpy (src_ptr, buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_set_domain (fd, dst,I915_GEM_DOMAIN_GTT ,0 );memcpy (buf, dst_ptr, len);
@@ -145,7 +145,7 @@ static void as_cpu_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);memcpy (src_ptr, buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_set_domain (fd, dst,I915_GEM_DOMAIN_CPU ,0 );memcpy (buf, dst_ptr, len);
@@ -167,7 +167,7 @@ static void test_copy(int fd, uint32_t src, uint32_t dst, uint32_t *buf, int lengem_write (fd, src,0 , buf, len);memset (buf,0 , len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_read (fd, dst,0 , buf, len);gem_close (fd, exec[2 ].handle);
@@ -189,7 +189,7 @@ static void test_as_gtt_mmap(int fd, uint32_t src, uint32_t dst, int len)for (i =0 ; i < len/4 ; i++) src_ptr[i] = i; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_close (fd, exec[2 ].handle);gem_set_domain (fd, dst,I915_GEM_DOMAIN_GTT ,0 );
@@ -213,7 +213,7 @@ static void test_as_cpu_mmap(int fd, uint32_t src, uint32_t dst, int len)for (i =0 ; i < len/4 ; i++) src_ptr[i] = i; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_close (fd, exec[2 ].handle);gem_set_domain (fd, dst,I915_GEM_DOMAIN_CPU ,0 );
tests/gen3_mixed_blits.c +2 -14
@@ -88,7 +88,6 @@ render_copy(int fd,struct drm_i915_gem_execbuffer2 exec;uint32_t handle;uint32_t tiling_bits; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -310,12 +309,7 @@ render_copy(int fd,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
@@ -327,7 +321,6 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int ret; *b++ = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
@@ -388,12 +381,7 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/gen3_render_linear_blits.c +3 -3
@@ -280,10 +280,10 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { + ret =__gem_execbuf (fd, &exec); +while (ret ==EBUSY ) {drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); + ret =__gem_execbuf (fd, &exec); }igt_assert_eq (ret,0 );
tests/gen3_render_mixed_blits.c +3 -3
@@ -293,10 +293,10 @@ copy(int fd,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { + ret =__gem_execbuf (fd, &exec); +while (ret ==EBUSY ) {drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); + ret =__gem_execbuf (fd, &exec); }igt_assert_eq (ret,0 );
tests/gen3_render_tiledx_blits.c +2 -2
@@ -280,10 +280,10 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); + ret =__gem_execbuf (fd, &exec);while (ret && errno ==EBUSY ) {drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); + ret =__gem_execbuf (fd, &exec); }igt_assert_eq (ret,0 );
tests/gen3_render_tiledy_blits.c +3 -3
@@ -280,10 +280,10 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { + ret =__gem_execbuf (fd, &exec); +while (ret ==EBUSY ) {drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); + ret =__gem_execbuf (fd, &exec); }igt_assert_eq (ret,0 );
tests/pm_rpm.c +3 -3
@@ -1116,7 +1116,7 @@ static void submit_blt_cmd(uint32_t dst_handle, uint16_t x, uint16_t y, execbuf.flags =I915_EXEC_BLT ;i915_execbuffer2_set_context_id (execbuf,0 ); -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf); *presumed_dst_offset = relocs[0 ].presumed_offset;
@@ -1257,7 +1257,7 @@ static void gem_execbuf_stress_subtest(int rounds, int wait_flags)i915_execbuffer2_set_context_id (execbuf,0 );for (i =0 ; i < rounds; i++) { -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf);if (wait_flags &WAIT_STATUS )igt_assert (wait_for_suspended ());
@@ -1387,7 +1387,7 @@ static void system_suspend_execbuf_subtest(void)igt_assert (wait_for_suspended ());for (i =0 ; i <20 ; i++) { -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf);igt_assert (wait_for_suspended ()); }
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v4 11/11] igt: Use lib gem_execbuf where possible
Quoting Antonio Argenziano (2018-02-21 23:19:47)
tests/gem_exec_fence.c static void alarm_handler(int sig) · line 335
Quoted 7 lines
tests/gem_exec_fence.c +0
-7-static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -int err; - - err =0 ; -if (ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2_WR , execbuf)) - err = -errno;
Another gotcha, EXECBUFFER2_WR != gem_execbuf()
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v3 1/1 igt: Use lib gem_execbuf where possible
In reply to Antonio ArgenzianoReplace custom execbuf ioctl wrapper with the ones in lib.
v2:
- Lib execbuf wrapper is not signal handling friendly. (Chris)
v3:
- EXECBUFFER2_WR != EXECBUFFER2. (Chris)
--- tests/gem_close_race.c | 3 +-- tests/gem_ctx_exec.c | 15 +++++---------- tests/gem_evict_alignment.c | 7 ++----- tests/gem_exec_bad_domains.c | 6 +----- tests/gem_exec_blt.c | 4 ++-- tests/gem_exec_fence.c | 14 +------------- tests/gem_exec_lut_handle.c | 2 +- tests/gem_exec_params.c | 9 ++------- tests/gem_gtt_hog.c | 2 +- tests/gem_lut_handle.c | 13 ++----------- tests/gem_pwrite_pread.c | 12 ++++++------ tests/gen3_mixed_blits.c | 16 ++-------------- tests/gen3_render_linear_blits.c | 8 +------- tests/gen3_render_mixed_blits.c | 8 +------- tests/gen3_render_tiledx_blits.c | 8 +------- tests/gen3_render_tiledy_blits.c | 8 +------- tests/pm_rpm.c | 6 +++--- 17 files changed, 33 insertions(+), 108 deletions(-)
tests/gem_close_race.c +1 -2
@@ -119,8 +119,7 @@ static void selfcopy(int fd, uint32_t handle, int loops) gem_pwrite.size =sizeof (buf); gem_pwrite.data_ptr =to_user_pointer (buf);if (drmIoctl (fd,DRM_IOCTL_I915_GEM_PWRITE , &gem_pwrite) ==0 ) { -while (loops-- && -drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf) ==0 ) +while (loops-- &&__gem_execbuf (fd, &execbuf) ==0 ) ; }
tests/gem_ctx_exec.c +5 -10
@@ -52,7 +52,6 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id) {struct drm_i915_gem_execbuffer2 execbuf;struct drm_i915_gem_exec_object2 gem_exec; -int ret =0 ; gem_exec.handle = handle; gem_exec.relocation_count =0 ;
@@ -75,10 +74,7 @@ static int exec(int fd, uint32_t handle, int ring, int ctx_id)i915_execbuffer2_set_context_id (execbuf, ctx_id); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); - -return ret; +return __gem_execbuf (fd, &execbuf); }static void big_exec (int fd,uint32_t handle,int ring)
@@ -116,7 +112,7 @@ static void big_exec(int fd, uint32_t handle, int ring) execbuf.buffer_count =1 ;i915_execbuffer2_set_context_id (execbuf, ctx_id1); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);for (i =0 ; i < num_buffers; i++) {uint32_t tmp_handle =gem_create (fd,4096 );
@@ -127,8 +123,7 @@ static void big_exec(int fd, uint32_t handle, int ring) execbuf.buffer_count = i +1 ;/* figure out how many buffers we can exactly fit */ -while (drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf) !=0 ) { +while (__gem_execbuf (fd, &execbuf) !=0 ) { i--;gem_close (fd, gem_exec[i].handle); gem_exec[i].handle = handle;
@@ -140,10 +135,10 @@ static void big_exec(int fd, uint32_t handle, int ring) i - 1, num_buffers);/* double check that it works */ -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);i915_execbuffer2_set_context_id (execbuf, ctx_id2); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_sync (fd, handle); }
tests/gem_evict_alignment.c +2 -5
@@ -61,7 +61,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo,struct drm_i915_gem_exec_object2 *obj;struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int n, ret, i=0 ; +int n, i=0 ; batch[i++] = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
@@ -121,10 +121,7 @@ copy(int fd, uint32_t dst, uint32_t src, uint32_t *all_bo,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -if (ret) - ret = errno; -igt_assert_eq (ret, error); +igt_assert_eq (__gem_execbuf (fd, &exec), -error);gem_close (fd, handle);free (obj);
tests/gem_exec_bad_domains.c +1 -5
@@ -95,7 +95,6 @@ static void multi_write_domain(int fd)struct drm_i915_gem_exec_object2 exec[2 ];struct drm_i915_gem_relocation_entry reloc[1 ];uint32_t handle, handle_target; -int ret; handle =gem_create (fd,4096 ); handle_target =gem_create (fd,4096 );
@@ -137,10 +136,7 @@ static void multi_write_domain(int fd)i915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); -igt_assert (ret !=0 && errno ==EINVAL ); +igt_assert_eq (__gem_execbuf (fd, &execbuf), -EINVAL );gem_close (fd, handle);gem_close (fd, handle_target);
tests/gem_exec_blt.c +2 -2
@@ -228,12 +228,12 @@ static void run(int object_size, bool dumb) execbuf.flags |=LOCAL_I915_EXEC_HANDLE_LUT ; execbuf.flags |=LOCAL_I915_EXEC_NO_RELOC ; -if (drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf)) { +if (__gem_execbuf (fd, &execbuf)) { len =gem_linear_blt (fd, buf, src, dst, object_size, reloc);igt_assert (len == execbuf.batch_len);gem_write (fd, handle,0 , buf, len); execbuf.flags = ring; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf); }gem_sync (fd, handle);
tests/gem_exec_fence.c +1 -13
@@ -326,18 +326,6 @@ static void alarm_handler(int sig) { } -static int __execbuf (int fd,struct drm_i915_gem_execbuffer2 *execbuf) -{ -int err; - - err =0 ; -if (ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2_WR , execbuf)) - err = -errno; - - errno =0 ; -return err; -} -static void test_parallel (int fd,unsigned int master) {const int SCRATCH =0 ;
@@ -565,7 +553,7 @@ static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) last =-1 ; count =0 ; do { - int err = __execbuf(fd, &execbuf); + int err = __gem_execbuf_wr(fd, &execbuf); igt_assert_eq(lower_32_bits(execbuf.rsvd2), fence);
tests/gem_exec_lut_handle.c +1 -1
@@ -77,7 +77,7 @@ static int has_exec_lut(int fd) execbuf.buffer_count =1 ; execbuf.flags =LOCAL_I915_EXEC_HANDLE_LUT ; -return drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf) ==0 ; +return __gem_execbuf (fd, &execbuf) ==0 ; }#define ELAPSED (a,b) (1e6*((b)->tv_sec - (a)->tv_sec) + ((b)->tv_usec - (a)->tv_usec))
tests/gem_exec_params.c +2 -7
@@ -233,10 +233,7 @@ igt_main }#define RUN_FAIL (expected_errno) do { \ - igt_assert(drmIoctl(fd, \ - DRM_IOCTL_I915_GEM_EXECBUFFER2, \ - &execbuf) == -1); \ - igt_assert_eq(errno, expected_errno); \ + igt_assert_eq(__gem_execbuf(fd, &execbuf), -expected_errno); \ } while(0) igt_subtest("no-bsd") {
@@ -350,9 +347,7 @@ igt_mainRUN_FAIL (EPERM );igt_device_set_master (fd); -igt_assert (drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf) ==0 ); +gem_execbuf (fd, &execbuf);igt_device_drop_master (fd);/* Only needs temporary master */ }
tests/gem_gtt_hog.c +1 -1
@@ -113,7 +113,7 @@ static void busy(data_t *data, uint32_t handle, int size, int loops) gem_pwrite.data_ptr =to_user_pointer (buf);if (drmIoctl (data->fd,DRM_IOCTL_I915_GEM_PWRITE , &gem_pwrite) ==0 ) {while (loops--) -drmIoctl (data->fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (data->fd, &execbuf); }drmIoctl (data->fd,DRM_IOCTL_GEM_CLOSE , &create.handle);
tests/gem_lut_handle.c +2 -11
@@ -84,12 +84,7 @@ static int exec(int fd, uint32_t handle, unsigned int flags)i915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; -if (drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf)) -return -errno; - -return 0 ; +return __gem_execbuf (fd, &execbuf); }static int many_exec (int fd,uint32_t batch,int num_exec,int num_reloc,unsigned flags)
@@ -156,11 +151,7 @@ static int many_exec(int fd, uint32_t batch, int num_exec, int num_reloc, unsigni915_execbuffer2_set_context_id (execbuf,0 ); execbuf.rsvd2 =0 ; - ret =drmIoctl (fd, -DRM_IOCTL_I915_GEM_EXECBUFFER2 , - &execbuf); -if (ret <0 ) - ret = -errno; + ret =__gem_execbuf (fd, &execbuf);for (n =0 ; n < num_exec; n++)gem_close (fd, gem_exec[n].handle);
tests/gem_pwrite_pread.c +6 -6
@@ -100,7 +100,7 @@ static void copy(int fd, uint32_t src, uint32_t dst, void *buf, int len, int loowhile (loops--) {gem_write (fd, src,0 , buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_read (fd, dst,0 , buf, len); }
@@ -120,7 +120,7 @@ static void as_gtt_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len, I915_GEM_DOMAIN_GTT, I915_GEM_DOMAIN_GTT);memcpy (src_ptr, buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_set_domain (fd, dst,I915_GEM_DOMAIN_GTT ,0 );memcpy (buf, dst_ptr, len);
@@ -145,7 +145,7 @@ static void as_cpu_mmap(int fd, uint32_t src, uint32_t dst, void *buf, int len, I915_GEM_DOMAIN_CPU, I915_GEM_DOMAIN_CPU);memcpy (src_ptr, buf, len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_set_domain (fd, dst,I915_GEM_DOMAIN_CPU ,0 );memcpy (buf, dst_ptr, len);
@@ -167,7 +167,7 @@ static void test_copy(int fd, uint32_t src, uint32_t dst, uint32_t *buf, int lengem_write (fd, src,0 , buf, len);memset (buf,0 , len); -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_read (fd, dst,0 , buf, len);gem_close (fd, exec[2 ].handle);
@@ -189,7 +189,7 @@ static void test_as_gtt_mmap(int fd, uint32_t src, uint32_t dst, int len)for (i =0 ; i < len/4 ; i++) src_ptr[i] = i; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_close (fd, exec[2 ].handle);gem_set_domain (fd, dst,I915_GEM_DOMAIN_GTT ,0 );
@@ -213,7 +213,7 @@ static void test_as_cpu_mmap(int fd, uint32_t src, uint32_t dst, int len)for (i =0 ; i < len/4 ; i++) src_ptr[i] = i; -do_ioctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (fd, &execbuf);gem_close (fd, exec[2 ].handle);gem_set_domain (fd, dst,I915_GEM_DOMAIN_CPU ,0 );
tests/gen3_mixed_blits.c +2 -14
@@ -88,7 +88,6 @@ render_copy(int fd,struct drm_i915_gem_execbuffer2 exec;uint32_t handle;uint32_t tiling_bits; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -310,12 +309,7 @@ render_copy(int fd,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
@@ -327,7 +321,6 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int ret; *b++ = (XY_SRC_COPY_BLT_CMD | XY_SRC_COPY_BLT_WRITE_ALPHA |
@@ -388,12 +381,7 @@ static void blt_copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/gen3_render_linear_blits.c +1 -7
@@ -85,7 +85,6 @@ copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -280,12 +279,7 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/gen3_render_mixed_blits.c +1 -7
@@ -87,7 +87,6 @@ copy(int fd,struct drm_i915_gem_execbuffer2 exec;uint32_t handle;uint32_t tiling_bits; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -293,12 +292,7 @@ copy(int fd,i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/gen3_render_tiledx_blits.c +1 -7
@@ -84,7 +84,6 @@ copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -280,12 +279,7 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/gen3_render_tiledy_blits.c +1 -7
@@ -84,7 +84,6 @@ copy(int fd, uint32_t dst, uint32_t src)struct drm_i915_gem_exec_object2 obj[3 ];struct drm_i915_gem_execbuffer2 exec;uint32_t handle; -int ret;/* invariant state */ *b++ = (_3DSTATE_AA_CMD |
@@ -280,12 +279,7 @@ copy(int fd, uint32_t dst, uint32_t src)i915_execbuffer2_set_context_id (exec,0 ); exec.rsvd2 =0 ; - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); -while (ret && errno ==EBUSY ) { -drmCommandNone (fd,DRM_I915_GEM_THROTTLE ); - ret =drmIoctl (fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &exec); - } -igt_assert_eq (ret,0 ); +gem_execbuf (fd, &exec);gem_close (fd, handle); }
tests/pm_rpm.c +3 -3
@@ -1116,7 +1116,7 @@ static void submit_blt_cmd(uint32_t dst_handle, uint16_t x, uint16_t y, execbuf.flags =I915_EXEC_BLT ;i915_execbuffer2_set_context_id (execbuf,0 ); -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf); *presumed_dst_offset = relocs[0 ].presumed_offset;
@@ -1257,7 +1257,7 @@ static void gem_execbuf_stress_subtest(int rounds, int wait_flags)i915_execbuffer2_set_context_id (execbuf,0 );for (i =0 ; i < rounds; i++) { -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf);if (wait_flags &WAIT_STATUS )igt_assert (wait_for_suspended ());
@@ -1387,7 +1387,7 @@ static void system_suspend_execbuf_subtest(void)igt_assert (wait_for_suspended ());for (i =0 ; i <20 ; i++) { -do_ioctl (drm_fd,DRM_IOCTL_I915_GEM_EXECBUFFER2 , &execbuf); +gem_execbuf (drm_fd, &execbuf);igt_assert (wait_for_suspended ()); }
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v3] igt: Use lib gem_execbuf where possible
Quoting Antonio Argenziano (2018-02-23 00:54:38)
tests/gem_exec_fence.c static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) · line 556
Quoted 10 lines
tests/gem_exec_fence.c +1
-1@@ -565,7 +553,7 @@ static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) last =-1 ; count =0 ; do { - int err = __execbuf(fd, &execbuf); + int err = __gem_execbuf_wr(fd, &execbuf);
Darn. But this still calls drmIoctl() and we need the EINTR escape. -Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v3] igt: Use lib gem_execbuf where possible
Quoting Chris Wilson (2018-02-23 09:21:11)
Quoted 13 lines
Quoting Antonio Argenziano (2018-02-23 00:54:38)
tests/gem_exec_fence.c static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) · line 556
Quoted 10 lines
tests/gem_exec_fence.c +1
-1@@ -565,7 +553,7 @@ static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) last =-1 ; count =0 ; do { - int err = __execbuf(fd, &execbuf); + int err = __gem_execbuf_wr(fd, &execbuf);Darn. But this still calls
drmIoctl()and we need the EINTR escape.
Dropped the hunks to gem_exec_fence and pushed. Thanks! -Chris
_______________________________________________
igt-dev mailing list [email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Re: [igt-dev] [PATCH i-g-t v3] igt: Use lib gem_execbuf where possible
Quoted 15 lines · Chris Wilson
Quoting Chris Wilson (2018-02-23 09:21:11)
Quoted 13 lines
Quoting Antonio Argenziano (2018-02-23 00:54:38)
tests/gem_exec_fence.c static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) · line 556
Quoted 10 lines
tests/gem_exec_fence.c +1
-1@@ -565,7 +553,7 @@ static void test_keep_in_fence(int fd, unsigned int engine, unsigned int flags) last =-1 ; count =0 ; do { - int err = __execbuf(fd, &execbuf); + int err = __gem_execbuf_wr(fd, &execbuf);Darn. But this still calls
drmIoctl()and we need the EINTR escape.
Quoted 1 line
Dropped the hunks to
gem_exec_fenceand pushed. Thanks!
Thanks for the reviews :).
Antonio
Quoted 2 lines
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Antonio Argenziano (2018-02-21 23:19:37)
lib/igt_dummyload.h void igt_spin_batch_free(int fd, igt_spin_t *spin); · line 86
Quoted 9 lines
lib/igt_dummyload.h +9
-0+struct igt_cork { +enum igt_cork_type type; + +union __cork { +int fd; + +struct igt_cork_vgem vgem; +struct igt_cork_sw_sync sw_sync; + } cork;
Anonymous unions ftw.
Then instead of needing vgem_cork->device, you can just write cork->vgem.device.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v4,01/11] lib/igt_dummyload: add igt_cork
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v4,01/11] lib/igt_dummyload: add igt_cork
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 1ecc978a69a531858ba799425770062ebeb13888 igt/perf_pmu: Use a self-correcting busy pwm
with latest DRM-Tip kernel build CI_DRM_381942016703e66b drm-tip: 2018y-02m-21d-21h-26m-53s UTC integration manifest
No testlist changes.
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS (fi-bxt-dsi) fdo#103927fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:415s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:427s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:375s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:491s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:285s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:479s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:483s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:468s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:460s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:562s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:285s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:510s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:384s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:412s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:453s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:413s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:451s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:492s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:453s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:494s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:588s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:429s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:500s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:520s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:488s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:477s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:409s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:428s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:515s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:395s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_979/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v5 1/1 lib/igt_dummyload: add igt_cork
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
The "cork" bo (imported bo with attached fence) and fence is used in several tests to stall execution. Moving it to a common place makes the codebase cleaner.
Note that the actual test updates is done in follow up patches as it is simpler to do in one go after one more common function is added in the next patch.
v2: don't use new/free naming, don't use dynamic alloc (Chris)
v3: add sw_sync common functions. (Chris)
v4: squash sw_sync and vgem cork structs into one. (Chris)
v5: use anonymous enum in cork struct. (Chris)
--- lib/igt_dummyload.c | 115 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_dummyload.h | 32 +++++++++++++++ 2 files changed, 147 insertions(+)
lib/igt_dummyload.c +115 -0
@@ -29,12 +29,14 @@#include <i915_drm.h> #include "igt_core.h" +#include "drmtest.h" #include "igt_dummyload.h" #include "igt_gt.h" #include "intel_chipset.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "sw_sync.h" +#include "igt_vgem.h" /** * SECTION:igt_dummyload
@@ -371,3 +373,116 @@ void igt_terminate_spin_batches(void)igt_spin_batch_end (iter);pthread_mutex_unlock (&list_lock); } + +static uint32_t plug_vgem_handle (struct igt_cork *cork,int fd) +{ +struct vgem_bo bo; +int dmabuf; +uint32_t handle; + + cork->vgem.device =drm_open_driver (DRIVER_VGEM ); +igt_require (vgem_has_fences (cork->vgem.device)); + + bo.width = bo.height =1 ; + bo.bpp =4 ; +vgem_create (cork->vgem.device, &bo); + cork->vgem.fence =vgem_fence_attach (cork->vgem.device, &bo,VGEM_FENCE_WRITE ); + + dmabuf =prime_handle_to_fd (cork->vgem.device, bo.handle); + handle =prime_fd_to_handle (fd, dmabuf); +close (dmabuf); + +return handle; +} + +static void unplug_vgem_handle (struct igt_cork *cork) +{ +vgem_fence_signal (cork->vgem.device, cork->vgem.fence); +close (cork->vgem.device); + cork->vgem.device =-1 ; +} + +static uint32_t plug_sync_fd (struct igt_cork *cork) +{ +int fence; + +igt_require_sw_sync (); + + cork->sw_sync.timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (cork->sw_sync.timeline,1 ); + +return fence; +} + +static void unplug_sync_fd (struct igt_cork *cork) +{ +sw_sync_timeline_inc (cork->sw_sync.timeline,1 ); +close (cork->sw_sync.timeline); +} + +/** +* igt_cork_plug: +* @fd: open drm file descriptor +* @method: method to utilize for corking. +* @cork: structure that will be filled with the state of the cork bo. +* Note: this has to match the corking method. +* +* This function provides a mechanism to stall submission. It provides two +* blocking methods: +* +* VGEM_BO. +* Imports a vgem bo with a fence attached to it. This bo can be used as a +* dependency during submission to stall execution until the fence is signaled. +* +* SW_SYNC: +* Creates a timeline and then a fence on that timeline. The fence can be used +* as an input fence to a request, the request will be stalled until the fence +* is signaled. +* +* The parameters required to unblock the execution and to cleanup are stored in +* the provided cork structure. +* +* Returns: +* Handle of the imported BO / Sw sync fence FD. +*/ +uint32_t igt_cork_plug (struct igt_cork *cork,int fd) +{ +igt_assert (cork->fd ==-1 ); + +switch (cork->type) { +case CORK_SYNC_FD : +return plug_sync_fd (cork); + +case CORK_VGEM_HANDLE : +return plug_vgem_handle (cork, fd); + +default : +igt_assert_f (0 ,"Invalid cork type!\n" ); +return 0 ; + } +} + +/** +* igt_cork_unplug: +* @method: method to utilize for corking. +* @cork: cork state from igt_cork_plug() +* +* This function unblocks the execution by signaling the fence attached to the +* imported bo and does the necessary post-processing. +* +* NOTE: the handle returned by igt_cork_plug is not closed during this phase. +*/ +void igt_cork_unplug (struct igt_cork *cork) +{ +igt_assert (cork->fd !=-1 ); + +switch (cork->type) { +case CORK_SYNC_FD : +unplug_sync_fd (cork); +return ; + +case CORK_VGEM_HANDLE : +unplug_vgem_handle (cork); +return ; + } +}
lib/igt_dummyload.h +32 -0
@@ -61,4 +61,36 @@ void igt_spin_batch_free(int fd, igt_spin_t *spin);void igt_terminate_spin_batches (void ); +enum igt_cork_type { +CORK_SYNC_FD =1 , +CORK_VGEM_HANDLE +}; + +struct igt_cork_vgem { +int device; +uint32_t fence; +}; + +struct igt_cork_sw_sync { +int timeline; +}; + +struct igt_cork { +enum igt_cork_type type; + +union { +int fd; + +struct igt_cork_vgem vgem; +struct igt_cork_sw_sync sw_sync; + }; +}; + +#define IGT_CORK (name, cork_type) struct igt_cork name = { .type = cork_type, .fd = -1} +#define IGT_CORK_HANDLE (name) IGT_CORK(name, CORK_VGEM_HANDLE) +#define IGT_CORK_FENCE (name) IGT_CORK(name, CORK_SYNC_FD) + +uint32_t igt_cork_plug (struct igt_cork *cork,int fd); +void igt_cork_unplug (struct igt_cork *cork); +#endif /* __IGT_DUMMYLOAD_H__ */
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Quoting Antonio Argenziano (2018-02-22 00:31:44)
Quoted 33 lines
From: Daniele Ceraolo Spurio <[email protected]>
The "cork" bo (imported bo with attached fence) and fence is used in several tests to stall execution. Moving it to a common place makes the codebase cleaner.
Note that the actual test updates is done in follow up patches as it is simpler to do in one go after one more common function is added in the next patch.
v2: don't use new/free naming, don't use dynamic alloc (Chris)
v3: addsw_synccommon functions. (Chris)
v4: squashsw_syncand vgem cork structs into one. (Chris)
v5: use anonymous enum in cork struct. (Chris)Signed-off-by Daniele Ceraolo Spurio <[email protected]>Signed-off-by Antonio Argenziano <[email protected]>Cc Chris Wilson <[email protected]>Cc Daniele Ceraolo Spurio <[email protected]>---
lib/igt_dummyload.c +13
-0+static void unplug_vgem_handle (struct igt_cork *cork) +{ +vgem_fence_signal (cork->vgem.device, cork->vgem.fence); +close (cork->vgem.device); + cork->vgem.device =-1 ; +} + +static uint32_t plug_sync_fd (struct igt_cork *cork) +{ +int fence; + +igt_require_sw_sync (); +
lib/igt_dummyload.c void igt_terminate_spin_batches(void) · line 420
Quoted 10 lines
lib/igt_dummyload.c +10
-0+ cork->sw_sync.timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (cork->sw_sync.timeline,1 ); + +return fence; +} + +static void unplug_sync_fd (struct igt_cork *cork) +{ +sw_sync_timeline_inc (cork->sw_sync.timeline,1 ); +close (cork->sw_sync.timeline);
Either reset fd to -1 here, or don't for vgem. Resetting is handy if we want to reuse the cork (or we may then just move it to init but would need a fini to complete) and ties into the asserts.
-Chris
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
PATCH v6 1/1 lib/igt_dummyload: add igt_cork
In reply to Antonio ArgenzianoFrom: Daniele Ceraolo Spurio <[email protected]>
The "cork" bo (imported bo with attached fence) and fence is used in several tests to stall execution. Moving it to a common place makes the codebase cleaner.
Note that the actual test updates is done in follow up patches as it is simpler to do in one go after one more common function is added in the next patch.
v2: don't use new/free naming, don't use dynamic alloc (Chris)
v3: add sw_sync common functions. (Chris)
v4: squash sw_sync and vgem cork structs into one. (Chris)
v5: use anonymous enum in cork struct. (Chris)
v6: reset cork after unplugging. (Chris)
--- lib/igt_dummyload.c | 119 ++++++++++++++++++++++++++++++++++++++++++++++++++++ lib/igt_dummyload.h | 32 ++++++++++++++ 2 files changed, 151 insertions(+)
lib/igt_dummyload.c +119 -0
@@ -29,12 +29,14 @@#include <i915_drm.h> #include "igt_core.h" +#include "drmtest.h" #include "igt_dummyload.h" #include "igt_gt.h" #include "intel_chipset.h" #include "intel_reg.h" #include "ioctl_wrappers.h" #include "sw_sync.h" +#include "igt_vgem.h" /** * SECTION:igt_dummyload
@@ -371,3 +373,120 @@ void igt_terminate_spin_batches(void)igt_spin_batch_end (iter);pthread_mutex_unlock (&list_lock); } + +static uint32_t plug_vgem_handle (struct igt_cork *cork,int fd) +{ +struct vgem_bo bo; +int dmabuf; +uint32_t handle; + + cork->vgem.device =drm_open_driver (DRIVER_VGEM ); +igt_require (vgem_has_fences (cork->vgem.device)); + + bo.width = bo.height =1 ; + bo.bpp =4 ; +vgem_create (cork->vgem.device, &bo); + cork->vgem.fence =vgem_fence_attach (cork->vgem.device, &bo,VGEM_FENCE_WRITE ); + + dmabuf =prime_handle_to_fd (cork->vgem.device, bo.handle); + handle =prime_fd_to_handle (fd, dmabuf); +close (dmabuf); + +return handle; +} + +static void unplug_vgem_handle (struct igt_cork *cork) +{ +vgem_fence_signal (cork->vgem.device, cork->vgem.fence); +close (cork->vgem.device); +} + +static uint32_t plug_sync_fd (struct igt_cork *cork) +{ +int fence; + +igt_require_sw_sync (); + + cork->sw_sync.timeline =sw_sync_timeline_create (); + fence =sw_sync_timeline_create_fence (cork->sw_sync.timeline,1 ); + +return fence; +} + +static void unplug_sync_fd (struct igt_cork *cork) +{ +sw_sync_timeline_inc (cork->sw_sync.timeline,1 ); +close (cork->sw_sync.timeline); +} + +/** +* igt_cork_plug: +* @fd: open drm file descriptor +* @method: method to utilize for corking. +* @cork: structure that will be filled with the state of the cork bo. +* Note: this has to match the corking method. +* +* This function provides a mechanism to stall submission. It provides two +* blocking methods: +* +* VGEM_BO. +* Imports a vgem bo with a fence attached to it. This bo can be used as a +* dependency during submission to stall execution until the fence is signaled. +* +* SW_SYNC: +* Creates a timeline and then a fence on that timeline. The fence can be used +* as an input fence to a request, the request will be stalled until the fence +* is signaled. +* +* The parameters required to unblock the execution and to cleanup are stored in +* the provided cork structure. +* +* Returns: +* Handle of the imported BO / Sw sync fence FD. +*/ +uint32_t igt_cork_plug (struct igt_cork *cork,int fd) +{ +igt_assert (cork->fd ==-1 ); + +switch (cork->type) { +case CORK_SYNC_FD : +return plug_sync_fd (cork); + +case CORK_VGEM_HANDLE : +return plug_vgem_handle (cork, fd); + +default : +igt_assert_f (0 ,"Invalid cork type!\n" ); +return 0 ; + } +} + +/** +* igt_cork_unplug: +* @method: method to utilize for corking. +* @cork: cork state from igt_cork_plug() +* +* This function unblocks the execution by signaling the fence attached to the +* imported bo and does the necessary post-processing. +* +* NOTE: the handle returned by igt_cork_plug is not closed during this phase. +*/ +void igt_cork_unplug (struct igt_cork *cork) +{ +igt_assert (cork->fd !=-1 ); + +switch (cork->type) { +case CORK_SYNC_FD : +unplug_sync_fd (cork); +break ; + +case CORK_VGEM_HANDLE : +unplug_vgem_handle (cork); +break ; + +default : +igt_assert_f (0 ,"Invalid cork type!\n" ); + } + + cork->fd =-1 ;/* Reset cork */ +}
lib/igt_dummyload.h +32 -0
@@ -61,4 +61,36 @@ void igt_spin_batch_free(int fd, igt_spin_t *spin);void igt_terminate_spin_batches (void ); +enum igt_cork_type { +CORK_SYNC_FD =1 , +CORK_VGEM_HANDLE +}; + +struct igt_cork_vgem { +int device; +uint32_t fence; +}; + +struct igt_cork_sw_sync { +int timeline; +}; + +struct igt_cork { +enum igt_cork_type type; + +union { +int fd; + +struct igt_cork_vgem vgem; +struct igt_cork_sw_sync sw_sync; + }; +}; + +#define IGT_CORK (name, cork_type) struct igt_cork name = { .type = cork_type, .fd = -1} +#define IGT_CORK_HANDLE (name) IGT_CORK(name, CORK_VGEM_HANDLE) +#define IGT_CORK_FENCE (name) IGT_CORK(name, CORK_SYNC_FD) + +uint32_t igt_cork_plug (struct igt_cork *cork,int fd); +void igt_cork_unplug (struct igt_cork *cork); +#endif /* __IGT_DUMMYLOAD_H__ */
Signature · 6 lines
2.14.2 _______________________________________________ igt-dev mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v5] lib/igt_dummyload: add igt_cork (rev2)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v5] lib/igt_dummyload: add igt_cork (rev2)
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
IGT patchset tested on top of latest successful build 1ecc978a69a531858ba799425770062ebeb13888 igt/perf_pmu: Use a self-correcting busy pwm
with latest DRM-Tip kernel build CI_DRM_381942016703e66b drm-tip: 2018y-02m-21d-21h-26m-53s UTC integration manifest
No testlist changes.
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713
Subgroup suspend-read-crc-pipe-c:
incomplete -> PASS (fi-bxt-dsi) fdo#103927
Test prime_vgem:
Subgroup basic-fence-flip:
pass -> FAIL (fi-ilk-650) fdo#104008fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#103927 https://bugs.freedesktop.org/show_bug.cgi?id=103927
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:421s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:425s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:379s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:489s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:286s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:481s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:480s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:468s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:460s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:570s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:414s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:283s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:508s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:395s fi-ilk-650 total:288 pass:227 dwarn:0 dfail:0 fail:1 skip:60 time:409s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:451s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:413s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:452s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:492s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:448s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:495s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:585s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:427s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:505s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:520s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:482s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:495s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:405s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:431s fi-snb-2520m total:245 pass:211 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:393s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_981/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v4,01/11] lib/igt_dummyload: add igt_cork
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v4,01/11] lib/igt_dummyload: add igt_cork
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
Test kms_flip:
Subgroup modeset-vs-vblank-race:
fail -> PASS (shard-hsw) fdo#103060 +3
Subgroup wf_vblank-ts-check-interruptible:
pass -> FAIL (shard-hsw) fdo#100368
Test gem_eio:
Subgroup in-flight-contexts:
pass -> INCOMPLETE (shard-apl) fdo#104945
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
fail -> PASS (shard-snb) fdo#103925
Test kms_plane:
Subgroup plane-panning-bottom-right-suspend-pipe-a-planes:
pass -> INCOMPLETE (shard-hsw) fdo#103540
Test perf:
Subgroup enable-disable:
pass -> FAIL (shard-apl) fdo#103715
Subgroup oa-exponents:
incomplete -> PASS (shard-apl) fdo#102254
Test kms_chv_cursor_fail:
Subgroup pipe-b-128x128-top-edge:
dmesg-warn -> PASS (shard-snb)fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#103715 https://bugs.freedesktop.org/show_bug.cgi?id=103715
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
shard-apl total:3307 pass:1739 dwarn:1 dfail:0 fail:12 skip:1553 time:11827s shard-hsw total:3432 pass:1747 dwarn:1 dfail:0 fail:5 skip:1677 time:11005s shard-snb total:3465 pass:1358 dwarn:1 dfail:0 fail:2 skip:2104 time:6696s
Blacklisted hosts:
shard-kbl total:3465 pass:1962 dwarn:1 dfail:0 fail:14 skip:1488 time:9718s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_979/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: failure for series starting with [i-g-t,v5] lib/igt_dummyload: add igt_cork (rev2)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v5] lib/igt_dummyload: add igt_cork (rev2)
URL : https://patchwork.freedesktop.org/series/38730/
State : failure
== Summary ==
Test kms_flip:
Subgroup wf_vblank-ts-check-interruptible:
pass -> FAIL (shard-apl) fdo#100368 +1
Subgroup modeset-vs-vblank-race-interruptible:
fail -> PASS (shard-apl) fdo#103060 +2
Test kms_atomic_transition:
Subgroup 1x-modeset-transitions-fencing:
pass -> FAIL (shard-apl) fdo#103207
Test kms_chv_cursor_fail:
Subgroup pipe-b-128x128-top-edge:
dmesg-warn -> PASS (shard-snb)
Subgroup pipe-c-128x128-bottom-edge:
pass -> FAIL (shard-apl)
Test gem_tiled_swapping:
Subgroup non-threaded:
pass -> DMESG-FAIL (shard-hsw)
Test gem_eio:
Subgroup in-flight-contexts:
pass -> INCOMPLETE (shard-apl) fdo#104945
Test perf:
Subgroup oa-exponents:
incomplete -> PASS (shard-apl) fdo#102254fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#103207 https://bugs.freedesktop.org/show_bug.cgi?id=103207
fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#102254 https://bugs.freedesktop.org/show_bug.cgi?id=102254
shard-apl total:3344 pass:1755 dwarn:1 dfail:0 fail:15 skip:1571 time:11611s shard-hsw total:3465 pass:1765 dwarn:1 dfail:1 fail:4 skip:1693 time:11591s shard-snb total:3465 pass:1357 dwarn:1 dfail:0 fail:3 skip:2104 time:6692s
Blacklisted hosts:
shard-kbl total:3278 pass:1838 dwarn:19 dfail:1 fail:12 skip:1405 time:8644s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_981/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev3)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev3)
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
IGT patchset tested on top of latest successful build fe4cdd9e734d348be2d518fd0e663bddb886b7f0 tools/aubdump: Signal drm sync objects when device override is used
with latest DRM-Tip kernel build CI_DRM_3826b9f1df86d437 drm-tip: 2018y-02m-22d-18h-25m-51s UTC integration manifest
No testlist changes.
Test gem_mmap_gtt:
Subgroup basic-small-bo-tiledx:
fail -> PASS (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
Subgroup read-crc-pipe-a:
fail -> PASS (fi-skl-6700k2)fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:415s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:427s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:375s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:485s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:285s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:479s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:483s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:472s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:462s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:564s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s fi-gdg-551 total:288 pass:180 dwarn:0 dfail:0 fail:0 skip:108 time:286s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:507s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:386s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:414s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:460s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:411s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:454s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:491s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:450s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:496s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:593s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:428s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:503s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:518s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:494s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:475s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:408s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:429s fi-snb-2520m total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:522s fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:392s
Blacklisted hosts:
fi-cfl-8700k total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:390s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_991/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.BAT: success for series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev4)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev4)
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
IGT patchset tested on top of latest successful build e2e2b4c4d11a1aed2af1079c914e76df4eddbe76 igt: Add VC4 purgeable BO tests
with latest DRM-Tip kernel build CI_DRM_3827f57b51c21b83 drm-tip: 2018y-02m-22d-23h-14m-05s UTC integration manifest
No testlist changes.
Test kms_pipe_crc_basic:
Subgroup suspend-read-crc-pipe-b:
pass -> INCOMPLETE (fi-snb-2520m) fdo#103713fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fi-bdw-5557u total:288 pass:267 dwarn:0 dfail:0 fail:0 skip:21 time:421s fi-bdw-gvtdvm total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:426s fi-blb-e6850 total:288 pass:223 dwarn:1 dfail:0 fail:0 skip:64 time:375s fi-bsw-n3050 total:288 pass:242 dwarn:0 dfail:0 fail:0 skip:46 time:489s fi-bwr-2160 total:288 pass:183 dwarn:0 dfail:0 fail:0 skip:105 time:285s fi-bxt-dsi total:288 pass:258 dwarn:0 dfail:0 fail:0 skip:30 time:478s fi-bxt-j4205 total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:487s fi-byt-j1900 total:288 pass:253 dwarn:0 dfail:0 fail:0 skip:35 time:470s fi-byt-n2820 total:288 pass:249 dwarn:0 dfail:0 fail:0 skip:39 time:458s fi-cfl-s2 total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:565s fi-elk-e7500 total:288 pass:229 dwarn:0 dfail:0 fail:0 skip:59 time:415s fi-gdg-551 total:288 pass:179 dwarn:0 dfail:0 fail:1 skip:108 time:288s fi-glk-1 total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:506s fi-hsw-4770 total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:385s fi-ilk-650 total:288 pass:228 dwarn:0 dfail:0 fail:0 skip:60 time:412s fi-ivb-3520m total:288 pass:259 dwarn:0 dfail:0 fail:0 skip:29 time:442s fi-ivb-3770 total:288 pass:255 dwarn:0 dfail:0 fail:0 skip:33 time:410s fi-kbl-7500u total:288 pass:263 dwarn:1 dfail:0 fail:0 skip:24 time:455s fi-kbl-7560u total:288 pass:269 dwarn:0 dfail:0 fail:0 skip:19 time:494s fi-kbl-7567u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:448s fi-kbl-r total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:497s fi-pnv-d510 total:288 pass:222 dwarn:1 dfail:0 fail:0 skip:65 time:591s fi-skl-6260u total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:430s fi-skl-6600u total:288 pass:261 dwarn:0 dfail:0 fail:0 skip:27 time:502s fi-skl-6700hq total:288 pass:262 dwarn:0 dfail:0 fail:0 skip:26 time:518s fi-skl-6700k2 total:288 pass:264 dwarn:0 dfail:0 fail:0 skip:24 time:489s fi-skl-6770hq total:288 pass:268 dwarn:0 dfail:0 fail:0 skip:20 time:474s fi-skl-guc total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:404s fi-skl-gvtdvm total:288 pass:265 dwarn:0 dfail:0 fail:0 skip:23 time:430s fi-snb-2520m total:245 pass:211 dwarn:0 dfail:0 fail:0 skip:33 fi-snb-2600 total:288 pass:248 dwarn:0 dfail:0 fail:0 skip:40 time:395s
Blacklisted hosts:
fi-cfl-8700k total:288 pass:260 dwarn:0 dfail:0 fail:0 skip:28 time:393s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_992/issues.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✓ Fi.CI.IGT: success for series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev3)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev3)
URL : https://patchwork.freedesktop.org/series/38730/
State : success
== Summary ==
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
pass -> FAIL (shard-snb) fdo#103925 +1
Test kms_flip:
Subgroup 2x-wf_vblank-ts-check:
fail -> PASS (shard-hsw) fdo#100368 +2
Test kms_sysfs_edid_timing:
pass -> WARN (shard-apl) fdo#100047
Test kms_cursor_crc:
Subgroup cursor-64x64-suspend:
pass -> INCOMPLETE (shard-hsw) fdo#103540
Subgroup cursor-256x256-suspend:
pass -> SKIP (shard-snb) fdo#103375
Test kms_frontbuffer_tracking:
Subgroup fbc-1p-primscrn-indfb-msflip-blt:
fail -> PASS (shard-apl) fdo#103167
Test kms_flip_tiling:
Subgroup flip-to-yf-tiled:
fail -> PASS (shard-apl) fdo#103822fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#100047 https://bugs.freedesktop.org/show_bug.cgi?id=100047
fdo#103540 https://bugs.freedesktop.org/show_bug.cgi?id=103540
fdo#103375 https://bugs.freedesktop.org/show_bug.cgi?id=103375
fdo#103167 https://bugs.freedesktop.org/show_bug.cgi?id=103167
fdo#103822 https://bugs.freedesktop.org/show_bug.cgi?id=103822
shard-apl total:3465 pass:1820 dwarn:1 dfail:0 fail:12 skip:1631 time:12412s shard-hsw total:3391 pass:1735 dwarn:1 dfail:0 fail:3 skip:1650 time:11309s shard-snb total:3465 pass:1355 dwarn:1 dfail:0 fail:4 skip:2105 time:6514s
Blacklisted hosts:
shard-kbl total:3465 pass:1925 dwarn:38 dfail:1 fail:13 skip:1488 time:9497s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_991/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev
Patchwork
CI[igt-dev] ✗ Fi.CI.IGT: warning for series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev4)
In reply to Antonio Argenziano== Series Details ==
== Series Details ==
Series: series starting with [i-g-t,v6] lib/igt_dummyload: add igt_cork (rev4)
URL : https://patchwork.freedesktop.org/series/38730/
State : warning
== Summary ==
Test kms_flip:
Subgroup 2x-plain-flip-fb-recreate-interruptible:
fail -> PASS (shard-hsw) fdo#100368 +1
Subgroup dpms-vs-vblank-race:
pass -> FAIL (shard-hsw) fdo#103060 +1
Test gem_eio:
Subgroup in-flight-contexts:
incomplete -> PASS (shard-apl) fdo#104945
Test kms_plane:
Subgroup plane-panning-bottom-right-pipe-b-planes:
pass -> SKIP (shard-snb)
Test kms_plane_lowres:
Subgroup pipe-a-tiling-none:
pass -> SKIP (shard-snb)
Test kms_rotation_crc:
Subgroup sprite-rotation-180:
pass -> FAIL (shard-hsw) fdo#103925
Test kms_cursor_crc:
Subgroup cursor-64x64-suspend:
pass -> SKIP (shard-snb) fdo#102365 +1
Test gem_pwrite:
Subgroup big-cpu-backwards:
pass -> SKIP (shard-apl)fdo#100368 https://bugs.freedesktop.org/show_bug.cgi?id=100368
fdo#103060 https://bugs.freedesktop.org/show_bug.cgi?id=103060
fdo#104945 https://bugs.freedesktop.org/show_bug.cgi?id=104945
fdo#103925 https://bugs.freedesktop.org/show_bug.cgi?id=103925
fdo#102365 https://bugs.freedesktop.org/show_bug.cgi?id=102365
shard-apl total:3465 pass:1819 dwarn:1 dfail:0 fail:13 skip:1632 time:12483s shard-hsw total:3465 pass:1766 dwarn:1 dfail:0 fail:4 skip:1693 time:11534s shard-snb total:3465 pass:1354 dwarn:1 dfail:0 fail:2 skip:2108 time:6571s
Blacklisted hosts:
shard-kbl total:3423 pass:1942 dwarn:1 dfail:0 fail:14 skip:1465 time:9304s
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_992/shards.html
_______________________________________________
igt-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/igt-dev