dri: Add a flush control extension

This advertises that the driver can accept a new context attribute
__DRI_CTX_ATTRIB_RELEASE_BEHAVIOR.

Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>
Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
Signed-off-by: Neil Roberts <neil@linux.intel.com>
This commit is contained in:
Neil Roberts
2014-10-01 20:00:47 +01:00
committed by Adam Jackson
parent 6d87500fe1
commit b89067c84f
3 changed files with 46 additions and 2 deletions
+14
View File
@@ -361,6 +361,16 @@ driCreateContextAttribs(__DRIscreen *screen, int api,
ctx_config.attribute_mask |= __DRIVER_CONTEXT_ATTRIB_PRIORITY;
ctx_config.priority = attribs[i * 2 + 1];
break;
case __DRI_CTX_ATTRIB_RELEASE_BEHAVIOR:
if (attribs[i * 2 + 1] != __DRI_CTX_RELEASE_BEHAVIOR_FLUSH) {
ctx_config.attribute_mask |=
__DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR;
ctx_config.release_behavior = attribs[i * 2 + 1];
} else {
ctx_config.attribute_mask &=
~__DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR;
}
break;
default:
/* We can't create a context that satisfies the requirements of an
* attribute that we don't understand. Return failure.
@@ -833,6 +843,10 @@ const __DRI2configQueryExtension dri2ConfigQueryExtension = {
.configQueryf = dri2ConfigQueryf,
};
const __DRI2flushControlExtension dri2FlushControlExtension = {
.base = { __DRI2_FLUSH_CONTROL, 1 }
};
void
dri2InvalidateDrawable(__DRIdrawable *drawable)
{
+7 -2
View File
@@ -67,6 +67,7 @@ extern const __DRIswrastExtension driSWRastExtension;
extern const __DRIdri2Extension driDRI2Extension;
extern const __DRI2configQueryExtension dri2ConfigQueryExtension;
extern const __DRIcopySubBufferExtension driCopySubBufferExtension;
extern const __DRI2flushControlExtension dri2FlushControlExtension;
/**
* Description of the attributes used to create a config.
@@ -93,10 +94,14 @@ struct __DriverContextConfig {
/* Only valid if __DRIVER_CONTEXT_PRIORITY is set */
unsigned priority;
/* Only valid if __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR is set */
int release_behavior;
};
#define __DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY (1 << 0)
#define __DRIVER_CONTEXT_ATTRIB_PRIORITY (1 << 1)
#define __DRIVER_CONTEXT_ATTRIB_RESET_STRATEGY (1 << 0)
#define __DRIVER_CONTEXT_ATTRIB_PRIORITY (1 << 1)
#define __DRIVER_CONTEXT_ATTRIB_RELEASE_BEHAVIOR (1 << 2)
/**
* Driver callback functions.