[PATCH] xfree86: Revert workaround for drm race condition.

Peter Hutterer peter.hutterer at who-t.net
Thu Apr 11 16:57:40 PDT 2013


On Wed, Apr 10, 2013 at 11:05:40PM -0700, Bryce Harrington wrote:
> Revert 70739e817b2d64bc020ea491f23a3574bdb6155e and mostly revert
> c31eac647a9ecf0fb20dc98266cadf0ba923ba14.
> 
> Further investigation shows the encountered race condition is between
> lightdm and plymouth-splash, as implemented in the Ubuntu distribution
> within the limitations of upstart's job coordination logic, and can (and
> should) be fixed within those limiations.  Not in xserver itself.
> 
> This leaves some of the diagnostic improvements from the recent patch
> series, in case others run into a similar situation.
> 
> Signed-off-by: Bryce Harrington <bryce at canonical.com>

Reviewed-by: Peter Hutterer <peter.hutterer at who-t.net>

and merged. the 2s wait delayed server startup in the test suite, causing
the test runs to go up from 200-400ms per test to 4.5s per test, which is
rather unacceptable if you're running a few hundred tests.

(get_drm_info is called twice for each device)

Cheers,
   Peter


> ---
>  hw/xfree86/os-support/linux/lnx_platform.c |   30 ++++++----------------------
>  1 file changed, 6 insertions(+), 24 deletions(-)
> 
> diff --git a/hw/xfree86/os-support/linux/lnx_platform.c b/hw/xfree86/os-support/linux/lnx_platform.c
> index 444f8f5..33a953c 100644
> --- a/hw/xfree86/os-support/linux/lnx_platform.c
> +++ b/hw/xfree86/os-support/linux/lnx_platform.c
> @@ -26,35 +26,17 @@ get_drm_info(struct OdevAttributes *attribs, char *path)
>      char *buf;
>      int fd;
>      int err = 0;
> -    int tries = 0;
>  
>      fd = open(path, O_RDWR, O_CLOEXEC);
>      if (fd == -1)
>          return FALSE;
>  
> -    while (tries++ < 200) {
> -	sv.drm_di_major = 1;
> -	sv.drm_di_minor = 4;
> -	sv.drm_dd_major = -1;       /* Don't care */
> -	sv.drm_dd_minor = -1;       /* Don't care */
> -
> -	err = drmSetInterfaceVersion(fd, &sv);
> -	if (!err) {
> -	    if (tries > 1)
> -		LogMessage(X_INFO, "setversion 1.4 succeeded on try #%d\n", tries);
> -	    break;
> -	} if (err == -EACCES) {
> -	    if (tries % 500 == 0)
> -		LogMessage(X_INFO, "waiting on drm device...\n");
> -	} else {
> -	    break;
> -	}
> -
> -	usleep(10000);
> -
> -	if (!drmSetMaster(fd))
> -	    LogMessage(X_INFO, "drmSetMaster succeeded\n");
> -    }
> +    sv.drm_di_major = 1;
> +    sv.drm_di_minor = 4;
> +    sv.drm_dd_major = -1;       /* Don't care */
> +    sv.drm_dd_minor = -1;       /* Don't care */
> +
> +    err = drmSetInterfaceVersion(fd, &sv);
>      if (err) {
>          ErrorF("setversion 1.4 failed: %s\n", strerror(-err));
>  	goto out;
> -- 
> 1.7.9.5
> 
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: http://lists.x.org/mailman/listinfo/xorg-devel
> 


More information about the xorg-devel mailing list