diff options
author | Michel Dänzer <michel.daenzer@amd.com> | 2019-06-14 11:21:40 +0200 |
---|---|---|
committer | Michel Dänzer <michel@daenzer.net> | 2019-06-14 16:03:38 +0200 |
commit | 2a3f2d2089f603c99be54c98d7033155e771ce7b (patch) | |
tree | 1f95f68f32c7de35bec895adaecfa46bf177b09f /src/radeon_dri2.c | |
parent | d5f5bc5846ef06c3ecf9e5acf1ca357574f06f5a (diff) |
dri2: Re-use previous CRTC when possible if pick_best_crtc returns NULL
This way, the MSC will continue ticking at the rate of (the last mode
which was enabled for) that CRTC, instead of the client running
unthrottled.
(Ported from amdgpu commit 3109f088fdbd89c2ee8078625d4f073852492656)
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'src/radeon_dri2.c')
-rw-r--r-- | src/radeon_dri2.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/src/radeon_dri2.c b/src/radeon_dri2.c index 3c04e6fe..c59d799f 100644 --- a/src/radeon_dri2.c +++ b/src/radeon_dri2.c @@ -517,10 +517,12 @@ xf86CrtcPtr radeon_dri2_drawable_crtc(DrawablePtr pDraw, Bool consider_disabled) pDraw->x, pDraw->x + pDraw->width, pDraw->y, pDraw->y + pDraw->height); - if (crtc && pDraw->type == DRAWABLE_WINDOW) { + if (pDraw->type == DRAWABLE_WINDOW) { struct dri2_window_priv *priv = get_dri2_window_priv((WindowPtr)pDraw); - if (priv->crtc && priv->crtc != crtc) { + if (!crtc) { + crtc = priv->crtc; + } else if (priv->crtc && priv->crtc != crtc) { CARD64 ust, mscold, mscnew; if (radeon_dri2_get_crtc_msc(priv->crtc, &ust, &mscold) && |