Skip to content

Commit

Permalink
drm/i915/perf: Wean ourselves off dev_priv
Browse files Browse the repository at this point in the history
Use the local uncore accessors for the GT rather than using the [not-so]
magic global dev_priv mmio routines. In the process, we also teach the
perf stream to use backpointers to the i915_perf rather than digging it
out of dev_priv.

v2: Rebase onto i915_perf_types.h

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Cc: Umesh Nerlige Ramappa <umesh.nerlige.ramappa@intel.com>
Cc: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> #v1
Link: https://patchwork.freedesktop.org/patch/msgid/20191007140812.10963-1-chris@chris-wilson.co.uk
Link: https://patchwork.freedesktop.org/patch/msgid/20191007210942.18145-1-chris@chris-wilson.co.uk
  • Loading branch information
Chris Wilson committed Oct 8, 2019
1 parent d30213e commit 8f8b117
Show file tree
Hide file tree
Showing 3 changed files with 422 additions and 428 deletions.
56 changes: 1 addition & 55 deletions drivers/gpu/drm/i915/i915_drv.h
Original file line number Diff line number Diff line change
Expand Up @@ -1332,61 +1332,7 @@ struct drm_i915_private {

struct intel_runtime_pm runtime_pm;

struct {
bool initialized;

struct kobject *metrics_kobj;
struct ctl_table_header *sysctl_header;

/*
* Lock associated with adding/modifying/removing OA configs
* in dev_priv->perf.metrics_idr.
*/
struct mutex metrics_lock;

/*
* List of dynamic configurations, you need to hold
* dev_priv->perf.metrics_lock to access it.
*/
struct idr metrics_idr;

/*
* Lock associated with anything below within this structure
* except exclusive_stream.
*/
struct mutex lock;
struct list_head streams;

/*
* The stream currently using the OA unit. If accessed
* outside a syscall associated to its file
* descriptor, you need to hold
* dev_priv->drm.struct_mutex.
*/
struct i915_perf_stream *exclusive_stream;

/**
* For rate limiting any notifications of spurious
* invalid OA reports
*/
struct ratelimit_state spurious_report_rs;

struct i915_oa_config test_config;

u32 gen7_latched_oastatus1;
u32 ctx_oactxctrl_offset;
u32 ctx_flexeu0_offset;

/**
* The RPT_ID/reason field for Gen8+ includes a bit
* to determine if the CTX ID in the report is valid
* but the specific bit differs between Gen 8 and 9
*/
u32 gen8_valid_ctx_bit;

struct i915_oa_ops ops;
const struct i915_oa_format *oa_formats;
} perf;
struct i915_perf perf;

/* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
struct intel_gt gt;
Expand Down
Loading

0 comments on commit 8f8b117

Please sign in to comment.