[RFC v2] drm: Enable dynamic debug for DRM_[DEV]_DEBUG*

2016-12-08 Thread Robert Bragg
On Thu, Dec 8, 2016 at 12:17 AM, Daniel Vetter wrote: > > On Wed, Dec 07, 2016 at 06:35:29PM +, Robert Bragg wrote: > > This is still missing corresponding documentation changes, and I haven't > > moved anything to drm_print.h yet, as suggested. > > > > Sen

[RFC] drm: Enable dynamic debug for DRM_[DEV]_DEBUG*

2016-12-07 Thread Robert Bragg
On Mon, Dec 5, 2016 at 4:31 PM, Daniel Vetter wrote: > On Mon, Dec 05, 2016 at 11:24:44AM +0000, Robert Bragg wrote: > > Forgot to send to dri-devel when I first sent this out... > > > > The few times I've looked at using DRM_DEBUG messages, I haven't found > > them v

[RFC v2] drm: Enable dynamic debug for DRM_[DEV]_DEBUG*

2016-12-07 Thread Robert Bragg
und" Only single conditional call per message (macros expand to less code) Uses __dynamic_pr_debug/dev_dbg for dynamic formatting features Use module name for msg prefix like [drm] or [i915] Signed-off-by: Robert Bragg Cc: dri-devel at lists.freedesktop.org Cc: Daniel Vetter Cc: Tvrtk

[Intel-gfx] [RFC 0/5] DRM logging tidy

2016-12-07 Thread Robert Bragg
On Tue, Dec 6, 2016 at 6:57 PM, Tvrtko Ursulin wrote: > From: Tvrtko Ursulin > > I wasn't here at the beginnings of DRM so I might have gotten this wrong, > however the existance of DRM_NAME suggested to me that the intention was to > allow individual drivers to override it and get appropriate

[RFC] drm: Enable dynamic debug for DRM_[DEV]_DEBUG*

2016-12-05 Thread Robert Bragg
n this case. Previously some of non-dev drm debug macros were defined in terms of passing NULL to a dev version but that's avoided now due to this difference. Signed-off-by: Robert Bragg Cc: dri-devel at lists.freedesktop.org Cc: Daniel Vetter Cc: Chris Wilson --- drivers/gpu/drm/drm_drv.c |

[ANNOUNCE] libdrm 2.4.74

2016-11-29 Thread Robert Bragg
declaration warning libdrm: random typo fixes Michel Dänzer (1): intel: Add drm_intel_gem_context_get_id to intel-symbols-check Rob Clark (1): freedreno: 64bit support Robert Bragg (2): intel: Add a getter for the intel_context ctx_id Bump version for release git tag

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

2016-11-22 Thread Robert Bragg
On Tue, Nov 22, 2016 at 1:34 PM, Daniel Vetter wrote: > On Tue, Nov 08, 2016 at 12:51:48PM +0000, Robert Bragg wrote: > > This v2 patch bumps the command parser version so it can be referenced in > > corresponding i-g-t gem_exec_parse changes. > > > > --- >8 --- >

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

2016-11-22 Thread Robert Bragg
On Tue, Nov 22, 2016 at 1:31 PM, Daniel Vetter wrote: > On Tue, Nov 22, 2016 at 02:29:18PM +0100, Daniel Vetter wrote: > > On Wed, Nov 09, 2016 at 08:00:06PM +, Matthew Auld wrote: > > > On 7 November 2016 at 19:49, Robert Bragg > wrote: > > > > Adds base

[PATCH libdrm v2] intel: Add a getter for the intel_context ctx_id

2016-11-21 Thread Robert Bragg
_id/ Signed-off: Robert Bragg Reviewed-by: Matthew Auld --- intel/intel_bufmgr.h | 2 ++ intel/intel_bufmgr_gem.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmgr.h index ce4e70d..85e4ff7 100644 --- a/intel/intel_bufmgr.h +++ b/in

[PATCH libdrm] intel: Add a getter for the intel_context ctx_id

2016-11-17 Thread Robert Bragg
esa. For example this can be used to configure an i915-perf stream to collect metrics for a specific context. Signed-off: Robert Bragg --- intel/intel_bufmgr.h | 2 ++ intel/intel_bufmgr_gem.c | 11 +++ 2 files changed, 13 insertions(+) diff --git a/intel/intel_bufmgr.h b/intel/intel_bufmg

[PATCH] headers: add i915-perf interface to i915_drm.h

2016-11-10 Thread Robert Bragg
Ah, yup, I missed the [PATH libdrm] convention sorry. I noticed some other updates based on make headers_install, though I also saw a bunch of unrelated noise with e.g. mocs and C++ guard changes so figured I'd avoid those for now, while I was pretty much expecting I'd need to re-send this later.

[PATCH v9 09/11] drm/i915: add dev.i915.oa_max_sample_rate sysctl

2016-11-10 Thread Robert Bragg
On Wed, Nov 9, 2016 at 7:52 PM, Matthew Auld wrote: > On 7 November 2016 at 19:49, Robert Bragg wrote: > > The maximum OA sampling frequency is now configurable via a > > dev.i915.oa_max_sample_rate sysctl parameter. > > > > Following the prec

[PATCH] headers: add i915-perf interface to i915_drm.h

2016-11-10 Thread Robert Bragg
This interface gives access to Gen graphics Observability counters Signed-off-by: Robert Bragg --- include/drm/i915_drm.h | 134 + 1 file changed, 134 insertions(+) diff --git a/include/drm/i915_drm.h b/include/drm/i915_drm.h index eb611a7

[PATCH v2] drm/i915: don't whitelist oacontrol in cmd parser

2016-11-08 Thread Robert Bragg
and parser version from 8 to 9, as the change is visible to userspace. Signed-off-by: Robert Bragg Reviewed-by: Matthew Auld Reviewed-by: Sourab Gupta --- drivers/gpu/drm/i915/i915_cmd_parser.c | 42 -- 1 file changed, 5 insertions(+), 37 deletions(-) d

[PATCH v9 09/11] drm/i915: add dev.i915.oa_max_sample_rate sysctl

2016-11-08 Thread Robert Bragg
On Tue, Nov 8, 2016 at 6:19 AM, sourab gupta wrote: > On Mon, 2016-11-07 at 11:49 -0800, Robert Bragg wrote: > > The maximum OA sampling frequency is now configurable via a > > dev.i915.oa_max_sample_rate sysctl parameter. > > > > Following the prec

[PATCH v9 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-11-07 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

[PATCH v9 10/11] drm/i915: Add more Haswell OA metric sets

2016-11-07 Thread Robert Bragg
s/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 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_oa_hs

[PATCH v9 09/11] drm/i915: add dev.i915.oa_max_sample_rate sysctl

2016-11-07 Thread Robert Bragg
The maximum OA sampling frequency is now configurable via a dev.i915.oa_max_sample_rate sysctl parameter. Following the precedent set by perf's similar kernel.perf_event_max_sample_rate the default maximum rate is 10Hz Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_perf.c | 61

[PATCH v9 08/11] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option

2016-11-07 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

[PATCH v9 07/11] drm/i915: advertise available metrics via sysfs

2016-11-07 Thread Robert Bragg
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 Reviewed

[PATCH v9 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-11-07 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. Signed-off-by: Robert Bragg Signed-off-by: Zhenyu Wang Cc: Chris Wilson Reviewed-by: Matt

[PATCH v9 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-11-07 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

[PATCH v9 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-11-07 Thread Robert Bragg
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 Reviewed-by: Matthew Auld Reviewed-by: Sourab Gupta --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38

[PATCH v9 03/11] drm/i915: return EACCES for check_cmd() failures

2016-11-07 Thread Robert Bragg
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-by: Matthew

[PATCH v9 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-11-07 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 Reviewed-by: Sourab Gupta --- drivers/gpu/drm/i915/gvt/handlers.c| 2 +- drivers

[PATCH v9 01/11] drm/i915: Add i915 perf infrastructure

2016-11-07 Thread Robert Bragg
attempt to open a stream will return an error. v2: use i915_gem_context_get() - Chris Wilson v3: update read() interface to avoid passing state struct - Chris Wilson fix some rebase fallout, with i915-perf init/deinit v4: s/DRM_IORW/DRM_IOW/ - Emil Velikov Signed-off-by: Robert Bragg

[PATCH v9 00/11] Enable i915 perf stream for Haswell OA unit

2016-11-07 Thread Robert Bragg
gen9 OA is enabled where the exponents don't represent the same periods as for Haswell. - 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 whitelist oacontrol in cmd

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

2016-11-04 Thread Robert Bragg
On Fri, Nov 4, 2016 at 8:59 AM, sourab gupta wrote: > On Thu, 2016-10-27 at 19:14 -0700, 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 > > prope

[PATCH v8 10/12] drm/i915: add oa_event_min_timer_exponent sysctl

2016-11-04 Thread Robert Bragg
On Wed, Nov 2, 2016 at 6:29 AM, sourab gupta wrote: > On Thu, 2016-10-27 at 19:14 -0700, Robert Bragg wrote: > > The minimal sampling period is now configurable via a > > dev.i915.oa_min_timer_exponent sysctl parameter. > > > > Following the precedent set by perf,

[PATCH v8 11/12] drm/i915: Add more Haswell OA metric sets

2016-11-01 Thread Robert Bragg
On Tue, Nov 1, 2016 at 2:57 PM, Chris Wilson wrote: > On Fri, Oct 28, 2016 at 03:14:29AM +0100, Robert Bragg wrote: > > This adds 'compute', 'compute extended', 'memory reads', 'memory writes' > > and 'sampler balance' metric sets for Haswell. > > > > The code is

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

2016-10-31 Thread Robert Bragg
On Mon, Oct 31, 2016 at 5:13 PM, Matthew Auld < matthew.william.auld at gmail.com> wrote: > On 31 October 2016 at 16:27, Robert Bragg wrote: > > > > > > On Fri, Oct 28, 2016 at 3:27 PM, Matthew Auld > > wrote: > >> > >> > +/* Note we copy th

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

2016-10-31 Thread Robert Bragg
On Fri, Oct 28, 2016 at 3:27 PM, Matthew Auld < matthew.william.auld at gmail.com> wrote: > > +/* Note we copy the properties from userspace outside of the i915 perf > > + * mutex to avoid an awkward lockdep with mmap_sem. > > + * > > + * Note this function only validates properties in isolation

[PATCH v8 12/12] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-10-28 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

[PATCH v8 11/12] drm/i915: Add more Haswell OA metric sets

2016-10-28 Thread Robert Bragg
s/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 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_oa_hs

[PATCH v8 10/12] drm/i915: add oa_event_min_timer_exponent sysctl

2016-10-28 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: Robert

[PATCH v8 09/12] drm/i915: Add dev.i915.perf_stream_paranoid sysctl option

2016-10-28 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

[PATCH v8 08/12] drm/i915: advertise available metrics via sysfs

2016-10-28 Thread Robert Bragg
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 Reviewed

[PATCH v8 07/12] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-28 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 --- drivers/gpu/

[PATCH v8 06/12] drm/i915: Add 'render basic' Haswell OA unit config

2016-10-28 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

[PATCH v8 05/12] drm/i915: don't whitelist oacontrol in cmd parser

2016-10-28 Thread Robert Bragg
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 Reviewed-by: Matthew Auld --- drivers/gpu/drm/i915/i915_cmd_parser.c | 38 ++ 1 file changed, 2

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

2016-10-28 Thread Robert Bragg
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-by: Matthew

[PATCH v8 03/12] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-10-28 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

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

2016-10-28 Thread Robert Bragg
attempt to open a stream will return an error. v2: use i915_gem_context_get() - Chris Wilson v3: update read() interface to avoid passing state struct - Chris Wilson fix some rebase fallout, with i915-perf init/deinit v4: s/DRM_IORW/DRM_IOW/ - Emil Velikov Signed-off-by: Robert Bragg

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

2016-10-28 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

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

2016-10-28 Thread Robert Bragg
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 whitelist oacontrol in cmd

[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 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.syrjala at linux.intel.com> wrote: > > > > > On Wed, Oct

[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.syrjala at 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

[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.auld at gmail.com> wrote: > > > > On 25

[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:

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

2016-10-26 Thread Robert Bragg
On Tue, Oct 25, 2016 at 10:35 PM, Matthew Auld < matthew.william.auld at 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 >

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

2016-10-25 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

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

2016-10-25 Thread Robert Bragg
s/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 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_oa_hs

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

2016-10-25 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: Robert

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

2016-10-25 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

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

2016-10-25 Thread Robert Bragg
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 Reviewed

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

2016-10-25 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

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

2016-10-25 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

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

2016-10-25 Thread Robert Bragg
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 deletions

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

2016-10-25 Thread Robert Bragg
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 --- drivers/gpu/drm

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

2016-10-25 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

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

2016-10-25 Thread Robert Bragg
attempt to open a stream will return an error. v4: s/DRM_IORW/DRM_IOW/ - Emil Velikov v3: update read() interface to avoid passing state struct - Chris Wilson fix some rebase fallout, with i915-perf init/deinit v2: use i915_gem_context_get() - Chris Wilson Signed-off-by: Robert Bragg

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

2016-10-25 Thread Robert Bragg
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 whitelist oacontrol in cmd

[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

[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

[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

[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

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

2016-10-20 Thread Robert Bragg
s/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 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_oa_hs

[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: Robert

[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

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

2016-10-20 Thread Robert Bragg
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 Reviewed

[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/

[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

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

2016-10-20 Thread Robert Bragg
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 deletions

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

2016-10-20 Thread Robert Bragg
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 --- drivers/gpu/drm

[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

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

2016-10-20 Thread Robert Bragg
attempt to open a stream will return an error. v4: s/DRM_IORW/DRM_IOW/ - Emil Velikov v3: update read() interface to avoid passing state struct - Chris Wilson fix some rebase fallout, with i915-perf init/deinit v2: use i915_gem_context_get() - Chris Wilson Signed-off-by: Robert Bragg

[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.lahtinen at 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 v5 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-10-11 Thread Robert Bragg
On Fri, Oct 7, 2016 at 10:19 AM, Matthew Auld < matthew.william.auld at gmail.com> wrote: > On 14 September 2016 at 15:19, Robert Bragg wrote: > > > diff --git a/drivers/gpu/drm/i915/i915_perf.c > b/drivers/gpu/drm/i915/i915_perf.c > > index 87530f5..5305982 100644 >

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

2016-10-11 Thread Robert Bragg
On Fri, Oct 7, 2016 at 10:10 AM, Matthew Auld < matthew.william.auld at gmail.com> wrote: > On 14 September 2016 at 16:32, Robert Bragg wrote: > > > + > > +int i915_perf_open_ioctl_locked(struct drm_device *dev, > > + struct d

[PATCH] drm/i915: Add i915 perf infrastructure

2016-09-14 Thread Robert Bragg
attempt to open a stream will return an error. v4: s/DRM_IORW/DRM_IOR/ - Emil Velikov v3: update read() interface to avoid passing state struct - Chris Wilson fix some rebase fallout, with i915-perf init/deinit v2: use i915_gem_context_get() - Chris Wilson Signed-off-by: Robert Bragg

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

2016-09-14 Thread Robert Bragg
On Wed, Sep 14, 2016 at 3:42 PM, Emil Velikov wrote: > Hi Robert, > > I think I've spotted one interesting, yet trivial bit. > > On 14 September 2016 at 15:19, Robert Bragg wrote: > > Adds base i915 perf infrastructure for Gen performance metrics. > > > > Thi

[PATCH v5 11/11] drm/i915: Add a kerneldoc summary for i915_perf.c

2016-09-14 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

[PATCH v5 10/11] drm/i915: Add more Haswell OA metric sets

2016-09-14 Thread Robert Bragg
s/i915-perf-kernelgen.py $ make -C gputop-data -f Makefile.xml Signed-off-by: Robert Bragg --- drivers/gpu/drm/i915/i915_oa_hsw.c | 559 - 1 file changed, 558 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/i915/i915_oa_hsw.c b/drivers/gpu/dr

[PATCH v5 09/11] drm/i915: add oa_event_min_timer_exponent sysctl

2016-09-14 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: Robert

[PATCH v5 08/11] drm/i915: Add dev.i915.perf_event_paranoid sysctl option

2016-09-14 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

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

2016-09-14 Thread Robert Bragg
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 --- dri

[PATCH v5 06/11] drm/i915: Enable i915 perf stream for Haswell OA unit

2016-09-14 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

[PATCH v5 05/11] drm/i915: Add 'render basic' Haswell OA unit config

2016-09-14 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 | 143 + drivers/gpu/drm/i915/i915_oa

[PATCH v5 04/11] drm/i915: don't whitelist oacontrol in cmd parser

2016-09-14 Thread Robert Bragg
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 deletions

[PATCH v5 03/11] drm/i915: return EACCES for check_cmd() failures

2016-09-14 Thread Robert Bragg
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(-) diff --git

[PATCH v5 02/11] drm/i915: rename OACONTROL GEN7_OACONTROL

2016-09-14 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

[PATCH v5 01/11] drm/i915: Add i915 perf infrastructure

2016-09-14 Thread Robert Bragg
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_perf.c | 448 +++ include

[PATCH v5 00/11] Enable i915 perf stream for Haswell OA unit

2016-09-14 Thread Robert Bragg
for this series at the moment is just keeping up with rebasing on nightlies. Regards, - 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 whitelist oacontrol in cmd parser

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

2016-08-19 Thread Robert Bragg
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 --- dri

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

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

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

2016-08-19 Thread Robert Bragg
s/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/drivers/gpu/drm/i915/i915_oa_hsw.c b/drivers/gpu/dr

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

2016-08-19 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: Robert

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

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

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

2016-08-19 Thread Robert Bragg
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 --- dri

  1   2   3   >