[Mesa-dev] [PATCH] gl-renderer: Create a high priority context
Chris Wilson
chris at chris-wilson.co.uk
Fri Mar 2 22:45:59 UTC 2018
Quoting Emil Velikov (2018-03-02 17:45:29)
> [Moving the thread from wayland-devel to mesa-dev]
>
> On 2 March 2018 at 15:03, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > Quoting Emil Velikov (2018-03-02 14:52:28)
> >> Hi Chris,
> >>
> >> On 1 March 2018 at 08:28, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> >> > EGL_IMG_context_priority allows the client to request that their
> >> > rendering be considered high priority. For ourselves, this is important
> >> > as we are interactive and any delay in our rendering causes input-output
> >>
> >> > + if (gr->has_context_priority) {
> >> > + EGLint value = EGL_CONTEXT_PRIORITY_MEDIUM_IMG;
> >> > +
> >> > + eglQueryContext(gr->egl_display, gr->egl_context,
> >> > + EGL_CONTEXT_PRIORITY_LEVEL_IMG, &value);
> >> > +
> >> > + if (value != EGL_CONTEXT_PRIORITY_HIGH_IMG) {
> >> > + weston_log("Failed to obtain a high priority context.\n");
> >> > + /* Not an error, continue on as normal */
> >> > + }
> >> While this (and EGL spec) says "not an error" the i965 driver will
> >> error out as the ioctl fails.
> >
> > The high priority attribute is filtered out from the allowed set of EGL
> > attributes, so the request for a high priority context is silently
> > converted back to normal. You don't get as far as hitting the ioctl.
> >
> I'm talking about the case where the initial calls to
> brw_hw_context_set_priority() used to to get the mask succeed.
> While a call to brw_hw_context_set_priority() while creating a context fails.
>
> When and why that would happen, is an open question ;-)
> Say, when 'too many' high priority contexts are created the i915 DRM
> driver could bail on the set_param request?
No. The only failure mechanism here is programming error (asking for a
nonexistent content, invalid parameter etc) or if privileges were dropped
after the query. Or some catastrophic system error. At which point, my
thinking was that it was a critical error that should bail as the driver
was fubar.
-Chris
More information about the mesa-dev
mailing list