st/dri: simplify throttling code
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
This commit is contained in:
parent
d9838f653a
commit
a20800f49d
|
@ -1933,10 +1933,8 @@ dri2_init_screen(__DRIscreen * sPriv)
|
|||
throttle_ret = pipe_loader_configuration(screen->dev, DRM_CONF_THROTTLE);
|
||||
dmabuf_ret = pipe_loader_configuration(screen->dev, DRM_CONF_SHARE_FD);
|
||||
|
||||
if (throttle_ret && throttle_ret->val.val_int != -1) {
|
||||
screen->throttling_enabled = TRUE;
|
||||
if (throttle_ret && throttle_ret->val.val_int > 0)
|
||||
screen->default_throttle_frames = throttle_ret->val.val_int;
|
||||
}
|
||||
|
||||
if (pscreen->resource_create_with_modifiers)
|
||||
dri2ImageExtension.createImageWithModifiers =
|
||||
|
|
|
@ -547,7 +547,7 @@ dri_flush(__DRIcontext *cPriv,
|
|||
flush_flags |= ST_FLUSH_END_OF_FRAME;
|
||||
|
||||
/* Flush the context and throttle if needed. */
|
||||
if (dri_screen(ctx->sPriv)->throttling_enabled &&
|
||||
if (dri_screen(ctx->sPriv)->default_throttle_frames &&
|
||||
drawable &&
|
||||
(reason == __DRI2_THROTTLE_SWAPBUFFER ||
|
||||
reason == __DRI2_THROTTLE_FLUSHFRONT)) {
|
||||
|
|
|
@ -57,8 +57,7 @@ struct dri_screen
|
|||
|
||||
/* dri */
|
||||
__DRIscreen *sPriv;
|
||||
boolean throttling_enabled;
|
||||
int default_throttle_frames;
|
||||
unsigned default_throttle_frames;
|
||||
|
||||
struct st_config_options options;
|
||||
|
||||
|
|
Loading…
Reference in New Issue