summaryrefslogtreecommitdiff
path: root/src/sna/sna_driver.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2016-02-18 13:53:07 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2016-02-18 13:53:07 +0000
commitb99e8b022c4aaf586ae49e0eb597f0c34bc0e165 (patch)
tree5f522f0e485c2dcab2927eac002b83be3685f4da /src/sna/sna_driver.c
parentc4382c5e5b28a60261986b00bf0fcb8da4b78625 (diff)
sna: Use dirtyfb for fallback direct rendering
The preferred solution when direct rendering is too costly is to render into the backbuffer and flip. However, if the user insists, we need to tell the kernel when to flush the scanout due to direct rendering. Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'src/sna/sna_driver.c')
-rw-r--r--src/sna/sna_driver.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index 14ec2f6a..b2455941 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -461,13 +461,13 @@ static bool enable_tear_free(struct sna *sna)
return ENABLE_TEAR_FREE;
}
-static void setup_tear_free(struct sna *sna)
+static bool setup_tear_free(struct sna *sna)
{
MessageType from;
Bool enable;
if (sna->flags & SNA_LINEAR_FB)
- return;
+ return false;
if ((sna->flags & SNA_HAS_FLIP) == 0) {
from = X_PROBED;
@@ -486,6 +486,7 @@ static void setup_tear_free(struct sna *sna)
done:
xf86DrvMsg(sna->scrn->scrnIndex, from, "TearFree %sabled\n",
sna->flags & SNA_TEAR_FREE ? "en" : "dis");
+ return sna->flags & SNA_TEAR_FREE;
}
/**
@@ -653,7 +654,8 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int probe)
}
scrn->currentMode = scrn->modes;
- setup_tear_free(sna);
+ if (!setup_tear_free(sna) && sna_mode_wants_tear_free(sna))
+ sna->kgem.needs_dirtyfb = sna->kgem.has_dirtyfb;
xf86SetGamma(scrn, zeros);
xf86SetDpi(scrn, 0, 0);