drm: fix "persistant" typo

Signed-off-by: Jan Engelhardt <jengelh@medozas.de>
Signed-off-by: Dave Airlie <airlied@redhat.com>

authored by Jan Engelhardt and committed by Dave Airlie 5df23979 758f231e

+25 -25
+1 -1
drivers/gpu/drm/nouveau/nouveau_gem.c
··· 97 return -ENOMEM; 98 } 99 100 - nvbo->bo.persistant_swap_storage = nvbo->gem->filp; 101 nvbo->gem->driver_private = nvbo; 102 return 0; 103 }
··· 97 return -ENOMEM; 98 } 99 100 + nvbo->bo.persistent_swap_storage = nvbo->gem->filp; 101 nvbo->gem->driver_private = nvbo; 102 return 0; 103 }
+5 -5
drivers/gpu/drm/ttm/ttm_bo.c
··· 1168 uint32_t page_alignment, 1169 unsigned long buffer_start, 1170 bool interruptible, 1171 - struct file *persistant_swap_storage, 1172 size_t acc_size, 1173 void (*destroy) (struct ttm_buffer_object *)) 1174 { ··· 1211 bo->priv_flags = 0; 1212 bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); 1213 bo->seq_valid = false; 1214 - bo->persistant_swap_storage = persistant_swap_storage; 1215 bo->acc_size = acc_size; 1216 atomic_inc(&bo->glob->bo_count); 1217 ··· 1260 uint32_t page_alignment, 1261 unsigned long buffer_start, 1262 bool interruptible, 1263 - struct file *persistant_swap_storage, 1264 struct ttm_buffer_object **p_bo) 1265 { 1266 struct ttm_buffer_object *bo; ··· 1282 1283 ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, 1284 buffer_start, interruptible, 1285 - persistant_swap_storage, acc_size, NULL); 1286 if (likely(ret == 0)) 1287 *p_bo = bo; 1288 ··· 1863 if (bo->bdev->driver->swap_notify) 1864 bo->bdev->driver->swap_notify(bo); 1865 1866 - ret = ttm_tt_swapout(bo->ttm, bo->persistant_swap_storage); 1867 out: 1868 1869 /**
··· 1168 uint32_t page_alignment, 1169 unsigned long buffer_start, 1170 bool interruptible, 1171 + struct file *persistent_swap_storage, 1172 size_t acc_size, 1173 void (*destroy) (struct ttm_buffer_object *)) 1174 { ··· 1211 bo->priv_flags = 0; 1212 bo->mem.placement = (TTM_PL_FLAG_SYSTEM | TTM_PL_FLAG_CACHED); 1213 bo->seq_valid = false; 1214 + bo->persistent_swap_storage = persistent_swap_storage; 1215 bo->acc_size = acc_size; 1216 atomic_inc(&bo->glob->bo_count); 1217 ··· 1260 uint32_t page_alignment, 1261 unsigned long buffer_start, 1262 bool interruptible, 1263 + struct file *persistent_swap_storage, 1264 struct ttm_buffer_object **p_bo) 1265 { 1266 struct ttm_buffer_object *bo; ··· 1282 1283 ret = ttm_bo_init(bdev, bo, size, type, placement, page_alignment, 1284 buffer_start, interruptible, 1285 + persistent_swap_storage, acc_size, NULL); 1286 if (likely(ret == 0)) 1287 *p_bo = bo; 1288 ··· 1863 if (bo->bdev->driver->swap_notify) 1864 bo->bdev->driver->swap_notify(bo); 1865 1866 + ret = ttm_tt_swapout(bo->ttm, bo->persistent_swap_storage); 1867 out: 1868 1869 /**
+8 -8
drivers/gpu/drm/ttm/ttm_tt.c
··· 332 ttm_tt_free_page_directory(ttm); 333 } 334 335 - if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP) && 336 ttm->swap_storage) 337 fput(ttm->swap_storage); 338 ··· 503 page_cache_release(from_page); 504 } 505 506 - if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTANT_SWAP)) 507 fput(swap_storage); 508 ttm->swap_storage = NULL; 509 ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED; ··· 514 return ret; 515 } 516 517 - int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistant_swap_storage) 518 { 519 struct address_space *swap_space; 520 struct file *swap_storage; ··· 540 return 0; 541 } 542 543 - if (!persistant_swap_storage) { 544 swap_storage = shmem_file_setup("ttm swap", 545 ttm->num_pages << PAGE_SHIFT, 546 0); ··· 549 return PTR_ERR(swap_storage); 550 } 551 } else 552 - swap_storage = persistant_swap_storage; 553 554 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 555 ··· 577 ttm_tt_free_alloced_pages(ttm); 578 ttm->swap_storage = swap_storage; 579 ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED; 580 - if (persistant_swap_storage) 581 - ttm->page_flags |= TTM_PAGE_FLAG_PERSISTANT_SWAP; 582 583 return 0; 584 out_err: 585 - if (!persistant_swap_storage) 586 fput(swap_storage); 587 588 return ret;
··· 332 ttm_tt_free_page_directory(ttm); 333 } 334 335 + if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP) && 336 ttm->swap_storage) 337 fput(ttm->swap_storage); 338 ··· 503 page_cache_release(from_page); 504 } 505 506 + if (!(ttm->page_flags & TTM_PAGE_FLAG_PERSISTENT_SWAP)) 507 fput(swap_storage); 508 ttm->swap_storage = NULL; 509 ttm->page_flags &= ~TTM_PAGE_FLAG_SWAPPED; ··· 514 return ret; 515 } 516 517 + int ttm_tt_swapout(struct ttm_tt *ttm, struct file *persistent_swap_storage) 518 { 519 struct address_space *swap_space; 520 struct file *swap_storage; ··· 540 return 0; 541 } 542 543 + if (!persistent_swap_storage) { 544 swap_storage = shmem_file_setup("ttm swap", 545 ttm->num_pages << PAGE_SHIFT, 546 0); ··· 549 return PTR_ERR(swap_storage); 550 } 551 } else 552 + swap_storage = persistent_swap_storage; 553 554 swap_space = swap_storage->f_path.dentry->d_inode->i_mapping; 555 ··· 577 ttm_tt_free_alloced_pages(ttm); 578 ttm->swap_storage = swap_storage; 579 ttm->page_flags |= TTM_PAGE_FLAG_SWAPPED; 580 + if (persistent_swap_storage) 581 + ttm->page_flags |= TTM_PAGE_FLAG_PERSISTENT_SWAP; 582 583 return 0; 584 out_err: 585 + if (!persistent_swap_storage) 586 fput(swap_storage); 587 588 return ret;
+9 -9
include/drm/ttm/ttm_bo_api.h
··· 158 * the object is destroyed. 159 * @event_queue: Queue for processes waiting on buffer object status change. 160 * @mem: structure describing current placement. 161 - * @persistant_swap_storage: Usually the swap storage is deleted for buffers 162 * pinned in physical memory. If this behaviour is not desired, this member 163 - * holds a pointer to a persistant shmem object. 164 * @ttm: TTM structure holding system pages. 165 * @evicted: Whether the object was evicted without user-space knowing. 166 * @cpu_writes: For synchronization. Number of cpu writers. ··· 221 */ 222 223 struct ttm_mem_reg mem; 224 - struct file *persistant_swap_storage; 225 struct ttm_tt *ttm; 226 bool evicted; 227 ··· 459 * user buffer object. 460 * @interruptible: If needing to sleep to wait for GPU resources, 461 * sleep interruptible. 462 - * @persistant_swap_storage: Usually the swap storage is deleted for buffers 463 * pinned in physical memory. If this behaviour is not desired, this member 464 - * holds a pointer to a persistant shmem object. Typically, this would 465 * point to the shmem object backing a GEM object if TTM is used to back a 466 * GEM user interface. 467 * @acc_size: Accounted size for this object. ··· 490 uint32_t page_alignment, 491 unsigned long buffer_start, 492 bool interrubtible, 493 - struct file *persistant_swap_storage, 494 size_t acc_size, 495 void (*destroy) (struct ttm_buffer_object *)); 496 /** ··· 506 * user buffer object. 507 * @interruptible: If needing to sleep while waiting for GPU resources, 508 * sleep interruptible. 509 - * @persistant_swap_storage: Usually the swap storage is deleted for buffers 510 * pinned in physical memory. If this behaviour is not desired, this member 511 - * holds a pointer to a persistant shmem object. Typically, this would 512 * point to the shmem object backing a GEM object if TTM is used to back a 513 * GEM user interface. 514 * @p_bo: On successful completion *p_bo points to the created object. ··· 528 uint32_t page_alignment, 529 unsigned long buffer_start, 530 bool interruptible, 531 - struct file *persistant_swap_storage, 532 struct ttm_buffer_object **p_bo); 533 534 /**
··· 158 * the object is destroyed. 159 * @event_queue: Queue for processes waiting on buffer object status change. 160 * @mem: structure describing current placement. 161 + * @persistent_swap_storage: Usually the swap storage is deleted for buffers 162 * pinned in physical memory. If this behaviour is not desired, this member 163 + * holds a pointer to a persistent shmem object. 164 * @ttm: TTM structure holding system pages. 165 * @evicted: Whether the object was evicted without user-space knowing. 166 * @cpu_writes: For synchronization. Number of cpu writers. ··· 221 */ 222 223 struct ttm_mem_reg mem; 224 + struct file *persistent_swap_storage; 225 struct ttm_tt *ttm; 226 bool evicted; 227 ··· 459 * user buffer object. 460 * @interruptible: If needing to sleep to wait for GPU resources, 461 * sleep interruptible. 462 + * @persistent_swap_storage: Usually the swap storage is deleted for buffers 463 * pinned in physical memory. If this behaviour is not desired, this member 464 + * holds a pointer to a persistent shmem object. Typically, this would 465 * point to the shmem object backing a GEM object if TTM is used to back a 466 * GEM user interface. 467 * @acc_size: Accounted size for this object. ··· 490 uint32_t page_alignment, 491 unsigned long buffer_start, 492 bool interrubtible, 493 + struct file *persistent_swap_storage, 494 size_t acc_size, 495 void (*destroy) (struct ttm_buffer_object *)); 496 /** ··· 506 * user buffer object. 507 * @interruptible: If needing to sleep while waiting for GPU resources, 508 * sleep interruptible. 509 + * @persistent_swap_storage: Usually the swap storage is deleted for buffers 510 * pinned in physical memory. If this behaviour is not desired, this member 511 + * holds a pointer to a persistent shmem object. Typically, this would 512 * point to the shmem object backing a GEM object if TTM is used to back a 513 * GEM user interface. 514 * @p_bo: On successful completion *p_bo points to the created object. ··· 528 uint32_t page_alignment, 529 unsigned long buffer_start, 530 bool interruptible, 531 + struct file *persistent_swap_storage, 532 struct ttm_buffer_object **p_bo); 533 534 /**
+2 -2
include/drm/ttm/ttm_bo_driver.h
··· 122 #define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) 123 #define TTM_PAGE_FLAG_WRITE (1 << 3) 124 #define TTM_PAGE_FLAG_SWAPPED (1 << 4) 125 - #define TTM_PAGE_FLAG_PERSISTANT_SWAP (1 << 5) 126 #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) 127 #define TTM_PAGE_FLAG_DMA32 (1 << 7) 128 ··· 714 */ 715 extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); 716 extern int ttm_tt_swapout(struct ttm_tt *ttm, 717 - struct file *persistant_swap_storage); 718 719 /* 720 * ttm_bo.c
··· 122 #define TTM_PAGE_FLAG_USER_DIRTY (1 << 2) 123 #define TTM_PAGE_FLAG_WRITE (1 << 3) 124 #define TTM_PAGE_FLAG_SWAPPED (1 << 4) 125 + #define TTM_PAGE_FLAG_PERSISTENT_SWAP (1 << 5) 126 #define TTM_PAGE_FLAG_ZERO_ALLOC (1 << 6) 127 #define TTM_PAGE_FLAG_DMA32 (1 << 7) 128 ··· 714 */ 715 extern int ttm_tt_set_placement_caching(struct ttm_tt *ttm, uint32_t placement); 716 extern int ttm_tt_swapout(struct ttm_tt *ttm, 717 + struct file *persistent_swap_storage); 718 719 /* 720 * ttm_bo.c