Skip to content

Commit

Permalink
drm/i915: Add OA unit support for Gen 8+
Browse files Browse the repository at this point in the history
Enables access to OA unit metrics for BDW, CHV and SKL which all share
the same OA unit design.

Signed-off-by: Robert Bragg <[email protected]>
  • Loading branch information
rib committed Jan 27, 2016
1 parent ac938f3 commit e9aaf89
Show file tree
Hide file tree
Showing 6 changed files with 553 additions and 24 deletions.
7 changes: 7 additions & 0 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1784,6 +1784,7 @@ struct i915_oa_ops {
void (*update_oacontrol)(struct drm_i915_private *dev_priv);
void (*update_hw_ctx_id_locked)(struct drm_i915_private *dev_priv,
u32 ctx_id);
void (*legacy_ctx_switch_unlocked)(struct drm_i915_gem_request *req);
void (*read)(struct i915_perf_stream *stream,
struct i915_perf_read_state *read_state);
bool (*oa_buffer_is_empty)(struct drm_i915_private *dev_priv);
Expand Down Expand Up @@ -2071,10 +2072,14 @@ struct drm_i915_private {
u8 *addr;
u32 head;
u32 tail;
u32 last_ctx_id;
int format;
int format_size;
} oa_buffer;

u32 ctx_oactxctrl_off;
u32 ctx_flexeu0_off;

struct i915_oa_ops ops;
const struct i915_oa_format *oa_formats;
int n_builtin_sets;
Expand Down Expand Up @@ -3321,6 +3326,8 @@ int i915_perf_open_ioctl(struct drm_device *dev, void *data,
struct drm_file *file);
void i915_oa_context_pin_notify(struct drm_i915_private *dev_priv,
struct intel_context *context);
void i915_oa_legacy_ctx_switch_notify(struct drm_i915_gem_request *req);
void i915_oa_update_reg_state(struct intel_engine_cs *ring, uint32_t *reg_state);

/* i915_gem_evict.c */
int __must_check i915_gem_evict_something(struct drm_device *dev,
Expand Down
2 changes: 2 additions & 0 deletions drivers/gpu/drm/i915/i915_gem_context.c
Original file line number Diff line number Diff line change
Expand Up @@ -828,6 +828,8 @@ static int do_switch(struct drm_i915_gem_request *req)
}
}

i915_oa_legacy_ctx_switch_notify(req);

return 0;

unpin_out:
Expand Down
Loading

0 comments on commit e9aaf89

Please sign in to comment.