[Mesa-dev] [PATCH v2 2/4] egl, dri: Propagate context priority hint to driver->CreateContext

Chris Wilson chris at chris-wilson.co.uk
Wed May 3 14:29:30 UTC 2017


On Wed, Apr 12, 2017 at 02:58:50PM +0100, Emil Velikov wrote:
> On 11 April 2017 at 17:11, Chris Wilson <chris at chris-wilson.co.uk> wrote:
> > Jump through the layers of abstraction between egl and dri in order to
> > feed the context priority attribute through to the backend. This
> > requires us to read the value from the base _egl_context, convert it to
> > a DRI attribute, parse it again in the generic context creator before
> > passing it to the driver as a function parameter.
> >
> > In order to not require us to pass back the actual value of the context
> > priority after creation, we impose that drivers should report the
> > available set of priorities during screen setup (and then they may chose
> > to fail if given an invalid value as that should have been checked at
> > the user boundary.)
> >
> > Signed-off-by: Chris Wilson <chris at chris-wilson.co.uk>
> > ---
> >  include/GL/internal/dri_interface.h            |  6 ++++
> >  src/egl/drivers/dri2/egl_dri2.c                | 38 +++++++++++++++++++++-----
> >  src/gallium/state_trackers/dri/dri_context.c   |  1 +
> >  src/gallium/state_trackers/dri/dri_context.h   |  1 +
> >  src/mesa/drivers/dri/common/dri_util.c         |  7 ++++-
> >  src/mesa/drivers/dri/common/dri_util.h         |  9 +++---
> >  src/mesa/drivers/dri/i915/intel_screen.c       | 11 ++++----
> >  src/mesa/drivers/dri/i965/brw_context.c        |  7 +++--
> >  src/mesa/drivers/dri/i965/brw_context.h        | 17 ++++++------
> >  src/mesa/drivers/dri/nouveau/nouveau_context.c |  1 +
> >  src/mesa/drivers/dri/nouveau/nouveau_context.h |  4 +--
> >  src/mesa/drivers/dri/r200/r200_context.c       |  1 +
> >  src/mesa/drivers/dri/r200/r200_context.h       |  1 +
> >  src/mesa/drivers/dri/radeon/radeon_context.c   |  1 +
> >  src/mesa/drivers/dri/radeon/radeon_context.h   |  1 +
> >  src/mesa/drivers/dri/swrast/swrast.c           |  1 +
> >  16 files changed, 77 insertions(+), 30 deletions(-)
> >
> > diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h
> > index 9881ddcbb0..969d304a95 100644
> > --- a/include/GL/internal/dri_interface.h
> > +++ b/include/GL/internal/dri_interface.h
> > @@ -1056,6 +1056,12 @@ struct __DRIdri2LoaderExtensionRec {
> >  #define __DRI_CTX_RESET_LOSE_CONTEXT           1
> >  /*@}*/
> >
> > +#define __DRI_CTX_ATTRIB_PRIORITY              4
> > +
> > +#define __DRI_CTX_PRIORITY_LOW                 0
> > +#define __DRI_CTX_PRIORITY_MEDIUM              1
> > +#define __DRI_CTX_PRIORITY_HIGH                        2
> > +
> Second Ben's question here - reuse the HAS_CTX_PRIO defines if you prefer.

I still haven't found a way I can cleanly include the same definitions
into both the EGL and DRI2 interfaces. These bits get pulled into the
core EGL via the egl_dri2 module and used by drivers via the dri
interface. There doesn't seem to be any overlap between the core where
we want to report the information to the client, and the driver talking
dri (not egl).

I'm going to have to leave this to someone more familiar, if we do run
into a situation where the bits need updating.
-Chris

-- 
Chris Wilson, Intel Open Source Technology Centre


More information about the mesa-dev mailing list