summaryrefslogtreecommitdiff
path: root/hw
diff options
context:
space:
mode:
authorAlex Goins <agoins@nvidia.com>2016-06-16 20:06:54 -0700
committerAdam Jackson <ajax@redhat.com>2016-06-28 12:56:37 -0400
commitf6fef2a171366156c4c6807de7fe086f04f41b7b (patch)
tree701cdb9043aa93227387503a56697e2cde14f27d /hw
parent500853086dd5fbfe6d2b3e30923fdc4d8c262cf0 (diff)
modesetting: Blacklist USB transport devices from PRIME sync
UDL (USB 2.0 DisplayLink DRM driver) and other drivers for USB transport devices have strange semantics when it comes to vblank events, due to their inability to get the actual vblank info. When doing a page flip, UDL instantly raises a vblank event without waiting for vblank. It also has no support for DRM_IOCTL_WAIT_VBLANK, and has some strange behavior with how it handles damage when page flipping. It's possible to get something semi-working by hacking around these issues, but even then there isn't much value-add vs single buffered PRIME, and it reduces maintainability and adds additional risks to the modesetting driver when running with more well-behaved DRM drivers. Work needs to be done on UDL in order to properly support synchronized PRIME. For now, just blacklist it, causing RandR to fall back to unsynchronized PRIME. This patch originally blacklisted UDL by name, but it was pointed out that there are other USB transport device drivers with similar limitations, so it was expanded to blacklist all USB transport devices. v1: N/A v2: N/A v3: Initial commit v4: Move check to driver.c for consistency/visibility v5: Refactor to accomodate earlier changes v6: Rebase onto ToT v7: Expand to blacklist all USB transport devices, not just UDL Signed-off-by: Alex Goins <agoins@nvidia.com> Reviewed-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Dave Airlie <airlied@redhat.com>
Diffstat (limited to 'hw')
-rw-r--r--hw/xfree86/drivers/modesetting/driver.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index ab3b0283d..2d66a4b8f 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -973,6 +973,7 @@ msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back)
ScreenPtr screen = crtc->pScreen;
ScrnInfoPtr scrn = xf86ScreenToScrn(screen);
modesettingPtr ms = modesettingPTR(scrn);
+ EntityInfoPtr pEnt = ms->pEnt;
xf86CrtcPtr xf86Crtc = crtc->devPrivate;
if (!xf86Crtc)
@@ -986,6 +987,19 @@ msEnableSharedPixmapFlipping(RRCrtcPtr crtc, PixmapPtr front, PixmapPtr back)
if (ms->drmmode.reverse_prime_offload_mode)
return FALSE;
+#if XSERVER_PLATFORM_BUS
+ if (pEnt->location.type == BUS_PLATFORM) {
+ char *syspath =
+ xf86_platform_device_odev_attributes(pEnt->location.id.plat)->
+ syspath;
+
+ /* Not supported for devices using USB transport due to misbehaved
+ * vblank events */
+ if (syspath && strstr(syspath, "usb"))
+ return FALSE;
+ }
+#endif
+
return drmmode_EnableSharedPixmapFlipping(xf86Crtc, &ms->drmmode,
front, back);
}