Re: [Intel-gfx] [RFC 0/4] GPU/CPU timestamps correlation for relating OA samples with system events

2017-12-05 Thread Robert Bragg
On Tue, Dec 5, 2017 at 2:16 PM, Lionel Landwerlin < lionel.g.landwer...@intel.com> wrote: > Hey Sagar, > > Sorry for the delay looking into this series. > I've done some userspace/UI work in GPUTop to try to correlate perf > samples/tracepoints with i915 perf reports. > > I wanted to avoid having

Re: [Intel-gfx] [RFC 0/4] GPU/CPU timestamps correlation for relating OA samples with system events

2017-12-06 Thread Robert Bragg
On Wed, Nov 15, 2017 at 12:13 PM, Sagar Arun Kamble < sagar.a.kam...@intel.com> wrote: > We can compute system time corresponding to GPU timestamp by taking a > reference point (CPU monotonic time, GPU timestamp) and then adding > delta time computed using timecounter/cyclecounter support in kerne

Re: [Intel-gfx] [RFC 0/4] GPU/CPU timestamps correlation for relating OA samples with system events

2017-12-06 Thread Robert Bragg
On Thu, Dec 7, 2017 at 12:48 AM, Robert Bragg wrote: > > at least from what I wrote back then it looks like I was seeing a drift of > a few milliseconds per second on SKL. I vaguely recall it being much worse > given the frequency constants we had for Haswell. > Sorry I didn

[Intel-gfx] [PATCH v3 09/11] drm/i915: add oa_event_min_timer_exponent sysctl

2016-08-15 Thread Robert Bragg
The minimal sampling period is now configurable via a dev.i915.oa_min_timer_exponent sysctl parameter. Following the precedent set by perf, the default is the minimum that won't (on its own) exceed the default kernel.perf_event_max_sample_rate default of 10 samples/s. Signed-off-by: R

[Intel-gfx] [PATCH v3 03/11] drm/i915: return EACCES for check_cmd() failures

2016-08-15 Thread Robert Bragg
er is disabled, but if we were to remove OACONTROL from the parser's whitelist then the returned EINVAL would break Mesa applications as they attempt an OACONTROL write. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[Intel-gfx] [PATCH v3 07/11] drm/i915: advertise available metrics via sysfs

2016-08-15 Thread Robert Bragg
scriptions and code generation scripts, ref: https://github.com/rib/gputop > gputop-data/guids.xml > scripts/update-guids.py > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml SYSFS=1 WHITELIST=RenderBasic Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v3 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-08-15 Thread Robert Bragg
OACONTROL changes quite a bit for gen8, with some bits split out into a per-context OACTXCONTROL register. Rename now before adding more gen7 OA registers Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- drivers/gpu/drm/i915/i915_reg.h| 2 +- 2 files

[Intel-gfx] [PATCH v3 00/11] Enable Gen 7 Observation Architecture

2016-08-15 Thread Robert Bragg
l counters will show the description + normalization equation. Having the web UI hosted on github hopefully lowers the bar to trying it out since it avoids needing to set up Emscripten first as a build dependency. Regards, - Robert Robert Bragg (11): drm/i915: Add i915 perf infrastructur

[Intel-gfx] [PATCH v3 01/11] drm/i915: Add i915 perf infrastructure

2016-08-15 Thread Robert Bragg
yet so any attempt to open a stream will return an error. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/Makefile| 3 + drivers/gpu/drm/i915/i915_drv.c | 6 + drivers/gpu/drm/i915/i915_drv.h | 92 + drivers/gpu/drm/i915/i915_pe

[Intel-gfx] [PATCH v3 10/11] drm/i915: Add more Haswell OA metric sets

2016-08-15 Thread Robert Bragg
rib/gputop > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_oa_hsw.c | 484 - 1 file changed, 483 insertions(+), 1 deletion(-) diff --git a/dr

[Intel-gfx] [PATCH v3 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-08-15 Thread Robert Bragg
particular running any Mesa based GL application currently results in clearing OACONTROL when initializing which would disable the capturing of metrics. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38 ++ 1 file changed, 2 insertions(+), 36

[Intel-gfx] [PATCH v3 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-08-15 Thread Robert Bragg
In particular this tries to capture for posterity some of the early challenges we had with using the core perf infrastructure in case we ever want to revisit adapting perf for device metrics. Cc: Chris Wilson Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_perf.c | 163

[Intel-gfx] [PATCH v3 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-08-15 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

[Intel-gfx] [PATCH v3 08/11] drm/i915: Add dev.i915.perf_event_paranoid sysctl option

2016-08-15 Thread Robert Bragg
Consistent with the kernel.perf_event_paranoid sysctl option that can allow non-root users to access system wide cpu metrics, this can optionally allow non-root users to access system wide OA counter metrics from Gen graphics hardware. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v3 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-08-15 Thread Robert Bragg
ake -C gputop-data -f Makefile.xml SYSFS=0 WHITELIST=RenderBasic Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.h| 14 drivers/gpu/drm/i915/i915_oa_hsw.c | 132 + drivers/gpu/drm/i915/i915_oa

Re: [Intel-gfx] [PATCH v3 01/11] drm/i915: Add i915 perf infrastructure

2016-08-16 Thread Robert Bragg
On Mon, Aug 15, 2016 at 3:57 PM, Chris Wilson wrote: > On Mon, Aug 15, 2016 at 03:41:18PM +0100, Robert Bragg wrote: > > Adds base i915 perf infrastructure for Gen performance metrics. > > > > This adds a DRM_IOCTL_I915_PERF_OPEN ioctl that takes an array of uint64 > >

Re: [Intel-gfx] [PATCH v3 03/11] drm/i915: return EACCES for check_cmd() failures

2016-08-18 Thread Robert Bragg
On Mon, Aug 15, 2016 at 4:04 PM, Chris Wilson wrote: > On Mon, Aug 15, 2016 at 03:41:20PM +0100, Robert Bragg wrote: > > check_cmd() is checking whether a command adheres to certain > > restrictions that ensure it's safe to execute within a privileged batch > > buffer.

[Intel-gfx] [PATCH v4 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-08-18 Thread Robert Bragg
ake -C gputop-data -f Makefile.xml SYSFS=0 WHITELIST=RenderBasic Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.h| 14 drivers/gpu/drm/i915/i915_oa_hsw.c | 132 + drivers/gpu/drm/i915/i915_oa

[Intel-gfx] [PATCH v4 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-08-18 Thread Robert Bragg
particular running any Mesa based GL application currently results in clearing OACONTROL when initializing which would disable the capturing of metrics. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38 ++ 1 file changed, 2 insertions(+), 36

[Intel-gfx] [PATCH v4 00/11] Enable i915 perf stream for Haswell OA unit

2016-08-18 Thread Robert Bragg
ication and more fiddly error paths in the ->read implementations. The initialization code is now spit into an i915_perf_init() called in i915_driver_init_early() and an i915_perf_register() called in i915_driver_register() once we're visible to userspace, after sysfs has been initialized. -

[Intel-gfx] [PATCH v4 01/11] drm/i915: Add i915 perf infrastructure

2016-08-18 Thread Robert Bragg
yet so any attempt to open a stream will return an error. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/Makefile| 3 + drivers/gpu/drm/i915/i915_drv.c | 4 + drivers/gpu/drm/i915/i915_drv.h | 91 drivers/gpu/drm/i915/i915_pe

[Intel-gfx] [PATCH v4 09/11] drm/i915: add oa_event_min_timer_exponent sysctl

2016-08-18 Thread Robert Bragg
The minimal sampling period is now configurable via a dev.i915.oa_min_timer_exponent sysctl parameter. Following the precedent set by perf, the default is the minimum that won't (on its own) exceed the default kernel.perf_event_max_sample_rate default of 10 samples/s. Signed-off-by: R

[Intel-gfx] [PATCH v4 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-08-18 Thread Robert Bragg
OACONTROL changes quite a bit for gen8, with some bits split out into a per-context OACTXCONTROL register. Rename now before adding more gen7 OA registers Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 4 ++-- drivers/gpu/drm/i915/i915_reg.h| 2 +- 2 files

[Intel-gfx] [PATCH v4 10/11] drm/i915: Add more Haswell OA metric sets

2016-08-18 Thread Robert Bragg
rib/gputop > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_oa_hsw.c | 484 - 1 file changed, 483 insertions(+), 1 deletion(-) diff --git a/dr

[Intel-gfx] [PATCH v4 07/11] drm/i915: advertise available metrics via sysfs

2016-08-18 Thread Robert Bragg
scriptions and code generation scripts, ref: https://github.com/rib/gputop > gputop-data/guids.xml > scripts/update-guids.py > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml SYSFS=1 WHITELIST=RenderBasic Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v4 03/11] drm/i915: return EACCES for check_cmd() failures

2016-08-18 Thread Robert Bragg
er is disabled, but if we were to remove OACONTROL from the parser's whitelist then the returned EINVAL would break Mesa applications as they attempt an OACONTROL write. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) di

[Intel-gfx] [PATCH v4 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-08-18 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

[Intel-gfx] [PATCH v4 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-08-18 Thread Robert Bragg
In particular this tries to capture for posterity some of the early challenges we had with using the core perf infrastructure in case we ever want to revisit adapting perf for device metrics. Cc: Chris Wilson Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_perf.c | 163

[Intel-gfx] [PATCH v4 08/11] drm/i915: Add dev.i915.perf_event_paranoid sysctl option

2016-08-18 Thread Robert Bragg
Consistent with the kernel.perf_event_paranoid sysctl option that can allow non-root users to access system wide cpu metrics, this can optionally allow non-root users to access system wide OA counter metrics from Gen graphics hardware. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v5 07/11] drm/i915: advertise available metrics via sysfs

2016-08-19 Thread Robert Bragg
scriptions and code generation scripts, ref: https://github.com/rib/gputop > gputop-data/guids.xml > scripts/update-guids.py > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml SYSFS=1 WHITELIST=RenderBasic Signed-off-by: Robert Bragg

Re: [Intel-gfx] [PATCH v2 5/5] drm/i915: Add more OA configs for BDW, CHV, SKL + BXT

2017-04-05 Thread Robert Bragg
On Mon, Mar 27, 2017 at 7:16 PM, Matthew Auld < matthew.william.a...@gmail.com> wrote: > On 03/23, Robert Bragg wrote: > > These are auto generated from an XML description of metric sets, > > currently maintained in gputop, ref: > > > > https://github.com/rib/g

[Intel-gfx] [PATCH v3] drm/i915/perf: rate limit spurious oa report notice

2017-04-05 Thread Robert Bragg
printk_ratelimit() v3: (Matt) init and summarise with stream init/close not driver init/fini Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_drv.h | 6 ++ drivers/gpu/drm/i915/i915_perf.c | 28 +++- 2 files changed, 33 insertions(+), 1 deletion(-) diff --git

[Intel-gfx] [PATCH v3 0/7] Enable OA unit for Gen 8 and 9 in i915 perf

2017-04-05 Thread Robert Bragg
Adds some R/Bs from from Matthew and some updates based on Matthew's feedback Notably the 'Add OA unit support for Gen 8+' patch now avoids duplicating lots of fiddly tail race workaround code by adding a vfunc for reading the OA tail pointer register. Robert Bragg (7): d

[Intel-gfx] [PATCH v3 3/7] drm/i915/perf: Add 'render basic' Gen8+ OA unit configs

2017-04-05 Thread Robert Bragg
xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml WHITELIST=RenderBasic v2: add newlines to debug messages + fix comment (Matthew Auld) Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/Makefile | 8 +- drivers/gpu/drm/i915/i915

[Intel-gfx] [PATCH v3 4/7] drm/i915/perf: Add OA unit support for Gen 8+

2017-04-05 Thread Robert Bragg
er reports captured via MI_REPORT_PERF_COUNT commands. As a result, for Gen8+, we always require the dev.i915.perf_stream_paranoid to be unset for any access to OA metrics if not root. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_drv.h | 45 +- drivers/gpu/drm/i915/i915_gem

[Intel-gfx] [PATCH v3 1/7] drm/i915: expose _SLICE_MASK GETPARM

2017-04-05 Thread Robert Bragg
Enables userspace to determine the number of slices enabled and also know what specific slices are enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW slice configuration. Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v3 7/7] drm/i915/perf: remove perf.hook_lock

2017-04-05 Thread Robert Bragg
sed to be updated as part of a context pin hook. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_drv.h | 2 -- drivers/gpu/drm/i915/i915_perf.c | 32 ++-- 2 files changed, 10 insertions(+), 24 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.

[Intel-gfx] [PATCH v3 2/7] drm/i915: expose _SUBSLICE_MASK GETPARM

2017-04-05 Thread Robert Bragg
Assuming a uniform mask across all slices, this enables userspace to determine the specific sub slices enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW sub slice configuration. Signed-off-by: Robert

[Intel-gfx] [PATCH v3 6/7] drm/i915/perf: per-gen timebase for checking sample freq

2017-04-05 Thread Robert Bragg
Haswell. Signed-off-by: Robert Bragg Cc: Lionel Landwerlin --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_perf.c | 21 +++-- 2 files changed, 16 insertions(+), 6 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h

Re: [Intel-gfx] [PATCH v3 6/7] drm/i915/perf: per-gen timebase for checking sample freq

2017-04-05 Thread Robert Bragg
On Wed, Apr 5, 2017 at 6:26 PM, Ville Syrjälä wrote: > On Wed, Apr 05, 2017 at 06:17:36PM +0100, Lionel Landwerlin wrote: > > On 05/04/17 18:06, Ville Syrjälä wrote: > > > On Wed, Apr 05, 2017 at 05:23:19PM +0100, Robert Bragg wrote: > > >> An oa_exponent_to_ns(

[Intel-gfx] [PATCH v2] drm/i915/perf: per-gen timebase for checking sample freq

2017-04-05 Thread Robert Bragg
r BXT (Ville) Initialize oa_sample_rate_hard_limit per-gen too (Lionel) Signed-off-by: Robert Bragg Cc: Lionel Landwerlin Cc: Ville Syrjälä --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_perf.c | 31 ++- 2 files changed, 23 insertions(

Re: [Intel-gfx] [PATCH v3 4/7] drm/i915/perf: Add OA unit support for Gen 8+

2017-04-12 Thread Robert Bragg
On Wed, Apr 12, 2017 at 12:33 PM, Matthew Auld wrote: > On 04/05, Robert Bragg wrote: > > Enables access to OA unit metrics for BDW, CHV, SKL and BXT which all > > share (more-or-less) the same OA unit design. > > > > Of particular note in comparison to Haswell: some

Re: [Intel-gfx] [PATCH v2] drm/i915/perf: per-gen timebase for checking sample freq

2017-04-12 Thread Robert Bragg
On Wed, Apr 12, 2017 at 1:34 PM, Matthew Auld < matthew.william.a...@gmail.com> wrote: > On 5 April 2017 at 20:05, Robert Bragg wrote: > > An oa_exponent_to_ns() utility and per-gen timebase constants where > were > > > recently removed when updating the tail poi

[Intel-gfx] [PATCH v4 00/15] Enable OA unit for Gen 8 and 9 in i915 perf

2017-04-12 Thread Robert Bragg
no last moment uapi change for gputop, mesa and igt. The series is longer just because I've included the gen7 prep patches (already reviewed) that I haven't landed yet but the gen8+ bits depend on. Regards, - Robert Robert Bragg (15): drm/i915/perf: fix gen7_append_oa_reports comment d

[Intel-gfx] [PATCH v4 03/15] drm/i915/perf: avoid read back of head register

2017-04-12 Thread Robert Bragg
ping stone towards re-working how the head and tail state is managed as part of an improved workaround for the tail register race condition. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_drv.h | 11 ++ drivers/gpu/drm/i915/i915_p

[Intel-gfx] [PATCH v4 02/15] drm/i915/perf: avoid poll, read, EAGAIN busy loops

2017-04-12 Thread Robert Bragg
have. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 78fef53b45c9..f59f6dd20922 100644 --- a/drivers

[Intel-gfx] [PATCH v4 06/15] drm/i915/perf: improve invalid OA format debug message

2017-04-12 Thread Robert Bragg
A minor improvement to debugging output Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index 18734e1926b9

[Intel-gfx] [PATCH v4 05/15] drm/i915/perf: improve tail race workaround

2017-04-12 Thread Robert Bragg
t while checking whether the buffer contains data. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_drv.h | 60 - drivers/gpu/drm/i915/i915_perf.c | 277 ++- 2 files changed, 241 insertions(+), 96 deletions(-) di

[Intel-gfx] [PATCH v4 08/15] drm/i915/perf: rate limit spurious oa report notice

2017-04-12 Thread Robert Bragg
A sampling frequency that might be a large number of repeat notices. v2: (Chris) avoid inconsistent warning on throttle with printk_ratelimit() v3: (Matt) init and summarise with stream init/close not driver init/fini Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i

[Intel-gfx] [PATCH v4 04/15] drm/i915/perf: no head/tail ref in gen7_oa_read

2017-04-12 Thread Robert Bragg
l pointers. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 51 +++- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drivers/gpu/drm/i915/i915_perf.c index f47d1cc2144b..83

[Intel-gfx] [PATCH v4 01/15] drm/i915/perf: fix gen7_append_oa_reports comment

2017-04-12 Thread Robert Bragg
If I'm going to complain about a back-to-front convention then the least I can do is not muddle the comment up too. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gp

[Intel-gfx] [PATCH v4 07/15] drm/i915/perf: better pipeline aged/aging tail updates

2017-04-12 Thread Robert Bragg
a later hrtimer callback (and then another to age). Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_perf.c | 41 ++-- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_perf.c b/drive

[Intel-gfx] [PATCH v4 10/15] drm/i915: expose _SUBSLICE_MASK GETPARM

2017-04-12 Thread Robert Bragg
Assuming a uniform mask across all slices, this enables userspace to determine the specific sub slices enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW sub slice configuration. Signed-off-by: Robert

[Intel-gfx] [PATCH v4 09/15] drm/i915: expose _SLICE_MASK GETPARM

2017-04-12 Thread Robert Bragg
Enables userspace to determine the number of slices enabled and also know what specific slices are enabled. This information is required, for example, to be able to analyse some OA counter reports where the counter configuration depends on the HW slice configuration. Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v4 11/15] drm/i915/perf: Add 'render basic' Gen8+ OA unit configs

2017-04-12 Thread Robert Bragg
xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml WHITELIST=RenderBasic v2: add newlines to debug messages + fix comment (Matthew Auld) Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld Acked-by: Lionel Landwerlin --- drivers/gpu/drm/i915/Makefile

[Intel-gfx] [PATCH v4 12/15] drm/i915/perf: Add OA unit support for Gen 8+

2017-04-12 Thread Robert Bragg
er reports captured via MI_REPORT_PERF_COUNT commands. As a result, for Gen8+, we always require the dev.i915.perf_stream_paranoid to be unset for any access to OA metrics if not root. Signed-off-by: Robert Bragg Acked-by: Lionel Landwerlin --- drivers/gpu/drm/i915/i915_drv.h | 45 +- d

[Intel-gfx] [PATCH v4 14/15] drm/i915/perf: per-gen timebase for checking sample freq

2017-04-12 Thread Robert Bragg
r BXT (Ville) Initialize oa_sample_rate_hard_limit per-gen too (Lionel) Signed-off-by: Robert Bragg Cc: Lionel Landwerlin Cc: Ville Syrjälä Reviewed-by: Matthew Auld Acked-by: Lionel Landwerlin --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_perf.c

[Intel-gfx] [PATCH v4 15/15] drm/i915/perf: remove perf.hook_lock

2017-04-12 Thread Robert Bragg
sed to be updated as part of a context pin hook. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld Acked-by: Lionel Landwerlin --- drivers/gpu/drm/i915/i915_drv.h | 2 -- drivers/gpu/drm/i915/i915_perf.c | 32 ++-- 2 files changed, 10 insertions(+), 24 deleti

Re: [Intel-gfx] [PATCH] drm/i915: Add i915 perf infrastructure

2016-10-19 Thread Robert Bragg
On Wed, Oct 12, 2016 at 12:41 PM, Joonas Lahtinen < joonas.lahti...@linux.intel.com> wrote: > On ti, 2016-10-11 at 12:03 -0700, Robert Bragg wrote: > > > > + case DRM_I915_PERF_PROP_MAX: > > > > + BUG(); > > > >

[Intel-gfx] [PATCH v6 03/11] drm/i915: return EACCES for check_cmd() failures

2016-10-20 Thread Robert Bragg
er is disabled, but if we were to remove OACONTROL from the parser's whitelist then the returned EINVAL would break Mesa applications as they attempt an OACONTROL write. This bumps the command parser version from 7 to 8, as the change is visible to userspace. Signed-off-by: Robert Bragg --- drive

[Intel-gfx] [PATCH v6 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-10-20 Thread Robert Bragg
particular running any Mesa based GL application currently results in clearing OACONTROL when initializing which would disable the capturing of metrics. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38 ++ 1 file changed, 2 insertions(+), 36

[Intel-gfx] [PATCH v6 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-10-20 Thread Robert Bragg
OACONTROL changes quite a bit for gen8, with some bits split out into a per-context OACTXCONTROL register. Rename now before adding more gen7 OA registers Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gvt/handlers.c| 2 +- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v6 01/11] drm/i915: Add i915 perf infrastructure

2016-10-20 Thread Robert Bragg
ORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Robert Bragg + */

[Intel-gfx] [PATCH v6 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-10-20 Thread Robert Bragg
ake -C gputop-data -f Makefile.xml SYSFS=0 WHITELIST=RenderBasic Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.h| 14 drivers/gpu/drm/i915/i915_oa_hsw.c | 144 + d

[Intel-gfx] [PATCH v6 09/11] drm/i915: add oa_event_min_timer_exponent sysctl

2016-10-20 Thread Robert Bragg
The minimal sampling period is now configurable via a dev.i915.oa_min_timer_exponent sysctl parameter. Following the precedent set by perf, the default is the minimum that won't (on its own) exceed the default kernel.perf_event_max_sample_rate default of 10 samples/s. Signed-off-by: R

[Intel-gfx] [PATCH v6 10/11] drm/i915: Add more Haswell OA metric sets

2016-10-20 Thread Robert Bragg
rib/gputop > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_oa_hsw.c | 559 - 1 file changed, 558 insertions(+), 1 deletio

[Intel-gfx] [PATCH v6 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-20 Thread Robert Bragg
ing, without relying on _pin_notify hook, in case ctx already pinned. Cc: Chris Wilson Signed-off-by: Robert Bragg Signed-off-by: Zhenyu Wang factor out init_specific_ctx_id func --- drivers/gpu/drm/i915/i915_drv.h | 72 ++- drivers/gpu/drm/i915/i915_gem_context.c | 22 +- drivers/gpu/

[Intel-gfx] [PATCH v6 07/11] drm/i915: advertise available metrics via sysfs

2016-10-20 Thread Robert Bragg
scriptions and code generation scripts, ref: https://github.com/rib/gputop > gputop-data/guids.xml > scripts/update-guids.py > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml SYSFS=1 WHITELIST=RenderBasic Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v6 08/11] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option

2016-10-20 Thread Robert Bragg
Consistent with the kernel.perf_event_paranoid sysctl option that can allow non-root users to access system wide cpu metrics, this can optionally allow non-root users to access system wide OA counter metrics from Gen graphics hardware. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld

[Intel-gfx] [PATCH v6 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-10-20 Thread Robert Bragg
In particular this tries to capture for posterity some of the early challenges we had with using the core perf infrastructure in case we ever want to revisit adapting perf for device metrics. Cc: Chris Wilson Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915

Re: [Intel-gfx] [PATCH v6 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-21 Thread Robert Bragg
On Thu, Oct 20, 2016 at 11:10 PM, Chris Wilson wrote: > On Thu, Oct 20, 2016 at 10:19:05PM +0100, Robert Bragg wrote: > > +int i915_gem_context_pin_legacy_rcs_state(struct drm_i915_private > *dev_priv, > > + struct i91

Re: [Intel-gfx] [PATCH v6 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-21 Thread Robert Bragg
On Thu, Oct 20, 2016 at 11:10 PM, Chris Wilson wrote: > On Thu, Oct 20, 2016 at 10:19:05PM +0100, Robert Bragg wrote: > > +int i915_gem_context_pin_legacy_rcs_state(struct drm_i915_private > *dev_priv, > > + struct i91

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

2016-10-21 Thread Robert Bragg
ing, without relying on _pin_notify hook, in case ctx already pinned. Cc: Chris Wilson Signed-off-by: Robert Bragg Signed-off-by: Zhenyu Wang --- drivers/gpu/drm/i915/i915_drv.h | 70 ++- drivers/gpu/drm/i915/i915_gem_context.c | 22 +- drivers/gpu/drm/i915/i915_perf.c| 1

[Intel-gfx] [PATCH] igt/gem_exec_parse: update for version 8 changes

2016-10-21 Thread Robert Bragg
mand parser to squash the commands to NOOPS). The interface change isn't expected to affect userspace and in fact it looks like the previous behaviour was liable to break userspace, such as Mesa which explicitly tries to observe whether OACONTROL LRIs are squashed to NOOPs but Mesa will abo

[Intel-gfx] [PATCH v7 03/11] drm/i915: return EACCES for check_cmd() failures

2016-10-24 Thread Robert Bragg
er is disabled, but if we were to remove OACONTROL from the parser's whitelist then the returned EINVAL would break Mesa applications as they attempt an OACONTROL write. This bumps the command parser version from 7 to 8, as the change is visible to userspace. Signed-off-by: Robert Bragg --- drive

[Intel-gfx] [PATCH v7 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-10-24 Thread Robert Bragg
particular running any Mesa based GL application currently results in clearing OACONTROL when initializing which would disable the capturing of metrics. Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38 ++ 1 file changed, 2 insertions(+), 36

[Intel-gfx] [PATCH v7 07/11] drm/i915: advertise available metrics via sysfs

2016-10-24 Thread Robert Bragg
scriptions and code generation scripts, ref: https://github.com/rib/gputop > gputop-data/guids.xml > scripts/update-guids.py > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml SYSFS=1 WHITELIST=RenderBasic Signed-off-by: Robert Bragg

[Intel-gfx] [PATCH v7 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-10-24 Thread Robert Bragg
OACONTROL changes quite a bit for gen8, with some bits split out into a per-context OACTXCONTROL register. Rename now before adding more gen7 OA registers Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/gvt/handlers.c| 2 +- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v7 01/11] drm/i915: Add i915 perf infrastructure

2016-10-24 Thread Robert Bragg
ORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Robert Bragg + */

[Intel-gfx] [PATCH v7 08/11] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option

2016-10-24 Thread Robert Bragg
Consistent with the kernel.perf_event_paranoid sysctl option that can allow non-root users to access system wide cpu metrics, this can optionally allow non-root users to access system wide OA counter metrics from Gen graphics hardware. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld

[Intel-gfx] [PATCH v7 09/11] drm/i915: add oa_event_min_timer_exponent sysctl

2016-10-24 Thread Robert Bragg
The minimal sampling period is now configurable via a dev.i915.oa_min_timer_exponent sysctl parameter. Following the precedent set by perf, the default is the minimum that won't (on its own) exceed the default kernel.perf_event_max_sample_rate default of 10 samples/s. Signed-off-by: R

[Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-24 Thread Robert Bragg
ing, without relying on _pin_notify hook, in case ctx already pinned. v3: Revert back to pinning ctx upfront when opening stream, removing need to hook in to pinning and to update OACONTROL on the fly. Cc: Chris Wilson Signed-off-by: Robert Bragg Signed-off-by: Zhenyu Wang fix enable

[Intel-gfx] [PATCH v7 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-10-24 Thread Robert Bragg
In particular this tries to capture for posterity some of the early challenges we had with using the core perf infrastructure in case we ever want to revisit adapting perf for device metrics. Cc: Chris Wilson Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915

[Intel-gfx] [PATCH v7 10/11] drm/i915: Add more Haswell OA metric sets

2016-10-24 Thread Robert Bragg
rib/gputop > gputop-data/oa-*.xml > scripts/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_oa_hsw.c | 559 - 1 file changed, 558 insertions(+), 1 deletio

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-25 Thread Robert Bragg
On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld < matthew.william.a...@gmail.com> wrote: > On 25 October 2016 at 00:19, Robert Bragg wrote: > > > diff --git a/drivers/gpu/drm/i915/i915_drv.h > b/drivers/gpu/drm/i915/i915_drv.h > > index 3448d05..ea24814 100644 >

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Robert Bragg
On 26 Oct 2016 11:08 a.m., "Matthew Auld" wrote: > > On 26 October 2016 at 00:51, Robert Bragg wrote: > > > > > > On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld > > wrote: > >> > >> On 25 October 2016 at 00:19, Robert Bragg wrote:

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Robert Bragg
On 26 Oct 2016 9:54 a.m., "Chris Wilson" wrote: > > On Wed, Oct 26, 2016 at 12:51:58AM +0100, Robert Bragg wrote: > >On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld > ><[1]matthew.william.a...@gmail.com> wrote: > > > > On 25 October 2016 a

[Intel-gfx] [PATCH igt 0/3] corresponding changes for i915-perf interface

2016-10-26 Thread Robert Bragg
The i915-perf series affects the command parser and itself includes new uapi which these i-g-t changes try to cover. - Robert Robert Bragg (3): igt/perf: add i915 perf stream tests for Haswell igt/gem_exec_parse: remove oacontrol checks igt/gem_exec_parse: update for version 8 changes

[Intel-gfx] [PATCH igt 1/3] igt/perf: add i915 perf stream tests for Haswell

2016-10-26 Thread Robert Bragg
Signed-off-by: Robert Bragg --- tests/Makefile.sources |1 + tests/perf.c | 2173 2 files changed, 2174 insertions(+) create mode 100644 tests/perf.c diff --git a/tests/Makefile.sources b/tests/Makefile.sources index 6d081c3

[Intel-gfx] [PATCH igt 3/3] igt/gem_exec_parse: update for version 8 changes

2016-10-26 Thread Robert Bragg
vious behaviour was liable to break userspace, such as Mesa which explicitly tries to observe whether OACONTROL LRIs are squashed to NOOPs but Mesa will abort for execbuffer errors. Signed-off-by: Robert Bragg --- tests/gem_exec_parse.c | 368 +++-- 1

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Robert Bragg
On Wed, Oct 26, 2016 at 4:37 PM, Ville Syrjälä < ville.syrj...@linux.intel.com> wrote: > On Wed, Oct 26, 2016 at 04:17:45PM +0100, Robert Bragg wrote: > > On 26 Oct 2016 9:54 a.m., "Chris Wilson" > wrote: > > > > > > On Wed, Oct 26, 2016 at 12:51:58A

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Robert Bragg
On 26 Oct 2016 5:54 p.m., "Ville Syrjälä" wrote: > > On Wed, Oct 26, 2016 at 05:42:23PM +0100, Robert Bragg wrote: > > On Wed, Oct 26, 2016 at 4:37 PM, Ville Syrjälä < > > ville.syrj...@linux.intel.com> wrote: > > > > > On Wed, Oct 26, 2016 at 04

Re: [Intel-gfx] [PATCH v7 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-26 Thread Robert Bragg
On Wed, Oct 26, 2016 at 4:03 PM, Robert Bragg wrote: > On 26 Oct 2016 11:08 a.m., "Matthew Auld" > wrote: > > > > On 26 October 2016 at 00:51, Robert Bragg wrote: > > > > > > > > > On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld > >

[Intel-gfx] [PATCH igt 2/3] igt/gem_exec_parse: remove oacontrol checks

2016-10-27 Thread Robert Bragg
ceful fallback path for not being able to write to OACONTROL via LRI commands will cause Mesa applications to abort(). Signed-off-by: Robert Bragg --- tests/gem_exec_parse.c | 88 -- 1 file changed, 88 deletions(-) diff --git a/tests/gem_exec_pars

[Intel-gfx] [PATCH v7 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-10-27 Thread Robert Bragg
ake -C gputop-data -f Makefile.xml SYSFS=0 WHITELIST=RenderBasic Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/i915_drv.h| 14 drivers/gpu/drm/i915/i915_oa_hsw.c | 144 + d

[Intel-gfx] [PATCH v7 00/11] Enable i915 perf stream for Haswell OA unit

2016-10-27 Thread Robert Bragg
original concern was overly cautious (or no longer an issue with the latest code), then this change is ok. - Robert Robert Bragg (11): drm/i915: Add i915 perf infrastructure drm/i915: rename OACONTROL GEN7_OACONTROL drm/i915: return EACCES for check_cmd() failures drm/i915: don't w

[Intel-gfx] [PATCH v8 04/12] drm/i915: return EACCES for check_cmd() failures

2016-10-27 Thread Robert Bragg
er is disabled, but if we were to remove OACONTROL from the parser's whitelist then the returned EINVAL would break Mesa applications as they attempt an OACONTROL write. This bumps the command parser version from 7 to 8, as the change is visible to userspace. Signed-off-by: Robert Bragg Reviewed-b

[Intel-gfx] [PATCH v8 02/12] drm/i915: Add i915 perf infrastructure

2016-10-27 Thread Robert Bragg
ORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS + * IN THE SOFTWARE. + * + * Authors: + * Robert Bragg + */

[Intel-gfx] [PATCH v8 00/12] Enable i915 perf stream for Haswell OA unit

2016-10-27 Thread Robert Bragg
his to the list himself with a proper commit message. - Robert Chris Wilson (1): ctx-pin placeholder from chris Robert Bragg (11): drm/i915: Add i915 perf infrastructure drm/i915: rename OACONTROL GEN7_OACONTROL drm/i915: return EACCES for check_cmd() failures drm/i915: don't whitel

[Intel-gfx] [PATCH v8 01/12] ctx-pin placeholder from chris

2016-10-27 Thread Robert Bragg
From: Chris Wilson --- drivers/gpu/drm/i915/i915_drv.h | 1 + drivers/gpu/drm/i915/i915_gem_context.c | 34 ++--- 2 files changed, 24 insertions(+), 11 deletions(-) diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h index 55afb66.

  1   2   3   4   >