summaryrefslogtreecommitdiff
path: root/src/sna/sna_driver.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2014-05-30 21:21:00 +0100
committerChris Wilson <chris@chris-wilson.co.uk>2014-06-02 08:32:11 +0100
commitc17d704a5baa0c902994f035d3da39d77d31fef3 (patch)
tree6fe4db6c9ec0ad6dcc4c46ee6b1611c24bc7f42a /src/sna/sna_driver.c
parentc95a4002d1d27937731c59e84254ccb3b1246ccd (diff)
sna: Enable kernel support for asynchronous flips
If a flip fails, attempt to restore the previous working configuration (using a modeset) then disable further flipping. 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.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/src/sna/sna_driver.c b/src/sna/sna_driver.c
index f609254c..9d079cb8 100644
--- a/src/sna/sna_driver.c
+++ b/src/sna/sna_driver.c
@@ -294,27 +294,6 @@ static bool has_vsync(struct sna *sna)
return true;
}
-static bool has_pageflipping(struct sna *sna)
-{
- drm_i915_getparam_t gp;
- int v;
-
- if (sna->flags & SNA_IS_HOSTED)
- return false;
-
- v = 0;
-
- VG_CLEAR(gp);
- gp.param = I915_PARAM_HAS_PAGEFLIPPING;
- gp.value = &v;
-
- if (drmIoctl(sna->kgem.fd, DRM_IOCTL_I915_GETPARAM, &gp))
- return false;
-
- VG(VALGRIND_MAKE_MEM_DEFINED(&v, sizeof(v)));
- return v > 0;
-}
-
static void sna_setup_capabilities(ScrnInfoPtr scrn, int fd)
{
#if HAS_PIXMAP_SHARING && defined(DRM_CAP_PRIME)
@@ -576,7 +555,7 @@ static Bool sna_pre_init(ScrnInfoPtr scrn, int flags)
sna->flags |= SNA_NO_VSYNC;
DBG(("%s: vsync? %s\n", __FUNCTION__, sna->flags & SNA_NO_VSYNC ? "disabled" : "enabled"));
- if (!has_pageflipping(sna) ||
+ if (sna->flags & SNA_IS_HOSTED ||
!xf86ReturnOptValBool(sna->Options, OPTION_PAGEFLIP, TRUE))
sna->flags |= SNA_NO_FLIP;
DBG(("%s: page flips? %s\n", __FUNCTION__, sna->flags & SNA_NO_FLIP ? "disabled" : "enabled"));