From 6f06c36b8da0be7f0031bafa9e7de1da35cab08d 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 590920ee2b..6f394384d1 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