diff options
author | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-28 19:23:38 +0100 |
---|---|---|
committer | Chris Wilson <chris@chris-wilson.co.uk> | 2016-05-28 19:23:38 +0100 |
commit | 4458f1bf8a5cfbed0c4bbe9d968719c47ee0ea7d (patch) | |
tree | 6e8a79ed848554204fc3596821083494efad5e0b /src/sna | |
parent | 46ffdf295d161a70459508ef0643d70af66ed990 (diff) |
sna: Restore TearFree operation after switching everything off
We give up on TearFree if we ever see an error whilst page flipping (in
the hope that we can keep displaying via direct use of the scanout).
With the advent of MST, this can happen simply by the user unplugging a
dock causing connectors to disappear and if we flip before we see the
uevent telling us which outputs are disabled, we get an error.
So, lets try and re-enable TearFree on the next opportunity, when all
the outputs are off and we can rebuild the shadow buffer.
Reported-by: Martin Jørgensen <mkj@gotu.dk>
References: https://bugs.freedesktop.org/show_bug.cgi?id=96180
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna')
-rw-r--r-- | src/sna/sna.h | 5 | ||||
-rw-r--r-- | src/sna/sna_display.c | 9 | ||||
-rw-r--r-- | src/sna/sna_driver.c | 2 |
3 files changed, 13 insertions, 3 deletions
diff --git a/src/sna/sna.h b/src/sna/sna.h index 664308f2..fdfefe17 100644 --- a/src/sna/sna.h +++ b/src/sna/sna.h @@ -259,8 +259,9 @@ struct sna { #define SNA_NO_VSYNC 0x40 #define SNA_TRIPLE_BUFFER 0x80 #define SNA_TEAR_FREE 0x100 -#define SNA_FORCE_SHADOW 0x200 -#define SNA_FLUSH_GTT 0x400 +#define SNA_WANT_TEAR_FREE 0x200 +#define SNA_FORCE_SHADOW 0x400 +#define SNA_FLUSH_GTT 0x800 #define SNA_PERFORMANCE 0x1000 #define SNA_POWERSAVE 0x2000 #define SNA_HAS_FLIP 0x10000 diff --git a/src/sna/sna_display.c b/src/sna/sna_display.c index ce58cc1e..9c1d8fda 100644 --- a/src/sna/sna_display.c +++ b/src/sna/sna_display.c @@ -7076,6 +7076,15 @@ sna_crtc_config_notify(ScreenPtr screen) probe_capabilities(sna); sna_present_update(sna); + /* Allow TearFree to come back on when everything is off */ + if (!sna->mode.front_active && sna->flags & SNA_WANT_TEAR_FREE) { + if ((sna->flags & SNA_TEAR_FREE) == 0) + DBG(("%s: enable TearFree next modeset\n", + __FUNCTION__)); + + sna->flags |= SNA_TEAR_FREE; + } + sna->mode.dirty = false; } diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c index b2455941..fce64bad 100644 --- a/src/sna/sna_driver.c +++ b/src/sna/sna_driver.c @@ -481,7 +481,7 @@ static bool setup_tear_free(struct sna *sna) from = X_CONFIG; if (enable) - sna->flags |= SNA_TEAR_FREE; + sna->flags |= SNA_WANT_TEAR_FREE | SNA_TEAR_FREE; done: xf86DrvMsg(sna->scrn->scrnIndex, from, "TearFree %sabled\n", |