Merge tag 'drm-intel-next-queued-2020-11-27' of git://anongit.freedesktop.org/drm...
[linux-2.6-microblaze.git] / drivers / gpu / drm / i915 / i915_perf.c
index 3ced828..3b12c8f 100644 (file)
@@ -910,8 +910,13 @@ static int gen8_oa_read(struct i915_perf_stream *stream,
                                       DRM_I915_PERF_RECORD_OA_REPORT_LOST);
                if (ret)
                        return ret;
-               intel_uncore_write(uncore, oastatus_reg,
-                                  oastatus & ~GEN8_OASTATUS_REPORT_LOST);
+
+               intel_uncore_rmw(uncore, oastatus_reg,
+                                GEN8_OASTATUS_COUNTER_OVERFLOW |
+                                GEN8_OASTATUS_REPORT_LOST,
+                                IS_GEN_RANGE(uncore->i915, 8, 10) ?
+                                (GEN8_OASTATUS_HEAD_POINTER_WRAP |
+                                 GEN8_OASTATUS_TAIL_POINTER_WRAP) : 0);
        }
 
        return gen8_append_oa_reports(stream, buf, count, offset);