All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available
@ 2018-02-21 11:21 Chris Wilson
  2018-02-21 12:17 ` [PATCH igt v2] " Chris Wilson
                   ` (2 more replies)
  0 siblings, 3 replies; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 11:21 UTC (permalink / raw)
  To: intel-gfx

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) {
-		if (ring & (3 << 13) && !gem_has_bsd2(fd))
+		if (!(ring & (3 << 13)) ^ gem_has_bsd2(fd))
 			return false;
 	}
 
-- 
2.16.1

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 11:21 [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available Chris Wilson
@ 2018-02-21 12:17 ` Chris Wilson
  2018-02-21 12:53   ` Tvrtko Ursulin
  2018-02-21 12:25 ` [PATCH igt] " Tvrtko Ursulin
  2018-02-21 18:33 ` ✗ Fi.CI.BAT: warning for lib: Skip aliased bsd ABI ring if bsd2 is available (rev2) Patchwork
  2 siblings, 1 reply; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 12:17 UTC (permalink / raw)
  To: intel-gfx

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.

v2: When in doubt, shout!

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..b9b86079 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) {
-		if (ring & (3 << 13) && !gem_has_bsd2(fd))
+		if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
 			return false;
 	}
 
-- 
2.16.1

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

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available
  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:25 ` Tvrtko Ursulin
  2018-02-21 12:29   ` Chris Wilson
  2018-02-21 18:33 ` ✗ Fi.CI.BAT: warning for lib: Skip aliased bsd ABI ring if bsd2 is available (rev2) Patchwork
  2 siblings, 1 reply; 12+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 12:25 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 12:25 ` [PATCH igt] " Tvrtko Ursulin
@ 2018-02-21 12:29   ` Chris Wilson
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 12:29 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-02-21 12:25:55)
> 
> 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.

What other bits? :) (Note EXEC_RING_MASK has the wrong value in the
headers.)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 12:17 ` [PATCH igt v2] " Chris Wilson
@ 2018-02-21 12:53   ` Tvrtko Ursulin
  2018-02-21 12:55     ` Tvrtko Ursulin
  0 siblings, 1 reply; 12+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 12:53 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/02/2018 12:17, 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.
> 
> v2: When in doubt, shout!
> 
> 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..b9b86079 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) {
> -		if (ring & (3 << 13) && !gem_has_bsd2(fd))
> +		if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
>   			return false;
>   	}

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

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

Maybe I'm confused.. please simplify the statement? :)

Regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 12:53   ` Tvrtko Ursulin
@ 2018-02-21 12:55     ` Tvrtko Ursulin
  2018-02-21 13:07       ` Chris Wilson
  0 siblings, 1 reply; 12+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 12:55 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/02/2018 12:53, Tvrtko Ursulin wrote:
> 
> On 21/02/2018 12:17, 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.
>>
>> v2: When in doubt, shout!
>>
>> 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..b9b86079 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) {
>> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
>> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
>>               return false;
>>       }
> 
> If default BSD (1)
>      and no BSD2 -> 1 ^ 1 = 1 OK

Oops
1 ^ 1 = 0 so also bad

>      and BSD2 -> 1 ^ 0 = 1 BAD
> 
> If explicit BSD (0)
>      and no BSD2 -> 0 ^ 1 = 1 BAD
>      has BSD2 -> 0 ^ 0 = 0 = BAD
> 
> Maybe I'm confused.. please simplify the statement? :)
> 
> Regards,
> 
> Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 12:55     ` Tvrtko Ursulin
@ 2018-02-21 13:07       ` Chris Wilson
  2018-02-21 13:35         ` Tvrtko Ursulin
  0 siblings, 1 reply; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 13:07 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-02-21 12:55:17)
> 
> On 21/02/2018 12:53, Tvrtko Ursulin wrote:
> > 
> > On 21/02/2018 12:17, 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.
> >>
> >> v2: When in doubt, shout!
> >>
> >> 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..b9b86079 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) {
> >> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
> >> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
> >>               return false;
> >>       }
> > 
> > If default BSD (1)
> >      and no BSD2 -> 1 ^ 1 = 1 OK
> 
> Oops
> 1 ^ 1 = 0 so also bad
> 
> >      and BSD2 -> 1 ^ 0 = 1 BAD
> > 
> > If explicit BSD (0)
> >      and no BSD2 -> 0 ^ 1 = 1 BAD
> >      has BSD2 -> 0 ^ 0 = 0 = BAD
> > 
> > Maybe I'm confused.. please simplify the statement? :)

return false?

default BSD ^ has-bsd2
0		0	-> 0 OK
0		1	-> 1 SKIP
1		0	-> 1 SKIP
1		1	-> 0 OK

So we only use bsd (implicit) on single BSD engine machines, and only
use bsd0,bsd1 (explicit) on dual engine machines.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 13:35 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/02/2018 13:07, Chris Wilson wrote:
> Quoting Tvrtko Ursulin (2018-02-21 12:55:17)
>>
>> On 21/02/2018 12:53, Tvrtko Ursulin wrote:
>>>
>>> On 21/02/2018 12:17, 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.
>>>>
>>>> v2: When in doubt, shout!
>>>>
>>>> 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..b9b86079 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) {
>>>> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
>>>> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
>>>>                return false;
>>>>        }
>>>
>>> If default BSD (1)
>>>       and no BSD2 -> 1 ^ 1 = 1 OK
>>
>> Oops
>> 1 ^ 1 = 0 so also bad
>>
>>>       and BSD2 -> 1 ^ 0 = 1 BAD
>>>
>>> If explicit BSD (0)
>>>       and no BSD2 -> 0 ^ 1 = 1 BAD
>>>       has BSD2 -> 0 ^ 0 = 0 = BAD
>>>
>>> Maybe I'm confused.. please simplify the statement? :)
> 
> return false?
> 
> default BSD ^ has-bsd2
> 0		0	-> 0 OK
> 0		1	-> 1 SKIP
> 1		0	-> 1 SKIP
> 1		1	-> 0 OK
> 
> So we only use bsd (implicit) on single BSD engine machines, and only
> use bsd0,bsd1 (explicit) on dual engine machines.

Don't get in your notation why is 0 OK and 1 SKIP. 0 is false = no ring 
= skip.

default BSD ^ 	has-bsd2
0		0		0 ^ !0 = 1 has engine - WRONG
0		1		0 ^ !1 = 0 no engine - WRONG
1		0		1 ^ !0 = 0 no engine - WRONG
1		1		1 ^ !1 = 1 has engine - WRONG


default BSD ^ 	has-bsd2
0		0		0 ^ 0 = 0 no engine - OK
0		1		0 ^ 1 = 1 has engine - OK
1		0		1 ^ 0 = 1 has engine - OK
1		1		1 ^ 1 = 0 no engine - OK

So previous version was OK!?

Regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 13:35         ` Tvrtko Ursulin
@ 2018-02-21 13:42           ` Chris Wilson
  2018-02-21 13:42           ` Tvrtko Ursulin
  1 sibling, 0 replies; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 13:42 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-02-21 13:35:38)
> 
> On 21/02/2018 13:07, Chris Wilson wrote:
> > Quoting Tvrtko Ursulin (2018-02-21 12:55:17)
> >>
> >> On 21/02/2018 12:53, Tvrtko Ursulin wrote:
> >>>
> >>> On 21/02/2018 12:17, 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.
> >>>>
> >>>> v2: When in doubt, shout!
> >>>>
> >>>> 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..b9b86079 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) {
> >>>> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
> >>>> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
> >>>>                return false;
> >>>>        }
> >>>
> >>> If default BSD (1)
> >>>       and no BSD2 -> 1 ^ 1 = 1 OK
> >>
> >> Oops
> >> 1 ^ 1 = 0 so also bad
> >>
> >>>       and BSD2 -> 1 ^ 0 = 1 BAD
> >>>
> >>> If explicit BSD (0)
> >>>       and no BSD2 -> 0 ^ 1 = 1 BAD
> >>>       has BSD2 -> 0 ^ 0 = 0 = BAD
> >>>
> >>> Maybe I'm confused.. please simplify the statement? :)
> > 
> > return false?
> > 
> > default BSD ^ has-bsd2
> > 0             0       -> 0 OK
> > 0             1       -> 1 SKIP
> > 1             0       -> 1 SKIP
> > 1             1       -> 0 OK
> > 
> > So we only use bsd (implicit) on single BSD engine machines, and only
> > use bsd0,bsd1 (explicit) on dual engine machines.
> 
> Don't get in your notation why is 0 OK and 1 SKIP. 0 is false = no ring 
> = skip.
> 
> default BSD ^   has-bsd2
> 0               0               0 ^ !0 = 1 has engine - WRONG
> 0               1               0 ^ !1 = 0 no engine - WRONG
> 1               0               1 ^ !0 = 0 no engine - WRONG
> 1               1               1 ^ !1 = 1 has engine - WRONG
> 
> 
> default BSD ^   has-bsd2
> 0               0               0 ^ 0 = 0 no engine - OK
> 0               1               0 ^ 1 = 1 has engine - OK
> 1               0               1 ^ 0 = 1 has engine - OK
> 1               1               1 ^ 1 = 0 no engine - OK
> 
> So previous version was OK!?

Now I am confused, v2 is the one that appears to work.

Anyway, I remember why it is like this. The intention is to iterate the
ABI not the physical engines, I keep meaning to do
s/for_each_engine/for_each_uabi_ring/ and then for_each_physical_engine
that skips the aliased default and bsd (and whatever the future may
bring).

Bring on class/instance.
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Tvrtko Ursulin @ 2018-02-21 13:42 UTC (permalink / raw)
  To: Chris Wilson, intel-gfx


On 21/02/2018 13:35, Tvrtko Ursulin wrote:
> 
> On 21/02/2018 13:07, Chris Wilson wrote:
>> Quoting Tvrtko Ursulin (2018-02-21 12:55:17)
>>>
>>> On 21/02/2018 12:53, Tvrtko Ursulin wrote:
>>>>
>>>> On 21/02/2018 12:17, 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.
>>>>>
>>>>> v2: When in doubt, shout!
>>>>>
>>>>> 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..b9b86079 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) {
>>>>> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
>>>>> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
>>>>>                return false;
>>>>>        }

For preserving time and sanity:

bool is_bsd = (ring & 0xf) == I915_EXEC_BSD;
bool implicit_bsd = !(ring & (3 << 13));
bool supports_explicit_bsd = gem_has_bsd2(fd);

if (is_bsd) {
	if (implicit_bsd && supports_explicit_bsd)
		return false;
	else if (!implicit_bsd && !supports_explicit_bsd)
		return false;
}

?

Regards,

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

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH igt v2] lib: Skip aliased bsd ABI ring if bsd2 is available
  2018-02-21 13:42           ` Tvrtko Ursulin
@ 2018-02-21 13:45             ` Chris Wilson
  0 siblings, 0 replies; 12+ messages in thread
From: Chris Wilson @ 2018-02-21 13:45 UTC (permalink / raw)
  To: Tvrtko Ursulin, intel-gfx

Quoting Tvrtko Ursulin (2018-02-21 13:42:29)
> 
> On 21/02/2018 13:35, Tvrtko Ursulin wrote:
> > 
> > On 21/02/2018 13:07, Chris Wilson wrote:
> >> Quoting Tvrtko Ursulin (2018-02-21 12:55:17)
> >>>
> >>> On 21/02/2018 12:53, Tvrtko Ursulin wrote:
> >>>>
> >>>> On 21/02/2018 12:17, 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.
> >>>>>
> >>>>> v2: When in doubt, shout!
> >>>>>
> >>>>> 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..b9b86079 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) {
> >>>>> -        if (ring & (3 << 13) && !gem_has_bsd2(fd))
> >>>>> +        if (!(ring & (3 << 13)) ^ !gem_has_bsd2(fd))
> >>>>>                return false;
> >>>>>        }
> 
> For preserving time and sanity:
> 
> bool is_bsd = (ring & 0xf) == I915_EXEC_BSD;

& 63

Just to remind you how broken it all is.

> bool implicit_bsd = !(ring & (3 << 13));
> bool supports_explicit_bsd = gem_has_bsd2(fd);
> 
> if (is_bsd) {
>         if (implicit_bsd && supports_explicit_bsd)
>                 return false;
>         else if (!implicit_bsd && !supports_explicit_bsd)
>                 return false;
> }
> 

class/instance to the rescue. :)
-Chris
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

* ✗ Fi.CI.BAT: warning for lib: Skip aliased bsd ABI ring if bsd2 is available (rev2)
  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:25 ` [PATCH igt] " Tvrtko Ursulin
@ 2018-02-21 18:33 ` Patchwork
  2 siblings, 0 replies; 12+ messages in thread
From: Patchwork @ 2018-02-21 18:33 UTC (permalink / raw)
  To: Chris Wilson; +Cc: intel-gfx

== Series Details ==

Series: lib: Skip aliased bsd ABI ring if bsd2 is available (rev2)
URL   : https://patchwork.freedesktop.org/series/38690/
State : warning

== Summary ==

IGT patchset tested on top of latest successful build
960e55a87d7b7d7385063e37cc9f281df2be8037 igt/gem_ctx_isolation: Check isolation of registers between contexts

with latest DRM-Tip kernel build CI_DRM_3816
42d073db2a85 drm-tip: 2018y-02m-21d-14h-03m-58s UTC integration manifest

No testlist changes.

Test gem_exec_basic:
        Subgroup basic-bsd:
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
        Subgroup gtt-bsd:
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
        Subgroup readonly-bsd:
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
Test gem_exec_store:
        Subgroup basic-bsd:
                pass       -> SKIP       (fi-bdw-5557u)
                pass       -> SKIP       (fi-bdw-gvtdvm)
                pass       -> SKIP       (fi-skl-6260u)
                pass       -> SKIP       (fi-skl-6770hq)
                pass       -> SKIP       (fi-skl-gvtdvm)
                pass       -> SKIP       (fi-kbl-7560u)
                pass       -> SKIP       (fi-kbl-7567u)
Test gem_mmap_gtt:
        Subgroup basic-small-bo-tiledx:
                pass       -> FAIL       (fi-gdg-551) fdo#102575
Test kms_pipe_crc_basic:
        Subgroup suspend-read-crc-pipe-a:
                fail       -> PASS       (fi-ivb-3520m)
                pass       -> FAIL       (fi-skl-guc) fdo#103191
        Subgroup suspend-read-crc-pipe-b:
                incomplete -> PASS       (fi-snb-2520m) fdo#103713
                fail       -> PASS       (fi-ivb-3520m)
        Subgroup suspend-read-crc-pipe-c:
                fail       -> PASS       (fi-ivb-3520m)
Test prime_vgem:
        Subgroup basic-fence-flip:
                pass       -> FAIL       (fi-ilk-650) fdo#104008

fdo#102575 https://bugs.freedesktop.org/show_bug.cgi?id=102575
fdo#103191 https://bugs.freedesktop.org/show_bug.cgi?id=103191
fdo#103713 https://bugs.freedesktop.org/show_bug.cgi?id=103713
fdo#104008 https://bugs.freedesktop.org/show_bug.cgi?id=104008

fi-bdw-5557u     total:288  pass:263  dwarn:0   dfail:0   fail:0   skip:25  time:417s
fi-bdw-gvtdvm    total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:428s
fi-blb-e6850     total:288  pass:223  dwarn:1   dfail:0   fail:0   skip:64  time:376s
fi-bsw-n3050     total:288  pass:242  dwarn:0   dfail:0   fail:0   skip:46  time:490s
fi-bwr-2160      total:288  pass:183  dwarn:0   dfail:0   fail:0   skip:105 time:286s
fi-bxt-j4205     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:485s
fi-byt-j1900     total:288  pass:253  dwarn:0   dfail:0   fail:0   skip:35  time:470s
fi-byt-n2820     total:288  pass:249  dwarn:0   dfail:0   fail:0   skip:39  time:460s
fi-cfl-s2        total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:562s
fi-elk-e7500     total:288  pass:229  dwarn:0   dfail:0   fail:0   skip:59  time:419s
fi-gdg-551       total:288  pass:179  dwarn:0   dfail:0   fail:1   skip:108 time:287s
fi-glk-1         total:288  pass:260  dwarn:0   dfail:0   fail:0   skip:28  time:508s
fi-hsw-4770      total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:385s
fi-ilk-650       total:288  pass:227  dwarn:0   dfail:0   fail:1   skip:60  time:408s
fi-ivb-3520m     total:288  pass:259  dwarn:0   dfail:0   fail:0   skip:29  time:452s
fi-ivb-3770      total:288  pass:255  dwarn:0   dfail:0   fail:0   skip:33  time:412s
fi-kbl-7500u     total:288  pass:263  dwarn:1   dfail:0   fail:0   skip:24  time:452s
fi-kbl-7560u     total:288  pass:265  dwarn:0   dfail:0   fail:0   skip:23  time:492s
fi-kbl-7567u     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:448s
fi-kbl-r         total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:498s
fi-pnv-d510      total:288  pass:222  dwarn:1   dfail:0   fail:0   skip:65  time:599s
fi-skl-6260u     total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:427s
fi-skl-6600u     total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:504s
fi-skl-6700hq    total:288  pass:262  dwarn:0   dfail:0   fail:0   skip:26  time:522s
fi-skl-6700k2    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:485s
fi-skl-6770hq    total:288  pass:264  dwarn:0   dfail:0   fail:0   skip:24  time:485s
fi-skl-guc       total:288  pass:259  dwarn:0   dfail:0   fail:1   skip:28  time:409s
fi-skl-gvtdvm    total:288  pass:261  dwarn:0   dfail:0   fail:0   skip:27  time:433s
fi-snb-2520m     total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:520s
fi-snb-2600      total:288  pass:248  dwarn:0   dfail:0   fail:0   skip:40  time:391s

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/IGTPW_974/issues.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2018-02-21 18:33 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
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 ` [PATCH igt] " Tvrtko Ursulin
2018-02-21 12:29   ` Chris Wilson
2018-02-21 18:33 ` ✗ Fi.CI.BAT: warning for lib: Skip aliased bsd ABI ring if bsd2 is available (rev2) Patchwork

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.