mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-08-27 19:29:37 +00:00
drm/i915/stolen: actually mark as contiguous
Stolen memory is always allocated as physically contiguous pages, so mark the object flags as such. It looks like the flags were previously just ignored so this had no effect. In the future we might to add the proper plumbing for passing the flags all over the way down from the caller, but for now we don't have a use for that. Signed-off-by: Matthew Auld <matthew.auld@intel.com> Cc: Tvrtko Ursulin <tvrtko.ursulin@linux.intel.com> Reviewed-by: Tvrtko Ursulin <tvrtko.ursulin@intel.com> Link: https://patchwork.freedesktop.org/patch/msgid/20210421104658.304142-4-matthew.auld@intel.com
This commit is contained in:
parent
f9a7b01e95
commit
ae7f0dc105
1 changed files with 9 additions and 3 deletions
|
@ -637,10 +637,17 @@ static int __i915_gem_object_create_stolen(struct intel_memory_region *mem,
|
||||||
{
|
{
|
||||||
static struct lock_class_key lock_class;
|
static struct lock_class_key lock_class;
|
||||||
unsigned int cache_level;
|
unsigned int cache_level;
|
||||||
|
unsigned int flags;
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Stolen objects are always physically contiguous since we just
|
||||||
|
* allocate one big block underneath using the drm_mm range allocator.
|
||||||
|
*/
|
||||||
|
flags = I915_BO_ALLOC_CONTIGUOUS;
|
||||||
|
|
||||||
drm_gem_private_object_init(&mem->i915->drm, &obj->base, stolen->size);
|
drm_gem_private_object_init(&mem->i915->drm, &obj->base, stolen->size);
|
||||||
i915_gem_object_init(obj, &i915_gem_object_stolen_ops, &lock_class, 0);
|
i915_gem_object_init(obj, &i915_gem_object_stolen_ops, &lock_class, flags);
|
||||||
|
|
||||||
obj->stolen = stolen;
|
obj->stolen = stolen;
|
||||||
obj->read_domains = I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT;
|
obj->read_domains = I915_GEM_DOMAIN_CPU | I915_GEM_DOMAIN_GTT;
|
||||||
|
@ -699,8 +706,7 @@ struct drm_i915_gem_object *
|
||||||
i915_gem_object_create_stolen(struct drm_i915_private *i915,
|
i915_gem_object_create_stolen(struct drm_i915_private *i915,
|
||||||
resource_size_t size)
|
resource_size_t size)
|
||||||
{
|
{
|
||||||
return i915_gem_object_create_region(i915->mm.stolen_region,
|
return i915_gem_object_create_region(i915->mm.stolen_region, size, 0);
|
||||||
size, I915_BO_ALLOC_CONTIGUOUS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static int init_stolen_smem(struct intel_memory_region *mem)
|
static int init_stolen_smem(struct intel_memory_region *mem)
|
||||||
|
|
Loading…
Reference in a new issue