diff options
author | Thomas Hellström <thomas.hellstrom@linux.intel.com> | 2021-06-10 09:01:49 +0200 |
---|---|---|
committer | Maarten Lankhorst <maarten.lankhorst@linux.intel.com> | 2021-06-11 10:53:06 +0200 |
commit | 213d5092776345ad5d6e2efa36a6bfbe9899e8b3 (patch) | |
tree | 3ebd2ee5becad5ebc47e52070e2072d8b6bd01ee /drivers/gpu/drm/i915/intel_region_ttm.h | |
parent | 1bd8a7dc28c1c410f1ceefae1f2a97c06d1a67c2 (diff) | |
download | lwn-213d5092776345ad5d6e2efa36a6bfbe9899e8b3.tar.gz lwn-213d5092776345ad5d6e2efa36a6bfbe9899e8b3.zip |
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
Diffstat (limited to 'drivers/gpu/drm/i915/intel_region_ttm.h')
-rw-r--r-- | drivers/gpu/drm/i915/intel_region_ttm.h | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/gpu/drm/i915/intel_region_ttm.h b/drivers/gpu/drm/i915/intel_region_ttm.h index 11b0574ab791..e8cf830fda6f 100644 --- a/drivers/gpu/drm/i915/intel_region_ttm.h +++ b/drivers/gpu/drm/i915/intel_region_ttm.h @@ -12,6 +12,7 @@ struct drm_i915_private; struct intel_memory_region; struct ttm_resource; +struct ttm_device_funcs; int intel_region_ttm_device_init(struct drm_i915_private *dev_priv); @@ -24,11 +25,15 @@ void intel_region_ttm_fini(struct intel_memory_region *mem); struct sg_table *intel_region_ttm_node_to_st(struct intel_memory_region *mem, struct ttm_resource *res); +void intel_region_ttm_node_free(struct intel_memory_region *mem, + struct ttm_resource *node); + +struct ttm_device_funcs *i915_ttm_driver(void); + +#ifdef CONFIG_DRM_I915_SELFTEST struct ttm_resource * intel_region_ttm_node_alloc(struct intel_memory_region *mem, resource_size_t size, unsigned int flags); - -void intel_region_ttm_node_free(struct intel_memory_region *mem, - struct ttm_resource *node); +#endif #endif /* _INTEL_REGION_TTM_H_ */ |