Lines Matching full:dsm
80 static bool valid_stolen_size(struct drm_i915_private *i915, struct resource *dsm) in valid_stolen_size() argument
82 return (dsm->start != 0 || HAS_LMEMBAR_SMEM_STOLEN(i915)) && dsm->end > dsm->start; in valid_stolen_size()
86 struct resource *dsm) in adjust_stolen() argument
91 if (!valid_stolen_size(i915, dsm)) in adjust_stolen()
102 struct resource stolen[2] = {*dsm, *dsm}; in adjust_stolen()
122 *dsm = stolen[0]; in adjust_stolen()
124 *dsm = stolen[1]; in adjust_stolen()
132 dsm); in adjust_stolen()
136 if (!valid_stolen_size(i915, dsm)) in adjust_stolen()
143 struct resource *dsm) in request_smem_stolen() argument
163 r = devm_request_mem_region(i915->drm.dev, dsm->start, in request_smem_stolen()
164 resource_size(dsm), in request_smem_stolen()
176 r = devm_request_mem_region(i915->drm.dev, dsm->start + 1, in request_smem_stolen()
177 resource_size(dsm) - 2, in request_smem_stolen()
186 dsm); in request_smem_stolen()
212 resource_size_t stolen_top = i915->dsm.stolen.end + 1; in g4x_get_stolen_reserved()
277 resource_size_t stolen_top = i915->dsm.stolen.end + 1; in vlv_get_stolen_reserved()
366 resource_size_t stolen_top = i915->dsm.stolen.end + 1; in bdw_get_stolen_reserved()
395 * the DSM) and, if so, reserve that part of the DSM to in icl_get_stolen_reserved()
396 * prevent accidental reuse. The DSM location should be just in icl_get_stolen_reserved()
402 if (gscpsmi_base >= i915->dsm.stolen.start && in icl_get_stolen_reserved()
403 gscpsmi_base < i915->dsm.stolen.end) { in icl_get_stolen_reserved()
405 *size = i915->dsm.stolen.end - gscpsmi_base; in icl_get_stolen_reserved()
436 * Initialize i915->dsm.reserved to contain the reserved space within the Data
437 * Stolen Memory. This is a range on the top of DSM that is reserved, not to
452 stolen_top = i915->dsm.stolen.end + 1; in init_reserved_stolen()
493 i915->dsm.reserved = DEFINE_RES_MEM(reserved_base, reserved_size); in init_reserved_stolen()
495 if (!resource_contains(&i915->dsm.stolen, &i915->dsm.reserved)) { in init_reserved_stolen()
498 &i915->dsm.reserved, &i915->dsm.stolen); in init_reserved_stolen()
506 i915->dsm.reserved = DEFINE_RES_MEM(reserved_base, 0); in init_reserved_stolen()
537 i915->dsm.stolen = mem->region; in i915_gem_init_stolen()
543 mem->region.end = i915->dsm.reserved.start - 1; in i915_gem_init_stolen()
548 i915->dsm.usable_size = resource_size(&mem->region); in i915_gem_init_stolen()
552 (u64)resource_size(&i915->dsm.stolen) >> 10, in i915_gem_init_stolen()
553 (u64)i915->dsm.usable_size >> 10); in i915_gem_init_stolen()
555 if (i915->dsm.usable_size == 0) in i915_gem_init_stolen()
559 drm_mm_init(&i915->mm.stolen, 0, i915->dsm.usable_size); in i915_gem_init_stolen()
567 i915->dsm.usable_size = 0; in i915_gem_init_stolen()
619 GEM_BUG_ON(range_overflows(offset, size, resource_size(&i915->dsm.stolen))); in i915_pages_create_for_stolen()
639 sg_dma_address(sg) = (dma_addr_t)i915->dsm.stolen.start + offset; in i915_pages_create_for_stolen()
920 * MTL dsm size is in GGC register. in i915_gem_stolen_lmem_setup()
937 /* Use DSM base address instead for stolen memory */ in i915_gem_stolen_lmem_setup()
949 drm_dbg(&i915->drm, "Using direct DSM access\n"); in i915_gem_stolen_lmem_setup()
1011 return i915->dsm.stolen.start; in i915_gem_stolen_area_address()
1016 return resource_size(&i915->dsm.stolen); in i915_gem_stolen_area_size()
1022 return i915->dsm.stolen.start + i915_gem_stolen_node_offset(node); in i915_gem_stolen_node_address()