Skip to content

Commit 5117c36

Browse files
committed
Merge tag 'drm-misc-fixes-2020-03-26' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
drm-misc-fixes for v5.6: - SG fixes for prime, radeon and amdgpu. Signed-off-by: Dave Airlie <[email protected]> From: Maarten Lankhorst <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
2 parents 16fbf79 + 47f7826 commit 5117c36

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

drivers/gpu/drm/amd/amdgpu/amdgpu_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -974,7 +974,7 @@ static int amdgpu_ttm_tt_pin_userptr(struct ttm_tt *ttm)
974974
/* Map SG to device */
975975
r = -ENOMEM;
976976
nents = dma_map_sg(adev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
977-
if (nents != ttm->sg->nents)
977+
if (nents == 0)
978978
goto release_sg;
979979

980980
/* convert SG to linear array of pages and dma addresses */

drivers/gpu/drm/drm_prime.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -967,7 +967,7 @@ int drm_prime_sg_to_page_addr_arrays(struct sg_table *sgt, struct page **pages,
967967

968968
index = 0;
969969
for_each_sg(sgt->sgl, sg, sgt->nents, count) {
970-
len = sg->length;
970+
len = sg_dma_len(sg);
971971
page = sg_page(sg);
972972
addr = sg_dma_address(sg);
973973

drivers/gpu/drm/radeon/radeon_ttm.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -528,7 +528,7 @@ static int radeon_ttm_tt_pin_userptr(struct ttm_tt *ttm)
528528

529529
r = -ENOMEM;
530530
nents = dma_map_sg(rdev->dev, ttm->sg->sgl, ttm->sg->nents, direction);
531-
if (nents != ttm->sg->nents)
531+
if (nents == 0)
532532
goto release_sg;
533533

534534
drm_prime_sg_to_page_addr_arrays(ttm->sg, ttm->pages,

0 commit comments

Comments
 (0)