summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicolai Hähnle <nicolai.haehnle@amd.com>2018-01-16 18:57:10 +0100
committerNicolai Hähnle <nicolai.haehnle@amd.com>2018-01-16 20:15:32 +0100
commit6f06c36b8da0be7f0031bafa9e7de1da35cab08d (patch)
tree78a4e4a939897605a36a20d340f2c9a3bd15ad67
parent9add4eaf3032f5c8d64b8a365817b4f4ce8180c5 (diff)
ac_surface: don't apply the 256-byte alignment to staging surfacesuser_stride
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 <airlied@redhat.com>
-rw-r--r--src/amd/common/ac_surface.c5
1 files changed, 4 insertions, 1 deletions
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);