iris: Don't fast clear with the view format
authorNanley Chery <nanley.g.chery@intel.com>
Mon, 27 Dec 2021 15:15:19 +0000 (10:15 -0500)
committerMarge Bot <emma+marge@anholt.net>
Thu, 10 Feb 2022 04:47:14 +0000 (04:47 +0000)
commit6778b3a379d010d9b4d82e7324bff19d73cd3d1a
treed79d0b7b9ea19218f315bac047e99a722e6064dc
parent68c1b50e48e32ec8ff4815666b7124d4cb4171ab
iris: Don't fast clear with the view format

Fast clear with the resource format instead. This is safe to do because
can_fast_clear_color ensures that the clear color generates the same
pixel with either the view format or the resource format.

On SKL, this prevents us from using an invalid surface state. This platform
doesn't support CCS_E with sRGB formats, but prior to this patch we allowed
fast-clearing with this combination. Piglit's fcc-write-after-clear test
can trigger this.

Fixes: 230952c2101 ("iris: Don't support sRGB + Y_TILED_CCS on gen9")
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/14806>
src/gallium/drivers/iris/iris_clear.c