Mesa (main): isl: Assert some iris invariants in isl_surf_get_ccs_surf
GitLab Mirror
gitlab-mirror at kemper.freedesktop.org
Thu Jun 24 14:21:03 UTC 2021
Module: Mesa
Branch: main
Commit: 2d2590a879b211b2ec290299467d1fc1b8e772b9
URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=2d2590a879b211b2ec290299467d1fc1b8e772b9
Author: Jason Ekstrand <jason at jlekstrand.net>
Date: Wed Jun 23 17:03:06 2021 -0500
isl: Assert some iris invariants in isl_surf_get_ccs_surf
The only driver which calls isl_surf_get_ccs_surf with extra_aux != NULL
is iris and it always calls it with two aux surfaces and never calls it
for CCS twice. We can turn those checks into asserts.
Reviewed-by: Nanley Chery <nanley.g.chery at intel.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/11479>
---
src/intel/isl/isl.c | 13 +++----------
1 file changed, 3 insertions(+), 10 deletions(-)
diff --git a/src/intel/isl/isl.c b/src/intel/isl/isl.c
index f60cc554430..3390604394b 100644
--- a/src/intel/isl/isl.c
+++ b/src/intel/isl/isl.c
@@ -2148,16 +2148,9 @@ isl_surf_get_ccs_surf(const struct isl_device *dev,
uint32_t row_pitch_B)
{
assert(aux_surf);
-
- /* An uninitialized surface is needed to get a CCS surface. */
- if (aux_surf->size_B > 0 &&
- (extra_aux_surf == NULL || extra_aux_surf->size_B > 0)) {
- return false;
- }
-
- /* A surface can't have two CCS surfaces. */
- if (aux_surf->usage & ISL_SURF_USAGE_CCS_BIT)
- return false;
+ if (aux_surf->size_B > 0)
+ assert(extra_aux_surf);
+ assert(!(aux_surf->usage & ISL_SURF_USAGE_CCS_BIT));
if (!isl_surf_supports_ccs(dev, surf))
return false;
More information about the mesa-commit
mailing list