[PATCH 0/2] Host1x memory context stealing

From: Mikko Perttunen

Date: Fri Jul 10 2026 - 03:18:57 EST


Host1x and devices on its bus support isolating address spaces for each
user via memory context devices. However, their number is limited by
hardware (SMMU context bank / stream ID assignment). Currently, each
process with at least one open Host1x channel is assigned one of these
devices of which there are typically eight. Any subsequent process
attempting to open a channel will simply fail.

In practice, often some of the processes with open channels, however,
are not actually using them all the time. Hence, we can improve
usability by moving the context devices between processes when
necessary. This series implements support for that by 'stealing' context
devices from idle processes. Additionally if all devices are in use,
the process will wait interruptibly until a free one appears.

On some systems more deterministic behavior is desired. For that
situation, a module parameter is introduced that can be used to revert
to the earlier static behavior.

The series is based on top of the Host1x T264 support series.

---
Mikko Perttunen (2):
gpu: host1x: Memory context stealing
gpu: host1x: Add option for disabling context stealing

drivers/gpu/drm/tegra/submit.c | 36 +++-
drivers/gpu/drm/tegra/uapi.c | 49 +++--
drivers/gpu/drm/tegra/uapi.h | 3 +-
drivers/gpu/host1x/context.c | 383 +++++++++++++++++++++++++++++++++++--
drivers/gpu/host1x/context.h | 18 +-
drivers/gpu/host1x/hw/channel_hw.c | 3 +-
include/linux/host1x.h | 49 ++++-
7 files changed, 488 insertions(+), 53 deletions(-)
---
base-commit: b3f94b2b3f3e51ab880a51fc6510e1dafba654ed
change-id: 20260624-b4-host1x-ctxsteal-31ffc856aefc
prerequisite-change-id: 20260313-t264-host1x-c97171fdde77:v2
prerequisite-patch-id: 430f8b34014f6b256630d0a2ca83245ccb20f31a
prerequisite-patch-id: 63ebc5b572f9637452244edbba6e1fad559e9764
prerequisite-patch-id: 1017c5f3670cedfa1ce2e5d2ae309739a836d514
prerequisite-patch-id: 4503288cda4b78b5e5397f236a01835275799b3e
prerequisite-patch-id: e678806351cc92f32c70923aab259111365324e9
prerequisite-patch-id: 6e8e3d23872715a36074524121ffbf66c451c1b0
prerequisite-patch-id: dc2aac97cd569d9fff8f05294d2e4ce13d5a741a