davya...@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.

Attachment: pgpDjn2XeNsiN.pgp
Description: PGP signature

_______________________________________________
xorg-devel@lists.x.org: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to