search for: ttm_bo_mmap

Displaying 20 results from an estimated 64 matches for "ttm_bo_mmap".

Did you mean: ttm_bo_kmap
2019 Aug 08
0
[PATCH v4 14/17] drm/qxl: drop qxl_ttm_fault
...ta; struct qxl_device *qdev = file_priv->minor->dev->dev_private; @@ -77,16 +61,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma) DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", filp->private_data, vma->vm_pgoff); - r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev); - if (unlikely(r != 0)) - return r; - if (unlikely(ttm_vm_ops == NULL)) { - ttm_vm_ops = vma->vm_ops; - qxl_ttm_vm_ops = *ttm_vm_ops; - qxl_ttm_vm_ops.fault = &qxl_ttm_fault; - } - vma->vm_ops = &qxl_ttm_vm_ops; - return 0; + return ttm_bo_mmap...
2019 Oct 17
0
[PATCH 1/5] drm/qxl: drop qxl_ttm_fault
...ta; struct qxl_device *qdev = file_priv->minor->dev->dev_private; @@ -77,16 +61,7 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma) DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", filp->private_data, vma->vm_pgoff); - r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev); - if (unlikely(r != 0)) - return r; - if (unlikely(ttm_vm_ops == NULL)) { - ttm_vm_ops = vma->vm_ops; - qxl_ttm_vm_ops = *ttm_vm_ops; - qxl_ttm_vm_ops.fault = &qxl_ttm_fault; - } - vma->vm_ops = &qxl_ttm_vm_ops; - return 0; + return ttm_bo_mmap...
2020 Jan 24
1
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...= ttm_bo_vm_access > +}; > + > int > nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) > { > struct drm_file *file_priv = filp->private_data; > struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); > + int ret; > > - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + if (ret) > + return ret; > + > + vma->vm_ops = &nouveau_ttm_vm_ops; > + return 0; > } > > static int > @@ -273,6 +311,9 @@ nouveau_ttm_init(struct nouveau_drm...
2020 Jan 28
1
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...ss > +}; > + > int > nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) > { > struct drm_file *file_priv = filp->private_data; > struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); > + int ret; > > - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + if (ret) > + return ret; > + > + vma->vm_ops = &nouveau_ttm_vm_ops; > + return 0; > } > > static int > @@ -273,6 +311,9 @@ nou...
2020 Jan 24
4
TTM/Nouveau cleanups
Hi guys, I've already send this out in September last year, but only got a response from Daniel. Could you guys please test this and tell me what you think about it? Basically I'm trying to remove all driver specific features from TTM which don't need to be inside the framework. Thanks, Christian.
2020 Jan 24
0
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver v2
...= ttm_bo_vm_open, + .close = ttm_bo_vm_close, + .access = ttm_bo_vm_access +}; + int nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *file_priv = filp->private_data; struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); + int ret; - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + if (ret) + return ret; + + vma->vm_ops = &nouveau_ttm_vm_ops; + return 0; } static int @@ -273,6 +311,9 @@ nouveau_ttm_init(struct nouveau_drm *drm) return ret; } + mutex_init(&drm-&gt...
2020 Aug 21
0
[PATCH 2/3] drm/nouveau: move io_reserve_lru handling into the driver v4
...= ttm_bo_vm_open, + .close = ttm_bo_vm_close, + .access = ttm_bo_vm_access +}; + int nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *file_priv = filp->private_data; struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); + int ret; - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + if (ret) + return ret; + + vma->vm_ops = &nouveau_ttm_vm_ops; + return 0; } static int @@ -173,7 +211,6 @@ nouveau_ttm_init_vram(struct nouveau_drm *drm) } man->func = &nouveau_vra...
2019 Oct 09
0
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver
...ccess = ttm_bo_vm_access > +}; > + > int > nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) > { > struct drm_file *file_priv = filp->private_data; > struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); > + int ret; > > - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); > + if (ret) > + return ret; > + > + vma->vm_ops = &nouveau_ttm_vm_ops; > + return 0; > } > > static int > @@ -272,6 +310,9 @@ nouveau_ttm_init(struct nouveau_drm *d...
2019 Sep 30
3
[PATCH 1/2] drm/nouveau: move io_reserve_lru handling into the driver
...= ttm_bo_vm_open, + .close = ttm_bo_vm_close, + .access = ttm_bo_vm_access +}; + int nouveau_ttm_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *file_priv = filp->private_data; struct nouveau_drm *drm = nouveau_drm(file_priv->minor->dev); + int ret; - return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + ret = ttm_bo_mmap(filp, vma, &drm->ttm.bdev); + if (ret) + return ret; + + vma->vm_ops = &nouveau_ttm_vm_ops; + return 0; } static int @@ -272,6 +310,9 @@ nouveau_ttm_init(struct nouveau_drm *drm) return ret; } + mutex_init(&drm-&gt...
2018 Mar 10
0
[RFC PATCH 13/13] drm/nouveau: HACK FOR HMM AREA
...ely(vma->vm_pgoff < DRM_FILE_PAGE_OFFSET)) return drm_legacy_mmap(filp, vma); + /* Hack for HMM */ + if (vma->vm_pgoff < (DRM_FILE_PAGE_OFFSET + (4UL << 30))) { + struct nouveau_cli *cli = file_priv->driver_priv; + + return nouveau_vmm_hmm(cli, filp, vma); + } + return ttm_bo_mmap(filp, vma, &drm->ttm.bdev); } @@ -305,7 +312,7 @@ nouveau_ttm_init(struct nouveau_drm *drm) drm->ttm.bo_global_ref.ref.object, &nouveau_bo_driver, dev->anon_inode->i_mapping, - DRM_FILE_PAGE_OFFSET, + DRM_FILE_PAGE_OFFSET + (4UL << 30),...
2019 Feb 07
0
[PATCH 0/5] Clean up TTM mmap offsets
...mmap-able BOs. > > Thomas Zimmermann (5): > staging/vboxvideo: Use same BO mmap offset as other drivers > drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant > drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init() > drm/ttm: Quick-test mmap offset in ttm_bo_mmap() > drm: Use the same mmap-range offset and size for GEM and TTM Reviewed-by: Christian K?nig <christian.koenig at amd.com> for the whole series. Nice cleanup! Thanks, Christian. > > drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c | 12 ++---------- > drivers/gpu/drm/ast/ast...
2019 Feb 15
0
[PATCH 0/5] Clean up TTM mmap offsets
...mmap-able BOs. > > Thomas Zimmermann (5): > staging/vboxvideo: Use same BO mmap offset as other drivers > drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant > drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init() > drm/ttm: Quick-test mmap offset in ttm_bo_mmap() > drm: Use the same mmap-range offset and size for GEM and TTM The first patch looks good to me: Reviewed-by: Hans de Goede <hdegoede at redhat.com> The vboxvideo bits in the other patches look good to me to: Acked-by: Hans de Goede <hdegoede at redhat.com> For the other pa...
2019 Mar 11
0
[PATCH 0/5] Clean up TTM mmap offsets
...mmap-able BOs. > > Thomas Zimmermann (5): > staging/vboxvideo: Use same BO mmap offset as other drivers > drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant > drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init() > drm/ttm: Quick-test mmap offset in ttm_bo_mmap() > drm: Use the same mmap-range offset and size for GEM and TTM Note I'm about to push a patch-series to drm-misc-next which moves vboxvideo out of staging and I see that this series has not landed in drm-misc-next yet, so it will needs to be rebased. Regards, Hans
2019 Mar 11
0
[PATCH 0/5] Clean up TTM mmap offsets
...Zimmermann (5): >>> ?? staging/vboxvideo: Use same BO mmap offset as other drivers >>> ?? drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant >>> ?? drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init() >>> ?? drm/ttm: Quick-test mmap offset in ttm_bo_mmap() >>> ?? drm: Use the same mmap-range offset and size for GEM and TTM >> >> Note I'm about to push a patch-series to drm-misc-next which moves >> vboxvideo out of staging and I see that this series has not landed >> in drm-misc-next yet, so it will needs to be r...
2019 Mar 11
0
[PATCH 0/5] Clean up TTM mmap offsets
...ann (5): > > > ?? staging/vboxvideo: Use same BO mmap offset as other drivers > > > ?? drm/ttm: Define a single DRM_FILE_PAGE_OFFSET constant > > > ?? drm/ttm: Remove file_page_offset parameter from ttm_bo_device_init() > > > ?? drm/ttm: Quick-test mmap offset in ttm_bo_mmap() > > > ?? drm: Use the same mmap-range offset and size for GEM and TTM > > > > Note I'm about to push a patch-series to drm-misc-next which moves > > vboxvideo out of staging and I see that this series has not landed > > in drm-misc-next yet, so it will needs...
2019 Oct 17
0
[PATCH 2/5] drm/qxl: switch qxl to &drm_gem_object_funcs.mmap
..._private; - - if (qdev == NULL) { - DRM_ERROR( - "filp->private_data->minor->dev->dev_private == NULL\n"); - return -EINVAL; - } - DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", - filp->private_data, vma->vm_pgoff); - - return ttm_bo_mmap(filp, vma, &qdev->mman.bdev); -} - static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) { return 0; -- 2.18.1
2019 Aug 08
0
[PATCH v4 15/17] drm/qxl: switch qxl to drm_gem_object_funcs->mmap codepath
..._private; - - if (qdev == NULL) { - DRM_ERROR( - "filp->private_data->minor->dev->dev_private == NULL\n"); - return -EINVAL; - } - DRM_DEBUG_DRIVER("filp->private_data = 0x%p, vma->vm_pgoff = %lx\n", - filp->private_data, vma->vm_pgoff); - - return ttm_bo_mmap(filp, vma, &qdev->mman.bdev); -} - static int qxl_invalidate_caches(struct ttm_bo_device *bdev, uint32_t flags) { return 0; -- 2.18.1
2020 Aug 20
3
Moving LRU handling into Nouveau v2
Hi guys, I already tried this a few month ago, but since I don't have NVidia hardware its rather hard to test for me (need to get some ordered). Dave brought up the topic that we should probably try to move the handling into Nouveau once more, so I tried to fix the problem Ben reported and rebased on top of current drm-misc-next. Dave can you test this? At least in theory the approach
2018 Apr 15
0
[RFC] Rewrite page fault interception in TTM drivers
...{ + .fault = qxl_ttm_fault, + .open = ttm_bo_vm_open, + .close = ttm_bo_vm_close, + .access = ttm_bo_vm_access, +}; + int qxl_mmap(struct file *filp, struct vm_area_struct *vma) { struct drm_file *file_priv; @@ -139,11 +141,6 @@ int qxl_mmap(struct file *filp, struct vm_area_struct *vma) r = ttm_bo_mmap(filp, vma, &qdev->mman.bdev); if (unlikely(r != 0)) return r; - if (unlikely(ttm_vm_ops == NULL)) { - ttm_vm_ops = vma->vm_ops; - qxl_ttm_vm_ops = *ttm_vm_ops; - qxl_ttm_vm_ops.fault = &qxl_ttm_fault; - } vma->vm_ops = &qxl_ttm_vm_ops; return 0; } diff --git a/driv...
2010 Jun 14
0
NV30 (FX 5200 Ultra) OUT_RINGp and initial four GEM objects are mapped to the GART instead of System RAM - is that proper?
...ends up in nouveau_pushbuf_init_call, invokes the DRM_NOUVEAU_GEM_PUSHBUF ioctl. Then sets up four bo objects doing four DRM_NOUVEAU_GEM_NEW ioctls. Then nouveau_pushbuf_space picks the second (not the first), of those allocated objects and mmaps it. That triggers the kernel 'ttm_bo_mmap' function which happily sets up the proper VMA. 4). Then 'NVAccelCommonInit' is called which ends up calling 'NVAccelInitContextSurfaces' function that tries to write to the second of the above mentioned objects. That triggers the ttm_bo_vm_fault which:...