[Mesa-dev] [PATCH 2/3] Create untiled buffers in get_back_bo when needed.

Kristian Høgsberg hoegsberg at gmail.com
Thu Nov 21 16:12:04 PST 2013


On Thu, Nov 07, 2013 at 05:13:37PM +0100, Axel Davy wrote:
> We must send to the compositor buffer it is able to read.
> 
> Since tiling modes are different on graphic cards, we have
> to disable tiling when creating the buffers if we render
> with a different graphic card than the compositor.
> 
> Signed-off-by: Axel Davy <axel.davy at ens.fr>

This looks fine.

Kristian

> ---
>  src/egl/drivers/dri2/platform_wayland.c | 17 +++++++++++------
>  1 file changed, 11 insertions(+), 6 deletions(-)
> 
> diff --git a/src/egl/drivers/dri2/platform_wayland.c b/src/egl/drivers/dri2/platform_wayland.c
> index 709df36..b922ff5 100644
> --- a/src/egl/drivers/dri2/platform_wayland.c
> +++ b/src/egl/drivers/dri2/platform_wayland.c
> @@ -283,12 +283,17 @@ get_back_bo(struct dri2_egl_surface *dri2_surf, __DRIbuffer *buffer)
>     if (dri2_surf->back == NULL)
>        return -1;
>     if (dri2_surf->back->dri_image == NULL) {
> -      dri2_surf->back->dri_image = 
> -         dri2_dpy->image->createImage(dri2_dpy->dri_screen,
> -                                      dri2_surf->base.Width,
> -                                      dri2_surf->base.Height,
> -                                      __DRI_IMAGE_FORMAT_ARGB8888,
> -                                      __DRI_IMAGE_USE_SHARE,
> +      unsigned int use_flags = __DRI_IMAGE_USE_SHARE;
> +
> +      if (!dri2_dpy->enable_tiling)
> +         use_flags |= __DRI_IMAGE_USE_LINEAR;
> +
> +       dri2_surf->back->dri_image = 
> +          dri2_dpy->image->createImage(dri2_dpy->dri_screen,
> +                                       dri2_surf->base.Width,
> +                                       dri2_surf->base.Height,
> +                                       __DRI_IMAGE_FORMAT_ARGB8888,
> +                                      use_flags,
>                                        NULL);
>        dri2_surf->back->age = 0;
>     }
> -- 
> 1.8.1.2
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list