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>
This commit is contained in:
Alex Goins 2016-06-16 20:06:54 -07:00 committed by Adam Jackson
parent 500853086d
commit f6fef2a171

View File

@ -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);
}