XE test cleanup to handle xe_device
v4 cover XE test cleanup to handle xe_device
Instead of caching the xe_device struct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver. So, this series introduces new helper drm_close_driver() which helps to remove the xe_device & close the drm fd. So that every user must call drm_close_driver() instead of close().
V2, V3:
- Cleanup
- Split the patches into multiple
V4: - Fix the double closure of fd
Bhanuprakash Modem (24):
lib: Interface to close the drm fd
lib: Cache xe_device at driver open/close level lib/xe/xe_query: Add xe_config() interface lib/igt_msm: Use drm_close_driver() to close the drm fd tests/amdgpu: Close the fd before exit
tests/i915: Close the fd before exit
tests/kms: Close the fd before exit tests/nouveau_crc: Close the fd before exit tests/xe/xe_gpgpu_fill: Close the fd before exit tests/i915/kms_mmap_write_crc: Avoid closing the closed fd tests/i915/gem_close_race: Fix the double closure of fd
tests: Use drm_close_driver() to close the drm fd tests/amdgpu: Use drm_close_driver() to close the drm fd tests/chamelium: Use drm_close_driver() to close the drm fd tests/panfrost: Use drm_close_driver() to close the drm fd tests/v3d: Use drm_close_driver() to close the drm fd tests/vc4: Use drm_close_driver() to close the drm fd tests/vmwgfx: Use drm_close_driver() to close the drm fd tests/kms: Use drm_close_driver() to close the drm fd tests/xe: Use drm_close_driver() to close the drm fd tests/i915: Use drm_close_driver() to close the drm fd tests/xe/xe_debugfs: Use xe_config() helper to get the config
tests: Drop xe_device get/put from test level Revert "lib/igt_kms: Cache xe_device info for kms tests"
lib/drmtest.c | 68 ++++++++++++++++++++- lib/drmtest.h | 1 + lib/igt_kms.c | 8 --- lib/igt_msm.c | 2 +- lib/igt_types.c | 6 ++ lib/igt_vmwgfx.c | 2 +- lib/xe/xe_query.c | 8 +++ lib/xe/xe_query.h | 1 + tests/amdgpu/amd_abm.c | 1 + tests/amdgpu/amd_assr.c | 1 + tests/amdgpu/amd_basic.c | 2 +- tests/amdgpu/amd_cs_nop.c | 2 +- tests/amdgpu/amd_deadlock.c | 2 +- tests/amdgpu/amd_freesync_video_mode.c | 1 + tests/amdgpu/amd_info.c | 2 +- tests/amdgpu/amd_mem_leak.c | 1 + tests/amdgpu/amd_module_load.c | 2 +- tests/amdgpu/amd_prime.c | 6 +- tests/amdgpu/amd_psr.c | 3 +- tests/amdgpu/amd_vrr_range.c | 1 + tests/chamelium/kms_chamelium_audio.c | 2 +- tests/chamelium/kms_chamelium_edid.c | 2 +- tests/chamelium/kms_chamelium_frames.c | 2 +- tests/chamelium/kms_chamelium_hpd.c | 2 +- tests/core_auth.c | 10 +-- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +- tests/core_setmaster_vs_auth.c | 6 +- tests/debugfs_test.c | 2 +- tests/dmabuf_sync_file.c | 3 + tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/i915/api_intel_allocator.c | 6 +- tests/i915/api_intel_bb.c | 2 +- tests/i915/drm_fdinfo.c | 2 +- tests/i915/gem_bad_reloc.c | 2 +- tests/i915/gem_barrier_race.c | 5 +- tests/i915/gem_basic.c | 2 +- tests/i915/gem_blits.c | 2 +- tests/i915/gem_busy.c | 2 +- tests/i915/gem_caching.c | 2 +- tests/i915/gem_ccs.c | 2 +- tests/i915/gem_close_race.c | 14 ++--- tests/i915/gem_concurrent_all.c | 5 ++ tests/i915/gem_cs_tlb.c | 2 +- tests/i915/gem_ctx_bad_destroy.c | 2 +- tests/i915/gem_ctx_create.c | 4 +- tests/i915/gem_ctx_exec.c | 5 +- tests/i915/gem_ctx_freq.c | 3 + tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 6 +- tests/i915/gem_ctx_shared.c | 2 +- tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 19 +++--- tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 2 +- tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_basic.c | 2 +- tests/i915/gem_exec_big.c | 2 +- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_create.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 4 +- tests/i915/gem_exec_flush.c | 2 +- tests/i915/gem_exec_gttfill.c | 4 +- tests/i915/gem_exec_latency.c | 2 +- tests/i915/gem_exec_nop.c | 2 +- tests/i915/gem_exec_parallel.c | 4 +- tests/i915/gem_exec_params.c | 2 +- tests/i915/gem_exec_reloc.c | 2 +- tests/i915/gem_exec_schedule.c | 2 +- tests/i915/gem_exec_store.c | 2 +- tests/i915/gem_exec_suspend.c | 2 +- tests/i915/gem_exec_whisper.c | 6 +- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 2 +- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 4 +- tests/i915/gem_flink_race.c | 6 +- tests/i915/gem_gtt_cpu_tlb.c | 2 +- tests/i915/gem_gtt_hog.c | 2 +- tests/i915/gem_gtt_speed.c | 2 +- tests/i915/gem_huc_copy.c | 2 +- tests/i915/gem_lmem_evict.c | 4 +- tests/i915/gem_lmem_swapping.c | 10 +-- tests/i915/gem_madvise.c | 12 ++-- tests/i915/gem_media_fill.c | 2 +- tests/i915/gem_mmap.c | 2 +- tests/i915/gem_mmap_gtt.c | 6 +- tests/i915/gem_mmap_offset.c | 8 +-- tests/i915/gem_mmap_wc.c | 2 +- tests/i915/gem_partial_pwrite_pread.c | 2 +- tests/i915/gem_pipe_control_store_loop.c | 2 +- tests/i915/gem_ppgtt.c | 8 +-- tests/i915/gem_pread.c | 2 +- tests/i915/gem_pread_after_blit.c | 2 +- tests/i915/gem_pwrite.c | 2 +- tests/i915/gem_pwrite_snooped.c | 2 +- tests/i915/gem_pxp.c | 2 +- tests/i915/gem_read_read_speed.c | 2 +- tests/i915/gem_readwrite.c | 2 +- tests/i915/gem_reg_read.c | 2 +- tests/i915/gem_render_copy.c | 2 +- tests/i915/gem_render_copy_redux.c | 2 +- tests/i915/gem_reset_stats.c | 32 +++++----- tests/i915/gem_ringfill.c | 2 +- tests/i915/gem_set_tiling_vs_blt.c | 2 +- tests/i915/gem_set_tiling_vs_gtt.c | 2 +- tests/i915/gem_set_tiling_vs_pwrite.c | 2 +- tests/i915/gem_shrink.c | 14 ++--- tests/i915/gem_softpin.c | 4 +- tests/i915/gem_spin_batch.c | 2 +- tests/i915/gem_streaming_writes.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_sync.c | 2 +- tests/i915/gem_tiled_blits.c | 2 +- tests/i915/gem_tiled_fence_blits.c | 2 +- tests/i915/gem_tiled_partial_pwrite_pread.c | 2 +- tests/i915/gem_tiled_pread_basic.c | 2 +- tests/i915/gem_tiled_pread_pwrite.c | 2 +- tests/i915/gem_tiled_swapping.c | 2 +- tests/i915/gem_tiled_wb.c | 2 +- tests/i915/gem_tiled_wc.c | 2 +- tests/i915/gem_tiling_max_stride.c | 2 +- tests/i915/gem_unfence_active_buffers.c | 2 +- tests/i915/gem_unref_active_buffers.c | 2 +- tests/i915/gem_userptr_blits.c | 6 +- tests/i915/gem_vm_create.c | 4 +- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 2 +- tests/i915/gen7_exec_parse.c | 4 +- tests/i915/gen9_exec_parse.c | 2 +- tests/i915/i915_fb_tiling.c | 2 +- tests/i915/i915_getparams_basic.c | 2 +- tests/i915/i915_hangman.c | 4 +- tests/i915/i915_hwmon.c | 2 +- tests/i915/i915_module_load.c | 8 +-- tests/i915/i915_pciid.c | 2 +- tests/i915/i915_pm_backlight.c | 2 +- tests/i915/i915_pm_dc.c | 2 +- tests/i915/i915_pm_freq_api.c | 2 +- tests/i915/i915_pm_freq_mult.c | 2 +- tests/i915/i915_pm_lpsp.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/i915_pm_rps.c | 5 +- tests/i915/i915_pm_sseu.c | 2 +- tests/i915/i915_power.c | 2 +- tests/i915/i915_query.c | 2 +- tests/i915/i915_suspend.c | 6 +- tests/i915/kms_big_fb.c | 2 +- tests/i915/kms_big_joiner.c | 2 +- tests/i915/kms_busy.c | 2 +- tests/i915/kms_ccs.c | 2 +- tests/i915/kms_cdclk.c | 2 +- tests/i915/kms_draw_crc.c | 2 +- tests/i915/kms_dsc.c | 2 +- tests/i915/kms_fbcon_fbt.c | 2 +- tests/i915/kms_fence_pin_leak.c | 2 +- tests/i915/kms_flip_scaled_crc.c | 2 +- tests/i915/kms_flip_tiling.c | 2 +- tests/i915/kms_frontbuffer_tracking.c | 2 +- tests/i915/kms_legacy_colorkey.c | 2 +- tests/i915/kms_mmap_write_crc.c | 3 +- tests/i915/kms_pipe_b_c_ivb.c | 2 +- tests/i915/kms_psr.c | 2 +- tests/i915/kms_psr2_sf.c | 2 +- tests/i915/kms_psr2_su.c | 2 +- tests/i915/kms_psr_stress_test.c | 2 +- tests/i915/kms_pwrite_crc.c | 2 +- tests/i915/perf.c | 6 +- tests/i915/perf_pmu.c | 6 +- tests/i915/sysfs_defaults.c | 2 +- tests/i915/sysfs_heartbeat_interval.c | 2 +- tests/i915/sysfs_preempt_timeout.c | 2 +- tests/i915/sysfs_timeslice_duration.c | 2 +- tests/kms_3d.c | 8 +-- tests/kms_addfb_basic.c | 13 +--- tests/kms_async_flips.c | 2 +- tests/kms_atomic.c | 2 +- tests/kms_atomic_interruptible.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_color.c | 2 +- tests/kms_concurrent.c | 2 +- tests/kms_content_protection.c | 2 +- tests/kms_cursor_crc.c | 2 +- tests/kms_cursor_edge_walk.c | 2 +- tests/kms_cursor_legacy.c | 2 +- tests/kms_dither.c | 2 +- tests/kms_dp_aux_dev.c | 2 +- tests/kms_flip.c | 11 +--- tests/kms_flip_event_leak.c | 8 +-- tests/kms_force_connector_basic.c | 4 +- tests/kms_getfb.c | 19 +----- tests/kms_hdmi_inject.c | 9 +-- tests/kms_hdr.c | 2 +- tests/kms_invalid_mode.c | 2 +- tests/kms_lease.c | 4 +- tests/kms_panel_fitting.c | 2 +- tests/kms_pipe_crc_basic.c | 2 +- tests/kms_plane.c | 2 +- tests/kms_plane_alpha_blend.c | 2 +- tests/kms_plane_cursor.c | 2 +- tests/kms_plane_lowres.c | 2 +- tests/kms_plane_multiple.c | 2 +- tests/kms_plane_scaling.c | 2 +- tests/kms_prime.c | 6 +- tests/kms_prop_blob.c | 8 +-- tests/kms_properties.c | 2 +- tests/kms_rmfb.c | 4 +- tests/kms_rotation_crc.c | 2 +- tests/kms_scaling_modes.c | 2 +- tests/kms_sequence.c | 2 +- tests/kms_setmode.c | 9 +-- tests/kms_tiled_display.c | 2 +- tests/kms_tv_load_detect.c | 2 +- tests/kms_universal_plane.c | 2 +- tests/kms_vblank.c | 2 +- tests/kms_vrr.c | 1 + tests/kms_writeback.c | 1 + tests/nouveau_crc.c | 6 +- tests/panfrost_gem_new.c | 4 +- tests/panfrost_get_param.c | 2 +- tests/panfrost_prime.c | 4 +- tests/panfrost_submit.c | 6 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 +- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 ++++---- tests/prime_vgem.c | 4 +- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/testdisplay.c | 4 +- tests/v3d/v3d_create_bo.c | 4 +- tests/v3d/v3d_get_bo_offset.c | 2 +- tests/v3d/v3d_get_param.c | 2 +- tests/v3d/v3d_job_submission.c | 2 +- tests/v3d/v3d_mmap.c | 2 +- tests/v3d/v3d_perfmon.c | 2 +- tests/v3d/v3d_submit_cl.c | 2 +- tests/v3d/v3d_submit_csd.c | 2 +- tests/v3d/v3d_wait_bo.c | 2 +- tests/vc4/vc4_create_bo.c | 4 +- tests/vc4/vc4_dmabuf_poll.c | 2 +- tests/vc4/vc4_label_bo.c | 2 +- tests/vc4/vc4_lookup_fail.c | 2 +- tests/vc4/vc4_mmap.c | 2 +- tests/vc4/vc4_perfmon.c | 2 +- tests/vc4/vc4_purgeable_bo.c | 2 +- tests/vc4/vc4_tiling.c | 2 +- tests/vc4/vc4_wait_bo.c | 2 +- tests/vc4/vc4_wait_seqno.c | 2 +- tests/vgem_basic.c | 6 +- tests/vgem_slow.c | 2 +- tests/vmwgfx/vmw_execution_buffer.c | 2 +- tests/vmwgfx/vmw_ref_count.c | 4 +- tests/vmwgfx/vmw_surface_copy.c | 2 +- tests/xe/xe_compute.c | 10 +-- tests/xe/xe_create.c | 13 ++-- tests/xe/xe_debugfs.c | 10 +-- tests/xe/xe_dma_buf_sync.c | 15 ++--- tests/xe/xe_evict.c | 11 +--- tests/xe/xe_exec_balancer.c | 10 +-- tests/xe/xe_exec_basic.c | 10 +-- tests/xe/xe_exec_compute_mode.c | 10 +-- tests/xe/xe_exec_fault_mode.c | 7 +-- tests/xe/xe_exec_reset.c | 31 +++------- tests/xe/xe_exec_threads.c | 28 +++------ tests/xe/xe_gpgpu_fill.c | 4 +- tests/xe/xe_guc_pc.c | 4 +- tests/xe/xe_huc_copy.c | 10 +-- tests/xe/xe_intel_bb.c | 4 +- tests/xe/xe_mmap.c | 10 +-- tests/xe/xe_mmio.c | 10 +-- tests/xe/xe_module_load.c | 2 +- tests/xe/xe_noexec_ping_pong.c | 4 +- tests/xe/xe_pm.c | 5 +- tests/xe/xe_prime_self_import.c | 61 +++++------------- tests/xe/xe_query.c | 10 +-- tests/xe/xe_spin_batch.c | 10 +-- tests/xe/xe_vm.c | 7 +-- tests/xe/xe_waitfence.c | 10 +-- 292 files changed, 581 insertions(+), 662 deletions(-)
--
2.40.0
PATCH v4 1/24 lib: Interface to close the drm fd
Add new helper drm_close_driver() to close the drm fd. Now every user could call drm_close_driver() instead of close().
V2: - Fix commit message
- Add debug prints
V3: - Check the validity of fd before close
V4: - s/igt_debug/igt_warn/
--- lib/drmtest.c | 44 ++++++++++++++++++++++++++++++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 45 insertions(+)
lib/drmtest.c +44 -0
@@ -636,6 +636,50 @@ int drm_open_driver(int chipset)return fd; } +static bool is_valid_fd (int fd) +{ +char path[32 ]; +char buf[PATH_MAX ]; +int len; + +if (fd <0 ) +return false; + +snprintf (path,sizeof (path),"/proc/self/fd/%d" , fd); + +memset (buf,0 ,sizeof (buf)); + len =readlink (path, buf,sizeof (buf) -1 ); +if (len <=0 ) +return false; + + buf[len] ='\0' ; +if (strstr (buf,"/dev/dri/card" ) == buf || +strstr (buf,"/dev/dri/renderD" ) == buf) +return true; + +return false; +} + +/** +* drm_close_driver: +* @fd: a drm file descriptor +* +* Check the given drm file descriptor @fd is valid & Close if it is +* an valid drm fd. +* +* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +if (!is_valid_fd (fd)) { +igt_warn ("Don't attempt to close standard/invalid file " +"descriptor: %d\n" , fd); +return -1 ; + } + +return close (fd); +} +/** * drm_open_driver_master: * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL
lib/drmtest.h +1 -0
@@ -105,6 +105,7 @@ int drm_open_driver_render(int chipset);int __drm_open_driver_another (int idx,int chipset);int __drm_open_driver (int chipset);int __drm_open_driver_render (int chipset); +int drm_close_driver (int fd);int drm_reopen_driver (int fd);
Signature · 1 line
2.40.0
PATCH v4 2/24 lib: Cache xe_device at driver open/close level
In reply to Bhanuprakash ModemInstead of caching the xe_device struct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver.
V2: - Place the logic in correct helpers (Zbigniew)
--- lib/drmtest.c | 24 +++++++++++++++++++++--- lib/igt_types.c | 6 ++++++ 2 files changed, 27 insertions(+), 3 deletions(-)
lib/drmtest.c +21 -3
@@ -64,6 +64,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest
@@ -497,9 +498,14 @@ int __drm_open_driver_another(int idx, int chipset) fd =__open_driver ("/dev/dri/card" ,0 , chipset, idx); } -if (fd >=0 ) +if (fd >=0 ) {_set_opened_fd (idx, fd); +/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); + } +return fd; }
@@ -523,6 +529,8 @@ int __drm_open_driver(int chipset)int __drm_open_driver_render (int chipset) { +int fd; +if (chipset !=DRIVER_VGEM &&igt_device_filter_count () >0 ) {struct igt_device_card card;bool found;
@@ -532,10 +540,16 @@ int __drm_open_driver_render(int chipset)if (!found || !strlen (card.render))return -1 ; -return __open_driver_exact (card.render, chipset); + fd =__open_driver_exact (card.render, chipset); + }else { + fd =__open_driver ("/dev/dri/renderD" ,128 , chipset,0 ); } -return __open_driver ("/dev/dri/renderD" ,128 , chipset,0 ); +/* Cache xe_device struct. */ +if (fd >=0 &&is_xe_device (fd)) +xe_device_get (fd); + +return fd; }static int at_exit_drm_fd =-1 ;
@@ -677,6 +691,10 @@ int drm_close_driver(int fd)return -1 ; } +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }
lib/igt_types.c +6 -0
@@ -5,13 +5,19 @@#include <unistd.h> +#include "drmtest.h" #include "igt_types.h" +#include "xe/xe_query.h" void igt_cleanup_fd (volatile int *fd) {if (!fd || *fd <0 )return ; +/* Remove xe_device from cache. */ +if (is_xe_device (*fd)) +xe_device_put (*fd); +close (*fd); *fd =-1 ; }
Signature · 1 line
2.40.0
PATCH v4 3/24 lib/xe/xe_query: Add xe_config() interface
In reply to Bhanuprakash ModemAdd support to get XE configuration from xe_device.
--- lib/xe/xe_query.c | 8 ++++++++ lib/xe/xe_query.h | 1 + 2 files changed, 9 insertions(+)
lib/xe/xe_query.c +8 -0
@@ -479,6 +479,14 @@ uint32_t xe_min_page_size(int fd, uint64_t region)return xe_mem_region (fd, region)->min_page_size; } +/** +* xe_config: +* @fd: xe device fd +* +* Returns xe configuration of xe device @fd. +*/ +xe_dev_FN(xe_config, config, struct drm_xe_query_config *); +/** * xe_number_hw_engine: * @fd: xe device fd
lib/xe/xe_query.h +1 -0
@@ -86,6 +86,7 @@ struct drm_xe_engine_class_instance *xe_hw_engine(int fd, int idx);struct drm_xe_query_mem_region *xe_mem_region (int fd,uint64_t region);const char *xe_region_name (uint64_t region);uint32_t xe_min_page_size (int fd,uint64_t region); +struct drm_xe_query_config *xe_config (int fd);unsigned int xe_number_hw_engines (int fd);bool xe_has_vram (int fd);uint64_t xe_vram_size (int fd,int gt);
Signature · 1 line
2.40.0
PATCH v4 4/24 lib/igt_msm: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- lib/igt_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/igt_msm.c +1 -1
@@ -87,7 +87,7 @@ igt_msm_dev_close(struct msm_device *dev) {if (!dev)return ; -close (dev->fd); +drm_close_driver (dev->fd);free (dev); }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 04/24] lib/igt_msm: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 6 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().Cc Rob Clark <[email protected]>Cc Abhinav Kumar <[email protected]>Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 20 lines
--- lib/igt_msm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)lib/igt_msm.c +1
-1@@ -87,7 +87,7 @@ igt_msm_dev_close(struct msm_device *dev) {if (!dev)return ; -close (dev->fd); +drm_close_driver (dev->fd);free (dev); }Signature · 1 line
2.40.0
PATCH v4 5/24 tests/amdgpu: Close the fd before exit
In reply to Bhanuprakash ModemClose the file descriptor before exiting the test.
--- tests/amdgpu/amd_abm.c | 1 + tests/amdgpu/amd_assr.c | 1 + tests/amdgpu/amd_freesync_video_mode.c | 1 + tests/amdgpu/amd_mem_leak.c | 1 + tests/amdgpu/amd_psr.c | 3 ++- tests/amdgpu/amd_vrr_range.c | 1 + 6 files changed, 7 insertions(+), 1 deletion(-)
tests/amdgpu/amd_abm.c +1 -0
@@ -378,5 +378,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.drm_fd); } }
tests/amdgpu/amd_assr.c +1 -0
@@ -299,5 +299,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
tests/amdgpu/amd_freesync_video_mode.c +1 -0
@@ -868,5 +868,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.drm_fd); } }
tests/amdgpu/amd_mem_leak.c +1 -0
@@ -232,5 +232,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
tests/amdgpu/amd_psr.c +2 -1
@@ -640,7 +640,7 @@ static void run_check_psr_su_cursor(data_t *data, bool test_mpo)* panning the primary plane at the top-left of screen * set alpha region in overlay plane and set alpha to 0.0 to show primary plane * set cursor plane and starting from position of (0, 0) -*/ +*/ draw_color_alpha (&data->ov_fb[0 ],0 ,0 , data->pfb_w, data->pfb_h,1.0 ,1.0 ,1.0 ,.0 );igt_plane_set_fb (data->primary, &data->pm_fb[0 ]);igt_plane_set_fb (data->overlay, &data->ov_fb[0 ]);
@@ -763,5 +763,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) }close (data.debugfs_fd);igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
tests/amdgpu/amd_vrr_range.c +1 -0
@@ -408,5 +408,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
Signature · 1 line
2.40.0
PATCH v4 6/24 tests/i915: Close the fd before exit
In reply to Bhanuprakash ModemClose the file descriptor before exiting the test.
V2: - Drop tests those are initializing the fd with igt_fd_t
--- tests/dmabuf_sync_file.c | 3 +++ tests/i915/gem_barrier_race.c | 3 +++ tests/i915/gem_concurrent_all.c | 5 +++++ tests/i915/gem_ctx_exec.c | 3 +++ tests/i915/gem_ctx_freq.c | 3 +++ tests/i915/gem_eio.c | 3 +++ tests/i915/i915_pm_rps.c | 3 +++ 7 files changed, 23 insertions(+)
tests/dmabuf_sync_file.c +3 -0
@@ -380,4 +380,7 @@ igt_main "operations."); igt_subtest("import-multiple-read-write")test_import_multiple (fd, true); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_barrier_race.c +3 -0
@@ -165,4 +165,7 @@ igt_mainbreak ; } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_concurrent_all.c +5 -0
@@ -2015,4 +2015,9 @@ igt_main } } } + + igt_fixture { +drm_close_driver (fd); +drm_close_driver (vgem_drv); + } }
tests/i915/gem_ctx_exec.c +3 -0
@@ -605,4 +605,7 @@ igt_maingem_context_destroy (fd, ctx_id);put_ahnd (ahnd); } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_ctx_freq.c +3 -0
@@ -261,4 +261,7 @@ igt_main igt_dynamic_f("gt%u", gt)sysfs_range (dirfd, gt); } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_eio.c +3 -0
@@ -1321,4 +1321,7 @@ igt_mainintel_allocator_multiprocess_stop (); } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/i915_pm_rps.c +3 -0
@@ -999,4 +999,7 @@ igt_mainwaitboost (drm_fd, true);igt_disallow_hang (drm_fd, hang); } + +igt_fixture +drm_close_driver (drm_fd ); }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 06/24] tests/i915: Close the fd before exit
Hi Bhanuprakash,
Quoted 5 lines · Bhanuprakash Modem
Close the file descriptor before exiting the test.
V2: - Drop tests those are initializing the fd with
igt_fd_tSigned-off-by Bhanuprakash Modem <[email protected]>
Quoted 99 lines
--- tests/dmabuf_sync_file.c | 3 +++ tests/i915/gem_barrier_race.c | 3 +++ tests/i915/gem_concurrent_all.c | 5 +++++ tests/i915/gem_ctx_exec.c | 3 +++ tests/i915/gem_ctx_freq.c | 3 +++ tests/i915/gem_eio.c | 3 +++ tests/i915/i915_pm_rps.c | 3 +++ 7 files changed, 23 insertions(+)tests/dmabuf_sync_file.c +3
-0@@ -380,4 +380,7 @@ igt_main "operations."); igt_subtest("import-multiple-read-write")test_import_multiple (fd, true); + +igt_fixture +drm_close_driver (fd ); }tests/i915/gem_barrier_race.c +3
-0@@ -165,4 +165,7 @@ igt_mainbreak ; } } + +igt_fixture +drm_close_driver (fd ); }tests/i915/gem_concurrent_all.c +5
-0@@ -2015,4 +2015,9 @@ igt_main } } } + + igt_fixture { +drm_close_driver (fd); +drm_close_driver (vgem_drv); + } }tests/i915/gem_ctx_exec.c +3
-0@@ -605,4 +605,7 @@ igt_maingem_context_destroy (fd, ctx_id);put_ahnd (ahnd); } + +igt_fixture +drm_close_driver (fd ); }tests/i915/gem_ctx_freq.c +3
-0@@ -261,4 +261,7 @@ igt_main igt_dynamic_f("gt%u", gt)sysfs_range (dirfd, gt); } + +igt_fixture +drm_close_driver (i915 ); }tests/i915/gem_eio.c +3
-0@@ -1321,4 +1321,7 @@ igt_mainintel_allocator_multiprocess_stop (); } } + +igt_fixture +drm_close_driver (fd ); }tests/i915/i915_pm_rps.c +3
-0@@ -999,4 +999,7 @@ igt_mainwaitboost (drm_fd, true);igt_disallow_hang (drm_fd, hang); } + +igt_fixture +drm_close_driver (drm_fd ); }Signature · 1 line
2.40.0
PATCH v4 7/24 tests/kms: Close the fd before exit
In reply to Bhanuprakash ModemClose the file descriptor before exiting the test.
--- tests/kms_vrr.c | 1 + tests/kms_writeback.c | 1 + 2 files changed, 2 insertions(+)
tests/kms_vrr.c +1 -0
@@ -528,5 +528,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.drm_fd); } }
tests/kms_writeback.c +1 -0
@@ -606,5 +606,6 @@ igt_main_args("b:c:dl", long_options, help_str, opt_handler, NULL)detach_crtc (&display, output);igt_remove_fb (display.drm_fd, &input_fb);igt_display_fini (&display); +drm_close_driver (display.drm_fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 07/24] tests/kms: Close the fd before exit
Hi Bhanuprakash,
Quoted 3 lines · Bhanuprakash Modem
Close the file descriptor before exiting the test.
Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 30 lines
--- tests/kms_vrr.c | 1 + tests/kms_writeback.c | 1 + 2 files changed, 2 insertions(+)tests/kms_vrr.c +1
-0@@ -528,5 +528,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.drm_fd); } }tests/kms_writeback.c +1
-0@@ -606,5 +606,6 @@ igt_main_args("b:c:dl", long_options, help_str, opt_handler, NULL)detach_crtc (&display, output);igt_remove_fb (display.drm_fd, &input_fb);igt_display_fini (&display); +drm_close_driver (display.drm_fd); } }Signature · 1 line
2.40.0
PATCH v4 8/24 tests/nouveau_crc: Close the fd before exit
In reply to Bhanuprakash ModemClose the file descriptor before exiting the test.
--- tests/nouveau_crc.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-)
tests/nouveau_crc.c +4 -2
@@ -409,7 +409,9 @@ igt_mainclose (data.nv_crc_dir); } } - igt_fixture - igt_display_fini(&data.display); + igt_fixture { +igt_display_fini (&data.display); +drm_close_driver (data.drm_fd); + } }
Signature · 1 line
2.40.0
PATCH v4 9/24 tests/xe/xe_gpgpu_fill: Close the fd before exit
In reply to Bhanuprakash ModemClose the file descriptor before exiting the test.
--- tests/xe/xe_gpgpu_fill.c | 1 + 1 file changed, 1 insertion(+)
tests/xe/xe_gpgpu_fill.c +1 -0
@@ -131,5 +131,6 @@ igt_main igt_fixture {xe_device_put (data.drm_fd);buf_ops_destroy (data.bops); +drm_close_driver (data.drm_fd); } }
Signature · 1 line
2.40.0
PATCH v4 10/24 tests/i915/kms_mmap_write_crc: Avoid closing the closed fd
In reply to Bhanuprakash ModemAvoid closing the closed fd.
--- tests/i915/kms_mmap_write_crc.c | 1 - 1 file changed, 1 deletion(-)
tests/i915/kms_mmap_write_crc.c +0 -1
@@ -309,6 +309,5 @@ igt_main_args("n", NULL, NULL, opt_handler, NULL)close (data.drm_fd);igt_stop_helper (&hog); -close (data.drm_fd); } }
Signature · 1 line
2.40.0
PATCH v4 11/24 tests/i915/gem_close_race: Fix the double closure of fd
In reply to Bhanuprakash ModemDon't close the fd in each thread, instead leave it to be closed by process termination
--- tests/i915/gem_close_race.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/i915/gem_close_race.c +1 -1
@@ -303,7 +303,7 @@ static void thread(int fd, struct drm_gem_open name, n++; }while (1 ); -close (crashme.fd); +/* leave fd to be closed by process termination */ }timer_delete (timer);
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 11/24] tests/i915/gem_close_race: Fix the double closure of fd
Hi Bhanuprakash,
Quoted 4 lines · Bhanuprakash Modem
Don't close the fd in each thread, instead leave it to be closed by process termination
Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 20 lines
--- tests/i915/gem_close_race.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/i915/gem_close_race.c +1
-1@@ -303,7 +303,7 @@ static void thread(int fd, struct drm_gem_open name, n++; }while (1 ); -close (crashme.fd); +/* leave fd to be closed by process termination */ }timer_delete (timer);Signature · 1 line
2.40.0
PATCH v4 12/24 tests: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/core_auth.c | 10 +++++----- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +++--- tests/core_setmaster_vs_auth.c | 6 +++--- tests/debugfs_test.c | 2 +- tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 ++-- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 +++++++++++++------------- tests/prime_vgem.c | 4 ++-- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/vgem_basic.c | 6 +++--- tests/vgem_slow.c | 2 +- 22 files changed, 46 insertions(+), 46 deletions(-)
tests/core_auth.c +5 -5
@@ -214,7 +214,7 @@ static void test_basic_auth(int master)igt_assert (drmGetMagic (slave, &magic) ==0 );igt_assert_eq (magic, old_magic); -close (slave); +drm_close_driver (slave); } igt_main
@@ -226,7 +226,7 @@ igt_mainigt_assert (check_auth (fd) == true); -close (fd); +drm_close_driver (fd); }igt_describe ("Use 2 clients, check second is authenticated even when first dropped." );
@@ -236,11 +236,11 @@ igt_mainigt_assert (check_auth (fd2) == true); -close (fd); +drm_close_driver (fd);igt_assert (check_auth (fd2) == true); -close (fd2); +drm_close_driver (fd2); }/* above tests require that no drm fd is open */
@@ -249,7 +249,7 @@ igt_mainigt_fixture master =drm_open_driver_master (DRIVER_ANY ); - +igt_describe ("Test magic numbers for master and slave." ); igt_subtest("basic-auth")test_basic_auth (master);
tests/core_getclient.c +1 -1
@@ -70,5 +70,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_CLIENT , &client);igt_assert (ret ==-1 && errno ==EINVAL ); -close (fd); +drm_close_driver (fd); }
tests/core_getstats.c +1 -1
@@ -64,5 +64,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_STATS , &stats);igt_assert (ret ==0 ); -close (fd); +drm_close_driver (fd); }
tests/core_getversion.c +1 -1
@@ -58,5 +58,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }
tests/core_setmaster.c +3 -3
@@ -104,7 +104,7 @@ static void check_drop_set(void)igt_assert_eq (drmDropMaster (master),0 );igt_assert_eq (drmSetMaster (master),0 ); -close (master); +drm_close_driver (master); }static unsigned tweak_perm (uint8_t *saved_perm,unsigned max_perm,bool save)
@@ -225,10 +225,10 @@ igt_mainigt_assert_eq (drmSetMaster (master),-1 );igt_assert_eq (errno,EACCES ); -close (master); +drm_close_driver (master); }igt_waitchildren (); -close (master); +drm_close_driver (master); } }
tests/core_setmaster_vs_auth.c +3 -3
@@ -78,7 +78,7 @@ igt_simple_mainigt_assert_neq (drmAuthMagic (master2, magic),0 );igt_assert_eq (errno,EINVAL ); -close (client); -close (master2); -close (master1); +drm_close_driver (client); +drm_close_driver (master2); +drm_close_driver (master1); }
tests/debugfs_test.c +1 -1
@@ -255,6 +255,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }
tests/dumb_buffer.c +1 -1
@@ -416,6 +416,6 @@ igt_mainalways_clear (fd,30 ); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/eviction_common.c +1 -1
@@ -300,7 +300,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,/* drmfd closing will take care of additional bo refs */ if (flags &FORKING_EVICTIONS_DUP_DRMFD ) -close (realfd); +drm_close_driver (realfd); }igt_waitchildren ();
tests/fbdev.c +1 -1
@@ -443,6 +443,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/prime_busy.c +1 -1
@@ -184,6 +184,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap.c +1 -1
@@ -590,6 +590,6 @@ igt_mainfree (query_info);igt_collection_destroy (set);igt_collection_destroy (dma_buf_set); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap_coherency.c +2 -2
@@ -267,7 +267,7 @@ static void blit_and_cmp(void)intel_bb_destroy (local_batch);buf_ops_destroy (local_bops); -close (local_fd); +drm_close_driver (local_fd); }/*
@@ -364,6 +364,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap_kms.c +1 -1
@@ -263,6 +263,6 @@ igt_main igt_fixture {igt_display_fini (&gpu.display); -close (gpu.drm_fd); +drm_close_driver (gpu.drm_fd); } }
tests/prime_self_import.c +13 -13
@@ -147,8 +147,8 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_two_bos (void )
@@ -180,8 +180,8 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_one_bo_two_files (void )
@@ -205,8 +205,8 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }
@@ -252,7 +252,7 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); }
@@ -316,14 +316,14 @@ static void test_reimport_close_race(void)igt_assert (status ==0 ); } -close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -398,13 +398,13 @@ static void test_export_close_race(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -433,7 +433,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )
@@ -462,7 +462,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_main
tests/prime_vgem.c +2 -2
@@ -1326,7 +1326,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }
tests/syncobj_basic.c +1 -1
@@ -266,7 +266,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_timeline.c +1 -1
@@ -1936,6 +1936,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_wait.c +1 -1
@@ -1062,6 +1062,6 @@ igt_maintest_wait_interrupted (fd,WAIT_ALL ); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/template.c +1 -1
@@ -76,6 +76,6 @@ igt_main*/ igt_fixture { -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/vgem_basic.c +3 -3
@@ -162,8 +162,8 @@ static void test_setversion(int fd)static void test_client (int fd) { -close (drm_open_driver (DRIVER_VGEM )); -close (drm_open_driver_render (DRIVER_VGEM )); +drm_close_driver (drm_open_driver (DRIVER_VGEM )); +drm_close_driver (drm_open_driver_render (DRIVER_VGEM )); }static void test_create (int fd)
@@ -635,6 +635,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/vgem_slow.c +1 -1
@@ -97,6 +97,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 12/24] tests: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 66 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().Signed-off-by Bhanuprakash Modem <[email protected]>--- tests/core_auth.c | 10 +++++----- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +++--- tests/core_setmaster_vs_auth.c | 6 +++--- tests/debugfs_test.c | 2 +- tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 ++-- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 +++++++++++++------------- tests/prime_vgem.c | 4 ++-- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/vgem_basic.c | 6 +++--- tests/vgem_slow.c | 2 +- 22 files changed, 46 insertions(+), 46 deletions(-)tests/core_auth.c +4
-4@@ -214,7 +214,7 @@ static void test_basic_auth(int master)igt_assert (drmGetMagic (slave, &magic) ==0 );igt_assert_eq (magic, old_magic); -close (slave); +drm_close_driver (slave); } igt_main@@ -226,7 +226,7 @@ igt_mainigt_assert (check_auth (fd) == true); -close (fd); +drm_close_driver (fd); }igt_describe ("Use 2 clients, check second is authenticated even when first dropped." );@@ -236,11 +236,11 @@ igt_mainigt_assert (check_auth (fd2) == true); -close (fd); +drm_close_driver (fd);igt_assert (check_auth (fd2) == true); -close (fd2); +drm_close_driver (fd2); }/* above tests require that no drm fd is open */
tests/core_auth.c igt_main · line 252
Quoted 5 lines
tests/core_auth.c +1
-1@@ -249,7 +249,7 @@ igt_mainigt_fixture master =drm_open_driver_master (DRIVER_ANY ); - +
Drop this change.
Quoted 230 lines
tests/core_auth.c +0
-0igt_describe ("Test magic numbers for master and slave." ); igt_subtest("basic-auth")test_basic_auth (master);tests/core_getclient.c +1
-1@@ -70,5 +70,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_CLIENT , &client);igt_assert (ret ==-1 && errno ==EINVAL ); -close (fd); +drm_close_driver (fd); }tests/core_getstats.c +1
-1@@ -64,5 +64,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_STATS , &stats);igt_assert (ret ==0 ); -close (fd); +drm_close_driver (fd); }tests/core_getversion.c +1
-1@@ -58,5 +58,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }tests/core_setmaster.c +3
-3@@ -104,7 +104,7 @@ static void check_drop_set(void)igt_assert_eq (drmDropMaster (master),0 );igt_assert_eq (drmSetMaster (master),0 ); -close (master); +drm_close_driver (master); }static unsigned tweak_perm (uint8_t *saved_perm,unsigned max_perm,bool save)@@ -225,10 +225,10 @@ igt_mainigt_assert_eq (drmSetMaster (master),-1 );igt_assert_eq (errno,EACCES ); -close (master); +drm_close_driver (master); }igt_waitchildren (); -close (master); +drm_close_driver (master); } }tests/core_setmaster_vs_auth.c +3
-3@@ -78,7 +78,7 @@ igt_simple_mainigt_assert_neq (drmAuthMagic (master2, magic),0 );igt_assert_eq (errno,EINVAL ); -close (client); -close (master2); -close (master1); +drm_close_driver (client); +drm_close_driver (master2); +drm_close_driver (master1); }tests/debugfs_test.c +1
-1@@ -255,6 +255,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }tests/dumb_buffer.c +1
-1@@ -416,6 +416,6 @@ igt_mainalways_clear (fd,30 ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/eviction_common.c +1
-1@@ -300,7 +300,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,/* drmfd closing will take care of additional bo refs */ if (flags &FORKING_EVICTIONS_DUP_DRMFD ) -close (realfd); +drm_close_driver (realfd); }igt_waitchildren ();tests/fbdev.c +1
-1@@ -443,6 +443,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/prime_busy.c +1
-1@@ -184,6 +184,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap.c +1
-1@@ -590,6 +590,6 @@ igt_mainfree (query_info);igt_collection_destroy (set);igt_collection_destroy (dma_buf_set); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_coherency.c +2
-2@@ -267,7 +267,7 @@ static void blit_and_cmp(void)intel_bb_destroy (local_batch);buf_ops_destroy (local_bops); -close (local_fd); +drm_close_driver (local_fd); }/* @@ -364,6 +364,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_kms.c +1
-1@@ -263,6 +263,6 @@ igt_main igt_fixture {igt_display_fini (&gpu.display); -close (gpu.drm_fd); +drm_close_driver (gpu.drm_fd); } }tests/prime_self_import.c +7
-7@@ -147,8 +147,8 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_two_bos (void )@@ -180,8 +180,8 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_one_bo_two_files (void )@@ -205,8 +205,8 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }@@ -252,7 +252,7 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); }
tests/prime_self_import.c static void test_reimport_close_race(void) · line 320
Quoted 6 lines
tests/prime_self_import.c +1
-1@@ -316,14 +316,14 @@ static void test_reimport_close_race(void)igt_assert (status ==0 ); } -close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]);
------- ^^^^^
this should also be changed ?
Rest looks ok.
Regards,
Kamil
Quoted 145 lines
tests/prime_self_import.c +5
-5obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -398,13 +398,13 @@ static void test_export_close_race(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -433,7 +433,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )@@ -462,7 +462,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_maintests/prime_vgem.c +2
-2@@ -1326,7 +1326,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }tests/syncobj_basic.c +1
-1@@ -266,7 +266,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_timeline.c +1
-1@@ -1936,6 +1936,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_wait.c +1
-1@@ -1062,6 +1062,6 @@ igt_maintest_wait_interrupted (fd,WAIT_ALL ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/template.c +1
-1@@ -76,6 +76,6 @@ igt_main*/ igt_fixture { -close (drm_fd); +drm_close_driver (drm_fd); } }tests/vgem_basic.c +3
-3@@ -162,8 +162,8 @@ static void test_setversion(int fd)static void test_client (int fd) { -close (drm_open_driver (DRIVER_VGEM )); -close (drm_open_driver_render (DRIVER_VGEM )); +drm_close_driver (drm_open_driver (DRIVER_VGEM )); +drm_close_driver (drm_open_driver_render (DRIVER_VGEM )); }static void test_create (int fd)@@ -635,6 +635,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/vgem_slow.c +1
-1@@ -97,6 +97,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 12/24] tests: Use drm_close_driver() to close the drm fd
Hi Kamil,
Quoted 70 lines · Kamil Konieczny
Hi Bhanuprakash,
Quoted 67 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().Signed-off-by Bhanuprakash Modem <[email protected]>--- tests/core_auth.c | 10 +++++----- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +++--- tests/core_setmaster_vs_auth.c | 6 +++--- tests/debugfs_test.c | 2 +- tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 ++-- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 +++++++++++++------------- tests/prime_vgem.c | 4 ++-- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/vgem_basic.c | 6 +++--- tests/vgem_slow.c | 2 +- 22 files changed, 46 insertions(+), 46 deletions(-)tests/core_auth.c +4
-4@@ -214,7 +214,7 @@ static void test_basic_auth(int master)igt_assert (drmGetMagic (slave, &magic) ==0 );igt_assert_eq (magic, old_magic); -close (slave); +drm_close_driver (slave); } igt_main@@ -226,7 +226,7 @@ igt_mainigt_assert (check_auth (fd) == true); -close (fd); +drm_close_driver (fd); }igt_describe ("Use 2 clients, check second is authenticated even when first dropped." );@@ -236,11 +236,11 @@ igt_mainigt_assert (check_auth (fd2) == true); -close (fd); +drm_close_driver (fd);igt_assert (check_auth (fd2) == true); -close (fd2); +drm_close_driver (fd2); }/* above tests require that no drm fd is open */ @@ -249,7 +249,7 @@ igt_main
Quoted 6 lines
tests/core_auth.c igt_main · line 252
Quoted 4 lines
tests/core_auth.c +1
-1igt_fixture master =drm_open_driver_master (DRIVER_ANY ); - +Drop this change.
I haven't done this, some how my vim editor is adding this change. Will fix it new rev.
Quoted 234 lines
Quoted 234 lines
tests/core_auth.c +0
-0igt_describe ("Test magic numbers for master and slave." ); igt_subtest("basic-auth")test_basic_auth (master);tests/core_getclient.c +1
-1@@ -70,5 +70,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_CLIENT , &client);igt_assert (ret ==-1 && errno ==EINVAL ); -close (fd); +drm_close_driver (fd); }tests/core_getstats.c +1
-1@@ -64,5 +64,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_STATS , &stats);igt_assert (ret ==0 ); -close (fd); +drm_close_driver (fd); }tests/core_getversion.c +1
-1@@ -58,5 +58,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }tests/core_setmaster.c +3
-3@@ -104,7 +104,7 @@ static void check_drop_set(void)igt_assert_eq (drmDropMaster (master),0 );igt_assert_eq (drmSetMaster (master),0 ); -close (master); +drm_close_driver (master); }static unsigned tweak_perm (uint8_t *saved_perm,unsigned max_perm,bool save)@@ -225,10 +225,10 @@ igt_mainigt_assert_eq (drmSetMaster (master),-1 );igt_assert_eq (errno,EACCES ); -close (master); +drm_close_driver (master); }igt_waitchildren (); -close (master); +drm_close_driver (master); } }tests/core_setmaster_vs_auth.c +3
-3@@ -78,7 +78,7 @@ igt_simple_mainigt_assert_neq (drmAuthMagic (master2, magic),0 );igt_assert_eq (errno,EINVAL ); -close (client); -close (master2); -close (master1); +drm_close_driver (client); +drm_close_driver (master2); +drm_close_driver (master1); }tests/debugfs_test.c +1
-1@@ -255,6 +255,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }tests/dumb_buffer.c +1
-1@@ -416,6 +416,6 @@ igt_mainalways_clear (fd,30 ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/eviction_common.c +1
-1@@ -300,7 +300,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,/* drmfd closing will take care of additional bo refs */ if (flags &FORKING_EVICTIONS_DUP_DRMFD ) -close (realfd); +drm_close_driver (realfd); }igt_waitchildren ();tests/fbdev.c +1
-1@@ -443,6 +443,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/prime_busy.c +1
-1@@ -184,6 +184,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap.c +1
-1@@ -590,6 +590,6 @@ igt_mainfree (query_info);igt_collection_destroy (set);igt_collection_destroy (dma_buf_set); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_coherency.c +2
-2@@ -267,7 +267,7 @@ static void blit_and_cmp(void)intel_bb_destroy (local_batch);buf_ops_destroy (local_bops); -close (local_fd); +drm_close_driver (local_fd); }/* @@ -364,6 +364,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_kms.c +1
-1@@ -263,6 +263,6 @@ igt_main igt_fixture {igt_display_fini (&gpu.display); -close (gpu.drm_fd); +drm_close_driver (gpu.drm_fd); } }tests/prime_self_import.c +7
-7@@ -147,8 +147,8 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_two_bos (void )@@ -180,8 +180,8 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_one_bo_two_files (void )@@ -205,8 +205,8 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }@@ -252,7 +252,7 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); }@@ -316,14 +316,14 @@ static void test_reimport_close_race(void)igt_assert (status ==0 ); }
Quoted 5 lines
tests/prime_self_import.c static void test_reimport_close_race(void) · line 320
Quoted 3 lines
tests/prime_self_import.c +1
-1-close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]);------- ^^^^^
this should also be changed ?
fds[1] is not a drm fd. It is a dma-buf fd to export the gem buffer. So, we are not going to change it.
- Bhanu
Quoted 151 lines
Rest looks ok.
Regards,
KamilQuoted 145 lines
tests/prime_self_import.c +5
-5obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -398,13 +398,13 @@ static void test_export_close_race(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -433,7 +433,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )@@ -462,7 +462,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_maintests/prime_vgem.c +2
-2@@ -1326,7 +1326,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }tests/syncobj_basic.c +1
-1@@ -266,7 +266,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_timeline.c +1
-1@@ -1936,6 +1936,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_wait.c +1
-1@@ -1062,6 +1062,6 @@ igt_maintest_wait_interrupted (fd,WAIT_ALL ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/template.c +1
-1@@ -76,6 +76,6 @@ igt_main*/ igt_fixture { -close (drm_fd); +drm_close_driver (drm_fd); } }tests/vgem_basic.c +3
-3@@ -162,8 +162,8 @@ static void test_setversion(int fd)static void test_client (int fd) { -close (drm_open_driver (DRIVER_VGEM )); -close (drm_open_driver_render (DRIVER_VGEM )); +drm_close_driver (drm_open_driver (DRIVER_VGEM )); +drm_close_driver (drm_open_driver_render (DRIVER_VGEM )); }static void test_create (int fd)@@ -635,6 +635,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/vgem_slow.c +1
-1@@ -97,6 +97,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }Signature · 1 line
2.40.0
PATCH v4 12/24 tests: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
V2: - Fix few nits
--- tests/core_auth.c | 8 ++++---- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +++--- tests/core_setmaster_vs_auth.c | 6 +++--- tests/debugfs_test.c | 2 +- tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 ++-- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 +++++++++++++------------- tests/prime_vgem.c | 4 ++-- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/vgem_basic.c | 6 +++--- tests/vgem_slow.c | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-)
tests/core_auth.c +4 -4
@@ -214,7 +214,7 @@ static void test_basic_auth(int master)igt_assert (drmGetMagic (slave, &magic) ==0 );igt_assert_eq (magic, old_magic); -close (slave); +drm_close_driver (slave); } igt_main
@@ -226,7 +226,7 @@ igt_mainigt_assert (check_auth (fd) == true); -close (fd); +drm_close_driver (fd); }igt_describe ("Use 2 clients, check second is authenticated even when first dropped." );
@@ -236,11 +236,11 @@ igt_mainigt_assert (check_auth (fd2) == true); -close (fd); +drm_close_driver (fd);igt_assert (check_auth (fd2) == true); -close (fd2); +drm_close_driver (fd2); }/* above tests require that no drm fd is open */
tests/core_getclient.c +1 -1
@@ -70,5 +70,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_CLIENT , &client);igt_assert (ret ==-1 && errno ==EINVAL ); -close (fd); +drm_close_driver (fd); }
tests/core_getstats.c +1 -1
@@ -64,5 +64,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_STATS , &stats);igt_assert (ret ==0 ); -close (fd); +drm_close_driver (fd); }
tests/core_getversion.c +1 -1
@@ -58,5 +58,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }
tests/core_setmaster.c +3 -3
@@ -104,7 +104,7 @@ static void check_drop_set(void)igt_assert_eq (drmDropMaster (master),0 );igt_assert_eq (drmSetMaster (master),0 ); -close (master); +drm_close_driver (master); }static unsigned tweak_perm (uint8_t *saved_perm,unsigned max_perm,bool save)
@@ -225,10 +225,10 @@ igt_mainigt_assert_eq (drmSetMaster (master),-1 );igt_assert_eq (errno,EACCES ); -close (master); +drm_close_driver (master); }igt_waitchildren (); -close (master); +drm_close_driver (master); } }
tests/core_setmaster_vs_auth.c +3 -3
@@ -78,7 +78,7 @@ igt_simple_mainigt_assert_neq (drmAuthMagic (master2, magic),0 );igt_assert_eq (errno,EINVAL ); -close (client); -close (master2); -close (master1); +drm_close_driver (client); +drm_close_driver (master2); +drm_close_driver (master1); }
tests/debugfs_test.c +1 -1
@@ -255,6 +255,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }
tests/dumb_buffer.c +1 -1
@@ -416,6 +416,6 @@ igt_mainalways_clear (fd,30 ); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/eviction_common.c +1 -1
@@ -300,7 +300,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,/* drmfd closing will take care of additional bo refs */ if (flags &FORKING_EVICTIONS_DUP_DRMFD ) -close (realfd); +drm_close_driver (realfd); }igt_waitchildren ();
tests/fbdev.c +1 -1
@@ -443,6 +443,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/prime_busy.c +1 -1
@@ -184,6 +184,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap.c +1 -1
@@ -590,6 +590,6 @@ igt_mainfree (query_info);igt_collection_destroy (set);igt_collection_destroy (dma_buf_set); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap_coherency.c +2 -2
@@ -267,7 +267,7 @@ static void blit_and_cmp(void)intel_bb_destroy (local_batch);buf_ops_destroy (local_bops); -close (local_fd); +drm_close_driver (local_fd); }/*
@@ -364,6 +364,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap_kms.c +1 -1
@@ -263,6 +263,6 @@ igt_main igt_fixture {igt_display_fini (&gpu.display); -close (gpu.drm_fd); +drm_close_driver (gpu.drm_fd); } }
tests/prime_self_import.c +13 -13
@@ -147,8 +147,8 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_two_bos (void )
@@ -180,8 +180,8 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_one_bo_two_files (void )
@@ -205,8 +205,8 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }
@@ -252,7 +252,7 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); }
@@ -316,14 +316,14 @@ static void test_reimport_close_race(void)igt_assert (status ==0 ); } -close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -398,13 +398,13 @@ static void test_export_close_race(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -433,7 +433,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )
@@ -462,7 +462,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_main
tests/prime_vgem.c +2 -2
@@ -1326,7 +1326,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }
tests/syncobj_basic.c +1 -1
@@ -266,7 +266,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_timeline.c +1 -1
@@ -1936,6 +1936,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_wait.c +1 -1
@@ -1062,6 +1062,6 @@ igt_maintest_wait_interrupted (fd,WAIT_ALL ); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/template.c +1 -1
@@ -76,6 +76,6 @@ igt_main*/ igt_fixture { -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/vgem_basic.c +3 -3
@@ -162,8 +162,8 @@ static void test_setversion(int fd)static void test_client (int fd) { -close (drm_open_driver (DRIVER_VGEM )); -close (drm_open_driver_render (DRIVER_VGEM )); +drm_close_driver (drm_open_driver (DRIVER_VGEM )); +drm_close_driver (drm_open_driver_render (DRIVER_VGEM )); }static void test_create (int fd)
@@ -635,6 +635,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/vgem_slow.c +1 -1
@@ -97,6 +97,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 12/24] tests: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 6 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().V2: - Fix few nits
Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 439 lines
--- tests/core_auth.c | 8 ++++---- tests/core_getclient.c | 2 +- tests/core_getstats.c | 2 +- tests/core_getversion.c | 2 +- tests/core_setmaster.c | 6 +++--- tests/core_setmaster_vs_auth.c | 6 +++--- tests/debugfs_test.c | 2 +- tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/prime_busy.c | 2 +- tests/prime_mmap.c | 2 +- tests/prime_mmap_coherency.c | 4 ++-- tests/prime_mmap_kms.c | 2 +- tests/prime_self_import.c | 26 +++++++++++++------------- tests/prime_vgem.c | 4 ++-- tests/syncobj_basic.c | 2 +- tests/syncobj_timeline.c | 2 +- tests/syncobj_wait.c | 2 +- tests/template.c | 2 +- tests/vgem_basic.c | 6 +++--- tests/vgem_slow.c | 2 +- 22 files changed, 45 insertions(+), 45 deletions(-)tests/core_auth.c +4
-4@@ -214,7 +214,7 @@ static void test_basic_auth(int master)igt_assert (drmGetMagic (slave, &magic) ==0 );igt_assert_eq (magic, old_magic); -close (slave); +drm_close_driver (slave); } igt_main@@ -226,7 +226,7 @@ igt_mainigt_assert (check_auth (fd) == true); -close (fd); +drm_close_driver (fd); }igt_describe ("Use 2 clients, check second is authenticated even when first dropped." );@@ -236,11 +236,11 @@ igt_mainigt_assert (check_auth (fd2) == true); -close (fd); +drm_close_driver (fd);igt_assert (check_auth (fd2) == true); -close (fd2); +drm_close_driver (fd2); }/* above tests require that no drm fd is open */ tests/core_getclient.c +1
-1@@ -70,5 +70,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_CLIENT , &client);igt_assert (ret ==-1 && errno ==EINVAL ); -close (fd); +drm_close_driver (fd); }tests/core_getstats.c +1
-1@@ -64,5 +64,5 @@ igt_simple_main ret =ioctl (fd,DRM_IOCTL_GET_STATS , &stats);igt_assert (ret ==0 ); -close (fd); +drm_close_driver (fd); }tests/core_getversion.c +1
-1@@ -58,5 +58,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }tests/core_setmaster.c +3
-3@@ -104,7 +104,7 @@ static void check_drop_set(void)igt_assert_eq (drmDropMaster (master),0 );igt_assert_eq (drmSetMaster (master),0 ); -close (master); +drm_close_driver (master); }static unsigned tweak_perm (uint8_t *saved_perm,unsigned max_perm,bool save)@@ -225,10 +225,10 @@ igt_mainigt_assert_eq (drmSetMaster (master),-1 );igt_assert_eq (errno,EACCES ); -close (master); +drm_close_driver (master); }igt_waitchildren (); -close (master); +drm_close_driver (master); } }tests/core_setmaster_vs_auth.c +3
-3@@ -78,7 +78,7 @@ igt_simple_mainigt_assert_neq (drmAuthMagic (master2, magic),0 );igt_assert_eq (errno,EINVAL ); -close (client); -close (master2); -close (master1); +drm_close_driver (client); +drm_close_driver (master2); +drm_close_driver (master1); }tests/debugfs_test.c +1
-1@@ -255,6 +255,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }tests/dumb_buffer.c +1
-1@@ -416,6 +416,6 @@ igt_mainalways_clear (fd,30 ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/eviction_common.c +1
-1@@ -300,7 +300,7 @@ static int forking_evictions(int fd, struct igt_eviction_test_ops *ops,/* drmfd closing will take care of additional bo refs */ if (flags &FORKING_EVICTIONS_DUP_DRMFD ) -close (realfd); +drm_close_driver (realfd); }igt_waitchildren ();tests/fbdev.c +1
-1@@ -443,6 +443,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/prime_busy.c +1
-1@@ -184,6 +184,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap.c +1
-1@@ -590,6 +590,6 @@ igt_mainfree (query_info);igt_collection_destroy (set);igt_collection_destroy (dma_buf_set); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_coherency.c +2
-2@@ -267,7 +267,7 @@ static void blit_and_cmp(void)intel_bb_destroy (local_batch);buf_ops_destroy (local_bops); -close (local_fd); +drm_close_driver (local_fd); }/* @@ -364,6 +364,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap_kms.c +1
-1@@ -263,6 +263,6 @@ igt_main igt_fixture {igt_display_fini (&gpu.display); -close (gpu.drm_fd); +drm_close_driver (gpu.drm_fd); } }tests/prime_self_import.c +13
-13@@ -147,8 +147,8 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_two_bos (void )@@ -180,8 +180,8 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static void test_with_one_bo_two_files (void )@@ -205,8 +205,8 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }@@ -252,7 +252,7 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); }@@ -316,14 +316,14 @@ static void test_reimport_close_race(void)igt_assert (status ==0 ); } -close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -398,13 +398,13 @@ static void test_export_close_race(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }@@ -433,7 +433,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )@@ -462,7 +462,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_maintests/prime_vgem.c +2
-2@@ -1326,7 +1326,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }tests/syncobj_basic.c +1
-1@@ -266,7 +266,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_timeline.c +1
-1@@ -1936,6 +1936,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_wait.c +1
-1@@ -1062,6 +1062,6 @@ igt_maintest_wait_interrupted (fd,WAIT_ALL ); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/template.c +1
-1@@ -76,6 +76,6 @@ igt_main*/ igt_fixture { -close (drm_fd); +drm_close_driver (drm_fd); } }tests/vgem_basic.c +3
-3@@ -162,8 +162,8 @@ static void test_setversion(int fd)static void test_client (int fd) { -close (drm_open_driver (DRIVER_VGEM )); -close (drm_open_driver_render (DRIVER_VGEM )); +drm_close_driver (drm_open_driver (DRIVER_VGEM )); +drm_close_driver (drm_open_driver_render (DRIVER_VGEM )); }static void test_create (int fd)@@ -635,6 +635,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/vgem_slow.c +1
-1@@ -97,6 +97,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }Signature · 1 line
2.40.0
PATCH v4 13/24 tests/amdgpu: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/amdgpu/amd_basic.c | 2 +- tests/amdgpu/amd_cs_nop.c | 2 +- tests/amdgpu/amd_deadlock.c | 2 +- tests/amdgpu/amd_info.c | 2 +- tests/amdgpu/amd_module_load.c | 2 +- tests/amdgpu/amd_prime.c | 6 +++--- 6 files changed, 8 insertions(+), 8 deletions(-)
tests/amdgpu/amd_basic.c +1 -1
@@ -696,6 +696,6 @@ igt_main igt_fixture {amdgpu_device_deinitialize (device); -close (fd); +drm_close_driver (fd); } }
tests/amdgpu/amd_cs_nop.c +1 -1
@@ -239,6 +239,6 @@ igt_main igt_fixture {amdgpu_cs_ctx_free (context);amdgpu_device_deinitialize (device); -close (fd); +drm_close_driver (fd); } }
tests/amdgpu/amd_deadlock.c +1 -1
@@ -118,6 +118,6 @@ igt_main igt_fixture {amdgpu_device_deinitialize (device); -close (fd); +drm_close_driver (fd); } }
tests/amdgpu/amd_info.c +1 -1
@@ -154,6 +154,6 @@ igt_main igt_fixture {amdgpu_device_deinitialize (dev); -close (fd); +drm_close_driver (fd); } }
tests/amdgpu/amd_module_load.c +1 -1
@@ -54,7 +54,7 @@ static void sanity_check(void) err = -errno;igt_set_timeout (0 ,NULL ); -close (fd); +drm_close_driver (fd);igt_assert_eq (err,0 ); }
tests/amdgpu/amd_prime.c +3 -3
@@ -166,7 +166,7 @@ static void amd_plug(amdgpu_device_handle device, struct cork *c)static void unplug (struct cork *c) {vgem_fence_signal (c->device, c->fence); -close (c->device); +drm_close_driver (c->device); }static void i915_to_amd (int i915,int amd,amdgpu_device_handle device)
@@ -461,7 +461,7 @@ igt_main igt_fixture {amdgpu_device_deinitialize (device); -close (amd); -close (i915); +drm_close_driver (amd); +drm_close_driver (i915); } }
Signature · 1 line
2.40.0
PATCH v4 14/24 tests/chamelium: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/chamelium/kms_chamelium_audio.c | 2 +- tests/chamelium/kms_chamelium_edid.c | 2 +- tests/chamelium/kms_chamelium_frames.c | 2 +- tests/chamelium/kms_chamelium_hpd.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)
tests/chamelium/kms_chamelium_audio.c +1 -1
@@ -870,6 +870,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/chamelium/kms_chamelium_edid.c +1 -1
@@ -585,6 +585,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/chamelium/kms_chamelium_frames.c +1 -1
@@ -1102,6 +1102,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/chamelium/kms_chamelium_hpd.c +1 -1
@@ -564,6 +564,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 14/24] tests/chamelium: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 5 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().Cc Mark Yacoub <[email protected]>Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 58 lines
--- tests/chamelium/kms_chamelium_audio.c | 2 +- tests/chamelium/kms_chamelium_edid.c | 2 +- tests/chamelium/kms_chamelium_frames.c | 2 +- tests/chamelium/kms_chamelium_hpd.c | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-)tests/chamelium/kms_chamelium_audio.c +1
-1@@ -870,6 +870,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/chamelium/kms_chamelium_edid.c +1
-1@@ -585,6 +585,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/chamelium/kms_chamelium_frames.c +1
-1@@ -1102,6 +1102,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/chamelium/kms_chamelium_hpd.c +1
-1@@ -564,6 +564,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }Signature · 1 line
2.40.0
PATCH v4 15/24 tests/panfrost: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/panfrost_gem_new.c | 4 ++-- tests/panfrost_get_param.c | 2 +- tests/panfrost_prime.c | 4 ++-- tests/panfrost_submit.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-)
tests/panfrost_gem_new.c +2 -2
@@ -82,9 +82,9 @@ igt_mainmunmap (map, size);igt_panfrost_free_bo (fd2, bo); -close (fd2); +drm_close_driver (fd2); }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/panfrost_get_param.c +1 -1
@@ -69,5 +69,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/panfrost_prime.c +2 -2
@@ -96,7 +96,7 @@ igt_main } igt_fixture { -close (fd); -close (kms_fd); +drm_close_driver (fd); +drm_close_driver (kms_fd); } }
tests/panfrost_submit.c +3 -3
@@ -154,7 +154,7 @@ igt_maincheck_done (headers[2 ]);igt_panfrost_free_job (fd, submit[0 ]);igt_panfrost_free_job (tmpfd, submit[1 ]); -close (tmpfd); +drm_close_driver (tmpfd); } igt_subtest("pan-submit-and-close") {
@@ -165,7 +165,7 @@ igt_main submit =igt_panfrost_job_loop (tmpfd);do_ioctl (tmpfd,DRM_IOCTL_PANFROST_SUBMIT , submit->args);igt_panfrost_free_job (tmpfd, submit); -close (tmpfd); +drm_close_driver (tmpfd); } igt_subtest("pan-unhandled-pagefault") {
@@ -197,6 +197,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 15/24] tests/panfrost: Use drm_close_driver() to close the drm fd
Quoted 5 lines · On Mon, 26 Jun 2023 10:40:22 +0530 Bhanuprakash Modem…
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().Cc Boris Brezillon <[email protected]>Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 78 lines
--- tests/panfrost_gem_new.c | 4 ++-- tests/panfrost_get_param.c | 2 +- tests/panfrost_prime.c | 4 ++-- tests/panfrost_submit.c | 6 +++--- 4 files changed, 8 insertions(+), 8 deletions(-)tests/panfrost_gem_new.c +2
-2@@ -82,9 +82,9 @@ igt_mainmunmap (map, size);igt_panfrost_free_bo (fd2, bo); -close (fd2); +drm_close_driver (fd2); }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/panfrost_get_param.c +1
-1@@ -69,5 +69,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/panfrost_prime.c +2
-2@@ -96,7 +96,7 @@ igt_main } igt_fixture { -close (fd); -close (kms_fd); +drm_close_driver (fd); +drm_close_driver (kms_fd); } }tests/panfrost_submit.c +3
-3@@ -154,7 +154,7 @@ igt_maincheck_done (headers[2 ]);igt_panfrost_free_job (fd, submit[0 ]);igt_panfrost_free_job (tmpfd, submit[1 ]); -close (tmpfd); +drm_close_driver (tmpfd); } igt_subtest("pan-submit-and-close") {@@ -165,7 +165,7 @@ igt_main submit =igt_panfrost_job_loop (tmpfd);do_ioctl (tmpfd,DRM_IOCTL_PANFROST_SUBMIT , submit->args);igt_panfrost_free_job (tmpfd, submit); -close (tmpfd); +drm_close_driver (tmpfd); } igt_subtest("pan-unhandled-pagefault") {@@ -197,6 +197,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
PATCH v4 16/24 tests/v3d: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/v3d/v3d_create_bo.c | 4 ++-- tests/v3d/v3d_get_bo_offset.c | 2 +- tests/v3d/v3d_get_param.c | 2 +- tests/v3d/v3d_job_submission.c | 2 +- tests/v3d/v3d_mmap.c | 2 +- tests/v3d/v3d_perfmon.c | 2 +- tests/v3d/v3d_submit_cl.c | 2 +- tests/v3d/v3d_submit_csd.c | 2 +- tests/v3d/v3d_wait_bo.c | 2 +- 9 files changed, 10 insertions(+), 10 deletions(-)
tests/v3d/v3d_create_bo.c +2 -2
@@ -63,9 +63,9 @@ igt_mainigt_assert_eq_u32 (((uint32_t *)bo->map)[i],0x0 );igt_v3d_free_bo (fd2, bo); -close (fd2); +drm_close_driver (fd2); }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_get_bo_offset.c +1 -1
@@ -67,5 +67,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_get_param.c +1 -1
@@ -69,5 +69,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_job_submission.c +1 -1
@@ -219,5 +219,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_mmap.c +1 -1
@@ -75,5 +75,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_perfmon.c +1 -1
@@ -142,5 +142,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_submit_cl.c +1 -1
@@ -376,5 +376,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_submit_csd.c +1 -1
@@ -360,5 +360,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/v3d/v3d_wait_bo.c +1 -1
@@ -122,6 +122,6 @@ igt_main igt_fixture {igt_v3d_free_bo (fd, bo); -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
PATCH v4 17/24 tests/vc4: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/vc4/vc4_create_bo.c | 4 ++-- tests/vc4/vc4_dmabuf_poll.c | 2 +- tests/vc4/vc4_label_bo.c | 2 +- tests/vc4/vc4_lookup_fail.c | 2 +- tests/vc4/vc4_mmap.c | 2 +- tests/vc4/vc4_perfmon.c | 2 +- tests/vc4/vc4_purgeable_bo.c | 2 +- tests/vc4/vc4_tiling.c | 2 +- tests/vc4/vc4_wait_bo.c | 2 +- tests/vc4/vc4_wait_seqno.c | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-)
tests/vc4/vc4_create_bo.c +2 -2
@@ -72,9 +72,9 @@ igt_mainmunmap (map, size);gem_close (fd2, handle); -close (fd2); +drm_close_driver (fd2); }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_dmabuf_poll.c +1 -1
@@ -73,5 +73,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_label_bo.c +1 -1
@@ -82,5 +82,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_lookup_fail.c +1 -1
@@ -67,5 +67,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_mmap.c +1 -1
@@ -49,5 +49,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_perfmon.c +1 -1
@@ -135,5 +135,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_purgeable_bo.c +1 -1
@@ -249,5 +249,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_tiling.c +1 -1
@@ -124,5 +124,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_wait_bo.c +1 -1
@@ -111,5 +111,5 @@ igt_maintest_used_bo (fd, ~0ull );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/vc4/vc4_wait_seqno.c +1 -1
@@ -55,5 +55,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
Signature · 1 line
2.40.0
PATCH v4 18/24 tests/vmwgfx: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- lib/igt_vmwgfx.c | 2 +- tests/vmwgfx/vmw_execution_buffer.c | 2 +- tests/vmwgfx/vmw_ref_count.c | 4 ++-- tests/vmwgfx/vmw_surface_copy.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-)
lib/igt_vmwgfx.c +1 -1
@@ -135,7 +135,7 @@ void vmw_svga_device_fini(struct vmw_svga_device *device)vmw_bitvector_free (device->rt_view_bv);vmw_bitvector_free (device->ds_view_bv);vmw_bitvector_free (device->shader_bv); -close (device->drm_fd); +drm_close_driver (device->drm_fd); } bool vmw_save_data_as_png(struct vmw_surface *surface, void *data,
tests/vmwgfx/vmw_execution_buffer.c +1 -1
@@ -308,6 +308,6 @@ igt_main_args("st:", long_options, NULL, parse_options, NULL) igt_fixture {vmw_ioctl_context_destroy (fd, cid); -close (fd); +drm_close_driver (fd); } }
tests/vmwgfx/vmw_ref_count.c +2 -2
@@ -314,7 +314,7 @@ igt_main igt_fixture { -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); } }
tests/vmwgfx/vmw_surface_copy.c +1 -1
@@ -336,6 +336,6 @@ igt_main igt_fixture {vmw_ioctl_context_destroy (fd, cid); -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
PATCH v4 19/24 tests/kms: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
V2: - New patch for chamelium tests
--- tests/i915/kms_big_fb.c | 2 +- tests/i915/kms_big_joiner.c | 2 +- tests/i915/kms_busy.c | 2 +- tests/i915/kms_ccs.c | 2 +- tests/i915/kms_cdclk.c | 2 +- tests/i915/kms_draw_crc.c | 2 +- tests/i915/kms_dsc.c | 2 +- tests/i915/kms_fbcon_fbt.c | 2 +- tests/i915/kms_fence_pin_leak.c | 2 +- tests/i915/kms_flip_scaled_crc.c | 2 +- tests/i915/kms_flip_tiling.c | 2 +- tests/i915/kms_frontbuffer_tracking.c | 2 +- tests/i915/kms_legacy_colorkey.c | 2 +- tests/i915/kms_mmap_write_crc.c | 2 +- tests/i915/kms_pipe_b_c_ivb.c | 2 +- tests/i915/kms_psr.c | 2 +- tests/i915/kms_psr2_sf.c | 2 +- tests/i915/kms_psr2_su.c | 2 +- tests/i915/kms_psr_stress_test.c | 2 +- tests/i915/kms_pwrite_crc.c | 2 +- tests/kms_3d.c | 2 +- tests/kms_addfb_basic.c | 4 ++-- tests/kms_async_flips.c | 2 +- tests/kms_atomic.c | 2 +- tests/kms_atomic_interruptible.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_color.c | 2 +- tests/kms_concurrent.c | 2 +- tests/kms_content_protection.c | 2 +- tests/kms_cursor_crc.c | 2 +- tests/kms_cursor_edge_walk.c | 2 +- tests/kms_cursor_legacy.c | 2 +- tests/kms_dither.c | 2 +- tests/kms_dp_aux_dev.c | 2 +- tests/kms_flip.c | 2 +- tests/kms_flip_event_leak.c | 4 ++-- tests/kms_force_connector_basic.c | 4 ++-- tests/kms_getfb.c | 4 ++-- tests/kms_hdmi_inject.c | 2 +- tests/kms_hdr.c | 2 +- tests/kms_invalid_mode.c | 2 +- tests/kms_lease.c | 4 ++-- tests/kms_panel_fitting.c | 2 +- tests/kms_pipe_crc_basic.c | 2 +- tests/kms_plane.c | 2 +- tests/kms_plane_alpha_blend.c | 2 +- tests/kms_plane_cursor.c | 2 +- tests/kms_plane_lowres.c | 2 +- tests/kms_plane_multiple.c | 2 +- tests/kms_plane_scaling.c | 2 +- tests/kms_prime.c | 6 +++--- tests/kms_prop_blob.c | 8 ++++---- tests/kms_properties.c | 2 +- tests/kms_rmfb.c | 4 ++-- tests/kms_rotation_crc.c | 2 +- tests/kms_scaling_modes.c | 2 +- tests/kms_sequence.c | 2 +- tests/kms_setmode.c | 2 +- tests/kms_tiled_display.c | 2 +- tests/kms_tv_load_detect.c | 2 +- tests/kms_universal_plane.c | 2 +- tests/kms_vblank.c | 2 +- 62 files changed, 73 insertions(+), 73 deletions(-)
tests/i915/kms_big_fb.c +1 -1
@@ -1054,6 +1054,6 @@ igt_main igt_fixture {igt_display_fini (&data.display);buf_ops_destroy (data.bops); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_big_joiner.c +1 -1
@@ -302,6 +302,6 @@ igt_main igt_fixture {igt_remove_fb (data.drm_fd, &data.fb);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_busy.c +1 -1
@@ -513,6 +513,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/i915/kms_ccs.c +1 -1
@@ -712,6 +712,6 @@ igt_main_args("cs:", NULL, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_cdclk.c +1 -1
@@ -397,6 +397,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_draw_crc.c +1 -1
@@ -242,7 +242,7 @@ static void teardown_environment(void)buf_ops_destroy (bops); -close (drm_fd); +drm_close_driver (drm_fd); }static const char *format_str (int format_index)
tests/i915/kms_dsc.c +1 -1
@@ -338,6 +338,6 @@ igt_main_args("l", NULL, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_fbcon_fbt.c +1 -1
@@ -408,7 +408,7 @@ static void teardown_environment(struct drm_info *drm)drmModeFreeResources (drm->res);close (drm->debugfs_fd); -close (drm->fd); +drm_close_driver (drm->fd);kmstest_restore_vt_mode (); }
tests/i915/kms_fence_pin_leak.c +1 -1
@@ -238,5 +238,5 @@ igt_simple_mainbuf_ops_destroy (data.bops);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }
tests/i915/kms_flip_scaled_crc.c +1 -1
@@ -694,6 +694,6 @@ igt_main }kmstest_set_vt_text_mode ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_flip_tiling.c +1 -1
@@ -240,6 +240,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_frontbuffer_tracking.c +1 -1
@@ -1353,7 +1353,7 @@ static void teardown_drm(void) {buf_ops_destroy (drm.bops);igt_display_fini (&drm.display); -close (drm.fd); +drm_close_driver (drm.fd); }static void setup_modeset (void )
tests/i915/kms_legacy_colorkey.c +1 -1
@@ -87,6 +87,6 @@ igt_main igt_fixture {igt_display_fini (&display); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/kms_mmap_write_crc.c +1 -1
@@ -306,7 +306,7 @@ igt_main_args("n", NULL, NULL, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd);igt_stop_helper (&hog); }
tests/i915/kms_pipe_b_c_ivb.c +1 -1
@@ -291,6 +291,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_psr.c +1 -1
@@ -670,6 +670,6 @@ igt_main_args("", long_options, help_str, opt_handler, &data)close (data.debugfs_fd);buf_ops_destroy (data.bops);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_psr2_sf.c +1 -1
@@ -1298,6 +1298,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_psr2_su.c +1 -1
@@ -373,6 +373,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_psr_stress_test.c +1 -1
@@ -378,6 +378,6 @@ igt_mainbuf_ops_destroy (data.bops);igt_display_fini (&data.display);close (data.debugfs_fd); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/kms_pwrite_crc.c +1 -1
@@ -193,5 +193,5 @@ igt_simple_mainrun_test (&data);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }
tests/kms_3d.c +1 -1
@@ -119,5 +119,5 @@ igt_simple_mainif (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); }
tests/kms_addfb_basic.c +2 -2
@@ -933,7 +933,7 @@ static void master_tests(int fd)do_ioctl_err (master2_fd,DRM_IOCTL_MODE_RMFB , &f.fb_id,ENOENT );igt_device_drop_master (master2_fd); -close (master2_fd); +drm_close_driver (master2_fd);igt_device_set_master (fd); }
@@ -1012,6 +1012,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/kms_async_flips.c +1 -1
@@ -676,6 +676,6 @@ igt_mainigt_display_reset (&data.display);igt_display_commit (&data.display);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_atomic.c +1 -1
@@ -1460,6 +1460,6 @@ igt_mainigt_remove_fb (display.drm_fd, &fb);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/kms_atomic_interruptible.c +1 -1
@@ -389,6 +389,6 @@ igt_main/* TODO: legacy gamma_set/get, object set/getprop, getcrtc, getconnector */ igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/kms_atomic_transition.c +1 -1
@@ -1182,6 +1182,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_color.c +1 -1
@@ -1120,6 +1120,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_concurrent.c +1 -1
@@ -400,6 +400,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)if (is_intel_device (data.drm_fd))intel_allocator_multiprocess_stop ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_content_protection.c +1 -1
@@ -884,6 +884,6 @@ igt_main igt_fixture {test_content_protection_cleanup ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_cursor_crc.c +1 -1
@@ -1016,6 +1016,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) }igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_cursor_edge_walk.c +1 -1
@@ -391,6 +391,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_cursor_legacy.c +1 -1
@@ -1843,6 +1843,6 @@ igt_mainif (intel_psr2_restore)i915_psr2_sel_fetch_restore (display.drm_fd);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/kms_dither.c +1 -1
@@ -247,6 +247,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_dp_aux_dev.c +1 -1
@@ -147,5 +147,5 @@ igt_simple_mainigt_require (valid_connectors);drmModeFreeResources (res); -close (drm_fd); +drm_close_driver (drm_fd); }
tests/kms_flip.c +1 -1
@@ -1930,6 +1930,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)if (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/kms_flip_event_leak.c +2 -2
@@ -79,7 +79,7 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)if (is_xe_device (fd))xe_device_put (fd); - ret =close (fd); + ret =drm_close_driver (fd);igt_assert_eq (ret,0 );igt_device_set_master (data->drm_fd);
@@ -121,6 +121,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_force_connector_basic.c +2 -2
@@ -65,7 +65,7 @@ static void reset_connectors(void)free (param); } -close (drm_fd); +drm_close_driver (drm_fd); }static void force_load_detect (int drm_fd,drmModeConnectorPtr connector,drmModeRes *res)
@@ -415,7 +415,7 @@ end: igt_fixture {drmModeFreeConnector (connector); -close (drm_fd); +drm_close_driver (drm_fd);reset_connectors (); }
tests/kms_getfb.c +2 -2
@@ -457,7 +457,7 @@ static void test_handle_protection(void) {if (is_xe_device (non_master_fd))xe_device_get (non_master_fd); -close (non_master_fd); +drm_close_driver (non_master_fd); } }
@@ -489,6 +489,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/kms_hdmi_inject.c +1 -1
@@ -227,6 +227,6 @@ igt_mainif (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/kms_hdr.c +1 -1
@@ -666,6 +666,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.fd); +drm_close_driver (data.fd); } }
tests/kms_invalid_mode.c +1 -1
@@ -300,6 +300,6 @@ igt_mainigt_display_fini (&data.display);igt_reset_connectors ();drmModeFreeResources (data.res); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_lease.c +2 -2
@@ -1082,7 +1082,7 @@ static void multimaster_lease(data_t *data)drmSetClientCap (master2_fd,DRM_CLIENT_CAP_UNIVERSAL_PLANES ,1 ); lease2_fd =create_simple_lease (master2_fd, data); -close (master2_fd);/* close is an implicit DropMaster */ +drm_close_driver (master2_fd);/* close is an implicit DropMaster */ igt_assert (!is_master (lease2_fd));igt_device_set_master (data->master.fd);
@@ -1278,6 +1278,6 @@ igt_main igt_fixture {igt_display_fini (display); -close (data.master.fd); +drm_close_driver (data.master.fd); } }
tests/kms_panel_fitting.c +1 -1
@@ -288,6 +288,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_pipe_crc_basic.c +1 -1
@@ -511,6 +511,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_plane.c +1 -1
@@ -1336,6 +1336,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_plane_alpha_blend.c +1 -1
@@ -715,6 +715,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) COMMIT_ATOMIC : COMMIT_LEGACY);igt_display_fini (&data.display); -close (data.gfx_fd); +drm_close_driver (data.gfx_fd); } }
tests/kms_plane_cursor.c +1 -1
@@ -331,6 +331,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_plane_lowres.c +1 -1
@@ -342,6 +342,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_plane_multiple.c +1 -1
@@ -478,6 +478,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_plane_scaling.c +1 -1
@@ -1324,6 +1324,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_prime.c +3 -3
@@ -431,7 +431,7 @@ igt_mainif (kms_poll_disabled)kms_poll_state_restore (); -close (second_fd_hybrid); +drm_close_driver (second_fd_hybrid); } }
@@ -454,9 +454,9 @@ igt_main }igt_fixture -close (second_fd_vgem ); +drm_close_driver (second_fd_vgem ); }igt_fixture -close (first_fd ); +drm_close_driver (first_fd ); }
tests/kms_prop_blob.c +4 -4
@@ -182,7 +182,7 @@ test_lifetime(int fd)/* Make sure properties are cleaned up on client exit. */ prop_id2 =create_prop (fd2);igt_assert_eq (validate_prop (fd, prop_id2),0 ); -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 );igt_assert_eq (validate_prop (fd, prop_id2),ENOENT );igt_assert_eq (validate_prop (fd, prop_id),0 );
@@ -210,7 +210,7 @@ test_multiple(int fd)igt_assert_eq (destroy_prop (fd2, prop_ids[i]),0 );igt_assert_eq (validate_prop (fd2, prop_ids[i]),ENOENT ); } -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 ); fd2 =drm_open_driver (DRIVER_ANY );igt_assert_fd (fd2);
@@ -221,7 +221,7 @@ test_multiple(int fd)igt_assert_eq (validate_prop (fd, prop_ids[i]),0 );igt_assert_eq (validate_prop (fd2, prop_ids[i]),0 ); } -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 );for (i =0 ; i <ARRAY_SIZE (prop_ids); i++)igt_assert_eq (validate_prop (fd, prop_ids[i]),ENOENT );
@@ -350,5 +350,5 @@ igt_mainprop_tests (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/kms_properties.c +1 -1
@@ -810,6 +810,6 @@ igt_main igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/kms_rmfb.c +2 -2
@@ -121,7 +121,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reodrmModeFreeCrtc (crtc);if (reopen) { -close (data->drm_fd); +drm_close_driver (data->drm_fd); data->drm_fd =drm_open_driver_master (DRIVER_ANY );drmSetClientCap (data->drm_fd,DRM_CLIENT_CAP_UNIVERSAL_PLANES ,1 );
@@ -204,6 +204,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_rotation_crc.c +1 -1
@@ -1292,6 +1292,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.gfx_fd); +drm_close_driver (data.gfx_fd); } }
tests/kms_scaling_modes.c +1 -1
@@ -138,6 +138,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_sequence.c +1 -1
@@ -303,6 +303,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/kms_setmode.c +1 -1
@@ -978,6 +978,6 @@ igt_main_args("det:", NULL, help_str, opt_handler, NULL)if (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/kms_tiled_display.c +1 -1
@@ -623,6 +623,6 @@ igt_mainfree (data.conns);kmstest_restore_vt_mode ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_tv_load_detect.c +1 -1
@@ -84,6 +84,6 @@ igt_main igt_fixture {drmModeFreeConnector (tv_connector); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/kms_universal_plane.c +1 -1
@@ -918,6 +918,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/kms_vblank.c +1 -1
@@ -601,6 +601,6 @@ igt_mainrun_subtests_for_pipe (&data); igt_fixture { -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 19/24] tests/kms: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 6 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().V2: - New patch for chamelium tests
Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 906 lines
--- tests/i915/kms_big_fb.c | 2 +- tests/i915/kms_big_joiner.c | 2 +- tests/i915/kms_busy.c | 2 +- tests/i915/kms_ccs.c | 2 +- tests/i915/kms_cdclk.c | 2 +- tests/i915/kms_draw_crc.c | 2 +- tests/i915/kms_dsc.c | 2 +- tests/i915/kms_fbcon_fbt.c | 2 +- tests/i915/kms_fence_pin_leak.c | 2 +- tests/i915/kms_flip_scaled_crc.c | 2 +- tests/i915/kms_flip_tiling.c | 2 +- tests/i915/kms_frontbuffer_tracking.c | 2 +- tests/i915/kms_legacy_colorkey.c | 2 +- tests/i915/kms_mmap_write_crc.c | 2 +- tests/i915/kms_pipe_b_c_ivb.c | 2 +- tests/i915/kms_psr.c | 2 +- tests/i915/kms_psr2_sf.c | 2 +- tests/i915/kms_psr2_su.c | 2 +- tests/i915/kms_psr_stress_test.c | 2 +- tests/i915/kms_pwrite_crc.c | 2 +- tests/kms_3d.c | 2 +- tests/kms_addfb_basic.c | 4 ++-- tests/kms_async_flips.c | 2 +- tests/kms_atomic.c | 2 +- tests/kms_atomic_interruptible.c | 2 +- tests/kms_atomic_transition.c | 2 +- tests/kms_color.c | 2 +- tests/kms_concurrent.c | 2 +- tests/kms_content_protection.c | 2 +- tests/kms_cursor_crc.c | 2 +- tests/kms_cursor_edge_walk.c | 2 +- tests/kms_cursor_legacy.c | 2 +- tests/kms_dither.c | 2 +- tests/kms_dp_aux_dev.c | 2 +- tests/kms_flip.c | 2 +- tests/kms_flip_event_leak.c | 4 ++-- tests/kms_force_connector_basic.c | 4 ++-- tests/kms_getfb.c | 4 ++-- tests/kms_hdmi_inject.c | 2 +- tests/kms_hdr.c | 2 +- tests/kms_invalid_mode.c | 2 +- tests/kms_lease.c | 4 ++-- tests/kms_panel_fitting.c | 2 +- tests/kms_pipe_crc_basic.c | 2 +- tests/kms_plane.c | 2 +- tests/kms_plane_alpha_blend.c | 2 +- tests/kms_plane_cursor.c | 2 +- tests/kms_plane_lowres.c | 2 +- tests/kms_plane_multiple.c | 2 +- tests/kms_plane_scaling.c | 2 +- tests/kms_prime.c | 6 +++--- tests/kms_prop_blob.c | 8 ++++---- tests/kms_properties.c | 2 +- tests/kms_rmfb.c | 4 ++-- tests/kms_rotation_crc.c | 2 +- tests/kms_scaling_modes.c | 2 +- tests/kms_sequence.c | 2 +- tests/kms_setmode.c | 2 +- tests/kms_tiled_display.c | 2 +- tests/kms_tv_load_detect.c | 2 +- tests/kms_universal_plane.c | 2 +- tests/kms_vblank.c | 2 +- 62 files changed, 73 insertions(+), 73 deletions(-)tests/i915/kms_big_fb.c +1
-1@@ -1054,6 +1054,6 @@ igt_main igt_fixture {igt_display_fini (&data.display);buf_ops_destroy (data.bops); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_big_joiner.c +1
-1@@ -302,6 +302,6 @@ igt_main igt_fixture {igt_remove_fb (data.drm_fd, &data.fb);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_busy.c +1
-1@@ -513,6 +513,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/i915/kms_ccs.c +1
-1@@ -712,6 +712,6 @@ igt_main_args("cs:", NULL, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_cdclk.c +1
-1@@ -397,6 +397,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_draw_crc.c +1
-1@@ -242,7 +242,7 @@ static void teardown_environment(void)buf_ops_destroy (bops); -close (drm_fd); +drm_close_driver (drm_fd); }static const char *format_str (int format_index)tests/i915/kms_dsc.c +1
-1@@ -338,6 +338,6 @@ igt_main_args("l", NULL, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_fbcon_fbt.c +1
-1@@ -408,7 +408,7 @@ static void teardown_environment(struct drm_info *drm)drmModeFreeResources (drm->res);close (drm->debugfs_fd); -close (drm->fd); +drm_close_driver (drm->fd);kmstest_restore_vt_mode (); }tests/i915/kms_fence_pin_leak.c +1
-1@@ -238,5 +238,5 @@ igt_simple_mainbuf_ops_destroy (data.bops);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }tests/i915/kms_flip_scaled_crc.c +1
-1@@ -694,6 +694,6 @@ igt_main }kmstest_set_vt_text_mode ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_flip_tiling.c +1
-1@@ -240,6 +240,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_frontbuffer_tracking.c +1
-1@@ -1353,7 +1353,7 @@ static void teardown_drm(void) {buf_ops_destroy (drm.bops);igt_display_fini (&drm.display); -close (drm.fd); +drm_close_driver (drm.fd); }static void setup_modeset (void )tests/i915/kms_legacy_colorkey.c +1
-1@@ -87,6 +87,6 @@ igt_main igt_fixture {igt_display_fini (&display); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/i915/kms_mmap_write_crc.c +1
-1@@ -306,7 +306,7 @@ igt_main_args("n", NULL, NULL, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd);igt_stop_helper (&hog); }tests/i915/kms_pipe_b_c_ivb.c +1
-1@@ -291,6 +291,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_psr.c +1
-1@@ -670,6 +670,6 @@ igt_main_args("", long_options, help_str, opt_handler, &data)close (data.debugfs_fd);buf_ops_destroy (data.bops);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_psr2_sf.c +1
-1@@ -1298,6 +1298,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_psr2_su.c +1
-1@@ -373,6 +373,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_psr_stress_test.c +1
-1@@ -378,6 +378,6 @@ igt_mainbuf_ops_destroy (data.bops);igt_display_fini (&data.display);close (data.debugfs_fd); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/kms_pwrite_crc.c +1
-1@@ -193,5 +193,5 @@ igt_simple_mainrun_test (&data);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }tests/kms_3d.c +1
-1@@ -119,5 +119,5 @@ igt_simple_mainif (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); }tests/kms_addfb_basic.c +2
-2@@ -933,7 +933,7 @@ static void master_tests(int fd)do_ioctl_err (master2_fd,DRM_IOCTL_MODE_RMFB , &f.fb_id,ENOENT );igt_device_drop_master (master2_fd); -close (master2_fd); +drm_close_driver (master2_fd);igt_device_set_master (fd); }@@ -1012,6 +1012,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/kms_async_flips.c +1
-1@@ -676,6 +676,6 @@ igt_mainigt_display_reset (&data.display);igt_display_commit (&data.display);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_atomic.c +1
-1@@ -1460,6 +1460,6 @@ igt_mainigt_remove_fb (display.drm_fd, &fb);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/kms_atomic_interruptible.c +1
-1@@ -389,6 +389,6 @@ igt_main/* TODO: legacy gamma_set/get, object set/getprop, getcrtc, getconnector */ igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/kms_atomic_transition.c +1
-1@@ -1182,6 +1182,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_color.c +1
-1@@ -1120,6 +1120,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_concurrent.c +1
-1@@ -400,6 +400,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)if (is_intel_device (data.drm_fd))intel_allocator_multiprocess_stop ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_content_protection.c +1
-1@@ -884,6 +884,6 @@ igt_main igt_fixture {test_content_protection_cleanup ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_cursor_crc.c +1
-1@@ -1016,6 +1016,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) }igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_cursor_edge_walk.c +1
-1@@ -391,6 +391,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_cursor_legacy.c +1
-1@@ -1843,6 +1843,6 @@ igt_mainif (intel_psr2_restore)i915_psr2_sel_fetch_restore (display.drm_fd);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/kms_dither.c +1
-1@@ -247,6 +247,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_dp_aux_dev.c +1
-1@@ -147,5 +147,5 @@ igt_simple_mainigt_require (valid_connectors);drmModeFreeResources (res); -close (drm_fd); +drm_close_driver (drm_fd); }tests/kms_flip.c +1
-1@@ -1930,6 +1930,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)if (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/kms_flip_event_leak.c +2
-2@@ -79,7 +79,7 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)if (is_xe_device (fd))xe_device_put (fd); - ret =close (fd); + ret =drm_close_driver (fd);igt_assert_eq (ret,0 );igt_device_set_master (data->drm_fd);@@ -121,6 +121,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_force_connector_basic.c +2
-2@@ -65,7 +65,7 @@ static void reset_connectors(void)free (param); } -close (drm_fd); +drm_close_driver (drm_fd); }static void force_load_detect (int drm_fd,drmModeConnectorPtr connector,drmModeRes *res)@@ -415,7 +415,7 @@ end: igt_fixture {drmModeFreeConnector (connector); -close (drm_fd); +drm_close_driver (drm_fd);reset_connectors (); }tests/kms_getfb.c +2
-2@@ -457,7 +457,7 @@ static void test_handle_protection(void) {if (is_xe_device (non_master_fd))xe_device_get (non_master_fd); -close (non_master_fd); +drm_close_driver (non_master_fd); } }@@ -489,6 +489,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/kms_hdmi_inject.c +1
-1@@ -227,6 +227,6 @@ igt_mainif (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/kms_hdr.c +1
-1@@ -666,6 +666,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.fd); +drm_close_driver (data.fd); } }tests/kms_invalid_mode.c +1
-1@@ -300,6 +300,6 @@ igt_mainigt_display_fini (&data.display);igt_reset_connectors ();drmModeFreeResources (data.res); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_lease.c +2
-2@@ -1082,7 +1082,7 @@ static void multimaster_lease(data_t *data)drmSetClientCap (master2_fd,DRM_CLIENT_CAP_UNIVERSAL_PLANES ,1 ); lease2_fd =create_simple_lease (master2_fd, data); -close (master2_fd);/* close is an implicit DropMaster */ +drm_close_driver (master2_fd);/* close is an implicit DropMaster */ igt_assert (!is_master (lease2_fd));igt_device_set_master (data->master.fd);@@ -1278,6 +1278,6 @@ igt_main igt_fixture {igt_display_fini (display); -close (data.master.fd); +drm_close_driver (data.master.fd); } }tests/kms_panel_fitting.c +1
-1@@ -288,6 +288,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_pipe_crc_basic.c +1
-1@@ -511,6 +511,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_plane.c +1
-1@@ -1336,6 +1336,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_plane_alpha_blend.c +1
-1@@ -715,6 +715,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) COMMIT_ATOMIC : COMMIT_LEGACY);igt_display_fini (&data.display); -close (data.gfx_fd); +drm_close_driver (data.gfx_fd); } }tests/kms_plane_cursor.c +1
-1@@ -331,6 +331,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_plane_lowres.c +1
-1@@ -342,6 +342,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_plane_multiple.c +1
-1@@ -478,6 +478,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_plane_scaling.c +1
-1@@ -1324,6 +1324,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_prime.c +3
-3@@ -431,7 +431,7 @@ igt_mainif (kms_poll_disabled)kms_poll_state_restore (); -close (second_fd_hybrid); +drm_close_driver (second_fd_hybrid); } }@@ -454,9 +454,9 @@ igt_main }igt_fixture -close (second_fd_vgem ); +drm_close_driver (second_fd_vgem ); }igt_fixture -close (first_fd ); +drm_close_driver (first_fd ); }tests/kms_prop_blob.c +4
-4@@ -182,7 +182,7 @@ test_lifetime(int fd)/* Make sure properties are cleaned up on client exit. */ prop_id2 =create_prop (fd2);igt_assert_eq (validate_prop (fd, prop_id2),0 ); -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 );igt_assert_eq (validate_prop (fd, prop_id2),ENOENT );igt_assert_eq (validate_prop (fd, prop_id),0 );@@ -210,7 +210,7 @@ test_multiple(int fd)igt_assert_eq (destroy_prop (fd2, prop_ids[i]),0 );igt_assert_eq (validate_prop (fd2, prop_ids[i]),ENOENT ); } -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 ); fd2 =drm_open_driver (DRIVER_ANY );igt_assert_fd (fd2);@@ -221,7 +221,7 @@ test_multiple(int fd)igt_assert_eq (validate_prop (fd, prop_ids[i]),0 );igt_assert_eq (validate_prop (fd2, prop_ids[i]),0 ); } -igt_assert_eq (close (fd2),0 ); +igt_assert_eq (drm_close_driver (fd2),0 );for (i =0 ; i <ARRAY_SIZE (prop_ids); i++)igt_assert_eq (validate_prop (fd, prop_ids[i]),ENOENT );@@ -350,5 +350,5 @@ igt_mainprop_tests (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/kms_properties.c +1
-1@@ -810,6 +810,6 @@ igt_main igt_fixture {igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/kms_rmfb.c +2
-2@@ -121,7 +121,7 @@ test_rmfb(struct rmfb_data *data, igt_output_t *output, enum pipe pipe, bool reodrmModeFreeCrtc (crtc);if (reopen) { -close (data->drm_fd); +drm_close_driver (data->drm_fd); data->drm_fd =drm_open_driver_master (DRIVER_ANY );drmSetClientCap (data->drm_fd,DRM_CLIENT_CAP_UNIVERSAL_PLANES ,1 );@@ -204,6 +204,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_rotation_crc.c +1
-1@@ -1292,6 +1292,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); -close (data.gfx_fd); +drm_close_driver (data.gfx_fd); } }tests/kms_scaling_modes.c +1
-1@@ -138,6 +138,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_sequence.c +1
-1@@ -303,6 +303,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/kms_setmode.c +1
-1@@ -978,6 +978,6 @@ igt_main_args("det:", NULL, help_str, opt_handler, NULL)if (is_xe_device (drm_fd))xe_device_put (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/kms_tiled_display.c +1
-1@@ -623,6 +623,6 @@ igt_mainfree (data.conns);kmstest_restore_vt_mode ();igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_tv_load_detect.c +1
-1@@ -84,6 +84,6 @@ igt_main igt_fixture {drmModeFreeConnector (tv_connector); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/kms_universal_plane.c +1
-1@@ -918,6 +918,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/kms_vblank.c +1
-1@@ -601,6 +601,6 @@ igt_mainrun_subtests_for_pipe (&data); igt_fixture { -close (fd); +drm_close_driver (fd); } }Signature · 1 line
2.40.0
PATCH v4 20/24 tests/xe: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- tests/testdisplay.c | 4 ++-- tests/xe/xe_compute.c | 2 +- tests/xe/xe_create.c | 4 ++-- tests/xe/xe_debugfs.c | 2 +- tests/xe/xe_dma_buf_sync.c | 4 ++-- tests/xe/xe_evict.c | 6 +++--- tests/xe/xe_exec_balancer.c | 2 +- tests/xe/xe_exec_basic.c | 2 +- tests/xe/xe_exec_compute_mode.c | 2 +- tests/xe/xe_exec_fault_mode.c | 2 +- tests/xe/xe_exec_reset.c | 8 ++++---- tests/xe/xe_exec_threads.c | 8 ++++---- tests/xe/xe_guc_pc.c | 2 +- tests/xe/xe_huc_copy.c | 2 +- tests/xe/xe_intel_bb.c | 2 +- tests/xe/xe_mmap.c | 2 +- tests/xe/xe_mmio.c | 2 +- tests/xe/xe_module_load.c | 2 +- tests/xe/xe_noexec_ping_pong.c | 2 +- tests/xe/xe_pm.c | 2 +- tests/xe/xe_prime_self_import.c | 30 +++++++++++++++--------------- tests/xe/xe_query.c | 2 +- tests/xe/xe_spin_batch.c | 2 +- tests/xe/xe_vm.c | 2 +- tests/xe/xe_waitfence.c | 2 +- 25 files changed, 50 insertions(+), 50 deletions(-)
tests/testdisplay.c +2 -2
@@ -548,7 +548,7 @@ int update_display(bool probe)__noreturn static void cleanup_and_exit (int ret) { -close (drm_fd); +drm_close_driver (drm_fd);exit (ret); }
@@ -779,7 +779,7 @@ out_hotplug: out_mainloop:g_main_loop_unref (mainloop); out_close: -close (drm_fd); +drm_close_driver (drm_fd);igt_assert_eq (ret,0 ); }
tests/xe/xe_compute.c +1 -1
@@ -46,6 +46,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_create.c +2 -2
@@ -177,7 +177,7 @@ static void create_engines(int fd, enum engine_destroy ed)igt_waitchildren ();xe_vm_destroy (fd, vm); -close (fd); +drm_close_driver (fd); seconds =igt_seconds_elapsed (&tv); igt_assert_f(seconds < MAXTIME,
@@ -231,6 +231,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_debugfs.c +1 -1
@@ -271,6 +271,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_dma_buf_sync.c +2 -2
@@ -219,7 +219,7 @@ test_export_dma_buf(struct drm_xe_engine_class_instance *hwe0,for (i =0 ; i <N_FD ; ++i) {xe_device_put (fd[i]); -close (fd[i]); +drm_close_driver (fd[i]); } }
@@ -256,6 +256,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_evict.c +3 -3
@@ -201,7 +201,7 @@ test_evict(int fd, struct drm_xe_engine_class_instance *eci,xe_vm_destroy (fd, vm3); }xe_device_put (fd); -close (fd); +drm_close_driver (fd); } static void
@@ -369,7 +369,7 @@ test_evict_cm(int fd, struct drm_xe_engine_class_instance *eci,if (flags &MULTI_VM )xe_vm_destroy (fd, vm2);xe_device_put (fd); -close (fd); +drm_close_driver (fd); }struct thread_data {
@@ -700,5 +700,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/xe/xe_exec_balancer.c +1 -1
@@ -701,6 +701,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_basic.c +1 -1
@@ -350,6 +350,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_compute_mode.c +1 -1
@@ -366,6 +366,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_fault_mode.c +1 -1
@@ -562,6 +562,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_reset.c +4 -4
@@ -286,7 +286,7 @@ test_balancer(int fd, int gt, int class, int n_engines, int n_execs,xe_engine_destroy (fd, engines[i]); }xe_device_put (fd); -close (fd); +drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );return ;
@@ -461,7 +461,7 @@ test_legacy_mode(int fd, struct drm_xe_engine_class_instance *eci,xe_engine_destroy (fd, engines[i]); }xe_device_put (fd); -close (fd); +drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );return ;
@@ -636,7 +636,7 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,xe_engine_destroy (fd, engines[i]); }xe_device_put (fd); -close (fd); +drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );return ;
@@ -927,6 +927,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_threads.c +4 -4
@@ -245,7 +245,7 @@ test_balancer(int fd, int gt, uint32_t vm, uint64_t addr, uint64_t userptr,xe_vm_destroy (fd, vm);if (owns_fd) {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
@@ -459,7 +459,7 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,xe_vm_destroy (fd, vm);if (owns_fd) {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
@@ -703,7 +703,7 @@ test_legacy_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,xe_vm_destroy (fd, vm);if (owns_fd) {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
@@ -1407,6 +1407,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_guc_pc.c +1 -1
@@ -490,6 +490,6 @@ igt_main }close (sysfs);xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_huc_copy.c +1 -1
@@ -192,6 +192,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_intel_bb.c +1 -1
@@ -1143,6 +1143,6 @@ igt_main_args("dpib", NULL, help_str, opt_handler, NULL) igt_fixture {xe_device_put (xe);buf_ops_destroy (bops); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_mmap.c +1 -1
@@ -140,6 +140,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_mmio.c +1 -1
@@ -90,6 +90,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_module_load.c +1 -1
@@ -87,7 +87,7 @@ static void load_and_check_xe(const char *opts)/* driver is ready, check if it's bound */ drm_fd =__drm_open_driver (DRIVER_XE );igt_fail_on_f (drm_fd <0 ,"Cannot open the xe DRM driver after modprobing xe.\n" ); -close (drm_fd); +drm_close_driver (drm_fd); }static const char *const unwanted_drivers[] = {
tests/xe/xe_noexec_ping_pong.c +1 -1
@@ -104,5 +104,5 @@ igt_simple_maintest_ping_pong (fd,xe_hw_engine (fd,0 ));xe_device_put (fd); -close (fd); +drm_close_driver (fd); }
tests/xe/xe_pm.c +1 -1
@@ -445,6 +445,6 @@ igt_mainset_d3cold_allowed (device.pci_xe, d3cold_allowed);igt_restore_runtime_pm ();xe_device_put (device.fd_xe); -close (device.fd_xe); +drm_close_driver (device.fd_xe); } }
tests/xe/xe_prime_self_import.c +15 -15
@@ -123,9 +123,9 @@ static void test_with_fd_dup(void)check_bo (fd2, handle_import, fd2, handle_import);xe_device_put (fd1); -close (fd1); +drm_close_driver (fd1);xe_device_put (fd2); -close (fd2); +drm_close_driver (fd2); }/**
@@ -166,9 +166,9 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import);xe_device_put (fd1); -close (fd1); +drm_close_driver (fd1);xe_device_put (fd2); -close (fd2); +drm_close_driver (fd2); }/**
@@ -201,9 +201,9 @@ static void test_with_one_bo_two_files(void)igt_assert_eq_u32 (handle_import, handle_open);xe_device_put (fd1); -close (fd1); +drm_close_driver (fd1);xe_device_put (fd2); -close (fd2); +drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2); }
@@ -258,10 +258,10 @@ static void test_with_one_bo(void)/* Completely rip out exporting fd. */ xe_device_put (fd1); -close (fd1); +drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1);xe_device_put (fd2); -close (fd2); +drm_close_driver (fd2); }static void *thread_fn_reimport_vs_close (void *p)
@@ -334,7 +334,7 @@ static void *thread_fn_reimport_vs_close(void *p)pthread_barrier_destroy (&g_barrier);xe_device_put (fds[0 ]); -close (fds[0 ]); +drm_close_driver (fds[0 ]);close (fds[1 ]);/* TODO: Read object count */
@@ -342,7 +342,7 @@ static void *thread_fn_reimport_vs_close(void *p)igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -428,7 +428,7 @@ static void test_export_close_race(void)pthread_barrier_destroy (&g_barrier);xe_device_put (fd); -close (fd); +drm_close_driver (fd);/* TODO: Read object count */ obj_count =0 ;
@@ -436,7 +436,7 @@ static void test_export_close_race(void)igt_info ("leaked %i objects\n" , obj_count);xe_device_put (fake); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
@@ -472,7 +472,7 @@ static void test_llseek_size(void) }xe_device_put (fd); -close (fd); +drm_close_driver (fd); }/**
@@ -508,7 +508,7 @@ static void test_llseek_bad(void)close (dma_buf_fd);xe_device_put (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -541,6 +541,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_query.c +1 -1
@@ -492,6 +492,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_spin_batch.c +1 -1
@@ -167,6 +167,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_vm.c +1 -1
@@ -1856,6 +1856,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_waitfence.c +1 -1
@@ -132,6 +132,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
PATCH v4 21/24 tests/i915: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
V2: - New patch for generic tests
V3: - Rebase
--- tests/i915/api_intel_allocator.c | 6 ++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/drm_fdinfo.c | 2 +- tests/i915/gem_bad_reloc.c | 2 +- tests/i915/gem_barrier_race.c | 2 +- tests/i915/gem_basic.c | 2 +- tests/i915/gem_blits.c | 2 +- tests/i915/gem_busy.c | 2 +- tests/i915/gem_caching.c | 2 +- tests/i915/gem_ccs.c | 2 +- tests/i915/gem_close_race.c | 12 ++++---- tests/i915/gem_cs_tlb.c | 2 +- tests/i915/gem_ctx_bad_destroy.c | 2 +- tests/i915/gem_ctx_create.c | 4 +-- tests/i915/gem_ctx_exec.c | 2 +- tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 6 ++-- tests/i915/gem_ctx_shared.c | 2 +- tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 16 +++++------ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 2 +- tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_basic.c | 2 +- tests/i915/gem_exec_big.c | 2 +- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_create.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 4 +-- tests/i915/gem_exec_flush.c | 2 +- tests/i915/gem_exec_gttfill.c | 4 +-- tests/i915/gem_exec_latency.c | 2 +- tests/i915/gem_exec_nop.c | 2 +- tests/i915/gem_exec_parallel.c | 4 +-- tests/i915/gem_exec_params.c | 2 +- tests/i915/gem_exec_reloc.c | 2 +- tests/i915/gem_exec_schedule.c | 2 +- tests/i915/gem_exec_store.c | 2 +- tests/i915/gem_exec_suspend.c | 2 +- tests/i915/gem_exec_whisper.c | 6 ++-- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 2 +- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 4 +-- tests/i915/gem_flink_race.c | 6 ++-- tests/i915/gem_gtt_cpu_tlb.c | 2 +- tests/i915/gem_gtt_hog.c | 2 +- tests/i915/gem_gtt_speed.c | 2 +- tests/i915/gem_huc_copy.c | 2 +- tests/i915/gem_lmem_evict.c | 4 +-- tests/i915/gem_lmem_swapping.c | 10 +++---- tests/i915/gem_madvise.c | 12 ++++---- tests/i915/gem_media_fill.c | 2 +- tests/i915/gem_mmap.c | 2 +- tests/i915/gem_mmap_gtt.c | 6 ++-- tests/i915/gem_mmap_offset.c | 8 +++--- tests/i915/gem_mmap_wc.c | 2 +- tests/i915/gem_partial_pwrite_pread.c | 2 +- tests/i915/gem_pipe_control_store_loop.c | 2 +- tests/i915/gem_ppgtt.c | 8 +++--- tests/i915/gem_pread.c | 2 +- tests/i915/gem_pread_after_blit.c | 2 +- tests/i915/gem_pwrite.c | 2 +- tests/i915/gem_pwrite_snooped.c | 2 +- tests/i915/gem_pxp.c | 2 +- tests/i915/gem_read_read_speed.c | 2 +- tests/i915/gem_readwrite.c | 2 +- tests/i915/gem_reg_read.c | 2 +- tests/i915/gem_render_copy.c | 2 +- tests/i915/gem_render_copy_redux.c | 2 +- tests/i915/gem_reset_stats.c | 32 ++++++++++----------- tests/i915/gem_ringfill.c | 2 +- tests/i915/gem_set_tiling_vs_blt.c | 2 +- tests/i915/gem_set_tiling_vs_gtt.c | 2 +- tests/i915/gem_set_tiling_vs_pwrite.c | 2 +- tests/i915/gem_shrink.c | 14 ++++----- tests/i915/gem_softpin.c | 4 +-- tests/i915/gem_spin_batch.c | 2 +- tests/i915/gem_streaming_writes.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_sync.c | 2 +- tests/i915/gem_tiled_blits.c | 2 +- tests/i915/gem_tiled_fence_blits.c | 2 +- tests/i915/gem_tiled_partial_pwrite_pread.c | 2 +- tests/i915/gem_tiled_pread_basic.c | 2 +- tests/i915/gem_tiled_pread_pwrite.c | 2 +- tests/i915/gem_tiled_swapping.c | 2 +- tests/i915/gem_tiled_wb.c | 2 +- tests/i915/gem_tiled_wc.c | 2 +- tests/i915/gem_tiling_max_stride.c | 2 +- tests/i915/gem_unfence_active_buffers.c | 2 +- tests/i915/gem_unref_active_buffers.c | 2 +- tests/i915/gem_userptr_blits.c | 6 ++-- tests/i915/gem_vm_create.c | 4 +-- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 2 +- tests/i915/gen7_exec_parse.c | 4 +-- tests/i915/gen9_exec_parse.c | 2 +- tests/i915/i915_fb_tiling.c | 2 +- tests/i915/i915_getparams_basic.c | 2 +- tests/i915/i915_hangman.c | 4 +-- tests/i915/i915_hwmon.c | 2 +- tests/i915/i915_module_load.c | 8 +++--- tests/i915/i915_pciid.c | 2 +- tests/i915/i915_pm_backlight.c | 2 +- tests/i915/i915_pm_dc.c | 2 +- tests/i915/i915_pm_freq_api.c | 2 +- tests/i915/i915_pm_freq_mult.c | 2 +- tests/i915/i915_pm_lpsp.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/i915_pm_rps.c | 2 +- tests/i915/i915_pm_sseu.c | 2 +- tests/i915/i915_power.c | 2 +- tests/i915/i915_query.c | 2 +- tests/i915/i915_suspend.c | 6 ++-- tests/i915/perf.c | 6 ++-- tests/i915/perf_pmu.c | 6 ++-- tests/i915/sysfs_defaults.c | 2 +- tests/i915/sysfs_heartbeat_interval.c | 2 +- tests/i915/sysfs_preempt_timeout.c | 2 +- tests/i915/sysfs_timeslice_duration.c | 2 +- 126 files changed, 205 insertions(+), 205 deletions(-)
tests/i915/api_intel_allocator.c +3 -3
@@ -579,7 +579,7 @@ static void reopen(int fd)__reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2); }#define REOPEN_TIMEOUT 3
@@ -605,7 +605,7 @@ static void reopen_fork(int fd)/* Check references at the end */ __reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2);intel_allocator_multiprocess_stop (); }
@@ -924,5 +924,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/api_intel_bb.c +1 -1
@@ -1908,6 +1908,6 @@ igt_main_args("dpibc:", NULL, help_str, opt_handler, NULL) igt_fixture {buf_ops_destroy (bops); -close (i915); +drm_close_driver (i915); } }
tests/i915/drm_fdinfo.c +1 -1
@@ -910,6 +910,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_bad_reloc.c +1 -1
@@ -231,5 +231,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_barrier_race.c +1 -1
@@ -120,7 +120,7 @@ static void intel_context_first_pin_last_unpin_loop(int fd, uint64_t engine, int }while (!READ_ONCE (*done)); -close (fd); +drm_close_driver (fd); }static void test_remote_request (int fd,uint64_t engine,unsigned int timeout)
tests/i915/gem_basic.c +1 -1
@@ -145,7 +145,7 @@ igt_main gpu_fd =__drm_open_driver_another (child,DRIVER_INTEL );igt_assert_f (gpu_fd >0 ,"cannot open gpu-%d, errno=%d\n" , child, errno);test_create_close (gpu_fd); -close (gpu_fd); +drm_close_driver (gpu_fd); }igt_waitchildren ();
tests/i915/gem_blits.c +1 -1
@@ -904,6 +904,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }
tests/i915/gem_busy.c +1 -1
@@ -617,6 +617,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_caching.c +1 -1
@@ -356,6 +356,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.fd); +drm_close_driver (data.fd); } }
tests/i915/gem_ccs.c +1 -1
@@ -764,6 +764,6 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL) igt_fixture {igt_disallow_hang (i915, hang); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_close_race.c +6 -6
@@ -329,7 +329,7 @@ static void multigpu_threads(int timeout, unsigned int flags, int gpu_count)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -348,7 +348,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -372,7 +372,7 @@ igt_main gpu_count =igt_device_filter_count ();igt_fork_hang_detector (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission." );
@@ -384,7 +384,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );
@@ -397,7 +397,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -424,7 +424,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_describe("Share buffer handle across different drm fd's and trying to race"
tests/i915/gem_cs_tlb.c +1 -1
@@ -174,5 +174,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_bad_destroy.c +1 -1
@@ -98,5 +98,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_create.c +2 -2
@@ -206,7 +206,7 @@ static void files(int core, const intel_ctx_cfg_t *cfg,gem_execbuf (fd, &execbuf);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); count++;clock_gettime (CLOCK_MONOTONIC , &end);
@@ -756,6 +756,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_exec.c +1 -1
@@ -403,7 +403,7 @@ static void nohangcheck_hostile(int i915)put_ahnd (ahnd);close (dir); -close (i915); +drm_close_driver (i915); }static void close_race (int i915)
tests/i915/gem_ctx_param.c +1 -1
@@ -636,5 +636,5 @@ igt_maintest_get_invalid_param (fd,I915_CONTEXT_PARAM_ENGINES );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_persistence.c +3 -3
@@ -791,7 +791,7 @@ static void test_nonpersistent_file(int i915)gem_context_set_persistence (i915,0 , false); spin = igt_spin_new(i915, .ahnd = ahnd, .flags = IGT_SPIN_FENCE_OUT); -close (i915); +drm_close_driver (i915);flush_delayed_fput (debugfs);igt_assert_eq (wait_for_status (spin->out_fence, reset_timeout_ms), -EIO );
@@ -1274,7 +1274,7 @@ static void __smoker(int i915, const intel_ctx_cfg_t *cfg,intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);flush_delayed_fput (i915);igt_spin_end (spin);
@@ -1570,6 +1570,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_ctx_shared.c +1 -1
@@ -315,7 +315,7 @@ static void exhaust_shared_gtt(int i915, unsigned int flags)igt_info ("Created %lu shared contexts, before %d (%s)\n" , count, err,strerror (-err)); } -close (i915); +drm_close_driver (i915);igt_waitchildren (); }
tests/i915/gem_ctx_sseu.c +1 -1
@@ -559,6 +559,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_switch.c +1 -1
@@ -805,6 +805,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, heavy);gem_close (fd, light); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_eio.c +8 -8
@@ -656,7 +656,7 @@ static void test_banned(int fd) { fd =reopen_device (fd);__test_banned (fd); -close (fd); +drm_close_driver (fd); }#define TEST_WEDGE (1)
@@ -690,7 +690,7 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_suspend (int fd,int state)
@@ -708,7 +708,7 @@ static void test_suspend(int fd, int state)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight (int fd,unsigned int wait)
@@ -772,7 +772,7 @@ static void test_inflight(int fd, unsigned int wait)trigger_reset (fd);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd); } }
@@ -833,7 +833,7 @@ static void test_inflight_suspend(int fd)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static const intel_ctx_t *context_create_safe (int i915)
@@ -923,7 +923,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)for (unsigned int n =0 ; n <ARRAY_SIZE (ctx); n++)intel_ctx_destroy (fd, ctx[n]); -close (fd); +drm_close_driver (fd); } }
@@ -979,7 +979,7 @@ static void test_inflight_external(int fd)put_ahnd (ahnd);igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight_internal (int fd,unsigned int wait)
@@ -1029,7 +1029,7 @@ static void test_inflight_internal(int fd, unsigned int wait)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); } static void reset_stress(int fd, uint64_t ahnd, const intel_ctx_t *ctx0,
tests/i915/gem_evict_alignment.c +1 -1
@@ -282,6 +282,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_evict_everything.c +1 -1
@@ -351,6 +351,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_alignment.c +1 -1
@@ -487,7 +487,7 @@ static void forked(int i915, int timeout)igt_waitchildren_timeout (3 * timeout,NULL );free (obj); -close (i915); +drm_close_driver (i915); }static void single (int fd)
tests/i915/gem_exec_async.c +1 -1
@@ -227,6 +227,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_await.c +1 -1
@@ -300,6 +300,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_basic.c +1 -1
@@ -113,6 +113,6 @@ igt_mainigt_collection_destroy (set);igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_big.c +1 -1
@@ -340,5 +340,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }
tests/i915/gem_exec_capture.c +1 -1
@@ -1055,6 +1055,6 @@ igt_mainclose (dir);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_create.c +1 -1
@@ -270,6 +270,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_fair.c +1 -1
@@ -1440,6 +1440,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_fence.c +2 -2
@@ -2118,7 +2118,7 @@ static void test_invalid_timeline_fence_array(int fd)igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT );munmap (ptr,4096 ); -close (fd); +drm_close_driver (fd); } static const char *test_syncobj_timeline_unused_fence_desc =
@@ -3701,6 +3701,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_flush.c +1 -1
@@ -2207,6 +2207,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_gttfill.c +2 -2
@@ -314,7 +314,7 @@ igt_main// release resources igt_stop_hang_detector ();intel_ctx_destroy (g_fd, ctx); -close (g_fd); +drm_close_driver (g_fd); }igt_waitchildren ();
@@ -322,6 +322,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_latency.c +1 -1
@@ -1001,6 +1001,6 @@ igt_main igt_fixture {intel_register_access_fini (&mmio_data);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_nop.c +1 -1
@@ -1150,6 +1150,6 @@ igt_mainigt_stop_hang_detector ();gem_close (device, handle);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_parallel.c +2 -2
@@ -230,7 +230,7 @@ static void *thread(void *data)intel_ctx_destroy (fd, tmp_ctx);gem_close (fd, obj[1 ].handle);if (t->flags &FDS ) -close (fd); +drm_close_driver (fd); t->used = used;return NULL ;
@@ -413,6 +413,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_params.c +1 -1
@@ -825,6 +825,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_reloc.c +1 -1
@@ -1771,5 +1771,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_exec_schedule.c +1 -1
@@ -3755,6 +3755,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_store.c +1 -1
@@ -480,6 +480,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_suspend.c +1 -1
@@ -510,6 +510,6 @@ igt_mainigt_collection_destroy (set);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_whisper.c +3 -3
@@ -457,7 +457,7 @@ static void fini_hang(struct hang *h)put_offset (h->ahnd, h->obj.handle);put_ahnd (h->ahnd);intel_ctx_destroy (h->fd, h->ctx); -close (h->fd); +drm_close_driver (h->fd); }static void ctx_set_random_priority (int fd,uint32_t ctx)
@@ -829,7 +829,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,gem_close (fd, batches[n].handle);if (flags &FDS ) {for (n =0 ; n <64 ; n++) -close (fds[n]); +drm_close_driver (fds[n]); } }
@@ -939,6 +939,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exercise_blt.c +1 -1
@@ -398,6 +398,6 @@ igt_main_args("b:pst:W:H:", NULL, help_str, opt_handler, NULL) } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_fd_exhaustion.c +1 -1
@@ -75,5 +75,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_fence_thrash.c +1 -1
@@ -244,7 +244,7 @@ static int run_test(int threads_per_fence, void *f, int tiling,igt_assert (func (&t) == (void *)0 ); } -close (t.fd); +drm_close_driver (t.fd);return 0 ; }
tests/i915/gem_fenced_exec_thrash.c +1 -1
@@ -217,5 +217,5 @@ igt_mainrun_test (fd, num_fences +1 ,intel_gen (devid) >=4 ?0 :ENOBUFS ,0 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_flink_basic.c +2 -2
@@ -196,7 +196,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); fd2 =drm_open_driver (DRIVER_INTEL );/* Flink name remains valid due to the second reference */
@@ -205,7 +205,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); } igt_main
tests/i915/gem_flink_race.c +3 -3
@@ -141,7 +141,7 @@ static void test_flink_name(int timeout) igt_stats_get_max(&stats));igt_stats_fini (&stats); -close (fd); +drm_close_driver (fd); }static void *thread_fn_flink_close (void *p)
@@ -202,13 +202,13 @@ static void test_flink_close(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
tests/i915/gem_gtt_cpu_tlb.c +1 -1
@@ -113,5 +113,5 @@ igt_simple_mainfor (i =0 ; i <OBJ_SIZE /4 ; i++)igt_assert (ptr[i] == i); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_gtt_hog.c +1 -1
@@ -170,7 +170,7 @@ igt_simple_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_mappable_ggtt (fd); -close (fd); +drm_close_driver (fd); data.fd =drm_open_driver (DRIVER_INTEL ); data.devid =intel_get_drm_devid (data.fd);
tests/i915/gem_gtt_speed.c +1 -1
@@ -521,5 +521,5 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL) }gem_close (fd, handle); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_huc_copy.c +1 -1
@@ -150,6 +150,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/gem_lmem_evict.c +2 -2
@@ -103,7 +103,7 @@ igt_mainigt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();
@@ -142,7 +142,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }
tests/i915/gem_lmem_swapping.c +5 -5
@@ -718,7 +718,7 @@ static void test_evict(int i915,igt_waitchildren ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);intel_allocator_multiprocess_stop (); }else {__do_evict (i915, ctx, ®ion->region, ¶ms, params.seed);
@@ -790,7 +790,7 @@ static void test_smem_oom(int i915, params.seed + child + 1);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }/* smem memory hog process, respawn till the lmem process completes */
@@ -811,7 +811,7 @@ static void test_smem_oom(int i915,break ;gem_leak (fd, alloc); } -close (fd); +drm_close_driver (fd); }/* * Wait for grand-child processes to finish or be
@@ -903,7 +903,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();
@@ -948,7 +948,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {intel_ctx_destroy (i915, ctx);free (regions); -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); }
tests/i915/gem_madvise.c +6 -6
@@ -110,7 +110,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -132,7 +132,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -156,7 +156,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -178,7 +178,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -194,7 +194,7 @@ dontneed_before_pwrite(void)igt_assert_eq (__gem_write (fd, handle,0 , &bbe,sizeof (bbe)), -EFAULT ); -close (fd); +drm_close_driver (fd); } static void
@@ -218,7 +218,7 @@ dontneed_before_exec(void) execbuf.batch_len =sizeof (buf);igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT ); -close (fd); +drm_close_driver (fd); } igt_main
tests/i915/gem_media_fill.c +1 -1
@@ -181,6 +181,6 @@ igt_main igt_fixture {igt_collection_destroy (set);igt_stop_hang_detector (); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_mmap.c +1 -1
@@ -372,5 +372,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_gtt.c +3 -3
@@ -869,13 +869,13 @@ test_isolation(int i915)igt_info ("B: {fd:%d, handle:%d, offset:%" PRIx64"}\n" ,B , b, offset_b); -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );
@@ -1979,5 +1979,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_offset.c +4 -4
@@ -434,13 +434,13 @@ static void isolation(int i915)igt_assert_eq (errno,EACCES ); } -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );
@@ -735,7 +735,7 @@ static void open_flood(int i915, int timeout)mmap_offset_ioctl (i915, &arg); } -close (tmp); +drm_close_driver (tmp); count++; }
@@ -1013,6 +1013,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_mmap_wc.c +1 -1
@@ -687,5 +687,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_partial_pwrite_pread.c +1 -1
@@ -388,6 +388,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_pipe_control_store_loop.c +1 -1
@@ -199,6 +199,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ppgtt.c +4 -4
@@ -278,8 +278,8 @@ static void flink_and_close(void)igt_assert_eq (offset, offset_new);gem_close (fd, bo); -close (fd); -close (fd2); +drm_close_driver (fd); +drm_close_driver (fd2); }#define PAGE_SIZE 4096
@@ -412,7 +412,7 @@ static bool has_contexts(void) fd =drm_open_driver (DRIVER_INTEL ); result =gem_has_contexts (fd); -close (fd); +drm_close_driver (fd);return result; }
@@ -425,7 +425,7 @@ igt_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_blitter (fd); -close (fd); +drm_close_driver (fd); } igt_subtest("blt-vs-render-ctx0") {
tests/i915/gem_pread.c +1 -1
@@ -367,6 +367,6 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL)free (src);gem_close (fd, dst); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_pread_after_blit.c +1 -1
@@ -281,5 +281,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite.c +1 -1
@@ -639,5 +639,5 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL) }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite_snooped.c +1 -1
@@ -148,5 +148,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_pxp.c +1 -1
@@ -1372,6 +1372,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_read_read_speed.c +1 -1
@@ -275,6 +275,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_readwrite.c +1 -1
@@ -158,5 +158,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_reg_read.c +1 -1
@@ -181,6 +181,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_render_copy.c +1 -1
@@ -999,6 +999,6 @@ igt_main_args("dac", NULL, help_str, opt_handler, NULL)igt_stop_hang_detector ();buf_ops_destroy (data.bops);igt_collection_destroy (set); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_render_copy_redux.c +1 -1
@@ -98,7 +98,7 @@ static void data_init(data_t *data)static void data_fini (data_t *data) {buf_ops_destroy (data->bops); -close (data->fd); +drm_close_driver (data->fd); } static void scratch_buf_init(data_t *data, struct intel_buf *buf,
tests/i915/gem_reset_stats.c +16 -16
@@ -475,7 +475,7 @@ static void test_rs(const struct intel_execution_ring *e,igt_assert (igt_seconds_elapsed (&ts_injected) <=30 );for (i =0 ; i < num_fds; i++) -close (fd[i]); +drm_close_driver (fd[i]); }#define MAX_CTX 100
@@ -551,7 +551,7 @@ static void test_rs_ctx(const struct intel_execution_ring *e,for (i =0 ; i < num_fds; i++) {assert_reset_status (i, fd[i],0 ,RS_NO_ERROR ); -close (fd[i]); +drm_close_driver (fd[i]); } }
@@ -605,8 +605,8 @@ static void test_ban(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd_good,0 , &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd_bad); -close (fd_good); +drm_close_driver (fd_bad); +drm_close_driver (fd_good); }static void test_ban_ctx (const struct intel_execution_ring *e)
@@ -664,7 +664,7 @@ static void test_ban_ctx(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd, ctx_good, &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd); +drm_close_driver (fd); }static void test_unrelated_ctx (const struct intel_execution_ring *e)
@@ -690,8 +690,8 @@ static void test_unrelated_ctx(const struct intel_execution_ring *e)assert_reset_status (0 , fd1, ctx_guilty,RS_BATCH_ACTIVE );assert_reset_status (1 , fd2, ctx_unrelated,RS_NO_ERROR ); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static int get_reset_count (int fd,int ctx)
@@ -717,7 +717,7 @@ static void test_close_pending_ctx(const struct intel_execution_ring *e)gem_context_destroy (fd, ctx);igt_assert_eq (__gem_context_destroy (fd, ctx), -ENOENT ); -close (fd); +drm_close_driver (fd); }static void test_close_pending (const struct intel_execution_ring *e)
@@ -727,7 +727,7 @@ static void test_close_pending(const struct intel_execution_ring *e)assert_reset_status (fd, fd,0 ,RS_NO_ERROR );inject_hang (fd,0 , e,0 ); -close (fd); +drm_close_driver (fd); }static void noop_on_each_ring (int fd,const bool reverse)
@@ -789,7 +789,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e,* when gpu is reset and ring lists are cleared. */ noop_on_each_ring (fd2, reverse); -close (fd2); +drm_close_driver (fd2);pause ();exit (0 ); }else {
@@ -802,7 +802,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e, }igt_post_hang_ring (fd, hang); -close (fd); +drm_close_driver (fd); } static void test_reset_count(const struct intel_execution_ring *e,
@@ -842,7 +842,7 @@ static void test_reset_count(const struct intel_execution_ring *e,if (create_ctx)gem_context_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }static int _test_params (int fd,int ctx,uint32_t flags,uint32_t pad)
@@ -913,7 +913,7 @@ static void test_params_ctx(void) fd =drm_reopen_driver (device);_test_param (fd,gem_context_create (fd)); -close (fd); +drm_close_driver (fd); }static void test_params (void )
@@ -922,7 +922,7 @@ static void test_params(void) fd =drm_reopen_driver (device);_test_param (fd,0 ); -close (fd); +drm_close_driver (fd); } static const struct intel_execution_ring *
@@ -968,7 +968,7 @@ static void defer_hangcheck(const struct intel_execution_ring *engine)igt_assert_lt (count_start, count_end); -close (fd); +drm_close_driver (fd); }static bool gem_has_reset_stats (int fd)
@@ -1177,6 +1177,6 @@ igt_main } igt_fixture {igt_assert (igt_params_set (device,"reset" ,"%d" ,INT_MAX /* any reset method */ )); -close (device); +drm_close_driver (device); } }
tests/i915/gem_ringfill.c +1 -1
@@ -522,6 +522,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_set_tiling_vs_blt.c +1 -1
@@ -276,6 +276,6 @@ igt_main igt_fixture{buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_set_tiling_vs_gtt.c +1 -1
@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_set_tiling_vs_pwrite.c +1 -1
@@ -107,5 +107,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_shrink.c +7 -7
@@ -381,7 +381,7 @@ static bool has_userptr(void)if (drmIoctl (fd,DRM_IOCTL_I915_GEM_USERPTR , &userptr)) err = errno; -close (fd); +drm_close_driver (fd);return err ==EFAULT ; }
@@ -430,7 +430,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)leak (fd, alloc); -close (fd); +drm_close_driver (fd); } } }
@@ -442,7 +442,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,0 ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;
@@ -455,7 +455,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,UDIRTY ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;
@@ -467,7 +467,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)func (fd, alloc); -close (fd); +drm_close_driver (fd); } }igt_waitchildren ();
@@ -510,7 +510,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main
@@ -567,7 +567,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )
tests/i915/gem_softpin.c +2 -2
@@ -1433,7 +1433,7 @@ static void *thread(void *data) fd, ctx->id, t->engine, succeeded);intel_ctx_destroy (fd, ctx);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd);return (void *)from_user_pointer (ret); }
@@ -1747,6 +1747,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_spin_batch.c +1 -1
@@ -354,6 +354,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_streaming_writes.c +1 -1
@@ -448,5 +448,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_stress.c +1 -1
@@ -933,7 +933,7 @@ igt_simple_main_args("ds:g:c:t:rbuxmo:fp:",intel_bb_destroy (ibb);buf_ops_destroy (bops); -close (drm_fd); +drm_close_driver (drm_fd);igt_stop_signal_helper (); }
tests/i915/gem_sync.c +1 -1
@@ -1606,6 +1606,6 @@ igt_mainintel_allocator_multiprocess_stop ();igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_blits.c +1 -1
@@ -232,6 +232,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_fence_blits.c +1 -1
@@ -335,5 +335,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_partial_pwrite_pread.c +1 -1
@@ -330,6 +330,6 @@ igt_mainintel_buf_destroy (tiled_staging_buf);buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_pread_basic.c +1 -1
@@ -230,5 +230,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_pread_pwrite.c +1 -1
@@ -162,5 +162,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_swapping.c +1 -1
@@ -256,5 +256,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_wb.c +1 -1
@@ -249,5 +249,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_wc.c +1 -1
@@ -250,5 +250,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiling_max_stride.c +1 -1
@@ -146,5 +146,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_unfence_active_buffers.c +1 -1
@@ -107,5 +107,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_unref_active_buffers.c +1 -1
@@ -133,5 +133,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_userptr_blits.c +3 -3
@@ -1086,7 +1086,7 @@ static void test_nohangcheck_hostile(int i915)close (fence);close (dir); -close (i915); +drm_close_driver (i915); }static size_t hugepagesize (void )
@@ -1644,9 +1644,9 @@ static int test_dmabuf(void)/* destroy userptr object and expect SIGBUS */ free_userptr_bo (fd1, handle); -close (fd1); +drm_close_driver (fd1); -close (fd2); +drm_close_driver (fd2);reset_handle_ptr ();return 0 ;
tests/i915/gem_vm_create.c +2 -2
@@ -370,7 +370,7 @@ static void isolation(int i915)gem_read (i915, obj[0 ].handle,0 , &result,sizeof (result));igt_assert_eq (result,1 ); -close (other); +drm_close_driver (other);gem_close (i915, obj[1 ].handle);gem_close (i915, obj[0 ].handle);
@@ -411,6 +411,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_wait.c +1 -1
@@ -336,6 +336,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_watchdog.c +1 -1
@@ -597,6 +597,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_workarounds.c +1 -1
@@ -305,7 +305,7 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags)if (flags &CONTEXT )intel_ctx_destroy (fd, ctx);if (flags &FD ) -close (fd); +drm_close_driver (fd); } igt_main
tests/i915/gen7_exec_parse.c +2 -2
@@ -476,7 +476,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main
@@ -748,6 +748,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gen9_exec_parse.c +1 -1
@@ -1299,6 +1299,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_fb_tiling.c +1 -1
@@ -52,5 +52,5 @@ igt_simple_mainigt_assert_eq (ret, -EBUSY );igt_remove_fb (drm_fd, &fb); -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_getparams_basic.c +1 -1
@@ -62,7 +62,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_hangman.c +2 -2
@@ -160,7 +160,7 @@ static void check_alive(void)put_ahnd (ahnd);intel_ctx_destroy (fd, ctx);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }static bool has_error_state (int dir)
@@ -643,6 +643,6 @@ igt_mainigt_disallow_hang (device, hang);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/i915_hwmon.c +1 -1
@@ -96,6 +96,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_module_load.c +4 -4
@@ -280,7 +280,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }
@@ -328,7 +328,7 @@ static void load_and_check_i915(void)/* make sure the GPU is idle */ gem_quiescent_gpu (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd);/* make sure we can do basic memory ops */ gem_sanitycheck ();
@@ -369,7 +369,7 @@ static uint32_t driver_load_with_lmem_bar_size(uint32_t lmem_bar_size, bool che } } -close (i915); +drm_close_driver (i915);return lmem_bar_size; }
@@ -461,7 +461,7 @@ igt_mainigt_require_gem (i915);igt_require (gem_has_lmem (i915));igt_skip_on_f (igt_sysfs_get_num_gt (i915) >1 ,"Skips for more than one lmem instance.\n" ); -close (i915); +drm_close_driver (i915); }/* Test for lmem_bar_size modparam support */
tests/i915/i915_pciid.c +1 -1
@@ -77,5 +77,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }
tests/i915/i915_pm_backlight.c +1 -1
@@ -357,6 +357,6 @@ igt_mainigt_display_fini (&display);igt_pm_restore_sata_link_power_management (); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/i915/i915_pm_dc.c +1 -1
@@ -730,7 +730,7 @@ igt_mainclose (data.debugfs_root_fd);close (data.msr_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }igt_exit ();
tests/i915/i915_pm_freq_api.c +1 -1
@@ -150,6 +150,6 @@ igt_mainigt_assert (set_freq (dirfd,RPS_MAX_FREQ_MHZ , stash_max[gt]) >0 );igt_assert (set_freq (dirfd,RPS_MIN_FREQ_MHZ , stash_min[gt]) >0 ); } -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_freq_mult.c +1 -1
@@ -177,6 +177,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_lpsp.c +1 -1
@@ -223,6 +223,6 @@ igt_main igt_fixture {free (data.pwr_dmn_info);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/i915_pm_rc6_residency.c +1 -1
@@ -627,6 +627,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_rps.c +1 -1
@@ -917,7 +917,7 @@ static void pm_rps_exit_handler(int sig)if (lh.igt_proc.running)load_helper_stop (); -close (drm_fd); +drm_close_driver (drm_fd); } igt_main
tests/i915/i915_pm_sseu.c +1 -1
@@ -323,7 +323,7 @@ gem_deinit(void)case 2 :buf_ops_destroy (gem.bops);case 1 : -close (gem.drm_fd); +drm_close_driver (gem.drm_fd); } }
tests/i915/i915_power.c +1 -1
@@ -86,6 +86,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_query.c +1 -1
@@ -1572,6 +1572,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_suspend.c +3 -3
@@ -256,7 +256,7 @@ test_shrink(int fd, unsigned int mode)igt_system_suspend_autoresume (mode,SUSPEND_TEST_NONE );munmap (mem, size); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -300,7 +300,7 @@ test_suspend_without_i915(int state)igt_pm_get_d3cold_allowed (&card, d3cold_allowed);igt_pm_set_d3cold_allowed (&card,"0\n" ); } -close (fd); +drm_close_driver (fd);igt_kmsg (KMSG_INFO "Unloading i915\n" );igt_assert_eq (igt_i915_driver_unload (),0 );
@@ -383,5 +383,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/perf.c +3 -3
@@ -4704,7 +4704,7 @@ gen12_test_single_ctx_render_target_writes_a_counter(const struct intel_executioigt_drop_root ();gen12_single_ctx_helper (e); -close (drm_fd); +drm_close_driver (drm_fd); } child_ret =igt_wait_helper (&child); igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||
@@ -5485,7 +5485,7 @@ test_i915_ref_count(void)igt_debug ("ref count after opening i915 perf stream = %u\n" , ref_count1);igt_assert (ref_count1 > ref_count0); -close (drm_fd); +drm_close_driver (drm_fd);close (sysfs); drm_fd =-1 ; sysfs =-1 ;
@@ -6194,6 +6194,6 @@ igt_mainput_engine_groups (perf_oa_groups, num_perf_oa_groups);intel_ctx_destroy (drm_fd, ctx); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/perf_pmu.c +3 -3
@@ -2424,7 +2424,7 @@ static void test_unload(unsigned int num_engines)if (fd[count] !=-1 ) count++; -close (i915); +drm_close_driver (i915); buf =calloc (count,sizeof (uint64_t ));igt_assert (buf);
@@ -2768,13 +2768,13 @@ igt_main igt_fixture {intel_ctx_destroy (render_fd ,render_ctx ); -close (render_fd); +drm_close_driver (render_fd); } } igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } igt_subtest("module-unload") {
tests/i915/sysfs_defaults.c +1 -1
@@ -116,6 +116,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_heartbeat_interval.c +1 -1
@@ -543,6 +543,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_preempt_timeout.c +1 -1
@@ -362,6 +362,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_timeslice_duration.c +1 -1
@@ -587,6 +587,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 21/24] tests/i915: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 7 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().V2: - New patch for generic tests
V3: - RebaseSigned-off-by Bhanuprakash Modem <[email protected]>
Quoted 2,313 lines
--- tests/i915/api_intel_allocator.c | 6 ++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/drm_fdinfo.c | 2 +- tests/i915/gem_bad_reloc.c | 2 +- tests/i915/gem_barrier_race.c | 2 +- tests/i915/gem_basic.c | 2 +- tests/i915/gem_blits.c | 2 +- tests/i915/gem_busy.c | 2 +- tests/i915/gem_caching.c | 2 +- tests/i915/gem_ccs.c | 2 +- tests/i915/gem_close_race.c | 12 ++++---- tests/i915/gem_cs_tlb.c | 2 +- tests/i915/gem_ctx_bad_destroy.c | 2 +- tests/i915/gem_ctx_create.c | 4 +-- tests/i915/gem_ctx_exec.c | 2 +- tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 6 ++-- tests/i915/gem_ctx_shared.c | 2 +- tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 16 +++++------ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 2 +- tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_basic.c | 2 +- tests/i915/gem_exec_big.c | 2 +- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_create.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 4 +-- tests/i915/gem_exec_flush.c | 2 +- tests/i915/gem_exec_gttfill.c | 4 +-- tests/i915/gem_exec_latency.c | 2 +- tests/i915/gem_exec_nop.c | 2 +- tests/i915/gem_exec_parallel.c | 4 +-- tests/i915/gem_exec_params.c | 2 +- tests/i915/gem_exec_reloc.c | 2 +- tests/i915/gem_exec_schedule.c | 2 +- tests/i915/gem_exec_store.c | 2 +- tests/i915/gem_exec_suspend.c | 2 +- tests/i915/gem_exec_whisper.c | 6 ++-- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 2 +- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 4 +-- tests/i915/gem_flink_race.c | 6 ++-- tests/i915/gem_gtt_cpu_tlb.c | 2 +- tests/i915/gem_gtt_hog.c | 2 +- tests/i915/gem_gtt_speed.c | 2 +- tests/i915/gem_huc_copy.c | 2 +- tests/i915/gem_lmem_evict.c | 4 +-- tests/i915/gem_lmem_swapping.c | 10 +++---- tests/i915/gem_madvise.c | 12 ++++---- tests/i915/gem_media_fill.c | 2 +- tests/i915/gem_mmap.c | 2 +- tests/i915/gem_mmap_gtt.c | 6 ++-- tests/i915/gem_mmap_offset.c | 8 +++--- tests/i915/gem_mmap_wc.c | 2 +- tests/i915/gem_partial_pwrite_pread.c | 2 +- tests/i915/gem_pipe_control_store_loop.c | 2 +- tests/i915/gem_ppgtt.c | 8 +++--- tests/i915/gem_pread.c | 2 +- tests/i915/gem_pread_after_blit.c | 2 +- tests/i915/gem_pwrite.c | 2 +- tests/i915/gem_pwrite_snooped.c | 2 +- tests/i915/gem_pxp.c | 2 +- tests/i915/gem_read_read_speed.c | 2 +- tests/i915/gem_readwrite.c | 2 +- tests/i915/gem_reg_read.c | 2 +- tests/i915/gem_render_copy.c | 2 +- tests/i915/gem_render_copy_redux.c | 2 +- tests/i915/gem_reset_stats.c | 32 ++++++++++----------- tests/i915/gem_ringfill.c | 2 +- tests/i915/gem_set_tiling_vs_blt.c | 2 +- tests/i915/gem_set_tiling_vs_gtt.c | 2 +- tests/i915/gem_set_tiling_vs_pwrite.c | 2 +- tests/i915/gem_shrink.c | 14 ++++----- tests/i915/gem_softpin.c | 4 +-- tests/i915/gem_spin_batch.c | 2 +- tests/i915/gem_streaming_writes.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_sync.c | 2 +- tests/i915/gem_tiled_blits.c | 2 +- tests/i915/gem_tiled_fence_blits.c | 2 +- tests/i915/gem_tiled_partial_pwrite_pread.c | 2 +- tests/i915/gem_tiled_pread_basic.c | 2 +- tests/i915/gem_tiled_pread_pwrite.c | 2 +- tests/i915/gem_tiled_swapping.c | 2 +- tests/i915/gem_tiled_wb.c | 2 +- tests/i915/gem_tiled_wc.c | 2 +- tests/i915/gem_tiling_max_stride.c | 2 +- tests/i915/gem_unfence_active_buffers.c | 2 +- tests/i915/gem_unref_active_buffers.c | 2 +- tests/i915/gem_userptr_blits.c | 6 ++-- tests/i915/gem_vm_create.c | 4 +-- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 2 +- tests/i915/gen7_exec_parse.c | 4 +-- tests/i915/gen9_exec_parse.c | 2 +- tests/i915/i915_fb_tiling.c | 2 +- tests/i915/i915_getparams_basic.c | 2 +- tests/i915/i915_hangman.c | 4 +-- tests/i915/i915_hwmon.c | 2 +- tests/i915/i915_module_load.c | 8 +++--- tests/i915/i915_pciid.c | 2 +- tests/i915/i915_pm_backlight.c | 2 +- tests/i915/i915_pm_dc.c | 2 +- tests/i915/i915_pm_freq_api.c | 2 +- tests/i915/i915_pm_freq_mult.c | 2 +- tests/i915/i915_pm_lpsp.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/i915_pm_rps.c | 2 +- tests/i915/i915_pm_sseu.c | 2 +- tests/i915/i915_power.c | 2 +- tests/i915/i915_query.c | 2 +- tests/i915/i915_suspend.c | 6 ++-- tests/i915/perf.c | 6 ++-- tests/i915/perf_pmu.c | 6 ++-- tests/i915/sysfs_defaults.c | 2 +- tests/i915/sysfs_heartbeat_interval.c | 2 +- tests/i915/sysfs_preempt_timeout.c | 2 +- tests/i915/sysfs_timeslice_duration.c | 2 +- 126 files changed, 205 insertions(+), 205 deletions(-)tests/i915/api_intel_allocator.c +3
-3@@ -579,7 +579,7 @@ static void reopen(int fd)__reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2); }#define REOPEN_TIMEOUT 3@@ -605,7 +605,7 @@ static void reopen_fork(int fd)/* Check references at the end */ __reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2);intel_allocator_multiprocess_stop (); }@@ -924,5 +924,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/api_intel_bb.c +1
-1@@ -1908,6 +1908,6 @@ igt_main_args("dpibc:", NULL, help_str, opt_handler, NULL) igt_fixture {buf_ops_destroy (bops); -close (i915); +drm_close_driver (i915); } }tests/i915/drm_fdinfo.c +1
-1@@ -910,6 +910,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_bad_reloc.c +1
-1@@ -231,5 +231,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_barrier_race.c +1
-1@@ -120,7 +120,7 @@ static void intel_context_first_pin_last_unpin_loop(int fd, uint64_t engine, int }while (!READ_ONCE (*done)); -close (fd); +drm_close_driver (fd); }static void test_remote_request (int fd,uint64_t engine,unsigned int timeout)tests/i915/gem_basic.c +1
-1@@ -145,7 +145,7 @@ igt_main gpu_fd =__drm_open_driver_another (child,DRIVER_INTEL );igt_assert_f (gpu_fd >0 ,"cannot open gpu-%d, errno=%d\n" , child, errno);test_create_close (gpu_fd); -close (gpu_fd); +drm_close_driver (gpu_fd); }igt_waitchildren ();tests/i915/gem_blits.c +1
-1@@ -904,6 +904,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }tests/i915/gem_busy.c +1
-1@@ -617,6 +617,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_caching.c +1
-1@@ -356,6 +356,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.fd); +drm_close_driver (data.fd); } }tests/i915/gem_ccs.c +1
-1@@ -764,6 +764,6 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL) igt_fixture {igt_disallow_hang (i915, hang); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_close_race.c +6
-6@@ -329,7 +329,7 @@ static void multigpu_threads(int timeout, unsigned int flags, int gpu_count)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();@@ -348,7 +348,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main@@ -372,7 +372,7 @@ igt_main gpu_count =igt_device_filter_count ();igt_fork_hang_detector (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission." );@@ -384,7 +384,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );@@ -397,7 +397,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();@@ -424,7 +424,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_describe("Share buffer handle across different drm fd's and trying to race"tests/i915/gem_cs_tlb.c +1
-1@@ -174,5 +174,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_ctx_bad_destroy.c +1
-1@@ -98,5 +98,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_ctx_create.c +2
-2@@ -206,7 +206,7 @@ static void files(int core, const intel_ctx_cfg_t *cfg,gem_execbuf (fd, &execbuf);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); count++;clock_gettime (CLOCK_MONOTONIC , &end);@@ -756,6 +756,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ctx_exec.c +1
-1@@ -403,7 +403,7 @@ static void nohangcheck_hostile(int i915)put_ahnd (ahnd);close (dir); -close (i915); +drm_close_driver (i915); }static void close_race (int i915)tests/i915/gem_ctx_param.c +1
-1@@ -636,5 +636,5 @@ igt_maintest_get_invalid_param (fd,I915_CONTEXT_PARAM_ENGINES );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_ctx_persistence.c +3
-3@@ -791,7 +791,7 @@ static void test_nonpersistent_file(int i915)gem_context_set_persistence (i915,0 , false); spin = igt_spin_new(i915, .ahnd = ahnd, .flags = IGT_SPIN_FENCE_OUT); -close (i915); +drm_close_driver (i915);flush_delayed_fput (debugfs);igt_assert_eq (wait_for_status (spin->out_fence, reset_timeout_ms), -EIO );@@ -1274,7 +1274,7 @@ static void __smoker(int i915, const intel_ctx_cfg_t *cfg,intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);flush_delayed_fput (i915);igt_spin_end (spin);@@ -1570,6 +1570,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_ctx_shared.c +1
-1@@ -315,7 +315,7 @@ static void exhaust_shared_gtt(int i915, unsigned int flags)igt_info ("Created %lu shared contexts, before %d (%s)\n" , count, err,strerror (-err)); } -close (i915); +drm_close_driver (i915);igt_waitchildren (); }tests/i915/gem_ctx_sseu.c +1
-1@@ -559,6 +559,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ctx_switch.c +1
-1@@ -805,6 +805,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, heavy);gem_close (fd, light); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_eio.c +8
-8@@ -656,7 +656,7 @@ static void test_banned(int fd) { fd =reopen_device (fd);__test_banned (fd); -close (fd); +drm_close_driver (fd); }#define TEST_WEDGE (1)@@ -690,7 +690,7 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_suspend (int fd,int state)@@ -708,7 +708,7 @@ static void test_suspend(int fd, int state)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight (int fd,unsigned int wait)@@ -772,7 +772,7 @@ static void test_inflight(int fd, unsigned int wait)trigger_reset (fd);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd); } }@@ -833,7 +833,7 @@ static void test_inflight_suspend(int fd)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static const intel_ctx_t *context_create_safe (int i915)@@ -923,7 +923,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)for (unsigned int n =0 ; n <ARRAY_SIZE (ctx); n++)intel_ctx_destroy (fd, ctx[n]); -close (fd); +drm_close_driver (fd); } }@@ -979,7 +979,7 @@ static void test_inflight_external(int fd)put_ahnd (ahnd);igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight_internal (int fd,unsigned int wait)@@ -1029,7 +1029,7 @@ static void test_inflight_internal(int fd, unsigned int wait)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); } static void reset_stress(int fd, uint64_t ahnd, const intel_ctx_t *ctx0,tests/i915/gem_evict_alignment.c +1
-1@@ -282,6 +282,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_evict_everything.c +1
-1@@ -351,6 +351,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_alignment.c +1
-1@@ -487,7 +487,7 @@ static void forked(int i915, int timeout)igt_waitchildren_timeout (3 * timeout,NULL );free (obj); -close (i915); +drm_close_driver (i915); }static void single (int fd)tests/i915/gem_exec_async.c +1
-1@@ -227,6 +227,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_await.c +1
-1@@ -300,6 +300,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_basic.c +1
-1@@ -113,6 +113,6 @@ igt_mainigt_collection_destroy (set);igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_big.c +1
-1@@ -340,5 +340,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }tests/i915/gem_exec_capture.c +1
-1@@ -1055,6 +1055,6 @@ igt_mainclose (dir);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_create.c +1
-1@@ -270,6 +270,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_fair.c +1
-1@@ -1440,6 +1440,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_fence.c +2
-2@@ -2118,7 +2118,7 @@ static void test_invalid_timeline_fence_array(int fd)igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT );munmap (ptr,4096 ); -close (fd); +drm_close_driver (fd); } static const char *test_syncobj_timeline_unused_fence_desc =@@ -3701,6 +3701,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_flush.c +1
-1@@ -2207,6 +2207,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_gttfill.c +2
-2@@ -314,7 +314,7 @@ igt_main// release resources igt_stop_hang_detector ();intel_ctx_destroy (g_fd, ctx); -close (g_fd); +drm_close_driver (g_fd); }igt_waitchildren ();@@ -322,6 +322,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_latency.c +1
-1@@ -1001,6 +1001,6 @@ igt_main igt_fixture {intel_register_access_fini (&mmio_data);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_nop.c +1
-1@@ -1150,6 +1150,6 @@ igt_mainigt_stop_hang_detector ();gem_close (device, handle);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_parallel.c +2
-2@@ -230,7 +230,7 @@ static void *thread(void *data)intel_ctx_destroy (fd, tmp_ctx);gem_close (fd, obj[1 ].handle);if (t->flags &FDS ) -close (fd); +drm_close_driver (fd); t->used = used;return NULL ;@@ -413,6 +413,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_params.c +1
-1@@ -825,6 +825,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_reloc.c +1
-1@@ -1771,5 +1771,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_exec_schedule.c +1
-1@@ -3755,6 +3755,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_store.c +1
-1@@ -480,6 +480,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_suspend.c +1
-1@@ -510,6 +510,6 @@ igt_mainigt_collection_destroy (set);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_whisper.c +3
-3@@ -457,7 +457,7 @@ static void fini_hang(struct hang *h)put_offset (h->ahnd, h->obj.handle);put_ahnd (h->ahnd);intel_ctx_destroy (h->fd, h->ctx); -close (h->fd); +drm_close_driver (h->fd); }static void ctx_set_random_priority (int fd,uint32_t ctx)@@ -829,7 +829,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,gem_close (fd, batches[n].handle);if (flags &FDS ) {for (n =0 ; n <64 ; n++) -close (fds[n]); +drm_close_driver (fds[n]); } }@@ -939,6 +939,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exercise_blt.c +1
-1@@ -398,6 +398,6 @@ igt_main_args("b:pst:W:H:", NULL, help_str, opt_handler, NULL) } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_fd_exhaustion.c +1
-1@@ -75,5 +75,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }tests/i915/gem_fence_thrash.c +1
-1@@ -244,7 +244,7 @@ static int run_test(int threads_per_fence, void *f, int tiling,igt_assert (func (&t) == (void *)0 ); } -close (t.fd); +drm_close_driver (t.fd);return 0 ; }tests/i915/gem_fenced_exec_thrash.c +1
-1@@ -217,5 +217,5 @@ igt_mainrun_test (fd, num_fences +1 ,intel_gen (devid) >=4 ?0 :ENOBUFS ,0 );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_flink_basic.c +2
-2@@ -196,7 +196,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); fd2 =drm_open_driver (DRIVER_INTEL );/* Flink name remains valid due to the second reference */ @@ -205,7 +205,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); } igt_maintests/i915/gem_flink_race.c +3
-3@@ -141,7 +141,7 @@ static void test_flink_name(int timeout) igt_stats_get_max(&stats));igt_stats_fini (&stats); -close (fd); +drm_close_driver (fd); }static void *thread_fn_flink_close (void *p)@@ -202,13 +202,13 @@ static void test_flink_close(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }tests/i915/gem_gtt_cpu_tlb.c +1
-1@@ -113,5 +113,5 @@ igt_simple_mainfor (i =0 ; i <OBJ_SIZE /4 ; i++)igt_assert (ptr[i] == i); -close (fd); +drm_close_driver (fd); }tests/i915/gem_gtt_hog.c +1
-1@@ -170,7 +170,7 @@ igt_simple_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_mappable_ggtt (fd); -close (fd); +drm_close_driver (fd); data.fd =drm_open_driver (DRIVER_INTEL ); data.devid =intel_get_drm_devid (data.fd);tests/i915/gem_gtt_speed.c +1
-1@@ -521,5 +521,5 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL) }gem_close (fd, handle); -close (fd); +drm_close_driver (fd); }tests/i915/gem_huc_copy.c +1
-1@@ -150,6 +150,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/i915/gem_lmem_evict.c +2
-2@@ -103,7 +103,7 @@ igt_mainigt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();@@ -142,7 +142,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }tests/i915/gem_lmem_swapping.c +5
-5@@ -718,7 +718,7 @@ static void test_evict(int i915,igt_waitchildren ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);intel_allocator_multiprocess_stop (); }else {__do_evict (i915, ctx, ®ion->region, ¶ms, params.seed);@@ -790,7 +790,7 @@ static void test_smem_oom(int i915, params.seed + child + 1);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }/* smem memory hog process, respawn till the lmem process completes */ @@ -811,7 +811,7 @@ static void test_smem_oom(int i915,break ;gem_leak (fd, alloc); } -close (fd); +drm_close_driver (fd); }/* * Wait for grand-child processes to finish or be @@ -903,7 +903,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();@@ -948,7 +948,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {intel_ctx_destroy (i915, ctx);free (regions); -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); }tests/i915/gem_madvise.c +6
-6@@ -110,7 +110,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;@@ -132,7 +132,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void@@ -156,7 +156,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;@@ -178,7 +178,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void@@ -194,7 +194,7 @@ dontneed_before_pwrite(void)igt_assert_eq (__gem_write (fd, handle,0 , &bbe,sizeof (bbe)), -EFAULT ); -close (fd); +drm_close_driver (fd); } static void@@ -218,7 +218,7 @@ dontneed_before_exec(void) execbuf.batch_len =sizeof (buf);igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT ); -close (fd); +drm_close_driver (fd); } igt_maintests/i915/gem_media_fill.c +1
-1@@ -181,6 +181,6 @@ igt_main igt_fixture {igt_collection_destroy (set);igt_stop_hang_detector (); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/gem_mmap.c +1
-1@@ -372,5 +372,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_mmap_gtt.c +3
-3@@ -869,13 +869,13 @@ test_isolation(int i915)igt_info ("B: {fd:%d, handle:%d, offset:%" PRIx64"}\n" ,B , b, offset_b); -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );@@ -1979,5 +1979,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_mmap_offset.c +4
-4@@ -434,13 +434,13 @@ static void isolation(int i915)igt_assert_eq (errno,EACCES ); } -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );@@ -735,7 +735,7 @@ static void open_flood(int i915, int timeout)mmap_offset_ioctl (i915, &arg); } -close (tmp); +drm_close_driver (tmp); count++; }@@ -1013,6 +1013,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_mmap_wc.c +1
-1@@ -687,5 +687,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_partial_pwrite_pread.c +1
-1@@ -388,6 +388,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/gem_pipe_control_store_loop.c +1
-1@@ -199,6 +199,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ppgtt.c +4
-4@@ -278,8 +278,8 @@ static void flink_and_close(void)igt_assert_eq (offset, offset_new);gem_close (fd, bo); -close (fd); -close (fd2); +drm_close_driver (fd); +drm_close_driver (fd2); }#define PAGE_SIZE 4096@@ -412,7 +412,7 @@ static bool has_contexts(void) fd =drm_open_driver (DRIVER_INTEL ); result =gem_has_contexts (fd); -close (fd); +drm_close_driver (fd);return result; }@@ -425,7 +425,7 @@ igt_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_blitter (fd); -close (fd); +drm_close_driver (fd); } igt_subtest("blt-vs-render-ctx0") {tests/i915/gem_pread.c +1
-1@@ -367,6 +367,6 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL)free (src);gem_close (fd, dst); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_pread_after_blit.c +1
-1@@ -281,5 +281,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_pwrite.c +1
-1@@ -639,5 +639,5 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL) }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_pwrite_snooped.c +1
-1@@ -148,5 +148,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }tests/i915/gem_pxp.c +1
-1@@ -1372,6 +1372,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_read_read_speed.c +1
-1@@ -275,6 +275,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_readwrite.c +1
-1@@ -158,5 +158,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_reg_read.c +1
-1@@ -181,6 +181,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_render_copy.c +1
-1@@ -999,6 +999,6 @@ igt_main_args("dac", NULL, help_str, opt_handler, NULL)igt_stop_hang_detector ();buf_ops_destroy (data.bops);igt_collection_destroy (set); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/gem_render_copy_redux.c +1
-1@@ -98,7 +98,7 @@ static void data_init(data_t *data)static void data_fini (data_t *data) {buf_ops_destroy (data->bops); -close (data->fd); +drm_close_driver (data->fd); } static void scratch_buf_init(data_t *data, struct intel_buf *buf,tests/i915/gem_reset_stats.c +16
-16@@ -475,7 +475,7 @@ static void test_rs(const struct intel_execution_ring *e,igt_assert (igt_seconds_elapsed (&ts_injected) <=30 );for (i =0 ; i < num_fds; i++) -close (fd[i]); +drm_close_driver (fd[i]); }#define MAX_CTX 100@@ -551,7 +551,7 @@ static void test_rs_ctx(const struct intel_execution_ring *e,for (i =0 ; i < num_fds; i++) {assert_reset_status (i, fd[i],0 ,RS_NO_ERROR ); -close (fd[i]); +drm_close_driver (fd[i]); } }@@ -605,8 +605,8 @@ static void test_ban(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd_good,0 , &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd_bad); -close (fd_good); +drm_close_driver (fd_bad); +drm_close_driver (fd_good); }static void test_ban_ctx (const struct intel_execution_ring *e)@@ -664,7 +664,7 @@ static void test_ban_ctx(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd, ctx_good, &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd); +drm_close_driver (fd); }static void test_unrelated_ctx (const struct intel_execution_ring *e)@@ -690,8 +690,8 @@ static void test_unrelated_ctx(const struct intel_execution_ring *e)assert_reset_status (0 , fd1, ctx_guilty,RS_BATCH_ACTIVE );assert_reset_status (1 , fd2, ctx_unrelated,RS_NO_ERROR ); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static int get_reset_count (int fd,int ctx)@@ -717,7 +717,7 @@ static void test_close_pending_ctx(const struct intel_execution_ring *e)gem_context_destroy (fd, ctx);igt_assert_eq (__gem_context_destroy (fd, ctx), -ENOENT ); -close (fd); +drm_close_driver (fd); }static void test_close_pending (const struct intel_execution_ring *e)@@ -727,7 +727,7 @@ static void test_close_pending(const struct intel_execution_ring *e)assert_reset_status (fd, fd,0 ,RS_NO_ERROR );inject_hang (fd,0 , e,0 ); -close (fd); +drm_close_driver (fd); }static void noop_on_each_ring (int fd,const bool reverse)@@ -789,7 +789,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e,* when gpu is reset and ring lists are cleared. */ noop_on_each_ring (fd2, reverse); -close (fd2); +drm_close_driver (fd2);pause ();exit (0 ); }else {@@ -802,7 +802,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e, }igt_post_hang_ring (fd, hang); -close (fd); +drm_close_driver (fd); } static void test_reset_count(const struct intel_execution_ring *e,@@ -842,7 +842,7 @@ static void test_reset_count(const struct intel_execution_ring *e,if (create_ctx)gem_context_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }static int _test_params (int fd,int ctx,uint32_t flags,uint32_t pad)@@ -913,7 +913,7 @@ static void test_params_ctx(void) fd =drm_reopen_driver (device);_test_param (fd,gem_context_create (fd)); -close (fd); +drm_close_driver (fd); }static void test_params (void )@@ -922,7 +922,7 @@ static void test_params(void) fd =drm_reopen_driver (device);_test_param (fd,0 ); -close (fd); +drm_close_driver (fd); } static const struct intel_execution_ring *@@ -968,7 +968,7 @@ static void defer_hangcheck(const struct intel_execution_ring *engine)igt_assert_lt (count_start, count_end); -close (fd); +drm_close_driver (fd); }static bool gem_has_reset_stats (int fd)@@ -1177,6 +1177,6 @@ igt_main } igt_fixture {igt_assert (igt_params_set (device,"reset" ,"%d" ,INT_MAX /* any reset method */ )); -close (device); +drm_close_driver (device); } }tests/i915/gem_ringfill.c +1
-1@@ -522,6 +522,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_set_tiling_vs_blt.c +1
-1@@ -276,6 +276,6 @@ igt_main igt_fixture{buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_set_tiling_vs_gtt.c +1
-1@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }tests/i915/gem_set_tiling_vs_pwrite.c +1
-1@@ -107,5 +107,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }tests/i915/gem_shrink.c +7
-7@@ -381,7 +381,7 @@ static bool has_userptr(void)if (drmIoctl (fd,DRM_IOCTL_I915_GEM_USERPTR , &userptr)) err = errno; -close (fd); +drm_close_driver (fd);return err ==EFAULT ; }@@ -430,7 +430,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)leak (fd, alloc); -close (fd); +drm_close_driver (fd); } } }@@ -442,7 +442,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,0 ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;@@ -455,7 +455,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,UDIRTY ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;@@ -467,7 +467,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)func (fd, alloc); -close (fd); +drm_close_driver (fd); } }igt_waitchildren ();@@ -510,7 +510,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main@@ -567,7 +567,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )tests/i915/gem_softpin.c +2
-2@@ -1433,7 +1433,7 @@ static void *thread(void *data) fd, ctx->id, t->engine, succeeded);intel_ctx_destroy (fd, ctx);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd);return (void *)from_user_pointer (ret); }@@ -1747,6 +1747,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_spin_batch.c +1
-1@@ -354,6 +354,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_streaming_writes.c +1
-1@@ -448,5 +448,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_stress.c +1
-1@@ -933,7 +933,7 @@ igt_simple_main_args("ds:g:c:t:rbuxmo:fp:",intel_bb_destroy (ibb);buf_ops_destroy (bops); -close (drm_fd); +drm_close_driver (drm_fd);igt_stop_signal_helper (); }tests/i915/gem_sync.c +1
-1@@ -1606,6 +1606,6 @@ igt_mainintel_allocator_multiprocess_stop ();igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_tiled_blits.c +1
-1@@ -232,6 +232,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_tiled_fence_blits.c +1
-1@@ -335,5 +335,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_tiled_partial_pwrite_pread.c +1
-1@@ -330,6 +330,6 @@ igt_mainintel_buf_destroy (tiled_staging_buf);buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_tiled_pread_basic.c +1
-1@@ -230,5 +230,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_pread_pwrite.c +1
-1@@ -162,5 +162,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_swapping.c +1
-1@@ -256,5 +256,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_tiled_wb.c +1
-1@@ -249,5 +249,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_wc.c +1
-1@@ -250,5 +250,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiling_max_stride.c +1
-1@@ -146,5 +146,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }tests/i915/gem_unfence_active_buffers.c +1
-1@@ -107,5 +107,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }tests/i915/gem_unref_active_buffers.c +1
-1@@ -133,5 +133,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }tests/i915/gem_userptr_blits.c +3
-3@@ -1086,7 +1086,7 @@ static void test_nohangcheck_hostile(int i915)close (fence);close (dir); -close (i915); +drm_close_driver (i915); }static size_t hugepagesize (void )@@ -1644,9 +1644,9 @@ static int test_dmabuf(void)/* destroy userptr object and expect SIGBUS */ free_userptr_bo (fd1, handle); -close (fd1); +drm_close_driver (fd1); -close (fd2); +drm_close_driver (fd2);reset_handle_ptr ();return 0 ;tests/i915/gem_vm_create.c +2
-2@@ -370,7 +370,7 @@ static void isolation(int i915)gem_read (i915, obj[0 ].handle,0 , &result,sizeof (result));igt_assert_eq (result,1 ); -close (other); +drm_close_driver (other);gem_close (i915, obj[1 ].handle);gem_close (i915, obj[0 ].handle);@@ -411,6 +411,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_wait.c +1
-1@@ -336,6 +336,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_watchdog.c +1
-1@@ -597,6 +597,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_workarounds.c +1
-1@@ -305,7 +305,7 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags)if (flags &CONTEXT )intel_ctx_destroy (fd, ctx);if (flags &FD ) -close (fd); +drm_close_driver (fd); } igt_maintests/i915/gen7_exec_parse.c +2
-2@@ -476,7 +476,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main@@ -748,6 +748,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }tests/i915/gen9_exec_parse.c +1
-1@@ -1299,6 +1299,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }tests/i915/i915_fb_tiling.c +1
-1@@ -52,5 +52,5 @@ igt_simple_mainigt_assert_eq (ret, -EBUSY );igt_remove_fb (drm_fd, &fb); -close (drm_fd); +drm_close_driver (drm_fd); }tests/i915/i915_getparams_basic.c +1
-1@@ -62,7 +62,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }tests/i915/i915_hangman.c +2
-2@@ -160,7 +160,7 @@ static void check_alive(void)put_ahnd (ahnd);intel_ctx_destroy (fd, ctx);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }static bool has_error_state (int dir)@@ -643,6 +643,6 @@ igt_mainigt_disallow_hang (device, hang);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }tests/i915/i915_hwmon.c +1
-1@@ -96,6 +96,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }tests/i915/i915_module_load.c +4
-4@@ -280,7 +280,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }@@ -328,7 +328,7 @@ static void load_and_check_i915(void)/* make sure the GPU is idle */ gem_quiescent_gpu (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd);/* make sure we can do basic memory ops */ gem_sanitycheck ();@@ -369,7 +369,7 @@ static uint32_t driver_load_with_lmem_bar_size(uint32_t lmem_bar_size, bool che } } -close (i915); +drm_close_driver (i915);return lmem_bar_size; }@@ -461,7 +461,7 @@ igt_mainigt_require_gem (i915);igt_require (gem_has_lmem (i915));igt_skip_on_f (igt_sysfs_get_num_gt (i915) >1 ,"Skips for more than one lmem instance.\n" ); -close (i915); +drm_close_driver (i915); }/* Test for lmem_bar_size modparam support */ tests/i915/i915_pciid.c +1
-1@@ -77,5 +77,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }tests/i915/i915_pm_backlight.c +1
-1@@ -357,6 +357,6 @@ igt_mainigt_display_fini (&display);igt_pm_restore_sata_link_power_management (); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/i915/i915_pm_dc.c +1
-1@@ -730,7 +730,7 @@ igt_mainclose (data.debugfs_root_fd);close (data.msr_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }igt_exit ();tests/i915/i915_pm_freq_api.c +1
-1@@ -150,6 +150,6 @@ igt_mainigt_assert (set_freq (dirfd,RPS_MAX_FREQ_MHZ , stash_max[gt]) >0 );igt_assert (set_freq (dirfd,RPS_MIN_FREQ_MHZ , stash_min[gt]) >0 ); } -close (i915); +drm_close_driver (i915); } }tests/i915/i915_pm_freq_mult.c +1
-1@@ -177,6 +177,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/i915_pm_lpsp.c +1
-1@@ -223,6 +223,6 @@ igt_main igt_fixture {free (data.pwr_dmn_info);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/i915/i915_pm_rc6_residency.c +1
-1@@ -627,6 +627,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/i915_pm_rps.c +1
-1@@ -917,7 +917,7 @@ static void pm_rps_exit_handler(int sig)if (lh.igt_proc.running)load_helper_stop (); -close (drm_fd); +drm_close_driver (drm_fd); } igt_maintests/i915/i915_pm_sseu.c +1
-1@@ -323,7 +323,7 @@ gem_deinit(void)case 2 :buf_ops_destroy (gem.bops);case 1 : -close (gem.drm_fd); +drm_close_driver (gem.drm_fd); } }tests/i915/i915_power.c +1
-1@@ -86,6 +86,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/i915_query.c +1
-1@@ -1572,6 +1572,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/i915_suspend.c +3
-3@@ -256,7 +256,7 @@ test_shrink(int fd, unsigned int mode)igt_system_suspend_autoresume (mode,SUSPEND_TEST_NONE );munmap (mem, size); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();@@ -300,7 +300,7 @@ test_suspend_without_i915(int state)igt_pm_get_d3cold_allowed (&card, d3cold_allowed);igt_pm_set_d3cold_allowed (&card,"0\n" ); } -close (fd); +drm_close_driver (fd);igt_kmsg (KMSG_INFO "Unloading i915\n" );igt_assert_eq (igt_i915_driver_unload (),0 );@@ -383,5 +383,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/perf.c +3
-3@@ -4704,7 +4704,7 @@ gen12_test_single_ctx_render_target_writes_a_counter(const struct intel_executioigt_drop_root ();gen12_single_ctx_helper (e); -close (drm_fd); +drm_close_driver (drm_fd); } child_ret =igt_wait_helper (&child); igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||@@ -5485,7 +5485,7 @@ test_i915_ref_count(void)igt_debug ("ref count after opening i915 perf stream = %u\n" , ref_count1);igt_assert (ref_count1 > ref_count0); -close (drm_fd); +drm_close_driver (drm_fd);close (sysfs); drm_fd =-1 ; sysfs =-1 ;@@ -6194,6 +6194,6 @@ igt_mainput_engine_groups (perf_oa_groups, num_perf_oa_groups);intel_ctx_destroy (drm_fd, ctx); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/i915/perf_pmu.c +3
-3@@ -2424,7 +2424,7 @@ static void test_unload(unsigned int num_engines)if (fd[count] !=-1 ) count++; -close (i915); +drm_close_driver (i915); buf =calloc (count,sizeof (uint64_t ));igt_assert (buf);@@ -2768,13 +2768,13 @@ igt_main igt_fixture {intel_ctx_destroy (render_fd ,render_ctx ); -close (render_fd); +drm_close_driver (render_fd); } } igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } igt_subtest("module-unload") {tests/i915/sysfs_defaults.c +1
-1@@ -116,6 +116,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_heartbeat_interval.c +1
-1@@ -543,6 +543,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_preempt_timeout.c +1
-1@@ -362,6 +362,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_timeslice_duration.c +1
-1@@ -587,6 +587,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }Signature · 1 line
2.40.0
PATCH v4 21/24 tests/i915: Use drm_close_driver() to close the drm fd
In reply to Bhanuprakash ModemTo close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
V2: - New patch for generic tests
V3, V4: - Rebase
--- tests/i915/api_intel_allocator.c | 6 ++-- tests/i915/api_intel_bb.c | 2 +- tests/i915/drm_fdinfo.c | 2 +- tests/i915/gem_bad_reloc.c | 2 +- tests/i915/gem_barrier_race.c | 2 +- tests/i915/gem_basic.c | 2 +- tests/i915/gem_blits.c | 2 +- tests/i915/gem_busy.c | 2 +- tests/i915/gem_caching.c | 2 +- tests/i915/gem_ccs.c | 2 +- tests/i915/gem_close_race.c | 12 ++++---- tests/i915/gem_cs_tlb.c | 2 +- tests/i915/gem_ctx_bad_destroy.c | 2 +- tests/i915/gem_ctx_create.c | 4 +-- tests/i915/gem_ctx_exec.c | 2 +- tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 6 ++-- tests/i915/gem_ctx_shared.c | 2 +- tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 16 +++++------ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 2 +- tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_basic.c | 2 +- tests/i915/gem_exec_big.c | 2 +- tests/i915/gem_exec_capture.c | 2 +- tests/i915/gem_exec_create.c | 2 +- tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 4 +-- tests/i915/gem_exec_flush.c | 2 +- tests/i915/gem_exec_gttfill.c | 4 +-- tests/i915/gem_exec_latency.c | 2 +- tests/i915/gem_exec_nop.c | 2 +- tests/i915/gem_exec_parallel.c | 4 +-- tests/i915/gem_exec_params.c | 2 +- tests/i915/gem_exec_reloc.c | 2 +- tests/i915/gem_exec_schedule.c | 2 +- tests/i915/gem_exec_store.c | 2 +- tests/i915/gem_exec_suspend.c | 2 +- tests/i915/gem_exec_whisper.c | 6 ++-- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 2 +- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 4 +-- tests/i915/gem_flink_race.c | 6 ++-- tests/i915/gem_gtt_cpu_tlb.c | 2 +- tests/i915/gem_gtt_hog.c | 2 +- tests/i915/gem_gtt_speed.c | 2 +- tests/i915/gem_huc_copy.c | 2 +- tests/i915/gem_lmem_evict.c | 4 +-- tests/i915/gem_lmem_swapping.c | 10 +++---- tests/i915/gem_madvise.c | 12 ++++---- tests/i915/gem_media_fill.c | 2 +- tests/i915/gem_mmap.c | 2 +- tests/i915/gem_mmap_gtt.c | 6 ++-- tests/i915/gem_mmap_offset.c | 8 +++--- tests/i915/gem_mmap_wc.c | 2 +- tests/i915/gem_partial_pwrite_pread.c | 2 +- tests/i915/gem_pipe_control_store_loop.c | 2 +- tests/i915/gem_ppgtt.c | 8 +++--- tests/i915/gem_pread.c | 2 +- tests/i915/gem_pread_after_blit.c | 2 +- tests/i915/gem_pwrite.c | 2 +- tests/i915/gem_pwrite_snooped.c | 2 +- tests/i915/gem_pxp.c | 2 +- tests/i915/gem_read_read_speed.c | 2 +- tests/i915/gem_readwrite.c | 2 +- tests/i915/gem_reg_read.c | 2 +- tests/i915/gem_render_copy.c | 2 +- tests/i915/gem_render_copy_redux.c | 2 +- tests/i915/gem_reset_stats.c | 32 ++++++++++----------- tests/i915/gem_ringfill.c | 2 +- tests/i915/gem_set_tiling_vs_blt.c | 2 +- tests/i915/gem_set_tiling_vs_gtt.c | 2 +- tests/i915/gem_set_tiling_vs_pwrite.c | 2 +- tests/i915/gem_shrink.c | 14 ++++----- tests/i915/gem_softpin.c | 4 +-- tests/i915/gem_spin_batch.c | 2 +- tests/i915/gem_streaming_writes.c | 2 +- tests/i915/gem_stress.c | 2 +- tests/i915/gem_sync.c | 2 +- tests/i915/gem_tiled_blits.c | 2 +- tests/i915/gem_tiled_fence_blits.c | 2 +- tests/i915/gem_tiled_partial_pwrite_pread.c | 2 +- tests/i915/gem_tiled_pread_basic.c | 2 +- tests/i915/gem_tiled_pread_pwrite.c | 2 +- tests/i915/gem_tiled_swapping.c | 2 +- tests/i915/gem_tiled_wb.c | 2 +- tests/i915/gem_tiled_wc.c | 2 +- tests/i915/gem_tiling_max_stride.c | 2 +- tests/i915/gem_unfence_active_buffers.c | 2 +- tests/i915/gem_unref_active_buffers.c | 2 +- tests/i915/gem_userptr_blits.c | 6 ++-- tests/i915/gem_vm_create.c | 4 +-- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 2 +- tests/i915/gen7_exec_parse.c | 4 +-- tests/i915/gen9_exec_parse.c | 2 +- tests/i915/i915_fb_tiling.c | 2 +- tests/i915/i915_getparams_basic.c | 2 +- tests/i915/i915_hangman.c | 4 +-- tests/i915/i915_hwmon.c | 2 +- tests/i915/i915_module_load.c | 8 +++--- tests/i915/i915_pciid.c | 2 +- tests/i915/i915_pm_backlight.c | 2 +- tests/i915/i915_pm_dc.c | 2 +- tests/i915/i915_pm_freq_api.c | 2 +- tests/i915/i915_pm_freq_mult.c | 2 +- tests/i915/i915_pm_lpsp.c | 2 +- tests/i915/i915_pm_rc6_residency.c | 2 +- tests/i915/i915_pm_rps.c | 2 +- tests/i915/i915_pm_sseu.c | 2 +- tests/i915/i915_power.c | 2 +- tests/i915/i915_query.c | 2 +- tests/i915/i915_suspend.c | 6 ++-- tests/i915/perf.c | 6 ++-- tests/i915/perf_pmu.c | 6 ++-- tests/i915/sysfs_defaults.c | 2 +- tests/i915/sysfs_heartbeat_interval.c | 2 +- tests/i915/sysfs_preempt_timeout.c | 2 +- tests/i915/sysfs_timeslice_duration.c | 2 +- 126 files changed, 205 insertions(+), 205 deletions(-)
tests/i915/api_intel_allocator.c +3 -3
@@ -579,7 +579,7 @@ static void reopen(int fd)__reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2); }#define REOPEN_TIMEOUT 3
@@ -605,7 +605,7 @@ static void reopen_fork(int fd)/* Check references at the end */ __reopen_allocs (fd, fd2, true); -close (fd2); +drm_close_driver (fd2);intel_allocator_multiprocess_stop (); }
@@ -924,5 +924,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/api_intel_bb.c +1 -1
@@ -1908,6 +1908,6 @@ igt_main_args("dpibc:", NULL, help_str, opt_handler, NULL) igt_fixture {buf_ops_destroy (bops); -close (i915); +drm_close_driver (i915); } }
tests/i915/drm_fdinfo.c +1 -1
@@ -910,6 +910,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_bad_reloc.c +1 -1
@@ -231,5 +231,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_barrier_race.c +1 -1
@@ -120,7 +120,7 @@ static void intel_context_first_pin_last_unpin_loop(int fd, uint64_t engine, int }while (!READ_ONCE (*done)); -close (fd); +drm_close_driver (fd); }static void test_remote_request (int fd,uint64_t engine,unsigned int timeout)
tests/i915/gem_basic.c +1 -1
@@ -145,7 +145,7 @@ igt_main gpu_fd =__drm_open_driver_another (child,DRIVER_INTEL );igt_assert_f (gpu_fd >0 ,"cannot open gpu-%d, errno=%d\n" , child, errno);test_create_close (gpu_fd); -close (gpu_fd); +drm_close_driver (gpu_fd); }igt_waitchildren ();
tests/i915/gem_blits.c +1 -1
@@ -904,6 +904,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }
tests/i915/gem_busy.c +1 -1
@@ -617,6 +617,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_caching.c +1 -1
@@ -356,6 +356,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.fd); +drm_close_driver (data.fd); } }
tests/i915/gem_ccs.c +1 -1
@@ -764,6 +764,6 @@ igt_main_args("bf:pst:W:H:", NULL, help_str, opt_handler, NULL) igt_fixture {igt_disallow_hang (i915, hang); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_close_race.c +6 -6
@@ -329,7 +329,7 @@ static void multigpu_threads(int timeout, unsigned int flags, int gpu_count)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -348,7 +348,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -372,7 +372,7 @@ igt_main gpu_count =igt_device_filter_count ();igt_fork_hang_detector (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission." );
@@ -384,7 +384,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );
@@ -397,7 +397,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -424,7 +424,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_describe("Share buffer handle across different drm fd's and trying to race"
tests/i915/gem_cs_tlb.c +1 -1
@@ -174,5 +174,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_bad_destroy.c +1 -1
@@ -98,5 +98,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_create.c +2 -2
@@ -206,7 +206,7 @@ static void files(int core, const intel_ctx_cfg_t *cfg,gem_execbuf (fd, &execbuf);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); count++;clock_gettime (CLOCK_MONOTONIC , &end);
@@ -756,6 +756,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_exec.c +1 -1
@@ -403,7 +403,7 @@ static void nohangcheck_hostile(int i915)put_ahnd (ahnd);close (dir); -close (i915); +drm_close_driver (i915); }static void close_race (int i915)
tests/i915/gem_ctx_param.c +1 -1
@@ -636,5 +636,5 @@ igt_maintest_get_invalid_param (fd,I915_CONTEXT_PARAM_ENGINES );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_persistence.c +3 -3
@@ -791,7 +791,7 @@ static void test_nonpersistent_file(int i915)gem_context_set_persistence (i915,0 , false); spin = igt_spin_new(i915, .ahnd = ahnd, .flags = IGT_SPIN_FENCE_OUT); -close (i915); +drm_close_driver (i915);flush_delayed_fput (debugfs);igt_assert_eq (wait_for_status (spin->out_fence, reset_timeout_ms), -EIO );
@@ -1274,7 +1274,7 @@ static void __smoker(int i915, const intel_ctx_cfg_t *cfg,intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);flush_delayed_fput (i915);igt_spin_end (spin);
@@ -1570,6 +1570,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_ctx_shared.c +1 -1
@@ -315,7 +315,7 @@ static void exhaust_shared_gtt(int i915, unsigned int flags)igt_info ("Created %lu shared contexts, before %d (%s)\n" , count, err,strerror (-err)); } -close (i915); +drm_close_driver (i915);igt_waitchildren (); }
tests/i915/gem_ctx_sseu.c +1 -1
@@ -559,6 +559,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_switch.c +1 -1
@@ -805,6 +805,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, heavy);gem_close (fd, light); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_eio.c +8 -8
@@ -656,7 +656,7 @@ static void test_banned(int fd) { fd =reopen_device (fd);__test_banned (fd); -close (fd); +drm_close_driver (fd); }#define TEST_WEDGE (1)
@@ -690,7 +690,7 @@ static void test_wait(int fd, unsigned int flags, unsigned int wait)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_suspend (int fd,int state)
@@ -708,7 +708,7 @@ static void test_suspend(int fd, int state)igt_require (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight (int fd,unsigned int wait)
@@ -772,7 +772,7 @@ static void test_inflight(int fd, unsigned int wait)trigger_reset (fd);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd); } }
@@ -833,7 +833,7 @@ static void test_inflight_suspend(int fd)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static const intel_ctx_t *context_create_safe (int i915)
@@ -923,7 +923,7 @@ static void test_inflight_contexts(int fd, unsigned int wait)for (unsigned int n =0 ; n <ARRAY_SIZE (ctx); n++)intel_ctx_destroy (fd, ctx[n]); -close (fd); +drm_close_driver (fd); } }
@@ -979,7 +979,7 @@ static void test_inflight_external(int fd)put_ahnd (ahnd);igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); }static void test_inflight_internal (int fd,unsigned int wait)
@@ -1029,7 +1029,7 @@ static void test_inflight_internal(int fd, unsigned int wait)igt_assert (i915_reset_control (fd, true));trigger_reset (fd); -close (fd); +drm_close_driver (fd); } static void reset_stress(int fd, uint64_t ahnd, const intel_ctx_t *ctx0,
tests/i915/gem_evict_alignment.c +1 -1
@@ -282,6 +282,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_evict_everything.c +1 -1
@@ -351,6 +351,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_alignment.c +1 -1
@@ -487,7 +487,7 @@ static void forked(int i915, int timeout)igt_waitchildren_timeout (3 * timeout,NULL );free (obj); -close (i915); +drm_close_driver (i915); }static void single (int fd)
tests/i915/gem_exec_async.c +1 -1
@@ -227,6 +227,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_await.c +1 -1
@@ -300,6 +300,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_basic.c +1 -1
@@ -113,6 +113,6 @@ igt_mainigt_collection_destroy (set);igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_big.c +1 -1
@@ -340,5 +340,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }
tests/i915/gem_exec_capture.c +1 -1
@@ -1055,6 +1055,6 @@ igt_mainclose (dir);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_create.c +1 -1
@@ -270,6 +270,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_fair.c +1 -1
@@ -1440,6 +1440,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_fence.c +2 -2
@@ -2118,7 +2118,7 @@ static void test_invalid_timeline_fence_array(int fd)igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT );munmap (ptr,4096 ); -close (fd); +drm_close_driver (fd); } static const char *test_syncobj_timeline_unused_fence_desc =
@@ -3701,6 +3701,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_flush.c +1 -1
@@ -2207,6 +2207,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_gttfill.c +2 -2
@@ -314,7 +314,7 @@ igt_main// release resources igt_stop_hang_detector ();intel_ctx_destroy (g_fd, ctx); -close (g_fd); +drm_close_driver (g_fd); }igt_waitchildren ();
@@ -322,6 +322,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_latency.c +1 -1
@@ -1001,6 +1001,6 @@ igt_main igt_fixture {intel_register_access_fini (&mmio_data);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_nop.c +1 -1
@@ -1150,6 +1150,6 @@ igt_mainigt_stop_hang_detector ();gem_close (device, handle);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_parallel.c +2 -2
@@ -230,7 +230,7 @@ static void *thread(void *data)intel_ctx_destroy (fd, tmp_ctx);gem_close (fd, obj[1 ].handle);if (t->flags &FDS ) -close (fd); +drm_close_driver (fd); t->used = used;return NULL ;
@@ -413,6 +413,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_params.c +1 -1
@@ -825,6 +825,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_reloc.c +1 -1
@@ -1771,5 +1771,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_exec_schedule.c +1 -1
@@ -3755,6 +3755,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_store.c +1 -1
@@ -480,6 +480,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_suspend.c +1 -1
@@ -510,6 +510,6 @@ igt_mainigt_collection_destroy (set);igt_disallow_hang (fd, hang);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_whisper.c +3 -3
@@ -457,7 +457,7 @@ static void fini_hang(struct hang *h)put_offset (h->ahnd, h->obj.handle);put_ahnd (h->ahnd);intel_ctx_destroy (h->fd, h->ctx); -close (h->fd); +drm_close_driver (h->fd); }static void ctx_set_random_priority (int fd,uint32_t ctx)
@@ -829,7 +829,7 @@ static void whisper(int fd, const intel_ctx_t *ctx,gem_close (fd, batches[n].handle);if (flags &FDS ) {for (n =0 ; n <64 ; n++) -close (fds[n]); +drm_close_driver (fds[n]); } }
@@ -939,6 +939,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exercise_blt.c +1 -1
@@ -398,6 +398,6 @@ igt_main_args("b:pst:W:H:", NULL, help_str, opt_handler, NULL) } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_fd_exhaustion.c +1 -1
@@ -75,5 +75,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_fence_thrash.c +1 -1
@@ -244,7 +244,7 @@ static int run_test(int threads_per_fence, void *f, int tiling,igt_assert (func (&t) == (void *)0 ); } -close (t.fd); +drm_close_driver (t.fd);return 0 ; }
tests/i915/gem_fenced_exec_thrash.c +1 -1
@@ -217,5 +217,5 @@ igt_mainrun_test (fd, num_fences +1 ,intel_gen (devid) >=4 ?0 :ENOBUFS ,0 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_flink_basic.c +2 -2
@@ -196,7 +196,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); fd2 =drm_open_driver (DRIVER_INTEL );/* Flink name remains valid due to the second reference */
@@ -205,7 +205,7 @@ test_flink_lifetime(int fd)igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -close (fd2); +drm_close_driver (fd2); } igt_main
tests/i915/gem_flink_race.c +3 -3
@@ -141,7 +141,7 @@ static void test_flink_name(int timeout) igt_stats_get_max(&stats));igt_stats_fini (&stats); -close (fd); +drm_close_driver (fd); }static void *thread_fn_flink_close (void *p)
@@ -202,13 +202,13 @@ static void test_flink_close(void)igt_assert (status ==0 ); } -close (fd); +drm_close_driver (fd); obj_count =igt_get_stable_obj_count (fake) - obj_count;igt_info ("leaked %i objects\n" , obj_count); -close (fake); +drm_close_driver (fake);igt_assert_eq (obj_count,0 ); }
tests/i915/gem_gtt_cpu_tlb.c +1 -1
@@ -113,5 +113,5 @@ igt_simple_mainfor (i =0 ; i <OBJ_SIZE /4 ; i++)igt_assert (ptr[i] == i); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_gtt_hog.c +1 -1
@@ -170,7 +170,7 @@ igt_simple_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_mappable_ggtt (fd); -close (fd); +drm_close_driver (fd); data.fd =drm_open_driver (DRIVER_INTEL ); data.devid =intel_get_drm_devid (data.fd);
tests/i915/gem_gtt_speed.c +1 -1
@@ -521,5 +521,5 @@ igt_simple_main_args("s:", NULL, help_str, opt_handler, NULL) }gem_close (fd, handle); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_huc_copy.c +1 -1
@@ -150,6 +150,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/gem_lmem_evict.c +2 -2
@@ -103,7 +103,7 @@ igt_mainigt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();
@@ -142,7 +142,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }
tests/i915/gem_lmem_swapping.c +5 -5
@@ -718,7 +718,7 @@ static void test_evict(int i915,igt_waitchildren ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd);intel_allocator_multiprocess_stop (); }else {__do_evict (i915, ctx, ®ion->region, ¶ms, params.seed);
@@ -790,7 +790,7 @@ static void test_smem_oom(int i915, params.seed + child + 1);intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }/* smem memory hog process, respawn till the lmem process completes */
@@ -811,7 +811,7 @@ static void test_smem_oom(int i915,break ;gem_leak (fd, alloc); } -close (fd); +drm_close_driver (fd); }/* * Wait for grand-child processes to finish or be
@@ -903,7 +903,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_fd (i915);igt_require_gem (i915);igt_require (gem_has_lmem (i915)); -close (i915); +drm_close_driver (i915); }igt_i915_driver_unload ();
@@ -948,7 +948,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) igt_fixture {intel_ctx_destroy (i915, ctx);free (regions); -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); }
tests/i915/gem_madvise.c +6 -6
@@ -110,7 +110,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -132,7 +132,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -156,7 +156,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -178,7 +178,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -194,7 +194,7 @@ dontneed_before_pwrite(void)igt_assert_eq (__gem_write (fd, handle,0 , &bbe,sizeof (bbe)), -EFAULT ); -close (fd); +drm_close_driver (fd); } static void
@@ -218,7 +218,7 @@ dontneed_before_exec(void) execbuf.batch_len =sizeof (buf);igt_assert_eq (__gem_execbuf (fd, &execbuf), -EFAULT ); -close (fd); +drm_close_driver (fd); } igt_main
tests/i915/gem_media_fill.c +1 -1
@@ -181,6 +181,6 @@ igt_main igt_fixture {igt_collection_destroy (set);igt_stop_hang_detector (); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_mmap.c +1 -1
@@ -372,5 +372,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_gtt.c +3 -3
@@ -869,13 +869,13 @@ test_isolation(int i915)igt_info ("B: {fd:%d, handle:%d, offset:%" PRIx64"}\n" ,B , b, offset_b); -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );
@@ -1979,5 +1979,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_offset.c +4 -4
@@ -434,13 +434,13 @@ static void isolation(int i915)igt_assert_eq (errno,EACCES ); } -close (B ); +drm_close_driver (B ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr !=MAP_FAILED );munmap (ptr,4096 ); -close (A ); +drm_close_driver (A ); ptr =mmap (0 ,4096 ,PROT_READ ,MAP_SHARED ,A , offset_a);igt_assert (ptr ==MAP_FAILED );
@@ -735,7 +735,7 @@ static void open_flood(int i915, int timeout)mmap_offset_ioctl (i915, &arg); } -close (tmp); +drm_close_driver (tmp); count++; }
@@ -1013,6 +1013,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_mmap_wc.c +1 -1
@@ -687,5 +687,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_partial_pwrite_pread.c +1 -1
@@ -388,6 +388,6 @@ igt_mainintel_buf_destroy (scratch_buf);intel_buf_destroy (staging_buf);buf_ops_destroy (data.bops); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_pipe_control_store_loop.c +1 -1
@@ -199,6 +199,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ppgtt.c +4 -4
@@ -278,8 +278,8 @@ static void flink_and_close(void)igt_assert_eq (offset, offset_new);gem_close (fd, bo); -close (fd); -close (fd2); +drm_close_driver (fd); +drm_close_driver (fd2); }#define PAGE_SIZE 4096
@@ -412,7 +412,7 @@ static bool has_contexts(void) fd =drm_open_driver (DRIVER_INTEL ); result =gem_has_contexts (fd); -close (fd); +drm_close_driver (fd);return result; }
@@ -425,7 +425,7 @@ igt_mainint fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);gem_require_blitter (fd); -close (fd); +drm_close_driver (fd); } igt_subtest("blt-vs-render-ctx0") {
tests/i915/gem_pread.c +1 -1
@@ -367,6 +367,6 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL)free (src);gem_close (fd, dst); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_pread_after_blit.c +1 -1
@@ -281,5 +281,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite.c +1 -1
@@ -639,5 +639,5 @@ igt_main_args("s:", NULL, help_str, opt_handler, NULL) }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite_snooped.c +1 -1
@@ -148,5 +148,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_pxp.c +1 -1
@@ -1372,6 +1372,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_read_read_speed.c +1 -1
@@ -275,6 +275,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_readwrite.c +1 -1
@@ -158,5 +158,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_reg_read.c +1 -1
@@ -181,6 +181,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_render_copy.c +1 -1
@@ -999,6 +999,6 @@ igt_main_args("dac", NULL, help_str, opt_handler, NULL)igt_stop_hang_detector ();buf_ops_destroy (data.bops);igt_collection_destroy (set); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/gem_render_copy_redux.c +1 -1
@@ -98,7 +98,7 @@ static void data_init(data_t *data)static void data_fini (data_t *data) {buf_ops_destroy (data->bops); -close (data->fd); +drm_close_driver (data->fd); } static void scratch_buf_init(data_t *data, struct intel_buf *buf,
tests/i915/gem_reset_stats.c +16 -16
@@ -475,7 +475,7 @@ static void test_rs(const struct intel_execution_ring *e,igt_assert (igt_seconds_elapsed (&ts_injected) <=30 );for (i =0 ; i < num_fds; i++) -close (fd[i]); +drm_close_driver (fd[i]); }#define MAX_CTX 100
@@ -551,7 +551,7 @@ static void test_rs_ctx(const struct intel_execution_ring *e,for (i =0 ; i < num_fds; i++) {assert_reset_status (i, fd[i],0 ,RS_NO_ERROR ); -close (fd[i]); +drm_close_driver (fd[i]); } }
@@ -605,8 +605,8 @@ static void test_ban(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd_good,0 , &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd_bad); -close (fd_good); +drm_close_driver (fd_bad); +drm_close_driver (fd_good); }static void test_ban_ctx (const struct intel_execution_ring *e)
@@ -664,7 +664,7 @@ static void test_ban_ctx(const struct intel_execution_ring *e)igt_assert_eq (gem_reset_stats (fd, ctx_good, &rs_good),0 );igt_assert_eq (rs_good.batch_active,0 ); -close (fd); +drm_close_driver (fd); }static void test_unrelated_ctx (const struct intel_execution_ring *e)
@@ -690,8 +690,8 @@ static void test_unrelated_ctx(const struct intel_execution_ring *e)assert_reset_status (0 , fd1, ctx_guilty,RS_BATCH_ACTIVE );assert_reset_status (1 , fd2, ctx_unrelated,RS_NO_ERROR ); -close (fd1); -close (fd2); +drm_close_driver (fd1); +drm_close_driver (fd2); }static int get_reset_count (int fd,int ctx)
@@ -717,7 +717,7 @@ static void test_close_pending_ctx(const struct intel_execution_ring *e)gem_context_destroy (fd, ctx);igt_assert_eq (__gem_context_destroy (fd, ctx), -ENOENT ); -close (fd); +drm_close_driver (fd); }static void test_close_pending (const struct intel_execution_ring *e)
@@ -727,7 +727,7 @@ static void test_close_pending(const struct intel_execution_ring *e)assert_reset_status (fd, fd,0 ,RS_NO_ERROR );inject_hang (fd,0 , e,0 ); -close (fd); +drm_close_driver (fd); }static void noop_on_each_ring (int fd,const bool reverse)
@@ -789,7 +789,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e,* when gpu is reset and ring lists are cleared. */ noop_on_each_ring (fd2, reverse); -close (fd2); +drm_close_driver (fd2);pause ();exit (0 ); }else {
@@ -802,7 +802,7 @@ static void test_close_pending_fork(const struct intel_execution_ring *e, }igt_post_hang_ring (fd, hang); -close (fd); +drm_close_driver (fd); } static void test_reset_count(const struct intel_execution_ring *e,
@@ -842,7 +842,7 @@ static void test_reset_count(const struct intel_execution_ring *e,if (create_ctx)gem_context_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); }static int _test_params (int fd,int ctx,uint32_t flags,uint32_t pad)
@@ -913,7 +913,7 @@ static void test_params_ctx(void) fd =drm_reopen_driver (device);_test_param (fd,gem_context_create (fd)); -close (fd); +drm_close_driver (fd); }static void test_params (void )
@@ -922,7 +922,7 @@ static void test_params(void) fd =drm_reopen_driver (device);_test_param (fd,0 ); -close (fd); +drm_close_driver (fd); } static const struct intel_execution_ring *
@@ -968,7 +968,7 @@ static void defer_hangcheck(const struct intel_execution_ring *engine)igt_assert_lt (count_start, count_end); -close (fd); +drm_close_driver (fd); }static bool gem_has_reset_stats (int fd)
@@ -1177,6 +1177,6 @@ igt_main } igt_fixture {igt_assert (igt_params_set (device,"reset" ,"%d" ,INT_MAX /* any reset method */ )); -close (device); +drm_close_driver (device); } }
tests/i915/gem_ringfill.c +1 -1
@@ -522,6 +522,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_set_tiling_vs_blt.c +1 -1
@@ -276,6 +276,6 @@ igt_main igt_fixture{buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_set_tiling_vs_gtt.c +1 -1
@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_set_tiling_vs_pwrite.c +1 -1
@@ -107,5 +107,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_shrink.c +7 -7
@@ -381,7 +381,7 @@ static bool has_userptr(void)if (drmIoctl (fd,DRM_IOCTL_I915_GEM_USERPTR , &userptr)) err = errno; -close (fd); +drm_close_driver (fd);return err ==EFAULT ; }
@@ -430,7 +430,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)leak (fd, alloc); -close (fd); +drm_close_driver (fd); } } }
@@ -442,7 +442,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,0 ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;
@@ -455,7 +455,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)userptr (fd, alloc,UDIRTY ); -close (fd); +drm_close_driver (fd); } } nchildren = (nchildren +1 )/2 ;
@@ -467,7 +467,7 @@ static void run_test(int nchildren, uint64_t alloc,int fd =drm_open_driver (DRIVER_INTEL );for (int pass =0 ; pass < nchildren; pass++)func (fd, alloc); -close (fd); +drm_close_driver (fd); } }igt_waitchildren ();
@@ -510,7 +510,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main
@@ -567,7 +567,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )
tests/i915/gem_softpin.c +2 -2
@@ -1433,7 +1433,7 @@ static void *thread(void *data) fd, ctx->id, t->engine, succeeded);intel_ctx_destroy (fd, ctx);gem_close (fd, obj[1 ].handle); -close (fd); +drm_close_driver (fd);return (void *)from_user_pointer (ret); }
@@ -1747,6 +1747,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_spin_batch.c +1 -1
@@ -354,6 +354,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_streaming_writes.c +1 -1
@@ -448,5 +448,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_stress.c +1 -1
@@ -933,7 +933,7 @@ igt_simple_main_args("ds:g:c:t:rbuxmo:fp:",intel_bb_destroy (ibb);buf_ops_destroy (bops); -close (drm_fd); +drm_close_driver (drm_fd);igt_stop_signal_helper (); }
tests/i915/gem_sync.c +1 -1
@@ -1606,6 +1606,6 @@ igt_mainintel_allocator_multiprocess_stop ();igt_stop_hang_detector ();intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_blits.c +1 -1
@@ -232,6 +232,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_fence_blits.c +1 -1
@@ -335,5 +335,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_partial_pwrite_pread.c +1 -1
@@ -330,6 +330,6 @@ igt_mainintel_buf_destroy (tiled_staging_buf);buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_pread_basic.c +1 -1
@@ -230,5 +230,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_pread_pwrite.c +1 -1
@@ -162,5 +162,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_swapping.c +1 -1
@@ -256,5 +256,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_wb.c +1 -1
@@ -249,5 +249,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_wc.c +1 -1
@@ -250,5 +250,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiling_max_stride.c +1 -1
@@ -146,5 +146,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_unfence_active_buffers.c +1 -1
@@ -107,5 +107,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_unref_active_buffers.c +1 -1
@@ -133,5 +133,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_userptr_blits.c +3 -3
@@ -1086,7 +1086,7 @@ static void test_nohangcheck_hostile(int i915)close (fence);close (dir); -close (i915); +drm_close_driver (i915); }static size_t hugepagesize (void )
@@ -1644,9 +1644,9 @@ static int test_dmabuf(void)/* destroy userptr object and expect SIGBUS */ free_userptr_bo (fd1, handle); -close (fd1); +drm_close_driver (fd1); -close (fd2); +drm_close_driver (fd2);reset_handle_ptr ();return 0 ;
tests/i915/gem_vm_create.c +2 -2
@@ -370,7 +370,7 @@ static void isolation(int i915)gem_read (i915, obj[0 ].handle,0 , &result,sizeof (result));igt_assert_eq (result,1 ); -close (other); +drm_close_driver (other);gem_close (i915, obj[1 ].handle);gem_close (i915, obj[0 ].handle);
@@ -411,6 +411,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_wait.c +1 -1
@@ -336,6 +336,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_watchdog.c +1 -1
@@ -597,6 +597,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_workarounds.c +1 -1
@@ -305,7 +305,7 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags)if (flags &CONTEXT )intel_ctx_destroy (fd, ctx);if (flags &FD ) -close (fd); +drm_close_driver (fd); } igt_main
tests/i915/gen7_exec_parse.c +2 -2
@@ -476,7 +476,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main
@@ -748,6 +748,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gen9_exec_parse.c +1 -1
@@ -1299,6 +1299,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_fb_tiling.c +1 -1
@@ -52,5 +52,5 @@ igt_simple_mainigt_assert_eq (ret, -EBUSY );igt_remove_fb (drm_fd, &fb); -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_getparams_basic.c +1 -1
@@ -62,7 +62,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_hangman.c +2 -2
@@ -160,7 +160,7 @@ static void check_alive(void)put_ahnd (ahnd);intel_ctx_destroy (fd, ctx);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }static bool has_error_state (int dir)
@@ -643,6 +643,6 @@ igt_mainigt_disallow_hang (device, hang);intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/i915_hwmon.c +1 -1
@@ -96,6 +96,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_module_load.c +4 -4
@@ -280,7 +280,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }
@@ -328,7 +328,7 @@ static void load_and_check_i915(void)/* make sure the GPU is idle */ gem_quiescent_gpu (drm_fd); -close (drm_fd); +drm_close_driver (drm_fd);/* make sure we can do basic memory ops */ gem_sanitycheck ();
@@ -369,7 +369,7 @@ static uint32_t driver_load_with_lmem_bar_size(uint32_t lmem_bar_size, bool che } } -close (i915); +drm_close_driver (i915);return lmem_bar_size; }
@@ -461,7 +461,7 @@ igt_mainigt_require_gem (i915);igt_require (gem_has_lmem (i915));igt_skip_on_f (igt_sysfs_get_num_gt (i915) >1 ,"Skips for more than one lmem instance.\n" ); -close (i915); +drm_close_driver (i915); }/* Test for lmem_bar_size modparam support */
tests/i915/i915_pciid.c +1 -1
@@ -77,5 +77,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }
tests/i915/i915_pm_backlight.c +1 -1
@@ -357,6 +357,6 @@ igt_mainigt_display_fini (&display);igt_pm_restore_sata_link_power_management (); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/i915/i915_pm_dc.c +1 -1
@@ -730,7 +730,7 @@ igt_mainclose (data.debugfs_root_fd);close (data.msr_fd);display_fini (&data); -close (data.drm_fd); +drm_close_driver (data.drm_fd); }igt_exit ();
tests/i915/i915_pm_freq_api.c +1 -1
@@ -139,7 +139,7 @@ static void restore_sysfs_freq(int sig) }free (stash_min);free (stash_max); -close (i915); +drm_close_driver (i915); } igt_main
tests/i915/i915_pm_freq_mult.c +1 -1
@@ -177,6 +177,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_lpsp.c +1 -1
@@ -223,6 +223,6 @@ igt_main igt_fixture {free (data.pwr_dmn_info);igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/i915/i915_pm_rc6_residency.c +1 -1
@@ -627,6 +627,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_rps.c +1 -1
@@ -917,7 +917,7 @@ static void pm_rps_exit_handler(int sig)if (lh.igt_proc.running)load_helper_stop (); -close (drm_fd); +drm_close_driver (drm_fd); } igt_main
tests/i915/i915_pm_sseu.c +1 -1
@@ -323,7 +323,7 @@ gem_deinit(void)case 2 :buf_ops_destroy (gem.bops);case 1 : -close (gem.drm_fd); +drm_close_driver (gem.drm_fd); } }
tests/i915/i915_power.c +1 -1
@@ -86,6 +86,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_query.c +1 -1
@@ -1572,6 +1572,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_suspend.c +3 -3
@@ -256,7 +256,7 @@ test_shrink(int fd, unsigned int mode)igt_system_suspend_autoresume (mode,SUSPEND_TEST_NONE );munmap (mem, size); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -300,7 +300,7 @@ test_suspend_without_i915(int state)igt_pm_get_d3cold_allowed (&card, d3cold_allowed);igt_pm_set_d3cold_allowed (&card,"0\n" ); } -close (fd); +drm_close_driver (fd);igt_kmsg (KMSG_INFO "Unloading i915\n" );igt_assert_eq (igt_i915_driver_unload (),0 );
@@ -383,5 +383,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/perf.c +3 -3
@@ -4704,7 +4704,7 @@ gen12_test_single_ctx_render_target_writes_a_counter(const struct intel_executioigt_drop_root ();gen12_single_ctx_helper (e); -close (drm_fd); +drm_close_driver (drm_fd); } child_ret =igt_wait_helper (&child); igt_assert(WEXITSTATUS(child_ret) == EAGAIN ||
@@ -5485,7 +5485,7 @@ test_i915_ref_count(void)igt_debug ("ref count after opening i915 perf stream = %u\n" , ref_count1);igt_assert (ref_count1 > ref_count0); -close (drm_fd); +drm_close_driver (drm_fd);close (sysfs); drm_fd =-1 ; sysfs =-1 ;
@@ -6194,6 +6194,6 @@ igt_mainput_engine_groups (perf_oa_groups, num_perf_oa_groups);intel_ctx_destroy (drm_fd, ctx); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/perf_pmu.c +3 -3
@@ -2424,7 +2424,7 @@ static void test_unload(unsigned int num_engines)if (fd[count] !=-1 ) count++; -close (i915); +drm_close_driver (i915); buf =calloc (count,sizeof (uint64_t ));igt_assert (buf);
@@ -2768,13 +2768,13 @@ igt_main igt_fixture {intel_ctx_destroy (render_fd ,render_ctx ); -close (render_fd); +drm_close_driver (render_fd); } } igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } igt_subtest("module-unload") {
tests/i915/sysfs_defaults.c +1 -1
@@ -116,6 +116,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_heartbeat_interval.c +1 -1
@@ -543,6 +543,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_preempt_timeout.c +1 -1
@@ -362,6 +362,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_timeslice_duration.c +1 -1
@@ -587,6 +587,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
Signature · 1 line
2.40.0
PATCH v4 22/24 tests/xe/xe_debugfs: Use xe_config() helper to get the config
In reply to Bhanuprakash ModemUse xe_config() helper to get the config.
--- tests/xe/xe_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tests/xe/xe_debugfs.c +1 -1
@@ -253,7 +253,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) } igt_subtest("base") { -test_base (fd, xe_dev->config); +test_base (fd,xe_config (fd)); }
Signature · 1 line
2.40.0
Re: [igt-dev] [V4 i-g-t 22/24] tests/xe/xe_debugfs: Use xe_config() helper to get the config
Hi Bhanuprakash,
could you move it up in series just after 3/24? [i-g-t 03/24] lib/xe/xe_query: Add xe_config() interface
with that:
Regards,
Kamil
Quoted 23 lines · Bhanuprakash Modem
Use
xe_config()helper to get the config.Signed-off-by Bhanuprakash Modem <[email protected]>--- tests/xe/xe_debugfs.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)tests/xe/xe_debugfs.c +1
-1@@ -253,7 +253,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL) } igt_subtest("base") { -test_base (fd, xe_dev->config); +test_base (fd,xe_config (fd)); }Signature · 1 line
2.40.0
PATCH v4 23/24 tests: Drop xe_device get/put from test level
In reply to Bhanuprakash ModemAs xe_device get/put is already handled at driver open/close level, drop these checks from tests.
V2: - New patch for xe_config()
V3: - Fix xe_spin_batch.c
--- tests/kms_3d.c | 6 ------ tests/kms_addfb_basic.c | 9 +-------- tests/kms_flip.c | 9 +-------- tests/kms_flip_event_leak.c | 4 ---- tests/kms_getfb.c | 15 +-------------- tests/kms_hdmi_inject.c | 7 ------- tests/kms_setmode.c | 7 ------- tests/xe/xe_compute.c | 8 ++------ tests/xe/xe_create.c | 9 ++------- tests/xe/xe_debugfs.c | 6 +----- tests/xe/xe_dma_buf_sync.c | 11 ++--------- tests/xe/xe_evict.c | 5 ----- tests/xe/xe_exec_balancer.c | 8 ++------ tests/xe/xe_exec_basic.c | 8 ++------ tests/xe/xe_exec_compute_mode.c | 8 ++------ tests/xe/xe_exec_fault_mode.c | 5 +---- tests/xe/xe_exec_reset.c | 23 +++++------------------ tests/xe/xe_exec_threads.c | 20 ++++---------------- tests/xe/xe_gpgpu_fill.c | 3 --- tests/xe/xe_guc_pc.c | 2 -- tests/xe/xe_huc_copy.c | 8 ++------ tests/xe/xe_intel_bb.c | 2 -- tests/xe/xe_mmap.c | 8 ++------ tests/xe/xe_mmio.c | 8 ++------ tests/xe/xe_noexec_ping_pong.c | 2 -- tests/xe/xe_pm.c | 3 --- tests/xe/xe_prime_self_import.c | 31 +------------------------------ tests/xe/xe_query.c | 8 ++------ tests/xe/xe_spin_batch.c | 8 ++------ tests/xe/xe_vm.c | 5 +---- tests/xe/xe_waitfence.c | 8 ++------ 31 files changed, 40 insertions(+), 224 deletions(-)
tests/kms_3d.c +0 -6
@@ -37,9 +37,6 @@ igt_simple_main drm_fd =drm_open_driver_master (DRIVER_ANY ); -if (is_xe_device (drm_fd)) -xe_device_get (drm_fd); - res =drmModeGetResources (drm_fd);igt_require (res);
@@ -116,8 +113,5 @@ igt_simple_maindrmModeFreeConnector (connector); -if (is_xe_device (drm_fd)) -xe_device_put (drm_fd); -drm_close_driver (drm_fd); }
tests/kms_addfb_basic.c +1 -8
@@ -974,9 +974,6 @@ igt_main igt_fixture { fd =drm_open_driver_master (DRIVER_ANY );igt_require (has_addfb2_iface (fd)); - -if (is_xe_device (fd)) -xe_device_get (fd); }invalid_tests (fd);
@@ -1008,10 +1005,6 @@ igt_mainigt_display_fini (&display); } - igt_fixture { -if (is_xe_device (fd)) -xe_device_put (fd); - +igt_fixture drm_close_driver (fd ); - } }
tests/kms_flip.c +1 -8
@@ -1858,9 +1858,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)igt_install_exit_handler (kms_flip_exit_handler);get_timestamp_format (); -if (is_xe_device (drm_fd)) -xe_device_get (drm_fd); -if (is_i915_device (drm_fd)) { bops =buf_ops_create (drm_fd); }
@@ -1926,10 +1923,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) }igt_stop_signal_helper (); - igt_fixture { -if (is_xe_device (drm_fd)) -xe_device_put (drm_fd); - +igt_fixture drm_close_driver (drm_fd ); - } }
tests/kms_flip_event_leak.c +0 -4
@@ -65,8 +65,6 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output)igt_device_drop_master (data->drm_fd);igt_device_set_master (fd); -if (is_xe_device (fd)) -xe_device_get (fd); igt_create_fb(fd, mode->hdisplay, mode->vdisplay, DRM_FORMAT_XRGB8888,
@@ -77,8 +75,6 @@ static void test(data_t *data, enum pipe pipe, igt_output_t *output) data);igt_assert_eq (ret,0 ); -if (is_xe_device (fd)) -xe_device_put (fd); ret =drm_close_driver (fd);igt_assert_eq (ret,0 );
tests/kms_getfb.c +1 -14
@@ -404,9 +404,6 @@ static void test_handle_protection(void) { igt_fixture { non_master_fd =drm_open_driver (DRIVER_ANY ); -if (is_xe_device (non_master_fd)) -xe_device_get (non_master_fd); - non_master_add.width =1024 ; non_master_add.height =1024 ; non_master_add.pixel_format =DRM_FORMAT_XRGB8888 ;
@@ -454,9 +451,6 @@ static void test_handle_protection(void) {do_ioctl (non_master_fd,DRM_IOCTL_MODE_RMFB , &non_master_add.fb_id);gem_close (non_master_fd, non_master_add.handles[0 ]); -if (is_xe_device (non_master_fd)) -xe_device_get (non_master_fd); -drm_close_driver (non_master_fd); } }
@@ -468,9 +462,6 @@ igt_main igt_fixture { fd =drm_open_driver_master (DRIVER_ANY );igt_require (has_getfb_iface (fd)); - -if (is_xe_device (fd)) -xe_device_get (fd); } igt_subtest_group
@@ -485,10 +476,6 @@ igt_mainigt_subtest_group test_handle_protection (); - igt_fixture { -if (is_xe_device (fd)) -xe_device_put (fd); - +igt_fixture drm_close_driver (fd ); - } }
tests/kms_hdmi_inject.c +0 -7
@@ -206,9 +206,6 @@ igt_mainigt_require (connector);kmstest_unset_all_crtcs (drm_fd, res); - -if (is_xe_device (drm_fd)) -xe_device_get (drm_fd); } igt_describe("Make sure that 4K modes exposed by DRM match the "
@@ -223,10 +220,6 @@ igt_main igt_fixture {drmModeFreeConnector (connector); - -if (is_xe_device (drm_fd)) -xe_device_put (drm_fd); -drm_close_driver (drm_fd); } }
tests/kms_setmode.c +0 -7
@@ -955,9 +955,6 @@ igt_main_args("det:", NULL, help_str, opt_handler, NULL) drm_resources =drmModeGetResources (drm_fd);igt_require (drm_resources); - -if (is_xe_device (drm_fd)) -xe_device_get (drm_fd); }for (i =0 ; i <ARRAY_SIZE (tests); i++) {
@@ -974,10 +971,6 @@ igt_main_args("det:", NULL, help_str, opt_handler, NULL) igt_fixture {drmModeFreeResources (drm_resources); - -if (is_xe_device (drm_fd)) -xe_device_put (drm_fd); -drm_close_driver (drm_fd); } }
tests/xe/xe_compute.c +2 -6
@@ -36,16 +36,12 @@ igt_main {int xe; - igt_fixture { +igt_fixture xe =drm_open_driver (DRIVER_XE ); -xe_device_get (xe); - } igt_subtest("compute-square")test_compute_square (xe); - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }
tests/xe/xe_create.c +2 -7
@@ -209,10 +209,8 @@ igt_main {int xe; - igt_fixture { +igt_fixture xe =drm_open_driver (DRIVER_XE ); -xe_device_get (xe); - } igt_subtest("create-invalid-size") {create_invalid_size (xe);
@@ -228,9 +226,6 @@ igt_maincreate_massive_size (xe); } - - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }
tests/xe/xe_debugfs.c +1 -5
@@ -241,14 +241,12 @@ static int opt_handler(int option, int option_index, void *input) igt_main_args("", long_options, help_str, opt_handler, NULL) { -struct xe_device *xe_dev;char devnode[PATH_MAX ];int fd;int gt; igt_fixture { fd =drm_open_driver (DRIVER_XE ); - xe_dev =xe_device_get (fd);__igt_debugfs_dump (fd,"info" ,IGT_LOG_INFO ); }
@@ -269,8 +267,6 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)test_forcewake (fd); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_dma_buf_sync.c +2 -9
@@ -112,7 +112,6 @@ test_export_dma_buf(struct drm_xe_engine_class_instance *hwe0,for (i =0 ; i <N_FD ; ++i) { fd[i] =drm_open_driver (DRIVER_XE ); -xe_device_get (fd[0 ]); vm[i] =xe_vm_create (fd[i],0 ,0 ); engine[i] =xe_engine_create (fd[i], vm[i], !i ? hwe0 : hwe1,0 ); }
@@ -217,11 +216,8 @@ test_export_dma_buf(struct drm_xe_engine_class_instance *hwe0,close (dma_buf_fd[i]); } -for (i =0 ; i <N_FD ; ++i) { -xe_device_put (fd[i]); +for (i =0 ; i <N_FD ; ++i)drm_close_driver (fd[i]); - } - } igt_main
@@ -231,7 +227,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);xe_for_each_hw_engine (fd, hwe)if (hwe0 ==NULL ) {
@@ -254,8 +249,6 @@ igt_main igt_subtest("export-dma-buf-many-read-sync")test_export_dma_buf (hwe0, hwe1,16 ,READ_SYNC ); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_evict.c +0 -5
@@ -62,7 +62,6 @@ test_evict(int fd, struct drm_xe_engine_class_instance *eci,igt_assert (bo); fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); vm =xe_vm_create (fd,DRM_XE_VM_CREATE_ASYNC_BIND_OPS ,0 );if (flags &BIND_ENGINE )
@@ -200,7 +199,6 @@ test_evict(int fd, struct drm_xe_engine_class_instance *eci,xe_vm_destroy (fd, vm2);xe_vm_destroy (fd, vm3); } -xe_device_put (fd);drm_close_driver (fd); }
@@ -239,7 +237,6 @@ test_evict_cm(int fd, struct drm_xe_engine_class_instance *eci,igt_assert (bo); fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); vm =xe_vm_create (fd,DRM_XE_VM_CREATE_ASYNC_BIND_OPS |DRM_XE_VM_CREATE_COMPUTE_MODE ,0 );
@@ -368,7 +365,6 @@ test_evict_cm(int fd, struct drm_xe_engine_class_instance *eci,xe_vm_destroy (fd, vm);if (flags &MULTI_VM )xe_vm_destroy (fd, vm2); -xe_device_put (fd);drm_close_driver (fd); }
@@ -667,7 +663,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);igt_require (xe_has_vram (fd)); vram_size =xe_vram_size (fd,0 );igt_assert (vram_size);
tests/xe/xe_exec_balancer.c +2 -6
@@ -619,10 +619,8 @@ igt_mainint class;int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }igt_subtest ("virtual-all-active" ) xe_for_each_gt(fd, gt)
@@ -699,8 +697,6 @@ igt_maintest_cm (fd, gt, class,1 ,0 , s->flags); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_exec_basic.c +2 -6
@@ -308,10 +308,8 @@ igt_main };int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }for (const struct section *s = sections; s->name; s++) {igt_subtest_f ("once-%s" , s->name)
@@ -348,8 +346,6 @@ igt_maintest_exec (fd, hwe,1 ,0 ,1 , s->flags); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_exec_compute_mode.c +2 -6
@@ -332,10 +332,8 @@ igt_main };int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }for (const struct section *s = sections; s->name; s++) {igt_subtest_f ("once-%s" , s->name)
@@ -364,8 +362,6 @@ igt_main s->flags); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_exec_fault_mode.c +1 -4
@@ -516,7 +516,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);igt_require (xe_supports_faults (fd)); }
@@ -560,8 +559,6 @@ igt_mainxe_for_each_hw_engine (fd, hwe)test_atomic (fd, hwe,8 ,WAIT_ATOMIC ); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_exec_reset.c +5 -18
@@ -170,10 +170,8 @@ test_balancer(int fd, int gt, int class, int n_engines, int n_execs,igt_assert (n_engines <=MAX_N_ENGINES ); -if (flags &CLOSE_FD ) { +if (flags &CLOSE_FD ) fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }xe_for_each_hw_engine (fd, hwe) {if (hwe->engine_class != class || hwe->gt_id != gt)
@@ -285,7 +283,6 @@ test_balancer(int fd, int gt, int class, int n_engines, int n_execs,for (i =0 ; i < n_engines; i++)xe_engine_destroy (fd, engines[i]); } -xe_device_put (fd);drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );
@@ -374,10 +371,8 @@ test_legacy_mode(int fd, struct drm_xe_engine_class_instance *eci,igt_assert (n_engines <=MAX_N_ENGINES ); -if (flags &CLOSE_FD ) { +if (flags &CLOSE_FD ) fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } vm =xe_vm_create (fd,DRM_XE_VM_CREATE_ASYNC_BIND_OPS ,0 ); bo_size =sizeof (*data) * n_execs;
@@ -460,7 +455,6 @@ test_legacy_mode(int fd, struct drm_xe_engine_class_instance *eci,for (i =0 ; i < n_engines; i++)xe_engine_destroy (fd, engines[i]); } -xe_device_put (fd);drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );
@@ -547,10 +541,8 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,igt_assert (n_engines <=MAX_N_ENGINES ); -if (flags &CLOSE_FD ) { +if (flags &CLOSE_FD ) fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } vm =xe_vm_create (fd,DRM_XE_VM_CREATE_ASYNC_BIND_OPS |DRM_XE_VM_CREATE_COMPUTE_MODE ,0 );
@@ -635,7 +627,6 @@ test_compute_mode(int fd, struct drm_xe_engine_class_instance *eci,for (i =0 ; i < n_engines; i++)xe_engine_destroy (fd, engines[i]); } -xe_device_put (fd);drm_close_driver (fd);/* FIXME: wait for idle */ usleep (150000 );
@@ -812,10 +803,8 @@ igt_mainint class;int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }igt_subtest ("spin" ) xe_for_each_hw_engine(fd, hwe)
@@ -925,8 +914,6 @@ igt_main igt_subtest("gt-reset-stress")gt_reset (fd,4 ,1 ); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_exec_threads.c +4 -16
@@ -73,7 +73,6 @@ test_balancer(int fd, int gt, uint32_t vm, uint64_t addr, uint64_t userptr,if (!fd) { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); owns_fd = true; }
@@ -243,10 +242,8 @@ test_balancer(int fd, int gt, uint32_t vm, uint64_t addr, uint64_t userptr, }if (owns_vm)xe_vm_destroy (fd, vm); -if (owns_fd) { -xe_device_put (fd); +if (owns_fd)drm_close_driver (fd); - } } static void
@@ -283,7 +280,6 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,if (!fd) { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); owns_fd = true; }
@@ -458,7 +454,6 @@ test_compute_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,if (owns_vm)xe_vm_destroy (fd, vm);if (owns_fd) { -xe_device_put (fd);drm_close_driver (fd); } }
@@ -496,7 +491,6 @@ test_legacy_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr,if (!fd) { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); owns_fd = true; }
@@ -701,10 +695,8 @@ test_legacy_mode(int fd, uint32_t vm, uint64_t addr, uint64_t userptr, }if (owns_vm)xe_vm_destroy (fd, vm); -if (owns_fd) { -xe_device_put (fd); +if (owns_fd)drm_close_driver (fd); - } }struct thread_data {
@@ -1395,18 +1387,14 @@ igt_main };int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - }for (const struct section *s = sections; s->name; s++) { igt_subtest_f("threads-%s", s->name)threads (fd, s->flags); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_gpgpu_fill.c +0 -3
@@ -120,8 +120,6 @@ igt_main fill_fn =igt_get_gpgpu_fillfunc (data.devid);igt_require_f (fill_fn,"no gpgpu-fill function\n" ); - -xe_device_get (data.drm_fd); } igt_subtest("basic") {
@@ -129,7 +127,6 @@ igt_main } igt_fixture { -xe_device_put (data.drm_fd);buf_ops_destroy (data.bops);drm_close_driver (data.drm_fd); }
tests/xe/xe_guc_pc.c +0 -2
@@ -381,7 +381,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); sysfs =igt_sysfs_open (fd);igt_assert (sysfs !=-1 );
@@ -489,7 +488,6 @@ igt_mainset_freq (sysfs, gt,"max" , stash_max); }close (sysfs); -xe_device_put (fd);drm_close_driver (fd); } }
tests/xe/xe_huc_copy.c +2 -6
@@ -176,10 +176,8 @@ igt_main {int xe; - igt_fixture { +igt_fixture xe =drm_open_driver (DRIVER_XE ); -xe_device_get (xe); - } igt_subtest("huc_copy") {/*
@@ -190,8 +188,6 @@ igt_maintest_huc_copy (xe); } - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }
tests/xe/xe_intel_bb.c +0 -2
@@ -1069,7 +1069,6 @@ igt_main_args("dpib", NULL, help_str, opt_handler, NULL) igt_fixture { xe =drm_open_driver (DRIVER_XE ); bops =buf_ops_create (xe); -xe_device_get (xe); }igt_describe ("Ensure reset is possible on fresh bb" );
@@ -1141,7 +1140,6 @@ igt_main_args("dpib", NULL, help_str, opt_handler, NULL) } igt_fixture { -xe_device_put (xe);buf_ops_destroy (bops);drm_close_driver (xe); }
tests/xe/xe_mmap.c +2 -6
@@ -115,10 +115,8 @@ igt_main {int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("system")test_mmap (fd,system_memory (fd));
@@ -138,8 +136,6 @@ igt_main igt_subtest("bad-object")test_bad_object (fd); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_mmio.c +2 -6
@@ -78,18 +78,14 @@ igt_main {int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("mmio-timestamp")test_xe_mmio_timestamp (fd); igt_subtest("mmio-invalid")test_xe_mmio_invalid (fd); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_noexec_ping_pong.c +0 -2
@@ -99,10 +99,8 @@ igt_simple_main { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);test_ping_pong (fd,xe_hw_engine (fd,0 )); -xe_device_put (fd);drm_close_driver (fd); }
tests/xe/xe_pm.c +0 -3
@@ -374,8 +374,6 @@ igt_main device.pci_xe =igt_device_get_pci_device (device.fd_xe); device.pci_root =igt_device_get_pci_root_port (device.fd_xe); -xe_device_get (device.fd_xe); -/* Always perform initial once-basic exec checking for health */ xe_for_each_hw_engine (device.fd_xe, hwe)test_exec (device, hwe,1 ,1 ,NO_SUSPEND ,NO_RPM );
@@ -444,7 +442,6 @@ igt_main igt_fixture {set_d3cold_allowed (device.pci_xe, d3cold_allowed);igt_restore_runtime_pm (); -xe_device_put (device.fd_xe);drm_close_driver (device.fd_xe); } }
tests/xe/xe_prime_self_import.c +1 -30
@@ -105,9 +105,7 @@ static void test_with_fd_dup(void) counter =0 ; fd1 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd1); fd2 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd2); handle =xe_bo_create (fd1,0 ,0 ,BO_SIZE );
@@ -122,9 +120,7 @@ static void test_with_fd_dup(void)close (dma_buf_fd2);check_bo (fd2, handle_import, fd2, handle_import); -xe_device_put (fd1);drm_close_driver (fd1); -xe_device_put (fd2);drm_close_driver (fd2); }
@@ -143,9 +139,7 @@ static void test_with_two_bos(void) counter =0 ; fd1 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd1); fd2 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd2); handle1 =xe_bo_create (fd1,0 ,0 ,BO_SIZE ); handle2 =xe_bo_create (fd1,0 ,0 ,BO_SIZE );
@@ -165,9 +159,7 @@ static void test_with_two_bos(void)check_bo (fd2, handle_import, fd2, handle_import); -xe_device_put (fd1);drm_close_driver (fd1); -xe_device_put (fd2);drm_close_driver (fd2); }
@@ -184,9 +176,7 @@ static void test_with_one_bo_two_files(void)int dma_buf_fd1, dma_buf_fd2; fd1 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd1); fd2 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd2); handle_orig =xe_bo_create (fd1,0 ,0 ,BO_SIZE ); dma_buf_fd1 =prime_handle_to_fd (fd1, handle_orig);
@@ -200,9 +190,7 @@ static void test_with_one_bo_two_files(void)/* dma-buf self importing an flink bo should give the same handle */ igt_assert_eq_u32 (handle_import, handle_open); -xe_device_put (fd1);drm_close_driver (fd1); -xe_device_put (fd2);drm_close_driver (fd2);close (dma_buf_fd1);close (dma_buf_fd2);
@@ -221,9 +209,7 @@ static void test_with_one_bo(void)int dma_buf_fd; fd1 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd1); fd2 =drm_open_driver (DRIVER_XE ); -xe_device_get (fd2); handle =xe_bo_create (fd1,0 ,0 ,BO_SIZE );
@@ -257,10 +243,8 @@ static void test_with_one_bo(void)check_bo (fd1, handle, fd2, handle_import1);/* Completely rip out exporting fd. */ -xe_device_put (fd1);drm_close_driver (fd1);check_bo (fd2, handle_import1, fd2, handle_import1); -xe_device_put (fd2);drm_close_driver (fd2); }
@@ -313,7 +297,6 @@ static void *thread_fn_reimport_vs_close(void *p) threads =calloc (num_threads,sizeof (pthread_t)); fds[0 ] =drm_open_driver (DRIVER_XE ); -xe_device_get (fds[0 ]); handle =xe_bo_create (fds[0 ],0 ,0 ,BO_SIZE );
@@ -333,7 +316,6 @@ static void *thread_fn_reimport_vs_close(void *p) }pthread_barrier_destroy (&g_barrier); -xe_device_put (fds[0 ]);drm_close_driver (fds[0 ]);close (fds[1 ]);
@@ -405,13 +387,11 @@ static void test_export_close_race(void)/* Allocate exit handler fds in here so that we dont screw * up the counts */ fake =drm_open_driver (DRIVER_XE ); -xe_device_get (fake);/* TODO: Read object count */ obj_count =0 ; fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);pthread_barrier_init (&g_barrier,NULL , num_threads);for (i =0 ; i < num_threads; i++) {
@@ -427,7 +407,6 @@ static void test_export_close_race(void) }pthread_barrier_destroy (&g_barrier); -xe_device_put (fd);drm_close_driver (fd);/* TODO: Read object count */
@@ -435,7 +414,6 @@ static void test_export_close_race(void)igt_info ("leaked %i objects\n" , obj_count); -xe_device_put (fake);drm_close_driver (fake);igt_assert_eq (obj_count,0 );
@@ -456,7 +434,6 @@ static void test_llseek_size(void) counter =0 ; fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);for (i =0 ; i <10 ; i++) {int bufsz =xe_get_default_alignment (fd) << i;
@@ -471,7 +448,6 @@ static void test_llseek_size(void)close (dma_buf_fd); } -xe_device_put (fd);drm_close_driver (fd); }
@@ -490,7 +466,6 @@ static void test_llseek_bad(void) counter =0 ; fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); handle =xe_bo_create (fd,0 ,0 ,BO_SIZE ); dma_buf_fd =prime_handle_to_fd (fd, handle);
@@ -507,7 +482,6 @@ static void test_llseek_bad(void)close (dma_buf_fd); -xe_device_put (fd);drm_close_driver (fd); }
@@ -531,7 +505,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); }for (i =0 ; i <ARRAY_SIZE (tests); i++) {
@@ -539,8 +512,6 @@ igt_main tests[i].fn (); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_query.c +2 -6
@@ -458,10 +458,8 @@ igt_main {int xe; - igt_fixture { +igt_fixture xe =drm_open_driver (DRIVER_XE ); -xe_device_get (xe); - } igt_subtest("query-engines")test_query_engines (xe);
@@ -490,8 +488,6 @@ igt_main igt_subtest("query-invalid-extension")test_query_invalid_extension (xe); - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }
tests/xe/xe_spin_batch.c +2 -6
@@ -144,10 +144,8 @@ igt_mainint fd;int gt, class; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("spin-basic")spin_basic (fd);
@@ -165,8 +163,6 @@ igt_mainspin_all (fd, gt, class); } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_vm.c +1 -4
@@ -1638,7 +1638,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);xe_for_each_hw_engine (fd, hwe)if (hwe->engine_class !=DRM_XE_ENGINE_CLASS_COPY ) {
@@ -1854,8 +1853,6 @@ igt_main } } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_waitfence.c +2 -6
@@ -119,10 +119,8 @@ igt_main {int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("reltime")waitfence (fd,RELTIME );
@@ -130,8 +128,6 @@ igt_main igt_subtest("abstime")waitfence (fd,ABSTIME ); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
Signature · 1 line
2.40.0
PATCH v4 24/24 Revert "lib/igt_kms: Cache xe_device info for kms tests"
In reply to Bhanuprakash ModemAs this logic is moved to driver open/close level, this is redundant, hence revert this logic.
This reverts commit 3e049d7c5048c8e4d0b0cfc22afca18e9e897e9a.
--- lib/igt_kms.c | 8 -------- 1 file changed, 8 deletions(-)
lib/igt_kms.c +0 -8
@@ -59,7 +59,6 @@#include "igt_device.h" #include "igt_sysfs.h" #include "sw_sync.h" -#include "xe/xe_query.h" #ifdef HAVE_CHAMELIUM #include "igt_chamelium.h" #endif
@@ -2657,9 +2656,6 @@ void igt_display_require(igt_display_t *display, int drm_fd) }#endif -if (is_xe_device (drm_fd)) -xe_device_get (drm_fd); - display->n_pipes =IGT_MAX_PIPES ; display->pipes =calloc (sizeof (igt_pipe_t), display->n_pipes);igt_assert_f (display->pipes,"Failed to allocate memory for %d pipes\n" , display->n_pipes);
@@ -2996,10 +2992,6 @@ static void igt_output_fini(igt_output_t *output)void igt_display_fini (igt_display_t *display) {int i; -int drm_fd = display->drm_fd; - -if (is_xe_device (drm_fd)) -xe_device_put (drm_fd);for (i =0 ; i < display->n_planes; ++i) {igt_plane_t *plane = &display->planes[i];
Signature · 1 line
2.40.0