mirror of
https://github.com/torvalds/linux.git
synced 2024-12-09 20:51:43 +00:00
e3d8b08904
When memory is migrated to the GPU, it is likely to be accessed by GPU code soon afterwards. Instead of waiting for a GPU fault, map the migrated memory into the GPU page tables with the same access permissions as the source CPU page table entries. This preserves copy on write semantics. Signed-off-by: Ralph Campbell <rcampbell@nvidia.com> Cc: Christoph Hellwig <hch@lst.de> Cc: Jason Gunthorpe <jgg@mellanox.com> Cc: "Jérôme Glisse" <jglisse@redhat.com> Cc: Ben Skeggs <bskeggs@redhat.com> Signed-off-by: Ben Skeggs <bskeggs@redhat.com>
54 lines
1.7 KiB
C
54 lines
1.7 KiB
C
#ifndef __NOUVEAU_SVM_H__
|
|
#define __NOUVEAU_SVM_H__
|
|
#include <nvif/os.h>
|
|
struct drm_device;
|
|
struct drm_file;
|
|
struct nouveau_drm;
|
|
|
|
struct nouveau_svmm;
|
|
|
|
#if IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM)
|
|
void nouveau_svm_init(struct nouveau_drm *);
|
|
void nouveau_svm_fini(struct nouveau_drm *);
|
|
void nouveau_svm_suspend(struct nouveau_drm *);
|
|
void nouveau_svm_resume(struct nouveau_drm *);
|
|
|
|
int nouveau_svmm_init(struct drm_device *, void *, struct drm_file *);
|
|
void nouveau_svmm_fini(struct nouveau_svmm **);
|
|
int nouveau_svmm_join(struct nouveau_svmm *, u64 inst);
|
|
void nouveau_svmm_part(struct nouveau_svmm *, u64 inst);
|
|
int nouveau_svmm_bind(struct drm_device *, void *, struct drm_file *);
|
|
|
|
u64 *nouveau_pfns_alloc(unsigned long npages);
|
|
void nouveau_pfns_free(u64 *pfns);
|
|
void nouveau_pfns_map(struct nouveau_svmm *svmm, struct mm_struct *mm,
|
|
unsigned long addr, u64 *pfns, unsigned long npages);
|
|
#else /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
|
|
static inline void nouveau_svm_init(struct nouveau_drm *drm) {}
|
|
static inline void nouveau_svm_fini(struct nouveau_drm *drm) {}
|
|
static inline void nouveau_svm_suspend(struct nouveau_drm *drm) {}
|
|
static inline void nouveau_svm_resume(struct nouveau_drm *drm) {}
|
|
|
|
static inline int nouveau_svmm_init(struct drm_device *device, void *p,
|
|
struct drm_file *file)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
|
|
static inline void nouveau_svmm_fini(struct nouveau_svmm **svmmp) {}
|
|
|
|
static inline int nouveau_svmm_join(struct nouveau_svmm *svmm, u64 inst)
|
|
{
|
|
return 0;
|
|
}
|
|
|
|
static inline void nouveau_svmm_part(struct nouveau_svmm *svmm, u64 inst) {}
|
|
|
|
static inline int nouveau_svmm_bind(struct drm_device *device, void *p,
|
|
struct drm_file *file)
|
|
{
|
|
return -ENOSYS;
|
|
}
|
|
#endif /* IS_ENABLED(CONFIG_DRM_NOUVEAU_SVM) */
|
|
#endif
|