[Intel-gfx] [PATCH i-g-t v5 0/4] Calculate softpin offsets from minimum GTT alignment
Janusz Krzysztofik
janusz.krzysztofik at linux.intel.com
Mon Nov 4 17:13:26 UTC 2019
Some tests assume 4kB page size while using softpin. That assumption
may be wrong on future GEM backends with possibly larger minimum page
sizes. As a result, those tests may either fail on softpin at offsets
which are incorrectly aligned, may silently skip such incorrectly
aligned addresses assuming them occupied by other users, or may always
succeed when examining invalid use patterns.
Provide a helper function that detects minimum page size and returns
the size order. Use it in test which perform softpin to calculate
offsets suitable for actually used backing store.
Changelog:
v2: Don't skip failing offsets only when on full PPGTT,
- simplify the code by reversing the size->order conversion,
- drop irrelevant modifications of requested object sizes.
v3: Drop patch 1/2 "Don't filter out addresses when on PPGTT" - I don't
know how to detect if the kernel is interfering with the user's GTT,
- introduce patch 1/4 "lib: Move redundant local helpers to lib/",
subsequent patch will use the helper,
- introduce patch 2/4 "lib: Add GEM minimum page size helper",
subsequent patches will use the new helper (inspired by Chris),
- in former patch 2/2, now 3/4, initialize page size order with an
actual minimum returned by the new helper (inspired by Chris),
- add a new fix for gem_ctx_shared test (patch 4/4).
v4: Rename the helper, use 'minimum GTT alignment' term across the
changes (Chris),
- update variable names accordingly,
- use error numbers to distinguish between invalid offsets and
addresses occupied by other users, then
- simplify the helper code (Chris),
- drop no longer required patch 1/4 "lib: Move redundant local
helpers to lib/",
- reintroduce former patch 1/2 as 1/4 "tests/gem_exec_reloc: Don't
filter out invalid addresses" with the former not on full PPGTT
requirement for skipping now replaced with error code checking.
v5: Put the helper code under lib/i915/, not in lib/ioctl_wrappers.c
(Chris),
- validate objects with an invalid reloc applied so execbuf requests
called only for validation purposes are actually not emitted to GPU
(Chris),
- move object validation code to a separate helper,
- promote the former patch 2/4 as 1/4 so the new helper is available
for use by the former patch 1/4, now 2/4,
- silently skip only those offsets which have been explicitly
reported as overlapping with shared GTT reserved space, not simply
all which raise failures other than -EINVAL (Chris),
- as an implementation of moving the probe out of line so it's not
easily confused with the central point of the test (Chris), use
object validation library helper just introduced,
- name the variable 'stride', not 'alignment', it better reflects
its purpose (Chris).
Janusz Krzysztofik (4):
lib/i915: Add minimum GTT alignment helper
tests/gem_exec_reloc: Don't filter out invalid addresses
tests/gem_exec_reloc: Calculate offsets from minimum GTT alignment
tests/gem_ctx_shared: Align objects using minimum GTT alignment
lib/Makefile.sources | 2 +
lib/i915/gem_gtt_topology.c | 118 ++++++++++++++++++++++++++++++++++++
lib/i915/gem_gtt_topology.h | 36 +++++++++++
lib/meson.build | 1 +
tests/i915/gem_ctx_shared.c | 7 ++-
tests/i915/gem_exec_reloc.c | 31 ++++++----
6 files changed, 180 insertions(+), 15 deletions(-)
create mode 100644 lib/i915/gem_gtt_topology.c
create mode 100644 lib/i915/gem_gtt_topology.h
--
2.21.0
More information about the Intel-gfx
mailing list