summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--hw/xfree86/drivers/modesetting/driver.c8
-rw-r--r--hw/xfree86/drivers/modesetting/driver.h1
-rw-r--r--hw/xfree86/drivers/modesetting/present.c7
3 files changed, 14 insertions, 2 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index ec4189a2c..5dc8e202c 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -1040,6 +1040,14 @@ PreInit(ScrnInfoPtr pScrn, int flags)
#endif
}
+ /*
+ * Use "atomic modesetting disable" request to detect if the kms driver is
+ * atomic capable, regardless if we will actually use atomic modesetting.
+ * This is effectively a no-op, we only care about the return status code.
+ */
+ ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 0);
+ ms->atomic_modeset_capable = (ret == 0);
+
if (xf86ReturnOptValBool(ms->drmmode.Options, OPTION_ATOMIC, FALSE)) {
ret = drmSetClientCap(ms->fd, DRM_CLIENT_CAP_ATOMIC, 1);
ms->atomic_modeset = (ret == 0);
diff --git a/hw/xfree86/drivers/modesetting/driver.h b/hw/xfree86/drivers/modesetting/driver.h
index a99f37871..28810c063 100644
--- a/hw/xfree86/drivers/modesetting/driver.h
+++ b/hw/xfree86/drivers/modesetting/driver.h
@@ -108,6 +108,7 @@ typedef struct _modesettingRec {
* Page flipping stuff.
* @{
*/
+ Bool atomic_modeset_capable;
Bool atomic_modeset;
Bool pending_modeset;
/** @} */
diff --git a/hw/xfree86/drivers/modesetting/present.c b/hw/xfree86/drivers/modesetting/present.c
index 186309a29..f7a475356 100644
--- a/hw/xfree86/drivers/modesetting/present.c
+++ b/hw/xfree86/drivers/modesetting/present.c
@@ -252,8 +252,11 @@ ms_present_check_unflip(RRCrtcPtr crtc,
if (num_crtcs_on == 0)
return FALSE;
- /* Check stride, can't change that on flip */
- if (!ms->atomic_modeset &&
+ /*
+ * Check stride, can't change that reliably on flip on some drivers, unless
+ * the kms driver is atomic_modeset_capable.
+ */
+ if (!ms->atomic_modeset_capable &&
pixmap->devKind != drmmode_bo_get_pitch(&ms->drmmode.front_bo))
return FALSE;