summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2016-11-30 13:40:08 -0800
committerBen Widawsky <ben@bwidawsk.net>2017-03-27 22:24:59 -0700
commitebacbd2a6ba5bd0aca480c840e91a33fd80f071c (patch)
tree9231f65a5b37690554d988bf28099c0caa31787a
parent13a82678522a7cc4742c04525ed98292ea0f938c (diff)
i965: Make CCS stride match kernel's expectations
v2: Put the commit message as a comment (Topi) v3: Use different stride calculation. (Jason) Quoting Jason's review feedback: "Does the kernel expect the alignment to be 128 or 64? Given that ville likes 64-wide tiles, I think it should be 64. Really, I think the more accurate calculation would be stride = ALIGN(parent->pitch, 4096) / 64; 4096 is the stride in bytes in the primary surface required to cross a single CCS tile. The calculation you have above will work in the sense that the worst that happens is for it to align up a bit too far. In any case, what matters is that we a) have enough space and b) exactly match the kernel's calculation." The above doesn't actually work. The kernel seems to want a divisor of 128. Cc: Topi Pohjolainen <topi.pohjolainen@gmail.com> Cc: Ville Syrjälä <ville.syrjala@linux.intel.com> Cc: Jason Ekstrand <jason@jlekstrand.net> Signed-off-by: Ben Widawsky <ben@bwidawsk.net> Acked-by: Daniel Stone <daniels@collabora.com>
-rw-r--r--src/mesa/drivers/dri/i965/intel_screen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index 8bd179338e..746c6c938e 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -968,7 +968,10 @@ intel_from_planar(__DRIimage *parent, int plane, void *loaderPrivate)
height = ALIGN(DIV_ROUND_UP(parent->height, 16), 64);
dri_format = parent->dri_format;
offset = parent->aux_offset;
- stride = ALIGN(parent->pitch / 32, 128);
+ /* Make CCS stride match kernel's expectations. Mesa's internals
+ * expect: stride = ALIGN(parent->pitch / 32, 128)
+ */
+ stride = ALIGN(parent->pitch / 4096, 128);
} else {
return NULL;
}