All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
To: Chris Wilson <chris@chris-wilson.co.uk>, intel-gfx@lists.freedesktop.org
Subject: Re: [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available
Date: Wed, 21 Feb 2018 12:25:55 +0000	[thread overview]
Message-ID: <eae61b84-1239-3249-dc04-a801da769d23@linux.intel.com> (raw)
In-Reply-To: <20180221112151.7244-1-chris@chris-wilson.co.uk>


On 21/02/2018 11:21, Chris Wilson wrote:
> How much do I want this uABI to rot away? Say "Never again!" to implicit
> aliasing.
> 
> In the meantime, we do not need to perform duplicate work on bsd2
> machines, as especially we do not know which engine bsd relates to.
> 
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
> ---
>   lib/ioctl_wrappers.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/lib/ioctl_wrappers.c b/lib/ioctl_wrappers.c
> index 8748cfcf..868d68f7 100644
> --- a/lib/ioctl_wrappers.c
> +++ b/lib/ioctl_wrappers.c
> @@ -1460,7 +1460,7 @@ bool gem_has_ring(int fd, unsigned ring)
>   
>   	/* silly ABI, the kernel thinks everyone who has BSD also has BSD2 */
>   	if ((ring & ~(3<<13)) == I915_EXEC_BSD) {

What is this testing for? Why not just ring & i915_EXEC_RING_MASK == 
I915_EXEC_BSD? It there are some other bits set it will behave strangely.

> -		if (ring & (3 << 13) && !gem_has_bsd2(fd))

Disallow explicit selection if no vcs2, makes sense.

> +		if (!(ring & (3 << 13)) ^ gem_has_bsd2(fd))

Ugh..

If default BSD (1)
	and no BSD2 -> 1 ^ 0 = 1 OK
	and BSD2 -> 1 ^ 1 = 1 BAD

If explicit BSD (0)
	and no BSD2 -> 0 ^ 0 = 0 BAD
	has BSD2 -> 0 ^ 1 = 1 = OK

Or I made a mistake, its possible..

Regards,

Tvrtko

>   			return false;
>   	}
>   
> 

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

  parent reply	other threads:[~2018-02-21 12:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-02-21 11:21 [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available Chris Wilson
2018-02-21 12:17 ` [PATCH igt v2] " Chris Wilson
2018-02-21 12:53   ` Tvrtko Ursulin
2018-02-21 12:55     ` Tvrtko Ursulin
2018-02-21 13:07       ` Chris Wilson
2018-02-21 13:35         ` Tvrtko Ursulin
2018-02-21 13:42           ` Chris Wilson
2018-02-21 13:42           ` Tvrtko Ursulin
2018-02-21 13:45             ` Chris Wilson
2018-02-21 12:25 ` Tvrtko Ursulin [this message]
2018-02-21 12:29   ` [PATCH igt] " Chris Wilson
2018-02-21 18:33 ` ✗ Fi.CI.BAT: warning for lib: Skip aliased bsd ABI ring if bsd2 is available (rev2) Patchwork

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=eae61b84-1239-3249-dc04-a801da769d23@linux.intel.com \
    --to=tvrtko.ursulin@linux.intel.com \
    --cc=chris@chris-wilson.co.uk \
    --cc=intel-gfx@lists.freedesktop.org \
    /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.