XE test cleanup to handle xe_device
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().
Bhanuprakash Modem (6):
lib: Interface to close the drm fd
lib: Cache xe_device at driver open/close level lib/xe/xe_query: Add xe_config() interface Revert "lib/igt_kms: Cache xe_device info for kms tests"
tests: Use drm_close_driver() to close the drm fd
tests: Drop xe_device get/put from test level
lib/drmtest.c | 26 +++++++++ lib/drmtest.h | 1 + lib/igt_kms.c | 8 --- lib/igt_msm.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 | 4 +- 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/drm_read.c | 3 + tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/i915/api_intel_allocator.c | 2 +- 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 | 3 + tests/i915/gem_basic.c | 5 +- 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_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 | 2 +- tests/i915/gem_ctx_engines.c | 4 +- tests/i915/gem_ctx_exec.c | 3 + tests/i915/gem_ctx_freq.c | 3 + tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 2 +- tests/i915/gem_ctx_shared.c | 3 + tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 3 + tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 3 + tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_balancer.c | 3 + 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_endless.c | 3 + tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 2 +- 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 | 2 +- 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 | 2 +- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 3 +- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 7 ++- 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 | 4 +- 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 | 2 +- tests/i915/gem_mmap_offset.c | 2 +- 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 | 2 +- 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 | 2 +- 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 | 7 ++- tests/i915/gem_vm_create.c | 2 +- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 3 + 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_rpm.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 | 4 +- 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 | 4 +- 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_dp_tiled_display.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_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 | 10 +--- 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 | 6 +- 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_vm.c | 7 +-- tests/xe/xe_waitfence.c | 10 +--- 294 files changed, 512 insertions(+), 603 deletions(-)
--
2.40.0
PATCH 1/6 lib: Interface to close the drm fd
Add new helper drm_close_driver() to close the drm fd. So that every user could call drm_close_driver() instead of close().
--- lib/drmtest.c | 17 +++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 18 insertions(+)
lib/drmtest.c +17 -0
@@ -604,6 +604,23 @@ int drm_open_driver(int chipset)return fd; } +/** +* drm_close_driver: +* @fd: a drm file descriptor +* +* Close the drm file descriptor @fd. +* +* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +/* Avoid closing standard file descriptors (0, 1, and 2). */ +if (fd <3 ) +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);void igt_require_amdgpu (int fd);void igt_require_intel (int fd);
Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 1/6] lib: Interface to close the drm fd
Quoted 4 lines · Bhanuprakash Modem
Add new helper
drm_close_driver()to close the drm fd. So that every user could calldrm_close_driver()instead ofclose().Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 45 lines
--- lib/drmtest.c | 17 +++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 18 insertions(+)lib/drmtest.c +17
-0@@ -604,6 +604,23 @@ int drm_open_driver(int chipset)return fd; } +/** +* drm_close_driver: +* @fd: a drm file descriptor +* +* Close the drm file descriptor @fd. +* +* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +/* Avoid closing standard file descriptors (0, 1, and 2). */ +if (fd <3 ) +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);void igt_require_amdgpu (int fd);void igt_require_intel (int fd);
Re: [igt-dev] [i-g-t 1/6] lib: Interface to close the drm fd
In reply to Bhanuprakash ModemHi Bhanuprakash,
Quoted 1 line · Bhanuprakash Modem
Add new helper
drm_close_driver()to close the drm fd. So that
-------------------------------------------------------- ^^^^^^^ s/So that/Now/
Quoted 18 lines
every user could call
drm_close_driver()instead ofclose().Signed-off-by Bhanuprakash Modem <[email protected]>--- lib/drmtest.c | 17 +++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 18 insertions(+)lib/drmtest.c +2
-0@@ -604,6 +604,23 @@ int drm_open_driver(int chipset)return fd; } +/** +* drm_close_driver:
lib/drmtest.c int drm_open_driver(int chipset) · line 618
Quoted 10 lines
lib/drmtest.c +10
-0+* @fd: a drm file descriptor +* +* Close the drm file descriptor @fd. +* +* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +/* Avoid closing standard file descriptors (0, 1, and 2). */ +if (fd <3 )
-1 is ok here, if you are concerned about 0...2 imho print debug message here for these.
Quoted 13 lines
lib/drmtest.c +5
-0+return -1 ; + +return close (fd); +} +/** * drm_open_driver_master: * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL lib/drmtest.h +0
-0
lib/drmtest.h int drm_open_driver_render(int chipset); · line 108
Quoted 4 lines
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);
imho this may be __drm_close_driver(int fd) and drm_close_driver could be macro with setting fd to -1 after succesfull close ?
Regards,
Kamil
Quoted 6 lines
lib/drmtest.h +0
-0void igt_require_amdgpu (int fd);void igt_require_intel (int fd);Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 1/6] lib: Interface to close the drm fd
Hi Kamil,
Quoted 23 lines · Kamil Konieczny
Hi Bhanuprakash,
Quoted 1 line · Bhanuprakash Modem
Add new helper
drm_close_driver()to close the drm fd. So that-------------------------------------------------------- ^^^^^^^ s/So that/Now/
Quoted 16 lines
every user could call
drm_close_driver()instead ofclose().Signed-off-by Bhanuprakash Modem <[email protected]>--- lib/drmtest.c | 17 +++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 18 insertions(+)lib/drmtest.c +0
-0@@ -604,6 +604,23 @@ int drm_open_driver(int chipset)return fd; }
Quoted 15 lines
lib/drmtest.c int drm_open_driver(int chipset) · line 618
Quoted 12 lines
lib/drmtest.c +12
-0+/** +* drm_close_driver: +* @fd: a drm file descriptor +* +* Close the drm file descriptor @fd. +* +* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +/* Avoid closing standard file descriptors (0, 1, and 2). */ +if (fd <3 )-1 is ok here, if you are concerned about 0...2 imho print debug message here for these.
Sure, will fix this in next rev.
Quoted 13 lines
Quoted 13 lines
lib/drmtest.c +5
-0+return -1 ; + +return close (fd); +} +/** * drm_open_driver_master: * @chipset: OR'd flags for each chipset to search, eg. #DRIVER_INTEL lib/drmtest.h +0
-0
Quoted 8 lines
lib/drmtest.h int drm_open_driver_render(int chipset); · line 108
Quoted 5 lines
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);imho this may be
__drm_close_driver(int fd)anddrm_close_drivercould be macro with setting fd to -1 after succesfull close ?
Not understood, why do we need to set fd = -1 ?
- Bhanu
Quoted 10 lines
Regards,
KamilQuoted 6 lines
lib/drmtest.h +0
-0void igt_require_amdgpu (int fd);void igt_require_intel (int fd);Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 1/6] lib: Interface to close the drm fd
In reply to Bhanuprakash ModemQuoted 23 lines · Bhanuprakash Modem
Add new helper
drm_close_driver()to close the drm fd. So that every user could calldrm_close_driver()instead ofclose().Signed-off-by Bhanuprakash Modem <[email protected]>--- lib/drmtest.c | 17 +++++++++++++++++ lib/drmtest.h | 1 + 2 files changed, 18 insertions(+)lib/drmtest.c +6
-0@@ -604,6 +604,23 @@ int drm_open_driver(int chipset)return fd; } +/** +* drm_close_driver: +* @fd: a drm file descriptor +* +* Close the drm file descriptor @fd. +*
lib/drmtest.c int drm_open_driver(int chipset) · line 622
Quoted 10 lines
lib/drmtest.c +10
-0+* Returns: 0 on success or -1 on error. +*/ +int drm_close_driver (int fd) +{ +/* Avoid closing standard file descriptors (0, 1, and 2). */ +if (fd <3 ) +return -1 ; + +return close (fd); +}
Drm fd also can be 0-2 if one of it was previously closed so I'm not sure you should check this way. Maybe readlink() or sth else?
--
Zbigniew
Quoted 19 lines
lib/drmtest.c +1
-0+/** * 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);void igt_require_amdgpu (int fd);void igt_require_intel (int fd);Signature · 1 line
2.40.0
PATCH 2/6 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.
--- lib/drmtest.c | 9 +++++++++ 1 file changed, 9 insertions(+)
lib/drmtest.c +9 -0
@@ -63,6 +63,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest
@@ -601,6 +602,10 @@ int drm_open_driver(int chipset) } } +/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); +return fd; }
@@ -618,6 +623,10 @@ int drm_close_driver(int fd)if (fd <3 )return -1 ; +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }
Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 2/6] lib: Cache xe_device at driver open/close level
Quoted 5 lines · Bhanuprakash Modem
Instead of caching the
xe_devicestruct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver.Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 38 lines
--- lib/drmtest.c | 9 +++++++++ 1 file changed, 9 insertions(+)lib/drmtest.c +9
-0@@ -63,6 +63,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest @@ -601,6 +602,10 @@ int drm_open_driver(int chipset) } } +/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); +return fd; }@@ -618,6 +623,10 @@ int drm_close_driver(int fd)if (fd <3 )return -1 ; +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }
Re: [igt-dev] [i-g-t 2/6] lib: Cache xe_device at driver open/close level
In reply to Bhanuprakash ModemQuoted 5 lines · Bhanuprakash Modem
Instead of caching the
xe_devicestruct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver.Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 41 lines
--- lib/drmtest.c | 9 +++++++++ 1 file changed, 9 insertions(+)lib/drmtest.c +9
-0@@ -63,6 +63,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest @@ -601,6 +602,10 @@ int drm_open_driver(int chipset) } } +/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); +return fd; }@@ -618,6 +623,10 @@ int drm_close_driver(int fd)if (fd <3 )return -1 ; +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 2/6] lib: Cache xe_device at driver open/close level
In reply to Bhanuprakash ModemQuoted 22 lines · Bhanuprakash Modem
Instead of caching the
xe_devicestruct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver.Signed-off-by Bhanuprakash Modem <[email protected]>--- lib/drmtest.c | 9 +++++++++ 1 file changed, 9 insertions(+)lib/drmtest.c +1
-0@@ -63,6 +63,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest
lib/drmtest.c int drm_open_driver(int chipset) · line 611
Quoted 10 lines
lib/drmtest.c +4
-0@@ -601,6 +602,10 @@ int drm_open_driver(int chipset) } } +/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); +return fd; }
Imo this should land to __drm_open_driver_another() and __drm_open_driver_render().
gem_reopen_driver() still requires explicit device get for xe.
--
Zbigniew
Quoted 14 lines
lib/drmtest.c +4
-0@@ -618,6 +623,10 @@ int drm_close_driver(int fd)if (fd <3 )return -1 ; +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 2/6] lib: Cache xe_device at driver open/close level
Hi Zbigniew,
Quoted 26 lines · Zbigniew Kempczyński
Quoted 25 lines · Bhanuprakash Modem
Instead of caching the
xe_devicestruct at subtest level, cache just after opening the driver. And remove from the cache just before closing the driver.Signed-off-by Bhanuprakash Modem <[email protected]>--- lib/drmtest.c | 9 +++++++++ 1 file changed, 9 insertions(+)lib/drmtest.c +1
-0@@ -63,6 +63,7 @@#include "intel_reg.h" #include "ioctl_wrappers.h" #include "igt_dummyload.h" +#include "xe/xe_query.h" /** * SECTION:drmtest @@ -601,6 +602,10 @@ int drm_open_driver(int chipset) } }
Quoted 10 lines
lib/drmtest.c int drm_open_driver(int chipset) · line 611
Quoted 7 lines
lib/drmtest.c +4
-0+/* Cache xe_device struct. */ +if (is_xe_device (fd)) +xe_device_get (fd); +return fd; }Imo this should land to
__drm_open_driver_another()and__drm_open_driver_render().
Agreed, will float a new rev with these changes.
Quoted 2 lines
gem_reopen_driver()still requires explicit device get for xe.
This fix is already landed in IGT:
https://cgit.freedesktop.org/drm/igt-gpu-tools/commit/?id=a48277948
- Bhanu
Quoted 19 lines
--
ZbigniewQuoted 14 lines
lib/drmtest.c +4
-0@@ -618,6 +623,10 @@ int drm_close_driver(int fd)if (fd <3 )return -1 ; +/* Remove xe_device from cache. */ +if (is_xe_device (fd)) +xe_device_put (fd); +return close (fd); }Signature · 1 line
2.40.0
PATCH 3/6 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
Re: [igt-dev] [i-g-t 3/6] lib/xe/xe_query: Add xe_config() interface
Quoted 3 lines · Bhanuprakash Modem
Add support to get XE configuration from
xe_device.Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 36 lines
--- 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);
Re: [igt-dev] [i-g-t 3/6] lib/xe/xe_query: Add xe_config() interface
In reply to Bhanuprakash ModemHi,
Quoted 3 lines · Bhanuprakash Modem
Add support to get XE configuration from
xe_device.Signed-off-by Bhanuprakash Modem <[email protected]>
Regards,
Kamil
Quoted 39 lines
--- 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 4/6 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
@@ -2639,9 +2638,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);
@@ -2978,10 +2974,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
Re: [igt-dev] [i-g-t 4/6] Revert "lib/igt_kms: Cache xe_device info for kms tests"
Quoted 6 lines · Bhanuprakash Modem
As this logic is moved to driver open/close level, this is redundant, hence revert this logic.
This reverts commit
3e049d7c5048c8e4d0b0cfc22afca18e9e897e9a.Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 37 lines
--- 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 @@ -2639,9 +2638,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);@@ -2978,10 +2974,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];
Re: [igt-dev] [i-g-t 4/6] Revert "lib/igt_kms: Cache xe_device info for kms tests"
In reply to Bhanuprakash ModemHi,
Quoted 2 lines · Bhanuprakash Modem
As this logic is moved to driver open/close level, this is redundant, hence revert this logic.
------------------------- ^^^^^^^^^^
s/this logic/it/
Quoted 4 lines
This reverts commit
3e049d7c5048c8e4d0b0cfc22afca18e9e897e9a.Signed-off-by Bhanuprakash Modem <[email protected]>
Please make it last patch in this series.
Regards,
Kamil
Quoted 40 lines
--- 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 @@ -2639,9 +2638,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);@@ -2978,10 +2974,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
PATCH 5/6 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().
--- lib/igt_msm.c | 2 +- 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 | 4 +-- 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/drm_read.c | 3 +++ tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/i915/api_intel_allocator.c | 2 +- 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 | 3 +++ tests/i915/gem_basic.c | 5 +++- 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_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 | 2 +- tests/i915/gem_ctx_engines.c | 4 ++- tests/i915/gem_ctx_exec.c | 3 +++ tests/i915/gem_ctx_freq.c | 3 +++ tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 2 +- tests/i915/gem_ctx_shared.c | 3 +++ tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 3 +++ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 3 +++ tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_balancer.c | 3 +++ 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_endless.c | 3 +++ tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 2 +- 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 | 2 +- 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 | 2 +- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 3 ++- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 7 +++-- 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 | 4 +-- 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 | 2 +- tests/i915/gem_mmap_offset.c | 2 +- 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 | 2 +- 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 | 2 +- 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 | 7 +++-- tests/i915/gem_vm_create.c | 2 +- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 3 +++ 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_rpm.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 | 4 +-- 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 | 4 +-- 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 | 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_dp_tiled_display.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_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 | 2 +- tests/xe/xe_create.c | 2 +- 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_vm.c | 2 +- tests/xe/xe_waitfence.c | 2 +- 288 files changed, 436 insertions(+), 375 deletions(-)
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); }
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_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_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_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_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_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); } }
tests/amdgpu/amd_psr.c +2 -2
@@ -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 ]);
@@ -761,7 +761,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_f (igt_amd_set_visual_confirm (data.fd,VISUAL_CONFIRM_DISABLE ),"reset PSR visual confirm option failed\n" ); } -close (data.debugfs_fd);igt_display_fini (&data.display); +drm_close_driver (data.debugfs_fd); } }
tests/amdgpu/amd_vrr_range.c +1 -0
@@ -338,5 +338,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
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
@@ -558,6 +558,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
@@ -1080,6 +1080,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
@@ -525,6 +525,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/core_auth.c +5 -5
@@ -189,7 +189,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
@@ -201,7 +201,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." );
@@ -211,11 +211,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 */
@@ -224,7 +224,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
@@ -58,5 +58,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
@@ -52,5 +52,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
@@ -46,5 +46,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }
tests/core_setmaster.c +3 -3
@@ -85,7 +85,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)
@@ -206,10 +206,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
@@ -66,7 +66,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
@@ -213,6 +213,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }
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/drm_read.c +3 -0
@@ -311,4 +311,7 @@ igt_main igt_subtest("short-buffer-wakeup")test_short_buffer_wakeup (fd, pipe); + +igt_fixture +drm_close_driver (fd ); }
tests/dumb_buffer.c +1 -1
@@ -394,6 +394,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/i915/api_intel_allocator.c +1 -1
@@ -847,5 +847,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/api_intel_bb.c +1 -1
@@ -1701,6 +1701,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
@@ -855,6 +855,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_bad_reloc.c +1 -1
@@ -212,5 +212,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_barrier_race.c +3 -0
@@ -153,4 +153,7 @@ igt_mainbreak ; } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_basic.c +4 -1
@@ -108,7 +108,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 ();
@@ -117,4 +117,7 @@ igt_mainigt_describe ("Verify that closing drm driver is possible with opened gem object." ); igt_subtest("create-fd-close")test_create_fd_close (fd); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_blits.c +1 -1
@@ -893,6 +893,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }
tests/i915/gem_busy.c +1 -1
@@ -562,6 +562,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_caching.c +1 -1
@@ -340,6 +340,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
@@ -731,6 +731,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
@@ -274,7 +274,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 ();
@@ -293,7 +293,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -317,7 +317,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." );
@@ -329,7 +329,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );
@@ -342,7 +342,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -369,7 +369,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_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_cs_tlb.c +1 -1
@@ -162,5 +162,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_bad_destroy.c +1 -1
@@ -80,5 +80,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_create.c +1 -1
@@ -667,6 +667,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_engines.c +3 -1
@@ -633,6 +633,8 @@ igt_mainindependent_all (i915, ctx); } -igt_fixture + igt_fixture {igt_stop_hang_detector (); +drm_close_driver (i915); + } }
tests/i915/gem_ctx_exec.c +3 -0
@@ -546,4 +546,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
@@ -213,4 +213,7 @@ igt_main igt_subtest_f("sysfs")sysfs_range (i915); + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_ctx_param.c +1 -1
@@ -473,5 +473,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 +1 -1
@@ -1383,6 +1383,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_ctx_shared.c +3 -0
@@ -1088,4 +1088,7 @@ igt_mainigt_stop_hang_detector (); } } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_ctx_sseu.c +1 -1
@@ -545,6 +545,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_switch.c +1 -1
@@ -440,6 +440,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 +3 -0
@@ -1126,4 +1126,7 @@ igt_mainintel_allocator_multiprocess_stop (); } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_evict_alignment.c +1 -1
@@ -265,6 +265,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_evict_everything.c +1 -1
@@ -290,6 +290,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_alignment.c +3 -0
@@ -546,4 +546,7 @@ igt_mainprio_inversion (fd,SHARED ); igt_subtest("pi-isolated")prio_inversion (fd,ISOLATED ); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_exec_async.c +1 -1
@@ -213,6 +213,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
@@ -287,6 +287,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_balancer.c +3 -0
@@ -3482,4 +3482,7 @@ igt_main igt_subtest("nohangcheck")nohangcheck (i915); } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_exec_basic.c +1 -1
@@ -98,6 +98,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
@@ -326,5 +326,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }
tests/i915/gem_exec_capture.c +1 -1
@@ -1013,6 +1013,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
@@ -225,6 +225,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_endless.c +3 -0
@@ -367,4 +367,7 @@ igt_mainintel_register_access_fini (&mmio); } } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_exec_fair.c +1 -1
@@ -1348,6 +1348,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_fence.c +1 -1
@@ -3351,6 +3351,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_flush.c +1 -1
@@ -711,6 +711,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_gttfill.c +2 -2
@@ -279,7 +279,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 ();
@@ -287,6 +287,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_latency.c +1 -1
@@ -971,6 +971,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
@@ -1083,6 +1083,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 +1 -1
@@ -364,6 +364,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
@@ -646,6 +646,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_reloc.c +1 -1
@@ -1178,5 +1178,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_exec_schedule.c +1 -1
@@ -3369,6 +3369,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
@@ -455,6 +455,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
@@ -411,6 +411,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 +1 -1
@@ -660,6 +660,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
@@ -381,6 +381,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
@@ -69,5 +69,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_fence_thrash.c +2 -1
@@ -225,7 +225,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 ; }
@@ -252,4 +252,5 @@ igt_main igt_subtest("bo-copy")igt_assert (run_test (1 , bo_copy,I915_TILING_X ,1 ) ==0 ); + }
tests/i915/gem_fenced_exec_thrash.c +1 -1
@@ -199,5 +199,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 +5 -2
@@ -147,7 +147,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 */
@@ -156,7 +156,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
@@ -188,4 +188,7 @@ igt_mainigt_describe ("Tests flink lifetime by referencing from multiple descriptors." ); igt_subtest("flink-lifetime")test_flink_lifetime (fd); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_flink_race.c +3 -3
@@ -127,7 +127,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)
@@ -188,13 +188,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
@@ -105,5 +105,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
@@ -164,7 +164,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
@@ -515,5 +515,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
@@ -139,6 +139,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/gem_lmem_evict.c +2 -2
@@ -93,7 +93,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 ();
@@ -132,7 +132,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }
tests/i915/gem_lmem_swapping.c +2 -2
@@ -736,7 +736,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 ();
@@ -781,7 +781,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
@@ -77,7 +77,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -99,7 +99,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -123,7 +123,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -145,7 +145,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -161,7 +161,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
@@ -185,7 +185,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
@@ -173,6 +173,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
@@ -315,5 +315,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_gtt.c +1 -1
@@ -1492,5 +1492,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_offset.c +1 -1
@@ -926,6 +926,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_mmap_wc.c +1 -1
@@ -620,5 +620,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_partial_pwrite_pread.c +1 -1
@@ -326,6 +326,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
@@ -183,6 +183,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ppgtt.c +4 -4
@@ -251,8 +251,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
@@ -385,7 +385,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; }
@@ -398,7 +398,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
@@ -350,6 +350,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
@@ -252,5 +252,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite.c +1 -1
@@ -572,5 +572,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
@@ -140,5 +140,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_pxp.c +1 -1
@@ -1293,6 +1293,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_read_read_speed.c +1 -1
@@ -214,6 +214,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_readwrite.c +1 -1
@@ -143,5 +143,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_reg_read.c +1 -1
@@ -170,6 +170,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_render_copy.c +1 -1
@@ -879,6 +879,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
@@ -81,7 +81,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 +1 -1
@@ -999,6 +999,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
@@ -401,6 +401,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
@@ -261,6 +261,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
@@ -130,5 +130,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_set_tiling_vs_pwrite.c +1 -1
@@ -99,5 +99,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_shrink.c +7 -7
@@ -270,7 +270,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 ; }
@@ -319,7 +319,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); } } }
@@ -331,7 +331,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 ;
@@ -344,7 +344,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 ;
@@ -356,7 +356,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 ();
@@ -399,7 +399,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main
@@ -456,7 +456,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )
tests/i915/gem_softpin.c +1 -1
@@ -1531,6 +1531,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_spin_batch.c +1 -1
@@ -277,6 +277,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
@@ -419,5 +419,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_stress.c +1 -1
@@ -926,7 +926,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
@@ -1363,6 +1363,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
@@ -215,6 +215,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_fence_blits.c +1 -1
@@ -320,5 +320,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_partial_pwrite_pread.c +1 -1
@@ -318,6 +318,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
@@ -222,5 +222,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_pread_pwrite.c +1 -1
@@ -154,5 +154,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_swapping.c +1 -1
@@ -246,5 +246,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_wb.c +1 -1
@@ -239,5 +239,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_wc.c +1 -1
@@ -243,5 +243,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiling_max_stride.c +1 -1
@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_unfence_active_buffers.c +1 -1
@@ -99,5 +99,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
@@ -121,5 +121,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_userptr_blits.c +5 -2
@@ -1288,9 +1288,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 ;
@@ -2703,4 +2703,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)igt_require (has_userptr_probe (fd));test_probe (fd); } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_vm_create.c +1 -1
@@ -388,6 +388,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_wait.c +1 -1
@@ -257,6 +257,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_watchdog.c +1 -1
@@ -586,6 +586,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_workarounds.c +3 -0
@@ -339,4 +339,7 @@ igt_main } } } + +igt_fixture +drm_close_driver (device ); }
tests/i915/gen7_exec_parse.c +2 -2
@@ -445,7 +445,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main
@@ -717,6 +717,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gen9_exec_parse.c +1 -1
@@ -1252,6 +1252,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_fb_tiling.c +1 -1
@@ -44,5 +44,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
@@ -46,7 +46,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_hangman.c +2 -2
@@ -97,7 +97,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)
@@ -580,6 +580,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
@@ -83,6 +83,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_module_load.c +4 -4
@@ -238,7 +238,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }
@@ -286,7 +286,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 ();
@@ -327,7 +327,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; }
@@ -419,7 +419,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
@@ -65,5 +65,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }
tests/i915/i915_pm_backlight.c +1 -1
@@ -332,6 +332,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
@@ -689,7 +689,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,6 +139,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
@@ -167,6 +167,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_lpsp.c +1 -1
@@ -211,6 +211,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
@@ -611,6 +611,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_rpm.c +1 -1
@@ -874,7 +874,7 @@ static void teardown_environment(bool display_enabled)fini_mode_set_data (&ms_data);close (debugfs); -close (drm_fd); +drm_close_driver (drm_fd); has_runtime_pm = false; }
tests/i915/i915_pm_rps.c +4 -1
@@ -877,7 +877,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
@@ -959,4 +959,7 @@ igt_mainwaitboost (drm_fd, true);igt_disallow_hang (drm_fd, hang); } + +igt_fixture +drm_close_driver (drm_fd ); }
tests/i915/i915_pm_sseu.c +1 -1
@@ -315,7 +315,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
@@ -76,6 +76,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_query.c +1 -1
@@ -1465,6 +1465,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_suspend.c +2 -2
@@ -232,7 +232,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 );
@@ -315,5 +315,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/kms_big_fb.c +1 -1
@@ -1010,6 +1010,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
@@ -506,6 +506,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {gpu_engines_restore_timeouts (fd, num_engines, saved_gpu_timeouts);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/i915/kms_ccs.c +1 -1
@@ -708,6 +708,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
@@ -257,6 +257,6 @@ igt_main 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
@@ -1351,7 +1351,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 -2
@@ -303,9 +303,8 @@ 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); -close (data.drm_fd); } }
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
@@ -639,6 +639,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/i915/perf.c +2 -2
@@ -5299,7 +5299,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 ;
@@ -6008,6 +6008,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
@@ -2111,7 +2111,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);
@@ -2436,13 +2436,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
@@ -105,6 +105,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_heartbeat_interval.c +1 -1
@@ -514,6 +514,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_preempt_timeout.c +1 -1
@@ -343,6 +343,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_timeslice_duration.c +1 -1
@@ -564,6 +564,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
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
@@ -795,7 +795,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); }
@@ -874,6 +874,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/kms_async_flips.c +1 -1
@@ -668,6 +668,6 @@ igt_main_args("e", NULL, help_str, opt_handler, &data)igt_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
@@ -1069,6 +1069,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
@@ -1010,6 +1010,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
@@ -1803,6 +1803,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_dp_tiled_display.c +1 -1
@@ -502,6 +502,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_flip.c +1 -1
@@ -1898,6 +1898,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
@@ -60,7 +60,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)
@@ -386,7 +386,7 @@ end: igt_fixture {drmModeFreeConnector (connector); -close (drm_fd); +drm_close_driver (drm_fd);reset_connectors (); }
tests/kms_getfb.c +2 -2
@@ -452,7 +452,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); } }
@@ -484,6 +484,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
@@ -433,6 +433,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
@@ -1318,6 +1318,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
@@ -1323,6 +1323,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
@@ -178,7 +178,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 );
@@ -206,7 +206,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);
@@ -217,7 +217,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 );
@@ -338,5 +338,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
@@ -1279,6 +1279,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_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); } }
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); } }
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); + } }
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); } }
tests/prime_busy.c +1 -1
@@ -162,6 +162,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap.c +1 -1
@@ -557,6 +557,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
@@ -249,7 +249,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); }/*
@@ -346,6 +346,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
@@ -106,8 +106,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 )
@@ -139,8 +139,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 )
@@ -164,8 +164,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); }
@@ -211,7 +211,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); }
@@ -275,14 +275,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 ); }
@@ -357,13 +357,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 ); }
@@ -392,7 +392,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )
@@ -421,7 +421,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
@@ -1249,7 +1249,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }
tests/syncobj_basic.c +1 -1
@@ -232,7 +232,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_timeline.c +1 -1
@@ -1538,6 +1538,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_wait.c +1 -1
@@ -914,6 +914,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/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/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); } }
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 ); }
tests/vgem_basic.c +3 -3
@@ -64,8 +64,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)
@@ -537,6 +537,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/vgem_slow.c +1 -1
@@ -85,6 +85,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
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); } }
tests/xe/xe_compute.c +1 -1
@@ -45,6 +45,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_create.c +1 -1
@@ -102,6 +102,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_debugfs.c +1 -1
@@ -270,6 +270,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
@@ -220,7 +220,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]); } }
@@ -257,6 +257,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 {
@@ -701,5 +701,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/xe/xe_exec_balancer.c +1 -1
@@ -708,6 +708,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_basic.c +1 -1
@@ -353,6 +353,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_compute_mode.c +1 -1
@@ -361,6 +361,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_fault_mode.c +1 -1
@@ -570,6 +570,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_reset.c +4 -4
@@ -294,7 +294,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 ;
@@ -475,7 +475,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 ;
@@ -655,7 +655,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 ;
@@ -946,6 +946,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); } }
@@ -454,7 +454,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); } }
@@ -698,7 +698,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); } }
@@ -1403,6 +1403,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_guc_pc.c +1 -1
@@ -496,6 +496,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
@@ -1180,6 +1180,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
@@ -77,6 +77,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_mmio.c +1 -1
@@ -89,6 +89,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_module_load.c +1 -1
@@ -86,7 +86,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
@@ -441,6 +441,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
@@ -122,9 +122,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); }/**
@@ -202,9 +202,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); }
@@ -259,10 +259,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)
@@ -335,7 +335,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 */
@@ -343,7 +343,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 ); }
@@ -429,7 +429,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 ;
@@ -437,7 +437,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 ); }
@@ -474,7 +474,7 @@ static void test_llseek_size(void) }xe_device_put (fd); -close (fd); +drm_close_driver (fd); }/**
@@ -511,7 +511,7 @@ static void test_llseek_bad(void)close (dma_buf_fd);xe_device_put (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -544,6 +544,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_query.c +1 -1
@@ -491,6 +491,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_vm.c +1 -1
@@ -1839,6 +1839,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_waitfence.c +1 -1
@@ -98,6 +98,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
PATCH v2 5/6 tests: Use drm_close_driver() to close the drm fd
To close the drm file descriptor, use igt helper drm_close_driver() instead of using close().
--- lib/igt_msm.c | 2 +- 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 | 4 +-- 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/drm_read.c | 3 +++ tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/i915/api_intel_allocator.c | 2 +- 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 | 3 +++ tests/i915/gem_basic.c | 5 +++- 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_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 | 2 +- tests/i915/gem_ctx_engines.c | 4 ++- tests/i915/gem_ctx_exec.c | 3 +++ tests/i915/gem_ctx_freq.c | 3 +++ tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 2 +- tests/i915/gem_ctx_shared.c | 3 +++ tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 3 +++ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 3 +++ tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_balancer.c | 3 +++ 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_endless.c | 3 +++ tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 2 +- 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 | 2 +- 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 | 2 +- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 3 ++- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 7 +++-- 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 | 4 +-- 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 | 2 +- tests/i915/gem_mmap_offset.c | 2 +- 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 | 2 +- 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 | 2 +- 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 | 7 +++-- tests/i915/gem_vm_create.c | 2 +- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 3 +++ 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 | 4 +-- 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 | 4 +-- 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 | 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_dp_tiled_display.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_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 | 2 +- tests/xe/xe_create.c | 2 +- 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_vm.c | 2 +- tests/xe/xe_waitfence.c | 2 +- 287 files changed, 435 insertions(+), 374 deletions(-)
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); }
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_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_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_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_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_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); } }
tests/amdgpu/amd_psr.c +2 -2
@@ -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 ]);
@@ -761,7 +761,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_f (igt_amd_set_visual_confirm (data.fd,VISUAL_CONFIRM_DISABLE ),"reset PSR visual confirm option failed\n" ); } -close (data.debugfs_fd);igt_display_fini (&data.display); +drm_close_driver (data.debugfs_fd); } }
tests/amdgpu/amd_vrr_range.c +1 -0
@@ -338,5 +338,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }
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
@@ -558,6 +558,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
@@ -1080,6 +1080,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
@@ -525,6 +525,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }
tests/core_auth.c +5 -5
@@ -189,7 +189,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
@@ -201,7 +201,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." );
@@ -211,11 +211,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 */
@@ -224,7 +224,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
@@ -58,5 +58,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
@@ -52,5 +52,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
@@ -46,5 +46,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }
tests/core_setmaster.c +3 -3
@@ -85,7 +85,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)
@@ -206,10 +206,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
@@ -66,7 +66,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
@@ -213,6 +213,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }
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/drm_read.c +3 -0
@@ -311,4 +311,7 @@ igt_main igt_subtest("short-buffer-wakeup")test_short_buffer_wakeup (fd, pipe); + +igt_fixture +drm_close_driver (fd ); }
tests/dumb_buffer.c +1 -1
@@ -394,6 +394,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/i915/api_intel_allocator.c +1 -1
@@ -847,5 +847,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/api_intel_bb.c +1 -1
@@ -1701,6 +1701,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
@@ -855,6 +855,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_bad_reloc.c +1 -1
@@ -212,5 +212,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_barrier_race.c +3 -0
@@ -153,4 +153,7 @@ igt_mainbreak ; } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_basic.c +4 -1
@@ -108,7 +108,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 ();
@@ -117,4 +117,7 @@ igt_mainigt_describe ("Verify that closing drm driver is possible with opened gem object." ); igt_subtest("create-fd-close")test_create_fd_close (fd); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_blits.c +1 -1
@@ -893,6 +893,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }
tests/i915/gem_busy.c +1 -1
@@ -562,6 +562,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_caching.c +1 -1
@@ -340,6 +340,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
@@ -731,6 +731,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
@@ -274,7 +274,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 ();
@@ -293,7 +293,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -317,7 +317,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." );
@@ -329,7 +329,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );
@@ -342,7 +342,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();
@@ -369,7 +369,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_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_cs_tlb.c +1 -1
@@ -162,5 +162,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_bad_destroy.c +1 -1
@@ -80,5 +80,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_ctx_create.c +1 -1
@@ -667,6 +667,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_engines.c +3 -1
@@ -633,6 +633,8 @@ igt_mainindependent_all (i915, ctx); } -igt_fixture + igt_fixture {igt_stop_hang_detector (); +drm_close_driver (i915); + } }
tests/i915/gem_ctx_exec.c +3 -0
@@ -546,4 +546,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
@@ -213,4 +213,7 @@ igt_main igt_subtest_f("sysfs")sysfs_range (i915); + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_ctx_param.c +1 -1
@@ -473,5 +473,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 +1 -1
@@ -1383,6 +1383,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_ctx_shared.c +3 -0
@@ -1088,4 +1088,7 @@ igt_mainigt_stop_hang_detector (); } } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_ctx_sseu.c +1 -1
@@ -545,6 +545,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ctx_switch.c +1 -1
@@ -440,6 +440,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 +3 -0
@@ -1126,4 +1126,7 @@ igt_mainintel_allocator_multiprocess_stop (); } } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_evict_alignment.c +1 -1
@@ -265,6 +265,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_evict_everything.c +1 -1
@@ -290,6 +290,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_alignment.c +3 -0
@@ -546,4 +546,7 @@ igt_mainprio_inversion (fd,SHARED ); igt_subtest("pi-isolated")prio_inversion (fd,ISOLATED ); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_exec_async.c +1 -1
@@ -213,6 +213,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
@@ -287,6 +287,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_balancer.c +3 -0
@@ -3482,4 +3482,7 @@ igt_main igt_subtest("nohangcheck")nohangcheck (i915); } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_exec_basic.c +1 -1
@@ -98,6 +98,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
@@ -326,5 +326,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }
tests/i915/gem_exec_capture.c +1 -1
@@ -1013,6 +1013,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
@@ -225,6 +225,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }
tests/i915/gem_exec_endless.c +3 -0
@@ -367,4 +367,7 @@ igt_mainintel_register_access_fini (&mmio); } } + +igt_fixture +drm_close_driver (i915 ); }
tests/i915/gem_exec_fair.c +1 -1
@@ -1348,6 +1348,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_fence.c +1 -1
@@ -3351,6 +3351,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_flush.c +1 -1
@@ -711,6 +711,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_gttfill.c +2 -2
@@ -279,7 +279,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 ();
@@ -287,6 +287,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_exec_latency.c +1 -1
@@ -971,6 +971,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
@@ -1083,6 +1083,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 +1 -1
@@ -364,6 +364,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
@@ -646,6 +646,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_exec_reloc.c +1 -1
@@ -1178,5 +1178,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_exec_schedule.c +1 -1
@@ -3369,6 +3369,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
@@ -455,6 +455,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
@@ -411,6 +411,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 +1 -1
@@ -660,6 +660,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
@@ -381,6 +381,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
@@ -69,5 +69,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_fence_thrash.c +2 -1
@@ -225,7 +225,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 ; }
@@ -252,4 +252,5 @@ igt_main igt_subtest("bo-copy")igt_assert (run_test (1 , bo_copy,I915_TILING_X ,1 ) ==0 ); + }
tests/i915/gem_fenced_exec_thrash.c +1 -1
@@ -199,5 +199,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 +5 -2
@@ -147,7 +147,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 */
@@ -156,7 +156,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
@@ -188,4 +188,7 @@ igt_mainigt_describe ("Tests flink lifetime by referencing from multiple descriptors." ); igt_subtest("flink-lifetime")test_flink_lifetime (fd); + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_flink_race.c +3 -3
@@ -127,7 +127,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)
@@ -188,13 +188,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
@@ -105,5 +105,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
@@ -164,7 +164,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
@@ -515,5 +515,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
@@ -139,6 +139,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }
tests/i915/gem_lmem_evict.c +2 -2
@@ -93,7 +93,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 ();
@@ -132,7 +132,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }
tests/i915/gem_lmem_swapping.c +2 -2
@@ -736,7 +736,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 ();
@@ -781,7 +781,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
@@ -77,7 +77,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -99,7 +99,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -123,7 +123,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;
@@ -145,7 +145,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void
@@ -161,7 +161,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
@@ -185,7 +185,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
@@ -173,6 +173,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
@@ -315,5 +315,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_gtt.c +1 -1
@@ -1492,5 +1492,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_mmap_offset.c +1 -1
@@ -926,6 +926,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_mmap_wc.c +1 -1
@@ -620,5 +620,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_partial_pwrite_pread.c +1 -1
@@ -326,6 +326,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
@@ -183,6 +183,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_ppgtt.c +4 -4
@@ -251,8 +251,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
@@ -385,7 +385,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; }
@@ -398,7 +398,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
@@ -350,6 +350,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
@@ -252,5 +252,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_pwrite.c +1 -1
@@ -572,5 +572,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
@@ -140,5 +140,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_pxp.c +1 -1
@@ -1293,6 +1293,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_read_read_speed.c +1 -1
@@ -214,6 +214,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_readwrite.c +1 -1
@@ -143,5 +143,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_reg_read.c +1 -1
@@ -170,6 +170,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_render_copy.c +1 -1
@@ -879,6 +879,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
@@ -81,7 +81,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 +1 -1
@@ -999,6 +999,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
@@ -401,6 +401,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
@@ -261,6 +261,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
@@ -130,5 +130,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_set_tiling_vs_pwrite.c +1 -1
@@ -99,5 +99,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_shrink.c +7 -7
@@ -270,7 +270,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 ; }
@@ -319,7 +319,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); } } }
@@ -331,7 +331,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 ;
@@ -344,7 +344,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 ;
@@ -356,7 +356,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 ();
@@ -399,7 +399,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main
@@ -456,7 +456,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )
tests/i915/gem_softpin.c +1 -1
@@ -1531,6 +1531,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_spin_batch.c +1 -1
@@ -277,6 +277,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
@@ -419,5 +419,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_stress.c +1 -1
@@ -926,7 +926,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
@@ -1363,6 +1363,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
@@ -215,6 +215,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_tiled_fence_blits.c +1 -1
@@ -320,5 +320,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_partial_pwrite_pread.c +1 -1
@@ -318,6 +318,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
@@ -222,5 +222,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_pread_pwrite.c +1 -1
@@ -154,5 +154,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_swapping.c +1 -1
@@ -246,5 +246,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/gem_tiled_wb.c +1 -1
@@ -239,5 +239,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiled_wc.c +1 -1
@@ -243,5 +243,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }
tests/i915/gem_tiling_max_stride.c +1 -1
@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }
tests/i915/gem_unfence_active_buffers.c +1 -1
@@ -99,5 +99,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
@@ -121,5 +121,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }
tests/i915/gem_userptr_blits.c +5 -2
@@ -1288,9 +1288,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 ;
@@ -2703,4 +2703,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)igt_require (has_userptr_probe (fd));test_probe (fd); } + +igt_fixture +drm_close_driver (fd ); }
tests/i915/gem_vm_create.c +1 -1
@@ -388,6 +388,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_wait.c +1 -1
@@ -257,6 +257,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/i915/gem_watchdog.c +1 -1
@@ -586,6 +586,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/gem_workarounds.c +3 -0
@@ -339,4 +339,7 @@ igt_main } } } + +igt_fixture +drm_close_driver (device ); }
tests/i915/gen7_exec_parse.c +2 -2
@@ -445,7 +445,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main
@@ -717,6 +717,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }
tests/i915/gen9_exec_parse.c +1 -1
@@ -1252,6 +1252,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_fb_tiling.c +1 -1
@@ -44,5 +44,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
@@ -46,7 +46,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }
tests/i915/i915_hangman.c +2 -2
@@ -97,7 +97,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)
@@ -580,6 +580,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
@@ -83,6 +83,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_module_load.c +4 -4
@@ -238,7 +238,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }
@@ -286,7 +286,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 ();
@@ -327,7 +327,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; }
@@ -419,7 +419,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
@@ -65,5 +65,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }
tests/i915/i915_pm_backlight.c +1 -1
@@ -332,6 +332,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
@@ -689,7 +689,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,6 +139,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
@@ -167,6 +167,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_lpsp.c +1 -1
@@ -211,6 +211,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
@@ -611,6 +611,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_pm_rps.c +4 -1
@@ -877,7 +877,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
@@ -959,4 +959,7 @@ igt_mainwaitboost (drm_fd, true);igt_disallow_hang (drm_fd, hang); } + +igt_fixture +drm_close_driver (drm_fd ); }
tests/i915/i915_pm_sseu.c +1 -1
@@ -315,7 +315,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
@@ -76,6 +76,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }
tests/i915/i915_query.c +1 -1
@@ -1465,6 +1465,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/i915/i915_suspend.c +2 -2
@@ -232,7 +232,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 );
@@ -315,5 +315,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/i915/kms_big_fb.c +1 -1
@@ -1010,6 +1010,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
@@ -506,6 +506,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {gpu_engines_restore_timeouts (fd, num_engines, saved_gpu_timeouts);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }
tests/i915/kms_ccs.c +1 -1
@@ -708,6 +708,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
@@ -257,6 +257,6 @@ igt_main 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
@@ -1351,7 +1351,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 -2
@@ -303,9 +303,8 @@ 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); -close (data.drm_fd); } }
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
@@ -639,6 +639,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/i915/perf.c +2 -2
@@ -5299,7 +5299,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 ;
@@ -6008,6 +6008,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
@@ -2111,7 +2111,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);
@@ -2436,13 +2436,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
@@ -105,6 +105,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_heartbeat_interval.c +1 -1
@@ -514,6 +514,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_preempt_timeout.c +1 -1
@@ -343,6 +343,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
tests/i915/sysfs_timeslice_duration.c +1 -1
@@ -564,6 +564,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }
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
@@ -795,7 +795,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); }
@@ -874,6 +874,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/kms_async_flips.c +1 -1
@@ -668,6 +668,6 @@ igt_main_args("e", NULL, help_str, opt_handler, &data)igt_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
@@ -1069,6 +1069,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
@@ -1010,6 +1010,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
@@ -1803,6 +1803,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_dp_tiled_display.c +1 -1
@@ -502,6 +502,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_flip.c +1 -1
@@ -1898,6 +1898,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
@@ -60,7 +60,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)
@@ -386,7 +386,7 @@ end: igt_fixture {drmModeFreeConnector (connector); -close (drm_fd); +drm_close_driver (drm_fd);reset_connectors (); }
tests/kms_getfb.c +2 -2
@@ -452,7 +452,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); } }
@@ -484,6 +484,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
@@ -433,6 +433,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
@@ -1318,6 +1318,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
@@ -1323,6 +1323,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
@@ -178,7 +178,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 );
@@ -206,7 +206,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);
@@ -217,7 +217,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 );
@@ -338,5 +338,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
@@ -1279,6 +1279,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_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); } }
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); } }
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); + } }
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); } }
tests/prime_busy.c +1 -1
@@ -162,6 +162,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }
tests/prime_mmap.c +1 -1
@@ -557,6 +557,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
@@ -249,7 +249,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); }/*
@@ -346,6 +346,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
@@ -106,8 +106,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 )
@@ -139,8 +139,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 )
@@ -164,8 +164,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); }
@@ -211,7 +211,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); }
@@ -275,14 +275,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 ); }
@@ -357,13 +357,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 ); }
@@ -392,7 +392,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )
@@ -421,7 +421,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
@@ -1249,7 +1249,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }
tests/syncobj_basic.c +1 -1
@@ -232,7 +232,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_timeline.c +1 -1
@@ -1538,6 +1538,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/syncobj_wait.c +1 -1
@@ -914,6 +914,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/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/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); } }
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 ); }
tests/vgem_basic.c +3 -3
@@ -64,8 +64,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)
@@ -537,6 +537,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
tests/vgem_slow.c +1 -1
@@ -85,6 +85,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }
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); } }
tests/xe/xe_compute.c +1 -1
@@ -45,6 +45,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_create.c +1 -1
@@ -102,6 +102,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_debugfs.c +1 -1
@@ -270,6 +270,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
@@ -220,7 +220,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]); } }
@@ -257,6 +257,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 {
@@ -701,5 +701,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }
tests/xe/xe_exec_balancer.c +1 -1
@@ -708,6 +708,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_basic.c +1 -1
@@ -353,6 +353,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_compute_mode.c +1 -1
@@ -361,6 +361,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_fault_mode.c +1 -1
@@ -570,6 +570,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_exec_reset.c +4 -4
@@ -294,7 +294,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 ;
@@ -475,7 +475,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 ;
@@ -655,7 +655,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 ;
@@ -946,6 +946,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); } }
@@ -454,7 +454,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); } }
@@ -698,7 +698,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); } }
@@ -1403,6 +1403,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_guc_pc.c +1 -1
@@ -496,6 +496,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
@@ -1180,6 +1180,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
@@ -77,6 +77,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_mmio.c +1 -1
@@ -89,6 +89,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_module_load.c +1 -1
@@ -86,7 +86,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
@@ -441,6 +441,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
@@ -122,9 +122,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); }/**
@@ -202,9 +202,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); }
@@ -259,10 +259,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)
@@ -335,7 +335,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 */
@@ -343,7 +343,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 ); }
@@ -429,7 +429,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 ;
@@ -437,7 +437,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 ); }
@@ -474,7 +474,7 @@ static void test_llseek_size(void) }xe_device_put (fd); -close (fd); +drm_close_driver (fd); }/**
@@ -511,7 +511,7 @@ static void test_llseek_bad(void)close (dma_buf_fd);xe_device_put (fd); -close (fd); +drm_close_driver (fd); } igt_main
@@ -544,6 +544,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_query.c +1 -1
@@ -491,6 +491,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }
tests/xe/xe_vm.c +1 -1
@@ -1839,6 +1839,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
tests/xe/xe_waitfence.c +1 -1
@@ -98,6 +98,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }
Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t V2 5/6] tests: Use drm_close_driver() to close the drm fd
Hi Bhanuprakash,
Quoted 3 lines · Bhanuprakash Modem
To close the drm file descriptor, use igt helper
drm_close_driver()instead of usingclose().
What changed in v2 ? Please describe it here like:
v2: added/corrected/changed description
Add here e-mails for cc, like:
Quoted 1 line
Signed-off-by Bhanuprakash Modem <[email protected]>
Please use checkpatch.pl to correct some whitespace errors or if they are already there do not correct them in this patch, that should go in some other trivial one.
Please also look at lib/igt_types.c and add there also xe_device_put if fd is xe device.
Quoted 2 lines
--- lib/igt_msm.c | 2 +-
---------- ^
Non-related arch.
Quoted 1 line
tests/amdgpu/amd_abm.c | 1 +
-------- ^
Non-related arch.
If you are changing some other archs you should also Cc: developers or maybe if it is used only for intel/Xe just do it in few more patches, one for each arch ? In that case you could Cc: only to respective dev of given architecture. These Cc: should be also placed in patch before your s-o-b.
Quoted 4 lines
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 +-
Quoted 8 lines
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 | 4 +-- tests/amdgpu/amd_vrr_range.c | 1 + tests/chamelium/kms_chamelium_audio.c | 2 +-
-------- ^
These should stay.
Quoted 8 lines
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 ++---
Quoted 8 lines
tests/core_setmaster_vs_auth.c | 6 ++--- tests/debugfs_test.c | 2 +- tests/dmabuf_sync_file.c | 3 +++ tests/drm_read.c | 3 +++ tests/dumb_buffer.c | 2 +- tests/eviction_common.c | 2 +- tests/fbdev.c | 2 +- tests/i915/api_intel_allocator.c | 2 +-
-------- ^
This can also go in separate patchset as i915 is not Xe device. Btw some of them are fixes, there are no close(fd) there, so maybe that should be yet another patch with fixing exit without close.
Quoted 187 lines
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 | 3 +++ tests/i915/gem_basic.c | 5 +++- 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_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 | 2 +- tests/i915/gem_ctx_engines.c | 4 ++- tests/i915/gem_ctx_exec.c | 3 +++ tests/i915/gem_ctx_freq.c | 3 +++ tests/i915/gem_ctx_param.c | 2 +- tests/i915/gem_ctx_persistence.c | 2 +- tests/i915/gem_ctx_shared.c | 3 +++ tests/i915/gem_ctx_sseu.c | 2 +- tests/i915/gem_ctx_switch.c | 2 +- tests/i915/gem_eio.c | 3 +++ tests/i915/gem_evict_alignment.c | 2 +- tests/i915/gem_evict_everything.c | 2 +- tests/i915/gem_exec_alignment.c | 3 +++ tests/i915/gem_exec_async.c | 2 +- tests/i915/gem_exec_await.c | 2 +- tests/i915/gem_exec_balancer.c | 3 +++ 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_endless.c | 3 +++ tests/i915/gem_exec_fair.c | 2 +- tests/i915/gem_exec_fence.c | 2 +- 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 | 2 +- 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 | 2 +- tests/i915/gem_exercise_blt.c | 2 +- tests/i915/gem_fd_exhaustion.c | 2 +- tests/i915/gem_fence_thrash.c | 3 ++- tests/i915/gem_fenced_exec_thrash.c | 2 +- tests/i915/gem_flink_basic.c | 7 +++-- 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 | 4 +-- 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 | 2 +- tests/i915/gem_mmap_offset.c | 2 +- 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 | 2 +- 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 | 2 +- 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 | 7 +++-- tests/i915/gem_vm_create.c | 2 +- tests/i915/gem_wait.c | 2 +- tests/i915/gem_watchdog.c | 2 +- tests/i915/gem_workarounds.c | 3 +++ 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 | 4 +-- 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 | 4 +-- 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 | 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_dp_tiled_display.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 +-
Quoted 8 lines
tests/kms_sequence.c | 2 +- tests/kms_setmode.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 +++--
-------- ^
Non-related arch.
Quoted 1 line
tests/panfrost_gem_new.c | 4 +--
-------- ^
Non-related arch.
Quoted 7 lines
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 +-
Quoted 8 lines
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 +--
-------- ^
Non-related arch.
Quoted 9 lines
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 +--
-------- ^
Non-related arch.
Quoted 4 lines
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 +-
Quoted 8 lines
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 +-
-------- ^
Non-related arch.
Quoted 173 lines
tests/vmwgfx/vmw_ref_count.c | 4 +-- tests/vmwgfx/vmw_surface_copy.c | 2 +- tests/xe/xe_compute.c | 2 +- tests/xe/xe_create.c | 2 +- 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_vm.c | 2 +- tests/xe/xe_waitfence.c | 2 +- 287 files changed, 435 insertions(+), 374 deletions(-)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); }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_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_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_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_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_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); } }tests/amdgpu/amd_psr.c +0
-0
tests/amdgpu/amd_psr.c static void run_check_psr_su_cursor(data_t *data, bool test_mpo) · line 643
Quoted 5 lines
tests/amdgpu/amd_psr.c +1
-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) -*/ +*/
Do not make unrelated changes.
tests/amdgpu/amd_psr.c igt_main_args("", long_options, help_str, opt_handler, NULL) · line 764
Quoted 8 lines
tests/amdgpu/amd_psr.c +0
-1draw_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 ]);@@ -761,7 +761,7 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)igt_require_f (igt_amd_set_visual_confirm (data.fd,VISUAL_CONFIRM_DISABLE ),"reset PSR visual confirm option failed\n" ); } -close (data.debugfs_fd);
This is debugfs fd, not drm one.
Quoted 100 lines
tests/amdgpu/amd_psr.c +1
-0igt_display_fini (&data.display); +drm_close_driver (data.debugfs_fd); } }tests/amdgpu/amd_vrr_range.c +1
-0@@ -338,5 +338,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +drm_close_driver (data.fd); } }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@@ -558,6 +558,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@@ -1080,6 +1080,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@@ -525,6 +525,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); -close (data.drm_fd); +drm_close_driver (data.drm_fd); } }tests/core_auth.c +4
-4@@ -189,7 +189,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@@ -201,7 +201,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." );@@ -211,11 +211,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 227
Quoted 5 lines
tests/core_auth.c +1
-1@@ -224,7 +224,7 @@ igt_mainigt_fixture master =drm_open_driver_master (DRIVER_ANY ); - +
Do not make unrelated changes.
Quoted 94 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@@ -58,5 +58,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@@ -52,5 +52,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@@ -46,5 +46,5 @@ igt_simple_mainigt_assert_lte (1 , v->version_major);drmFree (v); -close (fd); +drm_close_driver (fd); }tests/core_setmaster.c +3
-3@@ -85,7 +85,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)@@ -206,10 +206,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@@ -66,7 +66,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@@ -213,6 +213,6 @@ igt_main igt_fixture {close (sysfs);close (debugfs); -close (fd); +drm_close_driver (fd); } }tests/dmabuf_sync_file.c +0
-0
tests/dmabuf_sync_file.c igt_main · line 385
Quoted 6 lines
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 );
This is a fix.
tests/drm_read.c igt_main · line 316
Quoted 12 lines
tests/dmabuf_sync_file.c +0
-0}tests/drm_read.c +3
-0@@ -311,4 +311,7 @@ igt_main igt_subtest("short-buffer-wakeup")test_short_buffer_wakeup (fd, pipe); + +igt_fixture +drm_close_driver (fd );
This is a fix.
Quoted 228 lines
tests/drm_read.c +0
-0}tests/dumb_buffer.c +1
-1@@ -394,6 +394,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/i915/api_intel_allocator.c +1
-1@@ -847,5 +847,5 @@ igt_maingem_pool (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/api_intel_bb.c +1
-1@@ -1701,6 +1701,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@@ -855,6 +855,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_bad_reloc.c +1
-1@@ -212,5 +212,5 @@ igt_mainnegative_reloc_blt (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_barrier_race.c +3
-0@@ -153,4 +153,7 @@ igt_mainbreak ; } } + +igt_fixture +drm_close_driver (fd ); }tests/i915/gem_basic.c +4
-1@@ -108,7 +108,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 ();@@ -117,4 +117,7 @@ igt_mainigt_describe ("Verify that closing drm driver is possible with opened gem object." ); igt_subtest("create-fd-close")test_create_fd_close (fd); + +igt_fixture +drm_close_driver (fd ); }tests/i915/gem_blits.c +1
-1@@ -893,6 +893,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); -close (device.fd); +drm_close_driver (device.fd); } }tests/i915/gem_busy.c +1
-1@@ -562,6 +562,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_caching.c +1
-1@@ -340,6 +340,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@@ -731,6 +731,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@@ -274,7 +274,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 ();@@ -293,7 +293,7 @@ static void threads(int timeout, unsigned int flags)igt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); } igt_main@@ -317,7 +317,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." );@@ -329,7 +329,7 @@ igt_mainigt_waitchildren ();gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_describe ("Basic workload submission on multi-GPU machine." );@@ -342,7 +342,7 @@ igt_mainigt_assert (fd >0 );process (fd, child);gem_quiescent_gpu (fd); -close (fd); +drm_close_driver (fd); }igt_waitchildren ();@@ -369,7 +369,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_concurrent_all.c +0
-0
tests/i915/gem_concurrent_all.c igt_main · line 2022
Quoted 8 lines
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); + }
This is a fix.
Quoted 40 lines
tests/i915/gem_concurrent_all.c +0
-0}tests/i915/gem_cs_tlb.c +1
-1@@ -162,5 +162,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_ctx_bad_destroy.c +1
-1@@ -80,5 +80,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_ctx_create.c +1
-1@@ -667,6 +667,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ctx_engines.c +0
-0
tests/i915/gem_ctx_engines.c igt_main · line 638
Quoted 7 lines
tests/i915/gem_ctx_engines.c +2
-1@@ -633,6 +633,8 @@ igt_mainindependent_all (i915, ctx); } -igt_fixture + igt_fixture {igt_stop_hang_detector (); +drm_close_driver (i915);
This is a fix.
tests/i915/gem_ctx_exec.c igt_main · line 551
Quoted 13 lines
tests/i915/gem_ctx_engines.c +1
-0+ } }tests/i915/gem_ctx_exec.c +3
-0@@ -546,4 +546,7 @@ igt_maingem_context_destroy (fd, ctx_id);put_ahnd (ahnd); } + +igt_fixture +drm_close_driver (fd );
This is a fix.
tests/i915/gem_ctx_freq.c igt_main · line 218
Quoted 12 lines
tests/i915/gem_ctx_exec.c +0
-0}tests/i915/gem_ctx_freq.c +3
-0@@ -213,4 +213,7 @@ igt_main igt_subtest_f("sysfs")sysfs_range (i915); + +igt_fixture +drm_close_driver (i915 );
This is a fix.
Quoted 29 lines
tests/i915/gem_ctx_freq.c +0
-0}tests/i915/gem_ctx_param.c +1
-1@@ -473,5 +473,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 +1
-1@@ -1383,6 +1383,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_ctx_shared.c +0
-0
tests/i915/gem_ctx_shared.c igt_main · line 1093
Quoted 6 lines
tests/i915/gem_ctx_shared.c +3
-0@@ -1088,4 +1088,7 @@ igt_mainigt_stop_hang_detector (); } } + +igt_fixture +drm_close_driver (i915 );
This is a fix.
Quoted 30 lines
tests/i915/gem_ctx_shared.c +0
-0}tests/i915/gem_ctx_sseu.c +1
-1@@ -545,6 +545,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ctx_switch.c +1
-1@@ -440,6 +440,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 +0
-0
tests/i915/gem_eio.c igt_main · line 1131
Quoted 6 lines
tests/i915/gem_eio.c +3
-0@@ -1126,4 +1126,7 @@ igt_mainintel_allocator_multiprocess_stop (); } } + +igt_fixture +drm_close_driver (fd );
This is a fix.
Quoted 30 lines
tests/i915/gem_eio.c +0
-0}tests/i915/gem_evict_alignment.c +1
-1@@ -265,6 +265,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_evict_everything.c +1
-1@@ -290,6 +290,6 @@ igt_main igt_fixture {igt_stop_hang_helper (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_alignment.c +0
-0
tests/i915/gem_exec_alignment.c igt_main · line 551
Quoted 6 lines
tests/i915/gem_exec_alignment.c +3
-0@@ -546,4 +546,7 @@ igt_mainprio_inversion (fd,SHARED ); igt_subtest("pi-isolated")prio_inversion (fd,ISOLATED ); + +igt_fixture +drm_close_driver (fd );
This is a fix.
Quoted 30 lines
tests/i915/gem_exec_alignment.c +0
-0}tests/i915/gem_exec_async.c +1
-1@@ -213,6 +213,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@@ -287,6 +287,6 @@ igt_main igt_fixture {igt_stop_hang_detector ();intel_ctx_destroy (device, ctx); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_balancer.c +0
-0
tests/i915/gem_exec_balancer.c igt_main · line 3487
Quoted 6 lines
tests/i915/gem_exec_balancer.c +3
-0@@ -3482,4 +3482,7 @@ igt_main igt_subtest("nohangcheck")nohangcheck (i915); } + +igt_fixture +drm_close_driver (i915 );
This is a fix.
Quoted 53 lines
tests/i915/gem_exec_balancer.c +0
-0}tests/i915/gem_exec_basic.c +1
-1@@ -98,6 +98,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@@ -326,5 +326,5 @@ igt_mainexhaustive (i915);igt_fixture -close (i915 ); +drm_close_driver (i915 ); }tests/i915/gem_exec_capture.c +1
-1@@ -1013,6 +1013,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@@ -225,6 +225,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (device); +drm_close_driver (device); } }tests/i915/gem_exec_endless.c +0
-0
tests/i915/gem_exec_endless.c igt_main · line 372
Quoted 6 lines
tests/i915/gem_exec_endless.c +3
-0@@ -367,4 +367,7 @@ igt_mainintel_register_access_fini (&mmio); } } + +igt_fixture +drm_close_driver (i915 );
This is a fix.
Quoted 241 lines
tests/i915/gem_exec_endless.c +0
-0}tests/i915/gem_exec_fair.c +1
-1@@ -1348,6 +1348,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_fence.c +1
-1@@ -3351,6 +3351,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_flush.c +1
-1@@ -711,6 +711,6 @@ igt_main igt_fixture {igt_stop_hang_detector (); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_gttfill.c +2
-2@@ -279,7 +279,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 ();@@ -287,6 +287,6 @@ igt_main igt_fixture {intel_allocator_multiprocess_stop (); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_exec_latency.c +1
-1@@ -971,6 +971,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@@ -1083,6 +1083,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 +1
-1@@ -364,6 +364,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@@ -646,6 +646,6 @@ igt_main igt_fixture {gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_exec_reloc.c +1
-1@@ -1178,5 +1178,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_exec_schedule.c +1
-1@@ -3369,6 +3369,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@@ -455,6 +455,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@@ -411,6 +411,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 +1
-1@@ -660,6 +660,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@@ -381,6 +381,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@@ -69,5 +69,5 @@ igt_simple_mainigt_waitchildren (); -close (fd); +drm_close_driver (fd); }tests/i915/gem_fence_thrash.c +2
-1@@ -225,7 +225,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 ; }@@ -252,4 +252,5 @@ igt_main igt_subtest("bo-copy")igt_assert (run_test (1 , bo_copy,I915_TILING_X ,1 ) ==0 ); + }tests/i915/gem_fenced_exec_thrash.c +1
-1@@ -199,5 +199,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@@ -147,7 +147,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 */ @@ -156,7 +156,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_basic.c igt_main · line 193
Quoted 6 lines
tests/i915/gem_flink_basic.c +3
-0@@ -188,4 +188,7 @@ igt_mainigt_describe ("Tests flink lifetime by referencing from multiple descriptors." ); igt_subtest("flink-lifetime")test_flink_lifetime (fd); + +igt_fixture +drm_close_driver (fd );
This is a fix.
Quoted 735 lines
tests/i915/gem_flink_basic.c +0
-0}tests/i915/gem_flink_race.c +3
-3@@ -127,7 +127,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)@@ -188,13 +188,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@@ -105,5 +105,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@@ -164,7 +164,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@@ -515,5 +515,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@@ -139,6 +139,6 @@ igt_main igt_fixture {put_ahnd (ahnd); -close (drm_fd); +drm_close_driver (drm_fd); } }tests/i915/gem_lmem_evict.c +2
-2@@ -93,7 +93,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 ();@@ -132,7 +132,7 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915);igt_i915_driver_unload (); } }tests/i915/gem_lmem_swapping.c +2
-2@@ -736,7 +736,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 ();@@ -781,7 +781,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@@ -77,7 +77,7 @@ dontneed_before_mmap(void)PROT_READ |PROT_WRITE , t->type); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;@@ -99,7 +99,7 @@ dontneed_before_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void@@ -123,7 +123,7 @@ dontneed_after_mmap(void) t->type);gem_madvise (fd, handle,I915_MADV_DONTNEED ); -close (fd); +drm_close_driver (fd);if (!ptr)continue ;@@ -145,7 +145,7 @@ dontneed_after_mmap(void) fd =drm_open_driver (DRIVER_INTEL ); } -close (fd); +drm_close_driver (fd); } static void@@ -161,7 +161,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@@ -185,7 +185,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@@ -173,6 +173,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@@ -315,5 +315,5 @@ igt_maintest_huge_bo (2 );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_mmap_gtt.c +1
-1@@ -1492,5 +1492,5 @@ igt_mainigt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_mmap_offset.c +1
-1@@ -926,6 +926,6 @@ igt_mainblt_coherency (i915); igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_mmap_wc.c +1
-1@@ -620,5 +620,5 @@ igt_maintest_set_cache_level (fd);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_partial_pwrite_pread.c +1
-1@@ -326,6 +326,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@@ -183,6 +183,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_ppgtt.c +4
-4@@ -251,8 +251,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@@ -385,7 +385,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; }@@ -398,7 +398,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@@ -350,6 +350,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@@ -252,5 +252,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_pwrite.c +1
-1@@ -572,5 +572,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@@ -140,5 +140,5 @@ igt_simple_maintest (256 ,256 );buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); }tests/i915/gem_pxp.c +1
-1@@ -1293,6 +1293,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_read_read_speed.c +1
-1@@ -214,6 +214,6 @@ igt_main igt_fixture {buf_ops_destroy (bops); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_readwrite.c +1
-1@@ -143,5 +143,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_reg_read.c +1
-1@@ -170,6 +170,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_render_copy.c +1
-1@@ -879,6 +879,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@@ -81,7 +81,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 +1
-1@@ -999,6 +999,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@@ -401,6 +401,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@@ -261,6 +261,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@@ -130,5 +130,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }tests/i915/gem_set_tiling_vs_pwrite.c +1
-1@@ -99,5 +99,5 @@ igt_simple_mainmunmap (ptr,OBJECT_SIZE ); -close (fd); +drm_close_driver (fd); }tests/i915/gem_shrink.c +7
-7@@ -270,7 +270,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 ; }@@ -319,7 +319,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); } } }@@ -331,7 +331,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 ;@@ -344,7 +344,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 ;@@ -356,7 +356,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 ();@@ -399,7 +399,7 @@ static void reclaim(unsigned engine, int timeout)munmap ((void *)shared,4096 );close (debugfs); -close (fd); +drm_close_driver (fd); } igt_main@@ -456,7 +456,7 @@ igt_main num_processes, alloc_size); alloc_size <<=20 ; -close (fd); +drm_close_driver (fd); }igt_subtest ("reclaim" )tests/i915/gem_softpin.c +1
-1@@ -1531,6 +1531,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_spin_batch.c +1
-1@@ -277,6 +277,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@@ -419,5 +419,5 @@ igt_maintest_batch (fd,2 ,1 );igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_stress.c +1
-1@@ -926,7 +926,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@@ -1363,6 +1363,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@@ -215,6 +215,6 @@ igt_main } igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/gem_tiled_fence_blits.c +1
-1@@ -320,5 +320,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_tiled_partial_pwrite_pread.c +1
-1@@ -318,6 +318,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@@ -222,5 +222,5 @@ igt_simple_main } } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_pread_pwrite.c +1
-1@@ -154,5 +154,5 @@ igt_simple_maingem_madvise (fd, handle,I915_MADV_DONTNEED ); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_swapping.c +1
-1@@ -246,5 +246,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/gem_tiled_wb.c +1
-1@@ -239,5 +239,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiled_wc.c +1
-1@@ -243,5 +243,5 @@ igt_simple_mainmunmap (linear, last_page - first_page); } -close (fd); +drm_close_driver (fd); }tests/i915/gem_tiling_max_stride.c +1
-1@@ -138,5 +138,5 @@ igt_simple_mainmunmap (ptr, size); -close (fd); +drm_close_driver (fd); }tests/i915/gem_unfence_active_buffers.c +1
-1@@ -99,5 +99,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@@ -121,5 +121,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); -close (i915); +drm_close_driver (i915); }tests/i915/gem_userptr_blits.c +2
-2@@ -1288,9 +1288,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_userptr_blits.c igt_main_args("c:", NULL, help_str, opt_handler, NULL) · line 2708
Quoted 6 lines
tests/i915/gem_userptr_blits.c +3
-0@@ -2703,4 +2703,7 @@ igt_main_args("c:", NULL, help_str, opt_handler, NULL)igt_require (has_userptr_probe (fd));test_probe (fd); } + +igt_fixture +drm_close_driver (fd );
This is a fix.
Quoted 42 lines
tests/i915/gem_userptr_blits.c +0
-0}tests/i915/gem_vm_create.c +1
-1@@ -388,6 +388,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/gem_wait.c +1
-1@@ -257,6 +257,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/i915/gem_watchdog.c +1
-1@@ -586,6 +586,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/gem_workarounds.c +0
-0
tests/i915/gem_workarounds.c igt_main · line 344
Quoted 6 lines
tests/i915/gem_workarounds.c +3
-0@@ -339,4 +339,7 @@ igt_main } } } + +igt_fixture +drm_close_driver (device );
This is a fix.
Quoted 229 lines
tests/i915/gem_workarounds.c +0
-0}tests/i915/gen7_exec_parse.c +2
-2@@ -445,7 +445,7 @@ static void hsw_load_register_reg(void) 0xabcdabc0); } -close (fd); +drm_close_driver (fd); } igt_main@@ -717,6 +717,6 @@ igt_mainigt_stop_hang_detector ();gem_close (fd, handle); -close (fd); +drm_close_driver (fd); } }tests/i915/gen9_exec_parse.c +1
-1@@ -1252,6 +1252,6 @@ igt_mainigt_stop_hang_detector ();gem_close (i915, handle); -close (i915); +drm_close_driver (i915); } }tests/i915/i915_fb_tiling.c +1
-1@@ -44,5 +44,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@@ -46,7 +46,7 @@ init(void)static void deinit (void ) { -close (drm_fd); +drm_close_driver (drm_fd); }tests/i915/i915_hangman.c +2
-2@@ -97,7 +97,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)@@ -580,6 +580,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@@ -83,6 +83,6 @@ igt_main igt_fixture {close (hwm); -close (fd); +drm_close_driver (fd); } }tests/i915/i915_module_load.c +4
-4@@ -238,7 +238,7 @@ static void gem_sanitycheck(void)store_all (i915); errno =0 ; -close (i915); +drm_close_driver (i915);igt_assert_eq (err, expected); }@@ -286,7 +286,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 ();@@ -327,7 +327,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; }@@ -419,7 +419,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@@ -65,5 +65,5 @@ igt_simple_mainigt_assert (has_known_intel_chipset (intel)); -close (intel); +drm_close_driver (intel); }tests/i915/i915_pm_backlight.c +1
-1@@ -332,6 +332,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@@ -689,7 +689,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,6 +139,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@@ -167,6 +167,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/i915_pm_lpsp.c +1
-1@@ -211,6 +211,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@@ -611,6 +611,6 @@ igt_main igt_fixture {intel_ctx_destroy (i915, ctx); -close (i915); +drm_close_driver (i915); } }tests/i915/i915_pm_rps.c +1
-1@@ -877,7 +877,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_rps.c igt_main · line 964
Quoted 6 lines
tests/i915/i915_pm_rps.c +3
-0@@ -959,4 +959,7 @@ igt_mainwaitboost (drm_fd, true);igt_disallow_hang (drm_fd, hang); } + +igt_fixture +drm_close_driver (drm_fd );
This is a fix.
Quoted 221 lines
tests/i915/i915_pm_rps.c +0
-0}tests/i915/i915_pm_sseu.c +1
-1@@ -315,7 +315,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@@ -76,6 +76,6 @@ igt_main } igt_fixture { -close (i915); +drm_close_driver (i915); } }tests/i915/i915_query.c +1
-1@@ -1465,6 +1465,6 @@ igt_mainquery_parse_and_validate_hwconfig_table (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/i915/i915_suspend.c +2
-2@@ -232,7 +232,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 );@@ -315,5 +315,5 @@ igt_maintest_forcewake (fd, true);igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/i915/kms_big_fb.c +1
-1@@ -1010,6 +1010,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@@ -506,6 +506,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {gpu_engines_restore_timeouts (fd, num_engines, saved_gpu_timeouts);igt_display_fini (&display); -close (display.drm_fd); +drm_close_driver (display.drm_fd); } }tests/i915/kms_ccs.c +1
-1@@ -708,6 +708,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@@ -257,6 +257,6 @@ igt_main 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@@ -1351,7 +1351,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 +0
-0
tests/i915/kms_mmap_write_crc.c igt_main_args("n", NULL, NULL, opt_handler, NULL) · line 309
Quoted 8 lines
tests/i915/kms_mmap_write_crc.c +1
-2@@ -303,9 +303,8 @@ 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); -close (data.drm_fd);
This is a fix.
Quoted 794 lines
tests/i915/kms_mmap_write_crc.c +0
-0} }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@@ -639,6 +639,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/i915/perf.c +2
-2@@ -5299,7 +5299,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 ;@@ -6008,6 +6008,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@@ -2111,7 +2111,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);@@ -2436,13 +2436,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@@ -105,6 +105,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_heartbeat_interval.c +1
-1@@ -514,6 +514,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_preempt_timeout.c +1
-1@@ -343,6 +343,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }tests/i915/sysfs_timeslice_duration.c +1
-1@@ -564,6 +564,6 @@ igt_main igt_fixture {close (engines); -close (i915); +drm_close_driver (i915); } }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@@ -795,7 +795,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); }@@ -874,6 +874,6 @@ igt_mainif (is_xe_device (fd))xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/kms_async_flips.c +1
-1@@ -668,6 +668,6 @@ igt_main_args("e", NULL, help_str, opt_handler, &data)igt_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@@ -1069,6 +1069,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@@ -1010,6 +1010,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@@ -1803,6 +1803,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_dp_tiled_display.c +1
-1@@ -502,6 +502,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_flip.c +1
-1@@ -1898,6 +1898,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@@ -60,7 +60,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)@@ -386,7 +386,7 @@ end: igt_fixture {drmModeFreeConnector (connector); -close (drm_fd); +drm_close_driver (drm_fd);reset_connectors (); }tests/kms_getfb.c +2
-2@@ -452,7 +452,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); } }@@ -484,6 +484,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@@ -433,6 +433,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@@ -1318,6 +1318,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@@ -1323,6 +1323,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@@ -178,7 +178,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 );@@ -206,7 +206,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);@@ -217,7 +217,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 );@@ -338,5 +338,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@@ -1279,6 +1279,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_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); } }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); } }tests/nouveau_crc.c +0
-0
tests/nouveau_crc.c igt_main · line 416
Quoted 10 lines
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); + }
This is a fix.
Quoted 609 lines
tests/nouveau_crc.c +0
-0}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); } }tests/prime_busy.c +1
-1@@ -162,6 +162,6 @@ igt_main igt_fixture {intel_ctx_destroy (fd, ctx); -close (fd); +drm_close_driver (fd); } }tests/prime_mmap.c +1
-1@@ -557,6 +557,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@@ -249,7 +249,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); }/* @@ -346,6 +346,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@@ -106,8 +106,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 )@@ -139,8 +139,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 )@@ -164,8 +164,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); }@@ -211,7 +211,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); }@@ -275,14 +275,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 ); }@@ -357,13 +357,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 ); }@@ -392,7 +392,7 @@ static void test_llseek_size(void)close (dma_buf_fd); } -close (fd); +drm_close_driver (fd); }static void test_llseek_bad (void )@@ -421,7 +421,7 @@ static void test_llseek_bad(void)close (dma_buf_fd); -close (fd); +drm_close_driver (fd); } igt_maintests/prime_vgem.c +2
-2@@ -1249,7 +1249,7 @@ igt_main igt_fixture { -close (i915); -close (vgem); +drm_close_driver (i915); +drm_close_driver (vgem); } }tests/syncobj_basic.c +1
-1@@ -232,7 +232,7 @@ igt_maintest_valid_cycle (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_timeline.c +1
-1@@ -1538,6 +1538,6 @@ igt_maintest_32bits_limit (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/syncobj_wait.c +1
-1@@ -914,6 +914,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/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/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); } }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 ); }tests/vgem_basic.c +3
-3@@ -64,8 +64,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)@@ -537,6 +537,6 @@ igt_maintest_debugfs_read (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }tests/vgem_slow.c +1
-1@@ -85,6 +85,6 @@ igt_maintest_nohang (fd); igt_fixture { -close (fd); +drm_close_driver (fd); } }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); } }tests/xe/xe_compute.c +0
-0
tests/xe/xe_compute.c igt_main · line 47
Quoted 3 lines
tests/xe/xe_compute.c +0
-0@@ -45,6 +45,6 @@ igt_main igt_fixture {xe_device_put (xe);
--------------- ^
You should remove this line as now it is done in drm_close_driver. The same change should be done for other Xe tests in tests/xe/
Regards,
Kamil
Quoted 454 lines
tests/xe/xe_compute.c +1
-1-close (xe); +drm_close_driver (xe); } }tests/xe/xe_create.c +1
-1@@ -102,6 +102,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }tests/xe/xe_debugfs.c +1
-1@@ -270,6 +270,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@@ -220,7 +220,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]); } }@@ -257,6 +257,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 {@@ -701,5 +701,5 @@ igt_main }igt_fixture -close (fd ); +drm_close_driver (fd ); }tests/xe/xe_exec_balancer.c +1
-1@@ -708,6 +708,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_exec_basic.c +1
-1@@ -353,6 +353,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_exec_compute_mode.c +1
-1@@ -361,6 +361,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_exec_fault_mode.c +1
-1@@ -570,6 +570,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_exec_reset.c +4
-4@@ -294,7 +294,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 ;@@ -475,7 +475,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 ;@@ -655,7 +655,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 ;@@ -946,6 +946,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); } }@@ -454,7 +454,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); } }@@ -698,7 +698,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); } }@@ -1403,6 +1403,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_guc_pc.c +1
-1@@ -496,6 +496,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@@ -1180,6 +1180,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@@ -77,6 +77,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_mmio.c +1
-1@@ -89,6 +89,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_module_load.c +1
-1@@ -86,7 +86,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@@ -441,6 +441,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@@ -122,9 +122,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); }/** @@ -202,9 +202,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); }@@ -259,10 +259,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)@@ -335,7 +335,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 */ @@ -343,7 +343,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 ); }@@ -429,7 +429,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 ;@@ -437,7 +437,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 ); }@@ -474,7 +474,7 @@ static void test_llseek_size(void) }xe_device_put (fd); -close (fd); +drm_close_driver (fd); }/** @@ -511,7 +511,7 @@ static void test_llseek_bad(void)close (dma_buf_fd);xe_device_put (fd); -close (fd); +drm_close_driver (fd); } igt_main@@ -544,6 +544,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_query.c +1
-1@@ -491,6 +491,6 @@ igt_main igt_fixture {xe_device_put (xe); -close (xe); +drm_close_driver (xe); } }tests/xe/xe_vm.c +1
-1@@ -1839,6 +1839,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }tests/xe/xe_waitfence.c +1
-1@@ -98,6 +98,6 @@ igt_main igt_fixture {xe_device_put (fd); -close (fd); +drm_close_driver (fd); } }Signature · 1 line
2.40.0
PATCH 6/6 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.
--- 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 | 8 ++------ tests/xe/xe_debugfs.c | 8 ++------ 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 | 6 +----- 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_vm.c | 5 +---- tests/xe/xe_waitfence.c | 8 ++------ 30 files changed, 40 insertions(+), 220 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
@@ -836,9 +836,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);
@@ -870,10 +867,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
@@ -1826,9 +1826,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); }
@@ -1894,10 +1891,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
@@ -399,9 +399,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 ;
@@ -449,9 +446,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); } }
@@ -463,9 +457,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
@@ -480,10 +471,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
@@ -35,16 +35,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 -6
@@ -91,17 +91,13 @@ 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); } - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }
tests/xe/xe_debugfs.c +2 -6
@@ -240,19 +240,17 @@ 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 ); } igt_subtest("base") { -test_base (fd, xe_dev->config); +test_base (fd,xe_config (fd)); }
@@ -268,8 +266,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
@@ -113,7 +113,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 ); }
@@ -218,11 +217,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
@@ -232,7 +228,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 ) {
@@ -255,8 +250,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); }
@@ -668,7 +664,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
@@ -626,10 +626,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)
@@ -706,8 +704,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
@@ -311,10 +311,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)
@@ -351,8 +349,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
@@ -327,10 +327,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)
@@ -359,8 +357,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
@@ -524,7 +524,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);igt_require (xe_supports_faults (fd)); }
@@ -568,8 +567,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
@@ -178,10 +178,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)
@@ -293,7 +291,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 );
@@ -388,10 +385,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;
@@ -474,7 +469,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 );
@@ -566,10 +560,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 );
@@ -654,7 +646,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 );
@@ -831,10 +822,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)
@@ -944,8 +933,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
@@ -282,7 +279,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; }
@@ -453,7 +449,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); } }
@@ -491,7 +486,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; }
@@ -696,10 +690,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 {
@@ -1391,18 +1383,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 +1 -5
@@ -120,16 +120,12 @@ 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") {gpgpu_fill (&data, fill_fn,0 ); } - igt_fixture { -xe_device_put (data.drm_fd); +igt_fixture buf_ops_destroy(data.bops); - } }
tests/xe/xe_guc_pc.c +0 -2
@@ -387,7 +387,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); sysfs =igt_sysfs_open (fd);igt_assert (sysfs !=-1 );
@@ -495,7 +494,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
@@ -1105,7 +1105,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" );
@@ -1178,7 +1177,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
@@ -61,10 +61,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));
@@ -75,8 +73,6 @@ igt_main igt_subtest("vram-system")test_mmap (fd,vram_memory (fd,0 ) |system_memory (fd)); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_mmio.c +2 -6
@@ -77,18 +77,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
@@ -370,8 +370,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 );
@@ -440,7 +438,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
@@ -104,9 +104,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 );
@@ -121,9 +119,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); }
@@ -185,9 +177,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);
@@ -201,9 +191,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);
@@ -222,9 +210,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 );
@@ -258,10 +244,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); }
@@ -314,7 +298,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 );
@@ -334,7 +317,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 ]);
@@ -406,13 +388,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++) {
@@ -428,7 +408,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 */
@@ -436,7 +415,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 );
@@ -458,7 +436,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;
@@ -473,7 +450,6 @@ static void test_llseek_size(void)close (dma_buf_fd); } -xe_device_put (fd);drm_close_driver (fd); }
@@ -493,7 +469,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);
@@ -510,7 +485,6 @@ static void test_llseek_bad(void)close (dma_buf_fd); -xe_device_put (fd);drm_close_driver (fd); }
@@ -534,7 +508,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); }for (i =0 ; i <ARRAY_SIZE (tests); i++) {
@@ -542,8 +515,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
@@ -457,10 +457,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);
@@ -489,8 +487,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_vm.c +1 -4
@@ -1621,7 +1621,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 ) {
@@ -1837,8 +1836,6 @@ igt_main } } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
tests/xe/xe_waitfence.c +2 -6
@@ -88,16 +88,12 @@ igt_main {int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("test")test (fd); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }
Signature · 1 line
2.40.0
Re: [igt-dev] [i-g-t 6/6] tests: Drop xe_device get/put from test level
Quoted 4 lines · Bhanuprakash Modem
As
xe_deviceget/put is already handled at driver open/close level, drop these checks from tests.Signed-off-by Bhanuprakash Modem <[email protected]>
Quoted 1,089 lines
--- 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 | 8 ++------ tests/xe/xe_debugfs.c | 8 ++------ 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 | 6 +----- 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_vm.c | 5 +---- tests/xe/xe_waitfence.c | 8 ++------ 30 files changed, 40 insertions(+), 220 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@@ -836,9 +836,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);@@ -870,10 +867,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@@ -1826,9 +1826,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); }@@ -1894,10 +1891,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@@ -399,9 +399,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 ;@@ -449,9 +446,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); } }@@ -463,9 +457,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@@ -480,10 +471,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@@ -35,16 +35,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
-6@@ -91,17 +91,13 @@ 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); } - igt_fixture { -xe_device_put (xe); +igt_fixture drm_close_driver (xe ); - } }tests/xe/xe_debugfs.c +2
-6@@ -240,19 +240,17 @@ 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 ); } igt_subtest("base") { -test_base (fd, xe_dev->config); +test_base (fd,xe_config (fd)); }@@ -268,8 +266,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@@ -113,7 +113,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 ); }@@ -218,11 +217,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@@ -232,7 +228,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 ) {@@ -255,8 +250,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); }@@ -668,7 +664,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@@ -626,10 +626,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)@@ -706,8 +704,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@@ -311,10 +311,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)@@ -351,8 +349,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@@ -327,10 +327,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)@@ -359,8 +357,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@@ -524,7 +524,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd);igt_require (xe_supports_faults (fd)); }@@ -568,8 +567,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@@ -178,10 +178,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)@@ -293,7 +291,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 );@@ -388,10 +385,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;@@ -474,7 +469,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 );@@ -566,10 +560,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 );@@ -654,7 +646,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 );@@ -831,10 +822,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)@@ -944,8 +933,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@@ -282,7 +279,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; }@@ -453,7 +449,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); } }@@ -491,7 +486,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; }@@ -696,10 +690,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 {@@ -1391,18 +1383,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 +1
-5@@ -120,16 +120,12 @@ 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") {gpgpu_fill (&data, fill_fn,0 ); } - igt_fixture { -xe_device_put (data.drm_fd); +igt_fixture buf_ops_destroy(data.bops); - } }tests/xe/xe_guc_pc.c +0
-2@@ -387,7 +387,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); sysfs =igt_sysfs_open (fd);igt_assert (sysfs !=-1 );@@ -495,7 +494,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@@ -1105,7 +1105,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" );@@ -1178,7 +1177,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@@ -61,10 +61,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));@@ -75,8 +73,6 @@ igt_main igt_subtest("vram-system")test_mmap (fd,vram_memory (fd,0 ) |system_memory (fd)); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }tests/xe/xe_mmio.c +2
-6@@ -77,18 +77,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@@ -370,8 +370,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 );@@ -440,7 +438,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@@ -104,9 +104,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 );@@ -121,9 +119,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); }@@ -185,9 +177,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);@@ -201,9 +191,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);@@ -222,9 +210,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 );@@ -258,10 +244,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); }@@ -314,7 +298,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 );@@ -334,7 +317,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 ]);@@ -406,13 +388,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++) {@@ -428,7 +408,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 */ @@ -436,7 +415,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 );@@ -458,7 +436,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;@@ -473,7 +450,6 @@ static void test_llseek_size(void)close (dma_buf_fd); } -xe_device_put (fd);drm_close_driver (fd); }@@ -493,7 +469,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);@@ -510,7 +485,6 @@ static void test_llseek_bad(void)close (dma_buf_fd); -xe_device_put (fd);drm_close_driver (fd); }@@ -534,7 +508,6 @@ igt_main igt_fixture { fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); }for (i =0 ; i <ARRAY_SIZE (tests); i++) {@@ -542,8 +515,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@@ -457,10 +457,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);@@ -489,8 +487,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_vm.c +1
-4@@ -1621,7 +1621,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 ) {@@ -1837,8 +1836,6 @@ igt_main } } - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }tests/xe/xe_waitfence.c +2
-6@@ -88,16 +88,12 @@ igt_main {int fd; - igt_fixture { +igt_fixture fd =drm_open_driver (DRIVER_XE ); -xe_device_get (fd); - } igt_subtest("test")test (fd); - igt_fixture { -xe_device_put (fd); +igt_fixture drm_close_driver (fd ); - } }