diff options
author | Thomas Hellstrom <thellstrom@vmware.com> | 2011-10-10 16:38:19 +0200 |
---|---|---|
committer | Thomas Hellstrom <thellstrom@vmware.com> | 2011-10-14 09:52:53 +0200 |
commit | 511dc295f82c61acefe026d0f4de43d4a31dbf90 (patch) | |
tree | bb70c67a7eea68d7cc426a90d3fe158f3779a3ff /include | |
parent | 718cbe4ba95439c074144ea2ce06ebf0915a660c (diff) |
dri2: Implement a throttle dri extension.
The X server has limited throttle support on the server side,
but doing this in the client has some benefits:
1) X server throttling is per client. Client side throttling can be done
per drawable.
2) It's easier to control the throttling based on what client is run,
for example using "driconf".
3) X server throttling requires drm swap complete events.
So implement a dri2 throttling extension intended to be used by direct
rendering clients.
Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
Reviewed-by: Michel Dänzer <michel@daenzer.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/GL/internal/dri_interface.h | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/include/GL/internal/dri_interface.h b/include/GL/internal/dri_interface.h index 8a9ca194913..4f768f0c829 100644 --- a/include/GL/internal/dri_interface.h +++ b/include/GL/internal/dri_interface.h @@ -84,6 +84,7 @@ typedef struct __DRIbufferRec __DRIbuffer; typedef struct __DRIdri2ExtensionRec __DRIdri2Extension; typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension; typedef struct __DRI2flushExtensionRec __DRI2flushExtension; +typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension; /*@}*/ @@ -284,6 +285,27 @@ struct __DRI2flushExtensionRec { /** + * Extension that the driver uses to request + * throttle callbacks. + */ + +#define __DRI2_THROTTLE "DRI2_Throttle" +#define __DRI2_THROTTLE_VERSION 1 + +enum __DRI2throttleReason { + __DRI2_THROTTLE_SWAPBUFFER, + __DRI2_THROTTLE_COPYSUBBUFFER, + __DRI2_THROTTLE_FLUSHFRONT +}; + +struct __DRI2throttleExtensionRec { + __DRIextension base; + void (*throttle)(__DRIcontext *ctx, + __DRIdrawable *drawable, + enum __DRI2throttleReason reason); +}; + +/** * XML document describing the configuration options supported by the * driver. */ |