Mesa (master): iris: handle the failure of converting unsupported yuv formats to isl
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Feb 6 01:06:27 UTC 2020
Module: Mesa
Branch: master
Commit: d8569baaed1a38cf3da9e45375fa2267d9a1eeb0
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=d8569baaed1a38cf3da9e45375fa2267d9a1eeb0
Author: James Xiong <james.xiong at intel.com>
Date: Wed Nov 20 15:59:00 2019 -0800
iris: handle the failure of converting unsupported yuv formats to isl
Signed-off-by: James Xiong <james.xiong at intel.com>
Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3527>
---
src/gallium/drivers/iris/iris_formats.c | 6 +++++-
src/gallium/drivers/iris/iris_resource.c | 3 ++-
2 files changed, 7 insertions(+), 2 deletions(-)
diff --git a/src/gallium/drivers/iris/iris_formats.c b/src/gallium/drivers/iris/iris_formats.c
index e8e813187c1..dc497c161bd 100644
--- a/src/gallium/drivers/iris/iris_formats.c
+++ b/src/gallium/drivers/iris/iris_formats.c
@@ -40,9 +40,13 @@ iris_format_for_usage(const struct gen_device_info *devinfo,
isl_surf_usage_flags_t usage)
{
enum isl_format format = isl_format_for_pipe_format(pformat);
- const struct isl_format_layout *fmtl = isl_format_get_layout(format);
struct isl_swizzle swizzle = ISL_SWIZZLE_IDENTITY;
+ if (format == ISL_FORMAT_UNSUPPORTED)
+ return (struct iris_format_info) { .fmt = format, .swizzle = swizzle };
+
+ const struct isl_format_layout *fmtl = isl_format_get_layout(format);
+
if (!util_format_is_srgb(pformat)) {
if (util_format_is_intensity(pformat)) {
swizzle = ISL_SWIZZLE(RED, RED, RED, RED);
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c
index bdd715df2c9..7ca6097840a 100644
--- a/src/gallium/drivers/iris/iris_resource.c
+++ b/src/gallium/drivers/iris/iris_resource.c
@@ -85,7 +85,8 @@ modifier_is_supported(const struct gen_device_info *devinfo,
enum isl_format linear_format = isl_format_srgb_to_linear(rt_format);
- if (!isl_format_supports_ccs_e(devinfo, linear_format))
+ if (linear_format == ISL_FORMAT_UNSUPPORTED ||
+ !isl_format_supports_ccs_e(devinfo, linear_format))
return false;
return devinfo->gen >= 9 && devinfo->gen <= 11;
More information about the mesa-commit
mailing list