drm/i915/perf: Add helper macros for comparing with whitelisted registers
Subsystems (2)
PATCH v2 1/2 drm/i915/perf: Add helper macros for comparing with whitelisted registers
Add helper macros for range and equality comparisons and use them to check with whitelisted registers in oa configurations.
--- drivers/gpu/drm/i915/i915_perf.c | 54 +++++++++++++++++--------------- 1 file changed, 28 insertions(+), 26 deletions(-)
drivers/gpu/drm/i915/i915_perf.c +28 -26
@@ -3515,56 +3515,58 @@ static bool gen8_is_valid_flex_addr(struct i915_perf *perf, u32 addr)return false; } +#define ADDR_IN_RANGE (addr, start, end) \ + ((addr) >= (start) && \ + (addr) <= (end)) + +#define REG_IN_RANGE (addr, start, end) \ + ((addr) >= i915_mmio_reg_offset(start) && \ + (addr) <= i915_mmio_reg_offset(end)) + +#define REG_EQUAL (addr, mmio) \ + ((addr) == i915_mmio_reg_offset(mmio)) +static bool gen7_is_valid_b_counter_addr (struct i915_perf *perf,u32 addr) { -return (addr >=i915_mmio_reg_offset (OASTARTTRIG1 ) && - addr <=i915_mmio_reg_offset (OASTARTTRIG8 )) || - (addr >=i915_mmio_reg_offset (OAREPORTTRIG1 ) && - addr <=i915_mmio_reg_offset (OAREPORTTRIG8 )) || - (addr >=i915_mmio_reg_offset (OACEC0_0 ) && - addr <=i915_mmio_reg_offset (OACEC7_1 )); +return REG_IN_RANGE (addr,OASTARTTRIG1 ,OASTARTTRIG8 ) || +REG_IN_RANGE (addr,OAREPORTTRIG1 ,OAREPORTTRIG8 ) || +REG_IN_RANGE (addr,OACEC0_0 ,OACEC7_1 ); }static bool gen7_is_valid_mux_addr (struct i915_perf *perf,u32 addr) { -return addr ==i915_mmio_reg_offset (HALF_SLICE_CHICKEN2 ) || - (addr >=i915_mmio_reg_offset (MICRO_BP0_0 ) && - addr <=i915_mmio_reg_offset (NOA_WRITE )) || - (addr >=i915_mmio_reg_offset (OA_PERFCNT1_LO ) && - addr <=i915_mmio_reg_offset (OA_PERFCNT2_HI )) || - (addr >=i915_mmio_reg_offset (OA_PERFMATRIX_LO ) && - addr <=i915_mmio_reg_offset (OA_PERFMATRIX_HI )); +return REG_EQUAL (addr,HALF_SLICE_CHICKEN2 ) || +REG_IN_RANGE (addr,MICRO_BP0_0 ,NOA_WRITE ) || +REG_IN_RANGE (addr,OA_PERFCNT1_LO ,OA_PERFCNT2_HI ) || +REG_IN_RANGE (addr,OA_PERFMATRIX_LO ,OA_PERFMATRIX_HI ); }static bool gen8_is_valid_mux_addr (struct i915_perf *perf,u32 addr) {return gen7_is_valid_mux_addr (perf, addr) || - addr ==i915_mmio_reg_offset (WAIT_FOR_RC6_EXIT ) || - (addr >=i915_mmio_reg_offset (RPM_CONFIG0 ) && - addr <=i915_mmio_reg_offset (NOA_CONFIG (8 ))); +REG_EQUAL (addr,WAIT_FOR_RC6_EXIT ) || +REG_IN_RANGE (addr,RPM_CONFIG0 ,NOA_CONFIG (8 )); }static bool gen10_is_valid_mux_addr (struct i915_perf *perf,u32 addr) {return gen8_is_valid_mux_addr (perf, addr) || - addr ==i915_mmio_reg_offset (GEN10_NOA_WRITE_HIGH ) || - (addr >=i915_mmio_reg_offset (OA_PERFCNT3_LO ) && - addr <=i915_mmio_reg_offset (OA_PERFCNT4_HI )); +REG_EQUAL (addr,GEN10_NOA_WRITE_HIGH ) || +REG_IN_RANGE (addr,OA_PERFCNT3_LO ,OA_PERFCNT4_HI ); }static bool hsw_is_valid_mux_addr (struct i915_perf *perf,u32 addr) {return gen7_is_valid_mux_addr (perf, addr) || - (addr >=0x25100 && addr <=0x2FF90 ) || - (addr >=i915_mmio_reg_offset (HSW_MBVID2_NOA0 ) && - addr <=i915_mmio_reg_offset (HSW_MBVID2_NOA9 )) || - addr ==i915_mmio_reg_offset (HSW_MBVID2_MISR0 ); +ADDR_IN_RANGE (addr,0x25100 ,0x2FF90 ) || +REG_IN_RANGE (addr,HSW_MBVID2_NOA0 ,HSW_MBVID2_NOA9 ) || +REG_EQUAL (addr,HSW_MBVID2_MISR0 ); }static bool chv_is_valid_mux_addr (struct i915_perf *perf,u32 addr) {return gen7_is_valid_mux_addr (perf, addr) || - (addr >=0x182300 && addr <=0x1823A4 ); +ADDR_IN_RANGE (addr,0x182300 ,0x1823A4 ); }static u32 mask_reg_value (u32 reg,u32 val)
@@ -3573,14 +3575,14 @@ static u32 mask_reg_value(u32 reg, u32 val)* WaDisableSTUnitPowerOptimization workaround. Make sure the value * programmed by userspace doesn't change this. */ -if (i915_mmio_reg_offset (HALF_SLICE_CHICKEN2 ) == reg) +if (REG_EQUAL (reg,HALF_SLICE_CHICKEN2 )) val = val & ~_MASKED_BIT_ENABLE (GEN8_ST_PO_DISABLE );/* WAIT_FOR_RC6_EXIT has only one bit fullfilling the function * indicated by its name and a bunch of selection fields used by OA * configs. */ -if (i915_mmio_reg_offset (WAIT_FOR_RC6_EXIT ) == reg) +if (REG_EQUAL (reg,WAIT_FOR_RC6_EXIT )) val = val & ~_MASKED_BIT_ENABLE (HSW_WAIT_FOR_RC6_EXIT_ENABLE );return val;
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
PATCH v2 2/2 drm/i915/tgl: Add perf support on TGL
From: Lionel Landwerlin <[email protected]>
The design of the OA unit has been split into several units. We now have a global unit (OAG) and a render specific unit (OAR). This leads to some changes on how we program things. Some details :
OAR:
- has its own set of counter registers, they are per-context saved/restored
- counters are not written to the circular OA buffer
- a snapshot of the counters can be acquired with MI_RECORD_PERF_COUNT, or a single counter can be read with MI_STORE_REGISTER_MEM.
OAG:
- has global counters that increment across context switches
- counters are written into the circular OA buffer (if requested)
v2: Fix checkpatch warnings on code style (Lucas)
v3: (Umesh)
- Update register from which tail, status and head are read
- Update logic to sample context reports
- Update whitelist mux and b counter regs
v4: Fix a bug when updating context image for new contexts (Umesh)
v5: Squash patch enabling save/restore of counters into context image
We want this so we can preempt performance queries and keep the system responsive even when long running queries are ongoing. We avoid doing it for all contexts.
- use LRI to modify context control (Chris)
- use MASKED_FIELD to program just the masked bits (Chris)
- disable save/restore of counters on cleanup (Chris)
v6: Do not use implicit parameters (Chris)
BSpec: 28727, 30021
--- drivers/gpu/drm/i915/Makefile | 3 +- drivers/gpu/drm/i915/gt/intel_lrc.h | 1 + drivers/gpu/drm/i915/i915_perf.c | 351 +++++++++++++++++++++++--- drivers/gpu/drm/i915/i915_reg.h | 103 ++++++++ drivers/gpu/drm/i915/oa/i915_oa_tgl.c | 121 +++++++++ drivers/gpu/drm/i915/oa/i915_oa_tgl.h | 16 ++ 6 files changed, 560 insertions(+), 35 deletions(-) create mode 100644 drivers/gpu/drm/i915/oa/i915_oa_tgl.c create mode 100644 drivers/gpu/drm/i915/oa/i915_oa_tgl.h
drivers/gpu/drm/i915/Makefile +2 -1
@@ -244,7 +244,8 @@ i915-y += \ oa/i915_oa_cflgt2.o \ oa/i915_oa_cflgt3.o \ oa/i915_oa_cnl.o \ - oa/i915_oa_icl.o + oa/i915_oa_icl.o \ + oa/i915_oa_tgl.o i915-y += i915_perf.o # Post-mortem debug and GPU hang state capture
drivers/gpu/drm/i915/gt/intel_lrc.h +1 -0
@@ -43,6 +43,7 @@ struct intel_engine_cs;#define CTX_CTRL_ENGINE_CTX_RESTORE_INHIBIT (1 << 0)#define CTX_CTRL_RS_CTX_ENABLE (1 << 1)#define CTX_CTRL_ENGINE_CTX_SAVE_INHIBIT (1 << 2) +#define GEN12_CTX_CTRL_OAR_CONTEXT_ENABLE (1 << 8)#define RING_CONTEXT_STATUS_PTR (base) _MMIO((base) + 0x3a0)#define RING_EXECLIST_SQ_CONTENTS (base) _MMIO((base) + 0x510)#define RING_EXECLIST_CONTROL (base) _MMIO((base) + 0x550)
drivers/gpu/drm/i915/i915_perf.c +317 -34
583 lines not on this page · raw message
drivers/gpu/drm/i915/i915_reg.h +103 -0
133 lines not on this page · raw message
drivers/gpu/drm/i915/oa/i915_oa_tgl.c new file +121 -0
121 lines not on this page · raw message
drivers/gpu/drm/i915/oa/i915_oa_tgl.h new file +16 -0
@@ -0,0 +1,16 @@ +/* SPDX-License-Identifier: MIT */ +/* +* Copyright © 2018 Intel Corporation +* +* Autogenerated file by GPU Top : https://github.com/rib/gputop +* DO NOT EDIT manually! +*/ + +#ifndef __I915_OA_TGL_H__ +#define __I915_OA_TGL_H__ + +struct drm_i915_private ; + +void i915_perf_load_test_config_tgl (struct drm_i915_private *dev_priv); + +#endif
Signature · 6 lines
2.20.1 _______________________________________________ Intel-gfx mailing list [email protected] https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.CHECKPATCH: warning for series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
In reply to Umesh Nerlige Ramappa== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
URL : https://patchwork.freedesktop.org/series/68582/
State : warning
== Summary ==
$ dim checkpatch origin/drm-tip d9a93528ebbd drm/i915/perf: Add helper macros for comparing with whitelisted registers -:21: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects? #21: FILE: drivers/gpu/drm/i915/i915_perf.c:3518: +#define ADDR_IN_RANGE(addr, start, end) \ + ((addr) >= (start) && \ + (addr) <= (end))
-:25: CHECK:MACRO_ARG_REUSE: Macro argument reuse 'addr' - possible side-effects? #25: FILE: drivers/gpu/drm/i915/i915_perf.c:3522:
+#define REG_IN_RANGE(addr, start, end) \
+ ((addr) >= i915_mmio_reg_offset(start) && \
+ (addr) <= i915_mmio_reg_offset(end))
total: 0 errors, 0 warnings, 2 checks, 98 lines checked c4fe94c04553 drm/i915/tgl: Add perf support on TGL -:132: ERROR:TRAILING_WHITESPACE: trailing whitespace #132: FILE: drivers/gpu/drm/i915/i915_perf.c:758:
+^I^I^I (IS_GEN(stream->perf->i915, 12) ? $
-:133: ERROR:TRAILING_WHITESPACE: trailing whitespace #133: FILE: drivers/gpu/drm/i915/i915_perf.c:759:
+^I^I^I OAREPORT_REASON_MASK_EXTENDED : $
-:457: CHECK:COMPARISON_TO_NULL: Comparison to NULL could be written "oa_config" #457: FILE: drivers/gpu/drm/i915/i915_perf.c:2473:
+ oa_config != NULL);
-:836: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating? #836:
new file mode 100644
total: 2 errors, 1 warnings, 1 checks, 869 lines checked
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.SPARSE: warning for series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
In reply to Umesh Nerlige Ramappa== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
URL : https://patchwork.freedesktop.org/series/68582/
State : warning
== Summary ==
$ dim sparse origin/drm-tip Sparse version: v0.6.0 Commit: drm/i915/perf: Add helper macros for comparing with whitelisted registers Okay!
Commit: drm/i915/tgl: Add perf support on TGL +drivers/gpu/drm/i915/i915_perf.c:2442:85: warning: dubious: x | !y
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx
Patchwork
CI✗ Fi.CI.BAT: failure for series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
In reply to Umesh Nerlige Ramappa== Series Details ==
== Series Details ==
Series: series starting with [v2,1/2] drm/i915/perf: Add helper macros for comparing with whitelisted registers
URL : https://patchwork.freedesktop.org/series/68582/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_7191 -> Patchwork_14991
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_14991 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_14991, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/index.html
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_14991:
### IGT changes ###
#### Possible regressions ####
* igt@i915_selftest@live_gem_contexts:
- fi-bsw-n3050: NOTRUN -> [INCOMPLETE][1]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/fi-bsw-n3050/igt@i915_selftest@live_gem_contexts.html
Known issues
------------
Here are the changes found in Patchwork_14991 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_pm_rpm@basic-pci-d3-state:
- fi-skl-6600u: [PASS][2] -> [FAIL][3] ([fdo#107707])
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7191/fi-skl-6600u/igt@[email protected]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/fi-skl-6600u/igt@[email protected]
#### Possible fixes ####
* igt@gem_close_race@basic-process:
- fi-icl-u3: [INCOMPLETE][4] ([fdo#107713]) -> [PASS][5]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7191/fi-icl-u3/igt@[email protected]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/fi-icl-u3/igt@[email protected]
* igt@gem_ctx_switch@rcs0:
- fi-icl-u2: [INCOMPLETE][6] ([fdo#107713]) -> [PASS][7]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7191/fi-icl-u2/igt@[email protected]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/fi-icl-u2/igt@[email protected]
* igt@i915_selftest@live_hangcheck:
- {fi-icl-guc}: [INCOMPLETE][8] ([fdo#107713] / [fdo#108569]) -> [PASS][9]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_7191/fi-icl-guc/igt@i915_selftest@live_hangcheck.html
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/fi-icl-guc/igt@i915_selftest@live_hangcheck.html
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#107707]: https://bugs.freedesktop.org/show_bug.cgi?id=107707
[fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
[fdo#108569]: https://bugs.freedesktop.org/show_bug.cgi?id=108569
[fdo#112096]: https://bugs.freedesktop.org/show_bug.cgi?id=112096
Participating hosts (50 -> 43)
------------------------------
Missing (7): fi-ilk-m540 fi-hsw-4200u fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus
Build changes
-------------
* CI: CI-20190529 -> None
* Linux: CI_DRM_7191 -> Patchwork_14991
CI-20190529: 20190529
CI_DRM_7191: 59c58784011dbec9a742d33b3d8d673393b95112 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_5242: 15c11e2df77f769b5fa9ca5b40a94f266370a479 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
Patchwork_14991: c4fe94c0455356a4ba6940234dedef8b00728a08 @ git://anongit.freedesktop.org/gfx-ci/linux
== Linux commits ==
c4fe94c04553 drm/i915/tgl: Add perf support on TGLd9a93528ebbd drm/i915/perf: Add helper macros for comparing with whitelisted registers
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14991/index.html
_______________________________________________
Intel-gfx mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/intel-gfx