<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jan 23, 2017 at 10:21 PM, Ben Widawsky <span dir="ltr"><<a href="mailto:ben@bwidawsk.net" target="_blank">ben@bwidawsk.net</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">FINISHME: Use the kernel's final choice for the fb modifier<br>
<br>
bwidawsk@norris2:~/intel-gfx/<wbr>kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube none<br>
Read bandwidth: 603.91 MiB/s<br>
Write bandwidth: 615.28 MiB/s<br>
bwidawsk@norris2:~/intel-gfx/<wbr>kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube ytile<br>
Read bandwidth: 571.13 MiB/s<br>
Write bandwidth: 555.51 MiB/s<br>
bwidawsk@norris2:~/intel-gfx/<wbr>kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube ccs<br>
Read bandwidth: 259.34 MiB/s<br>
Write bandwidth: 337.83 MiB/s<br>
<br>
v2: Move all references to the new fourcc code(s) to this patch.<br>
<br>
Signed-off-by: Ben Widawsky <<a href="mailto:ben@bwidawsk.net">ben@bwidawsk.net</a>><br>
Acked-by: Daniel Stone <<a href="mailto:daniels@collabora.com">daniels@collabora.com</a>><br>
---<br>
src/mesa/drivers/dri/i965/<wbr>intel_screen.c | 18 ++++++++++++++++++<br>
1 file changed, 18 insertions(+)<br>
<br>
diff --git a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
index 12b3b071e4..9914eff6e0 100644<br>
--- a/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
+++ b/src/mesa/drivers/dri/i965/<wbr>intel_screen.c<br>
@@ -560,11 +560,15 @@ select_best_modifier(struct gen_device_info *devinfo,<br>
const uint64_t *modifiers,<br>
const unsigned count)<br>
{<br>
+#define YTILE_CCS_Yf (1 << 4)<br></blockquote><div><br></div><div>Why not YfTILE_CCS? Y_TILE_*_Yf makes very little sense. I mean, it sort-of does with the weird way the docs like to say things, but Y and Yf are different tiling formats.<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+#define YTILE_CCS (1 << 3)<br>
#define YTILE (1 << 2)<br>
#define XTILE (1 << 1)<br>
#define LINEAR (1 << 0)<br>
<br>
const uint64_t prio_modifiers[] = {<br>
+ /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5),<br>
+ /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4),<br>
I915_FORMAT_MOD_Y_TILED,<br>
I915_FORMAT_MOD_X_TILED,<br>
DRM_FORMAT_MOD_LINEAR };<br>
@@ -586,6 +590,12 @@ select_best_modifier(struct gen_device_info *devinfo,<br>
<br>
modifier_bitmask |= YTILE;<br>
break;<br>
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):<br>
+ modifier_bitmask |= YTILE_CCS;<br>
+ break;<br>
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):<br>
+ modifier_bitmask |= YTILE_CCS_Yf;<br>
+ break;<br>
}<br>
}<br>
<br>
@@ -597,6 +607,8 @@ select_best_modifier(struct gen_device_info *devinfo,<br>
#undef LINEAR<br>
#undef XTILE<br>
#undef YTILE<br>
+#undef YTILE_CCS<br>
+#undef YTILE_CCS_Yf<br>
}<br>
<br>
static int<br>
@@ -610,6 +622,10 @@ create_image_with_modifier(<wbr>struct intel_screen *screen,<br>
unsigned ccs_height = 0;<br>
<br>
switch (modifier) {<br>
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):<br>
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):<br>
+ ccs_height = ALIGN(DIV_ROUND_UP(height, 16), 32);<br>
+ /* fallthrough */<br>
case I915_FORMAT_MOD_Y_TILED:<br>
requested_tiling = tiling = I915_TILING_Y;<br>
tiled_height = ALIGN(height, 32);<br>
@@ -761,6 +777,8 @@ intel_create_image_with_<wbr>modifiers(__DRIscreen *dri_screen,<br>
/* This compacts the actual modifiers to the ones we know how to handle */<br>
for (int i = 0; i < count; i++) {<br>
switch (modifiers[i]) {<br>
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):<br>
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):<br>
case I915_FORMAT_MOD_Y_TILED:<br>
case I915_FORMAT_MOD_X_TILED:<br>
case DRM_FORMAT_MOD_LINEAR:<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.11.0<br>
<br>
______________________________<wbr>_________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="https://lists.freedesktop.org/mailman/listinfo/mesa-dev" rel="noreferrer" target="_blank">https://lists.freedesktop.org/<wbr>mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div></div>