Lines Matching +full:no +full:- +full:memory +full:- +full:wc
2 DRM Memory Management
5 Modern Linux systems require large amount of graphics memory to store
6 frame buffers, textures, vertices and other graphics-related data. Given
7 the very dynamic nature of many of that data, managing graphics memory
11 The DRM core includes two memory managers, namely Translation Table Manager
12 (TTM) and Graphics Execution Manager (GEM). TTM was the first DRM memory
13 manager to be developed and tried to be a one-size-fits-them all
15 all hardware, supporting both Unified Memory Architecture (UMA) devices
20 GEM started as an Intel-sponsored project in reaction to TTM's
22 providing a solution to every graphics memory-related problems, GEM
25 TTM, but has no video RAM management capabilities and is thus limited to
31 .. kernel-doc:: drivers/gpu/drm/ttm/ttm_module.c
34 .. kernel-doc:: include/drm/ttm/ttm_caching.h
38 ---------------------------
40 .. kernel-doc:: include/drm/ttm/ttm_device.h
43 .. kernel-doc:: drivers/gpu/drm/ttm/ttm_device.c
47 --------------------------------
49 .. kernel-doc:: include/drm/ttm/ttm_placement.h
53 -----------------------------
55 .. kernel-doc:: include/drm/ttm/ttm_resource.h
58 .. kernel-doc:: drivers/gpu/drm/ttm/ttm_resource.c
62 -----------------------
64 .. kernel-doc:: include/drm/ttm/ttm_tt.h
67 .. kernel-doc:: drivers/gpu/drm/ttm/ttm_tt.c
71 -----------------------
73 .. kernel-doc:: include/drm/ttm/ttm_pool.h
76 .. kernel-doc:: drivers/gpu/drm/ttm/ttm_pool.c
82 The GEM design approach has resulted in a memory manager that doesn't
84 userspace or kernel API. GEM exposes a set of standard memory-related
86 let drivers implement hardware-specific operations with their own
89 The GEM userspace API is described in the `GEM - the Graphics Execution
94 driver-specific ioctls.
96 GEM is data-agnostic. It manages abstract buffer objects without knowing
100 using driver-specific ioctls.
104 - Memory allocation and freeing
105 - Command execution
106 - Aperture management at command execution time
109 provided by Linux's shmem layer, which provides memory to back each
112 Device-specific operations, such as command execution, pinning, buffer
114 driver-specific ioctls.
117 ------------------
123 DRM Memory Manager object which provides an address space pool for
128 hardware. UMA devices usually have what is called a "stolen" memory
130 contiguous memory regions required by the device. This space is
135 --------------------
137 GEM splits creation of GEM objects and allocation of the memory that
143 driver-specific GEM object structure type that embeds an instance of
146 To create a GEM object, a driver allocates memory for an instance of its
153 GEM uses shmem to allocate anonymous pageable memory.
156 drm_gem_object <drm_gem_object>` filp field. The memory is
158 uses system memory directly or as a backing store otherwise.
163 object, or to delay allocation until the memory is needed (for instance
164 when a page fault occurs as a result of a userspace memory access or
165 when the driver needs to start a DMA transfer involving the memory).
167 Anonymous pageable memory allocation is not always desired, for instance
168 when the hardware requires physically contiguous system memory as is
170 no shmfs backing (called private GEM objects) by initializing them with a call
175 --------------------
177 All GEM objects are reference-counted by the GEM core. References can be
183 operation. That operation is mandatory for GEM-enabled drivers and must
192 ------------------
196 All of those are 32-bit integer values; the usual Linux kernel limits
200 object through a driver-specific ioctl, and can use that handle to refer
201 to the GEM object in other standard or driver-specific ioctls. Closing a
207 locally unique handle. When the handle is no longer needed drivers delete it
227 driver-specific support.
229 GEM also supports buffer sharing with dma-buf file descriptors through
230 PRIME. GEM-based drivers must use the provided helpers functions to
235 Furthermore PRIME also allows cross-device buffer sharing since it is
236 based on dma-bufs.
239 -------------------
242 read/write-like access to buffers, implemented through driver-specific
249 co-exist to map GEM objects to userspace. The first method uses a
250 driver-specific ioctl to perform the mapping operation, calling
252 dubious, seems to be discouraged for new GEM-enabled drivers, and will
263 in a driver-specific way and can then be used as the mmap offset
270 <drm_driver>` gem_vm_ops field. Note that drm_gem_mmap() doesn't map memory to
271 userspace, but relies on the driver-provided fault handler to map pages
280 .. code-block:: c
294 to userspace when a page fault occurs. Depending on the memory
296 decide to allocate memory for the GEM object at the time the object is
311 Documentation/admin-guide/mm/nommu-mmap.rst
313 Memory Coherency
314 ----------------
317 an object are flushed to memory and marked write combined so as to be
320 coherent with the CPU's view of memory, usually involving GPU cache
321 flushing of various kinds. This core CPU<->GPU coherency management is
322 provided by a device-specific ioctl, which evaluates an object's current
330 -----------------
334 command buffers containing references to previously allocated memory
338 This often involves evicting some objects from the GTT and re-binding
342 the GTT; otherwise, GEM will reject them and no rendering will occur.
344 be allocated for correct rendering (e.g. 2D blits on pre-965 chips),
350 ----------------------
352 .. kernel-doc:: include/drm/drm_gem.h
355 .. kernel-doc:: drivers/gpu/drm/drm_gem.c
359 ----------------------------------
361 .. kernel-doc:: drivers/gpu/drm/drm_gem_dma_helper.c
364 .. kernel-doc:: include/drm/drm_gem_dma_helper.h
367 .. kernel-doc:: drivers/gpu/drm/drm_gem_dma_helper.c
371 -----------------------------------
373 .. kernel-doc:: drivers/gpu/drm/drm_gem_shmem_helper.c
376 .. kernel-doc:: include/drm/drm_gem_shmem_helper.h
379 .. kernel-doc:: drivers/gpu/drm/drm_gem_shmem_helper.c
383 -----------------------------------
385 .. kernel-doc:: drivers/gpu/drm/drm_gem_vram_helper.c
388 .. kernel-doc:: include/drm/drm_gem_vram_helper.h
391 .. kernel-doc:: drivers/gpu/drm/drm_gem_vram_helper.c
395 -----------------------------------
397 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
400 .. kernel-doc:: drivers/gpu/drm/drm_gem_ttm_helper.c
406 .. kernel-doc:: drivers/gpu/drm/drm_vma_manager.c
409 .. kernel-doc:: include/drm/drm_vma_manager.h
412 .. kernel-doc:: drivers/gpu/drm/drm_vma_manager.c
421 created for the OPTIMUS range of multi-gpu platforms. To userspace PRIME
422 buffers are dma-buf based file descriptors.
425 ---------------------------
427 .. kernel-doc:: drivers/gpu/drm/drm_prime.c
431 ----------------------
433 .. kernel-doc:: drivers/gpu/drm/drm_prime.c
437 -------------------------
439 .. kernel-doc:: include/drm/drm_prime.h
442 .. kernel-doc:: drivers/gpu/drm/drm_prime.c
449 --------
451 .. kernel-doc:: drivers/gpu/drm/drm_mm.c
455 -------------------------
457 .. kernel-doc:: drivers/gpu/drm/drm_mm.c
461 ------------------------------------------
463 .. kernel-doc:: include/drm/drm_mm.h
466 .. kernel-doc:: drivers/gpu/drm/drm_mm.c
475 --------
477 .. kernel-doc:: drivers/gpu/drm/drm_gpuvm.c
481 ---------------
483 .. kernel-doc:: drivers/gpu/drm/drm_gpuvm.c
489 -------
491 .. kernel-doc:: drivers/gpu/drm/drm_gpuvm.c
495 --------
497 .. kernel-doc:: drivers/gpu/drm/drm_gpuvm.c
501 -----------------------------
503 .. kernel-doc:: include/drm/drm_gpuvm.h
506 .. kernel-doc:: drivers/gpu/drm/drm_gpuvm.c
513 -----------------------------
515 .. kernel-doc:: drivers/gpu/drm/drm_buddy.c
518 DRM Cache Handling and Fast WC memcpy()
521 .. kernel-doc:: drivers/gpu/drm/drm_cache.c
529 .. kernel-doc:: drivers/gpu/drm/drm_syncobj.c
532 .. kernel-doc:: include/drm/drm_syncobj.h
535 .. kernel-doc:: drivers/gpu/drm/drm_syncobj.c
541 .. kernel-doc:: drivers/gpu/drm/drm_exec.c
544 .. kernel-doc:: include/drm/drm_exec.h
547 .. kernel-doc:: drivers/gpu/drm/drm_exec.c
554 --------
556 .. kernel-doc:: drivers/gpu/drm/scheduler/sched_main.c
560 ------------
562 .. kernel-doc:: drivers/gpu/drm/scheduler/sched_main.c
566 -----------------------------
568 .. kernel-doc:: include/drm/gpu_scheduler.h
571 .. kernel-doc:: drivers/gpu/drm/scheduler/sched_main.c
574 .. kernel-doc:: drivers/gpu/drm/scheduler/sched_entity.c