[Mesa-dev] [PATCH 1/2] swrast: Avoid creating front buffers with __DRI_SWRAST_LOADER < 3.

Mathias Fröhlich Mathias.Froehlich at gmx.net
Tue Jun 18 06:23:09 UTC 2019


Hi Emil,

On Monday, 17 June 2019 19:35:10 CEST Emil Velikov wrote:
> On 2019/06/06, Mathias.Froehlich at gmx.net wrote:
> > From: Mathias Fröhlich <mathias.froehlich at web.de>
> > 
> > Align classic swrast with galliums software renderer with respect
> > to front buffer creation.
> > In case of front buffers swrast uses the __DRI_SWRAST_LOADER extensions
> > getImage/putImage callbacks to keep the front buffer in sync between
> > the X server and the mesa software rendering. Gallium sofware rasterizers
> > only allocates front buffers if the __DRI_SWRAST_LOADER extension version
> > is >= 3. By that the getImage/putImage NULL pointers of the recent
> > EGL_platform_device, which announces __DRI_SWRAST_LOADER version 1, are
> > never called and thus this combination works fine.
> > The change makes classic swrast work together with EGL_platform_device
> > by using the same __DRI_SWRAST_LOADER version check than egl.
> > For reference see drisw_allocate_textures in
> > src/gallium/state_trackers/dri/drisw.c.
> > 
> > Signed-off-by: Mathias Fröhlich <Mathias.Froehlich at web.de>
> > ---
> >  src/mesa/drivers/dri/swrast/swrast.c | 5 ++++-
> >  1 file changed, 4 insertions(+), 1 deletion(-)
> > 
> > diff --git a/src/mesa/drivers/dri/swrast/swrast.c b/src/mesa/drivers/dri/swrast/swrast.c
> > index 8e8d6bd628e..832a45f1d88 100644
> > --- a/src/mesa/drivers/dri/swrast/swrast.c
> > +++ b/src/mesa/drivers/dri/swrast/swrast.c
> > @@ -572,7 +572,10 @@ dri_create_buffer(__DRIscreen * sPriv,
> >      _mesa_initialize_window_framebuffer(fb, visual);
> > 
> >      /* add front renderbuffer */
> > -    frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE);
> > +    if (sPriv->swrast_loader->base.version >= 3)
> > +       frontrb = swrast_new_renderbuffer(visual, dPriv, GL_TRUE);
> > +    else
> > +       frontrb = swrast_new_renderbuffer(visual, dPriv, GL_FALSE);
> >      _mesa_attach_and_own_rb(fb, BUFFER_FRONT_LEFT, &frontrb->Base.Base);
> > 
> Doubt I'll be able to look at the classic swrast, anytime soon. Sorry :-\

Thanks for that information.
Anybody else?

Or can I do something else to make that work?
Emil, I provided already working implementations as ready to be squashed updates to
your egl device branch that implemented getImage/putImage, but you did not want to
implement getImage/putImage by any means. Now that is the port of the if clause that
that makes llvmpipe work with your implementation of the egl device without
getImage/putImage.
So what do you suggest?

best and thanks

Mathias

> 
> -Emil
> 






More information about the mesa-dev mailing list