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

Matthew Auld matthew.william.auld at gmail.com
Fri Oct 7 17:15:57 UTC 2016


On 14 September 2016 at 15:19, Robert Bragg <robert at sixbynine.org> wrote:
> Adds a static OA unit, MUX + B Counter configuration for basic render
> metrics on Haswell. This is auto generated from an XML
> description of metric sets, currently maintained in gputop, ref:
>
>   https://github.com/rib/gputop
>   > gputop-data/oa-*.xml
>   > scripts/i915-perf-kernelgen.py
>
>   $ make -C gputop-data -f Makefile.xml SYSFS=0 WHITELIST=RenderBasic
>
> Signed-off-by: Robert Bragg <robert at sixbynine.org>
> ---
>  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_hsw.h |  34 +++++++++
>  4 files changed, 193 insertions(+), 1 deletion(-)
>  create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.c
>  create mode 100644 drivers/gpu/drm/i915/i915_oa_hsw.h
>
> diff --git a/drivers/gpu/drm/i915/Makefile b/drivers/gpu/drm/i915/Makefile
> index d991781..6cb25dd 100644
> --- a/drivers/gpu/drm/i915/Makefile
> +++ b/drivers/gpu/drm/i915/Makefile
> @@ -111,7 +111,8 @@ i915-y += dvo_ch7017.o \
>  i915-y += i915_vgpu.o
>
>  # perf code
> -i915-y += i915_perf.o
> +i915-y += i915_perf.o \
> +         i915_oa_hsw.o
>
>  ifeq ($(CONFIG_DRM_I915_GVT),y)
>  i915-y += intel_gvt.o
> diff --git a/drivers/gpu/drm/i915/i915_drv.h b/drivers/gpu/drm/i915/i915_drv.h
> index 0f5cd8f..5fad018 100644
> --- a/drivers/gpu/drm/i915/i915_drv.h
> +++ b/drivers/gpu/drm/i915/i915_drv.h
> @@ -1740,6 +1740,11 @@ struct intel_wm_config {
>         bool sprites_scaled;
>  };
>
> +struct i915_oa_reg {
> +       i915_reg_t addr;
> +       u32 value;
> +};
> +
>  struct i915_perf_stream;
>
>  struct i915_perf_stream_ops {
> @@ -2122,6 +2127,15 @@ struct drm_i915_private {
>                 bool initialized;
>                 struct mutex lock;
>                 struct list_head streams;
> +
> +               struct {
> +                       u32 metrics_set;
> +
> +                       const struct i915_oa_reg *mux_regs;
> +                       int mux_regs_len;
> +                       const struct i915_oa_reg *b_counter_regs;
> +                       int b_counter_regs_len;
> +               } oa;
>         } perf;
>
>         /* Abstract the submission mechanism (legacy ringbuffer or execlists) away */
> diff --git a/drivers/gpu/drm/i915/i915_oa_hsw.c b/drivers/gpu/drm/i915/i915_oa_hsw.c
> new file mode 100644
> index 0000000..eb5ceca
> --- /dev/null
> +++ b/drivers/gpu/drm/i915/i915_oa_hsw.c
> @@ -0,0 +1,143 @@
> +/*
> + * Autogenerated file, DO NOT EDIT manually!
> + *
> + * Copyright (c) 2015 Intel Corporation
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a
> + * copy of this software and associated documentation files (the "Software"),
> + * to deal in the Software without restriction, including without limitation
> + * the rights to use, copy, modify, merge, publish, distribute, sublicense,
> + * and/or sell copies of the Software, and to permit persons to whom the
> + * Software is furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice (including the next
> + * paragraph) shall be included in all copies or substantial portions of the
> + * Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
> + * THE AUTHORS 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.
> + *
> + */
> +
> +#include "i915_drv.h"
We need to be including i915_oa_hsw.h here, right?

With that fixed:
Reviewed-by: Matthew Auld <matthew.auld at intel.com>


More information about the Intel-gfx mailing list