[Linux-graphics-maintainer] [PATCH] glamor: Work around GEM usage v2
Lyude Paul
lyude at redhat.com
Wed Jun 27 19:15:37 UTC 2018
Pushed, thanks!
➜ xserver git:(master) git push
Counting objects: 4, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (4/4), done.
Writing objects: 100% (4/4), 791 bytes | 791.00 KiB/s, done.
Total 4 (delta 3), reused 0 (delta 0)
remote: Updating patchwork state for https://patchwork.freedesktop.org/project/Xorg/list/
remote: I: patch #230621 updated using rev 9f02855e7a1b7a3c1e2ee7bfbc73e87c29126920.
remote: I: 1 patch(es) updated to state Accepted.
To ssh://git.freedesktop.org/git/xorg/xserver
dc90b1c3c..9f02855e7 master -> master
On Wed, 2018-06-20 at 20:18 +0200, Thomas Hellstrom wrote:
> On 06/20/2018 07:58 PM, Deepak Singh Rawat wrote:
> > The patch looks good to me just one question, I see that flink name
> > is returned as fd, so handle is what vmwgfx expecting in that case ?
>
> Yes. vmwgfx doesn't differentiate between handles and names.
>
> /Thomas
>
>
>
> >
> > Reviewed-by: Deepak Rawat <drawat at vmware.com>
> >
> > > KMS drivers are not required to support GEM. In particular, vmwgfx
> > > doesn't support flink and handles and names are identical.
> > > Getting a bo name should really be part of a lower level API, if needed,
> > > but in the mean time work around this by setting the name identical to
> > > the handle if GEM isn't supported.
> > >
> > > This fixes modesetting driver dri2 on vmwgfx.
> > >
> > > Signed-off-by: Thomas Hellstrom <thellstrom at vmware.com>
> > > ---
> > > v2: Strip changes to an unrelated file.
> > > ---
> > > glamor/glamor_egl.c | 14 ++++++++++++--
> > > 1 file changed, 12 insertions(+), 2 deletions(-)
> > >
> > > diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
> > > index 4a4ca4bd8..7ec749742 100644
> > > --- a/glamor/glamor_egl.c
> > > +++ b/glamor/glamor_egl.c
> > > @@ -99,8 +99,18 @@ glamor_get_flink_name(int fd, int handle, int *name)
> > > struct drm_gem_flink flink;
> > >
> > > flink.handle = handle;
> > > - if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0)
> > > - return FALSE;
> > > + if (ioctl(fd, DRM_IOCTL_GEM_FLINK, &flink) < 0) {
> > > +
> > > + /*
> > > + * Assume non-GEM kernels have names identical to the handle
> > > + */
> > > + if (errno == ENODEV) {
> > > + *name = handle;
> > > + return TRUE;
> > > + } else {
> > > + return FALSE;
> > > + }
> > > + }
> > > *name = flink.name;
> > > return TRUE;
> > > }
> > > --
> > > 2.14.3
> > >
> > > _______________________________________________
> > > Sent to linux-graphics-maintainer at vmware.com
>
>
> _______________________________________________
> 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