[PATCH 6/6] glamor: Add support for DRI3.

Eric Anholt eric at anholt.net
Tue Feb 25 11:04:58 PST 2014


davyaxel at free.fr writes:

> Hi,
>
> While for XWayland we want to provide our own dri3_open, we still want to have glamor
> enabling the dri3 support
>
> That is rather a GLAMOR_NO_DRI3_SETUP flag
>
> and
>
> +    if (glamor_egl->dri3_capable && !(glamor_priv->flags & GLAMOR_NO_DRI3)) {
> +        /* Tell the core that we have the interfaces for import/export
> +         * of pixmaps.
> +         */
> +        glamor_enable_dri3(screen);
> +
> +        /* To do DRI3 device FD generation, we need to open a new fd
> +         * to the same device we were handed in originally.
> +         */
> +        glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd);
> +
> +        if (!dri3_screen_init(screen, &glamor_dri3_info)) {
> +            xf86DrvMsg(scrn->scrnIndex, X_ERROR,
> +                       "Failed to initialize DRI3.\n");
> +        }
> +    }
>
>
> would be like that:
>
> +    if (glamor_egl->dri3_capable) {
> +        /* Tell the core that we have the interfaces for import/export
> +         * of pixmaps.
> +         */
> +        glamor_enable_dri3(screen);
> +
> +        if (!(glamor_priv->flags & GLAMOR_NO_DRI3_SETUP)) {
> +            /* To do DRI3 device FD generation, we need to open a new fd
> +             * to the same device we were handed in originally.
> +             */
> +            glamor_egl->device_path = drmGetDeviceNameFromFd(glamor_egl->fd);
> +
> +            if (!dri3_screen_init(screen, &glamor_dri3_info)) {
> +                xf86DrvMsg(scrn->scrnIndex, X_ERROR,
> +                           "Failed to initialize DRI3.\n");
> +            }
> +        }
> +    }
>
> Otherwise, it looks fine.
>
> Perhaps it would be better to detect if the device is a render-node or not,
> and if it is a render-node, then prevent doing an IOCTL call for nothing.

Yeah, I thought you were all about using render nodes, in which case you
don't need auth, so you would want to fix the generic path to detect
that and not need custom code and flags for wayland.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 818 bytes
Desc: not available
URL: <http://lists.x.org/archives/xorg-devel/attachments/20140225/c1505873/attachment.pgp>


More information about the xorg-devel mailing list