gcr_cntl |= S_586_GL1_INV(1) | S_586_GLV_INV(1);
if (flush_bits & RADV_CMD_FLAG_INV_L2) {
/* Writeback and invalidate everything in L2. */
- gcr_cntl |= S_586_GL2_INV(1) | S_586_GLM_INV(1);
+ gcr_cntl |= S_586_GL2_INV(1) | S_586_GL2_WB(1) |
+ S_586_GLM_INV(1) | S_586_GLM_WB(1);
} else if (flush_bits & RADV_CMD_FLAG_WB_L2) {
- /* Writeback but do not invalidate. */
- gcr_cntl |= S_586_GL2_WB(1);
+ /* Writeback but do not invalidate.
+ * GLM doesn't support WB alone. If WB is set, INV must be set too.
+ */
+ gcr_cntl |= S_586_GL2_WB(1) |
+ S_586_GLM_WB(1) | S_586_GLM_INV(1);
}
/* TODO: Implement this new flag for GFX9+.
- if (flush_bits & RADV_CMD_FLAG_INV_L2_METADATA)
- gcr_cntl |= S_586_GLM_INV(1);
+ else if (flush_bits & RADV_CMD_FLAG_INV_L2_METADATA)
+ gcr_cntl |= S_586_GLM_INV(1) | S_586_GLM_WB(1);
*/
if (flush_bits & (RADV_CMD_FLAG_FLUSH_AND_INV_CB | RADV_CMD_FLAG_FLUSH_AND_INV_DB)) {