Ensure that file descriptors will be closed on exit
Subsystems (2)
v4 cover Ensure that file descriptors will be closed on exit
From: Mauro Carvalho Chehab <[email protected]>
GCC is usually smart enough to close devices on exit, but that doesn't work with the logic inside igt_skip(), as it uses longjmp, causing the code to go out of scope. Such scoped variables must be tracked in an outer scope to the skipping subtest.
Change the logic on IGT tests in order to avoid keeping device opened at the end of the test.
---
v4:
- added descriptions to the new tests added on patch 01/76
- added R-B and A-B on several patches;
- added a patch at the end, fixing some error messages with internal_assert()
Chris Wilson (76):
lib: Introduce typed cleanups
i915/gem_basic: Close device before exit i915/gem_flink_basic: Close device before exit i915/gem_linear_blits: Close device before exit i915/gem_blits: Close device before exit i915/gem_close: Close device before exit i915/gem_create: Close device before exit i915/gem_ctx_engines: Close device before exit i915/gem_ctx_shared: Close device before exit i915/gem_exec_alignment: Close device before exit i915/gem_render_copy: Close device before exit i915/gem_render_copy_redux: Close device before exit i915/gem_media_fill: Close device before exit i915/gem_userptr_blits: Close device before exit i915/gem_workarounds: Close device before exit i915/gem_unref_active_buffers: Close device before exit i915/gem_exec_endless: Close device before exit i915/gem_request_retire: Close device before exit i915/gem_unfence_active_buffers: Close device before exit i915/i915_pciid: Close device before exit
kms_cursor_legacy: Close device before exit
kms_flip: Close device before exit
kms_pipe_crc_basic: Close device before exit
kms_psr: Close device before exit
kms_flip: Close device before exit
kms_force_connector_basic: Close device before exit
dumb_buffer: Close device before exit
kms_atomic: Close device before exit
kms_atomic_interruptible: Close device before exit
kms_atomic_transition: Close device before exit i915/kms_big_fb: Close device before exit i915/kms_ccs: Close device before exit
kms_color: Close device before exit
kms_cursor_crc: Close device before exit i915/kms_big_joiner: Close device before exit i915/kms_cdclk: Close device before exit i915/kms_fence_pin_leak: Close device before exit i915/kms_flip_scaled_crc: Close device before exit i915/kms_flip_tiling: Close device before exit i915/kms_mmap_write_crc: Close device before exit i915/kms_pipe_b_c_ivb: Close device before exit i915/kms_psr2_sf: Close device before exit i915/kms_psr2_su: Close device before exit i915/kms_pwrite_crc: Close device before exit
kms_flip_event_leak: Close device before exit
kms_hdr: Close device before exit
kms_invalid_mode: Close device before exit
kms_panel_fitting: Close device before exit
kms_plane: Close device before exit
kms_plane_alpha_blend: Close device before exit
kms_plane_cursor: Close device before exit
kms_plane_multiple: Close device before exit
kms_plane_scaling: Close device before exit
kms_properties: Close device before exit
kms_rotation_crc: Close device before exit
kms_sequence: Close device before exit
kms_universal_plane: Close device before exit
kms_vblank: Close device before exit
syncobj_wait: Close device before exit
syncobj_basic: Close device before exit
syncobj_timeline: Close device before exit
drm_import_export: Close device before exit
kms_dp_aux_dev: Close device before exit
kms_hdmi_inject: Close device before exit
kms_3d: Close device before exit
kms_scaling_modes: Close device before exit
kms_dither: Close device before exit
drm_read: Close device before exit
kms_cursor_edge_walk: Close device before exit
kms_plane_lowres: Close device before exit
kms_content_protection: Close device before exit
feature_discovery: Close device before exit i915/i915_pm_dc: Close device before exit
core_auth: Close(master) before exit i915/gem_exec_balancer: Close device before exit i915/gem_ctx_isolation: Close device before exit
Mauro Carvalho Chehab (1):
igt_core: add a line break at the end of some internal_assert
lib/igt_core.c | 10 +- lib/igt_core.h | 2 + lib/igt_types.c | 17 +++ lib/igt_types.h | 47 ++++++++ lib/meson.build | 1 + lib/tests/bad_subtest_type.c | 23 ++++ lib/tests/igt_types.c | 153 ++++++++++++++++++++++++ lib/tests/meson.build | 2 + tests/core_auth.c | 8 +- tests/drm_import_export.c | 5 + tests/drm_read.c | 4 +- tests/dumb_buffer.c | 4 + tests/feature_discovery.c | 5 +- tests/i915/gem_basic.c | 8 +- tests/i915/gem_blits.c | 1 + tests/i915/gem_close.c | 3 +- tests/i915/gem_create.c | 3 +- tests/i915/gem_ctx_engines.c | 3 +- tests/i915/gem_ctx_isolation.c | 3 +- tests/i915/gem_ctx_shared.c | 3 +- tests/i915/gem_exec_alignment.c | 3 +- tests/i915/gem_exec_balancer.c | 3 +- tests/i915/gem_exec_endless.c | 3 +- tests/i915/gem_flink_basic.c | 11 +- tests/i915/gem_linear_blits.c | 3 +- tests/i915/gem_media_fill.c | 1 + tests/i915/gem_render_copy.c | 1 + tests/i915/gem_render_copy_redux.c | 4 + tests/i915/gem_request_retire.c | 5 +- tests/i915/gem_unfence_active_buffers.c | 1 + tests/i915/gem_unref_active_buffers.c | 1 + tests/i915/gem_userptr_blits.c | 4 +- tests/i915/gem_workarounds.c | 3 +- tests/i915/i915_pciid.c | 2 + tests/i915/i915_pm_dc.c | 1 + tests/i915/kms_big_fb.c | 1 + tests/i915/kms_big_joiner.c | 1 + tests/i915/kms_busy.c | 1 + tests/i915/kms_ccs.c | 4 +- tests/i915/kms_cdclk.c | 1 + tests/i915/kms_fence_pin_leak.c | 1 + tests/i915/kms_flip_scaled_crc.c | 1 + tests/i915/kms_flip_tiling.c | 1 + tests/i915/kms_mmap_write_crc.c | 1 + tests/i915/kms_pipe_b_c_ivb.c | 1 + tests/i915/kms_psr.c | 1 + tests/i915/kms_psr2_sf.c | 1 + tests/i915/kms_psr2_su.c | 1 + tests/i915/kms_pwrite_crc.c | 1 + tests/kms_3d.c | 1 + tests/kms_atomic.c | 1 + tests/kms_atomic_interruptible.c | 1 + tests/kms_atomic_transition.c | 1 + tests/kms_color.c | 1 + tests/kms_content_protection.c | 1 + tests/kms_cursor_crc.c | 1 + tests/kms_cursor_edge_walk.c | 4 +- tests/kms_cursor_legacy.c | 1 + tests/kms_dither.c | 1 + tests/kms_dp_aux_dev.c | 1 + tests/kms_flip.c | 3 + tests/kms_flip_event_leak.c | 1 + tests/kms_force_connector_basic.c | 7 +- tests/kms_hdmi_inject.c | 1 + tests/kms_hdr.c | 1 + tests/kms_invalid_mode.c | 1 + tests/kms_panel_fitting.c | 4 +- tests/kms_pipe_crc_basic.c | 1 + tests/kms_plane.c | 1 + tests/kms_plane_alpha_blend.c | 1 + tests/kms_plane_cursor.c | 1 + tests/kms_plane_lowres.c | 4 +- tests/kms_plane_multiple.c | 4 +- tests/kms_plane_scaling.c | 4 +- tests/kms_properties.c | 1 + tests/kms_rotation_crc.c | 1 + tests/kms_scaling_modes.c | 4 +- tests/kms_sequence.c | 4 + tests/kms_universal_plane.c | 1 + tests/kms_vblank.c | 4 + tests/syncobj_basic.c | 4 + tests/syncobj_timeline.c | 4 + tests/syncobj_wait.c | 4 + 83 files changed, 408 insertions(+), 35 deletions(-) create mode 100644 lib/igt_types.c create mode 100644 lib/igt_types.h create mode 100644 lib/tests/bad_subtest_type.c create mode 100644 lib/tests/igt_types.c
Signature · 1 line
2.37.3
PATCH v4 1/77 lib: Introduce typed cleanups
From: Chris Wilson <[email protected]>
Start introducing standard types with automatic cleanup courtesy of gcc's __attribute__((cleanup)). As an example, we start with an fd that will automatically call close() on going out of scope, and crucially before atexit where we will want to check for resource leaks.
--- lib/igt_core.c | 6 ++ lib/igt_core.h | 2 + lib/igt_types.c | 17 ++++ lib/igt_types.h | 47 +++++++++++ lib/meson.build | 1 + lib/tests/bad_subtest_type.c | 23 ++++++ lib/tests/igt_types.c | 153 +++++++++++++++++++++++++++++++++++ lib/tests/meson.build | 2 + 8 files changed, 251 insertions(+) create mode 100644 lib/igt_types.c create mode 100644 lib/igt_types.h create mode 100644 lib/tests/bad_subtest_type.c create mode 100644 lib/tests/igt_types.c
lib/igt_core.c +6 -0
@@ -624,6 +624,12 @@ uint64_t igt_nsec_elapsed(struct timespec *start) (uint64_t)NSEC_PER_SEC*(now.tv_sec - start->tv_sec)); } +void __igt_assert_in_outer_scope (void ) +{ +internal_assert (!in_subtest, +"must only be called outside of a subtest" ); +} +bool __igt_fixture (void ) { internal_assert(!in_fixture,
lib/igt_core.h +2 -0
@@ -135,6 +135,8 @@ struct _GKeyFile *igt_load_igtrc(void);*/ #define IGT_EXIT_ABORT 112 +void __igt_assert_in_outer_scope (void ); +bool __igt_fixture (void );void __igt_fixture_complete (void );__noreturn void __igt_fixture_end (void );
lib/igt_types.c new file +17 -0
@@ -0,0 +1,17 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2022 Intel Corporation +*/ + +#include <unistd.h> + +#include "igt_types.h" + +void igt_cleanup_fd (volatile int *fd) +{ +if (!fd || *fd <0 ) +return ; + +close (*fd); + *fd =-1 ; +}
lib/igt_types.h new file +47 -0
47 lines not on this page · raw message
lib/meson.build +1 -0
@@ -38,6 +38,7 @@ lib_sources = [ 'igt_sysrq.c', 'igt_taints.c', 'igt_thread.c', + 'igt_types.c', 'igt_vec.c', 'igt_vgem.c', 'igt_x86.c',
lib/tests/bad_subtest_type.c new file +23 -0
@@ -0,0 +1,23 @@ +// SPDX-License-Identifier: MIT +/* +* Copyright © 2022 Intel Corporation +*/ + +#include "igt_core.h" +#include "igt_types.h" + +IGT_TEST_DESCRIPTION ("Test bad-scoped file descriptor variable" ); + +igt_main +{ +igt_describe ("Check if using a scoped variable inside a subtest will abort it" ); + igt_subtest("bad-scoped-variable") { +/* +* Not allowed to nest a scoped variable inside a subtest as +* we expect to longjmp out of the subtest on failure/skip +* and automatic cleanup is not invoked for such jmps. +* So, this test is expected to fail with SIGABRT. +*/ +igt_fd_t (f); + } +}
lib/tests/igt_types.c new file +153 -0
153 lines not on this page · raw message
lib/tests/meson.build +2 -0
@@ -19,10 +19,12 @@ lib_tests = [ 'igt_stats', 'igt_subtest_group', 'igt_thread', + 'igt_types', 'i915_perf_data_alignment', ] lib_fail_tests = [ + 'bad_subtest_type', 'igt_no_subtest', 'igt_simple_test_subtests', 'igt_timeout',
Signature · 1 line
2.37.3
A message that is not in the archive (sent off-list or not yet received): Yz1WCjOSxGBbtEyt@kamilkon-desk1
Re: [igt-dev] [PATCH i-g-t v4 01/77] lib: Introduce typed cleanups
Quoted 25 lines · On Wed, 5 Oct 2022 12:01:46 +0200 Kamil Konieczny…
Hi Mauro,
Quoted 1 line · Mauro Carvalho Chehab
From: Chris Wilson <[email protected]>
imho here should be added "why" part, consider adding something like following (re-worded from cover letter):
We close devices on exit but that doesn't work when inside
igt_subtest_groupis usedigt_skip(), as it uses longjmp, causing the code to go out of scope and missclose().Quoted 13 lines
Start introducing standard types with automatic cleanup courtesy of gcc's __attribute__((cleanup)). As an example, we start with an fd that will automatically call
close()on going out of scope, and crucially before atexit where we will want to check for resource leaks.[mchehab: add test descriptions]Suggested-by Andrzej Hajda <[email protected]>Signed-off-by Chris Wilson <[email protected]>Cc Andrzej Hajda <[email protected]>Reviewed-by Petri Latvala <[email protected]>Acked-by Nirmoy Das <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>
Makes sense. Changing it to:
lib: Introduce typed cleanups
We close devices on exit but that doesn't work when inside igt_subtest_group is used igt_skip(), as it uses longjmp, causing the code to go out of scope and miss close().
Start introducing standard types with automatic cleanup courtesy of gcc's __attribute__((cleanup)). This also works with clang, when using volatile integers.
As an example, we start with an fd that will automatically call close() on going out of scope, and crucially before atexit where we will want to check for resource leaks.
Regards,
Mauro
PATCH v4 2/77 i915/gem_basic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_basic.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
tests/i915/gem_basic.c +5 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdio.h>
@@ -37,7 +36,10 @@#include <sys/ioctl.h> #include "drm.h" +#include "i915/gem_create.h" +#include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Tests basic gem_create and gem_close IOCTLs" );
@@ -78,10 +80,10 @@ test_create_fd_close(int fd)close (fd); } -int fd; - igt_main { +igt_fd_t (fd); +igt_fixture fd =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 3/77 i915/gem_flink_basic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_flink_basic.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-)
tests/i915/gem_flink_basic.c +8 -3
@@ -25,7 +25,6 @@* */ -#include "igt.h" #include <stdlib.h> #include <stdio.h> #include <string.h>
@@ -34,8 +33,12 @@#include <errno.h> #include <sys/stat.h> #include <sys/ioctl.h> +#include "drm.h" +#include "igt.h" +#include "igt_types.h" +IGT_TEST_DESCRIPTION ("Tests for flink - a way to export a gem object by name" ); static void
@@ -152,12 +155,14 @@ test_flink_lifetime(int fd) ret =ioctl (fd2,DRM_IOCTL_GEM_OPEN , &open_struct);igt_assert_eq (ret,0 );igt_assert (open_struct.handle !=0 ); -} -int fd; +close (fd2); +} igt_main { +igt_fd_t (fd); +igt_fixture fd =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 4/77 i915/gem_linear_blits: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_linear_blits.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_linear_blits.c +2 -1
@@ -47,6 +47,7 @@#include "i915/gem.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Test doing many blits with a working set larger than the" " aperture size." );
@@ -236,7 +237,7 @@ igt_mainconst int ncpus =sysconf (_SC_NPROCESSORS_ONLN);uint64_t count =0 ;bool do_relocs; -int fd =-1 ; +igt_fd_t (fd); igt_fixture { fd =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [igt-dev] [PATCH i-g-t v4 04/77] i915/gem_linear_blits: Close device before exit
Quoted 37 lines · On Wed, 05 Oct 2022 14:09:18 +0300 Jani Nikula <[email protected]>…
Quoted 26 lines · Mauro Carvalho Chehab
From: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
Signed-off-by Chris Wilson <[email protected]>Reviewed-by Andrzej Hajda <[email protected]>Reviewed-by Nirmoy Das<[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>--- tests/i915/gem_linear_blits.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/i915/gem_linear_blits.c +1
-0@@ -47,6 +47,7 @@#include "i915/gem.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Test doing many blits with a working set larger than the" " aperture size." );tests/i915/gem_linear_blits.c igt_main · line 240
Quoted 5 lines
tests/i915/gem_linear_blits.c +1
-1@@ -236,7 +237,7 @@ igt_mainconst int ncpus =sysconf (_SC_NPROCESSORS_ONLN);uint64_t count =0 ;bool do_relocs; -int fd =-1 ; +igt_fd_t (fd);I guess igt has long since stopped being written in C, and started being written in an "igt dialect" of its own... but the constructs still kind of resemble C.
Quoted 2 lines
This doesn't. It looks like a function call but isn't. Looks odd that it's among the declarations... but it is a declaration.
True, but this is not different than what we have already at the Linux Kernel with things like DECLARE_BITMAP():
struct fsubdev {
struct work_struct fw_work;
struct work_struct pm_work;
struct delayed_work ue_work;
struct work_struct rescan_work;
struct fdev *fdev;
char __iomem *csr_base;
int irq;
bool fw_running;
DECLARE_BITMAP(errors, NUM_SD_ERRORS);
struct mbdb *mbdb;...
and other similar variable declaration macros.
Maybe we could name it at patch 01/77 to:
#define DECLARE_IGT_FD(x__) \ volatile int x__ cleanup_with(igt_cleanup_fd) = IGT_OUTER_SCOPE_INIT(-1)
in order to be more like the Kernel.
In a matter of fact, C is just a nicer and more portable way to work macro-assembler... :-p
Regards,
Mauro
A message that is not in the archive (sent off-list or not yet received): [email protected]
Re: [igt-dev] [PATCH i-g-t v4 04/77] i915/gem_linear_blits: Close device before exit
Quoted 69 lines · On Wed, 05 Oct 2022 17:43:33 +0300 Jani Nikula <[email protected]>…
Quoted 68 lines · Mauro Carvalho Chehab
Quoted 37 lines · On Wed, 05 Oct 2022 14:09:18 +0300 Jani Nikula <[email protected]>…
Quoted 26 lines · Mauro Carvalho Chehab
From: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
Signed-off-by Chris Wilson <[email protected]>Reviewed-by Andrzej Hajda <[email protected]>Reviewed-by Nirmoy Das<[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>--- tests/i915/gem_linear_blits.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)tests/i915/gem_linear_blits.c +1
-0@@ -47,6 +47,7 @@#include "i915/gem.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Test doing many blits with a working set larger than the" " aperture size." );tests/i915/gem_linear_blits.c igt_main · line 240
Quoted 5 lines
tests/i915/gem_linear_blits.c +1
-1@@ -236,7 +237,7 @@ igt_mainconst int ncpus =sysconf (_SC_NPROCESSORS_ONLN);uint64_t count =0 ;bool do_relocs; -int fd =-1 ; +igt_fd_t (fd);I guess igt has long since stopped being written in C, and started being written in an "igt dialect" of its own... but the constructs still kind of resemble C.
Quoted 2 lines
This doesn't. It looks like a function call but isn't. Looks odd that it's among the declarations... but it is a declaration.
True, but this is not different than what we have already at the Linux Kernel with things like
DECLARE_BITMAP():struct fsubdev { struct work_struct fw_work; struct work_struct pm_work; struct delayed_work ue_work; struct work_struct rescan_work; struct fdev *fdev; char __iomem *csr_base; int irq; bool fw_running; DECLARE_BITMAP(errors, NUM_SD_ERRORS); struct mbdb *mbdb;...
and other similar variable declaration macros.
Maybe we could name it at patch 01/77 to:
#define DECLARE_IGT_FD(x__) \ volatile int x__ cleanup_with(igt_cleanup_fd) = IGT_OUTER_SCOPE_INIT(-1)
Quoted 6 lines
Quoted 1 line
in order to be more like the Kernel.
Yeah, maybe "declare" in the name would be helpful.
I was just making an observation, really, and I'll defer the decisions to Petri here.
As Petri reviewed patch 1, which added the macro, and all patches were reviewed, I'm applying the series.
It should be easy to replace "igt_fd_t" to "DECLARE_IGT_FD" or with something else in the future, if we think it would make it better.
Quoted 5 lines
Quoted 3 lines
In a matter of fact, C is just a nicer and more portable way to work macro-assembler... :-p
Macros really are a blessing and a curse here...
Agreed.
Regards,
Mauro
PATCH v4 5/77 i915/gem_blits: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_blits.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/gem_blits.c +1 -0
@@ -852,5 +852,6 @@ igt_main igt_fixture {put_ahnd (device.ahnd); +close (device.fd); } }
Signature · 1 line
2.37.3
PATCH v4 6/77 i915/gem_close: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_close.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_close.c +2 -1
@@ -24,6 +24,7 @@#include "i915/gem.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" static int batch_create (int fd) {
@@ -125,7 +126,7 @@ static void test_many_handles(int fd)igt_main { -int fd =-1 ; +igt_fd_t (fd ); igt_fixture {/* Create an flink requires DRM_AUTH */
Signature · 1 line
2.37.3
PATCH v4 7/77 i915/gem_create: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_create.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_create.c +2 -1
@@ -54,6 +54,7 @@#include "intel_chipset.h" #include "igt_aux.h" #include "igt_dummyload.h" +#include "igt_types.h" #include "igt_x86.h" #include "i915/gem.h" #include "i915/gem_create.h"
@@ -828,7 +829,7 @@ static void create_ext_cpu_access_big(int fd)igt_main { -int fd =-1 ; +igt_fd_t (fd ); igt_fixture { fd =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 8/77 i915/gem_ctx_engines: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_ctx_engines.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_ctx_engines.c +2 -1
@@ -41,6 +41,7 @@#include "i915/gem_context.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" #include "sw_sync.h" #define engine_class (e, n) ((e)->engines[(n)].engine_class)
@@ -593,7 +594,7 @@ static void independent_all(int i915, const intel_ctx_t *ctx) igt_main {const struct intel_execution_engine2 *e; -int i915 =-1 ; +igt_fd_t (i915); igt_fixture { i915 =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 9/77 i915/gem_ctx_shared: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_ctx_shared.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_ctx_shared.c +2 -1
@@ -42,6 +42,7 @@#include "i915/gem_engine_topology.h" #include "i915/gem_vm.h" #include "igt.h" +#include "igt_types.h" #include "igt_rand.h" #include "igt_vgem.h" #include "sw_sync.h"
@@ -987,7 +988,7 @@ igt_main {const struct intel_execution_engine2 *e;intel_ctx_cfg_t cfg; -int i915 =-1 ; +igt_fd_t (i915); igt_fixture { i915 =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 10/77 i915/gem_exec_alignment: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_exec_alignment.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_exec_alignment.c +2 -1
@@ -44,6 +44,7 @@#include "i915/gem.h" #include "i915/gem_create.h" #include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Exercises the basic execbuffer using object alignments" );
@@ -525,7 +526,7 @@ static void single(int fd)igt_main { -int fd =-1 ; +igt_fd_t (fd ); igt_fixture { fd =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 11/77 i915/gem_render_copy: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_render_copy.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/gem_render_copy.c +1 -0
@@ -879,5 +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); } }
Signature · 1 line
2.37.3
PATCH v4 12/77 i915/gem_render_copy_redux: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_render_copy_redux.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/i915/gem_render_copy_redux.c +4 -0
@@ -233,4 +233,8 @@ igt_maincopy_flink (&data);igt_stop_signal_helper (); } + + igt_fixture { +data_fini (&data); + } }
Signature · 1 line
2.37.3
PATCH v4 13/77 i915/gem_media_fill: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_media_fill.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/gem_media_fill.c +1 -0
@@ -173,5 +173,6 @@ igt_main igt_fixture {igt_collection_destroy (set);igt_stop_hang_detector (); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 14/77 i915/gem_userptr_blits: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_userptr_blits.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/i915/gem_userptr_blits.c +3 -1
@@ -62,6 +62,7 @@#include "i915/gem_create.h" #include "igt.h" #include "igt_sysfs.h" +#include "igt_types.h" #include "sw_sync.h" #include "eviction_common.c"
@@ -2299,7 +2300,7 @@ static void test_userfault(int i915)uint64_t total_ram;uint64_t aperture_size; -int fd, count; +int count;static int opt_handler (int opt,int opt_index,void *data) {
@@ -2319,6 +2320,7 @@ const char *help_str = " -c\tBuffer count\n"; igt_main_args("c:", NULL, help_str, opt_handler, NULL) {int size =sizeof (linear); +igt_fd_t (fd); igt_fixture {unsigned int mmo_max =0 ;
Signature · 1 line
2.37.3
PATCH v4 15/77 i915/gem_workarounds: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_workarounds.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_workarounds.c +2 -1
@@ -31,6 +31,7 @@#include "i915/gem_create.h" #include "igt.h" #include "igt_device.h" +#include "igt_types.h" #define PAGE_SIZE 4096#define PAGE_ALIGN (x) ALIGN(x, PAGE_SIZE)
@@ -238,7 +239,6 @@ static void check_workarounds(int fd, enum operation op, unsigned int flags) igt_main {struct intel_mmio_data mmio_data; -int device =-1 ; const struct { const char *name; enum operation op;
@@ -258,6 +258,7 @@ igt_main { "-fd", FD }, { } }, *m; +igt_fd_t (device); igt_fixture {FILE *file;
Signature · 1 line
2.37.3
PATCH v4 16/77 i915/gem_unref_active_buffers: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_unref_active_buffers.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/gem_unref_active_buffers.c +1 -0
@@ -121,4 +121,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); +close (i915); }
Signature · 1 line
2.37.3
PATCH v4 17/77 i915/gem_exec_endless: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_exec_endless.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_exec_endless.c +2 -1
@@ -28,6 +28,7 @@#include "igt.h" #include "igt_device.h" #include "igt_sysfs.h" +#include "igt_types.h" #include "sw_sync.h" #define MAX_ENGINES 64
@@ -341,7 +342,7 @@ static void unpin_rps(int sysfs) igt_main {const struct intel_execution_engine2 *e; -int i915 =-1 ; +igt_fd_t (i915);igt_skip_on_simulation ();
Signature · 1 line
2.37.3
PATCH v4 18/77 i915/gem_request_retire: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_request_retire.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/i915/gem_request_retire.c +3 -2
@@ -48,6 +48,7 @@#include "i915/gem.h" #include "igt.h" +#include "igt_types.h" IGT_TEST_DESCRIPTION ("Collection of tests targeting request retirement code" " paths." );
@@ -103,10 +104,10 @@ test_retire_vma_not_inactive(int fd)put_ahnd (ahnd); } -int fd; -igt_main { +igt_fd_t (fd ); + igt_fixture { fd =drm_open_driver (DRIVER_INTEL );igt_require_gem (fd);
Signature · 1 line
2.37.3
PATCH v4 19/77 i915/gem_unfence_active_buffers: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_unfence_active_buffers.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/gem_unfence_active_buffers.c +1 -0
@@ -99,4 +99,5 @@ igt_simple_mainigt_spin_free (i915, spin);put_ahnd (ahnd); +close (i915); }
Signature · 1 line
2.37.3
PATCH v4 20/77 i915/i915_pciid: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/i915_pciid.c | 2 ++ 1 file changed, 2 insertions(+)
tests/i915/i915_pciid.c +2 -0
@@ -64,4 +64,6 @@ igt_simple_mainint intel =drm_open_driver (DRIVER_INTEL );igt_assert (has_known_intel_chipset (intel)); + +close (intel); }
Signature · 1 line
2.37.3
PATCH v4 21/77 kms_cursor_legacy: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_cursor_legacy.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_cursor_legacy.c +1 -0
@@ -1753,5 +1753,6 @@ igt_mainif (intel_psr2_restore)i915_psr2_sel_fetch_restore (display.drm_fd);igt_display_fini (&display); +close (display.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 22/77 kms_flip: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_flip.c | 3 +++ 1 file changed, 3 insertions(+)
tests/kms_flip.c +3 -0
@@ -1877,4 +1877,7 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL)run_pair (tests[i].duration, tests[i].flags); }igt_stop_signal_helper (); + +igt_fixture +close (drm_fd ); }
Signature · 1 line
2.37.3
PATCH v4 23/77 kms_pipe_crc_basic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_pipe_crc_basic.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_pipe_crc_basic.c +1 -0
@@ -362,5 +362,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 24/77 kms_psr: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_psr.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_psr.c +1 -0
@@ -592,5 +592,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); } }
Signature · 1 line
2.37.3
PATCH v4 25/77 kms_flip: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_busy.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_busy.c +1 -0
@@ -436,5 +436,6 @@ igt_main_args("e", NULL, help_str, opt_handler, NULL) igt_fixture {igt_display_fini (&display); +close (display.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 26/77 kms_force_connector_basic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_force_connector_basic.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
tests/kms_force_connector_basic.c +6 -1
@@ -33,9 +33,9 @@ IGT_TEST_DESCRIPTION("Check the debugfs force connector/edid features work"static void reset_connectors (void ) { -int drm_fd =0 ;drmModeRes *res;drmModeConnector *connector =NULL ; +int drm_fd; drm_fd =drm_open_driver_master (DRIVER_ANY ); res =drmModeGetResources (drm_fd);
@@ -54,6 +54,8 @@ static void reset_connectors(void) }igt_set_module_param_int (drm_fd,"load_detect_test" ,0 ); + +close (drm_fd); }static int opt_handler (int opt,int opt_index,void *data)
@@ -224,6 +226,9 @@ igt_main_args("", long_opts, help_str, opt_handler, NULL)drmModeFreePlane (drm_plane); } + +igt_remove_fb (drm_fd, &xrgb_fb); +igt_remove_fb (drm_fd, &argb_fb); }igt_describe ("Test to check the forced connector state." );
Signature · 1 line
2.37.3
PATCH v4 27/77 dumb_buffer: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/dumb_buffer.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/dumb_buffer.c +4 -0
@@ -392,4 +392,8 @@ igt_main igt_subtest("create-clear")always_clear (fd,30 ); + + igt_fixture { +close (fd); + } }
Signature · 1 line
2.37.3
PATCH v4 28/77 kms_atomic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_atomic.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_atomic.c +1 -0
@@ -1436,5 +1436,6 @@ igt_mainigt_remove_fb (display.drm_fd, &fb);igt_display_fini (&display); +close (display.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 29/77 kms_atomic_interruptible: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_atomic_interruptible.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_atomic_interruptible.c +1 -0
@@ -349,5 +349,6 @@ igt_main/* TODO: legacy gamma_set/get, object set/getprop, getcrtc, getconnector */ igt_fixture {igt_display_fini (&display); +close (display.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 30/77 kms_atomic_transition: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_atomic_transition.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_atomic_transition.c +1 -0
@@ -1132,5 +1132,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 31/77 i915/kms_big_fb: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_big_fb.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_big_fb.c +1 -0
@@ -982,5 +982,6 @@ igt_main igt_fixture {igt_display_fini (&data.display);buf_ops_destroy (data.bops); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 32/77 i915/kms_ccs: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_ccs.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/i915/kms_ccs.c +3 -1
@@ -699,6 +699,8 @@ igt_main_args("cs:", NULL, help_str, opt_handler, &data) } } - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 33/77 kms_color: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_color.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_color.c +1 -0
@@ -1058,5 +1058,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 34/77 kms_cursor_crc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_cursor_crc.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_cursor_crc.c +1 -0
@@ -913,5 +913,6 @@ igt_main }igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 35/77 i915/kms_big_joiner: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_big_joiner.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_big_joiner.c +1 -0
@@ -328,5 +328,6 @@ igt_main igt_fixture {igt_remove_fb (data.drm_fd, &data.fb);igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 36/77 i915/kms_cdclk: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_cdclk.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_cdclk.c +1 -0
@@ -373,5 +373,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 37/77 i915/kms_fence_pin_leak: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_fence_pin_leak.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_fence_pin_leak.c +1 -0
@@ -229,4 +229,5 @@ igt_simple_mainbuf_ops_destroy (data.bops);igt_display_fini (&data.display); +close (data.drm_fd); }
Signature · 1 line
2.37.3
PATCH v4 38/77 i915/kms_flip_scaled_crc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_flip_scaled_crc.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_flip_scaled_crc.c +1 -0
@@ -676,5 +676,6 @@ igt_main }kmstest_set_vt_text_mode ();igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 39/77 i915/kms_flip_tiling: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_flip_tiling.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_flip_tiling.c +1 -0
@@ -229,5 +229,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 40/77 i915/kms_mmap_write_crc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_mmap_write_crc.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_mmap_write_crc.c +1 -0
@@ -299,5 +299,6 @@ igt_main_args("n", NULL, NULL, opt_handler, NULL)close (data.drm_fd);igt_stop_helper (&hog); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 41/77 i915/kms_pipe_b_c_ivb: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_pipe_b_c_ivb.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_pipe_b_c_ivb.c +1 -0
@@ -291,5 +291,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 42/77 i915/kms_psr2_sf: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_psr2_sf.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_psr2_sf.c +1 -0
@@ -1034,5 +1034,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 43/77 i915/kms_psr2_su: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_psr2_su.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_psr2_su.c +1 -0
@@ -335,5 +335,6 @@ igt_main igt_fixture {close (data.debugfs_fd);display_fini (&data); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 44/77 i915/kms_pwrite_crc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/kms_pwrite_crc.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/kms_pwrite_crc.c +1 -0
@@ -191,4 +191,5 @@ igt_simple_mainrun_test (&data);igt_display_fini (&data.display); +close (data.drm_fd); }
Signature · 1 line
2.37.3
PATCH v4 45/77 kms_flip_event_leak: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_flip_event_leak.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_flip_event_leak.c +1 -0
@@ -115,5 +115,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 46/77 kms_hdr: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_hdr.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_hdr.c +1 -0
@@ -615,5 +615,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.fd); } }
Signature · 1 line
2.37.3
PATCH v4 47/77 kms_invalid_mode: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_invalid_mode.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_invalid_mode.c +1 -0
@@ -306,5 +306,6 @@ igt_main igt_fixture {igt_display_fini (&data.display);igt_reset_connectors (); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 48/77 kms_panel_fitting: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_panel_fitting.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_panel_fitting.c +3 -1
@@ -280,6 +280,8 @@ igt_main igt_subtest_with_dynamic("atomic-fastset")test_panel_fitting (&data,TEST_ATOMIC ); - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 49/77 kms_plane: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_plane.c +1 -0
@@ -1213,5 +1213,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 50/77 kms_plane_alpha_blend: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane_alpha_blend.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_plane_alpha_blend.c +1 -0
@@ -648,5 +648,6 @@ igt_main COMMIT_ATOMIC : COMMIT_LEGACY);igt_display_fini (&data.display); +close (data.gfx_fd); } }
Signature · 1 line
2.37.3
PATCH v4 51/77 kms_plane_cursor: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane_cursor.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_plane_cursor.c +1 -0
@@ -309,5 +309,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 52/77 kms_plane_multiple: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane_multiple.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_plane_multiple.c +3 -1
@@ -468,6 +468,8 @@ igt_main_args("", long_options, help_str, opt_handler, NULL)run_test (&data, subtests[i].modifier); } - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 53/77 kms_plane_scaling: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane_scaling.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_plane_scaling.c +3 -1
@@ -983,6 +983,8 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_subtest_f("2x-scaler-multi-pipe")test_scaler_with_multi_pipe_plane (&data); - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 54/77 kms_properties: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_properties.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_properties.c +1 -0
@@ -792,5 +792,6 @@ igt_main igt_fixture {igt_display_fini (&display); +close (display.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 55/77 kms_rotation_crc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_rotation_crc.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_rotation_crc.c +1 -0
@@ -1248,5 +1248,6 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) igt_fixture {igt_display_fini (&data.display); +close (data.gfx_fd); } }
Signature · 1 line
2.37.3
PATCH v4 56/77 kms_sequence: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_sequence.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/kms_sequence.c +4 -0
@@ -295,4 +295,8 @@ igt_main } } } + + igt_fixture { +close (fd); + } }
Signature · 1 line
2.37.3
PATCH v4 57/77 kms_universal_plane: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_universal_plane.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_universal_plane.c +1 -0
@@ -823,5 +823,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 58/77 kms_vblank: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_vblank.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/kms_vblank.c +4 -0
@@ -550,4 +550,8 @@ igt_mainfor_each_pipe_static (data.pipe) igt_subtest_grouprun_subtests_for_pipe (&data); + + igt_fixture { +close (fd); + } }
Signature · 1 line
2.37.3
PATCH v4 59/77 syncobj_wait: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/syncobj_wait.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/syncobj_wait.c +4 -0
@@ -912,4 +912,8 @@ igt_main igt_subtest("wait-all-interrupted")test_wait_interrupted (fd,WAIT_ALL ); + + igt_fixture { +close (fd); + } }
Signature · 1 line
2.37.3
PATCH v4 60/77 syncobj_basic: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/syncobj_basic.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/syncobj_basic.c +4 -0
@@ -231,4 +231,8 @@ igt_main igt_subtest("test-valid-cycle")test_valid_cycle (fd); + igt_fixture { +close (fd); + } + }
Signature · 1 line
2.37.3
PATCH v4 61/77 syncobj_timeline: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/syncobj_timeline.c | 4 ++++ 1 file changed, 4 insertions(+)
tests/syncobj_timeline.c +4 -0
@@ -1536,4 +1536,8 @@ igt_mainigt_describe (test_32bits_limit_desc); igt_subtest("32bits-limit")test_32bits_limit (fd); + + igt_fixture { +close (fd); + } }
Signature · 1 line
2.37.3
PATCH v4 62/77 drm_import_export: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/drm_import_export.c | 5 +++++ 1 file changed, 5 insertions(+)
tests/drm_import_export.c +5 -0
@@ -296,4 +296,9 @@ igt_main {pthread_join (test_thread_id3,NULL );pthread_join (test_thread_id4,NULL ); } + + igt_fixture { +close (fd); +close (fd1); + } }
Signature · 1 line
2.37.3
PATCH v4 63/77 kms_dp_aux_dev: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_dp_aux_dev.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_dp_aux_dev.c +1 -0
@@ -134,4 +134,5 @@ igt_simple_mainigt_require (valid_connectors);drmModeFreeResources (res); +close (drm_fd); }
Signature · 1 line
2.37.3
PATCH v4 64/77 kms_hdmi_inject: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_hdmi_inject.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_hdmi_inject.c +1 -0
@@ -219,5 +219,6 @@ igt_main igt_fixture {drmModeFreeConnector (connector); +close (drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 65/77 kms_3d: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_3d.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_3d.c +1 -0
@@ -111,4 +111,5 @@ igt_simple_mainkmstest_force_edid (drm_fd, connector,NULL );drmModeFreeConnector (connector); +close (drm_fd); }
Signature · 1 line
2.37.3
PATCH v4 66/77 kms_scaling_modes: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_scaling_modes.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_scaling_modes.c +3 -1
@@ -132,6 +132,8 @@ igt_main igt_subtest_with_dynamic("scaling-mode-none")test_scaling_mode (&data,DRM_MODE_SCALE_NONE ); - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 67/77 kms_dither: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_dither.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_dither.c +1 -0
@@ -247,5 +247,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
Re: [igt-dev] [PATCH i-g-t v4 67/77] kms_dither: Close device before exit
Quoted 7 lines · Mauro Carvalho Chehab
From: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
Signed-off-by Chris Wilson <[email protected]>Signed-off-by Mauro Carvalho Chehab <[email protected]>
Quoted 18 lines
--- tests/kms_dither.c | 1 + 1 file changed, 1 insertion(+)tests/kms_dither.c +1
-0@@ -247,5 +247,6 @@ igt_main igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); } }Signature · 1 line
2.37.3
PATCH v4 68/77 drm_read: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/drm_read.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/drm_read.c +3 -1
@@ -46,6 +46,8 @@#include <pthread.h> #include "drm.h" +#include "igt_types.h" +IGT_TEST_DESCRIPTION ("Call read(drm) and see if it behaves." );static void sighandler (int sig,siginfo_t * info,void *context)
@@ -253,10 +255,10 @@ static void test_short_buffer_wakeup(int in, enum pipe pipe) igt_main { -int fd;igt_display_t display;struct igt_fb fb;enum pipe pipe; +igt_fd_t (fd); igt_fixture {struct sigaction alarm_action = {};
Signature · 1 line
2.37.3
PATCH v4 69/77 kms_cursor_edge_walk: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_cursor_edge_walk.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_cursor_edge_walk.c +3 -1
@@ -362,6 +362,8 @@ igt_main_args("", long_opts, help_str, opt_handler, &data) } } - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 70/77 kms_plane_lowres: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_plane_lowres.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
tests/kms_plane_lowres.c +3 -1
@@ -334,6 +334,8 @@ igt_mainrun_test (&data, subtests[i].modifier); } - igt_fixture + igt_fixture {igt_display_fini (&data.display); +close (data.drm_fd); + } }
Signature · 1 line
2.37.3
PATCH v4 71/77 kms_content_protection: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/kms_content_protection.c | 1 + 1 file changed, 1 insertion(+)
tests/kms_content_protection.c +1 -0
@@ -839,5 +839,6 @@ igt_main igt_fixture {test_content_protection_cleanup ();igt_display_fini (&data.display); +close (data.drm_fd); } }
Signature · 1 line
2.37.3
PATCH v4 72/77 feature_discovery: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/feature_discovery.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-)
tests/feature_discovery.c +3 -2
@@ -29,15 +29,16 @@#include "igt_kms.h" #include "igt_psr.h" #include "igt_sysfs.h" +#include "igt_types.h" -static int fd; -static int debugfs_fd;static igt_display_t display;IGT_TEST_DESCRIPTION ("A metatest that checks for \"features\" presence. " "The subtests here should only skip or pass, " "anything else means we have a serious problem." ); igt_main { +igt_fd_t (debugfs_fd ); +igt_fd_t (fd); igt_fixture { fd =drm_open_driver_master (DRIVER_ANY );
Signature · 1 line
2.37.3
PATCH v4 73/77 i915/i915_pm_dc: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/i915_pm_dc.c | 1 + 1 file changed, 1 insertion(+)
tests/i915/i915_pm_dc.c +1 -0
@@ -573,6 +573,7 @@ igt_mainclose (data.debugfs_fd);close (data.msr_fd);display_fini (&data); +close (data.drm_fd); }igt_exit ();
Signature · 1 line
2.37.3
PATCH v4 74/77 core_auth: Close(master) before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Add a missing close(master) to the subtest group fixture to prevent a leak during later tests.
--- tests/core_auth.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-)
tests/core_auth.c +5 -3
@@ -25,7 +25,6 @@* Testcase: drmGetMagic() and drmAuthMagic() */ -#include "igt.h" #include <unistd.h> #include <stdlib.h> #include <stdint.h>
@@ -48,6 +47,9 @@# include <pthread.h> #endif +#include "igt.h" +#include "igt_types.h" +IGT_TEST_DESCRIPTION ("Call drmGetMagic() and drmAuthMagic() and see if it behaves." ); static bool
@@ -192,8 +194,6 @@ static void test_basic_auth(int master) igt_main { -int master; -/* root (which we run igt as) should always be authenticated */ igt_describe ("Check drm client is always authenticated." ); igt_subtest("getclient-simple") {
@@ -220,6 +220,8 @@ igt_main/* above tests require that no drm fd is open */ igt_subtest_group { +igt_fd_t (master); +igt_fixture master =drm_open_driver_master (DRIVER_ANY );
Signature · 1 line
2.37.3
PATCH v4 75/77 i915/gem_exec_balancer: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_exec_balancer.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_exec_balancer.c +2 -1
@@ -35,6 +35,7 @@#include "igt_gt.h" #include "igt_perf.h" #include "igt_sysfs.h" +#include "igt_types.h" #include "sw_sync.h" IGT_TEST_DESCRIPTION ("Exercise in-kernel load-balancing" );
@@ -3302,7 +3303,7 @@ static bool has_parallel_execbuf(int i915)igt_main { -int i915 =-1 ; +igt_fd_t (i915 ); igt_fixture { i915 =drm_open_driver (DRIVER_INTEL );
Signature · 1 line
2.37.3
PATCH v4 76/77 i915/gem_ctx_isolation: Close device before exit
In reply to Mauro Carvalho ChehabFrom: Chris Wilson <[email protected]>
Close the device fd before we check for leaks during the atexit handlers.
--- tests/i915/gem_ctx_isolation.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
tests/i915/gem_ctx_isolation.c +2 -1
@@ -25,6 +25,7 @@#include "i915/gem_create.h" #include "igt.h" #include "igt_dummyload.h" +#include "igt_types.h" #define MAX_REG 0x200000#define NUM_REGS (MAX_REG / sizeof(uint32_t))
@@ -979,7 +980,7 @@ igt_mainunsigned int has_context_isolation =0 ;const struct intel_execution_engine2 *e;intel_ctx_cfg_t cfg; -int i915 =-1 ; +igt_fd_t (i915); igt_fixture {int gen;
Signature · 1 line
2.37.3
PATCH v4 77/77 igt_core: add a line break at the end of some internal_assert
In reply to Mauro Carvalho ChehabFrom: Mauro Carvalho Chehab <[email protected]>
The logic which prints internal_assert expects a line break, as otherwise it would print things like:
must only be called outside of a subtestplease refer to lib/igt_core documentation
So, add a \n on a couple of places that it is missing it.
--- lib/igt_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/igt_core.c +3 -3
@@ -627,7 +627,7 @@ uint64_t igt_nsec_elapsed(struct timespec *start)void __igt_assert_in_outer_scope (void ) {internal_assert (!in_subtest, -"must only be called outside of a subtest" ); +"must only be called outside of a subtest\n" ); }bool __igt_fixture (void )
@@ -1688,7 +1688,7 @@ void igt_fail(int exitcode)exit_subtest ("FAIL" ); }else {internal_assert (igt_can_fail (),"failing test is only allowed" -" in fixtures, subtests and igt_simple_main" ); +" in fixtures, subtests and igt_simple_main\n" );if (in_fixture) { skip_subtests_henceforth =FAIL ;
@@ -1755,7 +1755,7 @@ void igt_describe_f(const char *fmt, ...)internal_assert (!in_subtest || _igt_dynamic_tests_executed <0 ,"documenting dynamic subsubtests is impossible," -" document the subtest instead." ); +" document the subtest instead.\n" );if (!describe_subtests)return ;
Signature · 1 line
2.37.3
Re: [igt-dev] [PATCH i-g-t v4 77/77] igt_core: add a line break at the end of some internal_assert
Quoted 10 lines · Mauro Carvalho Chehab
From: Mauro Carvalho Chehab <[email protected]>
The logic which prints
internal_assertexpects a line break, as otherwise it would print things like:must only be called outside of a subtestplease refer to
lib/igt_coredocumentationSo, add a \n on a couple of places that it is missing it.
Signed-off-by Mauro Carvalho Chehab <[email protected]>
Quoted 38 lines
--- lib/igt_core.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)lib/igt_core.c +3
-3@@ -627,7 +627,7 @@ uint64_t igt_nsec_elapsed(struct timespec *start)void __igt_assert_in_outer_scope (void ) {internal_assert (!in_subtest, -"must only be called outside of a subtest" ); +"must only be called outside of a subtest\n" ); }bool __igt_fixture (void )@@ -1688,7 +1688,7 @@ void igt_fail(int exitcode)exit_subtest ("FAIL" ); }else {internal_assert (igt_can_fail (),"failing test is only allowed" -" in fixtures, subtests and igt_simple_main" ); +" in fixtures, subtests and igt_simple_main\n" );if (in_fixture) { skip_subtests_henceforth =FAIL ;@@ -1755,7 +1755,7 @@ void igt_describe_f(const char *fmt, ...)internal_assert (!in_subtest || _igt_dynamic_tests_executed <0 ,"documenting dynamic subsubtests is impossible," -" document the subtest instead." ); +" document the subtest instead.\n" );if (!describe_subtests)return ;Signature · 1 line
2.37.3