GLOBAL GTT VIEWS(9)
πΈ Global GTT views πΈ
bestie, welcome to the kernel API manual π this one's about global GTT views, and honestly it's a whole glow-up story, so let's get into it β¨
π Background and previous state π
okay so historically, objects could exist (like, be bound) in global GTT space only as singular instances β with a view that represents all of the object's backing pages in a linear fashion. we call that view a normal view. periodt.
to support multiple views of the same object β where the number of mapped pages isn't equal to the backing store, or where the layout of the pages is not linear β the concept of a GGTT view was added. iconic behaviour tbh π
one example of an alternative view is a stereo display driven by a single image. in this case we'd have a framebuffer looking like this (2x2 pages):
12 34
above would represent a normal GGTT view, as normally mapped for GPU or CPU rendering. in contrast, fed to the display engine would be an alternative view, which could look something like this:
1212 3434
in this example both the size and layout of pages in the alternative view is different from the normal view. not me being obsessed with this π
π Implementation and usage π
GGTT views are implemented using VMAs and are distinguished via enum i915_gtt_view_type and struct i915_gtt_view. slay.
a new flavour of core GEM functions which work with GGTT bound objects were added with the _ggtt_ infix, and sometimes with _view postfix β literally just to avoid renaming in large amounts of code. they take the struct i915_gtt_view parameter, encapsulating all metadata required to implement a view. π«Ά
as a helper for callers which are only interested in the normal view, a globally const i915_gtt_view_normal singleton instance exists. all old core GEM API functions β the ones not taking the view parameter β are operating on, or with, the normal GGTT view.
code wanting to add or use a new GGTT view needs to:
- add a new enum with a suitable name.
- extend the metadata in the
i915_gtt_viewstructure if required. - add support to
i915_get_vma_pages.
new views are required to build a scatter-gather table from within the i915_get_vma_pages function. this table is stored in the vma.gtt_view and exists for the lifetime of an VMA. π (yes, life-long commitment, no ghosting)
core API is designed to have copy semantics, which means that the passed-in struct i915_gtt_view does not need to be persistent (left around after calling the core API functions). so you can just let it go, bestie, no need to keep it on read π
π SEE ALSO π
- Kernel file
./drivers/gpu/drm/i915/i915_vma_types.hVirtual Memory Address(9)
π¦ cute little sign-off: this page lives at ./drivers/gpu/drm/i915, dated October 2026, and it's page Global GTT views(9) of the Kernel API Manual. mwah π π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms