From 7c145222bb9628f6ae187636304fa52b464411ab Mon Sep 17 00:00:00 2001 From: Nicolai Hähnle Date: Tue, 16 Jan 2018 18:57:10 +0100 Subject: ac_surface: don't apply the 256-byte alignment to staging surfaces Having the over-alignment on staging surfaces breaks the user_stride mechanism. This whole thing is a hack. We should really have a generic mechanism for specifying minimum stride alignments. In the meantime, I'm not sure if this breaks radv with GFX6/GFX9 hybrid graphics (e.g., pre-gfx9 on Raven). Cc: Dave Airlie --- src/amd/common/ac_surface.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/amd/common/ac_surface.c b/src/amd/common/ac_surface.c index c5bce0b651..93b75bc48f 100644 --- a/src/amd/common/ac_surface.c +++ b/src/amd/common/ac_surface.c @@ -265,8 +265,11 @@ static int gfx6_compute_level(ADDR_HANDLE addrlib, /* Make GFX6 linear surfaces compatible with GFX9 for hybrid graphics, * because GFX9 needs linear alignment of 256 bytes. + * + * This should not be applied to staging surfaces. */ - if (config->info.levels == 1 && + if ((surf->flags & (RADEON_SURF_SCANOUT | RADEON_SURF_SHAREABLE)) && + config->info.levels == 1 && AddrSurfInfoIn->tileMode == ADDR_TM_LINEAR_ALIGNED && AddrSurfInfoIn->bpp) { unsigned alignment = 256 / (AddrSurfInfoIn->bpp / 8); -- cgit v1.2.3