Matthew Auld
d22632c83b
drm/i915: support forcing the page size with lmem
...
For some specialised objects we might need something larger than the
regions min_page_size due to some hw restriction, and slightly more
hairy is needing something smaller with the guarantee that such objects
will never be inserted into any GTT, which is the case for the paging
structures.
This also fixes how we setup the BO page_alignment, if we later migrate
the object somewhere else. For example if the placements are {SMEM,
LMEM}, then we might get this wrong. Pushing the min_page_size behaviour
into the manager should fix this.
v2(Thomas): push the default page size behaviour into buddy_man, and let
the user override it with the page-alignment, which looks cleaner
v3: rebase on ttm sys changes
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Reviewed-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210625103824.558481-1-matthew.auld@intel.com
2021-06-30 13:24:29 +01:00
Thomas Hellström
213d509277
drm/i915/ttm: Introduce a TTM i915 gem object backend
...
Most logical place to introduce TTM buffer objects is as an i915
gem object backend. We need to add some ops to account for added
functionality like delayed delete and LRU list manipulation.
Initially we support only LMEM and SYSTEM memory, but SYSTEM
(which in this case means evicted LMEM objects) is not
visible to i915 GEM yet. The plan is to move the i915 gem system region
over to the TTM system memory type in upcoming patches.
We set up GPU bindings directly both from LMEM and from the system region,
as there is no need to use the legacy TTM_TT memory type. We reserve
that for future porting of GGTT bindings to TTM.
Remove the old lmem backend.
Signed-off-by: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Reviewed-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: Maarten Lankhorst <maarten.lankhorst@linux.intel.com >
Link: https://patchwork.freedesktop.org/patch/msgid/20210610070152.572423-2-thomas.hellstrom@linux.intel.com
2021-06-11 10:53:06 +02:00
Matthew Auld
0a46be95c2
drm/i915/gem: hide new uAPI behind CONFIG_BROKEN
...
Treat it the same as the fake local-memory stuff, where it is disabled
for normal kernels, in case some random UMD is tempted to use this. Once
we have all the other bits and pieces in place, like the TTM conversion,
we can turn this on for real.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com >
Cc: Jon Bloomfield <jon.bloomfield@intel.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Jason Ekstrand <jason@jlekstrand.net >
Cc: Dave Airlie <airlied@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210429103056.407067-9-matthew.auld@intel.com
2021-05-04 10:58:56 +01:00
Matthew Auld
0e997a36ec
drm/i915/gem: clear userspace buffers for LMEM
...
All userspace objects must be cleared when allocating the backing store,
before they are potentially visible to userspace. For now use simple
CPU based clearing to do this for device local-memory objects, note that
in the near future this will instead use the blitter engine.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com >
Cc: Jon Bloomfield <jon.bloomfield@intel.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Jason Ekstrand <jason@jlekstrand.net >
Cc: Dave Airlie <airlied@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210429103056.407067-8-matthew.auld@intel.com
2021-05-04 10:58:56 +01:00
Matthew Auld
2459e56fd8
drm/i915/uapi: implement object placement extension
...
Add new extension to support setting an immutable-priority-list of
potential placements, at creation time.
If we use the normal gem_create or gem_create_ext without the
extensions/placements then we still get the old behaviour with only
placing the object in system memory.
v2(Daniel & Jason):
- Add a bunch of kernel-doc
- Simplify design for placements extension
Testcase: igt/gem_create/create-ext-placement-sanity-check
Testcase: igt/gem_create/create-ext-placement-each
Testcase: igt/gem_create/create-ext-placement-all
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: CQ Tang <cq.tang@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Jason Ekstrand <jason@jlekstrand.net >
Cc: Dave Airlie <airlied@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210429103056.407067-6-matthew.auld@intel.com
2021-05-04 10:58:56 +01:00
Matthew Auld
ebcb402989
drm/i915/uapi: introduce drm_i915_gem_create_ext
...
Same old gem_create but with now with extensions support. This is needed
to support various upcoming usecases.
v2:(Chris)
- Use separate ioctl number for gem_create_ext, instead of hijacking
the existing gem_create ioctl, otherwise we run into the issue
with being unable to detect if the kernel supports the new extension
behaviour.
- We now have gem_create_ext.flags, which should be zeroed.
- I915_GEM_CREATE_EXT_SETPARAM value is now zero, since this is the
index into our array of extensions.
- Setup a "vanilla" object which we can directly apply our extensions
to.
v3:(Daniel & Jason)
- drop I915_GEM_CREATE_EXT_SETPARAM. Instead just have each extension
do one thing only, instead of generic setparam which can cover
various use cases.
- add some kernel-doc.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Signed-off-by: CQ Tang <cq.tang@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Jason Ekstrand <jason@jlekstrand.net >
Cc: Dave Airlie <airlied@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210429103056.407067-5-matthew.auld@intel.com
2021-05-04 10:58:56 +01:00
Matthew Auld
357814f878
drm/i915: rework gem_create flow for upcoming extensions
...
With the upcoming gem_create_ext we want to be able create a "vanilla"
object upfront and pass that directly to the extensions, before actually
initialising the object. Functionally this should be the same expect we
now feed the object into the lower-level region specific init_object.
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com >
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com >
Cc: Daniele Ceraolo Spurio <daniele.ceraolospurio@intel.com >
Cc: Lionel Landwerlin <lionel.g.landwerlin@linux.intel.com >
Cc: Jon Bloomfield <jon.bloomfield@intel.com >
Cc: Jordan Justen <jordan.l.justen@intel.com >
Cc: Daniel Vetter <daniel.vetter@intel.com >
Cc: Kenneth Graunke <kenneth@whitecape.org >
Cc: Jason Ekstrand <jason@jlekstrand.net >
Cc: Dave Airlie <airlied@gmail.com >
Cc: dri-devel@lists.freedesktop.org
Cc: mesa-dev@lists.freedesktop.org
Reviewed-by: Kenneth Graunke <kenneth@whitecape.org >
Link: https://patchwork.freedesktop.org/patch/msgid/20210429103056.407067-4-matthew.auld@intel.com
2021-05-04 10:58:55 +01:00
Matthew Auld
7d58fef2e7
drm/i915/gem: sanity check object size in gem_create
...
Depending on the regions min_page_size we might need to adjust the
object size, ensure this matches our expectations.
Suggested-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20210114182402.840247-2-matthew.auld@intel.com
2021-01-15 08:00:03 +00:00
Matthew Auld
dcaccaf0e8
drm/i915/gem: split gem_create into own file
...
In preparation for gem_create_ext break out the gem_create uAPI, so that
we don't clutter i915_gem.c once we start adding various extensions
Signed-off-by: Matthew Auld <matthew.auld@intel.com >
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk >
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk >
Link: https://patchwork.freedesktop.org/patch/msgid/20210114182402.840247-1-matthew.auld@intel.com
2021-01-15 08:00:03 +00:00