Lines Matching +full:0 +full:xe
27 _resize_bar(struct xe_device *xe, int resno, resource_size_t size) in _resize_bar() argument
29 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); in _resize_bar()
38 …drm_info(&xe->drm, "Failed to resize BAR%d to %dM (%pe). Consider enabling 'Resizable BAR' support… in _resize_bar()
43 drm_info(&xe->drm, "BAR%d resized to %dM\n", resno, 1 << bar_size); in _resize_bar()
50 static void resize_vram_bar(struct xe_device *xe) in resize_vram_bar() argument
53 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); in resize_vram_bar()
78 drm_info(&xe->drm, in resize_vram_bar()
79 "Requested size: %lluMiB is not supported by rebar sizes: 0x%x. Leaving default: %lluMiB\n", in resize_vram_bar()
96 drm_info(&xe->drm, "Attempting to resize bar from %lluMiB -> %lluMiB\n", in resize_vram_bar()
104 (u64)root_res->start > 0x100000000ul) in resize_vram_bar()
109 …drm_info(&xe->drm, "Can't resize VRAM BAR - platform support is missing. Consider enabling 'Resiza… in resize_vram_bar()
116 _resize_bar(xe, LMEM_BAR, rebar_size); in resize_vram_bar()
136 static int determine_lmem_bar_size(struct xe_device *xe) in determine_lmem_bar_size() argument
138 struct pci_dev *pdev = to_pci_dev(xe->drm.dev); in determine_lmem_bar_size()
141 drm_err(&xe->drm, "pci resource is not valid\n"); in determine_lmem_bar_size()
145 resize_vram_bar(xe); in determine_lmem_bar_size()
147 xe->mem.vram.io_start = pci_resource_start(pdev, LMEM_BAR); in determine_lmem_bar_size()
148 xe->mem.vram.io_size = pci_resource_len(pdev, LMEM_BAR); in determine_lmem_bar_size()
149 if (!xe->mem.vram.io_size) in determine_lmem_bar_size()
152 /* XXX: Need to change when xe link code is ready */ in determine_lmem_bar_size()
153 xe->mem.vram.dpa_base = 0; in determine_lmem_bar_size()
156 xe->mem.vram.mapping = ioremap_wc(xe->mem.vram.io_start, xe->mem.vram.io_size); in determine_lmem_bar_size()
158 return 0; in determine_lmem_bar_size()
163 struct xe_device *xe = gt_to_xe(gt); in get_flat_ccs_offset() local
167 if (GRAPHICS_VER(xe) >= 20) { in get_flat_ccs_offset()
188 xe_assert_msg(xe, offset == (xe_mmio_read64_2x32(gt, GSMBASE) - ccs_size), in get_flat_ccs_offset()
220 struct xe_device *xe = tile_to_xe(tile); in tile_vram_size() local
226 if (IS_SRIOV_VF(xe)) { in tile_vram_size()
230 offset = 0; in tile_vram_size()
231 for_each_tile(t, xe, id) in tile_vram_size()
239 return 0; in tile_vram_size()
247 if (unlikely(xe->info.platform == XE_DG1)) { in tile_vram_size()
248 *tile_size = pci_resource_len(to_pci_dev(xe->drm.dev), LMEM_BAR); in tile_vram_size()
249 *tile_offset = 0; in tile_vram_size()
257 if (xe->info.has_flat_ccs) { in tile_vram_size()
271 struct xe_device *xe = arg; in vram_fini() local
275 if (xe->mem.vram.mapping) in vram_fini()
276 iounmap(xe->mem.vram.mapping); in vram_fini()
278 xe->mem.vram.mapping = NULL; in vram_fini()
280 for_each_tile(tile, xe, id) in vram_fini()
286 * @xe: the &xe_device
290 * Return: 0 on success, error code on failure
292 int xe_vram_probe(struct xe_device *xe) in xe_vram_probe() argument
296 u64 available_size = 0; in xe_vram_probe()
297 u64 total_size = 0; in xe_vram_probe()
304 if (!IS_DGFX(xe)) in xe_vram_probe()
305 return 0; in xe_vram_probe()
308 tile = xe_device_get_root_tile(xe); in xe_vram_probe()
313 err = determine_lmem_bar_size(xe); in xe_vram_probe()
317 drm_info(&xe->drm, "VISIBLE VRAM: %pa, %pa\n", &xe->mem.vram.io_start, in xe_vram_probe()
318 &xe->mem.vram.io_size); in xe_vram_probe()
320 io_size = xe->mem.vram.io_size; in xe_vram_probe()
323 for_each_tile(tile, xe, id) { in xe_vram_probe()
329 tile->mem.vram.io_start = xe->mem.vram.io_start + tile_offset; in xe_vram_probe()
333 drm_err(&xe->drm, "Tile without any CPU visible VRAM. Aborting.\n"); in xe_vram_probe()
337 tile->mem.vram.dpa_base = xe->mem.vram.dpa_base + tile_offset; in xe_vram_probe()
339 tile->mem.vram.mapping = xe->mem.vram.mapping + tile_offset; in xe_vram_probe()
342 drm_info(&xe->drm, "Small BAR device\n"); in xe_vram_probe()
343 …drm_info(&xe->drm, "VRAM[%u, %u]: Actual physical size %pa, usable size exclude stolen %pa, CPU ac… in xe_vram_probe()
345 drm_info(&xe->drm, "VRAM[%u, %u]: DPA range: [%pa-%llx], io range: [%pa-%llx]\n", id, tile->id, in xe_vram_probe()
353 if (total_size > xe->mem.vram.io_size) { in xe_vram_probe()
354 drm_info(&xe->drm, "VRAM: %pa is larger than resource %pa\n", in xe_vram_probe()
355 &total_size, &xe->mem.vram.io_size); in xe_vram_probe()
361 xe->mem.vram.actual_physical_size = total_size; in xe_vram_probe()
363 drm_info(&xe->drm, "Total VRAM: %pa, %pa\n", &xe->mem.vram.io_start, in xe_vram_probe()
364 &xe->mem.vram.actual_physical_size); in xe_vram_probe()
365 drm_info(&xe->drm, "Available VRAM: %pa, %pa\n", &xe->mem.vram.io_start, in xe_vram_probe()
368 return devm_add_action_or_reset(xe->drm.dev, vram_fini, xe); in xe_vram_probe()