[PATCH xserver] glamor: Restore glamor_fd_from_pixmap and glamor_pixmap_from_fd

Daniel Stone daniel at fooishbar.org
Tue Mar 6 10:34:21 UTC 2018


Hi Michel,

On 6 March 2018 at 09:53, Michel Dänzer <michel at daenzer.net> wrote:
> They're part of the 1.20 RC1 ABI, and actually used by external drivers.
> Also, requiring drivers which don't support the new functionality in
> DRI3 1.2 to switch to the new interfaces seems unreasonable.

Thanks for this, and apologies: I'd only checked the DRI3 interface
and missed the Glamor ABI change.

> +_X_EXPORT PixmapPtr
> +glamor_pixmap_from_fd(ScreenPtr screen,
> +                      int fd,
> +                      CARD16 width,
> +                      CARD16 height,
> +                      CARD16 stride, CARD8 depth, CARD8 bpp)
> +{
> +    PixmapPtr pixmap;
> +    Bool ret;
> +
> +    pixmap = screen->CreatePixmap(screen, 0, 0, depth, 0);
> +
> +    ret = glamor_back_pixmap_from_fd(pixmap, fd, width, height,
> +                                     stride, depth, bpp);
> +
> +    if (ret == FALSE) {
> +        screen->DestroyPixmap(pixmap);
> +        return NULL;
> +    }
> +    return pixmap;
> +}

Any reason to not make this just 'return
glamor_pixmap_from_fds(screen, 1, &fd, width, height, &stride, &{0},
depth, bpp, DRM_FORMAT_MOD_INVALID)'? Regardless, this is:
Reviewed-by: Daniel Stone <daniels at collabora.com>

Cheers,
Daniel


More information about the xorg-devel mailing list