drm/xe/pvc: Don't try to invalidate AuxCCS TLB
authorMatt Roper <matthew.d.roper@intel.com>
Wed, 24 May 2023 19:26:35 +0000 (12:26 -0700)
committerRodrigo Vivi <rodrigo.vivi@intel.com>
Tue, 19 Dec 2023 23:34:01 +0000 (18:34 -0500)
Generally !has_flatccs implies that a platform has AuxCCS compression
and thus needs to invalidate the AuxCCS TLB.  However PVC is a special
case because it has no compression of either type (FlatCCS or AuxCCS)
so we should avoid writing to non-existent AuxCCS registers.

Reviewed-by: Haridhar Kalvala <haridhar.kalvala@intel.com>
Link: https://lore.kernel.org/r/20230524192635.673293-1-matthew.d.roper@intel.com
Signed-off-by: Matt Roper <matthew.d.roper@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
drivers/gpu/drm/xe/xe_ring_ops.c

index 06364bb2e95bd2cf8818a2612127d61c6f0367f3..a09ee8c736b5398e030c457de03da17d8e9a44c0 100644 (file)
@@ -190,6 +190,18 @@ static void __emit_job_gen12_copy(struct xe_sched_job *job, struct xe_lrc *lrc,
        xe_lrc_write_ring(lrc, dw, i * sizeof(*dw));
 }
 
+static bool has_aux_ccs(struct xe_device *xe)
+{
+       /*
+        * PVC is a special case that has no compression of either type
+        * (FlatCCS or AuxCCS).
+        */
+       if (xe->info.platform == XE_PVC)
+               return false;
+
+       return !xe->info.has_flat_ccs;
+}
+
 static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc,
                                   u64 batch_addr, u32 seqno)
 {
@@ -202,7 +214,7 @@ static void __emit_job_gen12_video(struct xe_sched_job *job, struct xe_lrc *lrc,
        dw[i++] = preparser_disable(true);
 
        /* hsdes: 1809175790 */
-       if (!xe->info.has_flat_ccs) {
+       if (has_aux_ccs(xe)) {
                if (decode)
                        i = emit_aux_table_inv(gt, VD0_AUX_INV, dw, i);
                else
@@ -248,7 +260,7 @@ static void __emit_job_gen12_render_compute(struct xe_sched_job *job,
        i = emit_pipe_invalidate(mask_flags, dw, i);
 
        /* hsdes: 1809175790 */
-       if (!xe->info.has_flat_ccs)
+       if (has_aux_ccs(xe))
                i = emit_aux_table_inv(gt, CCS_AUX_INV, dw, i);
 
        dw[i++] = preparser_disable(false);