On 11/05/18 15:11, Lionel Landwerlin wrote:
On 11/05/18 14:52, Chris Wilson wrote:
Before we unpin the buffer used for OA reports and return it to the
system, we need to be sure that the HW has finished writing into it.
For lack of a better idea, poll OACONTROL to check it is switched off.

References: https://bugs.freedesktop.org/show_bug.cgi?id=106379
Signed-off-by: Chris Wilson <[email protected]>
Cc: Lionel Landwerlin <[email protected]>
Cc: Matthew Auld <[email protected]>

Sounds fair :

Reviewed-by: Lionel Landwerlin <[email protected]>

Tested-by: Lionel Landwerlin <[email protected]>


---
  drivers/gpu/drm/i915/i915_perf.c | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c
index d9341415df40..019bd2d073ad 100644
--- a/drivers/gpu/drm/i915/i915_perf.c
+++ b/drivers/gpu/drm/i915/i915_perf.c
@@ -1960,11 +1960,19 @@ static void i915_oa_stream_enable(struct i915_perf_stream *stream)
  static void gen7_oa_disable(struct drm_i915_private *dev_priv)
  {
      I915_WRITE(GEN7_OACONTROL, 0);
+    if (intel_wait_for_register(dev_priv,
+                    GEN7_OACONTROL, GEN7_OACONTROL_ENABLE, 0,
+                    50))
+        DRM_ERROR("wait for OA to be disabled timed out\n");
  }
    static void gen8_oa_disable(struct drm_i915_private *dev_priv)
  {
      I915_WRITE(GEN8_OACONTROL, 0);
+    if (intel_wait_for_register(dev_priv,
+                    GEN8_OACONTROL, GEN8_OA_COUNTER_ENABLE, 0,
+                    50))
+        DRM_ERROR("wait for OA to be disabled timed out\n");
  }
    /**


_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx


_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

Reply via email to