/linux/drivers/gpu/drm/tegra/ |
H A D | gem.c | 3 * NVIDIA Tegra DRM GEM helper functions 8 * Based on the GEM/CMA helpers 22 #include "gem.h" 55 drm_gem_object_put(&obj->gem); in tegra_bo_put() 62 struct drm_gem_object *gem = &obj->gem; in tegra_bo_pin() local 96 map->size = gem->size; in tegra_bo_pin() 116 err = sg_alloc_table_from_pages(map->sgt, obj->pages, obj->num_pages, 0, gem->size, in tegra_bo_pin() 126 err = dma_get_sgtable(dev, map->sgt, obj->vaddr, obj->iova, gem->size); in tegra_bo_pin() 148 map->size = gem->size; in tegra_bo_pin() 220 drm_gem_object_get(&obj->gem); in tegra_bo_get() [all …]
|
H A D | fb.c | 18 #include "gem.h" 121 fb->obj[i] = &planes[i]->gem; in tegra_fb_alloc() 140 struct drm_gem_object *gem; in tegra_fb_create() local 150 gem = drm_gem_object_lookup(file, cmd->handles[i]); in tegra_fb_create() 151 if (!gem) { in tegra_fb_create() 161 if (gem->size < size) { in tegra_fb_create() 163 drm_gem_object_put(gem); in tegra_fb_create() 167 planes[i] = to_tegra_bo(gem); in tegra_fb_create() 180 drm_gem_object_put(&planes[i]->gem); in tegra_fb_create()
|
H A D | drm.c | 33 #include "gem.h" 251 refs[num_refs++] = &obj->gem; in tegra_drm_submit() 258 if (offset & 3 || offset > obj->gem.size) { in tegra_drm_submit() 281 refs[num_refs++] = &obj->gem; in tegra_drm_submit() 289 reloc->cmdbuf.offset >= obj->gem.size) { in tegra_drm_submit() 295 refs[num_refs++] = &obj->gem; in tegra_drm_submit() 297 if (reloc->target.offset >= obj->gem.size) { in tegra_drm_submit() 367 struct drm_gem_object *gem; in tegra_gem_mmap() local 370 gem = drm_gem_object_lookup(file, args->handle); in tegra_gem_mmap() 371 if (!gem) in tegra_gem_mmap() [all …]
|
H A D | fbdev.c | 23 #include "gem.h" 33 err = drm_gem_mmap_obj(&bo->gem, bo->gem.size, vma); in tegra_fb_mmap() 37 return __tegra_gem_mmap(&bo->gem, vma); in tegra_fb_mmap() 105 drm_gem_object_put(&bo->gem); in tegra_fbdev_driver_fbdev_probe() 116 drm_gem_object_put(&bo->gem); in tegra_fbdev_driver_fbdev_probe()
|
/linux/Documentation/gpu/ |
H A D | drm-mm.rst | 12 (TTM) and Graphics Execution Manager (GEM). TTM was the first DRM memory 20 GEM started as an Intel-sponsored project in reaction to TTM's 22 providing a solution to every graphics memory-related problems, GEM 24 share it. GEM has simpler initialization and execution requirements than 79 The Graphics Execution Manager (GEM) 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 89 The GEM userspace API is described in the `GEM - the Graphics Execution 91 slightly outdated, the document provides a good overview of the GEM API 93 as part of the common GEM API, are currently implemented using [all …]
|
H A D | drm-vm-bind-locking.rst | 34 a GEM object or anonymous or page-cache pages mapped also into the CPU 36 * ``gpu_vm_bo``: Abstracts the association of a GEM object and 37 a VM. The GEM object maintains a list of gpu_vm_bos, where each gpu_vm_bo 50 gpu_vm or a GEM object. The dma_resv contains an array / list 63 * ``local object``: A GEM object which is only mapped within a 64 single VM. Local GEM objects share the gpu_vm's dma_resv. 65 * ``external object``: a.k.a shared object: A GEM object which may be shared 72 One of the benefits of VM_BIND is that local GEM objects share the gpu_vm's 74 number of local GEM objects, only one lock is needed to make the exec 98 GEM objects. [all …]
|
/linux/include/drm/ |
H A D | drm_gem_dma_helper.h | 12 * struct drm_gem_dma_object - GEM object backed by DMA memory allocations 13 * @base: base GEM object 19 * @map_noncoherent: if true, the GEM object is backed by non-coherent memory 26 /* For objects with DMA memory allocated by GEM DMA */ 48 * GEM object functions 52 * drm_gem_dma_object_free - GEM object function for drm_gem_dma_free() 53 * @obj: GEM object to free 69 * @obj: GEM object 83 * drm_gem_dma_object_get_sg_table - GEM object function for drm_gem_dma_get_sg_table() 84 * @obj: GEM object [all …]
|
H A D | drm_exec.h | 44 * @contended: contended GEM object we backed off for 49 * @prelocked: already locked GEM object due to contention 72 * @obj: the current GEM object 74 * Iterate over all the locked GEM objects inside the drm_exec object. 84 * @obj: the current GEM object 86 * Iterate over all the locked GEM objects inside the drm_exec object in 95 * drm_exec_until_all_locked - loop until all GEM objects are locked 98 * Core functionality of the drm_exec object. Loops until all GEM objects are 100 * guaranteed that no GEM object is locked. 118 * clean up and re-start the loop to prepare all GEM objects. [all …]
|
H A D | drm_gem_ttm_helper.h | 18 const struct drm_gem_object *gem); 19 int drm_gem_ttm_vmap(struct drm_gem_object *gem, 21 void drm_gem_ttm_vunmap(struct drm_gem_object *gem, 23 int drm_gem_ttm_mmap(struct drm_gem_object *gem,
|
H A D | drm_gpuvm.h | 48 * Flag indicating that the &drm_gpuva's backing GEM is invalidated. 106 * @gem: structure containing the &drm_gem_object and its offset 110 * @gem.offset: the offset within the &drm_gem_object 115 * @gem.obj: the mapped &drm_gem_object 120 * @gem.entry: the &list_head to attach this object to a &drm_gpuvm_bo 123 } gem; member 164 * drm_gpuva_invalidate() - sets whether the backing GEM of this &drm_gpuva is 203 * When set, gpuva.lock is used to protect gpuva.list in all GEM 287 * @r_obj: Resv GEM object; representing the GPUVM's common &dma_resv. 652 * Furthermore it is used cache evicted GEM objects for a certain GPU-VM to [all …]
|
/linux/drivers/gpu/drm/exynos/ |
H A D | exynos_drm_gem.h | 21 * @base: a gem object. 22 * - a new handle to this gem object would be created 49 /* destroy a buffer with gem object */ 52 /* create a new buffer with gem object */ 59 * request gem object creation and buffer allocation as the size 66 /* get fake-offset of gem object that can be used with mmap. */ 71 * get exynos drm object from gem handle, this function could be used for 73 * with this function call, gem object reference count would be increased. 80 * gem object reference count would be decreased. 87 /* get buffer information to memory region allocated by gem. */ [all …]
|
/linux/drivers/gpu/drm/ |
H A D | drm_gem.c | 91 * drm_gem_init - Initialize the GEM device fields 118 * drm_gem_object_init_with_mnt - initialize an allocated shmem-backed GEM 124 * @gemfs: tmpfs mount where the GEM object will be created. If NULL, use 127 * Initialize an already allocated GEM object of the specified size with 154 * drm_gem_object_init - initialize an allocated shmem-backed GEM object 159 * Initialize an already allocated GEM object of the specified size with 170 * drm_gem_private_object_init - initialize an allocated private GEM object 175 * Initialize an already allocated GEM object of the specified size with 176 * no GEM provided backing store. Instead the caller is responsible for 207 * Uninitialize an already allocated GEM object when it initialized failed [all …]
|
H A D | drm_gem_dma_helper.c | 3 * drm gem DMA helper functions 29 * The DRM GEM/DMA helpers are a means to provide buffer objects that are 43 * For GEM callback helpers in struct &drm_gem_object functions, see likewise 58 * __drm_gem_dma_create - Create a GEM DMA object without allocating memory 63 * This function creates and initializes a GEM DMA object of the given size, 121 * This function creates a DMA GEM object and allocates memory as backing store. 173 * return a GEM handle to it 177 * @handle: return location for the GEM handle 179 * This function creates a DMA GEM object, allocating a chunk of memory as 180 * backing store. The GEM object is then added to the list of object associated [all …]
|
H A D | drm_gem_framebuffer_helper.c | 3 * drm gem framebuffer helper functions 43 * drm_gem_fb_get_obj() - Get GEM object backing the framebuffer 92 * drm_gem_fb_destroy - Free GEM backed framebuffer 95 * Frees a GEM backed framebuffer with its backing buffer(s) and the structure 112 * drm_gem_fb_create_handle - Create handle for GEM backed framebuffer 117 * This function creates a handle for the GEM object backing the framebuffer. 139 * @file: DRM file that holds the GEM handle(s) backing the framebuffer 180 drm_dbg_kms(dev, "Failed to lookup GEM object\n"); in drm_gem_fb_init_with_funcs() 191 "GEM object size (%zu) smaller than minimum size (%u) for plane %d\n", in drm_gem_fb_init_with_funcs() 219 * @file: DRM file that holds the GEM handle(s) backing the framebuffer [all …]
|
/linux/drivers/gpu/drm/nouveau/ |
H A D | nouveau_gem.c | 77 nouveau_gem_object_del(struct drm_gem_object *gem) in nouveau_gem_object_del() argument 79 struct nouveau_bo *nvbo = nouveau_gem_object(gem); in nouveau_gem_object_del() 97 nouveau_gem_object_open(struct drm_gem_object *gem, struct drm_file *file_priv) in nouveau_gem_object_open() argument 100 struct nouveau_bo *nvbo = nouveau_gem_object(gem); in nouveau_gem_object_open() 183 nouveau_gem_object_close(struct drm_gem_object *gem, struct drm_file *file_priv) in nouveau_gem_object_close() argument 186 struct nouveau_bo *nvbo = nouveau_gem_object(gem); in nouveau_gem_object_close() 260 /* Initialize the embedded gem-object. We return a single gem-reference in nouveau_gem_new() 299 nouveau_gem_info(struct drm_file *file_priv, struct drm_gem_object *gem, in nouveau_gem_info() argument 303 struct nouveau_bo *nvbo = nouveau_gem_object(gem); in nouveau_gem_info() 372 nouveau_gem_set_domain(struct drm_gem_object *gem, uint32_t read_domains, in nouveau_gem_set_domain() argument [all …]
|
/linux/drivers/gpu/drm/tests/ |
H A D | drm_gem_shmem_test.c | 3 * KUnit test suite for GEM objects backed by shmem buffers 38 * Test creating a shmem GEM object backed by shmem buffer. The test 39 * case succeeds if the GEM object is successfully allocated with the 58 * Test creating a shmem GEM object from a scatter/gather table exported 59 * via a DMA-BUF. The test case succeed if the GEM object is successfully 124 * Test pinning backing pages for a shmem GEM object. The test case 156 * Test creating a virtual mapping for a shmem GEM object. The test 193 * PRIME usage from a shmem GEM object. The test case succeeds if a 235 * driver usage from a shmem GEM object. The test case succeeds if the 269 * Test updating the madvise state of a shmem GEM object. The test [all …]
|
/linux/drivers/gpu/drm/mediatek/ |
H A D | mtk_gem.h | 14 * @base: a gem object. 15 * - a new handle to this gem object would be created 18 * @kvaddr: kernel virtual address of gem buffer. 19 * @dma_addr: dma address of gem buffer. 20 * @dma_attrs: dma attributes of gem buffer. 37 void mtk_gem_free_object(struct drm_gem_object *gem);
|
/linux/drivers/gpu/drm/gma500/ |
H A D | gem.c | 3 * psb GEM interface 11 * accelerated operations on a GEM object) 21 #include "gem.h" 25 * PSB GEM object 165 /* GEM object */ in psb_gem_create() 216 pobj = psb_gem_create(dev, size, "gem", false, PAGE_SIZE); in psb_gem_dumb_create() 239 * psb_gem_fault - pagefault handler for GEM objects 242 * Invoked when a fault occurs on an mmap of a GEM managed area. GEM 250 * The VMA was set up by GEM. In doing so it also ensured that the 251 * vma->vm_private_data points to the GEM object that is backing this [all …]
|
/linux/include/uapi/drm/ |
H A D | tegra_drm.h | 19 * struct drm_tegra_gem_create - parameters for the GEM object creation IOCTL 32 * A bitmask of flags that influence the creation of GEM objects: 45 * The handle of the created GEM object. Set by the kernel upon 52 * struct drm_tegra_gem_mmap - parameters for the GEM mmap IOCTL 58 * Handle of the GEM object to obtain an mmap offset for. 72 * The mmap offset for the given GEM object. Set by the kernel upon 276 * Handle to a GEM object containing the command buffer. 283 * Offset, in bytes, into the GEM object identified by @handle at 304 * struct drm_tegra_reloc - GEM object relocation structure 311 * Handle to the GEM object containing the command buffer for [all …]
|
/linux/drivers/net/ethernet/sun/ |
H A D | sungem.c | 3 * sungem.c: Sun GEM ethernet driver. 82 MODULE_DESCRIPTION("Sun GEM Gbit ethernet driver"); 85 #define GEM_MODULE_NAME "gem" 91 /* These models only differ from the original GEM in 117 static u16 __sungem_phy_read(struct gem *gp, int phy_addr, int reg) in __sungem_phy_read() 145 struct gem *gp = netdev_priv(dev); in _sungem_phy_read() 149 static inline u16 sungem_phy_read(struct gem *gp, int reg) in sungem_phy_read() 154 static void __sungem_phy_write(struct gem *gp, int phy_addr, int reg, u16 val) in __sungem_phy_write() 178 struct gem *gp = netdev_priv(dev); in _sungem_phy_write() 182 static inline void sungem_phy_write(struct gem *gp, int reg, u16 val) in sungem_phy_write() [all …]
|
/linux/drivers/gpu/drm/loongson/ |
H A D | lsdc_gem.c | 167 mutex_lock(&ldev->gem.mutex); in lsdc_gem_object_create() 168 list_add_tail(&lbo->list, &ldev->gem.objects); in lsdc_gem_object_create() 169 mutex_unlock(&ldev->gem.mutex); in lsdc_gem_object_create() 231 drm_err(ddev, "Failed to create gem object\n"); in lsdc_dumb_create() 269 mutex_init(&ldev->gem.mutex); in lsdc_gem_init() 270 INIT_LIST_HEAD(&ldev->gem.objects); in lsdc_gem_init() 281 mutex_lock(&ldev->gem.mutex); in lsdc_show_buffer_object() 285 list_for_each_entry(lbo, &ldev->gem.objects, list) { in lsdc_show_buffer_object() 296 mutex_unlock(&ldev->gem.mutex); in lsdc_show_buffer_object()
|
H A D | lsdc_ttm.h | 26 /* Protected by gem.mutex */ 47 static inline struct ttm_buffer_object *to_ttm_bo(struct drm_gem_object *gem) in to_ttm_bo() argument 49 return container_of(gem, struct ttm_buffer_object, base); in to_ttm_bo() 57 static inline struct lsdc_bo *gem_to_lsdc_bo(struct drm_gem_object *gem) in gem_to_lsdc_bo() argument 59 return container_of(gem, struct lsdc_bo, tbo.base); in gem_to_lsdc_bo()
|
/linux/rust/kernel/drm/gem/ |
H A D | mod.rs | 3 //! DRM GEM API 25 /// GEM object functions, which must be implemented by drivers. in open() 30 /// Create a new driver data object for a GEM object of a given size. 42 /// Trait that represents a GEM object subtype 58 // SAFETY: All gem objects are refcounted. 121 /// Base operations shared by all GEM object classes 161 // - Therefore, we're guaranteed that `ptr` must be a gem object embedded within `Self`. in lookup_handle() 185 /// A base GEM object. in create_mmap_offset() 219 /// Create a new GEM object. 226 // as long as the GEM objec [all...] |
/linux/drivers/gpu/drm/msm/ |
H A D | msm_gem_vma.c | 89 * original GEM object backing the mapping that will be unmapped. 121 /** @bos_pinned: are the GEM objects being bound pinned? */ 133 * This table also serves to hold a reference to the backing GEM 330 .offset = vma->gem.offset, in msm_gem_vma_map() 354 if (vma->gem.obj) in msm_gem_vma_close() 355 msm_gem_assert_locked(vma->gem.obj); in msm_gem_vma_close() 402 .gem.obj = obj, in msm_gem_vma_new() 403 .gem.offset = offset, in msm_gem_vma_new() 479 return msm_gem_vma_new(arg->job->vm, op->gem.obj, op->gem.offset, in vma_from_op() 488 struct drm_gem_object *obj = op->map.gem.obj; in msm_gem_vm_sm_step_map() [all …]
|
/linux/drivers/net/ethernet/cadence/ |
H A D | Kconfig | 23 tristate "Cadence MACB/GEM support" 30 AT91 parts. This driver also supports the Cadence GEM (Gigabit 32 support for the MACB/GEM chip. 46 tristate "Cadence PCI MACB/GEM support"
|