[PATCH xf86-video-ati 4/4] glamor: Reallocate linear pixmap BO if necessary for DRI2 PRIME

Alex Deucher alexdeucher at gmail.com
Tue Sep 13 14:22:08 UTC 2016


On Tue, Sep 13, 2016 at 4:55 AM, Michel Dänzer <michel at daenzer.net> wrote:
> From: Michel Dänzer <michel.daenzer at amd.com>
>
> Fixes corruption when using DRI2 PRIME render offloading with the master
> screen using this driver.
>
> (Ported from amdgpu commit 0007c2f018ba663303d91d847e7c085269a23062)
>
> Signed-off-by: Michel Dänzer <michel.daenzer at amd.com>

For the series:
Reviewed-by: Alex Deucher <alexander.deucher at amd.com>

> ---
>  src/radeon_glamor.c | 20 ++++++++++++++++++++
>  1 file changed, 20 insertions(+)
>
> diff --git a/src/radeon_glamor.c b/src/radeon_glamor.c
> index f46e8ba..7a6bf53 100644
> --- a/src/radeon_glamor.c
> +++ b/src/radeon_glamor.c
> @@ -342,6 +342,26 @@ radeon_glamor_share_pixmap_backing(PixmapPtr pixmap, ScreenPtr slave,
>         CARD32 size;
>         int fd;
>
> +       if ((radeon_get_pixmap_tiling_flags(pixmap) &
> +            RADEON_TILING_MASK) != RADEON_TILING_LINEAR) {
> +               PixmapPtr linear;
> +
> +               /* We don't want to re-allocate the screen pixmap as
> +                * linear, to avoid trouble with page flipping
> +                */
> +               if (screen->GetScreenPixmap(screen) == pixmap)
> +                       return FALSE;
> +
> +               linear = screen->CreatePixmap(screen, pixmap->drawable.width,
> +                                             pixmap->drawable.height,
> +                                             pixmap->drawable.depth,
> +                                             CREATE_PIXMAP_USAGE_SHARED);
> +               if (!linear)
> +                       return FALSE;
> +
> +               radeon_glamor_set_pixmap_bo(&pixmap->drawable, linear);
> +       }
> +
>         fd = glamor_fd_from_pixmap(screen, pixmap, &stride, &size);
>         if (fd < 0)
>                 return FALSE;
> --
> 2.9.3
>
> _______________________________________________
> amd-gfx mailing list
> amd-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/amd-gfx


More information about the amd-gfx mailing list