summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAdam Jackson <ajax@redhat.com>2017-11-02 15:01:46 -0400
committerDylan Baker <dylan@pnwbakers.com>2017-11-02 15:09:14 -0700
commitc35e62a35560c812398e41dfba2c8665c32d5dc0 (patch)
tree076e500e8aac3118aa0221b9038bf892ef468d25
parent90581daa0a73bedddb4c31c3e174458ca5531b95 (diff)
gallium: Wire up flush control
Reviewed-by: Marek Olšák <marek.olsak@amd.com> Signed-off-by: Adam Jackson <ajax@redhat.com>
-rw-r--r--src/gallium/include/state_tracker/st_api.h1
-rw-r--r--src/gallium/state_trackers/dri/dri_context.c6
-rw-r--r--src/mesa/state_tracker/st_manager.c3
3 files changed, 9 insertions, 1 deletions
diff --git a/src/gallium/include/state_tracker/st_api.h b/src/gallium/include/state_tracker/st_api.h
index 2232c3efa1..11a9878cf6 100644
--- a/src/gallium/include/state_tracker/st_api.h
+++ b/src/gallium/include/state_tracker/st_api.h
@@ -91,6 +91,7 @@ enum st_api_feature
#define ST_CONTEXT_FLAG_ROBUST_ACCESS (1 << 2)
#define ST_CONTEXT_FLAG_RESET_NOTIFICATION_ENABLED (1 << 3)
#define ST_CONTEXT_FLAG_NO_ERROR (1 << 4)
+#define ST_CONTEXT_FLAG_RELEASE_NONE (1 << 5)
/**
* Reasons that context creation might fail.
diff --git a/src/gallium/state_trackers/dri/dri_context.c b/src/gallium/state_trackers/dri/dri_context.c
index 73910e1df3..285ee90a95 100644
--- a/src/gallium/state_trackers/dri/dri_context.c
+++ b/src/gallium/state_trackers/dri/dri_context.c
@@ -57,7 +57,7 @@ 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 = 0;
+ unsigned allowed_attribs = __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR;
const __DRIbackgroundCallableExtension *backgroundCallable =
screen->sPriv->dri2.backgroundCallable;
@@ -112,6 +112,10 @@ 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_RELEASE_BEHAVIOR)
+ && (ctx_config->release_behavior == __DRI_CTX_RELEASE_BEHAVIOR_NONE))
+ attribs.flags |= ST_CONTEXT_FLAG_RELEASE_NONE;
+
if (sharedContextPrivate) {
st_share = ((struct dri_context *)sharedContextPrivate)->st;
}
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c
index eebde62183..48260df0c3 100644
--- a/src/mesa/state_tracker/st_manager.c
+++ b/src/mesa/state_tracker/st_manager.c
@@ -882,6 +882,9 @@ st_api_create_context(struct st_api *stapi, struct st_manager *smapi,
st_install_device_reset_callback(st);
}
+ if (attribs->flags & ST_CONTEXT_FLAG_RELEASE_NONE)
+ st->ctx->Const.ContextReleaseBehavior = GL_NONE;
+
/* need to perform version check */
if (attribs->major > 1 || attribs->minor > 0) {
/* Is the actual version less than the requested version?