diff options
| author | Gerd Hoffmann <[email protected]> | 2020-09-07 11:24:25 +0000 |
|---|---|---|
| committer | Gerd Hoffmann <[email protected]> | 2020-09-09 05:58:56 +0000 |
| commit | 707d561f77b5e2a6f90c9786bee44ee7a8dedc7e (patch) | |
| tree | 0d61c5038b1f4e8d9f5c0640b7349058600cb9d7 /drivers/gpu/drm/tegra/gem.c | |
| parent | drm/ttm: drop the tt backend function paths. (diff) | |
| download | kernel-707d561f77b5e2a6f90c9786bee44ee7a8dedc7e.tar.gz kernel-707d561f77b5e2a6f90c9786bee44ee7a8dedc7e.zip | |
drm: allow limiting the scatter list size.
Add drm_device argument to drm_prime_pages_to_sg(), so we can
call dma_max_mapping_size() to figure the segment size limit
and call into __sg_alloc_table_from_pages() with the correct
limit.
This fixes virtio-gpu with sev. Possibly it'll fix other bugs
too given that drm seems to totaly ignore segment size limits
so far ...
v2: place max_segment in drm driver not gem object.
v3: move max_segment next to the other gem fields.
v4: just use dma_max_mapping_size().
Signed-off-by: Gerd Hoffmann <[email protected]>
Reviewed-by: Daniel Vetter <[email protected]>
Link: http://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/tegra/gem.c')
| -rw-r--r-- | drivers/gpu/drm/tegra/gem.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c index 723df142a981..47e2935b8c68 100644 --- a/drivers/gpu/drm/tegra/gem.c +++ b/drivers/gpu/drm/tegra/gem.c @@ -284,7 +284,7 @@ static int tegra_bo_get_pages(struct drm_device *drm, struct tegra_bo *bo) bo->num_pages = bo->gem.size >> PAGE_SHIFT; - bo->sgt = drm_prime_pages_to_sg(bo->pages, bo->num_pages); + bo->sgt = drm_prime_pages_to_sg(bo->gem.dev, bo->pages, bo->num_pages); if (IS_ERR(bo->sgt)) { err = PTR_ERR(bo->sgt); goto put_pages; |
