diff options
author | Nanley Chery <[email protected]> | 2020-06-09 16:27:14 -0700 |
---|---|---|
committer | Marge Bot <[email protected]> | 2020-06-19 23:32:29 +0000 |
commit | 2305ab693820f6f08b054cb8b33536e4b1178e45 (patch) | |
tree | b8a8e5d86cd7e24f17817aca008b285a5003a4f6 | |
parent | c19492bcdb9ff5c5bf4092d2daff6e2e5d7bce1b (diff) |
iris: Refactor modifier_is_supported for gen12
Reviewed-by: Sagar Ghuge <[email protected]>
Reviewed-by: Jordan Justen <[email protected]>
Reviewed-by: Kenneth Graunke <[email protected]>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5420>
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 28 |
1 files changed, 19 insertions, 9 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 5b5c24a37d2..c2f1b2a300e 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -73,7 +73,22 @@ static bool modifier_is_supported(const struct gen_device_info *devinfo, enum pipe_format pfmt, uint64_t modifier) { - /* XXX: do something real */ + /* Check for basic device support. */ + switch (modifier) { + case DRM_FORMAT_MOD_LINEAR: + case I915_FORMAT_MOD_X_TILED: + case I915_FORMAT_MOD_Y_TILED: + break; + case I915_FORMAT_MOD_Y_TILED_CCS: + if (devinfo->gen <= 8 || devinfo->gen >= 12) + return false; + break; + case DRM_FORMAT_MOD_INVALID: + default: + return false; + } + + /* Check remaining requirements. */ switch (modifier) { case I915_FORMAT_MOD_Y_TILED_CCS: { if (unlikely(INTEL_DEBUG & DEBUG_NO_RBC)) @@ -86,17 +101,12 @@ modifier_is_supported(const struct gen_device_info *devinfo, if (rt_format == ISL_FORMAT_UNSUPPORTED || !isl_format_supports_ccs_e(devinfo, rt_format)) return false; - - return devinfo->gen >= 9 && devinfo->gen <= 11; } - case I915_FORMAT_MOD_Y_TILED: - case I915_FORMAT_MOD_X_TILED: - case DRM_FORMAT_MOD_LINEAR: - return true; - case DRM_FORMAT_MOD_INVALID: default: - return false; + break; } + + return true; } static uint64_t |