Commit 784b1a84 authored by Lionel Landwerlin's avatar Lionel Landwerlin

drm/i915/perf: remove redundant oa buffer initialization

We initialize the OA buffer everytime we enable the OA unit (first call in
gen[78]_oa_enable), so we don't need to initialize when preparing the metric
set.
Signed-off-by: default avatarLionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: default avatarMatthew Auld <matthew.auld@intel.com>
Reviewed-by: default avatarLucas De Marchi <lucas.demarchi@intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181023100707.31738-3-lionel.g.landwerlin@intel.com
parent 816c3715
...@@ -1522,23 +1522,6 @@ struct i915_oa_ops { ...@@ -1522,23 +1522,6 @@ struct i915_oa_ops {
*/ */
bool (*is_valid_flex_reg)(struct drm_i915_private *dev_priv, u32 addr); bool (*is_valid_flex_reg)(struct drm_i915_private *dev_priv, u32 addr);
/**
* @init_oa_buffer: Resets the head and tail pointers of the
* circular buffer for periodic OA reports.
*
* Called when first opening a stream for OA metrics, but also may be
* called in response to an OA buffer overflow or other error
* condition.
*
* Note it may be necessary to clear the full OA buffer here as part of
* maintaining the invariable that new reports must be written to
* zeroed memory for us to be able to reliable detect if an expected
* report has not yet landed in memory. (At least on Haswell the OA
* buffer tail pointer is not synchronized with reports being visible
* to the CPU)
*/
void (*init_oa_buffer)(struct drm_i915_private *dev_priv);
/** /**
* @enable_metric_set: Selects and applies any MUX configuration to set * @enable_metric_set: Selects and applies any MUX configuration to set
* up the Boolean and Custom (B/C) counters that are part of the * up the Boolean and Custom (B/C) counters that are part of the
......
...@@ -1528,8 +1528,6 @@ static int alloc_oa_buffer(struct drm_i915_private *dev_priv) ...@@ -1528,8 +1528,6 @@ static int alloc_oa_buffer(struct drm_i915_private *dev_priv)
goto err_unpin; goto err_unpin;
} }
dev_priv->perf.oa.ops.init_oa_buffer(dev_priv);
DRM_DEBUG_DRIVER("OA Buffer initialized, gtt offset = 0x%x, vaddr = %p\n", DRM_DEBUG_DRIVER("OA Buffer initialized, gtt offset = 0x%x, vaddr = %p\n",
i915_ggtt_offset(dev_priv->perf.oa.oa_buffer.vma), i915_ggtt_offset(dev_priv->perf.oa.oa_buffer.vma),
dev_priv->perf.oa.oa_buffer.vaddr); dev_priv->perf.oa.oa_buffer.vaddr);
...@@ -1998,7 +1996,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream, ...@@ -1998,7 +1996,7 @@ static int i915_oa_stream_init(struct i915_perf_stream *stream,
return -EINVAL; return -EINVAL;
} }
if (!dev_priv->perf.oa.ops.init_oa_buffer) { if (!dev_priv->perf.oa.ops.enable_metric_set) {
DRM_DEBUG("OA unit not supported\n"); DRM_DEBUG("OA unit not supported\n");
return -ENODEV; return -ENODEV;
} }
...@@ -3387,7 +3385,6 @@ void i915_perf_init(struct drm_i915_private *dev_priv) ...@@ -3387,7 +3385,6 @@ void i915_perf_init(struct drm_i915_private *dev_priv)
dev_priv->perf.oa.ops.is_valid_mux_reg = dev_priv->perf.oa.ops.is_valid_mux_reg =
hsw_is_valid_mux_addr; hsw_is_valid_mux_addr;
dev_priv->perf.oa.ops.is_valid_flex_reg = NULL; dev_priv->perf.oa.ops.is_valid_flex_reg = NULL;
dev_priv->perf.oa.ops.init_oa_buffer = gen7_init_oa_buffer;
dev_priv->perf.oa.ops.enable_metric_set = hsw_enable_metric_set; dev_priv->perf.oa.ops.enable_metric_set = hsw_enable_metric_set;
dev_priv->perf.oa.ops.disable_metric_set = hsw_disable_metric_set; dev_priv->perf.oa.ops.disable_metric_set = hsw_disable_metric_set;
dev_priv->perf.oa.ops.oa_enable = gen7_oa_enable; dev_priv->perf.oa.ops.oa_enable = gen7_oa_enable;
...@@ -3406,7 +3403,6 @@ void i915_perf_init(struct drm_i915_private *dev_priv) ...@@ -3406,7 +3403,6 @@ void i915_perf_init(struct drm_i915_private *dev_priv)
*/ */
dev_priv->perf.oa.oa_formats = gen8_plus_oa_formats; dev_priv->perf.oa.oa_formats = gen8_plus_oa_formats;
dev_priv->perf.oa.ops.init_oa_buffer = gen8_init_oa_buffer;
dev_priv->perf.oa.ops.oa_enable = gen8_oa_enable; dev_priv->perf.oa.ops.oa_enable = gen8_oa_enable;
dev_priv->perf.oa.ops.oa_disable = gen8_oa_disable; dev_priv->perf.oa.ops.oa_disable = gen8_oa_disable;
dev_priv->perf.oa.ops.read = gen8_oa_read; dev_priv->perf.oa.ops.read = gen8_oa_read;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment