[PATCH v2] glamor: Make glamor_name_from_pixmap work without DRI3
Mark Kettenis
mark.kettenis at xs4all.nl
Wed Nov 18 14:45:53 PST 2015
> From: Eric Anholt <eric at anholt.net>
> Date: Wed, 18 Nov 2015 12:57:31 -0800
>
> Mark Kettenis <kettenis at openbsd.org> writes:
>
> > This function is used by the modesetting driver to implement DRI2 and
> > shouldn't fail on systems that don't support DRI3. Remove the check
> > for DRI3 and rename glamor_egl_dri3_fd_name_from_tex to
> > glamor_egl_fd_name_from_tex.
>
> At the time you sent the patch, if you didn't have the dri3_capable ->
> glamor_enable_dri3() -> dri3_enable flag series set, then you wouldn't
> have had glamor_egl_create_argb8888_based_texture() getting called, so
> you'd make your EGL image to share out of whatever random format your GL
> chose. That probably explains your byte swapping bugs.
>
> Also, if you didn't have dri3_capable set, then you hadn't succeeded at
> the check for EGL_KHR_gl_texture_2D_image and
> EGL_EXT_image_dma_buf_import and GL_OES_EGL_image. I expect on your
> platform you don't have EXT_image_dma_buf_import, but you still need to
> check for the others before trying it.
>
> Now, post glamor-delay-shareable, we shouldn't have the issue with byte
> swapping since I always make the GBM bo-based EGLImage when exporting.
> So, could you respin in a way that just makes sure that we've checked
> for the appropriate extensions (see the calls in
> glamor_egl_create_textured_pixmap_from_gbm_bo() and
> glamor_create_texture_from_image())?
Thanks. The current master with my diffs on top seems to work.
Haven't fully processed your comments about checking the appropriate
extensions. Will try to do that tomorrow and respin the diff.
> Oh, also, make sure you rename the other callers of
> glamor_egl_dri3_fd_name_from_tex() in the tree.
Ah, I missed wayland and the stubs which aren't built on my system.
> > Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> > ---
> > glamor/glamor.c | 2 --
> > glamor/glamor.h | 6 +++---
> > glamor/glamor_egl.c | 8 ++++----
> > 3 files changed, 7 insertions(+), 9 deletions(-)
> >
> > diff --git a/glamor/glamor.c b/glamor/glamor.c
> > index d4a0236..110bdb8 100644
> > --- a/glamor/glamor.c
> > +++ b/glamor/glamor.c
> > @@ -776,8 +776,6 @@ glamor_name_from_pixmap(PixmapPtr pixmap, CARD16 *str=
> ide, CARD32 *size)
> > glamor_screen_private *glamor_priv =3D
> > glamor_get_screen_private(pixmap->drawable.pScreen);
> >=20=20
> > - if (!glamor_priv->dri3_enabled)
> > - return -1;
> > switch (pixmap_priv->type) {
> > case GLAMOR_TEXTURE_DRM:
> > case GLAMOR_TEXTURE_ONLY:
> > diff --git a/glamor/glamor.h b/glamor/glamor.h
> > index 4be8800..01b6e4c 100644
> > --- a/glamor/glamor.h
> > +++ b/glamor/glamor.h
> > @@ -144,9 +144,9 @@ extern _X_EXPORT unsigned int glamor_egl_create_argb8=
> 888_based_texture(ScreenPtr
> > i=
> nt w,
> > i=
> nt h,
> > B=
> ool linear);
> > -extern _X_EXPORT int glamor_egl_dri3_fd_name_from_tex(ScreenPtr, PixmapP=
> tr,
> > - unsigned int, Bool,
> > - CARD16 *, CARD32 *=
> );
> > +extern _X_EXPORT int glamor_egl_fd_name_from_tex(ScreenPtr, PixmapPtr,
> > + unsigned int, Bool,
> > + CARD16 *, CARD32 *);
> >=20=20
> > extern void glamor_egl_destroy_pixmap_image(PixmapPtr pixmap);
> >=20=20
> > diff --git a/glamor/glamor_egl.c b/glamor/glamor_egl.c
> > index 2e6c7bd..9b91147 100644
> > --- a/glamor/glamor_egl.c
> > +++ b/glamor/glamor_egl.c
> > @@ -471,10 +471,10 @@ glamor_gbm_bo_from_pixmap(ScreenPtr screen, PixmapP=
> tr pixmap)
> > }
> >=20=20
> > int
> > -glamor_egl_dri3_fd_name_from_tex(ScreenPtr screen,
> > - PixmapPtr pixmap,
> > - unsigned int tex,
> > - Bool want_name, CARD16 *stride, CARD32 =
> *size)
> > +glamor_egl_fd_name_from_tex(ScreenPtr screen,
> > + PixmapPtr pixmap,
> > + unsigned int tex,
> > + Bool want_name, CARD16 *stride, CARD32 *size)
> > {
> > #ifdef GLAMOR_HAS_GBM
> > struct glamor_egl_screen_private *glamor_egl;
> > --=20
> > 2.6.3
> >
> > _______________________________________________
> > xorg-devel at lists.x.org: X.Org development
> > Archives: http://lists.x.org/archives/xorg-devel
> > Info: http://lists.x.org/mailman/listinfo/xorg-devel
>
> --=-=-=
More information about the xorg-devel
mailing list