summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBen Widawsky <ben@bwidawsk.net>2016-10-06 21:49:45 -0700
committerBen Widawsky <ben@bwidawsk.net>2017-02-27 19:45:56 -0800
commit19f99687f9f1ac459d016d1a559d79b94a33fbac (patch)
treecc355014b0116915cafc8da860e8d9c8dcd5005b
parente0902fedd7afe694363fe176ae16df61a6d774b2 (diff)
i965: Handle compression modifiermodifiersv7
v2: Rename modifier to be more smart (Jason) FINISHME: Use the kernel's final choice for the fb modifier bwidawsk@norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube none Read bandwidth: 603.91 MiB/s Write bandwidth: 615.28 MiB/s bwidawsk@norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube ytile Read bandwidth: 571.13 MiB/s Write bandwidth: 555.51 MiB/s bwidawsk@norris2:~/intel-gfx/kmscube (modifiers $) ~/scripts/measure_bandwidth.sh ./kmscube ccs Read bandwidth: 259.34 MiB/s Write bandwidth: 337.83 MiB/s v2: Move all references to the new fourcc code(s) to this patch. 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.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/mesa/drivers/dri/i965/intel_screen.c b/src/mesa/drivers/dri/i965/intel_screen.c
index c447afad4b..a657652f57 100644
--- a/src/mesa/drivers/dri/i965/intel_screen.c
+++ b/src/mesa/drivers/dri/i965/intel_screen.c
@@ -562,6 +562,8 @@ select_best_modifier(struct gen_device_info *devinfo,
const uint64_t *modifiers,
const unsigned count)
{
+#define YfTILE_CCS (1 << 4)
+#define YTILE_CCS (1 << 3)
#define YTILE (1 << 2)
#define XTILE (1 << 1)
#define LINEAR (1 << 0)
@@ -569,7 +571,9 @@ select_best_modifier(struct gen_device_info *devinfo,
const uint64_t prio_modifiers[] = {
DRM_FORMAT_MOD_LINEAR,
I915_FORMAT_MOD_X_TILED,
- I915_FORMAT_MOD_Y_TILED};
+ I915_FORMAT_MOD_Y_TILED,
+ /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4),
+ /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5)};
uint32_t modifier_bitmask = 0; /* API only allows 32 */
for (int i = 0; i < count; i++) {
@@ -588,6 +592,12 @@ select_best_modifier(struct gen_device_info *devinfo,
modifier_bitmask |= YTILE;
break;
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):
+ modifier_bitmask |= YTILE_CCS;
+ break;
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):
+ modifier_bitmask |= YfTILE_CCS;
+ break;
}
}
@@ -599,6 +609,8 @@ select_best_modifier(struct gen_device_info *devinfo,
#undef LINEAR
#undef XTILE
#undef YTILE
+#undef YTILE_CCS
+#undef YTILE_CCS_Yf
}
static int
@@ -612,6 +624,10 @@ create_image_with_modifier(struct intel_screen *screen,
unsigned ccs_height = 0;
switch (modifier) {
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):
+ ccs_height = ALIGN(DIV_ROUND_UP(height, 16), 32);
+ /* fallthrough */
case I915_FORMAT_MOD_Y_TILED:
requested_tiling = tiling = I915_TILING_Y;
tiled_height = ALIGN(height, 32);
@@ -762,6 +778,8 @@ intel_create_image_with_modifiers(__DRIscreen *dri_screen,
/* This compacts the actual modifiers to the ones we know how to handle */
for (int i = 0; i < count; i++) {
switch (modifiers[i]) {
+ case /* I915_FORMAT_MOD_Yf_TILED_CCS */ fourcc_mod_code(INTEL, 5):
+ case /* I915_FORMAT_MOD_Y_TILED_CCS */ fourcc_mod_code(INTEL, 4):
case I915_FORMAT_MOD_Y_TILED:
case I915_FORMAT_MOD_X_TILED:
case DRM_FORMAT_MOD_LINEAR: