瀏覽代碼

drm/i915/oa: Check that OA is disabled before unpinning

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.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=106379
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Cc: Matthew Auld <matthew.auld@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Tested-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20180511135207.12880-1-chris@chris-wilson.co.uk
Chris Wilson 7 年之前
父節點
當前提交
e896d29a54
共有 1 個文件被更改,包括 8 次插入0 次删除
  1. 8 0
      drivers/gpu/drm/i915/i915_perf.c

+ 8 - 0
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)
 static void gen7_oa_disable(struct drm_i915_private *dev_priv)
 {
 {
 	I915_WRITE(GEN7_OACONTROL, 0);
 	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)
 static void gen8_oa_disable(struct drm_i915_private *dev_priv)
 {
 {
 	I915_WRITE(GEN8_OACONTROL, 0);
 	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");
 }
 }
 
 
 /**
 /**