From e3e91cebcd9307654eb3535e2f6521103ec8b997 Mon Sep 17 00:00:00 2001 From: Pierre-Eric Pelloux-Prayer Date: Mon, 9 Dec 2019 09:48:37 +0100 Subject: [PATCH] radeonsi: fix multi plane buffers creation MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit When using 3 planes, the sequence produces this chain: plane0 -> plane2 This commit fixes this to produce: plane0 -> plane1 -> plane2 Fixes: 86e60bc2659 ("radeonsi: remove si_vid_join_surfaces and use combined planar allocations") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2193 Reviewed-by: Marek Olšák --- src/gallium/drivers/radeonsi/si_texture.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/radeonsi/si_texture.c b/src/gallium/drivers/radeonsi/si_texture.c index de3cbb2bb88..474bc00f8c4 100644 --- a/src/gallium/drivers/radeonsi/si_texture.c +++ b/src/gallium/drivers/radeonsi/si_texture.c @@ -1722,10 +1722,12 @@ struct pipe_resource *si_texture_create(struct pipe_screen *screen, tex->plane_index = i; tex->num_planes = num_planes; - if (!last_plane) + if (!plane0) { plane0 = last_plane = tex; - else + } else { last_plane->buffer.b.b.next = &tex->buffer.b.b; + last_plane = tex; + } } return (struct pipe_resource *)plane0; -- 2.30.2