Enable TTM for integrated GFX objects in sysmem
Subsystems (2)
cover Enable TTM for integrated GFX objects in sysmem
This patch series aims at enabling TTM support for system memory objects in integrated graphics platforms. Whether one wishes to use TTM for sysmem objects depends on a user-enabled kernel module parameter, so that the former behaviour of using shmem objects for the system memory region is kept by default.
The rationale for this change is the benefits in having TTM allocate BO memory pages for us with alloc_page() rather than shmem.
The first three patches in the series, which the latter three depend on, are being worked on in parallel by Bob, and handle TTM object cache level and coherence for sysmem-allocated objects too.
Adrian Larumbe (4):
drm/i915/ttm: don't overwrite cache_dirty after setting coherency drm/i915: Pick the right memory allocation flags for older devices drm/i915: Add module param for enabling TTM in sysmem region drm/i915: Optionally manage system memory with TTM and poolalloc
Robert Beckett (3):
drm/i915/ttm: dont trample cache_level overrides during ttm move drm/i915: limit ttm to dma32 for i965G[M] drm/i915/ttm: only trust snooping for dgfx when deciding default
cache_level
drivers/gpu/drm/i915/gem/i915_gem_domain.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 21 +- drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- .../gpu/drm/i915/gem/i915_gem_object_types.h | 1 + drivers/gpu/drm/i915/gem/i915_gem_phys.c | 127 +++++++----- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 193 +++++++++++++++++- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 14 ++ drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 13 +- drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 6 +- drivers/gpu/drm/i915/i915_params.c | 6 + drivers/gpu/drm/i915/i915_params.h | 3 +- drivers/gpu/drm/i915/intel_memory_region.c | 2 +- drivers/gpu/drm/i915/intel_region_ttm.c | 7 +- 16 files changed, 331 insertions(+), 75 deletions(-)
Signature · 1 line
2.37.0
PATCH 1/7 drm/i915/ttm: dont trample cache_level overrides during ttm move
From: Robert Beckett <[email protected]>
Various places within the driver override the default chosen cache_level. Before ttm, these overrides were permanent until explicitly changed again or for the lifetime of the buffer.
TTM movement code came along and decided that it could make that decision at that time, which is usually well after object creation, so overrode the cache_level decision and reverted it back to its default decision.
Add logic to indicate whether the caching mode has been set by anything other than the move logic. If so, assume that the code that overrode the defaults knows best and keep it.
--- drivers/gpu/drm/i915/gem/i915_gem_object.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_object_types.h | 1 + drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 1 + drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 9 ++++++--- 4 files changed, 9 insertions(+), 3 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_object.c +1 -0
@@ -125,6 +125,7 @@ void i915_gem_object_set_cache_coherency(struct drm_i915_gem_object *obj,struct drm_i915_private *i915 =to_i915 (obj->base.dev); obj->cache_level = cache_level; + obj->ttm.cache_level_override = true;if (cache_level !=I915_CACHE_NONE ) obj->cache_coherent = (I915_BO_CACHE_COHERENT_FOR_READ |
drivers/gpu/drm/i915/gem/i915_gem_object_types.h +1 -0
@@ -623,6 +623,7 @@ struct drm_i915_gem_object {struct i915_gem_object_page_iter get_io_page;struct drm_i915_gem_object *backup; bool created:1; + bool cache_level_override:1; } ttm;/*
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +1 -0
@@ -1253,6 +1253,7 @@ int __i915_gem_ttm_object_init(struct intel_memory_region *mem,i915_gem_object_init_memory_region (obj, mem);i915_ttm_adjust_domains_after_move (obj);i915_ttm_adjust_gem_after_move (obj); + obj->ttm.cache_level_override = false;i915_gem_object_unlock (obj);return 0 ;
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +6 -3
@@ -129,9 +129,12 @@ void i915_ttm_adjust_gem_after_move(struct drm_i915_gem_object *obj) obj->mem_flags |=i915_ttm_cpu_maps_iomem (bo->resource) ?I915_BO_FLAG_IOMEM :I915_BO_FLAG_STRUCT_PAGE ; - cache_level =i915_ttm_cache_level (to_i915 (bo->base.dev), bo->resource, - bo->ttm); -i915_gem_object_set_cache_coherency (obj, cache_level); +if (!obj->ttm.cache_level_override) { + cache_level =i915_ttm_cache_level (to_i915 (bo->base.dev), + bo->resource, bo->ttm); +i915_gem_object_set_cache_coherency (obj, cache_level); + obj->ttm.cache_level_override = false; + } }/**
Signature · 1 line
2.37.0
PATCH 2/7 drm/i915: limit ttm to dma32 for i965G[M]
In reply to Adrian LarumbeFrom: Robert Beckett <[email protected]>
i965G[M] cannot relocate objects above 4GiB.
Ensure ttm uses dma32 on these systems.
--- drivers/gpu/drm/i915/intel_region_ttm.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/intel_region_ttm.c +6 -1
@@ -32,10 +32,15 @@int intel_region_ttm_device_init (struct drm_i915_private *dev_priv) {struct drm_device *drm = &dev_priv->drm; +bool use_dma32 = false; + +/* i965g[m] cannot relocate objects above 4GiB. */ +if (IS_I965GM (dev_priv) ||IS_I965G (dev_priv)) + use_dma32 = true;return ttm_device_init (&dev_priv->bdev,i915_ttm_driver (), drm->dev, drm->anon_inode->i_mapping, - drm->vma_offset_manager, false, false); + drm->vma_offset_manager, false, use_dma32); }/**
Signature · 1 line
2.37.0
PATCH 3/7 drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level
In reply to Adrian LarumbeFrom: Robert Beckett <[email protected]>
By default i915_ttm_cache_level() decides I915_CACHE_LLC if HAS_SNOOP. This is divergent from existing backends code which only considers HAS_LLC.
Testing shows that trusting snooping on gen5- is unreliable and bsw via ggtt mappings, so limit DGFX for now and maintain previous behaviour.
--- drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/gem/i915_gem_ttm_move.c +3 -1
@@ -52,7 +52,9 @@ static enum i915_cache_level i915_ttm_cache_level(struct drm_i915_private *i915, struct ttm_resource *res, struct ttm_tt *ttm) { - return ((HAS_LLC(i915) || HAS_SNOOP(i915)) && + bool can_snoop = HAS_SNOOP(i915) && IS_DGFX(i915); + +return ((HAS_LLC (i915) || can_snoop) && !i915_ttm_gtt_binds_lmem (res) && ttm->caching == ttm_cached) ?I915_CACHE_LLC :I915_CACHE_NONE ;
Signature · 1 line
2.37.0
PATCH 4/7 drm/i915/ttm: don't overwrite cache_dirty after setting coherency
In reply to Adrian LarumbeWhen i915_gem_object_set_cache_level sets the GEM object's cache_dirty to true, in the case of TTM that will sometimes be overwritten when getting the object's pages, more specifically for shmem-placed objects for which its ttm structure has just been populated.
This wasn't an issue so far, even though intel_dpt_create was setting the object's cache level to 'none', regardless of the platform and memory placement of the framebuffer. However, commit b6f17c183a3e ("drm/i915/ttm:
dont trample cache_level overrides during ttm move") makes sure the cache level set by older backends soon to be managed by TTM isn't altered after their TTM bo ttm structure is populated.
However this led to the 'obj->cache_dirty = true' set in i915_gem_object_set_cache_level and flush_write_domain to stick around rather than being reset inside i915_ttm_adjust_gem_after_move after calling ttm_tt_populate in __i915_ttm_get_pages, which eventually led to a warning in DGFX platforms.
Make sure it's not set in DGFX platforms.
--- drivers/gpu/drm/i915/gem/i915_gem_domain.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_domain.c +2 -2
@@ -77,7 +77,7 @@ flush_write_domain(struct drm_i915_gem_object *obj, unsigned int flush_domains)case I915_GEM_DOMAIN_RENDER :if (gpu_write_needs_clflush (obj)) - obj->cache_dirty = true; + obj->cache_dirty = !IS_DGFX (to_i915 (obj->base.dev));break ; }
@@ -275,7 +275,7 @@ int i915_gem_object_set_cache_level(struct drm_i915_gem_object *obj,/* Always invalidate stale cachelines */ if (obj->cache_level != cache_level) {i915_gem_object_set_cache_coherency (obj, cache_level); - obj->cache_dirty = true; + obj->cache_dirty = !IS_DGFX (to_i915 (obj->base.dev)); }/* The cache-level will be applied when each vma is rebound. */
Signature · 1 line
2.37.0
PATCH 5/7 drm/i915: Pick the right memory allocation flags for older devices
In reply to Adrian Larumbei965gm devices cannot relocate objects above 4GiB. This situation was already being handled in the older shmem GEM object backend, but not in TTM for BO's that are allocated in system memory.
Borrow the code from shmem so that TTM handles them in the same way.
--- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 5 +++++ 1 file changed, 5 insertions(+)
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +5 -0
@@ -207,6 +207,11 @@ static int i915_ttm_tt_shmem_populate(struct ttm_device *bdev,return PTR_ERR (filp); mask =GFP_HIGHUSER | __GFP_RECLAIMABLE; +if (IS_I965GM (i915) ||IS_I965G (i915)) { +/* 965gm cannot relocate objects above 4GiB. */ + mask &= ~__GFP_HIGHMEM; + mask |= __GFP_DMA32; + } mapping = filp->f_mapping;mapping_set_gfp_mask (mapping, mask);
Signature · 1 line
2.37.0
PATCH 6/7 drm/i915: Add module param for enabling TTM in sysmem region
In reply to Adrian LarumbeIntroduces a new module parameter, 'use_pool_alloc', which defaults to 'false'. Its goal is to make the driver fall back on TTM for setting up the system memory region, so that object allocation will be done through the TTM subsystem rather than shmem objects.
This commit only brings in the new kernel module param, which will be used by successive commits.
--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)
drivers/gpu/drm/i915/i915_params.c +6 -0
@@ -207,6 +207,12 @@ i915_param_named_unsafe(lmem_size, uint, 0400,i915_param_named_unsafe (lmem_bar_size, uint,0400 ,"Set the lmem bar size(in MiB)." ); +i915_param_named_unsafe (use_pool_alloc, bool,0600 , +"Force the driver to use TTM's pool allocator API for smem objects. " +"This will cause TTM to take over BO allocation even in integrated platforms. " +"(default: false)" ); + + static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,
drivers/gpu/drm/i915/i915_params.h +2 -1
@@ -84,7 +84,8 @@ struct drm_printer; param(bool, verbose_state_checks, true, 0) \ param(bool, nuclear_pageflip, false, 0400) \ param(bool, enable_dp_mst, true, 0600) \ - param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) + param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) \ + param(bool, use_pool_alloc, false, 0600)#define MEMBER (T , member, ...) T member;struct i915_params {
Signature · 1 line
2.37.0
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH 6/7] drm/i915: Add module param for enabling TTM in sysmem region
Quoted 19 lines · Adrian Larumbe
Introduces a new module parameter, '
use_pool_alloc', which defaults to 'false'. Its goal is to make the driver fall back on TTM for setting up the system memory region, so that object allocation will be done through the TTM subsystem rather than shmem objects.This commit only brings in the new kernel module param, which will be used by successive commits.
Signed-off-by Adrian Larumbe <[email protected]>--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_params.c +0
-0
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 210
Quoted 4 lines
drivers/gpu/drm/i915/i915_params.c +1
-0@@ -207,6 +207,12 @@ i915_param_named_unsafe(lmem_size, uint, 0400,i915_param_named_unsafe (lmem_bar_size, uint,0400 ,"Set the lmem bar size(in MiB)." ); +i915_param_named_unsafe(use_pool_alloc, bool, 0600,
Do you expect to be able to change this runtime? Or the device specific debugfs parameter knob?
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 215
Quoted 5 lines
drivers/gpu/drm/i915/i915_params.c +5
-0+"Force the driver to use TTM's pool allocator API for smem objects. " +"This will cause TTM to take over BO allocation even in integrated platforms. " + "(default: false)"); + +
Superfluous newline.
Quoted 17 lines
drivers/gpu/drm/i915/i915_params.c +0
-0static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,drivers/gpu/drm/i915/i915_params.h +2
-1@@ -84,7 +84,8 @@ struct drm_printer; param(bool, verbose_state_checks, true, 0) \ param(bool, nuclear_pageflip, false, 0400) \ param(bool, enable_dp_mst, true, 0600) \ - param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) + param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) \ + param(bool, use_pool_alloc, false, 0600)#define MEMBER (T , member, ...) T member;struct i915_params {
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Re: [Intel-gfx] [PATCH 6/7] drm/i915: Add module param for enabling TTM in sysmem region
Quoted 23 lines · Jani Nikula
Quoted 22 lines · Adrian Larumbe
Introduces a new module parameter, '
use_pool_alloc', which defaults to 'false'. Its goal is to make the driver fall back on TTM for setting up the system memory region, so that object allocation will be done through the TTM subsystem rather than shmem objects.This commit only brings in the new kernel module param, which will be used by successive commits.
Signed-off-by Adrian Larumbe <[email protected]>--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_params.c +0
-0@@ -207,6 +207,12 @@ i915_param_named_unsafe(lmem_size, uint, 0400,i915_param_named_unsafe (lmem_bar_size, uint,0400 ,"Set the lmem bar size(in MiB)." );
Quoted 4 lines
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 210
Quoted 1 line
drivers/gpu/drm/i915/i915_params.c +1
-0+i915_param_named_unsafe(use_pool_alloc, bool, 0600,Do you expect to be able to change this runtime? Or the device specific debugfs parameter knob?
No, it's a driver load-time setting and doesn't change unless you unload the driver module and load it back without setting the parameter.
Does that mean I would have to use a different param declaration macro?
Quoted 23 lines
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 215
Quoted 5 lines
drivers/gpu/drm/i915/i915_params.c +5
-0+"Force the driver to use TTM's pool allocator API for smem objects. " +"This will cause TTM to take over BO allocation even in integrated platforms. " + "(default: false)"); + +Superfluous newline.
Quoted 15 lines
drivers/gpu/drm/i915/i915_params.c +0
-0static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,drivers/gpu/drm/i915/i915_params.h +2
-1@@ -84,7 +84,8 @@ struct drm_printer; param(bool, verbose_state_checks, true, 0) \ param(bool, nuclear_pageflip, false, 0400) \ param(bool, enable_dp_mst, true, 0600) \ -param (bool, enable_gvt, false,IS_ENABLED (CONFIG_DRM_I915_GVT ) ?0400 :0 ) + param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) \ +param (bool, use_pool_alloc, false,0600 )
Quoted 5 lines
Quoted 2 lines
drivers/gpu/drm/i915/i915_params.h +0
-0#define MEMBER (T , member, ...) T member;struct i915_params {Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
Adrian Larumbe
Jani Nikula
maintainerRe: [Intel-gfx] [PATCH 6/7] drm/i915: Add module param for enabling TTM in sysmem region
Quoted 29 lines · Adrian Larumbe
Quoted 23 lines · Jani Nikula
Quoted 22 lines · Adrian Larumbe
Introduces a new module parameter, '
use_pool_alloc', which defaults to 'false'. Its goal is to make the driver fall back on TTM for setting up the system memory region, so that object allocation will be done through the TTM subsystem rather than shmem objects.This commit only brings in the new kernel module param, which will be used by successive commits.
Signed-off-by Adrian Larumbe <[email protected]>--- drivers/gpu/drm/i915/i915_params.c | 6 ++++++ drivers/gpu/drm/i915/i915_params.h | 3 ++- 2 files changed, 8 insertions(+), 1 deletion(-)drivers/gpu/drm/i915/i915_params.c +0
-0@@ -207,6 +207,12 @@ i915_param_named_unsafe(lmem_size, uint, 0400,i915_param_named_unsafe (lmem_bar_size, uint,0400 ,"Set the lmem bar size(in MiB)." );Quoted 4 lines
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 210
Quoted 1 line
drivers/gpu/drm/i915/i915_params.c +1
-0+i915_param_named_unsafe(use_pool_alloc, bool, 0600,Do you expect to be able to change this runtime? Or the device specific debugfs parameter knob?
Quoted 4 lines
No, it's a driver load-time setting and doesn't change unless you unload the driver module and load it back without setting the parameter.
Does that mean I would have to use a different param declaration macro?
No, just different mode, 0400 instead of 0600.
Quoted 31 lines
Quoted 24 lines
drivers/gpu/drm/i915/i915_params.c i915_param_named_unsafe(lmem_size, uint, 0400, · line 215
Quoted 6 lines
drivers/gpu/drm/i915/i915_params.c +5
-0+"Force the driver to use TTM's pool allocator API for smem objects. " +"This will cause TTM to take over BO allocation even in integrated platforms. " + "(default: false)"); + +Superfluous newline.
Quoted 15 lines
drivers/gpu/drm/i915/i915_params.c +0
-0static __always_inline void _print_param(struct drm_printer *p, const char *name, const char *type,drivers/gpu/drm/i915/i915_params.h +2
-1@@ -84,7 +84,8 @@ struct drm_printer; param(bool, verbose_state_checks, true, 0) \ param(bool, nuclear_pageflip, false, 0400) \ param(bool, enable_dp_mst, true, 0600) \ -param (bool, enable_gvt, false,IS_ENABLED (CONFIG_DRM_I915_GVT ) ?0400 :0 ) + param(bool, enable_gvt, false, IS_ENABLED(CONFIG_DRM_I915_GVT) ? 0400 : 0) \ +param (bool, use_pool_alloc, false,0600 )Quoted 5 lines
Quoted 2 lines
drivers/gpu/drm/i915/i915_params.h +0
-0#define MEMBER (T , member, ...) T member;struct i915_params {Signature · 1 line
Jani Nikula, Intel Open Source Graphics CenterAdrian Larumbe
Signature · 1 line
Jani Nikula, Intel Open Source Graphics Center
PATCH 7/7 drm/i915: Optionally manage system memory with TTM and poolalloc
In reply to Adrian LarumbeAllow system memory to be managed by TTM on integrated graphics platforms. We replace using the shmem objects with similar use of TTM objects and can then benefit from using alloc_page() pages instead of shmem pages.
This commit has no effect on DGFX hardware.
Because it manages objects allocated on system memory, support for the legacy mmap ioctl was introduced. The change also affects how the original object is accessed when constructing a phys gem object, which means it must be mapped and accessed in its entirety rather than traversing the list of shmem pages.
A new set of integrated TTM GEM object operations are needed, which do not hold pointers to memory mapping functions, because mmap'ing of TTM-managed BO's in system memory should still be handled by the GEM subsystem. This new set of operations also handles pwrite and pread, which are forbidden on platforms having LMEM.
--- drivers/gpu/drm/i915/gem/i915_gem_mman.c | 21 ++- drivers/gpu/drm/i915/gem/i915_gem_object.h | 2 +- drivers/gpu/drm/i915/gem/i915_gem_phys.c | 127 ++++++++----- drivers/gpu/drm/i915/gem/i915_gem_shmem.c | 4 +- drivers/gpu/drm/i915/gem/i915_gem_ttm.c | 187 ++++++++++++++++++-- drivers/gpu/drm/i915/gem/i915_gem_ttm.h | 14 ++ drivers/gpu/drm/i915/gem/i915_gem_userptr.c | 2 +- drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c | 6 +- drivers/gpu/drm/i915/intel_memory_region.c | 2 +- 9 files changed, 298 insertions(+), 67 deletions(-)
drivers/gpu/drm/i915/gem/i915_gem_mman.c +16 -5
@@ -83,6 +83,22 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data,if (!obj)return -ENOENT ; +if (range_overflows (args->offset, args->size, (u64 )obj->base.size)) { + addr = -EINVAL ; + goto err; + } + +if (i915_gem_object_is_ttm (obj)) { +GEM_WARN_ON (!i915->params.use_pool_alloc); + + addr =i915_gem_ttm_mmap_ioctl (obj, args); +if (IS_ERR_VALUE (addr)) + goto err; + + args->addr_ptr = (u64 )addr; +return 0 ; + } +/* prime objects have no backing filp to GEM mmap * pages from. */
@@ -91,11 +107,6 @@ i915_gem_mmap_ioctl(struct drm_device *dev, void *data, goto err; } -if (range_overflows (args->offset, args->size, (u64 )obj->base.size)) { - addr = -EINVAL ; - goto err; - } - addr =vm_mmap (obj->base.filp,0 , args->size,PROT_READ |PROT_WRITE ,MAP_SHARED , args->offset);
drivers/gpu/drm/i915/gem/i915_gem_object.h +1 -1
@@ -74,7 +74,7 @@ __i915_gem_object_create_user(struct drm_i915_private *i915, u64 size,extern const struct drm_i915_gem_object_ops i915_gem_shmem_ops; -void __i915_gem_object_release_shmem (struct drm_i915_gem_object *obj, +void __i915_gem_object_release_smem (struct drm_i915_gem_object *obj,struct sg_table *pages,bool needs_clflush);
drivers/gpu/drm/i915/gem/i915_gem_phys.c +81 -46
182 lines not on this page · raw message
drivers/gpu/drm/i915/gem/i915_gem_shmem.c +2 -2
@@ -351,7 +351,7 @@ static int shmem_shrink(struct drm_i915_gem_object *obj, unsigned int flags) }void -__i915_gem_object_release_shmem (struct drm_i915_gem_object *obj, +__i915_gem_object_release_smem (struct drm_i915_gem_object *obj,struct sg_table *pages,bool needs_clflush) {
@@ -382,7 +382,7 @@ __i915_gem_object_release_shmem(struct drm_i915_gem_object *obj,void i915_gem_object_put_pages_shmem (struct drm_i915_gem_object *obj,struct sg_table *pages) { -__i915_gem_object_release_shmem (obj, pages, true); +__i915_gem_object_release_smem (obj, pages, true);i915_gem_gtt_finish_pages (obj, pages);
drivers/gpu/drm/i915/gem/i915_gem_ttm.c +177 -10
276 lines not on this page · raw message
drivers/gpu/drm/i915/gem/i915_gem_ttm.h +14 -0
@@ -95,4 +95,18 @@ static inline bool i915_ttm_cpu_maps_iomem(struct ttm_resource *mem)bool i915_ttm_resource_mappable (struct ttm_resource *res); +bool i915_gem_object_is_ttm (const struct drm_i915_gem_object *obj); + +struct drm_i915_gem_object * +i915_gem_object_create_ttm_from_data (struct drm_i915_private *dev_priv, +const void *data,resource_size_t size); + +unsigned long i915_gem_ttm_mmap_ioctl (struct drm_i915_gem_object *obj, +struct drm_i915_gem_mmap *args); + +bool i915_gem_object_is_smem (struct drm_i915_gem_object *obj); + +void i915_gem_object_put_pages_ttm (struct drm_i915_gem_object *obj, +struct sg_table *st); +#endif
drivers/gpu/drm/i915/gem/i915_gem_userptr.c +1 -1
@@ -192,7 +192,7 @@ i915_gem_userptr_put_pages(struct drm_i915_gem_object *obj,if (!pages)return ; -__i915_gem_object_release_shmem (obj, pages, true); +__i915_gem_object_release_smem (obj, pages, true);i915_gem_gtt_finish_pages (obj, pages);/*
drivers/gpu/drm/i915/gt/uc/intel_uc_fw.c +5 -1
@@ -11,6 +11,7 @@#include <drm/drm_print.h> #include "gem/i915_gem_lmem.h" +#include "gem/i915_gem_ttm.h" #include "intel_uc_fw.h" #include "intel_uc_fw_abi.h" #include "i915_drv.h"
@@ -482,7 +483,10 @@ int intel_uc_fw_fetch(struct intel_uc_fw *uc_fw)if (!IS_ERR (obj)) obj->flags |=I915_BO_ALLOC_PM_EARLY ; }else { - obj =i915_gem_object_create_shmem_from_data (i915, fw->data, fw->size); +if (unlikely (i915->params.use_pool_alloc)) + obj =i915_gem_object_create_ttm_from_data (i915, fw->data, fw->size); +else + obj =i915_gem_object_create_shmem_from_data (i915, fw->data, fw->size); }if (IS_ERR (obj)) {
drivers/gpu/drm/i915/intel_memory_region.c +1 -1
@@ -321,7 +321,7 @@ int intel_memory_regions_hw_probe(struct drm_i915_private *i915) instance = intel_region_map[i].instance;switch (type) {case INTEL_MEMORY_SYSTEM : -if (IS_DGFX (i915)) +if (IS_DGFX (i915) || i915->params.use_pool_alloc) mem =i915_gem_ttm_system_setup (i915, type, instance);else
Signature · 1 line
2.37.0
Patchwork
CI[Intel-gfx] ✗ Fi.CI.CHECKPATCH: warning for Enable TTM for integrated GFX objects in sysmem
In reply to Adrian Larumbe== Series Details ==
== Series Details ==
Series: Enable TTM for integrated GFX objects in sysmem
URL : https://patchwork.freedesktop.org/series/106913/
State : warning
== Summary ==
Error: dim checkpatch failed30b2640e4185 drm/i915/ttm: dont trample cache_level overrides during ttm move b283b8a7d71e drm/i915: limit ttm to dma32 for i965G[M]ae22ccdeda30 drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level 8399f78186f7 drm/i915/ttm: don't overwrite cache_dirty after setting coherency -:14: WARNING:UNKNOWN_COMMIT_ID: Unknown commit id 'b6f17c183a3e', maybe rebased or not pulled? #14:
placement of the framebuffer. However, commit b6f17c183a3e ("drm/i915/ttm:
total: 0 errors, 1 warnings, 0 checks, 16 lines checked b08c8f9acefb drm/i915: Pick the right memory allocation flags for older devices 68bee3ccdca5 drm/i915: Add module param for enabling TTM in sysmem region -:25: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #25: FILE: drivers/gpu/drm/i915/i915_params.c:211:
+i915_param_named_unsafe(use_pool_alloc, bool, 0600,
+ "Force the driver to use TTM's pool allocator API for smem objects. "
-:29: CHECK:LINE_SPACING: Please don't use multiple blank lines #29: FILE: drivers/gpu/drm/i915/i915_params.c:215:
+
+
total: 0 errors, 0 warnings, 2 checks, 21 lines checked 085d8ed8fa28 drm/i915: Optionally manage system memory with TTM and poolalloc -:76: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #76: FILE: drivers/gpu/drm/i915/gem/i915_gem_object.h:78:
+void __i915_gem_object_release_smem(struct drm_i915_gem_object *obj,
struct sg_table *pages,
-:282: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #282: FILE: drivers/gpu/drm/i915/gem/i915_gem_shmem.c:355:
+__i915_gem_object_release_smem(struct drm_i915_gem_object *obj,
struct sg_table *pages,
-:423: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #423: FILE: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1177:
+ttm_pwrite(struct drm_i915_gem_object *obj,
+ const struct drm_i915_gem_pwrite *arg)
-:425: CHECK:BRACES: Blank lines aren't necessary after an open brace '{' #425: FILE: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1179:
+{
+
-:434: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #434: FILE: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1188:
+ttm_pread(struct drm_i915_gem_object *obj,
+ const struct drm_i915_gem_pread *arg)
-:519: CHECK:PARENTHESIS_ALIGNMENT: Alignment should match open parenthesis #519: FILE: drivers/gpu/drm/i915/gem/i915_gem_ttm.c:1387:
+i915_gem_object_create_ttm_from_data(struct drm_i915_private *dev_priv,
+ const void *data, resource_size_t size)
total: 0 errors, 0 warnings, 6 checks, 567 lines checked
Patchwork
CI[Intel-gfx] ✗ Fi.CI.SPARSE: warning for Enable TTM for integrated GFX objects in sysmem
In reply to Adrian Larumbe== Series Details ==
== Series Details ==
Series: Enable TTM for integrated GFX objects in sysmem
URL : https://patchwork.freedesktop.org/series/106913/
State : warning
== Summary ==
Error: dim sparse failed
Sparse version: v0.6.2
Fast mode used, each commit won't be checked separately.
Patchwork
CI[Intel-gfx] ✗ Fi.CI.BAT: failure for Enable TTM for integrated GFX objects in sysmem
In reply to Adrian Larumbe== Series Details ==
== Series Details ==
Series: Enable TTM for integrated GFX objects in sysmem
URL : https://patchwork.freedesktop.org/series/106913/
State : failure
== Summary ==
CI Bug Log - changes from CI_DRM_11963 -> Patchwork_106913v1
====================================================
Summary
-------
**FAILURE**
Serious unknown changes coming with Patchwork_106913v1 absolutely need to be verified manually.
If you think the reported changes have nothing to do with the changes introduced in Patchwork_106913v1, please notify your bug team to allow them to document this new failure mode, which will reduce false positives in CI.
External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/index.html
Participating hosts (47 -> 44)
------------------------------
Missing (3): fi-ctg-p8600 fi-icl-u2 fi-hsw-4200u
Possible new issues
-------------------
Here are the unknown changes that may have been introduced in Patchwork_106913v1:
### IGT changes ###
#### Possible regressions ####
* igt@i915_module_load@load:
- bat-dg1-5: [PASS][1] -> [INCOMPLETE][2]
[1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg1-5/igt@[email protected]
[2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg1-5/igt@[email protected]
- bat-dg1-6: [PASS][3] -> [INCOMPLETE][4]
[3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg1-6/igt@[email protected]
[4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg1-6/igt@[email protected]
#### Suppressed ####
The following results come from untrusted machines, tests, or statuses. They do not affect the overall result.
* igt@i915_module_load@load:
- {bat-dg2-9}: [PASS][5] -> [INCOMPLETE][6]
[5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg2-9/igt@[email protected]
[6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg2-9/igt@[email protected]
- {bat-dg2-8}: [PASS][7] -> [INCOMPLETE][8]
[7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg2-8/igt@[email protected]
[8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg2-8/igt@[email protected]
Known issues
------------
Here are the changes found in Patchwork_106913v1 that come from known issues:
### IGT changes ###
#### Issues hit ####
* igt@i915_suspend@basic-s3-without-i915:
- fi-rkl-11600: [PASS][9] -> [INCOMPLETE][10] ([i915#5982])
[9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/fi-rkl-11600/igt@[email protected]
[10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/fi-rkl-11600/igt@[email protected]
* igt@kms_chamelium@common-hpd-after-suspend:
- fi-bdw-5557u: NOTRUN -> [SKIP][11] ([fdo#109271] / [fdo#111827])
[11]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/fi-bdw-5557u/igt@[email protected]
#### Possible fixes ####
* igt@gem_exec_suspend@basic-s3@smem:
- {bat-adlm-1}: [DMESG-WARN][12] ([i915#2867]) -> [PASS][13]
[12]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-adlm-1/igt@gem_exec_suspend@[email protected]
[13]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-adlm-1/igt@gem_exec_suspend@[email protected]
* igt@i915_selftest@live@hugepages:
- fi-rkl-guc: [DMESG-WARN][14] -> [PASS][15]
[14]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/fi-rkl-guc/igt@i915_selftest@[email protected]
[15]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/fi-rkl-guc/igt@i915_selftest@[email protected]
* igt@i915_suspend@basic-s3-without-i915:
- fi-bdw-5557u: [INCOMPLETE][16] ([i915#146]) -> [PASS][17]
[16]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/fi-bdw-5557u/igt@[email protected]
[17]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/fi-bdw-5557u/igt@[email protected]
#### Warnings ####
* igt@runner@aborted:
- bat-dg1-5: [FAIL][18] ([i915#4312] / [i915#5257]) -> [FAIL][19] ([i915#4312])
[18]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg1-5/igt@[email protected]
[19]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg1-5/igt@[email protected]
- bat-dg1-6: [FAIL][20] ([i915#4312] / [i915#5257]) -> [FAIL][21] ([i915#4312])
[20]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_11963/bat-dg1-6/igt@[email protected]
[21]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/bat-dg1-6/igt@[email protected]
{name}: This element is suppressed. This means it is ignored when computing
the status of the difference (SUCCESS, WARNING, or FAILURE).
[fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
[fdo#111827]: https://bugs.freedesktop.org/show_bug.cgi?id=111827
[i915#146]: https://gitlab.freedesktop.org/drm/intel/issues/146
[i915#1888]: https://gitlab.freedesktop.org/drm/intel/issues/1888
[i915#2867]: https://gitlab.freedesktop.org/drm/intel/issues/2867
[i915#4312]: https://gitlab.freedesktop.org/drm/intel/issues/4312
[i915#5153]: https://gitlab.freedesktop.org/drm/intel/issues/5153
[i915#5257]: https://gitlab.freedesktop.org/drm/intel/issues/5257
[i915#5982]: https://gitlab.freedesktop.org/drm/intel/issues/5982
[i915#6106]: https://gitlab.freedesktop.org/drm/intel/issues/6106
Build changes
-------------
* Linux: CI_DRM_11963 -> Patchwork_106913v1
CI-20190529: 20190529
CI_DRM_11963: d0b86a71849272bc47e5434cd0b0c428c1c6b2f5 @ git://anongit.freedesktop.org/gfx-ci/linux
IGT_6609: 541d11665dc829f60c84061422adce6b44fa2aef @ https://gitlab.freedesktop.org/drm/igt-gpu-tools.git
Patchwork_106913v1: d0b86a71849272bc47e5434cd0b0c428c1c6b2f5 @ git://anongit.freedesktop.org/gfx-ci/linux
### Linux commits
e6aa9016e60f drm/i915: Optionally manage system memory with TTM and poolalloc 61f3ff9efb91 drm/i915: Add module param for enabling TTM in sysmem region be0cbdc5eb0f drm/i915: Pick the right memory allocation flags for older devices a69894e8dad5 drm/i915/ttm: don't overwrite cache_dirty after setting coherency 65b6fd9f01fa drm/i915/ttm: only trust snooping for dgfx when deciding default cache_level 6217f3edfa96 drm/i915: limit ttm to dma32 for i965G[M]f9dc545abb0d drm/i915/ttm: dont trample cache_level overrides during ttm move
== Logs ==
For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_106913v1/index.html