[PATCH xserver v2 1/2] glamor: Unbreak glamor_fd_from_pixmap()

Lyude Paul lyude at redhat.com
Thu Jun 21 19:10:48 UTC 2018


On Thu, 2018-06-21 at 08:38 +0100, Daniel Stone wrote:
> Hey Lyude,
> On Thu, 21 Jun 2018 at 00:13, Lyude Paul <lyude at redhat.com> wrote:
> > -    /* Pixmaps with multi-planes/modifier are not supported in this
> > interface */
> > -    if (ret != 1 || offsets[0] != 0) {
> > -        while (ret > 0)
> > -            close(fds[--ret]);
> > +    ret = _glamor_fds_from_pixmap(screen, pixmap, &fd, &stride32, NULL,
> > size,
> > +                                  NULL);
> > +    if (ret != 1)
> >          return -1;
> 
> This needs the removed code just above it, where it closes excess FDs.
> I think the rest looks good though; I don't have a PRIME system so
> wasn't able to test at the time.
I think there is a misunderstanding here, as that bit of code was the bug this
patch is supposed to fix. There's nothing excess it's closing, it either gets
a single plane non-modifier bo (which never actually happens) and returns
that, or gets a multi plane bo with modifiers and drops the bo entirely by
closing all of it's file descriptors and returning -1.

We avoid that problem entirely in the new code by making it so that
glamor_fd_from_pixmap() doesn't pass modifiers to _glamor_fds_from_pixmap(),
which makes _glamor_fds_from_pixmap() call glamor_egl_fd_from_pixmap() which
is only capable of returning a single file descriptor for a bo without
modifiers or multiple planes.

> 
> Cheers,
> Daniel
> _______________________________________________
> xorg-devel at lists.x.org: X.Org development
> Archives: http://lists.x.org/archives/xorg-devel
> Info: https://lists.x.org/mailman/listinfo/xorg-devel
-- 
Cheers,
	Lyude Paul


More information about the xorg-devel mailing list