[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Daniel Vetter
On Wed, May 04, 2016 at 02:24:14PM +0100, Robert Bragg wrote: > On Wed, May 4, 2016 at 1:24 PM, Daniel Vetter wrote: > > > On Wed, May 04, 2016 at 10:49:53AM +0100, Robert Bragg wrote: > > > On Wed, May 4, 2016 at 10:09 AM, Martin Peres < > > martin.peres at linux.intel.com> > > > wrote: > > > >

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Robert Bragg
On Wed, May 4, 2016 at 2:24 PM, Robert Bragg wrote: > > > On Wed, May 4, 2016 at 1:24 PM, Daniel Vetter wrote: > >> On Wed, May 04, 2016 at 10:49:53AM +0100, Robert Bragg wrote: >> > On Wed, May 4, 2016 at 10:09 AM, Martin Peres < >> martin.peres at linux.intel.com> >> > wrote: >> > >> > > On 03

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Daniel Vetter
On Wed, May 04, 2016 at 10:49:53AM +0100, Robert Bragg wrote: > On Wed, May 4, 2016 at 10:09 AM, Martin Peres linux.intel.com> > wrote: > > > On 03/05/16 23:03, Robert Bragg wrote: > > > >> > >> > >> On Tue, May 3, 2016 at 8:34 PM, Robert Bragg >> > wrote: > >> >

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Robert Bragg
On Wed, May 4, 2016 at 1:24 PM, Daniel Vetter wrote: > On Wed, May 04, 2016 at 10:49:53AM +0100, Robert Bragg wrote: > > On Wed, May 4, 2016 at 10:09 AM, Martin Peres < > martin.peres at linux.intel.com> > > wrote: > > > > > On 03/05/16 23:03, Robert Bragg wrote: > > > > > >> > > >> > > >> On Tue

[Intel-gfx] [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Robert Bragg
On Wed, May 4, 2016 at 10:04 AM, Martin Peres wrote: > On 03/05/16 22:34, Robert Bragg wrote: > >> Sorry for the delay replying to this, I missed it. >> > > No worries! > > >> On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres > > wrote: >> >> On 20/04/16 17:23, Ro

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Martin Peres
On 03/05/16 23:03, Robert Bragg wrote: > > > On Tue, May 3, 2016 at 8:34 PM, Robert Bragg > wrote: > > Sorry for the delay replying to this, I missed it. > > On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres > wrote: > >

[Intel-gfx] [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Martin Peres
On 03/05/16 22:34, Robert Bragg wrote: > Sorry for the delay replying to this, I missed it. No worries! > > On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres > wrote: > > On 20/04/16 17:23, Robert Bragg wrote: > > Gen graphics hardware can be set up to pe

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-04 Thread Robert Bragg
On Wed, May 4, 2016 at 10:09 AM, Martin Peres wrote: > On 03/05/16 23:03, Robert Bragg wrote: > >> >> >> On Tue, May 3, 2016 at 8:34 PM, Robert Bragg > > wrote: >> >> Sorry for the delay replying to this, I missed it. >> >> On Sat, Apr 23, 2016 at 11:34 AM,

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-03 Thread Robert Bragg
On Tue, May 3, 2016 at 8:34 PM, Robert Bragg wrote: > Sorry for the delay replying to this, I missed it. > > On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres > wrote: > >> On 20/04/16 17:23, Robert Bragg wrote: >> >>> Gen graphics hardware can be set up to periodically write snapshots of >>> perfo

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-05-03 Thread Robert Bragg
Sorry for the delay replying to this, I missed it. On Sat, Apr 23, 2016 at 11:34 AM, Martin Peres wrote: > On 20/04/16 17:23, Robert Bragg wrote: > >> Gen graphics hardware can be set up to periodically write snapshots of >> performance counters into a circular buffer via its Observation >> Arch

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-23 Thread Martin Peres
On 20/04/16 17:23, Robert Bragg wrote: > Gen graphics hardware can be set up to periodically write snapshots of > performance counters into a circular buffer via its Observation > Architecture and this patch exposes that capability to userspace via the > i915 perf interface. > > Cc: Chris Wilson >

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-23 Thread Chris Wilson
On Thu, Apr 21, 2016 at 05:15:10PM +0100, Robert Bragg wrote: >On Wed, Apr 20, 2016 at 10:11 PM, Chris Wilson ><[1]chris at chris-wilson.co.uk> wrote: > > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static void gen7_update_oacontrol_locked(struct drm_i915_p

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-22 Thread Chris Wilson
On Fri, Apr 22, 2016 at 12:04:26PM +0100, Robert Bragg wrote: >On Wed, Apr 20, 2016 at 11:46 PM, Chris Wilson ><[1]chris at chris-wilson.co.uk> wrote: > > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static void gen7_init_oa_buffer(struct drm_i915_private *d

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-22 Thread Robert Bragg
On Wed, Apr 20, 2016 at 11:46 PM, Chris Wilson wrote: > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static void gen7_init_oa_buffer(struct drm_i915_private *dev_priv) > > +{ > > + /* Pre-DevBDW: OABUFFER must be set with counters off, > > + * before OASTATUS1, but

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-22 Thread Robert Bragg
On Thu, Apr 21, 2016 at 4:18 PM, Robert Bragg wrote: > > > On Thu, Apr 21, 2016 at 12:09 AM, Chris Wilson > wrote: > >> On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: >> > +static void i915_oa_stream_enable(struct i915_perf_stream *stream) >> > +{ >> > + struct drm_i915_privat

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Chris Wilson
On Thu, Apr 21, 2016 at 04:43:19PM +0100, Robert Bragg wrote: >On Wed, Apr 20, 2016 at 11:52 PM, Chris Wilson ><[1]chris at chris-wilson.co.uk> wrote: > > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static int i915_oa_read(struct i915_perf_stream *stream, >

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Robert Bragg
On Wed, Apr 20, 2016 at 10:11 PM, Chris Wilson wrote: > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static void gen7_update_oacontrol_locked(struct drm_i915_private > *dev_priv) > > +{ > > + assert_spin_locked(&dev_priv->perf.hook_lock); > > + > > + if (dev_priv->pe

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Robert Bragg
On Wed, Apr 20, 2016 at 11:52 PM, Chris Wilson wrote: > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static int i915_oa_read(struct i915_perf_stream *stream, > > + struct i915_perf_read_state *read_state) > > +{ > > + struct drm_i915_private *dev_priv

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Robert Bragg
On Thu, Apr 21, 2016 at 12:09 AM, Chris Wilson wrote: > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static void i915_oa_stream_enable(struct i915_perf_stream *stream) > > +{ > > + struct drm_i915_private *dev_priv = stream->dev_priv; > > + > > + dev_priv->perf.oa.op

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Robert Bragg
On Thu, Apr 21, 2016 at 12:16 AM, Chris Wilson wrote: > On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > > +static int hsw_enable_metric_set(struct drm_i915_private *dev_priv) > > +{ > > + int ret = i915_oa_select_metric_set_hsw(dev_priv); > > + > > + if (ret) > > +

[Intel-gfx] [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread kbuild test robot
Hi, [auto build test ERROR on drm-intel/for-linux-next] [also build test ERROR on next-20160420] [cannot apply to v4.6-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Robert-Bragg/Enable-G

[Intel-gfx] [PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread kbuild test robot
Hi, [auto build test ERROR on drm-intel/for-linux-next] [also build test ERROR on next-20160420] [cannot apply to v4.6-rc4] [if your patch is applied to the wrong git tree, please drop us a note to help improving the system] url: https://github.com/0day-ci/linux/commits/Robert-Bragg/Enable-G

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static int hsw_enable_metric_set(struct drm_i915_private *dev_priv) > +{ > + int ret = i915_oa_select_metric_set_hsw(dev_priv); > + > + if (ret) > + return ret; > + > + I915_WRITE(GDT_CHICKEN_BITS, GT_NOA_ENABL

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-21 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static void i915_oa_stream_enable(struct i915_perf_stream *stream) > +{ > + struct drm_i915_private *dev_priv = stream->dev_priv; > + > + dev_priv->perf.oa.ops.oa_enable(dev_priv); > + > + if (dev_priv->perf.oa.periodic) >

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-20 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static int i915_oa_read(struct i915_perf_stream *stream, > + struct i915_perf_read_state *read_state) > +{ > + struct drm_i915_private *dev_priv = stream->dev_priv; > + > + return dev_priv->perf.oa.ops.read

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-20 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static void gen7_init_oa_buffer(struct drm_i915_private *dev_priv) > +{ > + /* Pre-DevBDW: OABUFFER must be set with counters off, > + * before OASTATUS1, but after OASTATUS2 > + */ > + I915_WRITE(GEN7_OASTATUS2, dev

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-20 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static int alloc_oa_buffer(struct drm_i915_private *dev_priv) > +{ > + struct drm_i915_gem_object *bo; > + int ret; > + > + BUG_ON(dev_priv->perf.oa.oa_buffer.obj); > + > + ret = i915_mutex_lock_interruptible(dev_priv-

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-20 Thread Chris Wilson
On Wed, Apr 20, 2016 at 03:23:10PM +0100, Robert Bragg wrote: > +static void gen7_update_oacontrol_locked(struct drm_i915_private *dev_priv) > +{ > + assert_spin_locked(&dev_priv->perf.hook_lock); > + > + if (dev_priv->perf.oa.exclusive_stream->enabled) { > + unsigned long ctx_i

[PATCH 5/9] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-04-20 Thread Robert Bragg
Gen graphics hardware can be set up to periodically write snapshots of performance counters into a circular buffer via its Observation Architecture and this patch exposes that capability to userspace via the i915 perf interface. Cc: Chris Wilson Signed-off-by: Robert Bragg Signed-off-by: Zhenyu