gallium: Wire up flush control
authorAdam Jackson <ajax@redhat.com>
Wed, 4 Feb 2015 18:05:36 +0000 (13:05 -0500)
committerAdam Jackson <ajax@redhat.com>
Mon, 6 Nov 2017 21:09:03 +0000 (16:09 -0500)
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Adam Jackson <ajax@redhat.com>
src/gallium/include/state_tracker/st_api.h
src/gallium/state_trackers/dri/dri_context.c
src/mesa/state_tracker/st_manager.c

index 2232c3efa186863c6f400ba1b26c31057552820b..11a9878cf64a1582964c65fd076d388859b0d253 100644 (file)
@@ -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.
index d3a57322af39ea4c7f7b2e0a1042fa73a6677b57..18bbfa046caf822a9825eef6a2681302bd350226 100644 (file)
@@ -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;
    }
index eebde6218371b64a564b1a359d0c91d7612a21a2..48260df0c343a3192a0cb77751e85b1732d6e992 100644 (file)
@@ -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?