drm/vmwgfx: Honor the sg list segment size limitation

When building sg tables, honor the device sg list segment size limitation.

Signed-off-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Deepak Rawat <drawat@vmware.com>
This commit is contained in:
Thomas Hellstrom 2019-06-04 13:54:26 +02:00
parent cc0ba0d862
commit bde15555ba
1 changed files with 5 additions and 5 deletions

View File

@ -441,11 +441,11 @@ static int vmw_ttm_map_dma(struct vmw_ttm_tt *vmw_tt)
if (unlikely(ret != 0)) if (unlikely(ret != 0))
return ret; return ret;
ret = sg_alloc_table_from_pages(&vmw_tt->sgt, vsgt->pages, ret = __sg_alloc_table_from_pages
vsgt->num_pages, 0, (&vmw_tt->sgt, vsgt->pages, vsgt->num_pages, 0,
(unsigned long) (unsigned long) vsgt->num_pages << PAGE_SHIFT,
vsgt->num_pages << PAGE_SHIFT, dma_get_max_seg_size(dev_priv->dev->dev),
GFP_KERNEL); GFP_KERNEL);
if (unlikely(ret != 0)) if (unlikely(ret != 0))
goto out_sg_alloc_fail; goto out_sg_alloc_fail;