Skip to content

Commit 419d8a9

Browse files
committed
Merge tag 'drm-misc-fixes-2024-02-01' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
A quiet week: one fix for CMA dma-buf pages accounting, and one to virtio to set the segment size of the virtio_gpu device. Signed-off-by: Dave Airlie <airlied@redhat.com> From: Maxime Ripard <mripard@redhat.com> Link: https://patchwork.freedesktop.org/patch/msgid/obnofpccz73c3uiqfyipxmjta5fgm4cle55dmtnissgtgxfgv7@22o7kb62efri
2 parents 41bccc9 + 1c1914d commit 419d8a9

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

drivers/dma-buf/heaps/cma_heap.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,7 @@ static vm_fault_t cma_heap_vm_fault(struct vm_fault *vmf)
168168
if (vmf->pgoff > buffer->pagecount)
169169
return VM_FAULT_SIGBUS;
170170

171-
vmf->page = buffer->pages[vmf->pgoff];
172-
get_page(vmf->page);
173-
174-
return 0;
171+
return vmf_insert_pfn(vma, vmf->address, page_to_pfn(buffer->pages[vmf->pgoff]));
175172
}
176173

177174
static const struct vm_operations_struct dma_heap_vm_ops = {
@@ -185,6 +182,8 @@ static int cma_heap_mmap(struct dma_buf *dmabuf, struct vm_area_struct *vma)
185182
if ((vma->vm_flags & (VM_SHARED | VM_MAYSHARE)) == 0)
186183
return -EINVAL;
187184

185+
vm_flags_set(vma, VM_IO | VM_PFNMAP | VM_DONTEXPAND | VM_DONTDUMP);
186+
188187
vma->vm_ops = &dma_heap_vm_ops;
189188
vma->vm_private_data = buffer;
190189

drivers/gpu/drm/virtio/virtgpu_drv.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,7 @@ static int virtio_gpu_probe(struct virtio_device *vdev)
9494
goto err_free;
9595
}
9696

97+
dma_set_max_seg_size(dev->dev, dma_max_mapping_size(dev->dev) ?: UINT_MAX);
9798
ret = virtio_gpu_init(vdev, dev);
9899
if (ret)
99100
goto err_free;

0 commit comments

Comments
 (0)