summaryrefslogtreecommitdiff
path: root/drivers/gpu/drm/drm_property.c
diff options
context:
space:
mode:
authorMarek Szyprowski <m.szyprowski@samsung.com>2020-03-27 17:21:26 +0100
committerAlex Deucher <alexander.deucher@amd.com>2020-04-05 10:44:12 -0400
commitc0f83d164fb8f3a2b7bc379a6c1e27d1123a9eab (patch)
treeb4a240c1160ac26cd189c80fb7215b200764c7bf /drivers/gpu/drm/drm_property.c
parentcc46c03397c1865a181f1a4f66d4645806e5a943 (diff)
drm/prime: fix extracting of the DMA addresses from a scatterlist
Scatterlist elements contains both pages and DMA addresses, but one should not assume 1:1 relation between them. The sg->length is the size of the physical memory chunk described by the sg->page, while sg_dma_len(sg) is the size of the DMA (IO virtual) chunk described by the sg_dma_address(sg). The proper way of extracting both: pages and DMA addresses of the whole buffer described by a scatterlist it to iterate independently over the sg->pages/sg->length and sg_dma_address(sg)/sg_dma_len(sg) entries. Fixes: 42e67b479eab ("drm/prime: use dma length macro when mapping sg") Signed-off-by: Marek Szyprowski <m.szyprowski@samsung.com> Reviewed-by: Alex Deucher <alexander.deucher@amd.com> Signed-off-by: Alex Deucher <alexander.deucher@amd.com> Link: https://patchwork.freedesktop.org/patch/msgid/20200327162126.29705-1-m.szyprowski@samsung.com Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers/gpu/drm/drm_property.c')
0 files changed, 0 insertions, 0 deletions