aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers
diff options
context:
space:
mode:
authorMarek Olšák <[email protected]>2019-04-22 17:05:18 -0400
committerMarek Olšák <[email protected]>2019-04-23 21:19:48 -0400
commita20800f49d1d665c4d93dcca87face1320423476 (patch)
treef5aabac897fd0bddc7d9ffc2cfc56c6e192f769d /src/gallium/state_trackers
parentd9838f653a48e06d1518aca86613f27f2c2293ac (diff)
st/dri: simplify throttling code
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src/gallium/state_trackers')
-rw-r--r--src/gallium/state_trackers/dri/dri2.c4
-rw-r--r--src/gallium/state_trackers/dri/dri_drawable.c2
-rw-r--r--src/gallium/state_trackers/dri/dri_screen.h3
3 files changed, 3 insertions, 6 deletions
diff --git a/src/gallium/state_trackers/dri/dri2.c b/src/gallium/state_trackers/dri/dri2.c
index efb43c0d797..7edef415505 100644
--- a/src/gallium/state_trackers/dri/dri2.c
+++ b/src/gallium/state_trackers/dri/dri2.c
@@ -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 =
diff --git a/src/gallium/state_trackers/dri/dri_drawable.c b/src/gallium/state_trackers/dri/dri_drawable.c
index 92047584224..26bfdbecc53 100644
--- a/src/gallium/state_trackers/dri/dri_drawable.c
+++ b/src/gallium/state_trackers/dri/dri_drawable.c
@@ -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)) {
diff --git a/src/gallium/state_trackers/dri/dri_screen.h b/src/gallium/state_trackers/dri/dri_screen.h
index 30bde45ce42..85372cb97c8 100644
--- a/src/gallium/state_trackers/dri/dri_screen.h
+++ b/src/gallium/state_trackers/dri/dri_screen.h
@@ -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;