[PATCH xf86-video-ati] Add support for server managed fds

Mark Kettenis mark.kettenis at xs4all.nl
Sat Mar 15 02:49:06 PDT 2014


> From: Hans de Goede <hdegoede at redhat.com>
> Date: Tue, 11 Mar 2014 11:09:19 +0100
> 
> Signed-off-by: Hans de Goede <hdegoede at redhat.com>
> ---
>  src/radeon_kms.c   | 60 +++++++++++++++++++++++++++++++++++++++++++++---------
>  src/radeon_probe.c |  5 +++++
>  src/radeon_probe.h |  2 ++
>  3 files changed, 57 insertions(+), 10 deletions(-)
> 
> diff --git a/src/radeon_kms.c b/src/radeon_kms.c
> index 4a6c38e..6c5994c 100644
> --- a/src/radeon_kms.c
> +++ b/src/radeon_kms.c
> @@ -180,7 +180,11 @@ static void RADEONFreeRec(ScrnInfoPtr pScrn)
>          pRADEONEnt = pPriv->ptr;
>          pRADEONEnt->fd_ref--;
>          if (!pRADEONEnt->fd_ref) {
> -            drmClose(pRADEONEnt->fd);
> +#ifdef XF86_PDEV_SERVER_FD
> +            if (!(pRADEONEnt->platform_dev &&
> +                    pRADEONEnt->platform_dev->flags & XF86_PDEV_SERVER_FD))
> +#endif
> +                drmClose(pRADEONEnt->fd);
>              pRADEONEnt->fd = 0;
>          }
>      }
> @@ -599,6 +603,15 @@ static Bool radeon_open_drm_master(ScrnInfoPtr pScrn)
>  	goto out;
>      }
>  
> +#if defined(ODEV_ATTRIB_FD)
> +    if (pRADEONEnt->platform_dev) {
> +        info->dri2.drm_fd = xf86_get_platform_device_int_attrib(
> +                                pRADEONEnt->platform_dev, ODEV_ATTRIB_FD, -1);
> +        if (info->dri2.drm_fd != -1)
> +            goto got_fd;

Sorry, but this is firmly above my spaghetti-style goto threshold.

Same issue with most/all of the other driver conversions you did.


More information about the xorg-devel mailing list