* [PATCH i-g-t] i915: Fix gem_context_has_engine_map() for older kernels
@ 2019-07-02 10:50 Chris Wilson
2019-07-02 11:43 ` Tvrtko Ursulin
0 siblings, 1 reply; 2+ messages in thread
From: Chris Wilson @ 2019-07-02 10:50 UTC (permalink / raw)
To: intel-gfx; +Cc: igt-dev
CI is currently breaking on linus/drm-intel-fixes due to the assert that
the kernel supports context engine maps. Report the lack of maps on
older kernels gracefully!
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
---
lib/i915/gem_engine_topology.c | 9 ++++++---
1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
index cae5a0292..cc2b3ff6e 100644
--- a/lib/i915/gem_engine_topology.c
+++ b/lib/i915/gem_engine_topology.c
@@ -321,10 +321,13 @@ bool gem_context_has_engine_map(int fd, uint32_t ctx)
.param = I915_CONTEXT_PARAM_ENGINES,
.ctx_id = ctx
};
- int ret;
- ret = __gem_context_get_param(fd, ¶m);
- igt_assert_eq(ret, 0);
+ /*
+ * If the kernel is too old to support PARAM_ENGINES,
+ * then naturally is has no engine map.
+ */
+ if (__gem_context_get_param(fd, ¶m))
+ return false;
return param.size;
}
--
2.20.1
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH i-g-t] i915: Fix gem_context_has_engine_map() for older kernels
2019-07-02 10:50 [PATCH i-g-t] i915: Fix gem_context_has_engine_map() for older kernels Chris Wilson
@ 2019-07-02 11:43 ` Tvrtko Ursulin
0 siblings, 0 replies; 2+ messages in thread
From: Tvrtko Ursulin @ 2019-07-02 11:43 UTC (permalink / raw)
To: Chris Wilson, intel-gfx; +Cc: igt-dev
On 02/07/2019 11:50, Chris Wilson wrote:
> CI is currently breaking on linus/drm-intel-fixes due to the assert that
> the kernel supports context engine maps. Report the lack of maps on
> older kernels gracefully!
>
> Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com>
> ---
> lib/i915/gem_engine_topology.c | 9 ++++++---
> 1 file changed, 6 insertions(+), 3 deletions(-)
>
> diff --git a/lib/i915/gem_engine_topology.c b/lib/i915/gem_engine_topology.c
> index cae5a0292..cc2b3ff6e 100644
> --- a/lib/i915/gem_engine_topology.c
> +++ b/lib/i915/gem_engine_topology.c
> @@ -321,10 +321,13 @@ bool gem_context_has_engine_map(int fd, uint32_t ctx)
> .param = I915_CONTEXT_PARAM_ENGINES,
> .ctx_id = ctx
> };
> - int ret;
>
> - ret = __gem_context_get_param(fd, ¶m);
> - igt_assert_eq(ret, 0);
> + /*
> + * If the kernel is too old to support PARAM_ENGINES,
> + * then naturally is has no engine map.
> + */
> + if (__gem_context_get_param(fd, ¶m))
> + return false;
>
> return param.size;
> }
>
Bleurgh, sorry. I even have some memories of checking ret, otherwise I
wouldn't have had the local. Don't know what happened there..
Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com>
Regards,
Tvrtko
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2019-07-02 11:43 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2019-07-02 10:50 [PATCH i-g-t] i915: Fix gem_context_has_engine_map() for older kernels Chris Wilson
2019-07-02 11:43 ` Tvrtko Ursulin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox