Igt-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Mauro Carvalho Chehab <mauro.chehab@linux.intel.com>
To: Jani Nikula <jani.nikula@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, Petri Latvala <petri.latvala@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v4 04/77] i915/gem_linear_blits: Close device before exit
Date: Wed, 5 Oct 2022 18:53:50 +0200	[thread overview]
Message-ID: <20221005185350.01011527@maurocar-mobl2> (raw)
In-Reply-To: <87wn9eqqju.fsf@intel.com>

On Wed, 05 Oct 2022 17:43:33 +0300
Jani Nikula <jani.nikula@linux.intel.com> wrote:

> On Wed, 05 Oct 2022, Mauro Carvalho Chehab <mauro.chehab@linux.intel.com> wrote:
> > On Wed, 05 Oct 2022 14:09:18 +0300
> > Jani Nikula <jani.nikula@linux.intel.com> wrote:
> >  
> >> On Wed, 05 Oct 2022, Mauro Carvalho Chehab <mauro.chehab@linux.intel.com> wrote:  
> >> > From: Chris Wilson <chris.p.wilson@intel.com>
> >> >
> >> > Close the device fd before we check for leaks during the atexit
> >> > handlers.
> >> >
> >> > Signed-off-by: Chris Wilson <chris.p.wilson@intel.com>
> >> > Reviewed-by: Andrzej Hajda <andrzej.hajda@intel.com>
> >> > Reviewed-by: Nirmoy Das<nirmoy.das@intel.com>
> >> > Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
> >> > ---
> >> >  tests/i915/gem_linear_blits.c | 3 ++-
> >> >  1 file changed, 2 insertions(+), 1 deletion(-)
> >> >
> >> > diff --git a/tests/i915/gem_linear_blits.c b/tests/i915/gem_linear_blits.c
> >> > index 1fd5b733c3ce..d02751be9232 100644
> >> > --- a/tests/i915/gem_linear_blits.c
> >> > +++ b/tests/i915/gem_linear_blits.c
> >> > @@ -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_main
> >> >  	const 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.
> >> 
> >> 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.  
> 
> 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.

> 
> > 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

  parent reply	other threads:[~2022-10-05 16:54 UTC|newest]

Thread overview: 83+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-05  7:44 [igt-dev] [PATCH i-g-t v4 00/77] Ensure that file descriptors will be closed on exit Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 01/77] lib: Introduce typed cleanups Mauro Carvalho Chehab
     [not found]   ` <Yz1WCjOSxGBbtEyt@kamilkon-desk1>
2022-10-05 10:22     ` Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 02/77] i915/gem_basic: Close device before exit Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 03/77] i915/gem_flink_basic: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 04/77] i915/gem_linear_blits: " Mauro Carvalho Chehab
     [not found]   ` <8735c2sf1d.fsf@intel.com>
2022-10-05 13:13     ` Mauro Carvalho Chehab
     [not found]       ` <87wn9eqqju.fsf@intel.com>
2022-10-05 16:53         ` Mauro Carvalho Chehab [this message]
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 05/77] i915/gem_blits: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 06/77] i915/gem_close: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 07/77] i915/gem_create: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 08/77] i915/gem_ctx_engines: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 09/77] i915/gem_ctx_shared: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 10/77] i915/gem_exec_alignment: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 11/77] i915/gem_render_copy: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 12/77] i915/gem_render_copy_redux: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 13/77] i915/gem_media_fill: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 14/77] i915/gem_userptr_blits: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 15/77] i915/gem_workarounds: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 16/77] i915/gem_unref_active_buffers: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 17/77] i915/gem_exec_endless: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 18/77] i915/gem_request_retire: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 19/77] i915/gem_unfence_active_buffers: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 20/77] i915/i915_pciid: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 21/77] kms_cursor_legacy: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 22/77] kms_flip: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 23/77] kms_pipe_crc_basic: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 24/77] kms_psr: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 25/77] kms_flip: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 26/77] kms_force_connector_basic: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 27/77] dumb_buffer: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 28/77] kms_atomic: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 29/77] kms_atomic_interruptible: " Mauro Carvalho Chehab
2022-10-05  7:44 ` [igt-dev] [PATCH i-g-t v4 30/77] kms_atomic_transition: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 31/77] i915/kms_big_fb: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 32/77] i915/kms_ccs: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 33/77] kms_color: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 34/77] kms_cursor_crc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 35/77] i915/kms_big_joiner: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 36/77] i915/kms_cdclk: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 37/77] i915/kms_fence_pin_leak: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 38/77] i915/kms_flip_scaled_crc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 39/77] i915/kms_flip_tiling: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 40/77] i915/kms_mmap_write_crc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 41/77] i915/kms_pipe_b_c_ivb: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 42/77] i915/kms_psr2_sf: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 43/77] i915/kms_psr2_su: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 44/77] i915/kms_pwrite_crc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 45/77] kms_flip_event_leak: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 46/77] kms_hdr: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 47/77] kms_invalid_mode: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 48/77] kms_panel_fitting: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 49/77] kms_plane: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 50/77] kms_plane_alpha_blend: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 51/77] kms_plane_cursor: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 52/77] kms_plane_multiple: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 53/77] kms_plane_scaling: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 54/77] kms_properties: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 55/77] kms_rotation_crc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 56/77] kms_sequence: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 57/77] kms_universal_plane: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 58/77] kms_vblank: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 59/77] syncobj_wait: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 60/77] syncobj_basic: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 61/77] syncobj_timeline: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 62/77] drm_import_export: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 63/77] kms_dp_aux_dev: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 64/77] kms_hdmi_inject: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 65/77] kms_3d: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 66/77] kms_scaling_modes: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 67/77] kms_dither: " Mauro Carvalho Chehab
2022-10-05  8:44   ` Kamil Konieczny
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 68/77] drm_read: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 69/77] kms_cursor_edge_walk: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 70/77] kms_plane_lowres: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 71/77] kms_content_protection: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 72/77] feature_discovery: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 73/77] i915/i915_pm_dc: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 74/77] core_auth: Close(master) " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 75/77] i915/gem_exec_balancer: Close device " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 76/77] i915/gem_ctx_isolation: " Mauro Carvalho Chehab
2022-10-05  7:45 ` [igt-dev] [PATCH i-g-t v4 77/77] igt_core: add a line break at the end of some internal_assert Mauro Carvalho Chehab
2022-10-05  8:42   ` Kamil Konieczny

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221005185350.01011527@maurocar-mobl2 \
    --to=mauro.chehab@linux.intel.com \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=jani.nikula@linux.intel.com \
    --cc=petri.latvala@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox