diff options
author | Sagar Ghuge <[email protected]> | 2019-09-19 08:13:15 -0700 |
---|---|---|
committer | Sagar Ghuge <[email protected]> | 2019-10-28 14:02:01 -0700 |
commit | 2cd849cf17ca30f7b057b516c7f008a4f064c5be (patch) | |
tree | 244c60b2a34ca4c21fb18331fdb9142e25937c23 | |
parent | 2f0fbe06e65c5ae6c3e9ab3943a4a7d01ae9dc2f (diff) |
iris: Initialize CCS to fast clear while using with MCS
v2: Explain Bsepc quotes properly (Nanley Chery)
v3: 1) Fix comment format (Nanley Chery)
2) Fix typo in comment (Nanley Chery)
Signed-off-by: Sagar Ghuge <[email protected]>
Reviewed-by: Nanley Chery <[email protected]>
-rw-r--r-- | src/gallium/drivers/iris/iris_resource.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/src/gallium/drivers/iris/iris_resource.c b/src/gallium/drivers/iris/iris_resource.c index 61b47ae73b1..5a3c271e559 100644 --- a/src/gallium/drivers/iris/iris_resource.c +++ b/src/gallium/drivers/iris/iris_resource.c @@ -611,13 +611,24 @@ iris_resource_init_aux_buf(struct iris_resource *res, uint32_t alloc_flags, } if (iris_resource_get_aux_state(res, 0, 0) != ISL_AUX_STATE_AUX_INVALID) { - uint8_t memset_value = res->aux.usage == ISL_AUX_USAGE_MCS ? 0xFF : 0; + uint8_t memset_value = isl_aux_usage_has_mcs(res->aux.usage) ? 0xFF : 0; memset((char*)map + res->aux.offset, memset_value, res->aux.surf.size_B); } - /* Resolved is usually a safe state for CCS_E. */ - memset((char*)map + res->aux.extra_aux.offset, 0, + /* Bspec section titled : MCS/CCS Buffers for Render Target(s) states: + * - If Software wants to enable Color Compression without Fast clear, + * Software needs to initialize MCS with zeros. + * - Lossless compression and CCS initialized to all F (using HW Fast + * Clear or SW direct Clear) + * + * We think, the first bullet point above is referring to CCS aux + * surface. Since we initialize the MCS in the clear state, we also + * initialize the CCS in the clear state (via SW direct clear) to keep + * the two in sync. + */ + memset((char*)map + res->aux.extra_aux.offset, + isl_aux_usage_has_mcs(res->aux.usage) ? 0xFF : 0, res->aux.extra_aux.surf.size_B); /* Zero the indirect clear color to match ::fast_clear_color. */ |