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>
This commit is contained in:
@@ -84,6 +84,7 @@ typedef struct __DRIbufferRec __DRIbuffer;
|
||||
typedef struct __DRIdri2ExtensionRec __DRIdri2Extension;
|
||||
typedef struct __DRIdri2LoaderExtensionRec __DRIdri2LoaderExtension;
|
||||
typedef struct __DRI2flushExtensionRec __DRI2flushExtension;
|
||||
typedef struct __DRI2throttleExtensionRec __DRI2throttleExtension;
|
||||
|
||||
/*@}*/
|
||||
|
||||
@@ -283,6 +284,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.
|
||||
|
||||
Reference in New Issue
Block a user