All of lore.kernel.org
 help / color / mirror / Atom feed
From: Andi Shyti <andi.shyti@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org,
	Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Subject: Re: [igt-dev] [PATCH i-g-t v2] tests/i915/gem_ctx_switch: Update with engine discovery
Date: Fri, 28 Jun 2019 14:17:59 +0300	[thread overview]
Message-ID: <20190628111759.GA4284@intel.intel> (raw)
In-Reply-To: <86d9e921-1bdc-83de-7e09-90a090c70896@linux.intel.com>

> > > +gem_eb_flags_to_engine(unsigned int flags)
> > > +{
> > > +	const struct intel_execution_engine2 *e2;
> > > +
> > > +	__for_each_static_engine(e2) {
> > > +		if (e2->flags == flags)
> > > +			return e2;
> > > +	}
> > > +
> > > +	return NULL;
> > > +}
> > 
> > the amount of "helpers" is getting almost unbearable for a simple
> > mind like mine.
> > 
> > This means that we can get rid of
> > 
> >   gem_execbuf_flags_to_engine_class
> >   gem_ring_is_physical_engine
> >   gem_ring_has_physical_engine
> > 
> > in igt_gt.c, right?
> 
> If/when there are no callers left we can like everything. I dont' know if
> that is the case right now.

No, not yet, but this replaces the logical meaning of the
function above... but... there is still lots of legacy involved :(

> > > +	return param.size;
> > 
> > a small nitpick: bool to me means '0' or '1'.
> > 
> > So, if you do 'return param.size', I would call the function
> > gem_context_get_param_size, otherwise I would return
> > '!!param.size' and keep it bool.
> 
> Some people would then complain !! was not needed. ~o~
> 
> And actually I think I want to remove the distinction of no map and map with
> no engines for the callers of this helpers. So returning size would not work
> for that.
> 
> > (We are also somehow abusing on the size definition of bool in
> > C99/C17 or previous.)
> > 
> > I'm not asking you to change it, but it would make me happier :)
> 
> I don't understand the issue with size definition. Size is u32 - will not
> implicit conversion to bool just work?

This is fine, it's just some philosophical thinking that for me
bool should be true false.

-----------------
(If we want to be purists, this would rather be

	return param.size ? true : false;

which basically changes nothing, but sticks to the meaining of
"bool" and it would be to much anyway)

> > > -		q = ARRAY_SIZE(ctx) * timeout * 1e9 / igt_nsec_elapsed(&tv) / 8 + 1;
> > > +		q = ARRAY_SIZE(ctx) * timeout * 1e9 / igt_nsec_elapsed(&tv) /
> > > +		    8 + 1;
> > 
> > I don't know whether it's me who is paranoic, but the change
> > above doesn't match the commit log.
> 
> What do you mean:
> 
> """
> Also beware of drive-by formatting changes.
> """
> 
> ;)
> 
> File to many lines falling of 80 char so I tidied it alongside.

I'm not saying that this change is wrong, just that it's
out of the context of the patch and it should lay in a different
change (I'm not very strong in this case, though, but I've seen
such cases too many times in this list).

> > The rest of the patch I trust you it works :)
> > (however the devotion to whatever is legacy doesn't leave me with
> > a good taste after all the work done)
> > 
> > You can add my Reviewed-by: Andi Shyti <andi.shyti@intel.com>
> > 
> > Thanks, this patch clarifies a few more things as well,
> 
> Thanks!

Thank you,
Andi
_______________________________________________
igt-dev mailing list
igt-dev@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/igt-dev

WARNING: multiple messages have this Message-ID (diff)
From: Andi Shyti <andi.shyti@intel.com>
To: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
Cc: igt-dev@lists.freedesktop.org, Intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH i-g-t v2] tests/i915/gem_ctx_switch: Update with engine discovery
Date: Fri, 28 Jun 2019 14:17:59 +0300	[thread overview]
Message-ID: <20190628111759.GA4284@intel.intel> (raw)
In-Reply-To: <86d9e921-1bdc-83de-7e09-90a090c70896@linux.intel.com>

> > > +gem_eb_flags_to_engine(unsigned int flags)
> > > +{
> > > +	const struct intel_execution_engine2 *e2;
> > > +
> > > +	__for_each_static_engine(e2) {
> > > +		if (e2->flags == flags)
> > > +			return e2;
> > > +	}
> > > +
> > > +	return NULL;
> > > +}
> > 
> > the amount of "helpers" is getting almost unbearable for a simple
> > mind like mine.
> > 
> > This means that we can get rid of
> > 
> >   gem_execbuf_flags_to_engine_class
> >   gem_ring_is_physical_engine
> >   gem_ring_has_physical_engine
> > 
> > in igt_gt.c, right?
> 
> If/when there are no callers left we can like everything. I dont' know if
> that is the case right now.

No, not yet, but this replaces the logical meaning of the
function above... but... there is still lots of legacy involved :(

> > > +	return param.size;
> > 
> > a small nitpick: bool to me means '0' or '1'.
> > 
> > So, if you do 'return param.size', I would call the function
> > gem_context_get_param_size, otherwise I would return
> > '!!param.size' and keep it bool.
> 
> Some people would then complain !! was not needed. ~o~
> 
> And actually I think I want to remove the distinction of no map and map with
> no engines for the callers of this helpers. So returning size would not work
> for that.
> 
> > (We are also somehow abusing on the size definition of bool in
> > C99/C17 or previous.)
> > 
> > I'm not asking you to change it, but it would make me happier :)
> 
> I don't understand the issue with size definition. Size is u32 - will not
> implicit conversion to bool just work?

This is fine, it's just some philosophical thinking that for me
bool should be true false.

-----------------
(If we want to be purists, this would rather be

	return param.size ? true : false;

which basically changes nothing, but sticks to the meaining of
"bool" and it would be to much anyway)

> > > -		q = ARRAY_SIZE(ctx) * timeout * 1e9 / igt_nsec_elapsed(&tv) / 8 + 1;
> > > +		q = ARRAY_SIZE(ctx) * timeout * 1e9 / igt_nsec_elapsed(&tv) /
> > > +		    8 + 1;
> > 
> > I don't know whether it's me who is paranoic, but the change
> > above doesn't match the commit log.
> 
> What do you mean:
> 
> """
> Also beware of drive-by formatting changes.
> """
> 
> ;)
> 
> File to many lines falling of 80 char so I tidied it alongside.

I'm not saying that this change is wrong, just that it's
out of the context of the patch and it should lay in a different
change (I'm not very strong in this case, though, but I've seen
such cases too many times in this list).

> > The rest of the patch I trust you it works :)
> > (however the devotion to whatever is legacy doesn't leave me with
> > a good taste after all the work done)
> > 
> > You can add my Reviewed-by: Andi Shyti <andi.shyti@intel.com>
> > 
> > Thanks, this patch clarifies a few more things as well,
> 
> Thanks!

Thank you,
Andi
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

  reply	other threads:[~2019-06-28 11:17 UTC|newest]

Thread overview: 26+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 10:20 [igt-dev] [PATCH i-g-t] tests/i915/gem_ctx_switch: Update with engine discovery Tvrtko Ursulin
2019-06-27 10:20 ` Tvrtko Ursulin
2019-06-27 10:35 ` [Intel-gfx] " Chris Wilson
2019-06-27 10:35   ` Chris Wilson
2019-06-27 10:55   ` [igt-dev] " Tvrtko Ursulin
2019-06-27 10:55     ` Tvrtko Ursulin
2019-06-27 11:05     ` [igt-dev] " Chris Wilson
2019-06-27 11:05       ` Chris Wilson
2019-06-27 10:53 ` [igt-dev] [PATCH i-g-t v2] " Tvrtko Ursulin
2019-06-27 10:53   ` Tvrtko Ursulin
2019-06-27 20:15   ` [igt-dev] " Andi Shyti
2019-06-27 20:15     ` Andi Shyti
2019-06-27 20:24     ` [igt-dev] " Chris Wilson
2019-06-27 20:24       ` Chris Wilson
2019-06-28  5:39     ` [igt-dev] " Tvrtko Ursulin
2019-06-28  5:39       ` Tvrtko Ursulin
2019-06-28 11:17       ` Andi Shyti [this message]
2019-06-28 11:17         ` Andi Shyti
2019-06-27 11:01 ` [igt-dev] ✓ Fi.CI.BAT: success for " Patchwork
2019-06-27 12:00 ` [igt-dev] ✓ Fi.CI.BAT: success for tests/i915/gem_ctx_switch: Update with engine discovery (rev2) Patchwork
2019-06-28 10:06 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_ctx_switch: Update with engine discovery Patchwork
2019-06-28 10:16 ` [igt-dev] ✓ Fi.CI.IGT: success for tests/i915/gem_ctx_switch: Update with engine discovery (rev2) Patchwork
2019-06-29 14:11 ` [igt-dev] [PATCH i-g-t] tests/i915/gem_ctx_switch: Update with engine discovery Chris Wilson
2019-06-29 14:11   ` Chris Wilson
2019-07-02 10:43 ` [igt-dev] " Chris Wilson
2019-07-02 10:43   ` Chris Wilson

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=20190628111759.GA4284@intel.intel \
    --to=andi.shyti@intel.com \
    --cc=Intel-gfx@lists.freedesktop.org \
    --cc=igt-dev@lists.freedesktop.org \
    --cc=tvrtko.ursulin@intel.com \
    --cc=tvrtko.ursulin@linux.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.