diff options
author | Rob Clark <[email protected]> | 2017-08-23 14:39:55 -0400 |
---|---|---|
committer | Rob Clark <[email protected]> | 2017-12-19 16:36:10 -0500 |
commit | 0015217c1eeb3743785ae5e33d004ef49dba3fa6 (patch) | |
tree | b6db81addc04082097c9862b3d06067975b429db /src/gallium/state_trackers | |
parent | 85789831b487c08eb4817fb902efc2e6b614d9ac (diff) |
gallium: plumb context priority through to driver
Signed-off-by: Rob Clark <[email protected]>
Reviewed-by: Roland Scheidegger <[email protected]>
Reviewed-by: Marek Olšák <[email protected]>
Reviewed-by: Andres Rodriguez <[email protected]>
Reviewed-by: Wladimir J. van der Laan <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r-- | src/gallium/state_trackers/dri/dri_context.c | 17 | ||||
-rw-r--r-- | src/gallium/state_trackers/dri/dri_query_renderer.c | 8 |
2 files changed, 23 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c index 6e28553146f..fb307337a90 100644 --- a/src/gallium/state_trackers/dri/dri_context.c +++ b/src/gallium/state_trackers/dri/dri_context.c @@ -57,7 +57,9 @@ dri_create_context(gl_api api, const struct gl_config * visual, unsigned allowed_flags = __DRI_CTX_FLAG_DEBUG | __DRI_CTX_FLAG_FORWARD_COMPATIBLE | __DRI_CTX_FLAG_NO_ERROR; - unsigned allowed_attribs = __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR; + unsigned allowed_attribs = + __DRIVER_CONTEXT_ATTRIB_PRIORITY | + __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR; const __DRIbackgroundCallableExtension *backgroundCallable = screen->sPriv->dri2.backgroundCallable; @@ -112,6 +114,19 @@ dri_create_context(gl_api api, const struct gl_config * visual, if (ctx_config->flags & __DRI_CTX_FLAG_NO_ERROR) attribs.flags |= ST_CONTEXT_FLAG_NO_ERROR; + if (ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_PRIORITY) { + switch (ctx_config->priority) { + case __DRI_CTX_PRIORITY_LOW: + attribs.flags |= ST_CONTEXT_FLAG_LOW_PRIORITY; + break; + case __DRI_CTX_PRIORITY_HIGH: + attribs.flags |= ST_CONTEXT_FLAG_HIGH_PRIORITY; + break; + default: + break; + } + } + if ((ctx_config->attribute_mask & __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR) && (ctx_config->release_behavior == __DRI_CTX_RELEASE_BEHAVIOR_NONE)) attribs.flags |= ST_CONTEXT_FLAG_RELEASE_NONE; diff --git a/src/gallium/state_trackers/dri/dri_query_renderer.c b/src/gallium/state_trackers/dri/dri_query_renderer.c index ea31b6c1e10..80847e3d314 100644 --- a/src/gallium/state_trackers/dri/dri_query_renderer.c +++ b/src/gallium/state_trackers/dri/dri_query_renderer.c @@ -55,7 +55,13 @@ dri2_query_renderer_integer(__DRIscreen *_screen, int param, PIPE_TEXTURE_2D, 0, PIPE_BIND_RENDER_TARGET); return 0; - + case __DRI2_RENDERER_HAS_CONTEXT_PRIORITY: + value[0] = + screen->base.screen->get_param(screen->base.screen, + PIPE_CAP_CONTEXT_PRIORITY_MASK); + if (!value[0]) + return -1; + return 0; default: return driQueryRendererIntegerCommon(_screen, param, value); } |