[PATCH v7 09/11] modesetting: Blacklist USB transport devices from PRIME sync

Hans de Goede hdegoede at redhat.com
Fri Jun 17 08:17:15 UTC 2016


Hi,

On 17-06-16 05:06, Alex Goins wrote:
> 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 at nvidia.com>

Patch looks good to me:

Reviewed-by: Hans de Goede <hdegoede at redhat.com>

Regards,

Hans


> ---
>  hw/xfree86/drivers/modesetting/driver.c | 14 ++++++++++++++
>  1 file changed, 14 insertions(+)
>
> diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
> index ab3b028..2d66a4b 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);
>  }
>


More information about the xorg-devel mailing list